User manual

Table Of Contents
Zynq-7000 AP SoC Technical Reference Manual www.xilinx.com 542
UG585 (v1.11) September 27, 2016
Chapter 17: SPI Controller
17.2.7 SPI-to-SPI Connection
The I/O signals of the two SPI controller in the PC are connected together signals when the
slcr.MIO_LOOPBACK [SPI_LOOP_SPI1] bit is set = 1. In this mode, the clock, slave select, MISO, and
MOSI signals from one controller are connected to the other controller’s clock, slave, MISO, and
MOSI signals. respectively.
17.3 Programming Guide
17.3.1 Start-up Sequence
17.3.2 Controller Configuration
17.3.3 Master Mode Data Transfer
17.3.4 Slave Mode Data Transfer
17.3.5 Interrupt Service Routine
17.3.6 Register Overview
17.3.1 Start-up Sequence
Example: Start-up Sequence
1. Reset controller: Assert and de-assert the Ref and CPU_1x resets, refer to section 17.4.1 Resets.
2. Program clocks: Program the SPI_Ref_Clk, refer to section 17.4.2 Clocks.
3. Tx/Rx signal routing: Refer to section 17.5 I/O Interfaces.
4. Controller configuration: Refer to section 17.3.2 Controller Configuration.
5. Interrupt configuration: Configure the ISR to handle the interrupt conditions. The simplest ISR
reads data from the RxFIFO and writes content to the TxFIFO. The PS interrupt controller is
described in Chapter 7, Interrupts. The interrupt mechanism for the SPI controller is described in
section 17.3.5 Interrupt Service Routine.
6. Start data transfers:
°
Master Mode operation select: Manual/Auto start and SS, refer to section 17.3.3 Master
Mode Data Transfer.
°
Slave Mode operation, refer to section 17.3.4 Slave Mode Data Transfer.
17.3.2 Controller Configuration
Set controller parameters by writing to the spi.Config_reg register:
Set baud rate [BAUD_RATE_DIV].
Set clock phase [CLK_PH] and Polarity [CLK_POL].
Select Master/Slave mode [MODE_SEL].