David Duffy (AVD) wrote: > I have a design that uses a 16F88. The code is very similar to a few > other products but they use a 16F628A or 16F648A. > > I'm having problems with this one design where in the field the EE is > being erased. (I think) When I read the offending EE back (via MPLAB), > the data is FF instead of its usual 00 .. 07 range. > > I've gone over the code numerous times and checked the write sequence. I > can't even reproduce the fault back here. It can take days or months to > show up in the field. > > I don't know if more than one location is being erased as I'm only > storing and reading one byte. (the first one) Has anyone come across > this before? > David... > > David, this is pretty common in the "nanowatt" series of PICs. This is caused by weaknesses in the EEPROM manufactrung process. It turns out that, unlike the older PIC16C/18C, there are now severe limitations on the number of times the EEPROM cell can be read before being refreshed. Unfortunately, frequent refreshes reduce the useful lifetime of the EEPROM cell. My solution is to write critical values 3-5 times, then read with a "best 3 of 5" algorithm. The idea is that if all 5 match, use the first value found, but if any of the 5 are different, rewrite all 5, using the value that at least 3 of the 5 match, before proceeding. This limits over-refreshing, and only refreshes the cells that NEED to be refreshed. --Bob -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist