
DR
AFT
DR
AFT
DRAFT
DR
D
RAFT
DRAFT
DRA
FT DRAF
D
RAFT DRAFT DRAFT DRAFT DRAFT D
DRAFT
D
RAFT DRA
FT DRAFT DRAFT DRAFT DRA
UM10360_0
© NXP B.V. 2009. All rights reserved.
User manual
Rev. 00.06 — 5 June 2009
379 of 808
NXP Semiconductors
UM10360
Chapter 17: LPC17xx SPI
The data and clock phase relationships are summarized in
.
The definition of when a transfer starts and stops is dependent on whether a device is a
master or a slave, and the setting of the CPHA variable.
When a device is a master, the start of a transfer is indicated by the master having a byte
of data that is ready to be transmitted. At this point, the master can activate the clock, and
begin the transfer. The transfer ends when the last clock cycle of the transfer is complete.
When a device is a slave and CPHA is set to 0, the transfer starts when the SSEL signal
goes active, and ends when SSEL goes inactive. When a device is a slave, and CPHA is
set to 1, the transfer starts on the first clock edge when the slave is selected, and ends on
the last clock edge where data is sampled.
Fig 72. SPI data transfer format (CPHA = 0 and CPHA = 1)
MISO (CPHA = 1)
MOSI (CPHA = 1)
Cycle # CPHA = 1
CPHA = 1
MISO (CPHA = 0)
MOSI (CPHA = 0)
Cycle # CPHA = 0
CPHA = 0
SSEL
SCK (CPOL = 1)
SCK (CPOL = 0)
1
2
3
8
7
6
5
4
BIT 1
BIT 2
BIT 3
BIT 8
BIT 7
BIT 6
BIT 5
BIT 4
BIT 1
BIT 2
BIT 3
BIT 8
BIT 7
BIT 6
BIT 5
BIT 4
1
2
3
8
7
6
5
4
BIT 1
BIT 2
BIT 3
BIT 8
BIT 7
BIT 6
BIT 5
BIT 4
BIT 1
BIT 2
BIT 3
BIT 8
BIT 7
BIT 6
BIT 5
BIT 4
Table 339. SPI Data To Clock Phase Relationship
CPOL and CPHA
settings
When the first data bit is
driven
When all other data
bits are driven
When data is
sampled
CPOL = 0, CPHA = 0
Prior to first SCK rising edge
SCK falling edge
SCK rising edge
CPOL = 0, CPHA = 1
First SCK rising edge
SCK rising edge
SCK falling edge
CPOL = 1, CPHA = 0
Prior to first SCK falling edge
SCK rising edge
SCK falling edge
CPOL = 1, CPHA = 1
First SCK falling edge
SCK falling edge
SCK rising edge