</>EmbeddedInterview

How does I2C arbitration work with multiple controllers?

HardCommunication Protocols

Short answer: Every controller monitors SDA while it transmits. Because the bus is wired-AND (any device pulling low wins), a 0 overrides a 1. If a controller sends a 1 (releases SDA) but reads back a 0, another controller is sending a 0; it has lost arbitration and must stop transmitting immediately, switching to receive mode if needed. Arbitration continues bit by bit through the address and data, so the winner's message is not corrupted.

Example: two controllers start at the same time

Controller A sends address 0x50: 1 0 1 0 0 0 0
Controller B sends address 0x48: 1 0 0 ...
                                     ↑ A sends 1 (releases), B sends 0 (pulls low)
                                       A reads 0 ≠ 1 → A loses, stops; B continues

The lower address wins at the first differing bit; if both address the same device, arbitration continues into the data bytes.

Clock synchronisation: both controllers drive SCL; because it is wired-AND, SCL is low while either holds it low, so the combined clock has the longest low period and the shortest high period of the two. Both then stay in step bit by bit.

What the losing controller does: sets an "arbitration lost" flag (raises an interrupt) and retries after the bus becomes free (after STOP). Firmware must handle this, not treat it as a fatal error.

Practical note: true multi-controller I2C is relatively rare and tricky (some controllers have bugs in arbitration handling). Many systems with two processors use one controller and make the other a target, or use a separate bus.

Compare with CAN: CAN uses the same principle (dominant bit wins, lowest ID wins), but CAN is designed for multi-controller from the start.