27.3.1 Initialization

Full-Duplex Mode:

  1. Set the baud rate (USARTn.BAUD).
  2. Set the frame format and mode of operation (USARTn.CTRLC).
  3. Configure the TXD pin as an output.
  4. 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:

  1. Internally connect the TXD to the USART receiver (the LBME bit in the USARTn.CTRLA register).
  2. Enable internal pull-up for the RX/TX pin (the PULLUPEN bit in the PORTx.PINnCTRL register).
  3. Enable Open-Drain mode (the ODME bit in the USARTn.CTRLB register).
  4. Set the baud rate (USARTn.BAUD).
  5. Set the frame format and mode of operation (USARTn.CTRLC).
  6. 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