307
8331B–AVR–03/12
Atmel AVR XMEGA AU
23.10 USART in Master SPI Mode
Using the USART in master SPI mode requires the transmitter to be enabled. The receiver can
optionally be enabled to serve as the serial input. The XCK pin will be used as the transfer clock.
As for the USART, a data transfer is initiated by writing to the DATA register. This is the case for
both sending and receiving data, since the transmitter controls the transfer clock. The data writ-
ten to DATA are moved from the transmit buffer to the shift register when the shift register is
ready to send a new frame.
The transmitter and receiver interrupt flags and corresponding USART interrupts used in master
SPI mode are identical in function to their use in normal USART operation. The receiver error
status flags are not in use and are always read as zero.
Disabling of the USART transmitter or receiver in master SPI mode is identical to their disabling
in normal USART operation.
23.11 USART SPI vs. SPI
The USART in master SPI mode is fully compatible with the standalone SPI module in that:
• Timing diagrams are the same
• UCPHA bit functionality is identical to that of the SPI CPHA bit
• UDORD bit functionality is identical to that of the SPI DORD bit
When the USART is set in master SPI mode, configuration and use are in some cases different
from those of the standalone SPI module. In addition, the following differences exist:
• The USART transmitter in master SPI mode includes buffering, but the SPI module has no
transmit buffer
• The USART receiver in master SPI mode includes an additional buffer level
• The USART in master SPI mode does not include the SPI write collision feature
• The USART in master SPI mode does not include the SPI double speed mode feature, but
this can be achieved by configuring the baud rate generator accordingly
• Interrupt timing is not compatible
• Pin control differs due to the master-only operation of the USART in SPI master mode
A comparison of the USART in master SPI mode and the SPI pins is shown
.
23.12 Multiprocessor Communication Mode
The multiprocessor communication mode effectively reduces the number of incoming frames
that have to be handled by the receiver in a system with multiple microcontrollers communicat-
ing via the same serial bus. In this mode, a dedicated bit in the frames is used to indicate
whether the frame is an address or data frame type.
Table 23-6.
Comparison of USART in master SPI mode and SPI pins.
USART
SPI
Comment
TxD
MOSI
Master out only
RxD
MISO
Master in only
XCK
SCK
Functionally identical
N/A
SS
Not supported by USART in master SPI mode