25.3.4.5 Collision Detection

Transmit collisions can be detected by hardware by writing the Collision Detection Enable (COLDEN) bit to ‘1’ in the Control E (USARTn.CTRLE) register. Collision detection is performed for each transmitted bit by comparing the expected transmit value with the value on the TxD pin input buffer, as illustrated in the figure below.

Figure 25-17. Collision Detection Block Diagram

The figure below shows an example of how the Collision Detection feature tristates the TxD pin when a collision occurs. Collision detection is performed on all transmitted data, including the Start bit, Stop bit(s), and Parity bit.

Figure 25-18. Collision Detected Example
When a collision is detected, the USART automatically takes the following actions:
  • The current transfer is aborted
  • The transmitter is disabled (TXEN in USARTn.CTRLB is set to ‘0’)
    • This forces TxD to be tri-stated
  • The transmit buffer is flushed, and the Transmit Complete (TXC) interrupt flag in the Interrupt Flags (USARTn.INTFLAGS) register is set
  • The Collision Detected (COLL) bit in the Status (USARTn.STATUS) register is set to ‘1’, and the Error (ERROR) interrupt flag in the Interrupt Flags (USARTn.INTFLAGS) register is also set.

After a collision, software must manually enable the transmitter again before continuing.