EEPROM wearing
-
Hi there !
I was about to use saveState function, but I first aked myself about the wearing of the EEPROM.
It seems that the EEPROM has a life of about 100.000 writes.
So, if I do 100 writes per day (4 state change every hour), it takes 1000 days to write 100k times : about 3 years and the EEPROM may start failing.Do anyone use a wear-leveling trick ?
I've quickly searched for code over google, but hasn't tried anything yet.
-
@napo7 yup. I wrote an EEprom wear leveling library a while ago. Didn't publish it yet though...
I'll have a look if I can have it go public.
-
- you could use a circular buffer for this http://www.atmel.com/images/doc2526.pdf . I'm sure there are already libs for this.
- when it's not enough, it's maybe better to use a better mem,
- change strategy
-
Quick thought :
At least, if the old value is the same as the new value, don't write it !
I'm sure we can avoid a big amount of updates in case of the controller resend the same value...I did thought of a kind of circular buffer , but it's too late for my brain to find a working solution
Reading the atmel doc will surely be easier !
-
We're using eeprom_update_byte which only updates if the value differs.
-
Great !
Now I have to implement a circular buffer and the solution will be perfect !Edit : This reading is interresting : http://hackaday.com/2011/05/16/destroying-an-arduinos-eeprom/
The user did a test to wear out EEPROM, and did managed to get more than 1M writes before it started to fail !
Suggested Topics
-
Arduino Celebrates 10 years (Malmö/Sweden)
Announcements • 29 Mar 2014, 17:08 • hek 29 Mar 2014, 17:08 -
Counting Incoming and Outgoing Messages from a Gateway
Development • 10 Dec 2024, 21:57 • Trand 14 Dec 2024, 20:23 -
Saving last known good state, but not in EEPROM
Development • 30 Jan 2024, 18:46 • OldSurferDude 15 Jan 2025, 08:51 -
Home Assistant/MySensors quirks
Development • 12 days ago • OldSurferDude 12 days ago -
Sending offset to node
Development • 31 Jan 2025, 00:59 • bsl88k 4 Feb 2025, 12:14 -
PJON and Minicore not working
Development • 8 days ago • Trand 8 days ago