Atmel Evaluation Kit AT91SAM9X25-EK AT91SAM9X25-EK Data Sheet

Product codes
AT91SAM9X25-EK
Page of 1151
665
SAM9X25 [DATASHEET]
11054E–ATARM–10-Mar-2014
Figure 35-4. SPI Transfer Format (NCPHA = 0, 8 bits per transfer)
35.7.3 Master Mode Operations
When configured in Master Mode, the SPI operates on the clock generated by the internal programmable baud rate 
generator. It fully controls the data transfers to and from the slave(s) connected to the SPI bus. The SPI drives the chip 
select line to the slave and the serial clock signal (SPCK). 
The SPI features two holding registers, the Transmit Data Register and the Receive Data Register, and a single Shift 
Register. The holding registers maintain the data flow at a constant rate. 
After enabling the SPI, a data transfer begins when the processor writes to the SPI_TDR (Transmit Data Register). The 
written data is immediately transferred in the Shift Register and transfer on the SPI bus starts. While the data in the Shift 
Register is shifted on the MOSI line, the MISO line is sampled and shifted in the Shift Register. Receiving data cannot 
occur without transmitting data. If receiving mode is not needed, for example when communicating with a slave receiver 
only (such as an LCD), the receive status flags in the status register can be discarded.
Before writing the TDR, the PCS field in the SPI_MR register must be set in order to select a slave.
After enabling the SPI, a data transfer begins when the processor writes to the SPI_TDR (Transmit Data Register). The 
written data is immediately transferred in the Shift Register and transfer on the SPI bus starts. While the data in the Shift 
Register is shifted on the MOSI line, the MISO line is sampled and shifted in the Shift Register. Transmission cannot 
occur without reception.
Before writing the TDR, the PCS field must be set in order to select a slave.
If new data is written in SPI_TDR during the transfer, it stays in it until the current transfer is completed. Then, the 
received data is transferred from the Shift Register to SPI_RDR, the data in SPI_TDR is loaded in the Shift Register and 
a new transfer starts. 
The transfer of a data written in SPI_TDR in the Shift Register is indicated by the TDRE bit (Transmit Data Register 
Empty) in the Status Register (SPI_SR). When new data is written in SPI_TDR, this bit is cleared. The TDRE bit is used 
to trigger the Transmit DMAchannel.
*
SPCK
(CPOL = 0)
SPCK
(CPOL = 1)
1
2
3
4
5
7
MOSI
(from master)
MISO
(from slave)
NSS
(to slave)
SPCK cycle (for reference)
8
MSB
MSB
LSB
LSB
6
6
5
5
4
4
3
3
1
1
* Not defined but normally LSB of previous character transmitted.
2
2
6