
Knowledge check · self-test
Check: Shared-bus reliability
Test your understanding.
## Check I²C Arbitration {#i2c-knowledge-check .depth-l2}
::: {.callout-tip collapse="false"}
## Check I²C Arbitration {.depth-l2}
**Scenario:** You're designing a robotics platform with two microcontrollers (ESP32 and Arduino) that both need to control a shared OLED display (I2C address 0x3C) and BME280 sensor (0x76). Both MCUs operate as I2C masters on the same bus with 4.7k pull-ups.
**Think about:**
1. What happens if both masters try to send a START condition simultaneously?
2. Why doesn't this cause electrical damage to the devices?
**Key Insight:** I2C uses **wired-AND arbitration** through open-drain outputs. When multiple masters transmit simultaneously, any device pulling SDA LOW wins (LOW overrides HIGH). During arbitration, masters compare transmitted bits to actual bus state:
- Master transmits 1 (releases line HIGH)
- Bus reads 0 (another master pulled LOW)
- First master detects mismatch → backs off gracefully
- No electrical conflict because open-drain outputs never drive HIGH (only pull LOW or float)
This mechanism avoids the direct high-versus-low driver contention that push-pull outputs could cause if wired together incorrectly. The trade-off is that RC charging through pull-up resistors limits rise time. Standard-mode I2C reaches 100 kHz and Fast-mode reaches 400 kHz; supported devices and bus conditions can also permit Fast-mode Plus at 1 MHz or High-speed mode at 3.4 MHz. SPI's push-pull lines commonly run at tens of MHz.
**Verify Your Understanding:**
- Check rise time, not arbitration delay: with 400 pF bus capacitance and 4.7 kΩ pull-ups, the 30%-to-70% rise time is 0.8473 × 4,700 Ω × 400 pF = 1.59 µs. This exceeds Standard-mode's 1.0 µs limit and Fast-mode's 0.30 µs limit. Even 2.2 kΩ gives 0.746 µs at 400 pF, still too slow for Fast-mode; reduce capacitance or choose a pull-up within the device's sink-current limit.
- Smaller pull-ups give faster rise times, but no fixed resistor works for every bus. At 100 pF, 10 kΩ gives 0.847 µs and meets the Standard-mode rise-time limit; at the same load, 2.2 kΩ gives 0.186 µs and meets Fast-mode's limit if the connected devices can sink the resulting current.
:::
::: {.callout-tip}
##

Checkpoint: Pull-Up Window {.depth-l0}
You now know:
- Pull-ups are a range, not a default copied blindly from a breakout board.
- For the worked 3.3 V, 53 pF, 400 kHz example, the safe window is about 967 ohm to 6.68 kohm, which explains why 4.7 kohm is usually comfortable.
- When the bus gets longer or gains devices, check the rise-time budget before changing firmware delays or sensor libraries.
:::
Back to I2C: Bring-Up and Diagnosis: Keep a Release Record and Choose the Boundary