User manual

Table Of Contents
Zynq-7000 AP SoC Technical Reference Manual www.xilinx.com 537
UG585 (v1.11) September 27, 2016
Chapter 17: SPI Controller
17.2 Functional Description
17.2.1 Master Mode
17.2.2 Multi-Master Capability
17.2.3 Slave Mode
17.2.4 FIFOs
17.2.5 FIFO Interrupts
17.2.6 Interrupt Register Bits, Logic Flow
17.2.7 SPI-to-SPI Connection
17.2.1 Master Mode
In master mode, the SPI I/O interface can transmit data to a slave or initiate a transfer to receive data
from a slave. The controller selects one slave device at the time using one of the three slave select
lines. If more than three slave devices need to be connected to the master, it is possible to add an
external peripheral select 3-to-8 decode on the board.
Data Transfer
The SCLK clock and MOSI signals are under control of the master. Data to be transmitted is written
into the TxFIFO by software using register writes and then unloaded for transmission by the
controller hardware in a manual or automatic start sequence. Data is driven onto the master output
(MOSI) data pin. Transmission is continuous while there is data in the TxFIFO.
Data is received serially on the MISO data pin and is loaded 8 bits at a time into the RxFIFO. Software
reads the RxFIFO using register reads. For every “n” bytes written to the TxFIFO, there will be “n”
bytes stored in RxFIFO that must be read by software before starting the next transfer.
Auto/Manual SS and Start
Data transfers on the I/O interface can be manually started using software or automatically started
by the controller hardware. In addition, the slave select assertion/de-assertion can be done by the
controller hardware or from software. These four combinations are shown in Table 17-1.
Table 17-1: SPI Master Mode SS and Start Modes
Slave Select
Control
Data Transfer
Start Control
Manual
Slave
Select
Manual Start
Enable &
Command
Operation
Manual SS
(software)
Manual Start 1 1
Software controls the slave select and must issue
the start command to serialize data.
Auto Start 10
Software controls the slave select, but the
controller hardware automatically starts to
serialize data when there is data in the TxFIFO.
Recommended for general use.