15.6.6 McBSP as the SPI Master
An SPI interface with the McBSP used as the master is shown in
. When the McBSP is configured
as a master, the transmit output signal (DX) is used as the SIMO signal of the SPI protocol and the receive input
signal (DR) is used as the SOMI signal.
The register bit values required to configure the McBSP as a master are listed in
more details about the configuration requirements.
McBSP master
CLKX
DX
DR
FSX
SPI-compliant
slave
SPICLK
SPISIMO
SPISOMI
SPISTE
Figure 15-41. SPI Interface with McBSP Used as Master
Table 15-16. Bit Values Required to Configure the McBSP as an SPI Master
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 = 1
The MCLKX pin is an output pin driven by the internal sample rate generator. Because CLKSTP is
equal to 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.
CLKSM = 1
CLKGDV is a value from 1 to 255
CLKGDV defines the divide down value for CLKG.
FSXM = 1
The FSX pin is an output pin driven according to the FSGM bit. (See the
TMS320F2823x Digital Signal Controllers (DSCs)
FSGM = 0
The transmitter drives a frame-synchronization pulse on the FSX pin every time data is transferred
from DXR1 to XSR1.
FSXP = 1
The FSX pin is active low.
XDATDLY = 01b
This setting provides the correct setup time on the FSX signal.
RDATDLY = 01b
When the McBSP functions as the SPI master, it controls the transmission of data by producing the serial clock
signal. The clock signal on the MCLKX pin is enabled only during packet transfers. When packets are not being
transferred, the MCLKX pin remains high or low depending on the polarity used.
For SPI master operation, the MCLKX pin must be configured as an output. The sample rate generator is then
used to derive the CLKX signal from the CPU clock. The clock stop mode internally connects the MCLKX pin to
the MCLKR signal so that no external signal connection is required on the MCLKR pin and both the transmit and
receive circuits are clocked by the master clock (CLKX).
The data delay parameters of the McBSP (XDATDLY and RDATDLY) must be set to 1 for proper SPI master
operation. A data delay value of 0 or 2 is undefined in the clock stop mode.
Multichannel Buffered Serial Port (McBSP)
SPRUH18I – JANUARY 2011 – REVISED JUNE 2022
TMS320x2806x Microcontrollers
917
Copyright © 2022 Texas Instruments Incorporated
Содержание TMS320 2806 Series
Страница 2: ......