
164
ATmega64A [DATASHEET]
8160D–AVR–02/2013
Figure 21-1. USART Block Diagram
Note:
The dashed boxes in the block diagram separate the three main parts of the USART (listed from the top): Clock
generator, Transmitter and Receiver. Control registers are shared by all units. The Clock Generation logic consists
of synchronization logic for external clock input used by synchronous slave operation, and the baud rate generator.
The XCK (Transfer Clock) pin is only used by synchronous transfer mode. The Transmitter consists of a single
write buffer, a serial Shift Register, Parity Generator and Control Logic for handling different serial frame formats.
The write buffer allows a continuous transfer of data without any delay between frames. The Receiver is the most
complex part of the USART module due to its clock and data recovery units. The recovery units are used for asyn-
chronous data reception. In addition to the recovery units, the Receiver includes a Parity Checker, Control Logic, a
Shift Register and a two level receive buffer (UDRn). The Receiver supports the same frame formats as the Trans-
mitter, and can detect Frame Error, Data OverRun and Parity Errors.
21.2.1
AVR USART vs. AVR UART – Compatibility
The USART is fully compatible with the AVR UART regarding:
Bit locations inside all USART Registers
Baud Rate Generation.
Transmitter Operation.
Transmit Buffer Functionality.
Receiver Operation.
However, the receive buffering has two improvements that will affect the compatibility in some special cases:
A second buffer register has been added. The two buffer registers operate as a circular FIFO buffer. Therefore
the UDRn must only be read once for each incoming data! More important is the fact that the error flags (FEn
and DORn) and the ninth data bit (RXB8n) are buffered with the data in the receive buffer. Therefore the status
PARITY
GENERATOR
UBRR[H:L]
UDR (Transmit)
UCSRA
UCSRB
UCSRC
BAUD RATE GENERATOR
TRANSMIT SHIFT REGISTER
RECEIVE SHIFT REGISTER
RxD
TxD
PIN
CONTROL
UDR (Receive)
PIN
CONTROL
XCK
DATA
RECOVERY
CLOCK
RECOVERY
PIN
CONTROL
TX
CONTROL
RX
CONTROL
PARITY
CHECKER
DATA
BUS
OSC
SYNC LOGIC
Clock Generator
Transmitter
Receiver