Bob Axtell wrote: > 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. > I wasn't aware of this problem until now. It's odd that I've never encountered this with the 16F628A / 648A devices. I'll have to check more carefully, but I don't think the read/write ratio of the EE cell concerned is all that high. Maybe < 10 reads between every 1 write to the same cell at a guess. For now I've done away with the EE, and will just read / write the current status to RAM. It doesn't change very often - maybe only a few times each day. The main reason the EE was used was to persist the unit's status if it was power cycled, but this shouldn't happen very often anyway. I have now coded it so that it defaults back to the "closed mode" (it's a window controller) upon power-up to lessen security issues. I will try a different EE cell on a spare unit, and try to leave that running for as long as I can (weeks / months) so see what happens. David... -- ___________________________________________ David Duffy Audio Visual Devices P/L Unit 8, 10 Hook St, Capalaba 4157 Australia Ph: +61 7 38235717 Fax: +61 7 38234717 Our Web Site: www.audiovisualdevices.com.au ___________________________________________ -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist