Pitfalls of I2C communication

This post describes a bug I experienced in I2C communication that I fell into.

As shown in the figure below, memory ABC1 and memory ABC2 were connected via I2C communication, and the Write Read (read immediately after write execution) command was executed. As a result, the communication was successful for ABC1, but not for ABC2. The reason is that there was a difference in Min time in tBUF (Time the bus must be free before a new transmission can begin).

ABC1 tBUF = 1.2μs
ABC2 tBUF = 4.7μs

As a countermeasure for this case, wait 5μs after Write execution before executing Read.

tBUF time for I2C-bus specification and user manual UM10204

Fast-mode Plus


The root cause is that we assumed that because Standard-mode ABC1 is 1.2μs, ABC2 is also 1.2μs without checking the standard and Datasheet. I recommend that everyone check the Datasheet specifications carefully and not assume, as I did, that I2C communication is the same. It is also recommended to use clock stretching if the MCU and HAL support it.

OSS-ECAL English
error: Content is protected !!