Electronic – Reading empty (new) AT24C16 I2C EEPROM – 0xFF or 0x00

eepromi2c

What byte vaule should I see when reading empty EEPROM chip via I2C?

Best Answer

The way an EEPROM works, the act of erasing sets every bit to 1. When you write to it the bits that shouldn't be 1 are set to 0. It's all to do with the movement of free electrons in the semiconductor layers.

Therefore, an erased 'empty' EEPROM will always read 0xFF for every memory address.

However, you cannot always guarantee the current state of an EEPROM when it arrives from the supplier / manufacturer. It may have had some data written to it in order to test it, and not erased afterwards. You'd expect a good manufacturer to always finish the testing with an erase, but this isn't something that can be 100% guaranteed.

Therefore, you should erase the EEPROM before first use.

If the EEPROM is to be used to store data that is generated by the system it is placed in, then you could have an 'identifying' byte in a known location - check to see if that byte is there, and if not erase the EEPROM and write the identifying byte. That way you don't have to worry about what state it is in when first inserted into the circuit.