Datasheet
25.11.1. UDRn – USART I/O Data Register
When using the I/O specific commands IN and OUT, the I/O addresses 0x00 - 0x3F must be used. When
addressing I/O Registers as data space using LD and ST instructions, 0x20 must be added to these offset
addresses. The device is a complex microcontroller with more peripheral units than can be supported
within the 64 location reserved in Opcode for the IN and OUT instructions. For the Extended I/O space
from 0x60 in SRAM, only the ST/STS/STD and LD/LDS/LDD instructions can be used.
Name: UDRn
Offset: 0x0C
Reset: 0x00
Property:
When addressing I/O Registers as data space the offset address is 0x2C
Bit 7 6 5 4 3 2 1 0
TXB / RXB[7:0]
Access
R/W R/W R/W R/W R/W R/W R/W R/W
Reset 0 0 0 0 0 0 0 0
Bits 7:0 – TXB / RXB[7:0]: USART Transmit / Receive Data Buffer
The USARTn Transmit Data Buffer Register and USARTn Receive Data Buffer Registers share the same
I/O address referred to as USARTn Data Register or UDRn. The Transmit Data Buffer Register (TXBn)
will be the destination for data written to the UDRn Register location. Reading the UDRn Register location
will return the contents of the Receive Data Buffer Register (RXBn).
For 5-, 6-, or 7-bit characters the upper unused bits will be ignored by the Transmitter and set to zero by
the Receiver.
The transmit buffer can only be written when the UDREn Flag in the UCSRAn Register is set. Data
written to UDRn when the UDREn Flag is not set, will be ignored by the USARTn Transmitter. When data
is written to the transmit buffer, and the Transmitter is enabled, the Transmitter will load the data into the
Transmit Shift Register when the Shift Register is empty. Then the data will be serially transmitted on the
TxDn pin.
The receive buffer consists of a two level FIFO. The FIFO will change its state whenever the receive
buffer is accessed. Due to this behavior of the receive buffer, do not use Read-Modify-Write instructions
(SBI and CBI) on this location. Be careful when using bit test instructions (SBIC and SBIS), since these
also will change the state of the FIFO.
Atmel ATmega64A [DATASHEET]
Atmel-8160E-ATmega64A_Datasheet_Complete-09/2015
266