Comments are embedded. ;-) ----- Original Message ----- From: "Mohit Mahajan" To: Sent: Friday, February 22, 2002 6:08 AM Subject: EEPROM <-> PIC > 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.). Sounds like a big project. > 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: Don't be so sure yet, you may be quite suprised by how much "code" will fit in 8K, even when using C. (just try to avoid using printf to conserve memory) > 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? The short answer is "sort of", but it really wouldn't be at all practical. I suppose that you could contrive some kind of swap system, whereby you utilize the self-programming ability of the chip to reprogram itself. Most likely, you would cause the flash ROM in the PIC to fail from all the changes. IOW, the long answer is "no". > 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). Sounds like you're controling a fish tank. > 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. You might wish to consider using another processor if you really think you will need that much code memory. The 8052 (and kin) is a fairly capable CPU available in a wide variety of configurations. Variations include built in RTC, dual serial ports, large internal flash ROM(64k), fast clock speeds that will beat the pants off a PIC, A/D, D/A, PWM, and anything else you can think of. Look at this: http://dbserv.maxim-ic.com/quick_view2.cfm?qv_pk=2963 The down side of these processors is when using external memory, you lose 16 ports (not 'strictly' true) > Peace, > Mohit Mahajan. Hope that helps some. ;-) michael brown -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.