eeprom wear leveling

Coding and general discussion relating to user created compiler modules

Moderators: David Barker, Jerry Messina

Post Reply
User avatar
rocketbob
Registered User
Registered User
Posts: 51
Joined: Sun Apr 01, 2007 1:36 am
Location: Indiana USA

eeprom wear leveling

Post by rocketbob » Mon Feb 25, 2008 10:57 pm

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

User avatar
Steven
BETA Tester
Posts: 406
Joined: Tue Oct 03, 2006 8:32 pm
Location: Cumbria, UK

Post by Steven » Tue Feb 26, 2008 7:07 am

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?

User avatar
rocketbob
Registered User
Registered User
Posts: 51
Joined: Sun Apr 01, 2007 1:36 am
Location: Indiana USA

Post by rocketbob » Tue Feb 26, 2008 12:25 pm

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

Post Reply