PDA

View Full Version : Reducing the number of writecycles on EEPROM



NavMicroSystems
- 2nd February 2005, 00:22
I'm working on a DataLogger Project.

The logger has 1Mbit of EEPROM on Board (2x24FC512)
and of course it has it's own RTC (DS1307).

The issue was to remember the last EEPROM address data was written to.
(even after a RESET or Power failure)

There are certainly several different approaches like:

- storing the last used address at a fixed location in EEPROM
(will wear out those memory cells pretty quickly)

- "scanning" the EEPROM before each write to find the next unused address
(will be time consuming)

etc.

Agreed,
using FRAM instead of EEPROM would be another option,
but having an RTC with 256 Bytes of NVRAM on Board
I found this is great to "memorize" the EEPROM address last used (and some other stuff).

Melanie
- 2nd February 2005, 09:46
If you Format/Erase your EEPROM to say all $FF, by simple Binary Division you'll be able to determine your last used location in 1Mb of EEPROM using about 20 reads or less. Since reading is near instantaneous and doesn't wear out the EEPROM, even with rubbish code you'll get your answer in under a millisecond.

NavMicroSystems
- 3rd February 2005, 01:08
Mel,

you are right,
but this would mean I have got to "Format" the EEPROM each time
after I have transfered the Loggers Data to some other system.
This means an additional write to every memory cell that was previously used.

By storing the "pointer" in the RTC's NVRAM I could double the lifetime of the EEPROM,
as I don't have to "clear" the memory, I just reset the pointer in NVRAM.

or am I missing something here ?

Melanie
- 3rd February 2005, 09:55
Be warned about RTC's NVRAM...

With many of them (the DS1307 is one in particular), it's only NV as long as there's some form of power on the chip... remove the main power AND remove the Battery Backup, AND IT WILL lose the contents of NVRAM.

The use of the letters 'NV' by manufacturers in their literature in some cases is contestable!

NavMicroSystems
- 3rd February 2005, 12:43
Originally posted by Melanie
Be warned about RTC's NVRAM...

...it's only NV as long as there's some form of power on the chip...

Melanie, thanks for pointing that out.

For the current application this shouldn't be much of a problem
as the RTC has a good lithium battery backup.
If the Power-Supply AND the backup would fail at the same time
the Device would need Maintenance anyway, as the RTC would have lost it's Time Setting.