Matthew Rhys-Roberts wrote: > Will someone correct me if I'm wrong about this? > > As far as I can tell, writing (i.e. erase-writing) to any PIC EEPROM > address will disrupt the stored charge in neighboring memory cells. > Eventually, if written enough times, EEPROM data corruption may result. > Microchip recommend using an EEPROM refresh routine periodically, in > cases where erase-write cycles are likely to approach 1- to 10-million > times ("specification D124"). > > I'm only asking so I can make a sensible choice between EEPROM and Flash > program memory, for storing some infrequently changed non-volatile > constants. > > Thanks > > Matt > During a lengthy test three years ago, I noticed those failures, too. Microchip's approach of overwriting the entire array seems a bit like owning an elephant to kill roaches in your parlor by stepping on them; its clumsy. A sleeker approach is to simply write the variable 3 times, rather than just once. When you read it back, read all three copies; if one doesn't match, then rewrite all three (using the two that match). In 3 years of use, I've not seen another failure. This concept is "best 2 of 3". I used "best 3 of 5" in a military application. BTW, in the Nanowatt series of PICs, it is strange to me that the program memory is more reliable than the EEPROM memory, but it _IS_. I have stored variables in the program memory of the PIC16F87 and '88, never had a single failure, and to do so took less code space than "best 2 of 3" EEPROM method. --Bob A -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist