Pitfalls of I2C communication

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

As shown in the figure below, we connected memory ABC1 and memory ABC2 via I2C communication and executed a process that reads immediately after write execution.As a result, ABC1 communicated normally, but ABC2 did not communicate well.The cause was that there was a difference in the Min time of 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

Standard-mode
Fast-mode
Fast-mode Plus

4.7μs
1.3μs
0.5μs

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 !!