Distributing wear on EEPROM writes?
2005-06-09 by David Kelly
The classic example of what I'm thinking is an electronic odometer on a car. One must write periodically to nonvolatile memory such as EEPROM but limited to something like 10,000 erase/write cycles to represent 1,000,000.0 miles. Have heard mention of it somewhere before but can't find/derive a solution this morning where rather than represent every 0.1 to 1E6 in 24 bits that writes be distributed over something like 128 bits. More like counting days with a tally on a prison wall, only toggle one bit per unit. Set all the bits from one end to another than start back at the beginning and clear. The problem with writing my raw count to EEPROM is that to increment from 0 to 1 is only one bit toggle, but 1 to 2 is one on one off, 3 is only one on, 4 is one on two off. Wasteful of EEPROM wear. Another thought is to use Hamming codes and write multiple copies. The AVR has way more EEPROM than I really need as I have only about 20 bytes total of parameters, plus need for a summing register. -- David Kelly N4HHE, dkelly@HiWAAY.net ======================================================================== Whom computers would destroy, they must first drive mad.