
Procedure for Configuring a McBSP for SPI Operation
SPI Operation Using the Clock Stop Mode
6-8
SPRU592E
6.5 Procedure for Configuring a McBSP for SPI Operation
To configure the McBSP for SPI master or slave operation:
1) Place the transmitter and receiver in reset.
Clear the transmitter reset bit (XRST = 0) in SPCR2, to reset the
transmitter. Clear the receiver reset bit (RRST = 0) in SPCR1, to reset the
receiver.
2) Place the sample rate generator in reset.
Clear the sample rate generator reset bit (GRST = 0) in SPCR2, to reset
the sample rate generator.
3) Program registers that affect SPI operation.
Program the appropriate McBSP registers to configure the McBSP for
proper operation as an SPI master or an SPI slave.
4) Enable the sample rate generator.
To release the sample rate generator from reset, set the sample rate
generator reset bit (GRST = 1) in SPCR2.
Make sure that during the write to SPCR2, you only modify GRST.
Otherwise, you will modify the McBSP configuration you selected in the
previous step.
5) Enable the transmitter and receiver.
After the sample rate generator is released from reset, wait two sample
rate generator clock periods for the McBSP logic to stabilize.
If the CPU services the McBSP transmit and receive buffers, then you can
immediately enable the transmitter (XRST = 1 in SPCR2) and enable the
receiver (RRST = 1 in SPCR1).
If the DMA controller services the McBSP transmit and receive buffers,
then you must first configure the DMA controller (this includes enabling the
channels that service the McBSP buffers). When the DMA controller is
ready, make XRST = 1 and RRST = 1.
Note: In either case, make sure you only change XRST and RRST when
you write to SPCR2 and SPCR1. Otherwise, you will modify the bit settings
you selected earlier in this procedure.
After the transmitter and receiver are released from reset, wait two sample
rate generator clock periods for the McBSP logic to stabilize.
Summary of Contents for TMS320VC5509
Page 5: ...vi This page is intentionally left blank ...
Page 43: ...McBSP Operation 2 20 SPRU592E This page is intentionally left blank ...
Page 105: ...SPI Operation Using the Clock Stop Mode 6 16 SPRU592E This page is intentionally left blank ...
Page 187: ...Transmitter Configuration 8 40 SPRU592E This page is intentionally left blank ...
Page 191: ...General Purpose I O on the McBSP Pins 9 4 SPRU592E This page is intentionally left blank ...
Page 201: ...Emulation Power and Reset Considerations 10 10 SPRU592E ...
Page 207: ...Data Packing Examples 11 6 SPRU592E This page is intentionally left blank ...
Page 273: ...McBSP Register Worksheet 13 14 SPRU592E This page is intentionally left blank ...