23.4 Data Modes

There are four combinations of SCK phase and polarity with respect to serial data, which are determined by control bits CPHA and CPOL. The SPI data transfer formats are shown in the figures in this section. Data bits are shifted out and latched in on opposite edges of the SCK signal, ensuring sufficient time for data signals to stabilize. This is clearly seen by summarizing Table 23-3 and Table 23-4, as done below:

Table 23-2. CPOL and CPHA Functionality
SPI ModeConditionsLeading EdgeTrailing Edge
0CPOL=0, CPHA=0Sample (Rising)Setup (Falling)
1CPOL=0, CPHA=1Setup (Rising)Sample (Falling)
2CPOL=1, CPHA=0Sample (Falling)Setup (Rising)
3CPOL=1, CPHA=1Setup (Falling)Sample (Rising)
Figure 23-3. SPI Transfer Format with CPHA = 0
Figure 23-4. SPI Transfer Format with CPHA = 1