Information
Serial Peripheral Interface
MPC8308 PowerQUICC II Pro Processor Reference Manual, Rev. 1
Freescale Semiconductor 19-15
19.4 Initialization/Application Information
The following sections describe programming examples of the SPI master and slave.
19.4.1 SPI Master Programming Example
The following sequence initializes the SPI to run at a high speed in master mode:
1. Configure a parallel I/O signal to operate as the SPI select output signal if needed.
2. Write 0xFFFF_FFFF to SPIE to clear any previous events. Configure SPIM to enable all desired
SPI interrupts.
3. Configure SPMODE to enable normal operation (not loopback), master mode, SPI enabled,
character length, and the fastest speed possible.
4. Write the first character to be sent to SPITD.
19.4.2 SPI Slave Programming Example
The following is an example initialization sequence to follow when the SPI is in slave mode. It is very
similar to the SPI master example, except that SPISEL is used instead of a general-purpose I/O signal.
1. Write 0xFFFF_FFFF to SPIE to clear any previous events.
2. Configure SPIM to enable all desired SPI interrupts.
3. Configure SPMODE to enable normal operation (not loopback), slave mode, SPI enabled, and
characters length.
4. Write the first data to be sent to SPITD, to enable the SPI to be ready once the master begins to
transfer.
Access: Read-only
0 151617 3031
R—MSBDATALSB
W
Reset All ones
Figure 19-15. Example SPMODE[REV] = 0 SPMODE[LEN] = 15 LSB Sent First