Disabling the Transmitter or
Receiver
The disabling of the transmitter or receiver in USART in MSPIM mode is identical in
function to the normal USART operation.
USART MSPIM Register
Description
The following section describes the registers used for SPI operation using the USART.
USART MSPIM I/O Data
Register - UDRn
The function and bit description of the USART data register (UDRn) in MSPI mode is
identical to normal USART operation. See “USART I/O Data Register n– UDRn” on
page 222.
USART MSPIM Control and
Status Register n A - UCSRnA
•
Bit
7
RXCn
R/W
0
6
TXCn
R/W
0
5
UDREn
R/W
0
4
-
3
-
2
-
1
-
0
-
UCSRnA
Read/Write
Initial Value
R
0
R
0
R
1
R
1
R
0
• Bit 7 - RXCn: USART Receive Complete
This flag bit is set when there are unread data in the receive buffer and cleared when the
receive buffer is empty (i.e., does not contain any unread data). If the Receiver is dis-
abled, the receive buffer will be flushed and consequently the RXCn bit will become
zero. The RXCn Flag can be used to generate a Receive Complete interrupt (see
description of the RXCIEn bit).
• Bit 6 - TXCn: USART Transmit Complete
This flag bit is set when the entire frame in the Transmit Shift Register has been shifted
out and there are no new data currently present in the transmit buffer (UDRn). The
TXCn Flag bit is automatically cleared when a transmit complete interrupt is executed,
or it can be cleared by writing a one to its bit location. The TXCn Flag can generate a
Transmit Complete interrupt (see description of the TXCIEn bit).
• Bit 5 - UDREn: USART Data Register Empty
The UDREn Flag indicates if the transmit buffer (UDRn) is ready to receive new data. If
UDREn is one, the buffer is empty, and therefore ready to be written. The UDREn Flag
can generate a Data Register Empty interrupt (see description of the UDRIE bit).
UDREn is set after a reset to indicate that the Transmitter is ready.
• Bit 4:0 - Reserved Bits in MSPI mode
When in MSPI mode, these bits are reserved for future use. For compatibility with future
devices, these bits must be written to zero when UCSRnA is written.
USART MSPIM Control and
Status Register n B - UCSRnB
Bit
7
RXCIEn
R/W
0
6
TXCIEn
R/W
0
5
UDRIE
R/W
0
4
RXENn
R/W
0
3
TXENn
R/W
0
2
-
1
-
0
-
UCSRnB
Read/Write
Initial Value
R
1
R
1
R
0
• Bit 7 - RXCIEn: RX Complete Interrupt Enable
Writing this bit to one enables interrupt on the RXCn Flag. A USART Receive Complete
interrupt will be generated only if the RXCIEn bit is written to one, the Global Interrupt
Flag in SREG is written to one and the RXCn bit in UCSRnA is set.
236
ATmega640/1280/1281/2560/2561
2549A–AVR–03/05