English
Language : 

MC9S08JM16 Datasheet, PDF (243/386 Pages) Freescale Semiconductor, Inc – Microcontrollers
Serial Peripheral Interface (S08SPI16V1)
15.1.4.1 SPI System Block Diagram
Figure 15-3 shows the SPI modules of two MCUs connected in a master-slave arrangement. The master
device initiates all SPI data transfers. During a transfer, the master shifts data out (on the MOSI pin) to the
slave while simultaneously shifting data in (on the MISO pin) from the slave. The transfer effectively
exchanges the data that was in the SPI shift registers of the two SPI systems. The SPSCK signal is a clock
output from the master and an input to the slave. The slave device must be selected by a low level on the
slave select input (SS pin). In this system, the master device has configured its SS pin as an optional slave
select output.
MASTER
SLAVE
SPI SHIFTER
8 OR 16 BITS
MOSI
MISO
MOSI
MISO
SPI SHIFTER
8 OR 16 BITS
CLOCK
GENERATOR
SPSCK
SPSCK
SS
SS
Figure 15-3. SPI System Connections
15.1.4.2 SPI Module Block Diagram
Figure 15-4 is a block diagram of the SPI module. The central element of the SPI is the SPI shift register.
Data is written to the double-buffered transmitter (write to SPIxDH:SPIxDL) and gets transferred to the
SPI shift register at the start of a data transfer. After shifting in 8 or 16 bits (as determined by SPIMODE
bit) of data, the data is transferred into the double-buffered receiver where it can be read (read from
SPIxDH:SPIxDL). Pin multiplexing logic controls connections between MCU pins and the SPI module.
When the SPI is configured as a master, the clock output is routed to the SPSCK pin, the shifter output is
routed to MOSI, and the shifter input is routed from the MISO pin.
When the SPI is configured as a slave, the SPSCK pin is routed to the clock input of the SPI, the shifter
output is routed to MISO, and the shifter input is routed from the MOSI pin.
In the external SPI system, simply connect all SPSCK pins to each other, all MISO pins together, and all
MOSI pins together. Peripheral devices often use slightly different names for these pins.
MC9S08JM16 Series Data Sheet, Rev. 2
Freescale Semiconductor
243