Undefined conditions on the I2C-bus

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Undefined conditions on the I2C-bus

29 Views
takanie1967
Contributor I

In the Section 3.1.8 of the UM10204 (I2C-bus specification and user manual(Rev7.0)),

it is written that the undefined conditions occur on the I2C-bus.

If these occur, can all masters on the bus notice about it?

( If they can't notice, they can't know that data transfers on the bus are not correct. )

 

0 Kudos
Reply
1 Reply

9 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi,

In general, not all masters may be able to detect an undefined condition directly, especially if they are not actively participating in the communication at that moment (i.e. they are idle while another master is using the bus). However, here are a few mechanisms that can help some masters become aware of these situations:

1. Bus Monitoring and Arbitration
When multiple masters are present on an I2C bus, they rely on bus arbitration (by monitoring the SDA and SCL lines) to determine if the bus is free or if another master is already transmitting data. If a master is transmitting but encounters an undefined condition (e.g., SDA stuck low, incorrect acknowledgment), it can detect the failure and abort the transmission. In this case, the master initiating the communication should be able to detect a problem and then take corrective actions like issuing a stop condition or resetting the bus.

2. Clock Stretching (SCL Held Low)
If the bus gets stuck, such as SCL being held low (a form of clock stretching), masters that attempt to take control of the bus will notice this, because they will be unable to initiate their communication. This situation can serve as an indirect indication that something has gone wrong, allowing the master to attempt recovery (e.g. resetting the bus or retrying communication after a timeout).

3. Timeout Mechanisms in Masters
Some I2C masters have built-in timeout mechanisms where if they do not see expected signals (like acknowledgment or the next clock cycle) within a certain time, they can assume there is an issue on the bus. Masters using this mechanism can stop their current operation and potentially signal an error condition, but it is only based on the master’s own activity and perspective. They cannot actively monitor if the bus is malfunctioning unless they are trying to transmit or receive.

In summary, while the master that is currently using the bus will likely notice an undefined condition due to a failure to complete the expected communication sequence (acknowledgments, clocking, etc.), other masters may not notice immediately unless they try to take control of the bus and experience errors like clock stretching or bus being held in a faulty state. To ensure reliable operation, many systems implement bus error handling and recovery mechanisms that allow masters to detect and recover from undefined conditions, even if they were not the ones that caused the problem. However, not all I2C implementations provide universal detection of undefined states across all masters.

BRs, Tomas

0 Kudos
Reply