25.3.4.1.1 One-Wire Mode

One-Wire mode is enabled by setting the Loop-Back Mode Enable (LBME) bit in the USARTn.CTRLE register. This will enable an internal connection between the TXD pin and the USART receiver, allowing the TXD pin to function as a combined TxD/RxD line. The RXD pin will be disconnected from the USART receiver and can be controlled by a different peripheral.

In One-Wire mode, multiple devices can control the TxD/RxD line at the same time. In the case where one device drives the pin to a logical high level (VDD), and another device pulls the line low (GND), a short circuit will occur. To prevent this, the USART features an Open-Drain mode (enabled by the ODME bit in the USARTn.CTRLE register), which restricts the transmitter from driving a pin to a logical high level, thereby constraining it to only be able to pull it low. When combined with the internal pull-up feature (enabled by the PULLUPEN bit in the PORTx.PINnCTRL register), the line is held high by a pull-up resistor, allowing any device to pull it low. If the line is pulled low, the current from VDD to GND is limited by the pull-up resistor.

When the USART transmits on the TxD/RxD line, it also receives its own data. Overlapping transmissions are automatically detected, as detailed in the Collision Detection section.