Continuous data write in serial eeprom using I2C

I am trying to write the routine to store the char, int, float datas in the serial eeprom 24FC512 and read back the written values using random read method.

My problem is sometimes only the data is written properly and read back corretly.

I dont know what is the reason behind the wrong writing and reading.

But my I2C_Read, I2C_Write, I2C_Start,I2C_Stop works well with my RTC DS1307.

Idont know why the problem is coming with EEPROM?

Can anybody give me a suggestion?

Parents
  • I'd guess that you are not waiting for the EEPROM write to complete. This delay is specified in the EEPROM's datasheet, but just to give you an idea, it's typically ~5ms. It is usually the STOP condition that initiates the write, after which you must either delay the worst case write time, or loop reading from the device until it ACKs. It's all described in the EEPROM datasheet, of course.

Reply
  • I'd guess that you are not waiting for the EEPROM write to complete. This delay is specified in the EEPROM's datasheet, but just to give you an idea, it's typically ~5ms. It is usually the STOP condition that initiates the write, after which you must either delay the worst case write time, or loop reading from the device until it ACKs. It's all described in the EEPROM datasheet, of course.

Children
More questions in this forum