> Tony, you can probably write initialization data in assembly that clears > the EEPROM. When it matters for me, then I put a checksum in the EEPROM. > The runtime code checks this and initializes the EEPROM if it is not OK. > So I just set a garbage checksum in the assembly code and the chip takes > it from there. Obviously I do not expect new chips to have garbage in the > EEPROM, nor do I check for it (but I set the bad checksum as above). I've found it useful to also include a version byte in addition to a checksum. Suppose version 1 and 2 of the firmware used the same number of EEPROM bytes but the fields were interpreted differently and required different values. Now suppose the EEPROM was written with version 1, then it got programmed with firmware version 2. Because the same number of bytes are used (and checksummed), the checksum will match although the data is garbage for firmware version 2. I use an EEPROM version byte that is incremented by 1 whenever the meaning of the EEPROM data changes. The EEPROM is only considered valid when the checksum checks and the version is what is expected by the firmware. ******************************************************************** Olin Lathrop, embedded systems consultant in Littleton Massachusetts (978) 742-9014, olin@embedinc.com, http://www.embedinc.com -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu