fr #1 'I want to store an odometer value in an EEPROM and avoid writing too often reducing wear.'
How often is the bike actually storing data and what is the expected memory storage lifetime?
IMO I think this is being over thought. (although an interesting thought project)
AT24C series are less than ~1 USD ea
Even with the aggressive lifetime suggestion of 10,000 hrs see link below, that's an awful load of sore saddle time. My 0.02 worth. . . .
We had a write duration discussion six months ago. Did you catch this?
10 hrs/day page write usage equivalent of three years lifetime.
This is an easy to use chip AT24C
From this page http://www.espruino.com/AT24 I understand you can write whatever number of bytes to an EEPROM.
What I understood about EEPROMs that before writing a certain area (page) needs to be erased first (resulting in all FF) before it is written.
But what happens if I write only a byte?
The reason for my question is this: I want to store an odometer value in an EEPROM and avoid writing too often reducing wear.
What I know from the automotive world is that they are using a certain area all set to FF and (redundantly) clearing single bits in a certain pattern without erasing anything.
Is it possible with Espruino to do the same:
a) Erase a certain EEPROM area (set it to all FF) only once during initialization.
b) Later during lifetime only write single bytes in a way that only zero bits are cleared without doing an erase again?