2024-04-06 03:46 AM
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.
Solved! Go to Solution.
2024-04-06 12:17 PM
2024-04-06 12:17 PM
Yes.
2024-04-06 12:50 PM
If you know, to write 2 or more bytes, you should not use "byte write", but page write, to do it in one access:
-> less stress to the eeprom and to you (about timing) .
2024-04-06 03:30 PM
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.