
665
SAM G51 [DATASHEET]
11209C–ATARM–20-Dec-13
29.5
UART Operations
The UART operates in asynchronous mode only and supports only 8-bit character handling (with parity). It has no clock
pin.
The UART is made up of a receiver and a transmitter that operate independently, and a common baud rate generator.
Receiver timeout and transmitter time guard are not implemented. However, all the implemented features are compatible
with those of a standard USART.
29.5.1 Baud Rate Generator
The baud rate generator provides the bit period clock named baud rate clock to both the receiver and the transmitter.
The baud rate clock is the master clock divided by 16 times the value (CD) written in UART_BRGR (Baud Rate
Generator Register). If UART_BRGR is set to 0, the baud rate clock is disabled and the UART remains inactive. The
maximum allowable baud rate is Master Clock divided by 16. The minimum allowable baud rate is Master Clock divided
by (16 x 65536).
Figure 29-2.
Baud Rate Generator
29.5.2 Receiver
29.5.2.1
Receiver Reset, Enable and Disable
After device reset, the UART receiver is disabled and must be enabled before being used. The receiver can be enabled
by writing the Control register (UART_CR) with the bit RXEN at 1. At this command, the receiver starts looking for a start
bit.
The programmer can disable the receiver by writing UART_CR with the bit RXDIS at 1. If the receiver is waiting for a start
bit, it is immediately stopped. However, if the receiver has already detected a start bit and is receiving the data, it waits
for the stop bit before actually stopping its operation.
The receiver can be put in reset state by writing UART_CR with the bit RSTRX at 1. In this case, the receiver immediately
stops its current operations and is disabled, whatever its current state. If RSTRX is applied when data is being
processed, this data is lost.
29.5.2.2
Start Detection and Data Sampling
The UART only supports asynchronous operations, and this affects only its receiver. The UART receiver detects the start
of a received character by sampling the URXD signal until it detects a valid start bit. A low level (space) on URXD is
interpreted as a valid start bit if it is detected for more than seven cycles of the sampling clock, which is 16 times the baud
rate. Hence, a space that is longer than 7/16 of the bit period is detected as a valid start bit. A space which is 7/16 of a bit
period or shorter is ignored and the receiver continues to wait for a valid start bit.
Baud Rate
MCK
16
CD
×
----------------------
=
MCK
16-bit Counter
0
Baud Rate
Clock
CD
OUT
Divide
by 16
0
1
>1
Receiver
Sampling Clock