cancel
Showing results for 
Search instead for 
Did you mean: 

hal library and eeprom

Posted on May 02, 2017 at 15:05

After having sent a buffer to my eeprom using the i2c bus, I wait 20 ms in order to wait till the data are stored in the eeprom.

Can someone suggest me a way to poll the i2c bus to know when all the data are stored?
2 REPLIES 2
AvaTar
Lead
Posted on May 02, 2017 at 15:58

Read the datasheet of your undisclosed external EEPROM.

It might have a Busy-Flag in a status register, which tells you if an operation is ongoing. Or the document describes another way detecting the operational status.

S.Ma
Principal
Posted on May 02, 2017 at 16:41

Usually, while the write is in progress, trying to read data from eeprom will fail as the slave device will nack: You will be reading 0xFF... 

Poll every 1 msec trying to read data until it is successful then exit the loop. You'll probably want to check if the writing was successful...