English
Language : 

MC68HC16Z1CAG16 Datasheet, PDF (249/500 Pages) Freescale Semiconductor, Inc – M68HC16Z Series users manual
Freescale Semiconductor, Inc.
10.3.4.1 CPHA = 0 Transfer Format
Figure 10-3 is a timing diagram of an 8-bit, MSB-first SPI transfer in which CPHA
equals zero. Two waveforms are shown for SCK: one for CPOL equal to zero and an-
other for CPOL equal to one. The diagram may be interpreted as a master or slave
timing diagram since the SCK, MISO and MOSI pins are directly connected between
the master and the slave. The MISO signal shown is the output from the slave and the
MOSI signal shown is the output from the master. The SS line is the chip-select input
to the slave.
SCK CYCLE #
(FOR REFERENCE)
1
2
3
4
5
6
7
8
SCK (CPOL = 0)
SCK (CPOL = 1)
MOSI
(FROM MASTER)
MSB
6
5
4
3
2
1
LSB
MISO
(FROM SLAVE)
SS (TO SLAVE)
MSB
6
5
4
3
2
1
LSB
Figure 10-3 CPHA = 0 SPI Transfer Format
CPHA = 0 SPI TRANSFER
For a master, writing to the SPDR initiates the transfer. For a slave, the falling edge of
SS indicates the start of a transfer. The SCK signal remains inactive for the first half
of the first SCK cycle. Data is latched on the first and each succeeding odd clock edge,
and the SPI shift register is left-shifted on the second and succeeding even clock edg-
es. SPIF is set at the end of the eighth SCK cycle.
When CPHA equals zero, the SS line must be negated and reasserted between each
successive serial byte. If the slave writes data to the SPI data register while SS is as-
serted (low), a write collision error results. To avoid this problem, the slave should read
bit three of PORTMCP, which indicates the state of the SS pin, before writing to the
SPDR again.
M68HC16 Z SERIES
USER’S MANUAL
MULTICHANNEL COMMUNICATION INTERFACE
For More Information On This Product,
Go to: www.freescale.com
10-9