On Fri, Feb 22, 2002 at 05:38:57PM +0530, Mohit Mahajan wrote: > Hi, > > I'm new to PIC. I am planning to implement a control system using PIC16F877. > I'll be using a keypad, LCD, almost all I/O pins (to input the control > variables, operate four switches, PWM etc.). > > The code for all this is going to be large, no doubt. A PIC expert could > optimise it to fit in the 8K ROM of the PIC, but as I'm a novice I'm not > sure I'll be able to do so. In any case, since I'll either use JAL or a > C-compiler, the code will be more than 8K. So now my question is: > > Can we interface an EEPROM [specifically: 24LC256, 32Kbyte Flash EEPROM > (I2C)] to the PIC in such a way that the firmware code can be written in the > EEPROM, from where the PIC can fetch it in packets and run it? Not with the standard midrange PICs. The 17C (and 18C series I think) have such a microcontroller mode. But I think you may be making a faulty/hasty assumption by presuming that the code won't fit. Being a novice you simply don't have enough expertise to make that presumption. Nothing that you listed above consumes a significant amount of code. The only variable is your application code computation. So why not simply get the project started and see how far you get. I have a sunrise/sunset controller with display, knob/pushbutton interface, timer code, calandar, sunrise/sunset interpolation, and relay control interface. It takes barely 600 bytes of assembly. Even at 3x code bloat by switching to an High Level Language, that's less than 2K. > > It doesn't matter to my application if the effective operating speed > decreases, because I'll be controlling pH, temperature, dissolved oxygen > (all these take few minutes to adjust). > > If no, and the firmware is greater than 8K, then what should I do? Is there > anything available with Microchip that has a larger (flash) ROM and as many > I/O as the PIC 16F877? I've read about PIC18F242, but it still isn't out in > the market. Simple. Split the tasks between two PICs. It effectively doubles your code space and I/O space. Use the USART for the two parts to communication to one another. But frankly I think you're overanalyzing the problem. 8192 instructions will take you a lot further than you think. BAJ -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.