I2C allows the Slave to pause the Master by holding the Clock (SCL) line
LOW. This is a unique feature of I2C compared to SPI or UART.
When is it used?
- ADC/Sensors: An ADC might need time to convert an analog signal before
it has the data ready to send. It holds SCL Low during the "Read" phase until the
conversion is done.
- Microcontrollers: If a Slave MCU receives a byte but hasn't cleared its
RX buffer interrupt yet, it holds SCL Low to prevent the Master from sending the next
byte.
The Mechanism
I2C is Open-Drain. The SCL line is the logical AND of all devices.
1. Master releases SCL (High) to generate a clock pulse.
2. But Slave pulls SCL Low.
3. Master reads SCL pin. It sees LOW.
4. Master enters a Wait State. It will not drive the next edge until SCL
naturally rises to High.
The Timeout Deadlock (Sempahore Lockup)
If a Slave crashes while holding SCL Low, the entire bus hangs. The Master waits
forever.
Recovery: Advanced Masters implement a hardware timer (e.g., 25ms). If
SCL stays Low too long, they reset the bus logic or toggle GPIOs to reset the Slave.