4.4. SPI

ARM Documentation

Excerpted from the ARM PrimeCell Synchronous Serial Port (PL022) Technical Reference Manual . Used with permission.

RP2040 has two identical SPI controllers, both based on an ARM Primecell Synchronous Serial Port (SSP) (PL022) (Revision r1p4). Note this is NOT the same as the QSPI interface covered in Section 4.10 .

Each controller supports the following features:

Each controller can be connected to a number of GPIO pins as defined in the GPIO muxing Table 279 in Section 2.19.2 . Connections to the GPIO muxing are prefixed with the SPI instance name spi0_ or spi1_, and include the following:

The SPI TX pin function is wired to always assert the pad output enable, and is not driven from nSSPOE. When multiple SPI slaves are sharing a bus software would need to switch the output enable. This could be done by toggling oeover field of the relevant iobank0.ctrl register, or by switching GPIO function.

The SPI uses clk_peri as its reference clock for SPI timing, and is referred to as SSPCLK in the following sections. clk_sys is used as the bus clock, and is referred to as PCLK in the following sections (also see Section 2.15.1 ).

4.4.1. Overview

The PrimeCell SSP is a master or slave interface for synchronous serial communication with peripheral devices that have Motorola SPI, National Semiconductor Microwire, or Texas Instruments synchronous serial interfaces.

The PrimeCell SSP performs serial-to-parallel conversion on data received from a peripheral device. The CPU accesses data, control, and status information through the AMBA APB interface. The transmit and receive paths are buffered with internal FIFO memories enabling up to eight 16-bit values to be stored independently in both transmit and receive modes. Serial data is transmitted on SSPTXD and received on SSPRXD.

The PrimeCell SSP includes a programmable bit rate clock divider and prescaler to generate the serial output clock, SSPCLKOUT, from the input clock, SSPCLK. Bit rates are supported to 2MHz and higher, subject to choice of frequency for SSPCLK, and the maximum bit rate is determined by peripheral devices.

You can use the control registers SSPCR0 and SSPCR1 to program the PrimeCell SSP operating mode, frame format, and size.

The following individually maskable interrupts are generated:

A single combined interrupt is asserted if any of the individual interrupts are asserted and unmasked. This interrupt is connected to the processor interrupt controllers in RP2040.

In addition to the above interrupts, a set of DMA signals are provided for interfacing with a DMA controller.

Depending on the operating mode selected, the SSPFSSOUT output operates as:

4.4.2. Functional Description

Figure 87. PrimeCell SSP block diagram.
For clarity, does not show the test logic.

Figure 87: PrimeCell SSP block diagram. This block diagram illustrates the internal architecture of the SSP (Serial Peripheral Interface) block. It shows the connection between the AMBA APB interface, Tx and Rx FIFOs, a Register block, a Clock prescaler, a DMA interface, and Transmit and receive logic. The AMBA APB interface handles control signals like PRESETn, PSEL, PENABLE, PWRITE, PADDR[11:2], PWDATA[15:0], PRDATA[15:0], and PCLK. It connects to the Tx FIFO (16 bits wide, 8 locations deep) and Rx FIFO (16 bits wide, 8 locations deep). The Tx FIFO outputs TxRdData[15:0] to the Transmit and receive logic. The Rx FIFO outputs RxWrData[15:0] to the DMA interface. The Register block manages the SSPCLK and nSSPRST signals. The Clock prescaler takes SSPCLK and a Prescale value to generate SSPCLKDIV. The DMA interface handles data transfer requests (SSPRXDMACLR, SSPTXDMACLR, SSPRXDMSREQ, SSPRXDMABREQ, SSPTXDMSREQ, SSPTXDMABREQ). The Transmit and receive logic generates various status and interrupt signals (SSPTXINTR, SSPINTR, SSPRXINTR, SSPRORINTR, SSPRTINTR, SSPRTRINTR, SSPRORINTR, SSPRXINTR, nSSPOE, SSPTXD, SSPTXOUT, SSPTXOUT, nSSPCTLOE, SSPCLKIN, SSPTXSSIN, SSPTXOUT) and manages the Tx/Rx FIFO watermark levels.
Figure 87: PrimeCell SSP block diagram. This block diagram illustrates the internal architecture of the SSP (Serial Peripheral Interface) block. It shows the connection between the AMBA APB interface, Tx and Rx FIFOs, a Register block, a Clock prescaler, a DMA interface, and Transmit and receive logic. The AMBA APB interface handles control signals like PRESETn, PSEL, PENABLE, PWRITE, PADDR[11:2], PWDATA[15:0], PRDATA[15:0], and PCLK. It connects to the Tx FIFO (16 bits wide, 8 locations deep) and Rx FIFO (16 bits wide, 8 locations deep). The Tx FIFO outputs TxRdData[15:0] to the Transmit and receive logic. The Rx FIFO outputs RxWrData[15:0] to the DMA interface. The Register block manages the SSPCLK and nSSPRST signals. The Clock prescaler takes SSPCLK and a Prescale value to generate SSPCLKDIV. The DMA interface handles data transfer requests (SSPRXDMACLR, SSPTXDMACLR, SSPRXDMSREQ, SSPRXDMABREQ, SSPTXDMSREQ, SSPTXDMABREQ). The Transmit and receive logic generates various status and interrupt signals (SSPTXINTR, SSPINTR, SSPRXINTR, SSPRORINTR, SSPRTINTR, SSPRTRINTR, SSPRORINTR, SSPRXINTR, nSSPOE, SSPTXD, SSPTXOUT, SSPTXOUT, nSSPCTLOE, SSPCLKIN, SSPTXSSIN, SSPTXOUT) and manages the Tx/Rx FIFO watermark levels.

4.4.2.1. AMBA APB interface

The AMBA APB interface generates read and write decodes for accesses to status and control registers, and transmit and receive FIFO memories.

4.4.2.2. Register block

The register block stores data written, or to be read, across the AMBA APB interface.

4.4.2.3. Clock prescaler

When configured as a master, an internal prescaler, comprising two free-running reloadable serially linked counters, provides the serial output clock SSPCLKOUT.

You can program the clock prescaler, using the SSPCPSR register, to divide SSPCLK by a factor of 2-254 in steps of two. By not utilizing the least significant bit of the SSPCPSR register, division by an odd number is not possible which ensures that a symmetrical, equal mark space ratio, clock is generated. See SSPCPSR .

The output of the prescaler is divided again by a factor of 1-256, by programming the SSPCR0 control register, to give the final master output clock SSPCLKOUT.

i NOTE

The PCLK and SSPCLK clock inputs in Figure 87 are connected to the clk_sys and clk_peri system-level clock nets on RP2040, respectively. By default clk_peri is attached directly to the system clock, but can be detached to maintain constant SPI frequency if the system clock is varied dynamically. See Figure 28 for an overview of the RP2040 clock architecture.

4.4.2.4. Transmit FIFO

The common transmit FIFO is a 16-bit wide, 8-locations deep memory buffer. CPU data written across the AMBA APB

interface are stored in the buffer until read out by the transmit logic.

When configured as a master or a slave, parallel data is written into the transmit FIFO prior to serial conversion, and transmission to the attached slave or master respectively, through the SSPTXD pin.

4.4.2.5. Receive FIFO

The common receive FIFO is a 16-bit wide, 8-locations deep memory buffer. Received data from the serial interface are stored in the buffer until read out by the CPU across the AMBA APB interface.

When configured as a master or slave, serial data received through the SSPRXD pin is registered prior to parallel loading into the attached slave or master receive FIFO respectively.

4.4.2.6. Transmit and receive logic

When configured as a master, the clock to the attached slaves is derived from a divided-down version of SSPCLK through the previously described prescaler operations. The master transmit logic successively reads a value from its transmit FIFO and performs parallel to serial conversion on it. Then, the serial data stream and frame control signal, synchronized to SSPCLKOUT, are output through the SSPTXD pin to the attached slaves. The master receive logic performs serial to parallel conversion on the incoming synchronous SSPRXD data stream, extracting and storing values into its receive FIFO, for subsequent reading through the APB interface.

When configured as a slave, the SSPCLKIN clock is provided by an attached master and used to time its transmission and reception sequences. The slave transmit logic, under control of the master clock, successively reads a value from its transmit FIFO, performs parallel to serial conversion, then outputs the serial data stream and frame control signal through the slave SSPTXD pin. The slave receive logic performs serial to parallel conversion on the incoming SSPRXD data stream, extracting and storing values into its receive FIFO, for subsequent reading through the APB interface.

4.4.2.7. Interrupt generation logic

The PrimeCell SSP generates four individual maskable, active-HIGH interrupts. A combined interrupt output is generated as an OR function of the individual interrupt requests.

The transmit and receive dynamic data-flow interrupts, SSPTXINTR and SSPRXINTR, are separated from the status interrupts so that data can be read or written in response to the FIFO trigger levels.

4.4.2.8. DMA interface

The PrimeCell SSP provides an interface to connect to a DMA controller, see Section 4.4.3.16 .

4.4.2.9. Synchronizing registers and logic

The PrimeCell SSP supports both asynchronous and synchronous operation of the clocks, PCLK and SSPCLK. Synchronization registers and handshaking logic have been implemented, and are active at all times. Synchronization of control signals is performed on both directions of data flow, that is:

4.4.3. Operation

4.4.3.1. Interface reset

The PrimeCell SSP is reset by the global reset signal, PRESETn, and a block-specific reset signal, nSSPRST. The device reset controller asserts nSSPRST asynchronously and negates it synchronously to SSPCLK.

4.4.3.2. Configuring the SSP

Following reset, the PrimeCell SSP logic is disabled and must be configured when in this state. It is necessary to program control registers SSPCR0 and SSPCR1 to configure the peripheral as a master or slave operating under one of the following protocols:

The bit rate, derived from the external SSPCLK, requires the programming of the clock prescale register SSPCPSR.

4.4.3.3. Enable PrimeCell SSP operation

You can either prime the transmit FIFO, by writing up to eight 16-bit values when the PrimeCell SSP is disabled, or permit the transmit FIFO service request to interrupt the CPU. Once enabled, transmission or reception of data begins on the transmit, SSPTXD, and receive, SSPRXD, pins.

4.4.3.4. Clock ratios

There is a constraint on the ratio of the frequencies of PCLK to SSPCLK. The frequency of SSPCLK must be less than or equal to that of PCLK. This ensures that control signals from the SSPCLK domain to the PCLK domain are guaranteed to get synchronized before one frame duration:

\[ F_{SSPCLK} \leq F_{PCLK} \]

In the slave mode of operation, the SSPCLKIN signal from the external master is double-synchronized and then delayed to detect an edge. It takes three SSPCLKs to detect an edge on SSPCLKIN. SSPTXD has less setup time to the falling edge of SSPCLKIN on which the master is sampling the line.

The setup and hold times on SSPRXD, with reference to SSPCLKIN, must be more conservative to ensure that it is at the right value when the actual sampling occurs within the SSPMS. To ensure correct device operation, SSPCLK must be at least 12 times faster than the maximum expected frequency of SSPCLKIN.

The frequency selected for SSPCLK must accommodate the desired range of bit clock rates. The ratio of minimum SSPCLK frequency to SSPCLKOUT maximum frequency in the case of the slave mode is 12, and for the master mode, it is two.

For example, at the maximum SSPCLK ( clk_peri) frequency on RP2040 of 133MHz, the maximum peak bit rate in master mode is 62.5Mbps. This is achieved with the SSPCPSR register programmed with a value of 2, and the SCR[7:0] field in the SSPCR0 register programmed with a value of 0.

In slave mode, the same maximum SSPCLK frequency of 133MHz can achieve a peak bit rate of \( 133 / 12 = \sim 11.083 \) Mbps. The SSPCPSR register can be programmed with a value of 12, and the SCR[7:0] field in the SSPCR0 register can be programmed with a value of 0. Similarly, the ratio of SSPCLK maximum frequency to SSPCLKOUT minimum frequency is \( 254 \times 256 \) .

The minimum frequency of SSPCLK is governed by the following inequalities, both of which must be satisfied:

\( F_{SSPCLK}(min) \geq 2 \times F_{SSPCLKOUT}(max) \) , for master mode

\( F_{SSPCLK}(min) \geq 12 \times F_{SSPCLKIN}(max) \) , for slave mode.

The maximum frequency of SSPCLK is governed by the following inequalities, both of which must be satisfied:

\( F_{SSPCLK}(max) \leq 254 \times 256 \times F_{SSPCLKOUT}(min) \) , for master mode

\( F_{SSPCLK}(max) \leq 254 \times 256 \times F_{SSPCLKIN}(min) \) , for slave mode.

4.4.3.5. Programming the SSPCR0 Control Register

The SSPCR0 register is used to:

The Serial Clock Rate (SCR) value, in conjunction with the SSPCPSR clock prescale divisor value, CPSDVSR, is used to derive the PrimeCell SSP transmit and receive bit rate from the external SSPCLK.

The frame format is programmed through the FRF bits, and the data word size through the DSS bits.

Bit phase and polarity, applicable to Motorola SPI format only, are programmed through the SPH and SPO bits.

4.4.3.6. Programming the SSPCR1 Control Register

The SSPCR1 register is used to:

To configure the PrimeCell SSP as a master, clear the SSPCR1 register master or slave selection bit, MS, to 0. This is the default value on reset.

Setting the SSPCR1 register MS bit to 1 configures the PrimeCell SSP as a slave. When configured as a slave, enabling or disabling of the PrimeCell SSP SSPTXD signal is provided through the SSPCR1 slave mode SSPTXD output disable bit, SOD. You can use this in some multi-slave environments where masters might parallel broadcast.

To enable the operation of the PrimeCell SSP, set the Synchronous Serial Port Enable (SSE) bit to 1.

4.4.3.6.1. Bit rate generation

The serial bit rate is derived by dividing down the input clock, SSPCLK. The clock is first divided by an even prescale value CPSDVSR in the range 2-254, and is programmed in SSPCPSR. The clock is divided again by a value in the range 1-256, that is \( 1 + SCR \) , where SCR is the value programmed in SSPCR0.

The following equation defines the frequency of the output signal bit clock, SSPCLKOUT:

\[ F_{SSPCLKOUT} = \frac{F_{SSPCLK}}{CPSDVSR \times (1 + SCR)} \]

For example, if SSPCLK is 125MHz, and CPSDVSR = 2, then SSPCLKOUT has a frequency range from 244kHz - 62.5MHz.

4.4.3.7. Frame format

Each data frame is between 4-16 bits long, depending on the size of data programmed, and is transmitted starting with the MSB. You can select the following basic frame types:

For all formats, the serial clock, SSPCLKOUT, is held inactive while the PrimeCell SSP is idle, and transitions at the programmed frequency only during active transmission or reception of data. The idle state of SSPCLKOUT is utilized to provide a receive timeout indication that occurs when the receive FIFO still contains data after a timeout period.

For Motorola SPI and National Semiconductor Microwire frame formats, the serial frame, SSPFSSOUT, pin is active-LOW, and is asserted, pulled-down, during the entire transmission of the frame.

For Texas Instruments synchronous serial frame format, the SSPFSSOUT pin is pulsed for one serial clock period, starting at its rising edge, prior to the transmission of each frame. For this frame format, both the PrimeCell SSP and the off-chip slave device drive their output data on the rising edge of SSPCLKOUT, and latch data from the other device on the falling edge.

Unlike the full-duplex transmission of the other two frame formats, the National Semiconductor Microwire format uses a special master-slave messaging technique that operates at half-duplex. In this mode, when a frame begins, an 8-bit control message is transmitted to the off-chip slave. During this transmit, the SSS receives no incoming data. After the message has been sent, the off-chip slave decodes it and, after waiting one serial clock after the last bit of the 8-bit control message has been sent, responds with the requested data. The returned data can be 4-16 bits in length, making the total frame length in the range 13-25 bits.

4.4.3.8. Texas Instruments synchronous serial frame format

Figure 88 shows the Texas Instruments synchronous serial frame format for a single transmitted frame.

Figure 88. Texas Instruments synchronous serial frame format, single transfer

Timing diagram for Texas Instruments synchronous serial frame format, single transfer. The diagram shows four signals over time: SSPCLKOUT/SSPCLIN, SSPFSSOUT/SSPFSSIN, SSPTXD/SSPRXD, and nSSPOE. SSPCLKOUT/SSPCLIN is a periodic square wave. SSPFSSOUT/SSPFSSIN is pulsed HIGH for one SSPCLKOUT period before the data transfer. SSPTXD/SSPRXD shows a data frame of 4 to 16 bits, with the MSB (Most Significant Bit) and LSB (Least Significant Bit) indicated. nSSPOE is active-LOW and is asserted during the data transfer.
Timing diagram for Texas Instruments synchronous serial frame format, single transfer. The diagram shows four signals over time: SSPCLKOUT/SSPCLIN, SSPFSSOUT/SSPFSSIN, SSPTXD/SSPRXD, and nSSPOE. SSPCLKOUT/SSPCLIN is a periodic square wave. SSPFSSOUT/SSPFSSIN is pulsed HIGH for one SSPCLKOUT period before the data transfer. SSPTXD/SSPRXD shows a data frame of 4 to 16 bits, with the MSB (Most Significant Bit) and LSB (Least Significant Bit) indicated. nSSPOE is active-LOW and is asserted during the data transfer.

In this mode, SSPCLKOUT and SSPFSSOUT are forced LOW, and the transmit data line, SSPTXD, is tristated whenever the PrimeCell SSP is idle. When the bottom entry of the transmit FIFO contains data, SSPFSSOUT is pulsed HIGH for one SSPCLKOUT period. The value to be transmitted is also transferred from the transmit FIFO to the serial shift register of the transmit logic. On the next rising edge of SSPCLKOUT, the MSB of the 4-bit to 16-bit data frame is shifted out on the SSPTXD pin. In a similar way, the MSB of the received data is shifted onto the SSPRXD pin by the off-chip serial slave device.

Both the PrimeCell SSP and the off-chip serial slave device then clock each data bit into their serial shifter on the falling edge of each SSPCLKOUT. The received data is transferred from the serial shifter to the receive FIFO on the first rising edge of PCLK after the LSB has been latched.

Figure 89 shows the Texas Instruments synchronous serial frame format when back-to-back frames are transmitted.

Figure 89. Texas Instruments synchronous serial frame format, continuous transfer

Timing diagram for Texas Instruments synchronous serial frame format, continuous transfer.

The diagram shows four signals over time: SSPCLKOUT/SSPCLIN, SSPFSSOUT/SSPFSSIN, SSPTXD/SSPRXD, and nSSPOE (=0). The clock signal (SSPCLKOUT/SSPCLIN) is a periodic square wave. The slave select signal (SSPFSSOUT/SSPFSSIN) is a single pulse. The data signal (SSPTXD/SSPRXD) shows a sequence of bits, with the first bit labeled 'MSB' and the last bit labeled 'LSB'. A double arrow indicates a duration of '4 to 16 bits'. The nSSPOE (=0) signal is a constant low level.

Timing diagram for Texas Instruments synchronous serial frame format, continuous transfer.

4.4.3.9. Motorola SPI frame format

The Motorola SPI interface is a four-wire interface where the SSPFSSOUT signal behaves as a slave select. The main feature of the Motorola SPI format is that you can program the inactive state and phase of the SSPCLKOUT signal using the SPO and SPH bits of the SSPSCR0 control register.

4.4.3.9.1. SPO, clock polarity

When the SPO clock polarity control bit is LOW, it produces a steady state LOW value on the SSPCLKOUT pin. If the SPO clock polarity control bit is HIGH, a steady state HIGH value is placed on the SSPCLKOUT pin when data is not being transferred.

4.4.3.9.2. SPH, clock phase

The SPH control bit selects the clock edge that captures data and enables it to change state. It has the most impact on the first bit transmitted by either permitting or not permitting a clock transition before the first data capture edge.

When the SPH phase control bit is LOW, data is captured on the first clock edge transition.

When the SPH clock phase control bit is HIGH, data is captured on the second clock edge transition.

4.4.3.10. Motorola SPI Format with SPO=0, SPH=0

Figure 90 and Figure 91 shows a continuous transmission signal sequence for Motorola SPI frame format with SPO=0, SPH=0. Figure 90 shows a single transmission signal sequence for Motorola SPI frame format with SPO=0, SPH=0.

Figure 90. Motorola SPI frame format, single transfer, with SPO=0 and SPH=0

Timing diagram for Motorola SPI frame format, single transfer, with SPO=0 and SPH=0.

The diagram shows five signals: SSPCLKOUT/SSPCLIN, SSPFSSOUT/SSPFSSIN, SSPRXD, nSSPOE, and SSPTXD. The clock signal (SSPCLKOUT/SSPCLIN) is a periodic square wave. The slave select signal (SSPFSSOUT/SSPFSSIN) is a single pulse. The data signal (SSPRXD) shows a sequence of bits, with the first bit labeled 'MSB' and the last bit labeled 'LSB'. A double arrow indicates a duration of '4 to 16 bits'. The nSSPOE signal is a constant low level. The SSPTXD signal shows a sequence of bits, with the first bit labeled 'MSB' and the last bit labeled 'LSB'. A double arrow indicates a duration of '4 to 16 bits'.

Timing diagram for Motorola SPI frame format, single transfer, with SPO=0 and SPH=0.

Figure 91 shows a continuous transmission signal sequence for Motorola SPI frame format with SPO=0, SPH=0.

Figure 91. Motorola SPI frame format, single transfer, with SPO=0 and SPH=0

Timing diagram for Motorola SPI frame format, single transfer, with SPO=0 and SPH=0.

The diagram shows four signals: SSPCLKOUT/SSPCLIN, SSPFSSOUT/SSPFSSIN, SSPTXD/SSPRXD, and nSSPOE (=0). The clock signal (SSPCLKOUT/SSPCLIN) is a periodic square wave. The slave select signal (SSPFSSOUT/SSPFSSIN) is a single pulse. The data signal (SSPTXD/SSPRXD) shows a sequence of bits, with the first bit labeled 'LSB' and the last bit labeled 'MSB'. A double arrow indicates a duration of '4 to 16 bits'. The nSSPOE (=0) signal is a constant low level.

Timing diagram for Motorola SPI frame format, single transfer, with SPO=0 and SPH=0.

In this configuration, during idle periods:

If the PrimeCell SSP is enable, and there is valid data within the transmit FIFO, the start of transmission is signified by the SSPFSSOUT master signal being driven LOW. This causes slave data to be enabled onto the SSPTXD input line of the master. The nSSPOE line is driven LOW, enabling the master SSPTXD output pad.

One-half SSPCLKOUT period later, valid master data is transferred to the SSPTXD pin. Now that both the master and slave data have been set, the SSPCLKOUT master clock pin goes HIGH after one additional half SSPCLKOUT period.

The data is now captured on the rising and propagated on the falling edges of the SSPCLKOUT signal.

In the case of a single word transmission, after all bits of the data word have been transferred, the SSPFSSOUT line is returned to its idle HIGH state one SSPCLKOUT period after the last bit has been captured.

However, in the case of continuous back-to-back transmissions, the SSPFSSOUT signal must be pulsed HIGH between each data word transfer. This is because the slave select pin freezes the data in its serial peripheral register and does not permit it to be altered if the SPH bit is logic zero. Therefore, the master device must raise the SSPFSSIN pin of the slave device between each data transfer to enable the serial peripheral data write. On completion of the continuous transfer, the SSPFSSOUT pin is returned to its idle state one SSPCLKOUT period after the last bit has been captured.

4.4.3.11. Motorola SPI Format with SPO=0, SPH=1

Figure 92 shows the transfer signal sequence for Motorola SPI format with SPO=0, SPH=1, and it covers both single and continuous transfers.

Figure 92. Motorola SPI frame format with SPO=0 and SPH=1, single and continuous transfers

Timing diagram for Motorola SPI format with SPO=0 and SPH=1. The diagram shows five signals over time: SSPCLKOUT/SSPCLIN (clock), SSPFSSOUT/SSPFSSIN (master/slave select), SSPTXD (transmit data), nSSPOE (pad enable), and SSPRXD (receive data). The clock is a square wave. The master select signal is LOW during transmission. The transmit data line (SSPTXD) shows a sequence of bits from MSB to LSB, with a 'Q' at the start and end. The receive data line (SSPRXD) shows a sequence of bits from MSB to LSB, with a 'Q' at the start and end. A double arrow indicates a duration of '4 to 16 bits' for the data transfer. The nSSPOE signal is LOW during the transmission. The diagram is divided into two sections by a break symbol (//).
Timing diagram for Motorola SPI format with SPO=0 and SPH=1. The diagram shows five signals over time: SSPCLKOUT/SSPCLIN (clock), SSPFSSOUT/SSPFSSIN (master/slave select), SSPTXD (transmit data), nSSPOE (pad enable), and SSPRXD (receive data). The clock is a square wave. The master select signal is LOW during transmission. The transmit data line (SSPTXD) shows a sequence of bits from MSB to LSB, with a 'Q' at the start and end. The receive data line (SSPRXD) shows a sequence of bits from MSB to LSB, with a 'Q' at the start and end. A double arrow indicates a duration of '4 to 16 bits' for the data transfer. The nSSPOE signal is LOW during the transmission. The diagram is divided into two sections by a break symbol (//).

In this configuration, during idle periods:

If the PrimeCell SSP is enabled, and there is valid data within the transmit FIFO, the start of transmission is signified by the SSPFSSOUT master signal being driven LOW. The nSSPOE line is driven LOW, enabling the master SSPTXD output pad. After an additional one half SSPCLKOUT period, both master and slave valid data is enabled onto their respective transmission lines. At the same time, the SSPCLKOUT is enabled with a rising edge transition.

Data is then captured on the falling edges and propagated on the rising edges of the SSPCLKOUT signal.

In the case of a single word transfer, after all bits have been transferred, the SSPFSSOUT line is returned to its idle HIGH state one SSPCLKOUT period after the last bit has been captured. For continuous back-to-back transfers, the SSPFSSOUT pin is held LOW between successive data words and termination is the same as that of the single word transfer.

4.4.3.12. Motorola SPI Format with SPO=1, SPH=0

Figure 93 and Figure 94 show single and continuous transmission signal sequences for Motorola SPI format with SPO=1, SPH=0.

Figure 93 shows a single transmission signal sequence for Motorola SPI format with SPO=1, SPH=0.

Figure 93. Motorola SPI frame format, single transfer, with SPO=1 and SPH=0

Timing diagram for a single Motorola SPI transfer (SPO=1, SPH=0). The diagram shows five signals over time: SSPCLKOUT/SSPCLIN (clock), SSPFSSOUT/SSPFSSIN (chip select), SSPTXD/SSPRXD (data), nSSPOE (enable), and SSPTXD (transmit data). The clock is a square wave. The chip select is active-low, going LOW at the start of the transfer and returning HIGH at the end. The data line SSPTXD/SSPRXD shows a single word transfer from MSB to LSB. The nSSPOE signal is active-low, going LOW during the transfer. The SSPTXD signal is shown as a single word transfer from MSB to LSB. A break symbol (//) indicates a continuation of the signals.
Timing diagram for a single Motorola SPI transfer (SPO=1, SPH=0). The diagram shows five signals over time: SSPCLKOUT/SSPCLIN (clock), SSPFSSOUT/SSPFSSIN (chip select), SSPTXD/SSPRXD (data), nSSPOE (enable), and SSPTXD (transmit data). The clock is a square wave. The chip select is active-low, going LOW at the start of the transfer and returning HIGH at the end. The data line SSPTXD/SSPRXD shows a single word transfer from MSB to LSB. The nSSPOE signal is active-low, going LOW during the transfer. The SSPTXD signal is shown as a single word transfer from MSB to LSB. A break symbol (//) indicates a continuation of the signals.

Figure 94 shows a continuous transmission signal sequence for Motorola SPI format with SPO=1, SPH=0.

i NOTE

In Figure 93, Q is an undefined signal.

Figure 94. Motorola SPI frame format, continuous transfer, with SPO=1 and SPH=0

Timing diagram for a continuous Motorola SPI transfer (SPO=1, SPH=0). The diagram shows five signals over time: SSPCLKOUT/SSPCLIN (clock), SSPFSSOUT/SSPFSSIN (chip select), SSPTXD/SSPRXD (data), nSSPOE (=0) (enable), and SSPTXD (transmit data). The clock is a square wave. The chip select is active-low, going LOW at the start of the transfer and returning HIGH at the end. The data line SSPTXD/SSPRXD shows a continuous stream of data words, each starting with MSB and ending with LSB. The nSSPOE signal is active-low, going LOW during the transfer. The SSPTXD signal is shown as a continuous stream of data words from MSB to LSB. A break symbol (//) indicates a continuation of the signals.
Timing diagram for a continuous Motorola SPI transfer (SPO=1, SPH=0). The diagram shows five signals over time: SSPCLKOUT/SSPCLIN (clock), SSPFSSOUT/SSPFSSIN (chip select), SSPTXD/SSPRXD (data), nSSPOE (=0) (enable), and SSPTXD (transmit data). The clock is a square wave. The chip select is active-low, going LOW at the start of the transfer and returning HIGH at the end. The data line SSPTXD/SSPRXD shows a continuous stream of data words, each starting with MSB and ending with LSB. The nSSPOE signal is active-low, going LOW during the transfer. The SSPTXD signal is shown as a continuous stream of data words from MSB to LSB. A break symbol (//) indicates a continuation of the signals.

In this configuration, during idle periods:

If the PrimeCell SSP is enabled, and there is valid data within the transmit FIFO, the start of transmission is signified by the SSPFSSOUT master signal being driven LOW, and this causes slave data to be immediately transferred onto the SSPTXD line of the master. The nSSPOE line is driven LOW, enabling the master SSPTXD output pad.

One half period later, valid master data is transferred to the SSPTXD line. Now that both the master and slave data have been set, the SSPCLKOUT master clock pin becomes LOW after one additional half SSPCLKOUT period. This means that data is captured on the falling edges and be propagated on the rising edges of the SSPCLKOUT signal.

In the case of a single word transmission, after all bits of the data word are transferred, the SSPFSSOUT line is returned to its idle HIGH state one SSPCLKOUT period after the last bit has been captured.

However, in the case of continuous back-to-back transmissions, the SSPFSSOUT signal must be pulsed HIGH between each data word transfer. This is because the slave select pin freezes the data in its serial peripheral register and does not permit it to be altered if the SPH bit is logic zero. Therefore, the master device must raise the SSPFSSIN pin of the slave device between each data transfer to enable the serial peripheral data write. On completion of the continuous transfer, the SSPFSSOUT pin is returned to its idle state one SSPCLKOUT period after the last bit has been captured.

4.4.3.13. Motorola SPI Format with SPO=1, SPH=1

Figure 95 shows the transfer signal sequence for Motorola SPI format with SPO=1, SPH=1, and it covers both single and continuous transfers.

Figure 95. Motorola SPI frame format with SPO=1 and SPH=1, single and continuous transfers

Timing diagram for Motorola SPI format with SPO=1 and SPH=1. The diagram shows five signals over time: SSPCLKOUT/SSPCLIN (clock), SSPFSSOUT/SSPFSSIN (slave select), SSPTXD (transmit data), nSSPOE (output enable), and SSPRXD (receive data). The clock is a square wave. The slave select signal is pulsed LOW at the start of each transfer. The transmit data signal (SSPTXD) shows a sequence of bits from MSB to LSB, with a 'Q' signal at the end. The receive data signal (SSPRXD) shows a sequence of bits from MSB to LSB, with a 'Q' signal at the end. A double arrow indicates a duration of '4 to 16 bits' for the data transfer. The nSSPOE signal is pulsed LOW during the transfer. The diagram is divided into two sections by a break symbol, showing both single and continuous transfers.
Timing diagram for Motorola SPI format with SPO=1 and SPH=1. The diagram shows five signals over time: SSPCLKOUT/SSPCLIN (clock), SSPFSSOUT/SSPFSSIN (slave select), SSPTXD (transmit data), nSSPOE (output enable), and SSPRXD (receive data). The clock is a square wave. The slave select signal is pulsed LOW at the start of each transfer. The transmit data signal (SSPTXD) shows a sequence of bits from MSB to LSB, with a 'Q' signal at the end. The receive data signal (SSPRXD) shows a sequence of bits from MSB to LSB, with a 'Q' signal at the end. A double arrow indicates a duration of '4 to 16 bits' for the data transfer. The nSSPOE signal is pulsed LOW during the transfer. The diagram is divided into two sections by a break symbol, showing both single and continuous transfers.

i NOTE

In Figure 95, Q is an undefined signal.

In this configuration, during idle periods:

If the PrimeCell SSP is enabled, and there is valid data within the transmit FIFO, the start of transmission is signified by the SSPFSSOUT master signal being driven LOW. The nSSPOE line is driven LOW, enabling the master SSPTXD output pad. After an additional one half SSPCLKOUT period, both master and slave data are enabled onto their respective transmission lines. At the same time, the SSPCLKOUT is enabled with a falling edge transition. Data is then captured on the rising edges and propagated on the falling edges of the SSPCLKOUT signal.

After all bits have been transferred, in the case of a single word transmission, the SSPFSSOUT line is returned to its idle HIGH state one SSPCLKOUT period after the last bit has been captured.

For continuous back-to-back transmissions, the SSPFSSOUT pin remains in its active-LOW state, until the final bit of the last word has been captured, and then returns to its idle state as the previous section describes.

For continuous back-to-back transfers, the SSPFSSOUT pin is held LOW between successive data words and termination is the same as that of the single word transfer.

4.4.3.14. National Semiconductor Microwire frame format

Figure 96 shows the National Semiconductor Microwire frame format for a single frame. Figure 97 shows the same format when back to back frames are transmitted.

Figure 96. Microwire frame format, single transfer

Timing diagram for Microwire single transfer. It shows five signals: SSPCLKOUT/SSPCLIN (clock), SSPFSSOUT/SSPFSSIN (chip select), SSPTXD (transmit data), SSPRXD (receive data), and nSSPOE (pad enable). The SSPTXD signal shows an 8-bit control frame (MSB to LSB) followed by a 4 to 16 bits output data frame (MSB to LSB). The SSPRXD signal shows the received data (MSB to LSB) starting after the control frame. The nSSPOE signal is pulled up during the data transfer.
Timing diagram for Microwire single transfer. It shows five signals: SSPCLKOUT/SSPCLIN (clock), SSPFSSOUT/SSPFSSIN (chip select), SSPTXD (transmit data), SSPRXD (receive data), and nSSPOE (pad enable). The SSPTXD signal shows an 8-bit control frame (MSB to LSB) followed by a 4 to 16 bits output data frame (MSB to LSB). The SSPRXD signal shows the received data (MSB to LSB) starting after the control frame. The nSSPOE signal is pulled up during the data transfer.

Microwire format is very similar to SPI format, except that transmission is half-duplex instead of full-duplex, using a master-slave message passing technique. Each serial transmission begins with an 8-bit control word that is transmitted from the PrimeCell SSP to the off-chip slave device. During this transmission, the PrimeCell SSP receives no incoming data. After the message has been sent, the off-chip slave decodes it and, after waiting one serial clock after the last bit of the 8-bit control message has been sent, responds with the required data. The returned data is 4 to 16 bits in length, making the total frame length in the range 13-25 bits.

In this configuration, during idle periods:

A transmission is triggered by writing a control byte to the transmit FIFO. The falling edge of SSPFSSOUT causes the value contained in the bottom entry of the transmit FIFO to be transferred to the serial shift register of the transmit logic, and the MSB of the 8-bit control frame to be shifted out onto the SSPTXD pin. SSPFSSOUT remains LOW for the duration of the frame transmission. The SSPRXD pin remains tristated during this transmission.

The off-chip serial slave device latches each control bit into its serial shifter on the rising edge of each SSPCLKOUT. After the last bit is latched by the slave device, the control byte is decoded during a one clock wait-state, and the slave responds by transmitting data back to the PrimeCell SSP. Each bit is driven onto SSPRXD line on the falling edge of SSPCLKOUT. The PrimeCell SSP in turn latches each bit on the rising edge of SSPCLKOUT. At the end of the frame, for single transfers, the SSPFSSOUT signal is pulled HIGH one clock period after the last bit has been latched in the receive serial shifter, that causes the data to be transferred to the receive FIFO.

NOTE

The off-chip slave device can tristate the receive line either on the falling edge of SSPCLKOUT after the LSB has been latched by the receive shifter, or when the SSPFSSOUT pin goes HIGH.

For continuous transfers, data transmission begins and ends in the same manner as a single transfer. However, the SSPFSSOUT line is continuously asserted, held LOW, and transmission of data occurs back-to-back. The control byte of the next frame follows directly after the LSB of the received data from the current frame. Each of the received values is transferred from the receive shifter on the falling edge SSPCLKOUT, after the LSB of the frame has been latched into the PrimeCell SSP.

Figure 97 shows the National Semiconductor Microwire frame format when back-to-back frames are transmitted.

Figure 97. Microwire frame format, continuous transfers

Timing diagram for Microwire continuous transfers. It shows the same five signals as Figure 96. The SSPTXD signal shows an 8-bit control frame (MSB to LSB) followed by a 4 to 16 bits output data frame (MSB to LSB). The SSPRXD signal shows the received data (MSB to LSB) starting after the control frame. The nSSPOE signal is pulled up during the data transfer. The diagram illustrates back-to-back frames where the control byte of the next frame follows directly after the LSB of the received data from the current frame.
Timing diagram for Microwire continuous transfers. It shows the same five signals as Figure 96. The SSPTXD signal shows an 8-bit control frame (MSB to LSB) followed by a 4 to 16 bits output data frame (MSB to LSB). The SSPRXD signal shows the received data (MSB to LSB) starting after the control frame. The nSSPOE signal is pulled up during the data transfer. The diagram illustrates back-to-back frames where the control byte of the next frame follows directly after the LSB of the received data from the current frame.

In Microwire mode, the PrimeCell SSP slave samples the first bit of receive data on the rising edge of SSPCLKIN after SSPFSSIN has gone LOW. Masters that drive a free-running SSPCKLIN must ensure that the SSPFSSIN signal has sufficient setup and hold margins with respect to the rising edge of SSPCLKIN.

Figure 98 shows these setup and hold time requirements.

With respect to the SSPCLKIN rising edge on which the first bit of receive data is to be sampled by the PrimeCell SSP slave, SSPFSSIN must have a setup of at least two times the period of SSPCLK on which the PrimeCell SSP operates.

With respect to the SSPCLKIN rising edge previous to this edge, SSPFSSIN must have a hold of at least one SSPCLK period.

Figure 98. Microwire frame format, SSPFSSIN input setup and hold requirements

Timing diagram for Microwire frame format showing SSPCLKIN, SSPFSSIN, and SSPRXD signals. It highlights the setup and hold times for SSPFSSIN relative to SSPCLKIN.

The diagram shows three signals: SSPCLKIN (a periodic square wave), SSPFSSIN (a signal that transitions from high to low), and SSPRXD (a signal that transitions from high to low). The setup time \( t_{Setup} = (2 \times t_{SSPCLK}) \) is the time before the SSPCLKIN rising edge that SSPFSSIN must be stable. The hold time \( t_{Hold} = t_{SSPCLK} \) is the time after the SSPCLKIN rising edge that SSPFSSIN must remain stable. The first RX data bit to be sampled by the SSP slave is indicated by an arrow pointing to the first rising edge of SSPRXD.

Timing diagram for Microwire frame format showing SSPCLKIN, SSPFSSIN, and SSPRXD signals. It highlights the setup and hold times for SSPFSSIN relative to SSPCLKIN.

4.4.3.15. Examples of master and slave configurations

Figure 99, Figure 100, and Figure 101 shows how you can connect the PrimeCell SSP (PL022) peripheral to other synchronous serial peripherals, when it is configured as a master or a slave.

NOTE

The SSP (PL022) does not support dynamic switching between master and slave in a system. Each instance is configured and connected either as a master or slave.

Figure 99 shows the PrimeCell SSP (PL022) instantiated twice, as a single master and one slave. The master can broadcast to the slave through the master SSPTXD line. In response, the slave drives its nSSPOE signal HIGH, enabling its SSPTXD data onto the SSPRXD line of the master.

Figure 99. PrimeCell SSP master coupled to a PL022 slave

Schematic diagram showing the connection between a PL022 configured as master and a PL022 configured as slave.

The diagram shows two PL022 blocks. The left block is 'PL022 configured as master' and the right block is 'PL022 configured as slave'. The connections are as follows: Master SSPTXD to Slave SSPRXD; Master nSSPOE to Slave nSSPOE; Master SSPRXD to Slave SSPTXD; Master SSPFSSOUT to Slave SSPFSSIN; Master SSPFSSIN to GND (0V); Master SSPCLKOUT to Slave SSPCLKIN; Master nSSPCTLOE to Slave nSSPCTLOE; Master SSPCLKIN to GND (0V); and Master SSPCLKOUT to Slave SSPCLKOUT.

Schematic diagram showing the connection between a PL022 configured as master and a PL022 configured as slave.

Figure 100 shows how an PrimeCell SSP (PL022), configured as master, interfaces to a Motorola SPI slave. The SPI Slave Select (SS) signal is permanently tied LOW and configures it as a slave. Similar to the above operation, the master can broadcast to the slave through the master PrimeCell SSP SSPTXD line. In response, the slave drives its SPI MISO port onto the SSPRXD line of the master.

Figure 100. PrimeCell SSP master coupled to an SPI slave

Figure 100: PrimeCell SSP master coupled to an SPI slave. The diagram shows two blocks: 'PL022 configured as master' on the left and 'SPI slave' on the right. The PL022 block has pins: SSPTXD, nSSPOE, SSPRXD, SSPFSSOUT, SSPFSSIN (tied to OV), SSPCLKOUT, nSSPCTL0E, and SSPCLKIN (tied to OV). The SPI slave block has pins: MOSI, MISO, SCK, and SS (tied to Vdd). Connections: SSPTXD is connected to MOSI via two inverters. nSSPOE is connected to MOSI via one inverter. SSPRXD is connected to MISO via two inverters. SSPCLKOUT is connected to SCK via two inverters. nSSPCTL0E is connected to SCK via one inverter. SSPFSSIN is tied to OV. SSPCLKIN is tied to OV.
Figure 100: PrimeCell SSP master coupled to an SPI slave. The diagram shows two blocks: 'PL022 configured as master' on the left and 'SPI slave' on the right. The PL022 block has pins: SSPTXD, nSSPOE, SSPRXD, SSPFSSOUT, SSPFSSIN (tied to OV), SSPCLKOUT, nSSPCTL0E, and SSPCLKIN (tied to OV). The SPI slave block has pins: MOSI, MISO, SCK, and SS (tied to Vdd). Connections: SSPTXD is connected to MOSI via two inverters. nSSPOE is connected to MOSI via one inverter. SSPRXD is connected to MISO via two inverters. SSPCLKOUT is connected to SCK via two inverters. nSSPCTL0E is connected to SCK via one inverter. SSPFSSIN is tied to OV. SSPCLKIN is tied to OV.

Figure 101 shows a Motorola SPI configured as a master and interfaced to an instance of a PrimeCell SSP (PL022) configured as a slave. In this case, the slave Select Signal (SS) is permanently tied HIGH to configure it as a master. The master can broadcast to the slave through the master SPI MOSI line and in response, the slave drives its nSSPOE signal LOW. This enables its SSPTXD data onto the MISO line of the master.

Figure 101. SPI master coupled to a PrimeCell SSP slave

Figure 101: SPI master coupled to a PrimeCell SSP slave. The diagram shows two blocks: 'SPI master' on the left and 'PL022 configured as slave' on the right. The SPI master block has pins: MOSI, MISO, SCK, and SS (tied to Vdd). The PL022 block has pins: SSPRXD, nSSPOE, SSPTXD, SSPFSSIN (tied to OV), SSPFSSOUT, SSPCLKIN, nSSPCTL0E, and SSPCLKOUT. Connections: MOSI is connected to SSPRXD via two inverters. MISO is connected to SSPTXD via two inverters. SCK is connected to SSPCLKIN via two inverters. nSSPOE is connected to SSPTXD via one inverter. SSPFSSIN is tied to OV. SS is tied to Vdd. SSPCLKOUT is not connected.
Figure 101: SPI master coupled to a PrimeCell SSP slave. The diagram shows two blocks: 'SPI master' on the left and 'PL022 configured as slave' on the right. The SPI master block has pins: MOSI, MISO, SCK, and SS (tied to Vdd). The PL022 block has pins: SSPRXD, nSSPOE, SSPTXD, SSPFSSIN (tied to OV), SSPFSSOUT, SSPCLKIN, nSSPCTL0E, and SSPCLKOUT. Connections: MOSI is connected to SSPRXD via two inverters. MISO is connected to SSPTXD via two inverters. SCK is connected to SSPCLKIN via two inverters. nSSPOE is connected to SSPTXD via one inverter. SSPFSSIN is tied to OV. SS is tied to Vdd. SSPCLKOUT is not connected.

4.4.3.16. PrimeCell DMA interface

The PrimeCell SSP provides an interface to connect to the DMA controller. The PrimeCell SSP DMA control register, SSPDMACR controls the DMA operation of the PrimeCell SSP.

The DMA interface includes the following signals, for receive:

SSPRXDMSREQ

Single-character DMA transfer request, asserted by the SSP. This signal is asserted when the receive FIFO contains at least one character.

SSPRXDMABREQ

Burst DMA transfer request, asserted by the SSP. This signal is asserted when the receive FIFO contains four or more characters.

SSPRXDMACLR

DMA request clear, asserted by the DMA controller to clear the receive request signals. If DMA burst transfer is requested, the clear signal is asserted during the transfer of the last data in the burst.

The DMA interface includes the following signals, for transmit:

SSPTXDMASREQ

Single-character DMA transfer request, asserted by the SSP. This signal is asserted when there is at least one empty location in the transmit FIFO.

SSPTXDMABREQ

Burst DMA transfer request, asserted by the SSP. This signal is asserted when the transmit FIFO contains four characters or fewer.

SSPTXDMACLR

DMA request clear, asserted by the DMA controller, to clear the transmit request signals. If a DMA burst transfer is requested, the clear signal is asserted during the transfer of the last data in the burst.

The burst transfer and single transfer request signals are not mutually exclusive. They can both be asserted at the same time. For example, when there is more data than the watermark level of four in the receive FIFO, the burst transfer request, and the single transfer request, are asserted. When the amount of data left in the receive FIFO is less than the watermark level, the single request only is asserted. This is useful for situations where the number of characters left to be received in the stream is less than a burst.

For example, if 19 characters must be received, the DMA controller then transfers four bursts of four characters, and three single transfers to complete the stream.

NOTE

For the remaining three characters, the PrimeCell SSP does not assert the burst request.

Each request signal remains asserted until the relevant DMA clear signal is asserted. After the request clear signal is deasserted, a request signal can become active again, depending on the conditions that previous sections describe. All request signals are deasserted if the PrimeCell SSP is disabled, or the DMA enable signal is cleared.

Table 495 shows the trigger points for DMABREQ, for both the transmit and receive FIFOs.

Table 495. DMA trigger points for the transmit and receive FIFOs

Burst length
Watermark levelTransmit, number of empty locationsReceive, number of filled locations
1/244

Figure 102 shows the timing diagram for both a single transfer request, and a burst transfer request, with the appropriate DMA clear signal. The signals are all synchronous to PCLK.

Figure 102. DMA transfer waveforms

Timing diagram showing PCLK, DMASREQ, DMABREQ, and DMACLR signals. DMASREQ and DMABREQ are asserted at specific PCLK cycles and deasserted by DMACLR.

The diagram shows four digital signals over time, synchronized to a PCLK clock. PCLK is a periodic square wave. DMASREQ (single transfer request) is asserted at PCLK cycles 1, 2, 3, and 4, then deasserted at cycle 5. DMABREQ (burst transfer request) is asserted at PCLK cycles 1, 2, 3, and 4, then deasserted at cycle 5. DMACLR (DMA request clear) is asserted at PCLK cycle 5 and remains asserted until cycle 10, after which it is deasserted. The signals are all synchronous to the PCLK clock.

Timing diagram showing PCLK, DMASREQ, DMABREQ, and DMACLR signals. DMASREQ and DMABREQ are asserted at specific PCLK cycles and deasserted by DMACLR.

4.4.4. List of Registers

The SPI0 and SPI1 registers start at base addresses of 0x4003c000 and 0x40040000 respectively (defined as SPI0_BASE and SPI1_BASE in SDK).

Table 496. List of SPI registers

OffsetNameInfo
0x000SSPCR0Control register 0, SSPCR0 on page 3-4
0x004SSPCR1Control register 1, SSPCR1 on page 3-5
0x008SSPDRData register, SSPDR on page 3-6
0x00cSSPSRStatus register, SSPSR on page 3-7
0x010SSPCPSRClock prescale register, SSPCPSR on page 3-8
OffsetNameInfo
0x014SSPIMSCInterrupt mask set or clear register, SSPIMSC on page 3-9
0x018SSPRISRaw interrupt status register, SSPRIS on page 3-10
0x01cSSPMISMasked interrupt status register, SSPMIS on page 3-11
0x020SSPICRInterrupt clear register, SSPICR on page 3-11
0x024SSPDMACRDMA control register, SSPDMACR on page 3-12
0xfe0SSPPERIPHID0Peripheral identification registers, SSPPeriphID0-3 on page 3-13
0xfe4SSPPERIPHID1Peripheral identification registers, SSPPeriphID0-3 on page 3-13
0xfe8SSPPERIPHID2Peripheral identification registers, SSPPeriphID0-3 on page 3-13
0xfecSSPPERIPHID3Peripheral identification registers, SSPPeriphID0-3 on page 3-13
0xff0SSPPCELLID0PrimeCell identification registers, SSPPCellID0-3 on page 3-16
0xff4SSPPCELLID1PrimeCell identification registers, SSPPCellID0-3 on page 3-16
0xff8SSPPCELLID2PrimeCell identification registers, SSPPCellID0-3 on page 3-16
0xffcSSPPCELLID3PrimeCell identification registers, SSPPCellID0-3 on page 3-16

SPI: SSPCR0 Register

Offset: 0x000

Description

Control register 0, SSPCR0 on page 3-4

Table 497. SSPCR0 Register

BitsDescriptionTypeReset
31:16Reserved.--
15:8SCR : Serial clock rate. The value SCR is used to generate the transmit and receive bit rate of the PrimeCell SSP. The bit rate is: \( F_{SSPCLK} \times \text{CPSDVSR} \times (1 + \text{SCR}) \) where CPSDVSR is an even value from 2-254, programmed through the SSPCPSR register and SCR is a value from 0-255.RW0x00
7SPH : SSPCLKOUT phase, applicable to Motorola SPI frame format only. See Motorola SPI frame format on page 2-10.RW0x0
6SPO : SSPCLKOUT polarity, applicable to Motorola SPI frame format only. See Motorola SPI frame format on page 2-10.RW0x0
5:4FRF : Frame format: 00 Motorola SPI frame format. 01 TI synchronous serial frame format. 10 National Microwire frame format. 11 Reserved, undefined operation.RW0x0
3:0DSS : Data Size Select: 0000 Reserved, undefined operation. 0001 Reserved, undefined operation. 0010 Reserved, undefined operation. 0011 4-bit data. 0100 5-bit data. 0101 6-bit data. 0110 7-bit data. 0111 8-bit data. 1000 9-bit data. 1001 10-bit data. 1010 11-bit data. 1011 12-bit data. 1100 13-bit data. 1101 14-bit data. 1110 15-bit data. 1111 16-bit data.RW0x0

SPI: SSPCR1 Register

Offset: 0x004

Description

Control register 1, SSPCR1 on page 3-5

Table 498. SSPCR1 Register

Bits Register 31:0 Bitscolumn_2Description DescriptionType RO TypeReset 0x00000001 Reset
31:4Reserved.--
3SOD: Slave-mode output disable. This bit is relevant only in the slave mode, slave drives data onto its serial output line. In such systems the RXD linesRW0x0
2MSnot drive the SSPTXD output in slave mode. : Master or slave mode select. This bit can be modified only when the Device configured as slave.RW0x0
1SSE: Synchronous serial port enable: 0 SSP operation disabled. 1 SSP operation enabled.RW0x0
0LBM: Loop back mode: 0 Normal serial port operation enabled. 1 Output ofRW0x0
BitsDescriptionTypeReset
31:16Reserved.--
15:0DATA: Transmit/Receive FIFO: Read Receive FIFO. Write Transmit FIFO. You The receive logic automatically right-justifies.RWF-
BitsDescriptionTypeReset
31:5Reserved.--
4BSY: PrimeCell SSP busy flag, RO: 0 SSP is idle. 1 SSP is currently transmitting and/or receiving a frame or the transmit FIFO is not empty.RO0x0
3RFF: Receive FIFO full, RO: 0 Receive FIFO is not full. 1 Receive FIFO is full.RO0x0
2RNE: Receive FIFO not empty, RO: 0 Receive FIFO is empty. 1 Receive FIFO is not empty.RO0x0
1TNF full.: Transmit FIFO not full, RO: 0 Transmit FIFO is full. 1 Transmit FIFO is notRO0x1
0TFE: Transmit FIFO empty, RO: 0 Transmit FIFO is not empty. 1 Transmit FIFO is empty.RO0x1

SPI: SSPDR Register

Offset: 0x008

Description

Data register, SSPDR on page 3-6

Table 499. SSPDR Register

SPI: SSPSR Register

Offset: 0x00c

Description

Status register, SSPSR on page 3-7

Table 500. SSPSR Register

SPI: SSPCPSR Register

Offset: 0x010

Description

Clock prescale register, SSPCPSR on page 3-8

Table 501. SSPCPSR Register

BitsDescriptionTypeReset
31:8Reserved.--
7:0CPSDVSR : Clock prescale divisor. Must be an even number from 2-254, depending on the frequency of SSPCLK. The least significant bit always returns zero on reads.RW0x00

SPI: SSPIMSC Register

Offset: 0x014

Description

Interrupt mask set or clear register, SSPIMSC on page 3-9

Table 502. SSPIMSC Register

BitsDescriptionTypeReset
31:4Reserved.--
3TXIM : Transmit FIFO interrupt mask: 0 Transmit FIFO half empty or less condition interrupt is masked. 1 Transmit FIFO half empty or less condition interrupt is not masked.RW0x0
2RXIM : Receive FIFO interrupt mask: 0 Receive FIFO half full or less condition interrupt is masked. 1 Receive FIFO half full or less condition interrupt is not masked.RW0x0
1RTIM : Receive timeout interrupt mask: 0 Receive FIFO not empty and no read prior to timeout period interrupt is masked. 1 Receive FIFO not empty and no read prior to timeout period interrupt is not masked.RW0x0
0RORIM : Receive overrun interrupt mask: 0 Receive FIFO written to while full condition interrupt is masked. 1 Receive FIFO written to while full condition interrupt is not masked.RW0x0

SPI: SSPRIS Register

Offset: 0x018

Description

Raw interrupt status register, SSPRIS on page 3-10

Table 503. SSPRIS Register

BitsDescriptionTypeReset
31:4Reserved.--
3TXRIS : Gives the raw interrupt state, prior to masking, of the SSPTXINTR interruptRO0x1
2RXRIS : Gives the raw interrupt state, prior to masking, of the SSPRXINTR interruptRO0x0
1RTRIS : Gives the raw interrupt state, prior to masking, of the SSPRTINTR interruptRO0x0
BitsDescriptionTypeReset
0RORRIS : Gives the raw interrupt state, prior to masking, of the SSPRORINTR interruptRO0x0

SPI: SSPMIS Register

Offset: 0x01c

Description

Masked interrupt status register, SSPMIS on page 3-11

Table 504. SSPMIS Register

BitsDescriptionTypeReset
31:4Reserved.--
3TXMIS : Gives the transmit FIFO masked interrupt state, after masking, of the SSPTXINTR interruptRO0x0
2RXMIS : Gives the receive FIFO masked interrupt state, after masking, of the SSPRXINTR interruptRO0x0
1RTMIS : Gives the receive timeout masked interrupt state, after masking, of the SSPRTINTR interruptRO0x0
0RORMIS : Gives the receive over run masked interrupt status, after masking, of the SSPRORINTR interruptRO0x0

SPI: SSPICR Register

Offset: 0x020

Description

Interrupt clear register, SSPICR on page 3-11

Table 505. SSPICR Register

BitsDescriptionTypeReset
31:2Reserved.--
1RTIC : Clears the SSPRTINTR interruptWC0x0
0RORIC : Clears the SSPRORINTR interruptWC0x0

SPI: SSPDMACR Register

Offset: 0x024

Description

DMA control register, SSPDMACR on page 3-12

Table 506. SSPDMACR Register

BitsDescriptionTypeReset
31:2Reserved.--
1TXDMAE : Transmit DMA Enable. If this bit is set to 1, DMA for the transmit FIFO is enabled.RW0x0
0RXDMAE : Receive DMA Enable. If this bit is set to 1, DMA for the receive FIFO is enabled.RW0x0

SPI: SSPPERIPHID0 Register

Offset: 0xfe0

Description

Peripheral identification registers, SSPPeriphID0-3 on page 3-13

Table 507.
SSPPERIPHID0
Register

BitsDescriptionTypeReset
31:8Reserved.--
7:0PARTNUMBER0 : These bits read back as 0x22RO0x22

SPI: SSPPERIPHID1 Register

Offset: 0xfe4

Description

Peripheral identification registers, SSPPeriphID0-3 on page 3-13

Table 508.
SSPPERIPHID1
Register

BitsDescriptionTypeReset
31:8Reserved.--
7:4DESIGNER0 : These bits read back as 0x1RO0x1
3:0PARTNUMBER1 : These bits read back as 0x0RO0x0

SPI: SSPPERIPHID2 Register

Offset: 0xfe8

Description

Peripheral identification registers, SSPPeriphID0-3 on page 3-13

Table 509.
SSPPERIPHID2
Register

BitsDescriptionTypeReset
31:8Reserved.--
7:4REVISION : These bits return the peripheral revisionRO0x3
3:0DESIGNER1 : These bits read back as 0x4RO0x4

SPI: SSPPERIPHID3 Register

Offset: 0xfec

Description

Peripheral identification registers, SSPPeriphID0-3 on page 3-13

Table 510.
SSPPERIPHID3
Register

BitsDescriptionTypeReset
31:8Reserved.--
7:0CONFIGURATION : These bits read back as 0x00RO0x00

SPI: SSPPCELLID0 Register

Offset: 0xff0

Description

PrimeCell identification registers, SSPPCellID0-3 on page 3-16

Table 511.
SSPPCELLID0 Register

BitsDescriptionTypeReset
31:8Reserved.--
7:0SSPPCELLID0 : These bits read back as 0x0DRO0x0d

SPI: SSPPCELLID1 Register

Offset: 0xff4

Description

PrimeCell identification registers, SSPPCellIID0-3 on page 3-16

Table 512.
SSPPCELLID1 Register

BitsDescriptionTypeReset
31:8Reserved.--
7:0SSPPCELLID1 : These bits read back as 0xF0RO0xf0

SPI: SSPPCELLID2 Register

Offset: 0xff8

Description

PrimeCell identification registers, SSPPCellIID0-3 on page 3-16

Table 513.
SSPPCELLID2 Register

BitsDescriptionTypeReset
31:8Reserved.--
7:0SSPPCELLID2 : These bits read back as 0x05RO0x05

SPI: SSPPCELLID3 Register

Offset: 0xffc

Description

PrimeCell identification registers, SSPPCellIID0-3 on page 3-16

Table 514.
SSPPCELLID3 Register

BitsDescriptionTypeReset
31:8Reserved.--
7:0SSPPCELLID3 : These bits read back as 0xB1RO0xb1