34.6.1 Principle of Operation
The USART uses the following lines for data transfer:
- RxD for receiving
- TxD for transmitting
- XCK for the transmission clock in synchronous operation
When the SERCOM is used in USART mode, the SERCOM controls the direction and value of the I/O pins according to the table below.
Pin | Pin Configuration |
---|---|
TxD | Output |
RxD | Input |
XCK | Output or input |
PORT Control bit PINCFGn.DRVSTR is still effective for the SERCOM output pins.
PORT Control bit PINCFGn.PULLEN is still effective on the SERCOM input pins, but is limited to the enabling/disabling of a pull down only (it is not possible to enable/disable a pull up).
If the receiver or transmitter is disabled, these pins can be used for other purposes.
The combined configuration of PORT and the Transmit Data Pinout and Receive Data Pinout bit fields in the Control A register (CTRLA.TXPO and CTRLA.RXPO, respectively) will define the physical position of the USART signals in the Pin Configuration Summary.
USART data transfer is frame based. A serial frame consists of:
- 1 start bit
- From 5 to 9 data bits (MSB or LSB first)
- No, even or odd parity bit
- 1 or 2 stop bits
A frame starts with the start bit followed by one character of data bits. If enabled, the parity bit is inserted after the data bits and before the first stop bit. After the stop bit(s) of a frame, either the next frame can follow immediately, or the communication line can return to the idle (high) state. The figure below illustrates the possible frame formats. Brackets denote optional bits.
- St
- Start bit. Signal is always low.
- n, [n]
- Data bits. 0 to [5..9]
- [P]
- Parity bit. Either odd or even.
- Sp, [Sp]
- Stop bit. Signal is always high.
- IDLE
- No frame is transferred on the communication line. Signal is always high in this state.