Wear leveling of EEPROM at bit level

Suppose I want to do wear leveling on EEPROM, and the values I store in EEPROM are boolean, so I want to store each value in 1 bit. If I update a byte of EEPROM from B10001101 to B10001100 am I

  1. wearing on all bits for that byte in the EEPROM, or
  2. wearing on all of the bytes that were set to 0 because the entire byte is reset to B11111111 in preparation for clearing the 0's in the appropriate places, or
  3. are the operations within the chip smart enough to just clear that one low order bit to 0 and therefore just wear on 1 bit?

If I write B11111111 in a byte of EEPROM that is already set to B11111111, does that cause wear?

EEPROM is usually written at "page" level, where a "page" is, for example 256 bytes. So writing any value, 1 or 0, to any bit of any byte in that page causes the whole page to be re-written, increasing its wear. However, if you are writing to the EEPROM using a library function of some kind, it might spot that you have not actually changed anything and not perform the write, so no wearing occurrs.

What kind of EEPROM are you referring to? The built-in EEPROM of an AVR MCU chip, or an i2c or SPI EEPROM Chip?

Hi all
The EEPROM.update() function; it only writes when the data to be written is different from what is in the EEPROM at the same address.

I am concerned about the ATmega328P built-in EEPROM. So if we are wearing on a whole page, I would think writing to adjacent bytes to do wear leveling would not really work.

The Atmega328P does not have an EEPROM page buffer. Each byte is written one at a time

OK, so the main thing I'm wondering: if I update a byte using the EEPROM.update function, and in that byte all I am doing is zeroing out one bit compared to the way the byte was previously written at that memory location, does that cause wear on the whole byte, or on the bits that were previously 0, or just on the bit that I'm changing to 0.

Wear leveling is on the byte level. Writing/erasing just one bit in a byte will worn out the whole byte.

Have a look at using external FRAM instead

Here

Thanks for the responses and ideas.