57.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 57-14. SPI Bus Protocol Mode
SPI Mode CPOL NCPHA Host Shift SPCK Edge Client Capture SPCK Edge SPCK Inactive Level
0 0 1 Falling Rising Low
1 0 0 Rising Falling Low
2 1 1 Rising Falling High
3 1 0 Falling Rising High

The following figures show examples of data transfers.

Figure 57-75. SPI Transfer Format (NCPHA = 1, 8 bits per transfer) Mode 0 and 2
Figure 57-76. SPI Transfer Format (NCPHA = 0, 8 bits per transfer) Mode 1 and 3