Datasheet
167
2545T–AVR–05/11
ATmega48/88/168
Figure 19-3. SPI transfer format with CPHA = 0.
Figure 19-4. SPI transfer format with CPHA = 1.
Table 19-2. CPOL functionality.
Leading edge Trailing edge SPI mode
CPOL=0, CPHA=0 Sample (rising) Setup (falling) 0
CPOL=0, CPHA=1 Setup (rising) Sample (falling) 1
CPOL=1, CPHA=0 Sample (falling) Setup (rising) 2
CPOL=1, CPHA=1 Setup (falling) Sample (rising) 3
Bit 1
Bit 6
LSB
MSB
SCK (CPOL = 0)
mode 0
SAMPLE I
MOSI/MISO
CHANGE 0
MOSI PIN
CHANGE 0
MISO PIN
SCK (CPOL = 1)
mode 2
SS
MSB
LSB
Bit 6
Bit 1
Bit 5
Bit 2
Bit 4
Bit 3
Bit 3
Bit 4
Bit 2
Bit 5
MSB first (DORD = 0)
LSB first (DORD = 1)
SCK (CPOL = 0)
mode 1
SAMPLE I
MOSI/MISO
CHANGE 0
MOSI PIN
CHANGE 0
MISO PIN
SCK (CPOL = 1)
mode 3
SS
MSB
LSB
Bit 6
Bit 1
Bit 5
Bit 2
Bit 4
Bit 3
Bit 3
Bit 4
Bit 2
Bit 5
Bit 1
Bit 6
LSB
MSB
MSB first (DORD = 0)
LSB first (DORD = 1)