8.3.8.2 Data Transfer

Four combinations of polarity and phase are available for data transfers. The clock polarity is programmed with the CPOL bit in the SPI Chip Select register (FLEX_SPI_CSR). The clock phase is programmed with the NCPHA bit. These two parameters determine the edges of the clock signal on which data are driven and sampled. Each of the two parameters has two possible states, resulting in four possible combinations that are incompatible with one another. Consequently, a host/client pair must use the same parameter pair values to communicate. If multiple clients are connected and require different configurations, the host must reconfigure itself each time it needs to communicate with a different client.

The following table shows the four modes and corresponding parameter settings.

Table 8-30. SPI Bus Protocol Mode
SPI ModeCPOLNCPHAHost Shift SPCK EdgeClient Capture SPCK EdgeSPCK Inactive Level
001FallingRisingLow
100RisingFallingLow
211RisingFallingHigh
310FallingRisingHigh

The following figures show examples of data transfers.

Figure 8-84. SPI Transfer Format (NCPHA = 1, 8 bits per transfer) Modes 0 and 2
Figure 8-85. SPI Transfer Format (NCPHA = 0, 8 bits per transfer) Modes 1 and 3