EEPROM Questions

Hi all,

I'm curious on possibly making a fail safe function in my code to basically backup a variable to two locations of EEPROM and also recognizing if the first one goes bad to switch to the second. Obviously EEPROM has quite a life to it (100,000 reads and writes with extended life using EEPROM.update).

I guess my main question would be does the following make sense?

if (!EEPROM.read(x)){
//do stuff
}

I guess my main question would be does the following make sense?

No. Comparing to a specific value would, but that test does not.

EEPROM has a guaranteed life of 100000 writes, with unlimited reads.

PaulS:
No. Comparing to a specific value would, but that test does not.

EEPROM has a guaranteed life of 100000 writes, with unlimited reads.

Okay, Easy enough. I was under the impression that reading EEPROM reduces the life of it as well.

Thanks,

  • B

Blade2021:
I was under the impression that reading EEPROM reduces the life of it as well.

No. EEPROM reads are nearly free. They do not cause any wear and they are almost as fast as reading from SRAM.