30.4.2.4 SPI Transfer Modes

There are four combinations of SCK phase and polarity for transferring serial data. The SPI data transfer modes are shown in Table 30-2 and Figure 30-3.

SCK phase is configured by the Clock Phase bit in the CTRLA register (CTRLA.CPHA). SCK polarity is programmed by the Clock Polarity bit in the CTRLA register (CTRLA.CPOL). Data bits are shifted out and latched in on opposite edges of the SCK signal. This ensures sufficient time for the data signals to stabilize.

Table 30-2. SPI Transfer Modes
ModeCPOLCPHALeading EdgeTrailing Edge
000Rising, sampleFalling, setup
101Rising, setupFalling, sample
210Falling, sampleRising, setup
311Falling, setupRising, sample
Note:

Leading edge is the first clock edge in a clock cycle.

Trailing edge is the second clock edge in a clock cycle.

Figure 30-3. SPI Transfer Modes