Serial Peripheral Interface (SPI)
MPC885 PowerQUICC Family Reference Manual, Rev. 2
Freescale Semiconductor
30-17
7. Initialize the RxBD. Assume the Rx buffer is at 0x0000_1000 in main memory. Write 0xB000 to
RxBD[Status and Control], 0x0000 to RxBD[Data Length] (optional), and 0x0000_1000 to
RxBD[Buffer Pointer].
8. Initialize the TxBD. Assume the Tx buffer is at 0x0000_2000 in main memory and contains five
8-bit characters. Write 0xB800 to TxBD[Status and Control], 0x0005 to TxBD[Data Length], and
0x0000_2000 to TxBD[Buffer Pointer].
9. Write 0xFF to SPIE to clear any previous events.
10. Write 0x37 to SPIM to enable all SPI interrupts.
11. Write 0x0000_0020 to CIMR (that is, set CIMR[SPI]) to allow the SPI to generate a system
interrupt. The CICR should also be initialized.
12. Set SPMODE to 0x0170 to enable normal operation (not loopback), slave mode, SPI enabled, and
8-bit characters. Baud-rate generator speed is ignored in slave mode.
13. Set SPCOM[STR] to enable the SPI to be ready once the master begins the transfer.
Note that if the master sends 3 bytes and negates SPISEL, the RxBD is closed but the TxBD remains open.
If the master sends 5 or more bytes, the TxBD is closed after the fifth byte. If the master sends 16 bytes
and negates SPISEL, the RxBD is closed without triggering a busy error (SPIE[BSY]). If the master sends
more than 16 bytes, the RxBD is closed (full) and an SPIE[BSY] event occurs after the 17th byte is
received.
30.10 Handling Interrupts in the SPI
The following sequence should be followed to handle interrupts in the SPI:
1. Once an interrupt occurs, read SPIE to determine the interrupt source. Normally, SPIE bits should
be cleared at this time.
2. Process the TxBD to reuse it and the RxBD to extract the data from it. To transmit another buffer,
simply set TxBD[R], RxBD[E], and SPCOM[STR].
3. Clear the interrupt by writing a one to CISR[SPI].
4. Execute an rfi instruction.
Summary of Contents for PowerQUICC MPC870
Page 98: ...MPC885 PowerQUICC Family Reference Manual Rev 2 I 4 Freescale Semiconductor ...
Page 118: ...MPC885 Overview MPC885 PowerQUICC Family Reference Manual Rev 2 1 20 Freescale Semiconductor ...
Page 158: ...The MPC8xx Core MPC885 PowerQUICC Family Reference Manual Rev 2 3 18 Freescale Semiconductor ...
Page 288: ...MPC885 PowerQUICC Family Reference Manual Rev 2 III 4 Freescale Semiconductor ...
Page 554: ...MPC885 PowerQUICC Family Reference Manual Rev 2 V 6 Freescale Semiconductor ...
Page 1090: ...UTOPIA Interface MPC885 PowerQUICC Family Reference Manual Rev 2 43 8 Freescale Semiconductor ...
Page 1312: ...Byte Ordering MPC885 PowerQUICC Family Reference Manual Rev 2 A 8 Freescale Semiconductor ...
Page 1336: ...MPC885 PowerQUICC Family Reference Manual Rev 2 D 16 Freescale Semiconductor ...
Page 1358: ...MPC885 PowerQUICC Family Reference Manual Rev 2 D 38 Freescale Semiconductor ...
Page 1370: ...MPC880 MPC885 PowerQUICC Family Reference Manual Rev 2 E 4 Freescale Semiconductor ...
Page 1386: ...Revision History MPC885 PowerQUICC Family Reference Manual Rev 2 I 2 Freescale Semiconductor ...