1
\$\begingroup\$

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

\$\endgroup\$
4
\$\begingroup\$

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.

| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ A 1 byte signature has 1 chance in 256 of being accidentally correct. A better signature consists of 3 or 4 bytes. About bits being 1 upon erasure: that's a convention, it's not dictated by the technology. You can perfectly bake EEPROMs which erase to a low level. \$\endgroup\$ – stevenvh Jul 30 '11 at 14:35
4
\$\begingroup\$

An erased EEPROM normally reads as 0xFF, but it may also contain seemingly random data. We've had this often in microcontroller's Flash, which sometimes has code programmed in it for production testing. This may also be done with EEPROM. Start with erasing the device if you want to be sure.

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

Every eeprom I've ever encountered reads 0xff in its factory state.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.