When the bus is idle, any master device may attempt to take control of the bus. Two or more master devices may issue a Start condition within the minimum hold time (THD:STA), which triggers a valid Start on the bus. The master devices must then compete using bus arbitration to determine who takes control of the bus and completes their transaction.
Bus arbitration takes place bit by bit, and it may be possible for two masters who have identical messages to complete the entire transaction without either device losing arbitration.
Arbitration can be lost in any of the following states:
If a collision occurs during the data transfer phase, the transmission is halted and both SCL and SDA are released by hardware. If a collision occurs during a Start, Restart, Acknowledge, or Stop, the operation is aborted and hardware releases SCL and SDA. If a collision occurs during the addressing phase, the master that ‘wins’ arbitration may be attempting to address the ‘losing’ master as a slave. In this case, the master that lost arbitration must switch to its Slave mode and check to see if an address matches.