English
Language : 

MC68HC08AS20 Datasheet, PDF (276/386 Pages) Freescale Semiconductor, Inc – M68HC08 Microcontrollers
18.5.1 Master Mode
The SPI operates in master mode when the SPI master bit, SPMSTR
(SPCR $0010), is set.
NOTE:
Configure the SPI modules as master and slave before enabling them.
Enable the master SPI before enabling the slave SPI. Disable the slave
SPI before disabling the master SPI. (See 18.14.1 SPI Control
Register.)
Only a master SPI module can initiate transmissions. Software begins
the transmission from a master SPI module by writing to the SPI data
register. If the shift register is empty, the byte immediately transfers to
the shift register, setting the SPI transmitter empty bit, SPTE (SPSCR
$0011). The byte begins shifting out on the MOSI pin under the control
of the serial clock. (See Figure 18-2.)
The SPR1 and SPR0 bits control the baud rate generator and determine
the speed of the shift register. (See 18.14.2 SPI Status and Control
Register.) Through the SPSCK pin, the baud rate generator of the
master also controls the shift register of the slave peripheral.
MASTER MCU
SHIFT REGISTER
BAUD RATE
GENERATOR
MISO
MOSI
SPSCK
SS
SLAVE MCU
MISO
MOSI
SPSCK
SHIFT REGISTER
VDD
SS
Figure 18-2. Full-Duplex Master-Slave Connections
Advance Information
276
MC68HC08AS20 —Rev. 4.1
Freescale Semiconductor