4.10. SSI

Synopsys Documentation

Synopsys Proprietary. Used with permission.

RP2040 has a Synchronous Serial Interface (SSI) controller which appears on the QSPI pins and is used to communicate with external Flash devices. The SSI forms part of the XIP block.

The SSI controller is based on a configuration of the Synopsys DW_apb_ssi IP (v4.01a).

4.10.1. Overview

In order for the DW_apb_ssi to connect to a serial-master or serial-slave peripheral device, the peripheral must have a least one of the following interfaces:

Motorola Serial Peripheral Interface (SPI)

A four-wire, full-duplex serial protocol from Motorola. There are four possible combinations for the serial clock phase and polarity. The clock phase (SCPH) determines whether the serial transfer begins with the falling edge of the slave select signal or the first edge of the serial clock. The slave select line is held high when the DW_apb_ssi is idle or disabled.

Texas Instruments Serial Protocol (SSP)

A four-wire, full-duplex serial protocol. The slave select line used for SPI and Microwire protocols doubles as the frame indicator for the SSP protocol.

National Semiconductor Microwire

A half-duplex serial protocol, which uses a control word transmitted from the serial master to the target serial slave.

You can program the FRF (frame format) bit field in the Control Register 0 (CTRLR0) to select which protocol is used.

The serial protocols supported by the DW_apb_ssi allow for serial slaves to be selected or addressed using either hardware or software. When implemented in hardware, serial slaves are selected under the control of dedicated hardware select lines. The number of select lines generated from the serial master is equal to the number of serial slaves present on the bus. The serial-master device asserts the select line of the target serial slave before data transfer begins. This architecture is illustrated in Figure 118 .

When implemented in software, the input select line for all serial slave devices should originate from a single slave select output on the serial master. In this mode it is assumed that the serial master has only a single slave select output. If there are multiple serial masters in the system, the slave select output from all masters can be logically ANDed to generate a single slave select input for all serial slave devices. The main program in the software domain controls selection of the target slave device; this architecture is illustrated in Figure 118 . Software would use the SSIENR register in all slaves in order to control which slave is to respond to the serial transfer request from the master device.

The DW_apb_ssi does not enforce hardware or software control for serial-slave device selection. You can configure the DW_apb_ssi for either implementation, illustrated in Figure 118 .

Figure 118.
Hardware/Software
Slave Selection.

Figure 118: Hardware/Software Slave Selection. Two block diagrams, A and B, showing Master-Slave communication. Diagram A shows hardware selection with multiple slave select lines (ss_0, ss_x) from the Master to individual Slaves. Diagram B shows software selection with a single slave select line (ss) from the Master to multiple Slaves. Both diagrams show a shared Data Bus between Master and Slaves. A legend indicates 'ss = slave select line'.

Diagram A (Hardware Selection): A Master block (green) has multiple slave select outputs labeled ss_0 and ss_x. Each output connects to a corresponding slave select input labeled ss on a Slave block (blue). Multiple Slave blocks are shown, each with its own dedicated ss line from the Master. A shared Data Bus connects the Master to all Slaves.

Diagram B (Software Selection): A Master block (green) has a single slave select output labeled ss. This output connects to the slave select input labeled ss on all Slave blocks (blue). Multiple Slave blocks share the same ss line from the Master. A shared Data Bus connects the Master to all Slaves.

Legend: ss= slave select line

Figure 118: Hardware/Software Slave Selection. Two block diagrams, A and B, showing Master-Slave communication. Diagram A shows hardware selection with multiple slave select lines (ss_0, ss_x) from the Master to individual Slaves. Diagram B shows software selection with a single slave select line (ss) from the Master to multiple Slaves. Both diagrams show a shared Data Bus between Master and Slaves. A legend indicates 'ss = slave select line'.

4.10.2. Features

The DW_apb_ssi is a configurable and programmable component that is a full-duplex master serial interface. The host processor accesses data, control, and status information on the DW_apb_ssi through the APB interface. The DW_apb_ssi also interfaces with the DMA Controller for bulk data transfer.

The DW_apb_ssi is configured as a serial master. The DW_apb_ssi can connect to any serial-slave peripheral device using one of the following interfaces:

On RP2040, the DW_apb_ssi is a component of the flash execute-in-place subsystem (see Section 2.6.3 ), and provides communication with an external SPI, dual-SPI or quad-SPI flash device.

4.10.2.1. IO connections

The SSI controller connects to the following pins:

Some pins on the IP are tied off as not used:

Clock connections are as follows:

4.10.3. IP Modifications

The following modifications were made to the Synopsys DW_apb_ssi hardware:

  1. 1. XIP accesses are byte-swapped, such that the least-addressed byte is in the least-significant position
  2. 2. When SPI_CTRLR0_INST_L is 0, the XIP instruction field is appended to the end of the address for XIP accesses, rather than prepended to the beginning
  3. 3. The reset value of DMARDLR is increased from 0 to 4. The SSI to DMA handshaking on RP2040 requests only single transfers or bursts of four, depending on whether the RX FIFO level has reached DMARDLR , so DMARDLR should not be changed from this value.

The first of these changes allows mixed-size accesses by a little-endian busmaster, such as the RP2040 DMA, or the Cortex-M0+ configuration used on RP2040. Note that this only applies to XIP accesses (RP2040 system addresses in the range 0x10000000 to 0x13ffffff ), not to direct access to the DW_apb_ssi FIFOs. When accessing the SSI directly, it may be necessary for software to swap bytes manually, or to use the RP2040 DMA's byte swap feature.

The second supports issuing of continuation bits following the XIP address, so that command-prefix-free XIP modes can be supported (e.g. EBh Quad I/O Fast Read on Winbond devices), for greater performance. For example, the following configuration would be used to issue a standard 03h serial read command for each access to the XIP address window:

This will first issue eight command bits ( 0x03 ), then issue 24 address bits, then clock in the data bits. The configuration used for EBh quad read, after the flash has entered the XIP state, would be:

For each XIP access, the DW_apb_ssi will issue 32 "address" bits, consisting of the 24 LSBs of the RP2040 system bus

address, followed by the 8-bit continuation code 0xa0. No command prefix is issued.

4.10.3.1. Example of Target Slave Selection Using Software

The following example is pseudo code that illustrates how to use software to select the target slave.

1 int main() {
2     disable_all_serial_devices(); ①
3     initialize_mst(ssi_mst_1); ②
4     initialize_slv(ssi_slv_1); ③
5     start_serial_xfer(ssi_mst_1); ④
6 }

① This function sets the SSLEN bit to logic '0' in the SSIENR register of each device on the serial bus.

② This function initializes the master device for the serial transfer;

  1. 1. Write CTRLR0 to match the required transfer
  2. 2. If transfer is receive only write number of frames into CTRLR1
  3. 3. Write BAUDR to set the transfer baud rate.
  4. 4. Write TXFTLR and RXFTLR to set FIFO threshold levels
  5. 5. Write IMR register to set interrupt masks
  6. 6. Write SER register bit[0] to logic '1'
  7. 7. Write SSIENR register bit[0] to logic '1' to enable the master.

③ This function initializes the target slave device (slave 1 in this example) for the serial transfer;

  1. 1. Write CTRLR0 to match the required transfer
  2. 2. Write TXFTLR and RXFTLR to set FIFO threshold levels
  3. 3. Write IMR register to set interrupt masks
  4. 4. Write SSIENR register bit[0] to logic '1' to enable the slave.
  5. 5. If the slave is to transmit data, write data into TX FIFO. Now the slave is enabled and awaiting an active level on its ss_in_n input port. Note all other serial slaves are disabled (SSLEN=0) and therefore will not respond to an active level on their ss_in_n port.

④ This function begins the serial transfer by writing transmit data into the master's TX FIFO. User can poll the busy status with a function or use an ISR to determine when the serial transfer has completed.

4.10.4. Clock Ratios

The maximum frequency of the bit-rate clock (sclk_out) is one-half the frequency of ssi_clk. This allows the shift control logic to capture data on one clock edge of sclk_out and propagate data on the opposite edge.

Figure 119 illustrates the maximum ratio between sclk_out and ssi_clk.

Figure 119. Maximum \( sclk\_out/ssi\_clk \) Ratio.

Timing diagram showing the relationship between ssi_clk, sclk_out, and txd/rxd signals. The diagram illustrates the capture and drive phases for multiple data transfers. ssi_clk is a periodic clock signal. sclk_out is a clock signal that toggles during active transfers. txd/rxd shows the data being transferred, with the MSB (Most Significant Bit) indicated. The diagram shows three capture phases (capture, capture1, capture2, capture3) and three drive phases (drive1, drive2, drive3).
Timing diagram showing the relationship between ssi_clk, sclk_out, and txd/rxd signals. The diagram illustrates the capture and drive phases for multiple data transfers. ssi_clk is a periodic clock signal. sclk_out is a clock signal that toggles during active transfers. txd/rxd shows the data being transferred, with the MSB (Most Significant Bit) indicated. The diagram shows three capture phases (capture, capture1, capture2, capture3) and three drive phases (drive1, drive2, drive3).

The \( sclk\_out \) line toggles only when an active transfer is in progress. At all other times it is held in an inactive state, as defined by the serial protocol under which it operates.

The frequency of \( sclk\_out \) can be derived from the following equation:

\[ F_{sclk\_out} = \frac{F_{ssi\_clk}}{SCKDV} \]

SCKDV is a bit field in the programmable register BAUDR, holding any even value in the range 0 to 65,534. If SCKDV is 0, then \( sclk\_out \) is disabled.

4.10.4.1. Frequency Ratio Summary

A summary of the frequency ratio restrictions between the bit-rate clock ( \( sclk\_out \) ) and the DW_apb_ssi peripheral clock ( \( ssi\_clk \) ) are as follows:

4.10.5. Transmit and Receive FIFO Buffers

The FIFO buffers used by the DW_apb_ssi are internal D-type flip-flops that are 16 entries deep. The width of both transmit and receive FIFO buffers is fixed at 32 bits, due to the serial specifications, which state that a serial transfer (data frame) can be 4 to 16/32 bits in length. Data frames that are less than 32 bits must be right-justified when written into the transmit FIFO buffer. The shift control logic automatically right-justifies receive data in the receive FIFO buffer.

Each data entry in the FIFO buffers contains a single data frame. It is impossible to store multiple data frames in a single FIFO location; for example, you may not store two 8-bit data frames in a single FIFO location. If an 8-bit data frame is required, the upper bits of the FIFO entry are ignored or unused when the serial shifter transmits the data.

i NOTE

The transmit and receive FIFO buffers are cleared when the DW_apb_ssi is disabled (SSI_EN = 0) or when it is reset (presetrn).

The transmit FIFO is loaded by APB write commands to the DW_apb_ssi data register (DR). Data are popped (removed) from the transmit FIFO by the shift control logic into the transmit shift register. The transmit FIFO generates a FIFO empty interrupt request ( \( ssi\_txe\_intr \) ) when the number of entries in the FIFO is less than or equal to the FIFO threshold value. The threshold value, set through the programmable register TXFTLR, determines the level of FIFO entries at which an interrupt is generated. The threshold value allows you to provide early indication to the processor that the transmit FIFO is nearly empty. A transmit FIFO overflow interrupt ( \( ssi\_txo\_intr \) ) is generated if you attempt to write data into an already full transmit FIFO.

Data are popped from the receive FIFO by APB read commands to the DW_apb_ssi data register (DR). The receive FIFO is loaded from the receive shift register by the shift control logic. The receive FIFO generates a FIFO-full interrupt request ( \( ssi\_rxf\_intr \) ) when the number of entries in the FIFO is greater than or equal to the FIFO threshold value plus one. The threshold value, set through programmable register RXFTLR, determines the level of FIFO entries at which an interrupt is generated.

The threshold value allows you to provide early indication to the processor that the receive FIFO is nearly full. A receive FIFO overrun interrupt ( \( ssi\_rxo\_intr \) ) is generated when the receive shift logic attempts to load data into a completely full receive FIFO. However, this newly received data are lost. A receive FIFO underflow interrupt ( \( ssi\_rxu\_intr \) ) is generated if

you attempt to read from an empty receive FIFO. This alerts the processor that the read data are invalid.

Table 577 provides description for different Transmit FIFO Threshold values.

Table 577. Transmit
FIFO Threshold (TFT)
Decode Values

TFT ValueDescription
0000_0000ssi_txe_intr is asserted when zero data entries are present in transmit FIFO
0000_0001ssi_txe_intr is asserted when one or less data entry is present in transmit FIFO
0000_0010ssi_txe_intr is asserted when two or less data entries are present in transmit FIFO
......
0000_1101ssi_txe_intr is asserted when 13 or less data entries are present in transmit FIFO
0000_1110ssi_txe_intr is asserted when 14 or less data entries are present in transmit FIFO
0000_1111ssi_txe_intr is asserted when 15 or less data entries are present in transmit FIFO

Table 578 provides description for different Receive FIFO Threshold values.

Table 578. Receive
FIFO Threshold (RFT)
Decode Values

RFT ValueDescription
0000_0000ssi_rxf_intr is asserted when one or more data entry is present in receive FIFO
0000_0001ssi_rxf_intr is asserted when two or more data entries are present in receive FIFO
0000_0010ssi_rxf_intr is asserted when three or more data entries are present in receive FIFO
......
0000_1101ssi_rxf_intr is asserted when 14 or more data entries are present in receive FIFO
0000_1110ssi_rxf_intr is asserted when 15 or more data entries are present in receive FIFO
0000_1111ssi_rxf_intr is asserted when 16 data entries are present in receive FIFO

4.10.6. 32-Bit Frame Size Support

The IP is configured to set the maximum programmable value in of data frame size to 32 bits. As a result the following features exist:

4.10.7. SSI Interrupts

The DW_apb_ssi supports combined and individual interrupt requests, each of which can be masked. The combined interrupt request is the ORed result of all other DW_apb_ssi interrupts after masking. Only the combined interrupt request is routed to the Interrupt Controller. All DW_apb_ssi interrupts are level interrupts and are active high.

The DW_apb_ssi interrupts are described as follows:

Transmit FIFO Empty Interrupt (ssi_txe_intr)

Set when the transmit FIFO is equal to or below its threshold value and requires service to prevent an under-run. The threshold value, set through a software-programmable register, determines the level of transmit FIFO entries at which an interrupt is generated. This interrupt is cleared by hardware when data are written into the transmit FIFO buffer, bringing it over the threshold level.

Transmit FIFO Overflow Interrupt (ssi_txo_intr)

Set when an APB access attempts to write into the transmit FIFO after it has been completely filled. When set, data written from the APB is discarded. This interrupt remains set until you read the transmit FIFO overflow interrupt clear register (TXOICR).

Receive FIFO Full Interrupt (ssi_rxf_intr)

Set when the receive FIFO is equal to or above its threshold value plus 1 and requires service to prevent an overflow. The threshold value, set through a software-programmable register, determines the level of receive FIFO entries at which an interrupt is generated. This interrupt is cleared by hardware when data are read from the receive FIFO buffer, bringing it below the threshold level.

Receive FIFO Overflow Interrupt (ssi_rxo_intr)

Set when the receive logic attempts to place data into the receive FIFO after it has been completely filled. When set, newly received data are discarded. This interrupt remains set until you read the receive FIFO overflow interrupt clear register (RXOICR).

Receive FIFO Underflow Interrupt (ssi_rxu_intr)

Set when an APB access attempts to read from the receive FIFO when it is empty. When set, 0s are read back from the receive FIFO. This interrupt remains set until you read the receive FIFO underflow interrupt clear register (RXUICR).

Multi-Master Contention Interrupt (ssi_mst_intr)

Present only when the DW_apb_ssi component is configured as a serial-master device. The interrupt is set when another serial master on the serial bus selects the DW_apb_ssi master as a serial-slave device and is actively transferring data. This informs the processor of possible contention on the serial bus. This interrupt remains set until you read the multi-master interrupt clear register (MSTICR).

Combined Interrupt Request (ssi_intr)

OR'ed result of all the above interrupt requests after masking. To mask this interrupt signal, you must mask all other DW_apb_ssi interrupt requests.

4.10.8. Transfer Modes

When transferring data on the serial bus, the DW_apb_ssi operates in the modes discussed in this section. The transfer mode (TMOD) is set by writing to control register 0 (CTRLR0).

i NOTE

The transfer mode setting does not affect the duplex of the serial transfer. TMOD is ignored for Microwire transfers, which are controlled by the MWCR register.

4.10.8.1. Transmit and Receive

When TMOD = 00b, both transmit and receive logic are valid. The data transfer occurs as normal according to the selected frame format (serial protocol). Transmit data are popped from the transmit FIFO and sent through the txd line to the target device, which replies with data on the rxd line. The receive data from the target device is moved from the receive shift register into the receive FIFO at the end of each data frame.

4.10.8.2. Transmit Only

When TMOD = 01b, the receive data are invalid and should not be stored in the receive FIFO. The data transfer occurs as normal, according to the selected frame format (serial protocol). Transmit data are popped from the transmit FIFO and sent through the txd line to the target device, which replies with data on the rxd line. At the end of the data frame, the receive shift register does not load its newly received data into the receive FIFO. The data in the receive shift register is

overwritten by the next transfer. You should mask interrupts originating from the receive logic when this mode is entered.

4.10.8.3. Receive Only

When TMOD = 10b, the transmit data are invalid. When configured as a slave, the transmit FIFO is never popped in Receive Only mode. The txd output remains at a constant logic level during the transmission. The data transfer occurs as normal according to the selected frame format (serial protocol). The receive data from the target device is moved from the receive shift register into the receive FIFO at the end of each data frame. You should mask interrupts originating from the transmit logic when this mode is entered.

4.10.8.4. EEPROM Read

i NOTE

This transfer mode is only valid for master configurations.

When TMOD = 11b, the transmit data is used to transmit an opcode and/or an address to the EEPROM device. Typically this takes three data frames (8-bit opcode followed by 8-bit upper address and 8-bit lower address). During the transmission of the opcode and address, no data is captured by the receive logic (as long as the DW_apb_ssi master is transmitting data on its txd line, data on the rx line is ignored). The DW_apb_ssi master continues to transmit data until the transmit FIFO is empty. Therefore, you should ONLY have enough data frames in the transmit FIFO to supply the opcode and address to the EEPROM. If more data frames are in the transmit FIFO than are needed, then read data is lost.

When the transmit FIFO becomes empty (all control information has been sent), data on the receive line ( rx) is valid and is stored in the receive FIFO; the txd output is held at a constant logic level. The serial transfer continues until the number of data frames received by the DW_apb_ssi master matches the value of the NDF field in the CTRLR1 register + 1.

i NOTE

EEPROM read mode is not supported when the DW_apb_ssi is configured to be in the SSP mode.

4.10.9. Operation Modes

The DW_apb_ssi can be configured in the fundamental modes of operation discussed in this section.

4.10.9.1. Serial Master Mode

This mode enables serial communication with serial-slave peripheral devices. When configured as a serial-master device, the DW_apb_ssi initiates and controls all serial transfers. Figure 120 shows an example of the DW_apb_ssi configured as a serial master with all other devices on the serial bus configured as serial slaves.

Figure 120.
DW_apb_ssi
Configured as Master
Device

Figure 120: DW_apb_ssi Master 1 connected to Slave Peripheral 1 and Slave Peripheral n. The diagram shows the internal signals of the master (txd, ssi_oe_n, rxd, sclk_out, ss_n[0], ss_n[1], ss_in_n) and how they are connected to the slave peripherals (DI, DO, SCLK, SS). A Glue Logic block is shown between the master and the slaves. A note states: 'Should be driven to inactive level (protocol-dependent) in single master systems; may not need glue logic'.

Should be driven to inactive level
(protocol-dependent) in single master
systems; may not need glue logic

Figure 120: DW_apb_ssi Master 1 connected to Slave Peripheral 1 and Slave Peripheral n. The diagram shows the internal signals of the master (txd, ssi_oe_n, rxd, sclk_out, ss_n[0], ss_n[1], ss_in_n) and how they are connected to the slave peripherals (DI, DO, SCLK, SS). A Glue Logic block is shown between the master and the slaves. A note states: 'Should be driven to inactive level (protocol-dependent) in single master systems; may not need glue logic'.

The serial bit-rate clock, generated and controlled by the DW_apb_ssi, is driven out on the sclk_out line. When the DW_apb_ssi is disabled (SSI_EN = 0), no serial transfers can occur and sclk_out is held in “inactive” state, as defined by the serial protocol under which it operates.

Multiple master configuration is not supported.

4.10.9.1.1. RXD Sample Delay

When the DW_apb_ssi is configured as a master, additional logic can be included in the design in order to delay the default sample time of the rxd signal. This additional logic can help to increase the maximum achievable frequency on the serial bus.

Round trip routing delays on the sclk_out signal from the master and the rxd signal from the slave can mean that the timing of the rxd signal—as seen by the master—has moved away from the normal sampling time. Figure 121 illustrates this situation.

Figure 121. Effects of
Round-Trip Routing
Delays on sclk_out
Signal

Figure 121: Timing diagram showing the effects of round-trip routing delays on the sclk_out signal. The diagram shows signals: ssi_clk, sclk_out, txd_mst, rxd_mst, sclk_in, rxd_slv, and txd_slv. It illustrates how delays (dly=0, dly=5, dly=6, dly=7) affect the timing of the rxd signal relative to the sclk_out signal, leading to incorrect sampling of the rxd signal by the master. The baud-rate is 4.

baud-rate=4

Figure 121: Timing diagram showing the effects of round-trip routing delays on the sclk_out signal. The diagram shows signals: ssi_clk, sclk_out, txd_mst, rxd_mst, sclk_in, rxd_slv, and txd_slv. It illustrates how delays (dly=0, dly=5, dly=6, dly=7) affect the timing of the rxd signal relative to the sclk_out signal, leading to incorrect sampling of the rxd signal by the master. The baud-rate is 4.

The Slave uses the sclk_out signal from the master as a strobe in order to drive rxd signal data onto the serial bus. Routing and sampling delays on the sclk_out signal by the slave device can mean that the rxd bit has not stabilized to the correct value before the master samples the rxd signal. Figure 121 shows an example of how a routing delay on the rxd signal can result in an incorrect rxd value at the default time when the master samples the port.

Without the RXD Sample Delay logic, the user would have to increase the baud-rate for the transfer in order to ensure that the setup times on the rxd signal are within range; this results in reducing the frequency of the serial interface.

When the RXD Sample Delay logic is included, the user can dynamically program a delay value in order to move the sampling time of the rxd signal equal to a number of ssi_clk cycles from the default.

The sample delay logic has a resolution of one ssi_clk cycle. Software can “train” the serial bus by coding a loop that continually reads from the slave and increments the master’s RXD Sample Delay value until the correct data is received by the master.

4.10.9.1.2. Data Transfers

Data transfers are started by the serial-master device. When the DW_apb_ssi is enabled (SSI_EN=1), at least one valid data entry is present in the transmit FIFO and a serial-slave device is selected. When actively transferring data, the busy flag (BUSY) in the status register (SR) is set. You must wait until the busy flag is cleared before attempting a new serial transfer.

i NOTE

The BUSY status is not set when the data are written into the transmit FIFO. This bit gets set only when the target slave has been selected and the transfer is underway. After writing data into the transmit FIFO, the shift logic does not begin the serial transfer until a positive edge of the sclk_out signal is present. The delay in waiting for this positive edge depends on the baud rate of the serial transfer. Before polling the BUSY status, you should first poll the TFE status (waiting for 1) or wait for \( BAUDR * ssi\_clk \) clock cycles.

4.10.9.1.3. Master SPI and SSP Serial Transfers

When the transfer mode is “transmit and receive” or “transmit only” (TMOD = 00b or TMOD = 01b, respectively), transfers are terminated by the shift control logic when the transmit FIFO is empty. For continuous data transfers, you must ensure that the transmit FIFO buffer does not become empty before all the data have been transmitted. The transmit FIFO threshold level (TXFTLR) can be used to early interrupt (ssi_txe_intr) the processor indicating that the transmit FIFO buffer is nearly empty. When a DMA is used for APB accesses, the transmit data level (DMATDLR) can be used to early request (dma_tx_req) the DMA Controller, indicating that the transmit FIFO is nearly empty. The FIFO can then be refilled with data to continue the serial transfer. The user may also write a block of data (at least two FIFO entries) into the transmit FIFO before enabling a serial slave. This ensures that serial transmission does not begin until the number of data-frames that make up the continuous transfer are present in the transmit FIFO.

When the transfer mode is “receive only” (TMOD = 10b), a serial transfer is started by writing one “dummy” data word into the transmit FIFO when a serial slave is selected. The txd output from the DW_apb_ssi is held at a constant logic level for the duration of the serial transfer. The transmit FIFO is popped only once at the beginning and may remain empty for the duration of the serial transfer. The end of the serial transfer is controlled by the “number of data frames” (NDF) field in control register 1 (CTRLR1).

If, for example, you want to receive 24 data frames from a serial-slave peripheral, you should program the NDF field with the value 23; the receive logic terminates the serial transfer when the number of frames received is equal to the NDF value + 1. This transfer mode increases the bandwidth of the APB bus as the transmit FIFO never needs to be serviced during the transfer. The receive FIFO buffer should be read each time the receive FIFO generates a FIFO full interrupt request to prevent an overflow.

When the transfer mode is “eeprom_read” (TMOD = 11b), a serial transfer is started by writing the opcode and/or address into the transmit FIFO when a serial slave (EEPROM) is selected. The opcode and address are transmitted to the EEPROM device, after which read data is received from the EEPROM device and stored in the receive FIFO. The end of the serial transfer is controlled by the NDF field in the control register 1 (CTRLR1).

NOTE

EEPROM read mode is not supported when the DW_apb_ssi is configured to be in the SSP mode.

The receive FIFO threshold level (RXFTLR) can be used to give early indication that the receive FIFO is nearly full. When a DMA is used for APB accesses, the receive data level (DMARDLR) can be used to early request (dma_rx_req) the DMA Controller, indicating that the receive FIFO is nearly full.

A typical software flow for completing an SPI or SSP serial transfer from the DW_apb_ssi serial master is outlined as follows:

  1. 1. If the DW_apb_ssi is enabled, disable it by writing 0 to the SSI Enable register (SSIENR).
  2. 2. Set up the DW_apb_ssi control registers for the transfer; these registers can be set in any order.
    • ◦ Write Control Register 0 (CTRLR0). For SPI transfers, the serial clock polarity and serial clock phase parameters must be set identical to target slave device.
    • ◦ If the transfer mode is receive only, write CTRLR1 (Control Register 1) with the number of frames in the transfer minus 1; for example, if you want to receive four data frames, if you want to receive four data frames, write '3' into CTRLR1.
    • ◦ Write the Baud Rate Select Register (BAUDR) to set the baud rate for the transfer.
    • ◦ Write the Transmit and Receive FIFO Threshold Level registers (TXFTLR and RXFTLR, respectively) to set FIFO threshold levels.
    • ◦ Write the IMR register to set up interrupt masks.
    • ◦ The Slave Enable Register (SER) register can be written here to enable the target slave for selection. If a slave is enabled here, the transfer begins as soon as one valid data entry is present in the transmit FIFO. If no slaves are enabled prior to writing to the Data Register (DR), the transfer does not begin until a slave is enabled.
  3. 3. Enable the DW_apb_ssi by writing 1 to the SSIENR register.
  4. 4. Write data for transmission to the target slave into the transmit FIFO (write DR). If no slaves were enabled in the SER register at this point, enable it now to begin the transfer.
  5. 5. Poll the BUSY status to wait for completion of the transfer. The BUSY status cannot be polled immediately.
  6. 6. If a transmit FIFO empty interrupt request is made, write the transmit FIFO (write DR). If a receive FIFO full interrupt request is made, read the receive FIFO (read DR).
  7. 7. The transfer is stopped by the shift control logic when the transmit FIFO is empty. If the transfer mode is receive only (TMOD = 10b), the transfer is stopped by the shift control logic when the specified number of frames have been received. When the transfer is done, the BUSY status is reset to 0.
  8. 8. If the transfer mode is not transmit only (TMOD != 01b), read the receive FIFO until it is empty.
  9. 9. Disable the DW_apb_ssi by writing 0 to SSIENR.

Figure 122 shows a typical software flow for starting a DW_apb_ssi master SPI/SSP serial transfer. The diagram also shows the hardware flow inside the serial-master component.

Figure 122.
DW_apb_ssi Master
SPI/SSP Transfer Flow

Flowchart of DW_apb_ssi Master SPI/SSP Transfer Flow. The flowchart is divided into two main sections: 'Software Flow' and 'DW_apb_ssi' hardware flow. The 'Software Flow' starts with 'IDLE', followed by 'Disable DW_apb_ssi', 'Configure Master by writing CTRLR0, CTRLR1, BAUDR, TXFTLR, RXFTLR, IMR, SER, SPL, CTRLR0 (if Dual /Quad SPI)', 'Enable DW_apb_ssi', 'Write data to Tx FIFO', and 'Transfer in progress'. It then enters a loop: 'Interrupt?' (Yes leads to 'Interrupt Service Routine' and back to 'Transfer in progress'; No leads to 'BUSY?' (Yes leads to 'Read Rx FIFO' and back to 'Transfer in progress'; No leads to 'TMOD=01' and back to 'Interrupt?'). The 'DW_apb_ssi' hardware flow is enclosed in a dashed box. It starts with 'IDLE', followed by 'Pop data from Tx FIFO into shifter', 'Transfer Bit', and a decision 'All bits in frame transferred?'. If 'No', it loops back to 'Transfer Bit'. If 'Yes', it branches based on 'TMOD': 'TMOD=01' leads to 'Load Rx FIFO' and then to 'All frames transferred?'; 'TMOD=00' and 'TMOD=10' lead to 'Transmit FIFO empty?'. 'All frames transferred?' (Yes) leads to 'END'. 'Transmit FIFO empty?' (Yes) leads to 'END'. 'Transmit FIFO empty?' (No) leads to 'All frames transferred?'. 'All frames transferred?' (No) leads to 'Load Rx FIFO' and then to 'All frames transferred?'.
graph TD
    subgraph Software_Flow [Software Flow]
        IDLE1([IDLE]) --> Disable[Disable DW_apb_ssi]
        Disable --> Configure[Configure Master by writing CTRLR0, CTRLR1, BAUDR, TXFTLR, RXFTLR, IMR, SER, SPL, CTRLR0 (if Dual /Quad SPI)]
        Configure --> Enable[Enable DW_apb_ssi]
        Enable --> Write[Write data to Tx FIFO]
        Write --> Transfer[Transfer in progress]
        Transfer --> Interrupt{Interrupt?}
        Interrupt -- Yes --> ISR([Interrupt Service Routine])
        ISR --> Transfer
        Interrupt -- No --> Busy{BUSY?}
        Busy -- Yes --> Read[Read Rx FIFO]
        Read --> Transfer
        Busy -- No --> TMOD01[TMOD=01]
        TMOD01 --> Interrupt
    end

    subgraph DW_apb_ssi_Hardware_Flow [DW_apb_ssi]
        IDLE2([IDLE]) --> Pop[Pop data from Tx FIFO into shifter]
        Pop --> TransferBit[Transfer Bit]
        TransferBit --> AllBits{All bits in frame transferred?}
        AllBits -- No --> TransferBit
        AllBits -- Yes --> TMOD{TMOD}
        TMOD -- TMOD=01 --> LoadRx[Load Rx FIFO]
        LoadRx --> AllFrames{All frames transferred?}
        TMOD -- TMOD=00 --> TxEmpty{Transmit FIFO empty?}
        TMOD -- TMOD=10 --> TxEmpty
        AllFrames -- Yes --> END([END])
        TxEmpty -- Yes --> END
        TxEmpty -- No --> AllFrames
        AllFrames -- No --> LoadRx
    end

    Note[You may fill FIFO here: Transfer begins when first data word is present in the transmit FIFO and slave is enabled.]
    Note --- Transfer
    Note --- Read
Flowchart of DW_apb_ssi Master SPI/SSP Transfer Flow. The flowchart is divided into two main sections: 'Software Flow' and 'DW_apb_ssi' hardware flow. The 'Software Flow' starts with 'IDLE', followed by 'Disable DW_apb_ssi', 'Configure Master by writing CTRLR0, CTRLR1, BAUDR, TXFTLR, RXFTLR, IMR, SER, SPL, CTRLR0 (if Dual /Quad SPI)', 'Enable DW_apb_ssi', 'Write data to Tx FIFO', and 'Transfer in progress'. It then enters a loop: 'Interrupt?' (Yes leads to 'Interrupt Service Routine' and back to 'Transfer in progress'; No leads to 'BUSY?' (Yes leads to 'Read Rx FIFO' and back to 'Transfer in progress'; No leads to 'TMOD=01' and back to 'Interrupt?'). The 'DW_apb_ssi' hardware flow is enclosed in a dashed box. It starts with 'IDLE', followed by 'Pop data from Tx FIFO into shifter', 'Transfer Bit', and a decision 'All bits in frame transferred?'. If 'No', it loops back to 'Transfer Bit'. If 'Yes', it branches based on 'TMOD': 'TMOD=01' leads to 'Load Rx FIFO' and then to 'All frames transferred?'; 'TMOD=00' and 'TMOD=10' lead to 'Transmit FIFO empty?'. 'All frames transferred?' (Yes) leads to 'END'. 'Transmit FIFO empty?' (Yes) leads to 'END'. 'Transmit FIFO empty?' (No) leads to 'All frames transferred?'. 'All frames transferred?' (No) leads to 'Load Rx FIFO' and then to 'All frames transferred?'.

4.10.9.1.4. Master Microwire Serial Transfers

Microwire serial transfers from the DW_apb_ssi serial master are controlled by the Microwire Control Register (MWCR). The MWHS bit field enables and disables the Microwire handshaking interface. The MDD bit field controls the direction of the data frame (the control frame is always transmitted by the master and received by the slave). The MWMOD bit field defines whether the transfer is sequential or nonsequential.

All Microwire transfers are started by the DW_apb_ssi serial master when there is at least one control word in the transmit FIFO and a slave is enabled. When the DW_apb_ssi master transmits the data frame (MDD = 1), the transfer is terminated by the shift logic when the transmit FIFO is empty. When the DW_apb_ssi master receives the data frame (MDD = 0), the termination of the transfer depends on the setting of the MWMOD bit field. If the transfer is nonsequential (MWMOD = 0), it is terminated when the transmit FIFO is empty after shifting in the data frame from the slave. When the transfer is sequential (MWMOD = 1), it is terminated by the shift logic when the number of data frames received is equal to the value in the CTRLR1 register + 1.

When the handshaking interface on the DW_apb_ssi master is enabled (MWHS = 1), the status of the target slave is polled after transmission. Only when the slave reports a ready status does the DW_apb_ssi master complete the transfer and clear its BUSY status. If the transfer is continuous, the next control/data frame is not sent until the slave device returns a ready status.

A typical software flow for completing a Microwire serial transfer from the DW_apb_ssi serial master is outlined as follows:

  1. 1. If the DW_apb_ssi is enabled, disable it by writing 0 to SSIENR.
  2. 2. Set up the DW_apb_ssi control registers for the transfer. These registers can be set in any order. Write CTRLR0 to set transfer parameters.
    • ◦ If the transfer is sequential and the DW_apb_ssi master receives data, write CTRLR1 with the number of frames in the transfer minus 1; for instance, if you want to receive four data frames, write '3' into CTRLR1.
    • ◦ Write BAUDR to set the baud rate for the transfer.
    • ◦ Write TXFTLR and RXFTLR to set FIFO threshold levels.
    • ◦ Write the IMR register to set up interrupt masks.

You can write the SER register to enable the target slave for selection. If a slave is enabled here, the transfer begins as soon as one valid data entry is present in the transmit FIFO. If no slaves are enabled prior to writing to the DR register, the transfer does not begin until a slave is enabled.

  1. 3. Enable the DW_apb_ssi by writing 1 to the SSIENR register.
  2. 4. If the DW_apb_ssi master transmits data, write the control and data words into the transmit FIFO (write DR). If the DW_apb_ssi master receives data, write the control word(s) into the transmit FIFO.

If no slaves were enabled in the SER register at this point, enable now to begin the transfer.

  1. 5. Poll the BUSY status to wait for completion of the transfer. The BUSY status cannot be polled immediately.
  2. 6. The transfer is stopped by the shift control logic when the transmit FIFO is empty. If the transfer mode is sequential and the DW_apb_ssi master receives data, the transfer is stopped by the shift control logic when the specified number of data frames is received. When the transfer is done, the BUSY status is reset to 0.
  3. 7. If the DW_apb_ssi master receives data, read the receive FIFO until it is empty.
  4. 8. Disable the DW_apb_ssi by writing 0 to SSIENR.

Figure 123 shows a typical software flow for starting a DW_apb_ssi master Microwire serial transfer. The diagram also shows the hardware flow inside the serial-master component.

Figure 123.
DW_apb_ssi Master
Microwire Transfer
Flow

Flowchart showing the software and hardware flow for a DW_apb_ssi Master Microwire Transfer. The software flow starts with IDLE, followed by disabling DW_apb_ssi, configuring the master (CTRLR0, CTRLR1, BAUDR, TXFTLR, RXFTLR, MWCR, IMR, SER), enabling DW_apb_ssi, writing control and data to the Tx FIFO, and entering a transfer-in-progress state. It then checks for interrupts and the BUSY status, leading to an interrupt service routine or reading the Rx FIFO. The hardware flow, enclosed in a dashed box, shows the internal state of the DW_apb_ssi component, including popping control frames, transferring bits, checking for completion, and handling data reception and transmission.
graph TD
    subgraph Software_Flow [Software Flow]
        IDLE1([IDLE]) --> Disable[Disable DW_apb_ssi]
        Disable --> Configure[Configure Master by writing CTRLR0, CTRLR1, BAUDR, TXFTLR, RXFTLR, MWCR, IMR, SER]
        Configure --> Enable[Enable DW_apb_ssi]
        Enable --> Write[Write control & data to Tx FIFO]
        Write --> Transfer[Transfer in progress]
        Transfer --> Interrupt{Interrupt?}
        Interrupt -- Yes --> ISR([Interrupt Service Routine])
        Interrupt -- No --> Busy{BUSY?}
        Busy -- Yes --> Read[Read Rx FIFO]
        Read --> Transfer
        Busy -- No --> MWCR1[MWCR[1]=1]
        MWCR1 --> Transfer
    end

    subgraph Hardware_Flow [DW_apb_ssi]
        IDLE2([IDLE]) --> PopCtrl[Pop control frame from Tx FIFO into shifter]
        PopCtrl --> TransferBit1[Transfer Bit]
        TransferBit1 --> AllBitsCtrl{All bits in control frame transmitted?}
        AllBitsCtrl -- No --> TransferBit1
        AllBitsCtrl -- Yes --> MWCR1_1[MWCR[1]=1]
        MWCR1_1 --> PopData[Pop data frame from Tx FIFO into shifter]
        PopData --> TransferBit2[Transfer Bit]
        TransferBit2 --> AllBitsData{All bits in data frame transmitted?}
        AllBitsData -- No --> TransferBit2
        AllBitsData -- Yes --> TransmitEmpty{Transmit FIFO empty?}
        TransmitEmpty -- Yes --> END([END])
        TransmitEmpty -- No --> TransferBit2
        MWCR1_1 --> ReceiveBit[Receive Bit]
        ReceiveBit --> AllBitsRx{All bits in data frame received?}
        AllBitsRx -- Yes --> LoadRx[Load Rx FIFO]
        LoadRx --> MWCR0_0[MWCR[0]=0]
        MWCR0_0 --> MWCR0_1[MWCR[0]=1]
        MWCR0_1 --> AllFrames{All frames transferred?}
        AllFrames -- Yes --> END
        AllFrames -- No --> ReceiveBit
    end

    ISR --> IDLE1
    Read --> IDLE1
    END --> IDLE1
  

Software Flow:

Hardware Flow (DW_apb_ssi):

Annotations:

Flowchart showing the software and hardware flow for a DW_apb_ssi Master Microwire Transfer. The software flow starts with IDLE, followed by disabling DW_apb_ssi, configuring the master (CTRLR0, CTRLR1, BAUDR, TXFTLR, RXFTLR, MWCR, IMR, SER), enabling DW_apb_ssi, writing control and data to the Tx FIFO, and entering a transfer-in-progress state. It then checks for interrupts and the BUSY status, leading to an interrupt service routine or reading the Rx FIFO. The hardware flow, enclosed in a dashed box, shows the internal state of the DW_apb_ssi component, including popping control frames, transferring bits, checking for completion, and handling data reception and transmission.

4.10.10. Partner Connection Interfaces

The DW_apb_ssi can connect to any serial-slave peripheral device using one of the interfaces discussed in the following sections.

4.10.10.1. Motorola Serial Peripheral Interface (SPI)

With the SPI, the clock polarity (SCPOL) configuration parameter determines whether the inactive state of the serial clock is high or low. To transmit data, both SPI peripherals must have identical serial clock phase (SCPH) and clock polarity (SCPOL) values. The data frame can be 4 to 16/32 bits (depending upon SSI_MAX_XFER_SIZE) in length.

When the configuration parameter SCPH = 0, data transmission begins on the falling edge of the slave select signal. The first data bit is captured by the master and slave peripherals on the first edge of the serial clock; therefore, valid data must be present on the txd and rxd lines prior to the first serial clock edge.

Figure 124 shows a timing diagram for a single SPI data transfer with SCPH = 0. The serial clock is shown for configuration parameters SCPOL = 0 and SCPOL = 1.

Figure 124. SPI Serial Format (SCPH = 0)

Timing diagram for a single SPI data transfer with SCPH = 0. The diagram shows signals: sclk_out/in 0, sclk_out/in 1, txd, rxd, ss_0_n/ss_in_n, and ssi_oe_n. The serial clock (sclk) is shown for SCPOL = 0 and SCPOL = 1. Data is transmitted on txd and received on rxd. The data frame length is 4 to 32 bits. The diagram shows the MSB and LSB of the data frame. The slave select signal (ss_0_n/ss_in_n) is active during the transfer. The output enable signal (ssi_oe_n) is active during the transfer.
Timing diagram for a single SPI data transfer with SCPH = 0. The diagram shows signals: sclk_out/in 0, sclk_out/in 1, txd, rxd, ss_0_n/ss_in_n, and ssi_oe_n. The serial clock (sclk) is shown for SCPOL = 0 and SCPOL = 1. Data is transmitted on txd and received on rxd. The data frame length is 4 to 32 bits. The diagram shows the MSB and LSB of the data frame. The slave select signal (ss_0_n/ss_in_n) is active during the transfer. The output enable signal (ssi_oe_n) is active during the transfer.

The following signals are illustrated in the timing diagrams in this section:

sclk_out

serial clock from DW_apb_ssi master

ss_0_n

slave select signal from DW_apb_ssi master

ss_in_n

slave select input to the DW_apb_ssi slave

ss_oe_n

output enable for the DW_apb_ssi master

txd

transmit data line for the DW_apb_ssi master

rxn

receive data line for the DW_apb_ssi master

Continuous data transfers are supported when SCPH = 0:

Figure 125. Serial Format Continuous Transfers (SCPH = 0)

Timing diagram for Serial Format Continuous Transfers (SCPH = 0). The diagram shows signals: sclk_out/in 0, sclk_out/in 1, txd/rxd, ss_0_n/ss_in_n, and ssi_oe_n. The serial clock (sclk) is shown for SCPOL = 0 and SCPOL = 1. Data is transmitted on txd and received on rxd. The data frame length is 4 to 32 bits. The diagram shows the MSB and LSB of the data frame. The slave select signal (ss_0_n/ss_in_n) is active during the transfer. The output enable signal (ssi_oe_n) is active during the transfer.
Timing diagram for Serial Format Continuous Transfers (SCPH = 0). The diagram shows signals: sclk_out/in 0, sclk_out/in 1, txd/rxd, ss_0_n/ss_in_n, and ssi_oe_n. The serial clock (sclk) is shown for SCPOL = 0 and SCPOL = 1. Data is transmitted on txd and received on rxd. The data frame length is 4 to 32 bits. The diagram shows the MSB and LSB of the data frame. The slave select signal (ss_0_n/ss_in_n) is active during the transfer. The output enable signal (ssi_oe_n) is active during the transfer.

When the configuration parameter SCPH = 1, master peripherals begin transmitting data on the first serial clock edge

after the slave select line is activated. The first data bit is captured on the second (trailing) serial clock edge. Data are propagated by the master peripherals on the leading edge of the serial clock. During continuous data frame transfers, the slave select line may be held active-low until the last bit of the last frame has been captured.

Figure 126 shows the timing diagram for the SPI format when the configuration parameter SCPH = 1.

Figure 126. SPI Serial Format (SCPH = 1)

Timing diagram for SPI Serial Format (SCPH = 1). The diagram shows five signals over time: sclk_out/in 0, sclk_out/in 1, txd, rxd, and ss_0_n/ss_in_n. sclk_out/in 0 and sclk_out/in 1 are square waves. txd and rxd show data frames with MSB and LSB labels. A double-headed arrow indicates a 4-32 bit frame length. ss_0_n/ss_in_n is active-low, and ssi_oe_n is active-low. The diagram shows a single frame transfer where the slave select line is activated before the first clock edge and deactivated after the last clock edge.
Timing diagram for SPI Serial Format (SCPH = 1). The diagram shows five signals over time: sclk_out/in 0, sclk_out/in 1, txd, rxd, and ss_0_n/ss_in_n. sclk_out/in 0 and sclk_out/in 1 are square waves. txd and rxd show data frames with MSB and LSB labels. A double-headed arrow indicates a 4-32 bit frame length. ss_0_n/ss_in_n is active-low, and ssi_oe_n is active-low. The diagram shows a single frame transfer where the slave select line is activated before the first clock edge and deactivated after the last clock edge.

Continuous data frames are transferred in the same way as single frames, with the MSB of the next frame following directly after the LSB of the current frame. The slave select signal is held active for the duration of the transfer.

Figure 127 shows the timing diagram for continuous SPI transfers when the configuration parameter SCPH = 1.

Figure 127. SPI Serial Format Continuous Transfer (SCPH = 1)

Timing diagram for SPI Serial Format Continuous Transfer (SCPH = 1). The diagram shows five signals over time: sclk_out/in 0, sclk_out/in 1, txd, rxd, and ss_0_n/ss_in_n. sclk_out/in 0 and sclk_out/in 1 are square waves. txd and rxd show continuous data frames with MSB and LSB labels. ss_0_n/ss_in_n is active-low, and ssi_oe_n is active-low. The diagram shows multiple frames transferred continuously without gaps between them.
Timing diagram for SPI Serial Format Continuous Transfer (SCPH = 1). The diagram shows five signals over time: sclk_out/in 0, sclk_out/in 1, txd, rxd, and ss_0_n/ss_in_n. sclk_out/in 0 and sclk_out/in 1 are square waves. txd and rxd show continuous data frames with MSB and LSB labels. ss_0_n/ss_in_n is active-low, and ssi_oe_n is active-low. The diagram shows multiple frames transferred continuously without gaps between them.

There are four possible transfer modes on the DW_apb_ssi for performing SPI serial transactions. For transmit and receive transfers (transfer mode field (9:8) of the Control Register 0 = 00b), data transmitted from the DW_apb_ssi to the external serial device is written into the transmit FIFO. Data received from the external serial device into the DW_apb_ssi is pushed into the receive FIFO.

Figure 128 shows the FIFO levels prior to the beginning of a serial transfer and the FIFO levels on completion of the transfer. In this example, two data words are transmitted from the DW_apb_ssi to the external serial device in a continuous transfer. The external serial device also responds with two data words for the DW_apb_ssi.

Figure 128. FIFO Status for Transmit & Receive SPI and SSP Transfers

Diagram showing FIFO status for transmit and receive SPI and SSP transfers. It illustrates the state of the Tx FIFO and Rx FIFO before and after a transfer. The Tx FIFO is shown with locations n, 2, 1, and 0. Before the transfer, locations n and 2 are NULL, location 1 contains Tx Data(1), and location 0 contains Tx Data(0). After the transfer, all locations are NULL. The Rx FIFO is shown with locations n, 2, 1, and 0. Before the transfer, all locations are NULL. After the transfer, location n is NULL, location 2 is NULL, location 1 contains Rx_Data(1), and location 0 contains Rx_Data(0). The diagram also shows the Write DR and Read DR signals, and the Tx FIFO Empty and Rx FIFO Empty signals.
Diagram showing FIFO status for transmit and receive SPI and SSP transfers. It illustrates the state of the Tx FIFO and Rx FIFO before and after a transfer. The Tx FIFO is shown with locations n, 2, 1, and 0. Before the transfer, locations n and 2 are NULL, location 1 contains Tx Data(1), and location 0 contains Tx Data(0). After the transfer, all locations are NULL. The Rx FIFO is shown with locations n, 2, 1, and 0. Before the transfer, all locations are NULL. After the transfer, location n is NULL, location 2 is NULL, location 1 contains Rx_Data(1), and location 0 contains Rx_Data(0). The diagram also shows the Write DR and Read DR signals, and the Tx FIFO Empty and Rx FIFO Empty signals.

For transmit only transfers (transfer mode field (9:8) of the Control Register 0 = 01b), data transmitted from the DW_apb_ssi to the external serial device is written into the transmit FIFO. As the data received from the external serial device is deemed invalid, it is not stored in the DW_apb_ssi receive FIFO.

Figure 129 shows the FIFO levels prior to the beginning of a serial transfer and the FIFO levels on completion of the transfer. In this example, two data words are transmitted from the DW_apb_ssi to the external serial device in a continuous transfer.

Figure 129. FIFO Status for Transmit Only SPI and SSP Transfers

Diagram of FIFO status for transmit-only SPI and SSP transfers.

The diagram illustrates the FIFO status for transmit-only SPI and SSP transfers. It is divided into two main sections: 'FIFO Status Prior to Transfer' and 'FIFO Status on Completion of Transfer', separated by a dashed line.

FIFO Status Prior to Transfer:

FIFO Status on Completion of Transfer:

Arrows indicate the flow of data from the Tx FIFO Buffer to the SHIFT LOGIC and from the SHIFT LOGIC to the Rx FIFO Buffer.

Diagram of FIFO status for transmit-only SPI and SSP transfers.

For receive only transfers (transfer mode field (9:8) of the Control Register 0 = 10b), data transmitted from the DW_apb_ssi to the external serial device is invalid, so a single dummy word is written into the transmit FIFO to begin the serial transfer. The txd output from the DW_apb_ssi is held at a constant logic level for the duration of the serial transfer. Data received from the external serial device into the DW_apb_ssi is pushed into the receive FIFO.

Figure 130 shows the FIFO levels prior to the beginning of a serial transfer and the FIFO levels on completion of the transfer. In this example, two data words are received by the DW_apb_ssi from the external serial device in a continuous transfer.

Figure 130. FIFO Status for Receive Only SPI and SSP Transfers

Diagram of FIFO status for receive-only SPI and SSP transfers.

The diagram illustrates the FIFO status for receive-only SPI and SSP transfers. It is divided into two main sections: 'FIFO Status Prior to Transfer' and 'FIFO Status on Completion of Transfer', separated by a dashed line.

FIFO Status Prior to Transfer:

FIFO Status on Completion of Transfer:

Arrows indicate the flow of data from the Tx FIFO Buffer to the SHIFT LOGIC and from the SHIFT LOGIC to the Rx FIFO Buffer.

Diagram of FIFO status for receive-only SPI and SSP transfers.

For eeprom_read transfers (transfer mode field [9:8] of the Control Register 0 = 11b), opcode and/or EEPROM address are written into the transmit FIFO. During transmission of these control frames, received data is not captured by the DW_apb_ssi master. After the control frames have been transmitted, receive data from the EEPROM is stored in the receive FIFO.

Figure 131 shows the FIFO levels prior to the beginning of a serial transfer and the FIFO levels on completion of the transfer. In this example, one opcode and an upper and lower address are transmitted to the EEPROM, and eight data frames are read from the EEPROM and stored in the receive FIFO of the DW_apb_ssi master.

Figure 131. FIFO Status for EEPROM Read Transfer Mode

Diagram of FIFO status for EEPROM Read Transfer Mode. It shows two states: 'FIFO Status Prior to Transfer' and 'FIFO Status on Completion of Transfer'. In the first state, the Tx FIFO Buffer contains NULL at Location n, NULL at Location 3, Address[7:0] at Location 2, Address[15:8] at Location 1, and Opcode at Location 0. The Rx FIFO is empty. In the second state, the Tx FIFO is empty, and the Rx FIFO Buffer contains NULL at Location n, Rx_Data(7) at Location 7, Rx_Data(6) at Location 6, Rx_Data(1) at Location 1, and Rx_Data(0) at Location 0. A central SHIFT LOGIC block connects the two states, with rxd and txd lines.

The diagram illustrates the FIFO status for EEPROM Read Transfer Mode. It is divided into two main sections: 'FIFO Status Prior to Transfer' and 'FIFO Status on Completion of Transfer', connected by a central 'SHIFT LOGIC' block.

FIFO Status Prior to Transfer:

FIFO Status on Completion of Transfer:

The central SHIFT LOGIC block has rx and tx lines connecting the two states.

Diagram of FIFO status for EEPROM Read Transfer Mode. It shows two states: 'FIFO Status Prior to Transfer' and 'FIFO Status on Completion of Transfer'. In the first state, the Tx FIFO Buffer contains NULL at Location n, NULL at Location 3, Address[7:0] at Location 2, Address[15:8] at Location 1, and Opcode at Location 0. The Rx FIFO is empty. In the second state, the Tx FIFO is empty, and the Rx FIFO Buffer contains NULL at Location n, Rx_Data(7) at Location 7, Rx_Data(6) at Location 6, Rx_Data(1) at Location 1, and Rx_Data(0) at Location 0. A central SHIFT LOGIC block connects the two states, with rxd and txd lines.

4.10.10.2. Texas Instruments Synchronous Serial Protocol (SSP)

Data transfers begin by asserting the frame indicator line (ss_0_n/ss_in_n) for one serial clock period. Data to be transmitted are driven onto the txd line one serial clock cycle later; similarly data from the slave are driven onto the rxd line. Data are propagated on the rising edge of the serial clock (sclk_out/sclk_in) and captured on the falling edge. The length of the data frame ranges from four to 32 bits.

Figure 132 shows the timing diagram for a single SSP serial transfer.

Figure 132. SSP Serial Format

Timing diagram for a single SSP serial transfer. It shows four signals: sclk_out/in, txd/rxd, ss_0_n/ss_in_n, and ssi_oe_n. The sclk_out/in signal is a periodic clock. The txd/rxd signal shows a data frame with MSB and LSB. The ss_0_n/ss_in_n signal is asserted for one clock period. The ssi_oe_n signal is asserted for the duration of the transfer.

The timing diagram for a single SSP serial transfer shows four signals over time:

Timing diagram for a single SSP serial transfer. It shows four signals: sclk_out/in, txd/rxd, ss_0_n/ss_in_n, and ssi_oe_n. The sclk_out/in signal is a periodic clock. The txd/rxd signal shows a data frame with MSB and LSB. The ss_0_n/ss_in_n signal is asserted for one clock period. The ssi_oe_n signal is asserted for the duration of the transfer.

Continuous data frames are transferred in the same way as single data frames. The frame indicator is asserted for one clock period during the same cycle as the LSB from the current transfer, indicating that another data frame follows.

Figure 133 shows the timing for a continuous SSP transfer.

Figure 133. SSP Serial Format Continuous Transfer

Timing diagram for a continuous SSP transfer. It shows four signals: sclk_out/in, txd/rxd, ss_0_n/ss_in_n, and ssi_oe_n. The sclk_out/in signal is a periodic clock. The txd/rxd signal shows a continuous stream of data frames with MSB and LSB labels. The ss_0_n/ss_in_n signal is asserted for one clock period. The ssi_oe_n signal is asserted for the duration of the transfer.

The timing diagram for a continuous SSP transfer shows four signals over time:

Timing diagram for a continuous SSP transfer. It shows four signals: sclk_out/in, txd/rxd, ss_0_n/ss_in_n, and ssi_oe_n. The sclk_out/in signal is a periodic clock. The txd/rxd signal shows a continuous stream of data frames with MSB and LSB labels. The ss_0_n/ss_in_n signal is asserted for one clock period. The ssi_oe_n signal is asserted for the duration of the transfer.

4.10.10.3. National Semiconductor Microwire

Data transmission begins with the falling edge of the slave-select signal (ss_0_n). One-half serial clock (sclk_out) period later, the first bit of the control is sent out on the txd line. The length of the control word can be in the range 1 to 16 bits and is set by writing bit field CFS (bits 15:12) in CTRLR0. The remainder of the control word is transmitted (propagated on the falling edge of sclk_out) by the DW_apb_ssi serial master. During this transmission, no data are present (high impedance) on the serial master's rxd line.

The direction of the data word is controlled by the MDD bit field (bit 1) in the Microwire Control Register (MWCR). When MDD=0, this indicates that the DW_apb_ssi serial master receives data from the external serial slave. One clock cycle after the LSB of the control word is transmitted, the slave peripheral responds with a dummy 0 bit, followed by the data frame, which can be four to 32 bits in length. Data are propagated on the falling edge of the serial clock and captured on the rising edge.

The slave-select signal is held active-low during the transfer and is de-asserted one-half clock cycle later, after the data are transferred. Figure 134 shows the timing diagram for a single DW_apb_ssi serial master read from an external serial slave.

Figure 134. Single DW_apb_ssi Master Microwire Serial Transfer (MDD=0)

Timing diagram for a single DW_apb_ssi Master Microwire Serial Transfer (MDD=0). The diagram shows signals: sclk_out, txd, rxd, ss_0_n, and ssi_oe_n. The txd signal shows a control word (MSB to LSB) followed by a dummy 0 bit and then a data frame (4-32 bits, MSB to LSB). The rxd signal shows the data frame (MSB to LSB) starting after the dummy 0 bit. The ss_0_n signal is active-low and stays low during the transfer. The ssi_oe_n signal is active-low and goes low during the transfer.

The diagram illustrates the timing for a single Microwire serial transfer where MDD=0. It shows five signals over time: sclk_out (serial clock), txd (transmit data), rxd (receive data), ss_0_n (slave select), and ssi_oe_n (serial output enable). The txd signal first transmits a control word (MSB to LSB), followed by a dummy 0 bit, and then a data frame (4-32 bits, MSB to LSB). The rxd signal shows the data frame (MSB to LSB) starting after the dummy 0 bit. The ss_0_n signal is active-low and stays low during the transfer. The ssi_oe_n signal is active-low and goes low during the transfer.

Timing diagram for a single DW_apb_ssi Master Microwire Serial Transfer (MDD=0). The diagram shows signals: sclk_out, txd, rxd, ss_0_n, and ssi_oe_n. The txd signal shows a control word (MSB to LSB) followed by a dummy 0 bit and then a data frame (4-32 bits, MSB to LSB). The rxd signal shows the data frame (MSB to LSB) starting after the dummy 0 bit. The ss_0_n signal is active-low and stays low during the transfer. The ssi_oe_n signal is active-low and goes low during the transfer.

Figure 135 shows how the data and control frames are structured in the transmit FIFO prior to the transfer; the value programmed into the MWCR register is also shown.

Figure 135. FIFO Status for Single Microwire Transfer (receiving data frame)

FIFO Status for Single Microwire Transfer (receiving data frame). The diagram shows the MWCR register with fields MWHS, MDD, and MWMOD. The Tx FIFO Buffer contains NULL values for locations n, 3, 2, 1, and Ctrl Word(0). The Rx FIFO Buffer contains NULL values for locations n, 3, 2, 1, and Rx_Data(0). The SHIFT LOGIC block is shown between the Tx and Rx FIFOs. The Rx FIFO Empty signal is shown. The FIFO Status Prior to Transfer and FIFO Status on Completion of Transfer are shown.

The diagram shows the FIFO status for a single Microwire transfer where MDD=0. It includes the MWCR register with fields MWHS, MDD, and MWMOD. The Tx FIFO Buffer contains NULL values for locations n, 3, 2, 1, and Ctrl Word(0). The Rx FIFO Buffer contains NULL values for locations n, 3, 2, 1, and Rx_Data(0). The SHIFT LOGIC block is shown between the Tx and Rx FIFOs. The Rx FIFO Empty signal is shown. The FIFO Status Prior to Transfer and FIFO Status on Completion of Transfer are shown.

FIFO Status for Single Microwire Transfer (receiving data frame). The diagram shows the MWCR register with fields MWHS, MDD, and MWMOD. The Tx FIFO Buffer contains NULL values for locations n, 3, 2, 1, and Ctrl Word(0). The Rx FIFO Buffer contains NULL values for locations n, 3, 2, 1, and Rx_Data(0). The SHIFT LOGIC block is shown between the Tx and Rx FIFOs. The Rx FIFO Empty signal is shown. The FIFO Status Prior to Transfer and FIFO Status on Completion of Transfer are shown.

Continuous transfers for the Microwire protocol can be sequential or nonsequential, and are controlled by the MWMOD bit field (bit 0) in the MWCR register.

Nonsequential continuous transfers occur as illustrated in Figure 136 , with the control word for the next transfer following immediately after the LSB of the current data word.

Figure 136. Continuous Nonsequential Microwire Transfer (receiving data frame)

Timing diagram for Continuous Nonsequential Microwire Transfer (receiving data frame). The diagram shows signals: sclk_out, txd, rxd, ss_0_n, and ssi_oe_n. The txd signal shows Control word 0, followed by Data Word 0, then Control word 1, followed by Data Word 1. The rxd signal shows the data frame (MSB to LSB) starting after the dummy 0 bit. The ss_0_n signal is active-low and stays low during the transfer. The ssi_oe_n signal is active-low and goes low during the transfer.

The diagram illustrates the timing for a continuous nonsequential Microwire serial transfer. It shows five signals over time: sclk_out (serial clock), txd (transmit data), rxd (receive data), ss_0_n (slave select), and ssi_oe_n (serial output enable). The txd signal shows Control word 0, followed by Data Word 0, then Control word 1, followed by Data Word 1. The rxd signal shows the data frame (MSB to LSB) starting after the dummy 0 bit. The ss_0_n signal is active-low and stays low during the transfer. The ssi_oe_n signal is active-low and goes low during the transfer.

Timing diagram for Continuous Nonsequential Microwire Transfer (receiving data frame). The diagram shows signals: sclk_out, txd, rxd, ss_0_n, and ssi_oe_n. The txd signal shows Control word 0, followed by Data Word 0, then Control word 1, followed by Data Word 1. The rxd signal shows the data frame (MSB to LSB) starting after the dummy 0 bit. The ss_0_n signal is active-low and stays low during the transfer. The ssi_oe_n signal is active-low and goes low during the transfer.

The only modification needed to perform a continuous nonsequential transfer is to write more control words into the transmit FIFO buffer; this is illustrated in Figure 137 . In this example, two data words are read from the external serial-slave device.

Figure 137. FIFO Status for Nonsequential Microwire Transfer (receiving data frame)

Figure 137: FIFO Status for Nonsequential Microwire Transfer (receiving data frame). This block diagram shows the state of the DW_apb_ssi master and slave FIFOs during a nonsequential read. The MWCR register is shown with MWHS=0, MDD=0, and MWMOD=0. On the master side (left), the Tx FIFO Buffer contains NULL values from Location n down to Location 1, followed by Ctrl Word(1) at Location 1 and Ctrl Word(0) at Location 0. The Rx FIFO is empty. A 'Write DR' signal is shown entering the Tx FIFO Buffer. The 'FIFO Status Prior to Transfer' is indicated. On the slave side (right), the Tx FIFO is empty. The Rx FIFO Buffer contains NULL values from Location n down to Location 2, followed by Rx_Data(1) at Location 1 and Rx_Data(0) at Location 0. A 'Read DR' signal is shown entering the Rx FIFO Buffer. The 'FIFO Status on Completion of Transfer' is indicated. A central 'SHIFT LOGIC' block is connected to the Tx and Rx FIFOs via 'txd' and 'rxd' lines.
Figure 137: FIFO Status for Nonsequential Microwire Transfer (receiving data frame). This block diagram shows the state of the DW_apb_ssi master and slave FIFOs during a nonsequential read. The MWCR register is shown with MWHS=0, MDD=0, and MWMOD=0. On the master side (left), the Tx FIFO Buffer contains NULL values from Location n down to Location 1, followed by Ctrl Word(1) at Location 1 and Ctrl Word(0) at Location 0. The Rx FIFO is empty. A 'Write DR' signal is shown entering the Tx FIFO Buffer. The 'FIFO Status Prior to Transfer' is indicated. On the slave side (right), the Tx FIFO is empty. The Rx FIFO Buffer contains NULL values from Location n down to Location 2, followed by Rx_Data(1) at Location 1 and Rx_Data(0) at Location 0. A 'Read DR' signal is shown entering the Rx FIFO Buffer. The 'FIFO Status on Completion of Transfer' is indicated. A central 'SHIFT LOGIC' block is connected to the Tx and Rx FIFOs via 'txd' and 'rxd' lines.

During sequential continuous transfers, only one control word is transmitted from the DW_apb_ssi master. The transfer is started in the same manner as with nonsequential read operations, but the cycle is continued to read further data. The slave device automatically increments its address pointer to the next location and continues to provide data from that location. Any number of locations can be read in this manner; the DW_apb_ssi master terminates the transfer when the number of words received is equal to the value in the CTRLR1 register plus one.

The timing diagram in Figure 138 and example in Figure 139 show a continuous sequential read of two data frames from the external slave device.

Figure 138. Continuous Sequential Microwire Transfer (receiving data frame)

Figure 138: Continuous Sequential Microwire Transfer (receiving data frame). This timing diagram shows the relationship between sclk_out, txd, rxd, ss_0_n, and ssi_oe_n. sclk_out is a periodic clock signal. txd shows a 'Control word' being transmitted, with its MSB and LSB labeled. rxd shows 'Data Word 0' and 'Data Word 1' being received, with their MSB and LSB labeled. ss_0_n is a signal that goes low during the transfer. ssi_oe_n is a signal that goes low during the transfer.
Figure 138: Continuous Sequential Microwire Transfer (receiving data frame). This timing diagram shows the relationship between sclk_out, txd, rxd, ss_0_n, and ssi_oe_n. sclk_out is a periodic clock signal. txd shows a 'Control word' being transmitted, with its MSB and LSB labeled. rxd shows 'Data Word 0' and 'Data Word 1' being received, with their MSB and LSB labeled. ss_0_n is a signal that goes low during the transfer. ssi_oe_n is a signal that goes low during the transfer.

Figure 139. FIFO Status for Sequential Microwire Transfer (receiving data frame)

Figure 139: FIFO Status for Sequential Microwire Transfer (receiving data frame). This block diagram shows the state of the DW_apb_ssi master and slave FIFOs during a sequential read. The MWCR register is shown with MWHS=0, MDD=0, and MWMOD=1. On the master side (left), the Tx FIFO Buffer contains NULL values from Location n down to Location 1, followed by Ctrl Word(0) at Location 0. The Rx FIFO is empty. A 'Write DR' signal is shown entering the Tx FIFO Buffer. The 'FIFO Status Prior to Transfer' is indicated. On the slave side (right), the Tx FIFO is empty. The Rx FIFO Buffer contains NULL values from Location n down to Location 2, followed by Rx_Data(1) at Location 1 and Rx_Data(0) at Location 0. A 'Read DR' signal is shown entering the Rx FIFO Buffer. The 'FIFO Status on Completion of Transfer' is indicated. A central 'SHIFT LOGIC' block is connected to the Tx and Rx FIFOs via 'txd' and 'rxd' lines.
Figure 139: FIFO Status for Sequential Microwire Transfer (receiving data frame). This block diagram shows the state of the DW_apb_ssi master and slave FIFOs during a sequential read. The MWCR register is shown with MWHS=0, MDD=0, and MWMOD=1. On the master side (left), the Tx FIFO Buffer contains NULL values from Location n down to Location 1, followed by Ctrl Word(0) at Location 0. The Rx FIFO is empty. A 'Write DR' signal is shown entering the Tx FIFO Buffer. The 'FIFO Status Prior to Transfer' is indicated. On the slave side (right), the Tx FIFO is empty. The Rx FIFO Buffer contains NULL values from Location n down to Location 2, followed by Rx_Data(1) at Location 1 and Rx_Data(0) at Location 0. A 'Read DR' signal is shown entering the Rx FIFO Buffer. The 'FIFO Status on Completion of Transfer' is indicated. A central 'SHIFT LOGIC' block is connected to the Tx and Rx FIFOs via 'txd' and 'rxd' lines.

When MDD = 1, this indicates that the DW_apb_ssi serial master transmits data to the external serial slave. Immediately after the LSB of the control word is transmitted, the DW_apb_ssi master begins transmitting the data frame to the slave peripheral.

Figure 140 shows the timing diagram for a single DW_apb_ssi serial master write to an external serial slave.

Figure 140. Single Microwire Transfer (transmitting data frame)

Timing diagram for a single Microwire transfer. It shows five signals: sclk_out, txd, rxd, ss_0_n, and ssi_oe_n. sclk_out is a periodic clock signal. txd shows a control word (MSB to LSB) followed by data word 0 (MSB to LSB). rxd is high-impedance. ss_0_n is a strobe signal that goes low during the transfer. ssi_oe_n is an output enable signal that goes low during the transfer.
Timing diagram for a single Microwire transfer. It shows five signals: sclk_out, txd, rxd, ss_0_n, and ssi_oe_n. sclk_out is a periodic clock signal. txd shows a control word (MSB to LSB) followed by data word 0 (MSB to LSB). rxd is high-impedance. ss_0_n is a strobe signal that goes low during the transfer. ssi_oe_n is an output enable signal that goes low during the transfer.

NOTE

The DW_apb_ssi does not support continuous sequential Microwire writes, where MDD = 1 and MWMOD = 1.

Figure 141 shows how the data and control frames are structured in the transmit FIFO prior to the transfer, also shown is the value programmed into the MWCR register.

Figure 141. FIFO Status for Single Microwire Transfer (transmitting data frame)

Diagram of the FIFO status for a single Microwire transfer. It shows the MWCR register with MWS=0, MDD=1, and MWMOD=0. The Tx FIFO Buffer is shown with locations 0 to n. Location 0 contains Ctrl Word(0), Location 1 contains Tx Data(0), and Locations 2 to n are NULL. The Rx FIFO Buffer is shown with all locations (0 to n) being NULL. The diagram also shows the 'FIFO Status Prior to Transfer' and 'FIFO Status on Completion of Transfer' states, with the Tx FIFO becoming empty after the transfer.
Diagram of the FIFO status for a single Microwire transfer. It shows the MWCR register with MWS=0, MDD=1, and MWMOD=0. The Tx FIFO Buffer is shown with locations 0 to n. Location 0 contains Ctrl Word(0), Location 1 contains Tx Data(0), and Locations 2 to n are NULL. The Rx FIFO Buffer is shown with all locations (0 to n) being NULL. The diagram also shows the 'FIFO Status Prior to Transfer' and 'FIFO Status on Completion of Transfer' states, with the Tx FIFO becoming empty after the transfer.

Continuous transfers occur as shown in Figure 142, with the control word for the next transfer following immediately after the LSB of the current data word.

Figure 142. Continuous Microwire Transfer (transmitting data frame)

Timing diagram for a continuous Microwire transfer. It shows five signals: sclk_out, txd, rxd, ss_0_n, and ssi_oe_n. sclk_out is a periodic clock signal. txd shows a sequence of control words and data words: Control word 0, Data word 0, Control word 1, Data word 1. rxd is high-impedance. ss_0_n is a strobe signal that goes low during the transfer. ssi_oe_n is an output enable signal that goes low during the transfer.
Timing diagram for a continuous Microwire transfer. It shows five signals: sclk_out, txd, rxd, ss_0_n, and ssi_oe_n. sclk_out is a periodic clock signal. txd shows a sequence of control words and data words: Control word 0, Data word 0, Control word 1, Data word 1. rxd is high-impedance. ss_0_n is a strobe signal that goes low during the transfer. ssi_oe_n is an output enable signal that goes low during the transfer.

The only modification you need to make to perform a continuous transfer is to write more control and data words into the transmit FIFO buffer, shown in Figure 143. This example shows two data words are written to the external serial slave device.

Figure 143. FIFO Status for Continuous Microwire Transfer (transmitting data frame)

Figure 143: FIFO Status for Continuous Microwire Transfer (transmitting data frame). This block diagram shows the state of the Microwire interface before and after a data transfer. At the top, the MWCR register is shown with MWHS=0, MDD=1, and MWMOD=0. The 'FIFO Status Prior to Transfer' section shows a Tx FIFO Buffer with Location 0 containing Ctrl Word(0), Location 1 containing Tx Data(0), Location 2 containing Ctrl Word(1), Location 3 containing Data Word(1), and Location n containing NULL. The Rx FIFO Buffer is empty. A 'Write DR' signal is shown entering the Tx FIFO Buffer. The 'SHIFT LOGIC' block has rxd and txd signals. The 'FIFO Status on Completion of Transfer' section shows the Tx FIFO Buffer with all locations (0 to n) containing NULL, and the Rx FIFO Buffer also empty. The Tx FIFO Empty signal is active.
Figure 143: FIFO Status for Continuous Microwire Transfer (transmitting data frame). This block diagram shows the state of the Microwire interface before and after a data transfer. At the top, the MWCR register is shown with MWHS=0, MDD=1, and MWMOD=0. The 'FIFO Status Prior to Transfer' section shows a Tx FIFO Buffer with Location 0 containing Ctrl Word(0), Location 1 containing Tx Data(0), Location 2 containing Ctrl Word(1), Location 3 containing Data Word(1), and Location n containing NULL. The Rx FIFO Buffer is empty. A 'Write DR' signal is shown entering the Tx FIFO Buffer. The 'SHIFT LOGIC' block has rxd and txd signals. The 'FIFO Status on Completion of Transfer' section shows the Tx FIFO Buffer with all locations (0 to n) containing NULL, and the Rx FIFO Buffer also empty. The Tx FIFO Empty signal is active.

The Microwire handshaking interface can also be enabled for DW_apb_ssi master write operations to external serial-slave devices. To enable the handshaking interface, you must write 1 into the MHS bit field (bit 2) on the MWCR register. When MHS is set to 1, the DW_apb_ssi serial master checks for a ready status from the slave device before completing the transfer, or transmitting the next control word for continuous transfers.

Figure 144 shows an example of a continuous Microwire transfer with the handshaking interface enabled.

Figure 144. Continuous Microwire Transfer with Handshaking (transmitting data frame)

Figure 144: Continuous Microwire Transfer with Handshaking (transmitting data frame). This timing diagram shows the relationship between sclk_out, txd, rxd, ss_o_n, and ssi_oe_n signals. The txd signal shows a sequence of Control word 0, Data word 0, Control word 1, and Data word 1, each with MSB and LSB labels. The rxd signal shows a 'Busy' period followed by a 'Ready' period. The ss_o_n signal is active during the transfer. The ssi_oe_n signal is active during the transfer. The diagram illustrates the handshaking process where the master waits for the slave to be ready before transmitting the next control word.
Figure 144: Continuous Microwire Transfer with Handshaking (transmitting data frame). This timing diagram shows the relationship between sclk_out, txd, rxd, ss_o_n, and ssi_oe_n signals. The txd signal shows a sequence of Control word 0, Data word 0, Control word 1, and Data word 1, each with MSB and LSB labels. The rxd signal shows a 'Busy' period followed by a 'Ready' period. The ss_o_n signal is active during the transfer. The ssi_oe_n signal is active during the transfer. The diagram illustrates the handshaking process where the master waits for the slave to be ready before transmitting the next control word.

After the first data word has been transmitted to the serial-slave device, the DW_apb_ssi master polls the rxd input waiting for a ready status from the slave device. Upon reception of the ready status, the DW_apb_ssi master begins transmission of the next control word. After transmission of the last data frame has completed, the DW_apb_ssi master transmits a start bit to clear the ready status of the slave device before completing the transfer. The FIFO status for this transfer is the same as in Figure 143, except that the MWHS bit field is set (1).

To transmit a control word (not followed by data) to a serial-slave device from the DW_apb_ssi master, there must be only one entry in the transmit FIFO buffer. It is impossible to transmit two control words in a continuous transfer, as the shift logic in the DW_apb_ssi treats the second control word as a data word. When the DW_apb_ssi master transmits only a control word, the MDD bit field (bit 1 of MWCR register) must be set (1).

In the example shown in Figure 145 and in the timing diagram in Figure 146, the handshaking interface is enabled. If the handshaking interface is disabled (MHS=0), the transfer is terminated by the DW_apb_ssi master one sclk_out cycle after the LSB of the control word is captured by the slave device.

Figure 145. FIFO Status for Microwire Control Word Transfer

Figure 145: FIFO Status for Microwire Control Word Transfer. This block diagram shows the state of the Microwire interface for a control word transfer. At the top, the MWCR register is shown with MWHS=1, MDD=1, and MWMOD=0. The 'FIFO Status Prior to Transfer' section shows a Tx FIFO Buffer with Location 0 containing Ctrl Word(0), and Locations 1 to n containing NULL. The Rx FIFO Buffer is empty. A 'Write DR' signal is shown entering the Tx FIFO Buffer. The 'SHIFT LOGIC' block has rxd and txd signals. The 'FIFO Status on Completion of Transfer' section shows the Tx FIFO Buffer with all locations (0 to n) containing NULL, and the Rx FIFO Buffer also empty. The Tx FIFO Empty signal is active.
Figure 145: FIFO Status for Microwire Control Word Transfer. This block diagram shows the state of the Microwire interface for a control word transfer. At the top, the MWCR register is shown with MWHS=1, MDD=1, and MWMOD=0. The 'FIFO Status Prior to Transfer' section shows a Tx FIFO Buffer with Location 0 containing Ctrl Word(0), and Locations 1 to n containing NULL. The Rx FIFO Buffer is empty. A 'Write DR' signal is shown entering the Tx FIFO Buffer. The 'SHIFT LOGIC' block has rxd and txd signals. The 'FIFO Status on Completion of Transfer' section shows the Tx FIFO Buffer with all locations (0 to n) containing NULL, and the Rx FIFO Buffer also empty. The Tx FIFO Empty signal is active.

Figure 146. Microwire Control Word

Timing diagram for Microwire Control Word showing signals: sclk_out, txd, rxd, ss_0_n, and ssi_oe_n. The txd signal shows a sequence of bits from MSB to LSB, followed by a Start Bit. The rxd signal shows a Busy period followed by a Ready period. The ss_0_n and ssi_oe_n signals show a pulse during the Ready period.

The diagram illustrates the Microwire Control Word timing. It shows five signals: sclk_out, txd, rx, ss_0_n, and ssi_oe_n. The sclk_out signal is a periodic clock. The txd signal shows a sequence of bits from MSB to LSB, followed by a Start Bit. The rx signal shows a Busy period followed by a Ready period. The ss_0_n and ssi_oe_n signals show a pulse during the Ready period.

Timing diagram for Microwire Control Word showing signals: sclk_out, txd, rxd, ss_0_n, and ssi_oe_n. The txd signal shows a sequence of bits from MSB to LSB, followed by a Start Bit. The rxd signal shows a Busy period followed by a Ready period. The ss_0_n and ssi_oe_n signals show a pulse during the Ready period.

4.10.10.4. Enhanced SPI Modes

DW_apb_ssi supports the dual and quad modes of SPI in RP2040; octal mode is not supported. txd, rx and ssi_oe_n signals are four bits wide.

Data is shifted out/in on more than one line, increasing the overall throughput. All four combinations of the serial clock's polarity and phase are valid in this mode and work the same as in normal SPI mode. Dual SPI, or Quad SPI modes function similarly except for the width of txd, rx and ssi_oe_n signals. The mode of operation (write/read) can be selected using the CTRLR0.TMOD field.

4.10.10.4.1. Write Operation in Enhanced SPI Modes

Dual, or Quad, SPI write operations can be divided into three parts:

The following register fields are used for a write operation:

An instruction takes one FIFO location. An address can take more than one FIFO locations.

Both the instruction and address must be programmed in the data register (DR). DW_apb_ssi will wait until both have been programmed to start the write operation.

The instruction, address and data can be programmed to send in dual/quad mode, which can be selected from the SPI_CTRLR0.TRANS_TYPE and CTRLR0.SPI_FRF fields.

NOTE

Figure 147 shows a typical write operation in Dual, or Quad, SPI Mode. The value of N will be: 7 if SSI_SPI_MODE is set to 3, 3 if SSI_SPI_MODE is set to 2, and 1 if SSI_SPI_MODE is set to 1. For 1-write operation, the instruction and address are sent only once followed by data frames programmed in DR until the transmit FIFO becomes empty.

Figure 147. Typical Write Operation Dual/Quad SPI Mode

Timing diagram for a typical write operation in Dual/Quad SPI Mode. The diagram shows four signals: sclk_out, txd[N:0], ssi_oe_n[N:0], and ss_oe_n. The txd[N:0] signal is divided into three sections: INSTRUCTION, ADDRESS, and DATA. The ssi_oe_n signal is active low and covers the INSTRUCTION and ADDRESS sections. The ss_oe_n signal is active low and covers the DATA section.
Timing diagram for a typical write operation in Dual/Quad SPI Mode. The diagram shows four signals: sclk_out, txd[N:0], ssi_oe_n[N:0], and ss_oe_n. The txd[N:0] signal is divided into three sections: INSTRUCTION, ADDRESS, and DATA. The ssi_oe_n signal is active low and covers the INSTRUCTION and ADDRESS sections. The ss_oe_n signal is active low and covers the DATA section.

To initiate a Dual/Quad write operation, CTRLR0.SPI_FRF must be set to 01/10/11, respectively. This will set the transfer type, and for each write command, data will be transferred in the format specified in CTRLR0.SPI_FRF field.

Case A: Instruction and address both transmitted in standard SPI format

For this, SPI_CTRLR0.TRANS_TYPE field must be set to 00b. Figure 148 shows the timing diagram when both instruction and address are transmitted in standard SPI format. The value of N will be: 7 if CTRLR0.SPI_FRF is set to 11b, 3 if CTRLR0.SPI_FRF is set to 10b, and 1 if CTRLR0.SPI_FRF is set to 01b.

Figure 148. Instruction and Address Transmitted in Standard SPI Format

Timing diagram for Case A: Instruction and address both transmitted in standard SPI format. The diagram shows five signals: sclk_out, txd[0], txd[N-1:0], ss_oe_n[0], and ss_oe_n[N-1:0]. The txd[0] signal is divided into three sections: INSTRUCTION, ADDRESS, and DATA. The txd[N-1:0] signal is active low and covers the INSTRUCTION and ADDRESS sections. The ss_oe_n[0] signal is active low and covers the INSTRUCTION and ADDRESS sections. The ss_oe_n[N-1:0] signal is active low and covers the DATA section.
Timing diagram for Case A: Instruction and address both transmitted in standard SPI format. The diagram shows five signals: sclk_out, txd[0], txd[N-1:0], ss_oe_n[0], and ss_oe_n[N-1:0]. The txd[0] signal is divided into three sections: INSTRUCTION, ADDRESS, and DATA. The txd[N-1:0] signal is active low and covers the INSTRUCTION and ADDRESS sections. The ss_oe_n[0] signal is active low and covers the INSTRUCTION and ADDRESS sections. The ss_oe_n[N-1:0] signal is active low and covers the DATA section.
Case B: Instruction transmitted in standard and address transmitted in Enhanced SPI format

For this, SPI_CTRLR0.TRANS_TYPE field must be set to one. Figure 149 shows the timing diagram when an instruction is transmitted in standard format and address is transmitted in dual SPI format specified in the CTRLR0.SPI_FRF field. The value of N will be: 7 if CTRLR0.SPI_FRF is set to 11b, 3 if CTRLR0.SPI_FRF is set to 10b, and 1 if CTRLR0.SPI_FRF is set to 01b.

Figure 149. Instruction Transmitted in Standard and Address Transmitted in Enhanced SPI Format

Timing diagram for Case B: Instruction transmitted in standard and address transmitted in Enhanced SPI format. The diagram shows five signals: sclk_out, txd[0], txd[N-1:0], ss_oe_n[0], and ss_oe_n[N-1:0]. The txd[0] signal is divided into three sections: INSTRUCTION, ADDRESS, and DATA. The txd[N-1:0] signal is active low and covers the INSTRUCTION and ADDRESS sections. The ss_oe_n[0] signal is active low and covers the INSTRUCTION and ADDRESS sections. The ss_oe_n[N-1:0] signal is active low and covers the DATA section.
Timing diagram for Case B: Instruction transmitted in standard and address transmitted in Enhanced SPI format. The diagram shows five signals: sclk_out, txd[0], txd[N-1:0], ss_oe_n[0], and ss_oe_n[N-1:0]. The txd[0] signal is divided into three sections: INSTRUCTION, ADDRESS, and DATA. The txd[N-1:0] signal is active low and covers the INSTRUCTION and ADDRESS sections. The ss_oe_n[0] signal is active low and covers the INSTRUCTION and ADDRESS sections. The ss_oe_n[N-1:0] signal is active low and covers the DATA section.
Case C: Instruction and Address both transmitted in Enhanced SPI format

For this, SPI_CTRLR0.TRANS_TYPE field must be set to 10b. Figure 150 shows the timing diagram in which instruction and address are transmitted in SPI format specified in the CTRLR0.SPI_FRF field. The value of N will be: 7 if CTRLR0.SPI_FRF is set to 11b, 3 if CTRLR0.SPI_FRF is set to 10b, and 1 if CTRLR0.SPI_FRF is set to 01b.

Figure 150. Instruction and Address Both Transmitted in Enhanced SPI Format

Timing diagram for Case C: Instruction and Address both transmitted in Enhanced SPI format. The diagram shows four signals: sclk_out, txd[N:0], ssi_oe_n[N:0], and ss_0_n. The txd[N:0] signal is divided into three sections: INSTRUCTION, ADDRESS, and DATA. The ssi_oe_n[N:0] signal is active low and covers the INSTRUCTION and ADDRESS sections. The ss_0_n signal is active low and covers the DATA section.
Timing diagram for Case C: Instruction and Address both transmitted in Enhanced SPI format. The diagram shows four signals: sclk_out, txd[N:0], ssi_oe_n[N:0], and ss_0_n. The txd[N:0] signal is divided into three sections: INSTRUCTION, ADDRESS, and DATA. The ssi_oe_n[N:0] signal is active low and covers the INSTRUCTION and ADDRESS sections. The ss_0_n signal is active low and covers the DATA section.
Case D: Instruction only transfer in enhanced SPI format

For this, SPI_CTRLR0.TRANS_TYPE field must be set to 10b. Figure 151 shows the timing diagram for such a transfer. The value of N will be: 7 if CTRLR0.SPI_FRF is set to 11b, 3 if CTRLR0.SPI_FRF is set to 10b, and 1 if

CTRLR0.SPI_FRF is set to 01b.

Figure 151. Instruction only transfer in enhanced SPI Format

Timing diagram for Figure 151 showing sclk_out, txd[N:0], ssL_oe_n[N:0], and ss_0_n signals. The txd[N:0] signal contains the INSTRUCTION data.

The diagram shows four signals over time: sclk_out (clock), txd[N:0] (transmit data), ssL_oe_n[N:0] (slave select output enable), and ss_0_n (slave select output). The txd[N:0] signal is active during the INSTRUCTION phase. The ssL_oe_n[N:0] signal is active during the INSTRUCTION phase. The ss_0_n signal is active during the INSTRUCTION phase.

Timing diagram for Figure 151 showing sclk_out, txd[N:0], ssL_oe_n[N:0], and ss_0_n signals. The txd[N:0] signal contains the INSTRUCTION data.

4.10.10.4.2. Read Operation in Enhanced SPI Modes

A Dual, or Quad, SPI read operation can be divided into four phases:

Wait Cycles can be programmed using SPI_CTRLR0.WAIT_CYCLES field. The value programmed into SPI_CTRLR0.WAIT_CYCLES is mapped directly to sclk_out times. For example, WAIT_CYCLES=0 indicates no Wait, WAIT_CYCLES=1, indicates one wait cycle and so on. The wait cycles are introduced for target slave to change their mode from input to output and the wait cycles can vary for different devices.

For a READ operation, DW_apb_ssi sends instruction and control data once and waits until it receives NDF (CTRLR1 register) number of data frames and then de-asserts slave select signal.

Figure 152 shows a typical read operation in dual quad SPI mode. The value of N will be: 3 if SSI_SPI_MODE is set to Quad mode, and 1 if SSI_SPI_MODE is set to Dual mode.

Figure 152. Typical Read Operation in Enhanced SPI Mode

Timing diagram for Figure 152 showing sclk_out, txd[N:0], rxd[N:0], ssL_oe_n[N:0], and ss_0_n signals. The txd[N:0] signal contains INSTRUCTION, ADDRESS, and WAIT CYCLES. The rxd[N:0] signal contains DATA.

The diagram shows five signals over time: sclk_out (clock), txd[N:0] (transmit data), rxd[N:0] (receive data), ssL_oe_n[N:0] (slave select output enable), and ss_0_n (slave select output). The txd[N:0] signal contains INSTRUCTION, ADDRESS, and WAIT CYCLES. The rxd[N:0] signal contains DATA. The ssL_oe_n[N:0] signal is active during the INSTRUCTION, ADDRESS, and WAIT CYCLES phases. The ss_0_n signal is active during the INSTRUCTION, ADDRESS, and WAIT CYCLES phases.

Timing diagram for Figure 152 showing sclk_out, txd[N:0], rxd[N:0], ssL_oe_n[N:0], and ss_0_n signals. The txd[N:0] signal contains INSTRUCTION, ADDRESS, and WAIT CYCLES. The rxd[N:0] signal contains DATA.

To initiate a dual/quad read operation, CTRLR0.SPI_FRF must be set to 01/10/11 respectively. This will set the transfer type, now for each read command data will be transferred in the format specified in CTRLR0.SPI_FRF field.

Following are the possible cases of write operation in enhanced SPI modes:

Case A: Instruction and address both transmitted in standard SPI format

For this, SPI_CTRLR0.TRANS_TYPE field should be set to 00b. Figure 153 shows the timing diagram when both instruction and address are transferred in standard SPI format. The figure also shows WAIT cycles after address, which can be programmed in the SPI_CTRLR0.WAIT_CYCLES field. The value of N will be 7 if CTRLR0.SPI_FRF is set to 11b, 3 if CTRLR0.SPI_FRF is set to 10b, and 1 if CTRLR0.SPI_FRF is set to 01b.

Figure 153. Instruction and Address Transmitted in Standard SPI Format

Timing diagram for Figure 153 showing sclk_out, txd[0], txd[N-1:0], rxd[N:0], ssL_oe_n[0], ssL_oe_n[N-1:0], and ss_0_n signals. The txd[0] signal contains INSTRUCTION. The txd[N-1:0] signal contains ADDRESS. The rxd[N:0] signal contains DATA.

The diagram shows seven signals over time: sclk_out (clock), txd[0] (transmit data), txd[N-1:0] (transmit data), rxd[N:0] (receive data), ssL_oe_n[0] (slave select output enable), ssL_oe_n[N-1:0] (slave select output enable), and ss_0_n (slave select output). The txd[0] signal contains INSTRUCTION. The txd[N-1:0] signal contains ADDRESS. The rxd[N:0] signal contains DATA. The ssL_oe_n[0] signal is active during the INSTRUCTION, ADDRESS, and WAIT CYCLES phases. The ssL_oe_n[N-1:0] signal is active during the INSTRUCTION, ADDRESS, and WAIT CYCLES phases. The ss_0_n signal is active during the INSTRUCTION, ADDRESS, and WAIT CYCLES phases.

Timing diagram for Figure 153 showing sclk_out, txd[0], txd[N-1:0], rxd[N:0], ssL_oe_n[0], ssL_oe_n[N-1:0], and ss_0_n signals. The txd[0] signal contains INSTRUCTION. The txd[N-1:0] signal contains ADDRESS. The rxd[N:0] signal contains DATA.

Case B: Instruction transmitted in standard and address transmitted in dual SPI format

For this, SPI_CTRLR0.TRANS_TYPE field should be set to 01b. Figure 154 shows the timing diagram in which instruction is transmitted in standard format and address is transmitted in dual SPI format. The value of N will be 7 if CTRLR0.SPI_FRF is set to 11b, 3 if CTRLR0.SPI_FRF is set to 10b, and 1 if CTRLR0.SPI_FRF is set to 01b.

Figure 154. Instruction Transmitted in Standard and Address Transmitted in Enhanced SPI Format

Timing diagram for Figure 154 showing SPI signals: sclk_out, txd[0], txd[N-1:0], rxd[N:0], ssi_oe_n[0], ssi_oe_n[N-1:0], and ss_o_n. The diagram shows the sequence of instruction and address transmission in standard and enhanced SPI formats.

The diagram shows the timing of SPI signals. ss_o_n is active low and goes low at the start of the transfer. ss_i_oe_n[0] and ss_i_oe_n[N-1:0] are active low and go high at the start of the transfer. txd[0] and txd[N-1:0] transmit the instruction and address. rxd[N:0] receives the data. sclk_out is the serial clock. The diagram shows the sequence of instruction and address transmission in standard and enhanced SPI formats.

Timing diagram for Figure 154 showing SPI signals: sclk_out, txd[0], txd[N-1:0], rxd[N:0], ssi_oe_n[0], ssi_oe_n[N-1:0], and ss_o_n. The diagram shows the sequence of instruction and address transmission in standard and enhanced SPI formats.
Case C: Instruction and Address both transmitted in Dual SPI format

For this, SPI_CTRLR0.TRANS_TYPE field must be set to 10b . Figure 155 shows the timing diagram in which both instruction and address are transmitted in dual SPI format. The value of N will be: 7 if CTRLR0.SPI_FRF is set to 11b , 3 if CTRLR0.SPI_FRF is set to 10b , and 1 if CTRLR0.SPI_FRF is set to 01b .

Figure 155. Instruction and Address Transmitted in Enhanced SPI Format

Timing diagram for Figure 155 showing SPI signals: sclk_out, txd[N:0], rxd[N:0], ssi_oe_n[N:0], and ss_o_n. The diagram shows the sequence of instruction and address transmission in enhanced SPI format.

The diagram shows the timing of SPI signals. ss_o_n is active low and goes low at the start of the transfer. ss_i_oe_n[N:0] is active low and goes high at the start of the transfer. txd[N:0] transmits the instruction and address. rxd[N:0] receives the data. sclk_out is the serial clock. The diagram shows the sequence of instruction and address transmission in enhanced SPI format.

Timing diagram for Figure 155 showing SPI signals: sclk_out, txd[N:0], rxd[N:0], ssi_oe_n[N:0], and ss_o_n. The diagram shows the sequence of instruction and address transmission in enhanced SPI format.
Case D: No Instruction, No Address READ transfer

For this, SPI_CTRLR0.ADDR_L and SPI_CTRLR0.INST_L must be set to 0 and SPI_CTRLR0.WAIT_CYCLES must be set to a non-zero value. Table 579 lists the ADDR_L decode value and the respective description for enhanced (Dual/Quad) SPI modes.

Table 579. ADDR_L Decode in Enhanced SPI Mode

ADDR_L Decode ValueDescription
00000-bit Address Width
00014-bit Address Width
00108-bit Address Width
001112-bit Address Width
010016-bit Address Width
010120-bit Address Width
011024-bit Address Width
011128-bit Address Width
100032-bit Address Width
100136-bit Address Width
101040-bit Address Width
101144-bit Address Width
110048-bit Address Width
110152-bit Address Width
111056-bit Address Width
111160-bit Address Width

Figure 156 shows the timing diagram for such type of transfer. The value of N will be: 7 if CTRLR0.SPI_FRF is set to 11b , 3 if CTRLR0.SPI_FRF is set to 10b , and 1 if CTRLR0.SPI_FRF is set to 01b . To initiate this transfer, the software has to perform a dummy write in the data register (DR), DW_apb_ssi will wait for programmed wait cycles and then fetch the amount of data specified in NDF field.

Figure 156. No Instruction and No Address READ Transfer

Timing diagram for Figure 156 showing signals: sclk_out, txd[N:0], rxd[N:0], ssi_oe_n[N:0], and ss_0_n. The diagram illustrates a sequence of operations where the txd[N:0] signal is high during 'WAIT CYCLES' and then transitions to a 'DATA' phase. The rxd[N:0] signal is high during the 'DATA' phase. The ssi_oe_n[N:0] signal is high during the 'WAIT CYCLES' phase and then transitions to a low state. The ss_0_n signal is high during the 'WAIT CYCLES' phase and then transitions to a low state.
Timing diagram for Figure 156 showing signals: sclk_out, txd[N:0], rxd[N:0], ssi_oe_n[N:0], and ss_0_n. The diagram illustrates a sequence of operations where the txd[N:0] signal is high during 'WAIT CYCLES' and then transitions to a 'DATA' phase. The rxd[N:0] signal is high during the 'DATA' phase. The ssi_oe_n[N:0] signal is high during the 'WAIT CYCLES' phase and then transitions to a low state. The ss_0_n signal is high during the 'WAIT CYCLES' phase and then transitions to a low state.

4.10.10.4.3. Advanced I/O Mapping for Enhanced SPI Modes

The Input/Output mapping for enhanced SPI modes (dual, and quad) is hardcoded inside the DW_apb_ssi. The rxd[1] signal will be used to sample incoming data in standard SPI mode of operation.

For other protocols (such as SSP and Microwire), the I/O mapping remains the same. Therefore, it is easy for other protocols to connect with any device that supports Dual/Quad SPI operation because other protocols do not require a MUX logic to exist outside the design.

Figure 157 shows the I/O mapping of DW_apb_ssi in Quad mode with another SPI device that supports the Quad mode. As illustrated in Figure 157, the IO[1] pin is used as DO in standard SPI mode of operation and it is connected to rxd[1] pin, which will be sampling the input in the standard mode of operation.

Figure 157. Advanced I/O Mapping in Quad SPI Modes

Block diagram for Figure 157 showing the I/O mapping of DW_apb_ssi in Quad SPI mode. The DW_apb_ssi block has signals txd[3], rxd[3], txd[2], rxd[2], txd[1], rxd[1], txd[0], and rxd[0]. These signals are connected to four IO Buffers. The IO Buffers are connected to the SPI slave Device signals IO[3], IO[2], IO[1]/DO, and IO[0]/DI. The IO[1]/DO signal is connected to the rxd[1] signal of the DW_apb_ssi block.
Block diagram for Figure 157 showing the I/O mapping of DW_apb_ssi in Quad SPI mode. The DW_apb_ssi block has signals txd[3], rxd[3], txd[2], rxd[2], txd[1], rxd[1], txd[0], and rxd[0]. These signals are connected to four IO Buffers. The IO Buffers are connected to the SPI slave Device signals IO[3], IO[2], IO[1]/DO, and IO[0]/DI. The IO[1]/DO signal is connected to the rxd[1] signal of the DW_apb_ssi block.

4.10.10.5. Dual Data-Rate (DDR) Support in SPI Operation

In standard operations, data transfer in SPI modes occur on either the positive or negative edge of the clock. For improved throughput, the dual data-rate transfer can be used for reading or writing to the memories.

The DDR mode supports the following modes of SPI protocol:

DDR commands enable data to be transferred on both edges of clock. Following are the different types of DDR commands:

The DDR_EN (SPI_CTRLR0[16]) bit is used to determine if the Address and data have to be transferred in DDR mode and INST_DDR_EN (SPI_CTRLR0[17]) bit is used to determine if Instruction must be transferred in DDR format. These bits

are only valid when the CTRLR0.SPI_FRF bit is set to be in Dual, or Quad mode.

Figure 158 describes a DDR write transfer where instructions are continued to be transmitted in standard format. In Figure 158, the value of N will be 7 if CTRLR0.SPI_FRF is set to 11b, 3 if CTRLR0.SPI_FRF is set to 10b, and 1 if CTRLR0.SPI_FRF is set to 01b.

Figure 158. DDR Transfer with SCPH=0 and SCPOL=0

Timing diagram for Figure 158 showing a DDR write transfer with SCPH=0 and SCPOL=0. The diagram tracks signals: sclk_out (clock), ss_oe_n (active low chip select), txd[N:0] (transmit data), rxd[N:0] (receive data), and ss_oe_n[N:0]. The txd[N:0] signal begins with an instruction phase (INST) in standard format, followed by address bytes (A3, A2, A1, A0) and data bytes (D3, D2, D1, D0) transmitted on both edges of sclk_out. Legend: INST = Instruction Phase; A3, A2, A1, A0 = Address Bytes; D3, D2, D1, D0 = Data Bytes.
Timing diagram for Figure 158 showing a DDR write transfer with SCPH=0 and SCPOL=0. The diagram tracks signals: sclk_out (clock), ss_oe_n (active low chip select), txd[N:0] (transmit data), rxd[N:0] (receive data), and ss_oe_n[N:0]. The txd[N:0] signal begins with an instruction phase (INST) in standard format, followed by address bytes (A3, A2, A1, A0) and data bytes (D3, D2, D1, D0) transmitted on both edges of sclk_out. Legend: INST = Instruction Phase; A3, A2, A1, A0 = Address Bytes; D3, D2, D1, D0 = Data Bytes.

Figure 159 describes a DDR write transfer where instruction, address and data all are transferred in DDR format.

Figure 159. DDR Transfer with Instruction, Address and Data Transmitted in DDR Format

Timing diagram for Figure 159 showing a DDR write transfer where all phases are in DDR format. Signals include sclk_out, ss_0_n, txd[N:0], rxd[N:0], and ssi_oe_n[N:0]. The txd[N:0] line shows two instruction bytes (INST-1, INST-2) followed by address bytes (A3, A2, A1, A0) and data bytes (D3, D2, D1, D0), all changing on both rising and falling edges of sclk_out. Legend: INST-1, INST-2 = Instruction Bytes; A3, A2, A1, A0 = Address Bytes; D3, D2, D1, D0 = Data Bytes.
Timing diagram for Figure 159 showing a DDR write transfer where all phases are in DDR format. Signals include sclk_out, ss_0_n, txd[N:0], rxd[N:0], and ssi_oe_n[N:0]. The txd[N:0] line shows two instruction bytes (INST-1, INST-2) followed by address bytes (A3, A2, A1, A0) and data bytes (D3, D2, D1, D0), all changing on both rising and falling edges of sclk_out. Legend: INST-1, INST-2 = Instruction Bytes; A3, A2, A1, A0 = Address Bytes; D3, D2, D1, D0 = Data Bytes.

NOTE

In the DDR transfer, address and instruction cannot be programmed to a value of 0.

4.10.10.5.1. Transmitting Data in DDR Mode

In DDR mode, data is transmitted on both edges so that it is difficult to sample data correctly. DW_apb_ssi uses an internal register to determine the edge on which the data should be transmitted. This will ensure that the receiver is able to get a stable data while sampling. The internal register (DDR_DRIVE_EDGE) determines the edge on which the data is transmitted. DW_apb_ssi sends data with respect to baud clock, which is an integral multiple of the internal clock ( \( ssi\_clk * BAUDR \) ). The data needs to be transmitted within half clock cycle ( \( BAUDR/2 \) ), therefore the maximum value for DDR_DRIVE_EDGE is equal to \( [(BAUDR/2)-1] \) . If the programmed value of DDR_DRIVE_EDGE is 0 then data is transmitted edge-aligned with respect to sclk_out (baud clock). If the programmed value of DDR_DRIVE_EDGE is one then the data is transmitted one ssi_clk before the edge of sclk_out.

NOTE

If the baud rate is programmed to be two, then the data will always be edge aligned.

Figure 160, Figure 161, and Figure 162 show examples of how data is transmitted using different values of the DDR_DRIVE_EDGE register. The green arrows in these examples represent the points where data is driven. Baud rate used in all these examples is 12. In Figure 160, transmit edge and driving edge of the data are the same. This is default behavior in DDR mode.

Figure 160. Transmit Data With DDR_DRIVE_EDGE = 0

Timing diagram for Figure 160 showing transmit data with DDR_DRIVE_EDGE = 0. Signals include ssi_clk (high frequency internal clock), sclk_out (baud clock), ss_0_n, txd[N:0], rxd[N:0], and ssi_oe_n[N:0]. Green arrows indicate that data transitions on txd[N:0] are aligned exactly with the edges of sclk_out. The sequence on txd[N:0] is INST, A3, A2, A1, A0, D3, D2, D1, D0. Legend: INST = Instruction Phase; A3, A2, A1, A0 = Address Bytes; D3, D2, D1, D0 = Data Bytes.
Timing diagram for Figure 160 showing transmit data with DDR_DRIVE_EDGE = 0. Signals include ssi_clk (high frequency internal clock), sclk_out (baud clock), ss_0_n, txd[N:0], rxd[N:0], and ssi_oe_n[N:0]. Green arrows indicate that data transitions on txd[N:0] are aligned exactly with the edges of sclk_out. The sequence on txd[N:0] is INST, A3, A2, A1, A0, D3, D2, D1, D0. Legend: INST = Instruction Phase; A3, A2, A1, A0 = Address Bytes; D3, D2, D1, D0 = Data Bytes.

Figure 160 shows the default behavior in which the transmit and driving edge of the data is the same.

Figure 161. Transmit Data With \( DDR\_DRIVE\_EDGE = 1 \)

Timing diagram for Figure 161 showing transmit data with DDR_DRIVE_EDGE = 1. The diagram includes signals: ssi_clk, sclk_out, ss_0_n, txd[N:0], rxd[N:0], and ssi_oe_n[N:0]. The txd[N:0] signal shows an instruction phase (INST) followed by address bytes (A3, A2, A1, A0) and data bytes (D3, D2, D1, D0). The ssi_oe_n[N:0] signal is active (low) during the instruction and address phases. The legend indicates: INST = Instruction Phase, A3, A2, A1, A0 = Address Bytes, D3, D2, D1, D0 = Data Bytes. In this mode, data transitions on txd[N:0] occur on the falling edge of sclk_out.
Timing diagram for Figure 161 showing transmit data with DDR_DRIVE_EDGE = 1. The diagram includes signals: ssi_clk, sclk_out, ss_0_n, txd[N:0], rxd[N:0], and ssi_oe_n[N:0]. The txd[N:0] signal shows an instruction phase (INST) followed by address bytes (A3, A2, A1, A0) and data bytes (D3, D2, D1, D0). The ssi_oe_n[N:0] signal is active (low) during the instruction and address phases. The legend indicates: INST = Instruction Phase, A3, A2, A1, A0 = Address Bytes, D3, D2, D1, D0 = Data Bytes. In this mode, data transitions on txd[N:0] occur on the falling edge of sclk_out.

Figure 162. Transmit Data With \( DDR\_DRIVE\_EDGE = 2 \)

Timing diagram for Figure 162 showing transmit data with DDR_DRIVE_EDGE = 2. The diagram includes signals: ssi_clk, sclk_out, ss_0_n, txd[N:0], rxd[N:0], and ssi_oe_n[N:0]. The txd[N:0] signal shows an instruction phase (INST) followed by address bytes (A3, A2, A1, A0) and data bytes (D3, D2, D1, D0). The ssi_oe_n[N:0] signal is active (low) during the instruction and address phases. The legend indicates: INST = Instruction Phase, A3, A2, A1, A0 = Address Bytes, D3, D2, D1, D0 = Data Bytes. In this mode, data transitions on txd[N:0] occur on the rising edge of sclk_out.
Timing diagram for Figure 162 showing transmit data with DDR_DRIVE_EDGE = 2. The diagram includes signals: ssi_clk, sclk_out, ss_0_n, txd[N:0], rxd[N:0], and ssi_oe_n[N:0]. The txd[N:0] signal shows an instruction phase (INST) followed by address bytes (A3, A2, A1, A0) and data bytes (D3, D2, D1, D0). The ssi_oe_n[N:0] signal is active (low) during the instruction and address phases. The legend indicates: INST = Instruction Phase, A3, A2, A1, A0 = Address Bytes, D3, D2, D1, D0 = Data Bytes. In this mode, data transitions on txd[N:0] occur on the rising edge of sclk_out.

4.10.10.6. XIP Mode Support in SPI Mode

The eXecute In Place (XIP) mode enables transfer of SPI data directly through the APB interface without writing the data register of DW_apb_ssi. XIP mode is enabled in DW_apb_ssi when the XIP cache is enabled. This control signal indicates whether APB transfers are register read-write or XIP reads. When in XIP mode, DW_apb_ssi expects only read request on the APB interface. This request is translated to SPI read on the serial interface and soon after the data is received, the data is returned to the APB interface in the same transaction.

NOTE

The address length is derived from the SPI_CTRLR0.ADDR_L field, and relevant bits from paddr ( \( [SPI\_CTRLR0.ADDR\_L-1:0] \) ) are transferred as address to the SPI interface. XIP address is managed by the XIP cache controller.

4.10.10.6.1. Read Operation in XIP Mode

The XIP operation is supported only in enhanced SPI modes (Dual, Quad) of operation. Therefore, the CTRLR0.SPI_FRF bit should not be programmed to 0. An XIP read operation is divided into two phases:

For an XIP read operation

  1. 1. Set the SPI frame format and data frame size value in CTRLR0 register. Note that the value of the maximum data frame size is 32.
  2. 2. Set the Address length, Wait cycles, and transaction type in the SPI_CTRLR0 register. Note that the maximum address length is 32.

After these settings, a user can initiate a read transaction through the APB interface which will transferred to SPI peripheral using programmed values. Figure 163 shows the typical XIP transfer. The Value of N = 1, 3 and 7 for SPI mode Dual, and Quad modes, respectively.

Figure 163. Typical Read Operation in XIP Mode

Timing diagram for a typical read operation in XIP mode. The diagram shows signals: pclk, xip_en, psel, penable, paddr, pready, prdata[31:0], ss_x_n, sclk_out, txd[N:0], and rxd[N:0]. The pclk is a periodic clock. xip_en is active high. psel is active high. penable is active high. paddr is 0x00. pready is active high. prdata[31:0] shows data D1. ss_x_n is active low. sclk_out is active high. txd[N:0] shows data 0x00. rxd[N:0] shows data D1. Blue arrows indicate data flow from prdata to txd and from rxd to prdata.
Timing diagram for a typical read operation in XIP mode. The diagram shows signals: pclk, xip_en, psel, penable, paddr, pready, prdata[31:0], ss_x_n, sclk_out, txd[N:0], and rxd[N:0]. The pclk is a periodic clock. xip_en is active high. psel is active high. penable is active high. paddr is 0x00. pready is active high. prdata[31:0] shows data D1. ss_x_n is active low. sclk_out is active high. txd[N:0] shows data 0x00. rxd[N:0] shows data D1. Blue arrows indicate data flow from prdata to txd and from rxd to prdata.

4.10.11. DMA Controller Interface

The DW_apb_ssi has built-in DMA capability; it has a handshaking interface to a DMA Controller to request and control transfers. The APB bus is used to perform the data transfer to or from the DMA.

NOTE

When the DW_apb_ssi interfaces to the DMA controller, the DMA controller is always a flow controller; that is, it controls the block size. This must be programmed by software in the DMA controller.

The DW_apb_ssi uses two DMA channels, one for the transmit data and one for the receive data. The DW_apb_ssi has these DMA registers:

DMACR

Control register to enable DMA operation.

DMATDLR

Register to set the transmit the FIFO level at which a DMA request is made.

DMARDLR

Register to set the receive FIFO level at which a DMA request is made.

The DW_apb_ssi uses the following handshaking signals to interface with the DMA controller.

To enable the DMA Controller interface on the DW_apb_ssi, you must write the DMA Control Register (DMACR). Writing a 1 into the TDMAE bit field of DMACR register enables the DW_apb_ssi transmit handshaking interface. Writing a 1 into the RDMAE bit field of the DMACR register enables the DW_apb_ssi receive handshaking interface.

Table 580 provides description for different DMA transmit data level values.

Table 580. DMA Transmit Data Level (DMATDL) Decode Value

DMATDL ValueDescription
0000_0000dma_tx_req is asserted when zero data entries are present in the transmit FIFO
0000_0001dma_tx_req is asserted when one or less data entry is present in the transmit FIFO
0000_0010dma_tx_req is asserted when two or less data entries are present in the transmit FIFO
......
0000_1101dma_tx_req is asserted when 13 or less data entries are present in the transmit FIFO
0000_1110dma_tx_req is asserted when 14 or less data entries are present in the transmit FIFO
0000_1111dma_tx_req is asserted when 15 or less data entries are present in the transmit FIFO

Table 581 provides description for different DMA Receive Data Level values.

Table 581. DMA
Receive Data Level
(DMARDL) Decode
Value

DMARDL ValueDescription
0000_0000dma_rx_req is asserted when one or more data entries are present in the receive FIFO
0000_0001dma_rx_req is asserted when two or more data entries are present in the receive FIFO
0000_0010dma_rx_req is asserted when three or more data entries are present in the receive FIFO
......
0000_1101dma_rx_req is asserted when 14 or more data entries are present in the receive FIFO
0000_1110dma_rx_req is asserted when 15 or more data entries are present in the receive FIFO
0000_1111dma_rx_req is asserted when 16 data entries are present in the receive FIFO

4.10.11.1. Overview of Operation

As a block flow control device, the DMA Controller is programmed by the processor with the number of data items (block size) that are to be transmitted or received by the DW_apb_ssi.

The block is broken into a number of transactions, each initiated by a request from the DW_apb_ssi. The DMA Controller must also be programmed with the number of data items (in this case, DW_apb_ssi FIFO entries) to be transferred for each DMA request. This is also known as the burst transaction length.

Figure 164 shows a single block transfer, where the block size programmed into the DMA Controller is 12 and the burst transaction length is set to four. In this case, the block size is a multiple of the burst transaction length; therefore, the DMA block transfer consists of a series of burst transactions.

Caution icon CAUTION

On RP2040, the burst transaction length of the SSI's DMA interface is fixed at four transfers. SSI.DMARDLR must always be equal to 4, which is the value it takes at reset. The SSI will then request a single transfer when it has between one and three items in its FIFO, and a 4-burst when it has four or more.

Figure 164.
Breakdown of DMA
Transfer into Burst
Transactions. Block
size,
\( \text{DMA\_CTLx.BLOCKS\_TS} = \)
12. Number of data
items per source burst
transaction,
\( \text{DMA\_CTLx.SRC\_MSIZE} = \)
4. SSI receive FIFO
watermark level,
\( \text{SSI\_DMARDLR} + 1 = \)
\( \text{DMA\_CTLx.SRC\_MSIZE} = \)
4

Figure 164: Breakdown of DMA Transfer into Burst Transactions. The diagram shows a hierarchical structure starting with '12 Data Items' at the top, leading to a 'DMA Multi-block Transfer Level' box. This connects to a 'DMA Block Level' box, which then branches into three 'DMA Burst Transaction' boxes (1, 2, and 3). Each burst transaction is labeled with '4 Data Items' below it.
graph TD
    A[12 Data Items] --> B[DMA Multi-block Transfer Level]
    B --> C[12 Data Items]
    C --> D[DMA Block Level]
    D --> E1[DMA Burst Transaction 1]
    D --> E2[DMA Burst Transaction 2]
    D --> E3[DMA Burst Transaction 3]
    E1 --> F1[4 Data Items]
    E2 --> F2[4 Data Items]
    E3 --> F3[4 Data Items]
    
Figure 164: Breakdown of DMA Transfer into Burst Transactions. The diagram shows a hierarchical structure starting with '12 Data Items' at the top, leading to a 'DMA Multi-block Transfer Level' box. This connects to a 'DMA Block Level' box, which then branches into three 'DMA Burst Transaction' boxes (1, 2, and 3). Each burst transaction is labeled with '4 Data Items' below it.

If the DW_apb_ssi makes a transmit request to this channel, four data items are written to the DW_apb_ssi transmit FIFO. Similarly, if the DW_apb_ssi makes a receive request to this channel, four data items are read from the DW_apb_ssi receive FIFO. Three separate requests must be made to this DMA channel before all 12 data items are written or read.

When the block size programmed into the DMA Controller is not a multiple of the burst transaction length, as shown in Figure 165 , a series of burst transactions followed by single transactions are needed to complete the block transfer.

Figure 165.
Breakdown of DMA
Transfer into Single
and Burst
Transactions. Block
size,
\( \text{DMA\_CTLx.BLOCK\_TS} = \)
15. Number of data
items per burst
transaction,
\( \text{DMA\_CTLx.DEST\_MSIZE} = \)
4. SSI transmit FIFO
watermark level,
\( \text{SSI\_DMATDLR} = \)
\( \text{DMA\_CTLx.DEST\_MSIZE} = \)
4

Figure 165: Breakdown of DMA Transfer into Single and Burst Transactions. The diagram shows a hierarchical structure starting with '15 Data Items' at the top, leading to a 'DMA Multi-block Transfer Level' box. This connects to a 'DMA Block Level' box, which then branches into six transaction boxes: three 'DMA Burst Transaction' boxes (1, 2, and 3) and three 'DMA Single Transaction' boxes (1, 2, and 3). The burst transactions are labeled with '4 Data Items' below them, and the single transactions are labeled with '1 Data Items' below them.
graph TD
    A[15 Data Items] --> B[DMA Multi-block Transfer Level]
    B --> C[15 Data Items]
    C --> D[DMA Block Level]
    D --> E1[DMA Burst Transaction 1]
    D --> E2[DMA Burst Transaction 2]
    D --> E3[DMA Burst Transaction 3]
    D --> F1[DMA Single Transaction 1]
    D --> F2[DMA Single Transaction 2]
    D --> F3[DMA Single Transaction 3]
    E1 --> G1[4 Data Items]
    E2 --> G2[4 Data Items]
    E3 --> G3[4 Data Items]
    F1 --> H1[1 Data Items]
    F2 --> H2[1 Data Items]
    F3 --> H3[1 Data Items]
    
Figure 165: Breakdown of DMA Transfer into Single and Burst Transactions. The diagram shows a hierarchical structure starting with '15 Data Items' at the top, leading to a 'DMA Multi-block Transfer Level' box. This connects to a 'DMA Block Level' box, which then branches into six transaction boxes: three 'DMA Burst Transaction' boxes (1, 2, and 3) and three 'DMA Single Transaction' boxes (1, 2, and 3). The burst transactions are labeled with '4 Data Items' below them, and the single transactions are labeled with '1 Data Items' below them.

4.10.12. APB Interface

The host processor accesses data, control, and status information on the DW_apb_ssi through the APB interface. APB accesses to the DW_apb_ssi peripheral are described in the following subsections.

4.10.12.1. Control and Status Register APB Access

Control and status registers within the DW_apb_ssi are byte-addressable. The maximum width of the control or status register in the DW_apb_ssi is 16 bits. Therefore all read and write operations to the DW_apb_ssi control and status registers require only one APB access.

4.10.12.2. Data Register APB Access

The data register (DR) within the DW_apb_ssi is 32 bits wide in order to remain consistent with the maximum serial transfer size (data frame). An APB write operation to DR moves data from pwwdata into the transmit FIFO buffer. An APB read operation from DR moves data from the receive FIFO buffer onto prdata.

The DW_apb_ssi DR can be written/read in one APB access.

i NOTE

The DR register in the DW_apb_ssi occupies sixty-four 32-bit locations of the memory map to facilitate AHB burst transfers. There are no burst transactions on the APB bus itself, but DW_apb_ssi supports the AHB bursts that happen on the AHB side of the AHB/APB bridge. Writing to any of these address locations has the same effect as pushing the data from the pwwdata bus into the transmit FIFO. Reading from any of these locations has the same effect as popping data from the receive FIFO onto the prdata bus. The FIFO buffers on the DW_apb_ssi are not addressable.

4.10.13. List of Registers

The SSI registers start at a base address of 0x18000000(defined as XIP_SSI_BASE in SDK).

Table 582. List of SSI registers

OffsetNameInfo
0x00CTRLR0Control register 0
0x04CTRLR1Master Control register 1
0x08SSIENRSSI Enable
0x0cMWCRMicrowire Control
0x10SERSlave enable
0x14BAUDRBaud rate
0x18TXFTLRTX FIFO threshold level
0x1cRXFTLRRX FIFO threshold level
0x20TXFLRTX FIFO level
0x24RXFLRRX FIFO level
0x28SRStatus register
0x2cIMRInterrupt mask
0x30ISRInterrupt status
0x34RISRRaw interrupt status
0x38TXOICRTX FIFO overflow interrupt clear
0x3cRXOICRRX FIFO overflow interrupt clear
0x40RXUICRRX FIFO underflow interrupt clear
0x44MSTICRMulti-master interrupt clear
0x48ICRInterrupt clear
0x4cDMACRDMA control
0x50DMATDLRDMA TX data level
0x54DMARDLRDMA RX data level
Bits Register 31:0 Bitscolumn_2Description DescriptionType RO TypeReset 0x00000001 Reset
0xf8TXD_DRIVE_EDGETX drive edge
Table 583. CTRLR0 BitsControl register 0 DescriptionTypeReset
Register 31:25Reserved.--
24SSTE: Slave select toggle enableRW0x0
23Reserved.--
22:21SPI_FRF: SPI frame formatRW0x0
0x0Enumerated values: → STD: Standard 1-bit SPI frame format; 1 bit per SCK, full-duplex
0x1→ DUAL: Dual-SPI frame format; two bits per SCK, half-duplex
0x2→ QUAD: Quad-SPI frame format; four bits per SCK, half-duplex
20:16DFS_32: Data frame size in 32b transfer modeRW0x00
Value of n→ n+1 clocks per frame.
15:12CFS: Control frame sizeRW0x0
Value of n→ n+1 clocks per frame.
11SRL: Shift register loop (test mode)RW0x0
10SLV_OE: Slave output enableRW0x0
9:8TMOD: Transfer modeRW0x0
0x0Enumerated values: → TX_AND_RX: Both transmit and receive
0x1→ TX_ONLY: Transmit only (not for FRF == 0, standard SPI mode)
0x2→ RX_ONLY: Receive only (not for FRF == 0, standard SPI mode)
0x3→ EEPROM_READ: EEPROM read mode (TX then RX; RX starts after control data TX’d)
7SCPOL: Serial clock polarityRW0x0
6SCPH: Serial clock phaseRW0x0
5:4FRF: Frame formatRW0x0
3:0DFS: Data frame sizeRW0x0

SSI: CTRLR0 Register

Offset: 0x00

Description

Control register 0

Table 583. CTRLR0 Register

SSI: CTRLR1 Register

Offset: 0x04

Description

Master Control register 1

Table 584. CTRLR1 Register

BitsDescriptionTypeReset
31:16Reserved.--
15:0NDF : Number of data framesRW0x0000

SSI: SSIENR Register

Offset: 0x08

Description

SSI Enable

Table 585. SSIENR Register

BitsDescriptionTypeReset
31:1Reserved.--
0SSI_EN : SSI enableRW0x0

SSI: MWCR Register

Offset: 0x0c

Description

Microwire Control

Table 586. MWCR Register

BitsDescriptionTypeReset
31:3Reserved.--
2MHS : Microwire handshakingRW0x0
1MDD : Microwire controlRW0x0
0MWMOD : Microwire transfer modeRW0x0

SSI: SER Register

Offset: 0x10

Description

Slave enable

Table 587. SER Register

BitsDescriptionTypeReset
31:1Reserved.--
0For each bit:
0 → slave not selected
1 → slave selected
RW0x0

SSI: BAUDR Register

Offset: 0x14

Description

Baud rate

Table 588. BAUDR Register

BitsDescriptionTypeReset
31:16Reserved.--
15:0SCKDV : SSI clock dividerRW0x0000

SSI: TXFTLR Register

Offset: 0x18

Description

TX FIFO threshold level

Table 589. TXFTLR Register

BitsDescriptionTypeReset
31:8Reserved.--
7:0TFT : Transmit FIFO thresholdRW0x00

SSI: RXFTLR Register

Offset: 0x1c

Description

RX FIFO threshold level

Table 590. RXFTLR Register

BitsDescriptionTypeReset
31:8Reserved.--
7:0RFT : Receive FIFO thresholdRW0x00

SSI: TXFLR Register

Offset: 0x20

Description

TX FIFO level

Table 591. TXFLR Register

BitsDescriptionTypeReset
31:8Reserved.--
7:0TFTFL : Transmit FIFO levelRO0x00

SSI: RXFLR Register

Offset: 0x24

Description

RX FIFO level

Table 592. RXFLR Register

BitsDescriptionTypeReset
31:8Reserved.--
7:0RXTFL : Receive FIFO levelRO0x00

SSI: SR Register

Offset: 0x28

Description

Status register

Table 593. SR Register

BitsDescriptionTypeReset
31:7Reserved.--
6DCOL : Data collision errorRO0x0
5TXE : Transmission errorRO0x0
4RFF : Receive FIFO fullRO0x0
3RFNE : Receive FIFO not emptyRO0x0
2TFE : Transmit FIFO emptyRO0x0
1TFNF : Transmit FIFO not fullRO0x0
0BUSY : SSI busy flagRO0x0

SSI: IMR Register

Offset: 0x2c

Description

Interrupt mask

Table 594. IMR Register

BitsDescriptionTypeReset
31:6Reserved.--
5MSTIM : Multi-master contention interrupt maskRW0x0
4RXFIM : Receive FIFO full interrupt maskRW0x0
3RXOIM : Receive FIFO overflow interrupt maskRW0x0
2RXUIM : Receive FIFO underflow interrupt maskRW0x0
1TXOIM : Transmit FIFO overflow interrupt maskRW0x0
0TXEIM : Transmit FIFO empty interrupt maskRW0x0

SSI: ISR Register

Offset: 0x30

Description

Interrupt status

Table 595. ISR Register

BitsDescriptionTypeReset
31:6Reserved.--
5MSTIS : Multi-master contention interrupt statusRO0x0
4RXFIS : Receive FIFO full interrupt statusRO0x0
3RXOIS : Receive FIFO overflow interrupt statusRO0x0
2RXUIS : Receive FIFO underflow interrupt statusRO0x0
1TXOIS : Transmit FIFO overflow interrupt statusRO0x0
0TXEIS : Transmit FIFO empty interrupt statusRO0x0

SSI: RISR Register

Offset: 0x34

Description

Raw interrupt status

Table 596. RISR Register

BitsDescriptionTypeReset
31:6Reserved.--
5MSTIR : Multi-master contention raw interrupt statusRO0x0
4RXFIR : Receive FIFO full raw interrupt statusRO0x0
3RXOIR : Receive FIFO overflow raw interrupt statusRO0x0
2RXUIR : Receive FIFO underflow raw interrupt statusRO0x0
1TXOIR : Transmit FIFO overflow raw interrupt statusRO0x0
0TXEIR : Transmit FIFO empty raw interrupt statusRO0x0

SSI: TXOICR Register

Offset: 0x38

Description

TX FIFO overflow interrupt clear

Table 597. TXOICR Register

BitsDescriptionTypeReset
31:1Reserved.--
0Clear-on-read transmit FIFO overflow interruptRO0x0

SSI: RXOICR Register

Offset: 0x3c

Description

RX FIFO overflow interrupt clear

Table 598. RXOICR Register

BitsDescriptionTypeReset
31:1Reserved.--
0Clear-on-read receive FIFO overflow interruptRO0x0

SSI: RXUICR Register

Offset: 0x40

Description

RX FIFO underflow interrupt clear

Table 599. RXUICR Register

BitsDescriptionTypeReset
31:1Reserved.--
0Clear-on-read receive FIFO underflow interruptRO0x0

SSI: MSTICR Register

Offset: 0x44

Description

Multi-master interrupt clear

Table 600. MSTICR Register

BitsDescriptionTypeReset
31:1Reserved.--
0Clear-on-read multi-master contention interruptRO0x0

SSI: ICR Register

Offset: 0x48

Description

Interrupt clear

Table 601. ICR Register

BitsDescriptionTypeReset
31:1Reserved.--
0Clear-on-read all active interruptsRO0x0

SSI: DMACR Register

Offset: 0x4c

Description

DMA control

Table 602. DMACR Register

BitsDescriptionTypeReset
31:2Reserved.--
1TDMAE : Transmit DMA enableRW0x0
0RDMAE : Receive DMA enableRW0x0

SSI: DMATDLR Register

Offset: 0x50

Description

DMA TX data level

Table 603. DMATDLR Register

BitsDescriptionTypeReset
31:8Reserved.--
7:0DMATDL : Transmit data watermark levelRW0x00

SSI: DMARDLR Register

Offset: 0x54

Description

DMA RX data level

Table 604. DMARDLR Register

BitsDescriptionTypeReset
31:8Reserved.--
7:0DMARDL : Receive data watermark level (DMARDLR+1)RW0x00

SSI: IDR Register

Offset: 0x58

Description

Identification register

Table 605. IDR Register

BitsDescriptionTypeReset
31:0IDCODE : Peripheral dentification codeRO0x51535049

SSI: SSI_VERSION_ID Register

Offset: 0x5c

Description

Version ID

Table 606. SSI_VERSION_ID Register

BitsDescriptionTypeReset
31:0SSI_COMP_VERSION : SNPS component version (format X.YY)RO0x3430312a

SSI: DR0 Register

Offset: 0x60

Description

Data Register 0 (of 36)

Table 607. DR0 Register

BitsDescriptionTypeReset
31:0DR : First data register of 36RW0x00000000

SSI: RX_SAMPLE_DLY Register

Offset: 0xf0

Description

RX sample delay

Table 608. RX_SAMPLE_DLY Register

BitsDescriptionTypeReset
31:8Reserved.--
7:0RSD : RXD sample delay (in SCLK cycles)RW0x00

SSI: SPI_CTRLR0 Register

Offset: 0xf4

Description

SPI control

Table 609.
SPI_CTRLR0 Register

BitsDescriptionTypeReset
31:24XIP_CMD : SPI Command to send in XIP mode (INST_L = 8-bit) or to append to Address (INST_L = 0-bit)RW0x03
23:19Reserved.--
18SPI_RXDS_EN : Read data strobe enableRW0x0
17INST_DDR_EN : Instruction DDR transfer enableRW0x0
16SPI_DDR_EN : SPI DDR transfer enableRW0x0
15:11WAIT_CYCLES : Wait cycles between control frame transmit and data reception (in SCLK cycles)RW0x00
10Reserved.--
9:8INST_L : Instruction length (0/4/8/16b)RW0x0
Enumerated values:
0x0 → NONE: No instruction
0x1 → 4B: 4-bit instruction
0x2 → 8B: 8-bit instruction
0x3 → 16B: 16-bit instruction
7:6Reserved.--
5:2ADDR_L : Address length (0b-60b in 4b increments)RW0x0
1:0TRANS_TYPE : Address and instruction transfer formatRW0x0
Enumerated values:
0x0 → 1C1A: Command and address both in standard SPI frame format
0x1 → 1C2A: Command in standard SPI format, address in format specified by FRF
0x2 → 2C2A: Command and address both in format specified by FRF (e.g. Dual-SPI)

SSI: TXD_DRIVE_EDGE Register

Offset: 0xf8

Description

TX drive edge

Table 610.
TXD_DRIVE_EDGE
Register

BitsDescriptionTypeReset
31:8Reserved.--
7:0TDE : TXD drive edgeRW0x00