Page 1 of 1

eeprom wear leveling

Posted: Mon Feb 25, 2008 10:57 pm
by rocketbob
I need to write an often-changing value to internal eeprom, and am going to reserve a block of eeprom for this word variable. Lets say the block is 64 bytes. It would be easy to keep a ram pointer to the latest address but I need to be able to know the last pointer address at powerup. Basically looking for ideas on how to implement this.

Regards,
Bob

Posted: Tue Feb 26, 2008 7:07 am
by Steven
Could you also store a known byte, e.g. $FF, that would not be valid for value, in the EEPROM address just before the one that contains your value. Then on power up, scan for this byte and then take the value in the following byte?

Posted: Tue Feb 26, 2008 12:25 pm
by rocketbob
I think that would work fine. I thought of the same thing about five minutes before I checked back in here.

The other dillemma I have is how to insure that a write completes properly. I think some sort of checksum would be appropriate. Or maybe writing the same value to two successive locations and comparing the two when reading.

Regards,
Bob