Motorola MSC8101 ADS User's Guide Page 226

  • Download
  • Add to my manuals
  • Print
  • Page
    / 346
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 225
11-8 MSC8101 User’s Guide
Serial Peripheral Interface (SPI)
a. Configure the RxBD and TxBD.
Since there is only one RxBD, it is the last BD in the table. Assume the buffer is
empty and an interrupt is generated after the buffer is filled.
RxTxBD->RxBD[0].bd_cstatus = 0xB000;
Since there is only one TxBD, it is the last BD in the table. Assuming the buffer
is ready, an interrupt is generated after the buffer is filled and the buffer
contains the last character of the message.
RxTxBD->TxBD[0].bd_cstatus = 0xB800;
Assume that five 8-bit characters must be transmitted.
RxTxBD->TxBD[0].bd_length = 0x0005;
RxTxBD->RxBD[0].bd_length = 0x0000; (optional)
Assume that the receive buffer is located at IMM + 0x1000 and the transmit
buffer is located at IMM + 0x2000.
RxTxBD->RxBD[0].bd_addr = 0xF0001000;
RxTxBD->TxBD[0].bd_addr = 0xF0002000;
b. Execute the INIT RX AND TX PARAMETERS opcode.
This opcode operates on the SPI sub-block code 10 to initialize the transmit and
receive parameters.
IMM->cpm_cpcr = 0x25410000;
c. Clear any previous events.
Write a 1 to clear SPI Event Register (SPIE) bits to clear previous events.
IMM->spi_spie = 0xFF;
d. Enable all possible interrupts.
Setting SPI Mask Register (SPIM) bits enables the corresponding interrupt.
IMM->spi_spim = 0x37;
e. Configure the SPI Mode Register (SPMODE).
Assume normal operation, master mode, SPI enabled, 8-bits per character, and
the fastest speed possible.
IMM->spi_spmode = 0x0370;
f. Start the transfer.
Setting the SPCOM[0]:STR bit causes the SPI to start transferring data to and
from the Tx/Rx buffers.
IMM->spi_spcom = 0x80;
Page view 225
1 2 ... 221 222 223 224 225 226 227 228 229 230 231 ... 345 346

Comments to this Manuals

No comments