
224
8210C–AVR–09/11
Atmel AVR XMEGA D
Figure 18-9.
Fractional baud rate example.
18.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.
18.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
clk
PER
clk
PER
Baud
counter
Baud
counter
Ideal
baud clock
Fractional
baud clock