English
Language : 

MC9S08JM16 Datasheet, PDF (241/386 Pages) Freescale Semiconductor, Inc – Microcontrollers
Serial Peripheral Interface (S08SPI16V1)
Write:
Write:
Write:
Write:
SPIxC1
SPIxC2
SPIxMH:SPIxML
SPIxC1
Module Initialization (Slave):
to configure
to configure
to set
interrupts, set primary SPI options, slave mode select, and
system enable.
optional SPI features, hardware match interrupt enable,
and 8- or 16-bit data transmission length
hardware compare value that triggers SPMF (optional)
when value in receive data buffer equals this value.
Module Initialization (Master):
to configure
interrupts, set primary SPI options, master mode select,
and system enable.
Write:
Write:
SPIxC2
SPIxBR
to configure
to set
optional SPI features, hardware match interrupt enable,
and 8- or 16-bit data transmission length
baud rate
Write:
SPIxMH:SPIxML
to set
hardware compare value that triggers SPMF (optional)
when value in receive data buffer equals this value.
Module Use:
After SPI master initiates transfer by checking that SPTEF = 1 and then writing data to SPIDH/L:
Wait for SPRF, then read from SPIDH/L
Wait for SPTEF, then write to SPIDH/L
Data transmissions can be 8- or 16-bits long, and mode fault detection can be enabled for master mode in cases where
more than one SPI device might become a master at the same time. Also, some applications may utilize the receive data
buffer hardware match feature to trigger specific actions, such as when command data can be sent through the SPI or to
indicate the end of an SPI transmission.
SPIxC1
SPIxC2
SPIxBR
SPIxDH
SPIxDL
SPIE
SPE
SPTIE
MSTR
Module/interrupt enables and configuration
CPOL
SPMIE SPIMODE
MODFEN BIDIROE
Additional configuration options.
SPPR2
SPPR1 SPPR0
Baud rate = (BUSCLK/SPPR[2:0])/SPR2[2:0]
Bit 15
Bit 7
Bit 14
Bit 6
Bit 13
Bit 5
Bit 12
Bit 4
Bit 11
Bit 3
CPHA
SPR2
Bit 10
Bit 2
SSOE
SPISWAI
SPR1
Bit 9
Bit 1
LSBFE
SPC0
SPR0
Bit 8
Bit 0
SPIxMH
Bit 15
Bit 14
Bit 13
Bit 12
Bit 11
Bit 10
Bit 9
Bit 8
SPIxML
Bit 7
Bit 6
Bit 5
Hardware Match Value
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
SPIxS
SPRF
SPMF
SPTEF MODF
Figure 15-2. SPI Module Quick Start
MC9S08JM16 Series Data Sheet, Rev. 2
Freescale Semiconductor
241