27.3.2.2.3.4 Case M4: Arbitration Lost or Bus Error
If arbitration is lost, both the WIF and
the Arbitration Lost (ARBLOST) flags in the Master Status (TWIn.MSTATUS) register are set
to ‘1
’. The SDA is disabled and the SCL is released. The bus state changes
to Busy, and the master is no longer allowed to perform any operation on the bus until the
bus state is changed back to Idle.
A bus error will behave similarly to the
arbitration lost condition. In this case, the Bus Error (BUSERR) flag in the Master Status
(TWIn.MSTATUS) register is set to ‘1
’, in addition to the WIF and ARBLOST
flags.
- Abort the operation and wait until the bus state changes to Idle by reading the Bus State (BUSSTATE) bit field in the Master Status (TWIn.MSTATUS) register