Special I2C Features
I2C includes several features that make the protocol flexible in multi-device systems.
Clock stretching
Clock stretching allows a target device to slow down the controller.
If the target needs more time to process data, it can hold SCL LOW after a clock pulse. The controller must wait until SCL is released before continuing.
Clock stretching is useful when a slower target cannot immediately send or receive the next bit. Not all controllers support clock stretching equally, so this should be checked when selecting devices.
Arbitration
Arbitration is used in a multi-controller system when two controllers try to use the bus at the same time.
Because I2C uses open-drain signaling, a LOW bit dominates a HIGH bit. During arbitration, each controller monitors SDA while transmitting.
If a controller releases SDA expecting HIGH but reads LOW, it means another controller is transmitting a dominant LOW. The controller that detects this loses arbitration and stops transmitting.
The winning controller continues without corrupting the message.
Multi-controller support
I2C allows more than one controller on the same bus. Multi-controller systems require:
- Arbitration
- Clock synchronization
- Careful firmware coordination
- Proper handling of busy bus conditions
Most simple embedded systems use a single controller, but multi-controller support is part of the protocol.
Clock synchronization
In a multi-controller system, more than one controller may try to generate SCL. Since SCL is also open-drain, the LOW period can be extended by any controller holding SCL LOW. The bus clock is synchronized based on the actual SCL line level.
Bus busy condition
The bus is busy after a START condition and remains busy until a STOP condition is detected. A controller should check that both SDA and SCL are HIGH before starting a new transaction.
Bus recovery
Sometimes an I2C bus can become stuck if a target holds SDA LOW, often because a transaction was interrupted. A common recovery method is to toggle SCL several times so the target can finish shifting out data, then generate a STOP condition.
The exact recovery sequence depends on the controller and system design.
I2C Protocol