cancel
Showing results for 
Search instead for 
Did you mean: 

Question about HAL_I2C_Mem_Write for accessing I2C EEPROM

Strooom
Associate III

Most I2C EEPROM (eg M24M01E) need some time after a write command to transfer the written data into the internal EEPROM. During that time (eg max 3.5 ms) the device does not respond to I2C.

My question is about the timeOut parameter in the HAL_I2C_Mem_Write (and other HAL_I2C_Mem_xxxx) :

Is this timeOut intended or suited to deal with this unavailability of the device after a write operation ? 

If I want to do 2 write operations (and I do not insert a delay between both HAL calls myself), will the second call automatically retry until timeOut, and so if I set timeOut to 4 ms, I could in the application simply ignore the needed delay after a write operation.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Pavel A.
Evangelist III
3 REPLIES 3
Pavel A.
Evangelist III

Yes.

 

AScha.3
Chief II

If you know, to write 2 or more bytes, you should not use "byte write", but page write, to do it in one access:

AScha3_0-1712432984588.png

-> less stress to the eeprom and to you (about timing) .

If you feel a post has answered your question, please click "Accept as Solution".

Thank you.  Of course I combine writes to consecutive addresses into page-writes, but when this address range spans several pages, I have to split it into multiple page writes.