SPRUHX5I August 2014 – May 2024 TMS320F28374S , TMS320F28375S , TMS320F28375S-Q1 , TMS320F28376S , TMS320F28377S , TMS320F28377S-Q1 , TMS320F28378S , TMS320F28379S
An SPI with the McBSP used as a slave is shown in Figure 20-42. When the McBSP is configured as a slave, DX is used as the SPISOMI signal and DR is used as the SPISIMO signal.
The register bit values required to configure the McBSP as a slave are listed in Table 20-17. After Table 20-17 are more details about configuration requirements.
Required Bit Setting | Description |
---|---|
CLKSTP = 10b or 11b | The clock stop mode (without or with a clock delay) is selected. |
CLKXP = 0 or 1 | The polarity of CLKX as seen on the MCLKX pin is positive (CLKXP = 0) or negative (CLKXP = 1). |
CLKRP = 0 or 1 | The polarity of MCLKR as seen on the MCLKR pin is positive (CLKRP = 0) or negative (CLKRP = 1). |
CLKXM = 0 | The MCLKX pin is an input pin, so that the pin can be driven by the SPI master. Because CLKSTP = 10b or 11b, MCLKR is driven internally by CLKX. |
SCLKME = 0 | The clock generated by the sample rate generator (CLKG) is derived from the CPU clock. (The sample rate generator is used to synchronize the McBSP logic with the externally-generated master clock.) |
CLKSM = 1 | |
CLKGDV = 1 | The sample rate generator divides the CPU clock before generating CLKG. |
FSXM = 0 | The FSX pin is an input pin, so that the pin can be driven by the SPI master. |
FSXP = 1 | The FSX pin is active low. |
XDATDLY = 00b | These bits must be 0s for SPI slave operation. |
RDATDLY = 00b |
When the McBSP is used as an SPI slave, the master clock and slave-enable signals are generated externally by a master device. Accordingly, the CLKX and FSX pins must be configured as inputs. The MCLKX pin is internally connected to the MCLKR signal, so that both the transmit and receive circuits of the McBSP are clocked by the external master clock. The FSX pin is also internally connected to the FSR signal, and no external signal connections are required on the MCLKR and FSR pins.
Although the CLKX signal is generated externally by the master and is asynchronous to the McBSP, the sample rate generator of the McBSP must be enabled for proper SPI slave operation. The sample rate generator must be programmed to the maximum rate of half the CPU clock rate. The internal sample rate clock is then used to synchronize the McBSP logic to the external master clock and slave-enable signals.
The McBSP requires an active edge of the slave-enable signal on the FSX input for each transfer. This means that the master device must assert the slave-enable signal at the beginning of each transfer, and deassert the signal after the completion of each packet transfer; the slave-enable signal cannot remain active between transfers. Unlike the standard SPI, this pin cannot be tied low all the time.
The data delay parameters of the McBSP must be set to 0 for proper SPI slave operation. A value of 1 or 2 is undefined in the clock stop mode.