Serial Peripheral Interface (SPI)
Data Sheet
MC68HC08AS32A — Rev. 1
230
Serial Peripheral Interface (SPI)
For More Information On This Product,
Go to: www.freescale.com
MOTOROLA
into the shift register. This allows the user to queue up a 16-bit value to send. For
an already active slave, the load of the shift register cannot occur until the
transmission is completed. This implies that a back-to-back write to the transmit
data register is not possible. The SPTE indicates when the next write can occur.
15.9 Resetting the SPI
Any system reset completely resets the SPI. Partial resets occur whenever the SPI
enable bit (SPE) is low. Whenever SPE is low, the following occurs:
The SPTE flag is set.
Any transmission currently in progress is aborted.
The shift register is cleared.
The SPI state counter is cleared, making it ready for a new complete
transmission.
All the SPI port logic is defaulted back to being general-purpose I/O.
These additional items are reset only by a system reset:
All control bits in the SPCR register
All control bits in the SPSCR register (MODFEN, ERRIE, SPR1, and SPR0)
The status flags SPRF, OVRF, and MODF
By not resetting the control bits when SPE is low, the user can clear SPE between
transmissions without having to reset all control bits when SPE is set back to high
for the next transmission.
By not resetting the SPRF, OVRF, and MODF flags, the user can still service these
interrupts after the SPI has been disabled. The user can disable the SPI by writing
0 to the SPE bit. The SPI also can be disabled by a mode fault occurring in an SPI
that was configured as a master with the MODFEN bit set.
15.10 Low-Power Modes
The WAIT and STOP instructions put the MCU in low-power standby modes.
15.10.1 Wait Mode
The SPI module remains active after the execution of a WAIT instruction. In wait
mode, the SPI module registers are not accessible by the CPU. Any enabled CPU
interrupt request from the SPI module can bring the MCU out of wait mode.
If SPI module functions are not required during wait mode, reduce power
consumption by disabling the SPI module before executing the WAIT instruction.
F
Freescale Semiconductor, Inc.
n
.