27.3.1 Initialization
Full-Duplex Mode:
- Set the baud rate (USARTn.BAUD).
- Set the frame format and mode of operation (USARTn.CTRLC).
- Configure the TXD pin as an output.
- Enable the transmitter and the receiver (USARTn.CTRLB).
Note:
- For interrupt-driven USART operation, global interrupts must be disabled during the initialization
- Before doing a reinitialization with a changed baud rate or frame format, be sure that there are no ongoing transmissions while the registers are changed
One-Wire Half-Duplex Mode:
- Internally connect the TXD to the USART receiver (the LBME bit in the USARTn.CTRLA register).
- Enable internal pull-up for the RX/TX pin (the PULLUPEN bit in the PORTx.PINnCTRL register).
- Enable Open-Drain mode (the ODME bit in the USARTn.CTRLB register).
- Set the baud rate (USARTn.BAUD).
- Set the frame format and mode of operation (USARTn.CTRLC).
- Enable the transmitter and the receiver (USARTn.CTRLB).
Note:
- When Open-Drain mode is enabled, the TXD pin is automatically set to output by hardware
- For interrupt-driven USART operation, global interrupts must be disabled during the initialization
- Before doing a reinitialization with a changed baud rate or frame format, be sure that there are no ongoing transmissions while the registers are changed