Tms320C6000 DSP Multichannel Buffered Serial Port (MCBSP) Reference Guide
Tms320C6000 DSP Multichannel Buffered Serial Port (MCBSP) Reference Guide
Tms320C6000 DSP Multichannel Buffered Serial Port (MCBSP) Reference Guide
Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, modifications,
enhancements, improvements, and other changes to its products and services at any time and to discontinue
any product or service without notice. Customers should obtain the latest relevant information before placing
orders and should verify that such information is current and complete. All products are sold subject to TI’s terms
and conditions of sale supplied at the time of order acknowledgment.
TI warrants performance of its hardware products to the specifications applicable at the time of sale in
accordance with TI’s standard warranty. Testing and other quality control techniques are used to the extent TI
deems necessary to support this warranty. Except where mandated by government requirements, testing of all
parameters of each product is not necessarily performed.
TI assumes no liability for applications assistance or customer product design. Customers are responsible for
their products and applications using TI components. To minimize the risks associated with customer products
and applications, customers should provide adequate design and operating safeguards.
TI does not warrant or represent that any license, either express or implied, is granted under any TI patent right,
copyright, mask work right, or other TI intellectual property right relating to any combination, machine, or process
in which TI products or services are used. Information published by TI regarding third-party products or services
does not constitute a license from TI to use such products or services or a warranty or endorsement thereof.
Use of such information may require a license from a third party under the patents or other intellectual property
of the third party, or a license from TI under the patents or other intellectual property of TI.
Reproduction of information in TI data books or data sheets is permissible only if reproduction is without
alteration and is accompanied by all associated warranties, conditions, limitations, and notices. Reproduction
of this information with alteration is an unfair and deceptive business practice. TI is not responsible or liable for
such altered documentation.
Resale of TI products or services with statements different from or beyond the parameters stated by TI for that
product or service voids all express and any implied warranties for the associated TI product or service and
is an unfair and deceptive business practice. TI is not responsible or liable for any such statements.
Following are URLs where you can obtain information on other Texas Instruments products and application
solutions:
Products Applications
Amplifiers amplifier.ti.com Audio www.ti.com/audio
Data Converters dataconverter.ti.com Automotive www.ti.com/automotive
DSP dsp.ti.com Broadband www.ti.com/broadband
Interface interface.ti.com Digital Control www.ti.com/digitalcontrol
Logic logic.ti.com Military www.ti.com/military
Power Mgmt power.ti.com Optical Networking www.ti.com/opticalnetwork
Microcontrollers microcontroller.ti.com Security www.ti.com/security
Telephony www.ti.com/telephony
Video & Imaging www.ti.com/video
Wireless www.ti.com/wireless
Notational Conventions
This document uses the following conventions.
- Hexadecimal numbers are shown with the suffix h. For example, the
following number is 40 hexadecimal (decimal 64): 40h.
Trademarks
Contents
1 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2 McBSP Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3 McBSP Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.1 Resetting the Serial Port: RRST, XRST, GRST, and RESET . . . . . . . . . . . . . . . . . . . . . . . 15
3.2 Determining Ready Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2.1 Receive Ready Status: REVT, RINT, and RRDY . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2.2 Transmit Ready Status: XEVT, XINT, and XRDY . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.3 CPU Interrupts: RINT, XINT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.4 Frame and Clock Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
11 Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
11.1 Data Receive Register (DRR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
11.2 Data Transmit Register (DXR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
11.3 Serial Port Control Register (SPCR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
11.4 Receive Control Register (RCR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
11.5 Transmit Control Register (XCR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
11.6 Sample Rate Generator Register (SRGR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
11.7 Multichannel Control Register (MCR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
11.8 Receive Channel Enable Register (RCER) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
11.9 Transmit Channel Enable Registers (XCER) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
11.10 Enhanced Receive Channel Enable Registers (RCERE0−3) . . . . . . . . . . . . . . . . . . . . . . 107
11.11 Enhanced Transmit Channel Enable Registers (XCERE0−3) . . . . . . . . . . . . . . . . . . . . . 109
11.12 Pin Control Register (PCR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Figures
Tables
This document describes the operation of the multichannel buffered serial port
(McBSP) in the digital signal processors (DSPs) of the TMS320C6000 DSP
family.
1 Features
The McBSP provides these functions:
- Full-duplex communication
- Double-buffered data registers, which allow a continuous data stream
- Independent framing and clocking for receive and transmit
- Direct interface to industry-standard codecs, analog interface chips (AICs),
and other serially connected analog-to-digital (A/D) and digital-to-analog
(D/A) devices
- External shift clock or an internal, programmable frequency shift clock for
data transfer
All C6000 devices have the same McBSP. However, the C621x/C671x and
C64x McBSP has additional features and enhancements that are summarized
in Table 1.
2 McBSP Interface
The McBSP consists of a data path and a control path that connect to external
devices. Separate pins for transmission and reception communicate data to
these external devices. Four other pins communicate control information
(clocking and frame synchronization). The device communicates to the
McBSP using 32-bit-wide control registers accessible via the internal peripheral
bus.
The McBSP consists of a data path and control path, as shown in Figure 1.
Seven pins, listed in Table 2, connect the control and data paths to external
devices.
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
McBSP
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁ
Compand
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ ÁÁÁ ÁÁÁÁÁ ÁÁ
DR RSR RBR Expand DRR
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ ÁÁÁÁÁ ÁÁ
DX XSR Compress DXR
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ SPCR
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
CLKX
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
CLKR RCR
Clock and 32-bit
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
FSX frame sync peripheral
XCR
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
FSR generation bus
and control
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
CLKS SRGR
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ PCR
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
MCR
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ Multichannel RCER
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
selection
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁ
XCER
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
RINT
Interrupts to CPU
XINT
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ REVT Synchronization
Data is communicated to devices interfacing to the McBSP via the data transmit
(DX) pin for transmission and via the data receive (DR) pin for reception. Control
information (clocking and frame synchronization) is communicated via CLKS,
CLKX, CLKR, FSX, and FSR. The C6000 CPU communicates to the McBSP
using 32-bit-wide control registers accessible via the internal peripheral bus.
Non-32-bit write accesses to control registers can result in corrupting the control
register value. This is because undefined values are written to non-enabled
bytes. However, non-32-bit read accesses return the correct value.
Either the CPU or the DMA/EDMA controller reads the received data from the
data receive register (DRR) and writes the data to be transmitted to the data
transmit register (DXR). Data written to DXR is shifted out to DX via the transmit
shift register (XSR). Similarly, receive data on the DR pin is shifted into the
receive shift register (RSR) and copied into the receive buffer register (RBR).
RBR is then copied to DRR, which can be read by the CPU or the DMA/EDMA
controller. This allows simultaneous internal data movement and external data
communications. For information on registers, see section 11.
3 McBSP Overview
As shown in Figure 1, the receive operation is triple-buffered and the transmit
operation is double-buffered. Receive data arrives on the DR and is shifted into
the RSR. Once a full element (8, 12, 16, 20, 24, or 32 bits) is received, the RSR
is copied to the receive buffer register (RBR) only if the RBR is not full. The
RBR is then copied to DRR unless the DRR has not been read by the CPU or
the DMA/EDMA controller.
The CPU or the DMA/EDMA controller writes transmit data to DXR. If there is
no data in XSR, the value in DXR is copied to XSR. Otherwise, the DXR is
copied to XSR when the last bit of data is shifted out on the DX. After transmit
frame synchronization, XSR begins shifting out the transmit data on the DX.
3.1 Resetting the Serial Port: RRST, XRST, GRST, and RESET
The serial port can be reset in the following two ways:
- Device reset (RESET pin is low) places the receiver, the transmitter, and
the sample rate generator in reset. When the device reset is removed
(RESET = 1), FRST = GRST = RRST = XRST = 0, keeping the entire
serial port in the reset state.
- The serial port transmitter and receiver can be independently reset by the
XRST and RRST bits in the serial port control register (SPCR). The sample
rate generator is reset by the GRST bit in SPCR.
Table 3 shows the state of the McBSP pins when the serial port is reset by
these methods.
DR I Input Input
- Device reset or McBSP reset: When the McBSP is reset by device reset
or McBSP reset, the state machine is reset to its initial state. All counters
and status bits are reset. This includes the receive status bits RFULL,
RRDY, and RSYNCERR, and the transmit status bits XEMPTY, XRDY,
and XSYNCERR.
- Device reset: When the McBSP is reset due to device reset, the entire
serial port (including the transmitter, receiver, and the sample rate generator)
is reset. All input-only pins and 3-state pins should be in a known state. The
output-only pin, DX, is in the high-impedance state. See section 4.2 for
more information on the sample rate generator and its default at reset.
When the device is pulled out of reset, the serial port remains in the reset
condition (RRST = XRST = FRST = GRST = 0). In this reset condition,
the serial port pins can be used as general-purpose I/O (see section 10).
- McBSP reset: When the receiver and transmitter reset bits, RRST and
XRST, are written with 0, the respective portions of the McBSP are reset
and activity in the corresponding section stops. All input-only pins, such
as DR and CLKS, and all other pins that are configured as inputs are in
a known state. FS(R/X) is driven to its inactive state (same as its polarity
bit, FS(R/X)P) if it is an output. If CLK(R/X) are programmed as outputs,
they are driven by CLKG, provided that GRST = 1. The DX pin is in the
high-impedance state when the transmitter is reset. During normal
operation, the sample rate generator can be reset by writing a 0 to GRST.
GRST should be low only when neither the transmitter nor the receiver is
using the sample rate generator. In this case, the internal sample rate
generator clock CLKG, and its frame sync signal (FSG) is driven inactive
(low). When the sample rate generator is not in the reset state (GRST = 1),
FSR and FSX are in an inactive state when RRST = 0 and XRST = 0,
respectively, even if they are outputs driven by FSG. This ensures that
when only one portion of the McBSP is in reset, the other portion can
continue operation when FRST = 1 and frame sync is driven by FSG.
- Sample-rate generator reset: As mentioned previously, the sample rate
generator is reset when the device is reset or when its reset bit, GRST, is
written with 0. See section 5.5.5 to avoid this error.
A transmit frame sync error (XSYNCERR) may occur the first time the
transmitter is enabled (XRST = 1) after a device reset. See section 7 for details
on the McBSP initialization procedure.
Reading DRR and writing to DXR affects RRDY and XRDY, respectively.
Note:
If the polling method is used to service the transmitter, the CPU should wait
for one McBSP bit clock (CLKX) before polling again to write the next element
in DXR. This is because XRDY transitions occur based on bit clock and not
CPU clock. The CPU clock is much faster and can cause false XRDY status,
leading to data errors due to over-writes.
CLK(R/X)
FS(R/X)
Á ÁÁ ÁÁ
D(R/X) A1 A0
Á ÁÁ B7 B6 B5 B4 B3 B2 B1
ÁÁ
B0
0 CLKX_int FSX_int 0
CLKXP Transmit FSXP
1 1 DXR to XSR
CLKRP 0
FSRP FSRM and GSYNC
CLKRM 1
CLKXM FSXM
FSGM
See inset See inset
CLKR pin FSR pin
1 1
0 Receive 0
CLKRP 0 0 FSRP
1 1
DLB DLB
CLKRM CLKR_int FSR_int FSRM
CLKG
Sample FSG
internal clock source†
rate
generator
FSR_int
CLKS pin
Inset:
(R/X) IOEN
Yyy_int
When FSR and FSX are inputs (FSXM = FSRM = 0), the McBSP detects them
on the internal falling edge of clock, CLKR_int and CLKX_int, respectively (see
Figure 3, on page 19). The receive data arriving at the DR pin is also sampled
on the falling edge of CLKR_int. These internal clock signals are either derived
from external source via the CLK(R/X) pins or driven by the sample rate
generator clock (CLKG) internal to the McBSP.
When FSR and FSX are outputs driven by the sample rate generator, they are
generated (transition to their active state) on the rising edge of the internal
clock, CLK(R/X)_int. Similarly, data on DX is output on the rising edge of
CLKX_int. See section 4.5.5 for more information.
FSRP, FSXP, CLKRP, and CLKXP configure the polarities of FSR, FSX, CLKR,
and CLKX. All frame sync signals (FSR_int and FSX_int) internal to the serial
port are active high. If the serial port is configured for external frame
synchronization (FSR/FSX are inputs to the McBSP) and FSRP = FSXP = 1,
the external active (low) frame sync signals are inverted before being sent to
the receiver signal (FSR_int) and transmitter signal (FSX_int). Similarly, if
internal synchronization is selected (FSR/FSX are outputs and GSYNC = 0),
the internal active (high) sync signals are inverted if the polarity bit
FS(R/X)P = 1, before being sent to the FS(R/X) pin. Figure 3 shows this
inversion using XOR gates.
On the transmit side, the transmit clock polarity bit, CLKXP, sets the edge used
to shift and clock out transmit data. Data is always transmitted on the rising
edge of CLKX_int. If CLKXP = 1 and external clocking is selected (CLKXM = 0
and CLKX is an input), the external falling-edge-triggered input clock on CLKX
is inverted to a rising-edge-triggered clock before being sent to the transmitter.
If CLKXP = 1 and internal clocking is selected (CLKXM = 1 and CLKX is an
output pin), the internal (rising-edge-triggered) clock, CLKX_int, is inverted
before being sent out on the CLKX pin.
Similarly, the receiver can reliably sample data that is clocked (by the
transmitter) with a rising-edge clock. The receive clock polarity bit, CLKRP,
sets the edge used to sample received data. The receive data is always
sampled on the falling edge of CLKR_int. Therefore, if CLKRP = 1 and
external clocking is selected (CLKRM = 0 and CLKR is an input pin), the
external rising-edge triggered input clock on CLKR is inverted to a falling-edge
clock before being sent to the receiver. If CLKRP = 1 and internal clocking is
selected (CLKRM = 1), the internal falling-edge-triggered clock is inverted to
a rising edge before being sent out on the CLKR pin.
In a system where the same clock (internal or external) is used to clock the
receiver and transmitter, CLKRP = CLKXP. The receiver uses the opposite
edge as the transmitter to ensure valid setup and hold times of data around
this edge. Figure 4 shows how data clocked by an external serial device using
a rising-edge clock can be sampled by the McBSP receiver with the falling
edge of the same clock.
ÁÁ
Data setup
Data hold
ÁÁ
ÁÁ ÁÁÁÁÁÁÁÁ
DR B7 B6
CLKX_int
Propagation
Disable time delay
DX A1 A0 B7
The sample rate generator is not used when CLKX, FSX, CLKR, and FSR are
driven by an external source. Therefore, the GRST bit in SPCR does not need
to be enabled (GRST = 1) for this setup. The three stages of the sample rate
generator circuit compute:
- Clock divide-down (CLKGDV): The number of input clocks per data bit clock
- Frame period (FPER): The frame period in data bit clocks
- Frame width (FWID): The width of an active frame pulse in data bit clocks
CLKG
CLKSM
Frame pulse
GSYNC detection
and clock
FSR synchronization
- The input clock to the sample rate generator, which can be either the
internal clock source or a dedicated external clock source (CLKS). The
C620x/C670x DSP uses the CPU clock as the internal clock source to the
sample rate generator. The C621x/C671x DSP uses the CPU/2 clock as
the internal clock source. The C64x DSP uses the CPU/4 clock as the
internal clock source to the sample rate generator.
- The input clock source (internal clock source or external clock CLKS) to
the sample rate generator can be divided down by a programmable value
(CLKGDV) to drive CLKG.
Regardless of the source to the sample rate generator, the rising edge of
CLKSRG (see Figure 6) generates CLKG and FSG (see section 4.3.3).
The CLKSM bit in SRGR selects either the internal clock (CLKSM = 1) or the
external clock input (CLKSM = 0), CLKS, as the source for the sample rate
generator input clock. Any divide periods are divide-downs calculated by the
sample rate generator and are timed by this input clock selection.
The first divider stage generates the serial data bit clock from the input clock.
This divider stage uses a counter that is preloaded by CLKGDV and that
contains the divide ratio value. The output of this stage is the data bit clock that
is output on the sample rate generator output, CLKG, and that serves as the
input for the second and third divider stages.
Pulse width high = SIN × (CLKGDV + 1)/2 = SIN × (0+ 1)/2 = 0.5 × SIN
Pulse width low = SIN × (CLKGDV + 1)/2 = SIN × (0+ 1)/2 = 0.5 × SIN
When CLKS is selected to drive the sample rate generator (CLKSM = 0),
GSYNC can be used to configure the timing of CLKG relative to CLKS.
GSYNC = 1 ensures that the McBSP and the external device to which it is
communicating are dividing down the CLKS with the same phase relationship.
If GSYNC = 0, this feature is disabled and CLKG runs freely and is not
resynchronized. If GSYNC = 1, an inactive-to-active transition on FSR
triggers a resynchronization of CLKG and the generation of FSG. CLKG
always begins at a high state after synchronization. Also, FSR is always
detected at the same edge of CLKS that generates CLKG, regardless of the
length the FSR pulse. Although an external FSR is provided, FSG can still
drive internal receive frame synchronization when GSYNC = 1. When
GSYNC = 1, FPER is a don’t care, because the frame period is determined by
the arrival of the external frame sync pulse.
Figure 7 and Figure 8 show this operation with various polarities of CLKS and
FSR. These figures assume that FWID is 0, for a FSG = 1 CLKG wide.
These figures show what happens to CLKG when it is initially in sync and
GSYNC = 1, as well as when it is not in sync with the frame synchronization
and GSYNC = 1.
Figure 7. CLKG Synchronization and FSG Generation When GSYNC = 1 and CLKGDV = 1
CLKS (CLKSP = 1)
CLKS (CLKSP = 0)
FSG
Figure 8. CLKG Synchronization and FSG Generation When GSYNC = 1 and CLKGDV = 3
CLKS (CLKSP = 1)
CLKS (CLKSP = 0)
FSG
When GSYNC = 1, the transmitter can operate synchronously with the receiver,
provided that the following conditions are met:
- The sample-rate generator clock should drive the transmit and receive bit
clock (CLK(R/X)M = 1 in SPCR). Therefore, the CLK(R/X) pin should not
be driven by any other source.
Table 4 shows how the digital loopback bit (DLB) and the CLKRM bit in PCR
select the receiver clock. In digital loopback mode (DLB = 1), the transmitter
clock drives the receiver. CLKRM determines whether the CLKR pin is an input
or an output.
Table 5 shows how the CLKXM bit in PCR selects the transmit clock and
whether the CLKX pin is an input or output.
CLKXM Bit
in PCR Source of Transmit Clock CLKX Function
0 The external clock drives the CLKX input Input.
pin. CLKX is inverted as determined by
CLKXP before being used.
1 The sample rate generator clock, CLKG, Output. CLKG is inverted as determined by
drives the transmit clock CLKXP before being driven out on CLKX.
The other method is when the clocks are inputs to the McBSP (CLKXM or
CLKRM = 0) and the McBSP operates in non-SPI mode. This means that
clocks can be stopped between data transfers. If the external device stops the
serial clock between data transfers, the McBSP interprets it as a slow-down
serial clock. Ensure that there are no glitches on the CLK(R/X) lines as the
McBSP may interpret them as clock-edge transitions. Restarting the serial
clock is equivalent to a normal clock transition after a slow CLK(R/X) cycle.
Note that just as in normal operations, transmit under flow (XEMPTY) may
occur if the DXR is not properly serviced at least three CLKX cycles before the
next frame sync. Therefore if the serial clock is stopped before DXR is properly
serviced, the external device needs to restart the clock at least three CLKX
cycles before the next frame sync to allow the DXR write to be properly
synchronized. Refer to Figure 34 (page 56) for a graphical explanation on
when DXR needs to be written to avoid underflow.
- The transmitter can trigger its own frame sync signal that is generated by
a DXR-to-XSR copy. This causes a frame sync to occur on every
DXR-to-XSR copy. The data delays can be programmed as required.
However, maximum packet frequency cannot be achieved in this method
for data delays of 1 and 2.
- Both the receiver and transmitter can independently select an external frame
synchronization on the FSR and FSX pins, respectively.
When the sample rate generator comes out of reset, FSG is in an inactive (low)
state. After this, when FRST = 1 and FSGM = 1, frame sync signals are
generated. The frame width value (FWID + 1) is counted down on every CLKG
cycle until it reaches 0 when FSG goes low. Thus, the value of FWID + 1
determines an active frame pulse width ranging from 1 to 256 data bit clocks.
At the same time, the frame period value (FPER + 1) is also counting down,
and when this value reaches 0, FSG goes high again, indicating a new frame
is beginning. Thus, the value of FPER + 1 determines a frame length from 1
to 4096 data bits. When GSYNC = 1, the value of FPER does not matter.
Figure 9 shows a frame of 16 CLKG periods (FPER = 15 or 0000 1111b).
FSG
Note:
For a dual-phase frame with internally generated frame sync, the maximum
number of elements per phase depends on the word length. This is because
the frame period, FPER, is only 12-bits wide and, therefore, provides
4 096 bits per frame. Hence, the maximum number of 256 elements per dual-
phase frame applies only when the WDLEN is 16 bits. However, any
combination of element numbers and element size (defined by FRLEN and
WDLEN, respectively) is valid as long as their product is less than or equal
to 4096 bits. This limitation does not apply for dual-phase with external frame
sync.
ÁÁÁ
ÁÁ ÁÁÁ
ÁÁÁÁÁÁ
ÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
Phase 2 Phase 2
Element 1 Phase 1 Element 1 Phase 2 Element 3
Element 2 Element 2
CLK(R/X)
FS(R/X)
ÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁ
ÁÁ
ÁÁÁ
ÁÁÁ
ÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁÁÁ
ÁÁÁ
ÁÁÁÁ
D(R/X)
Á Á
32 Multichannel Buffered Serial Port (McBSP) SPRU580C
Clocks, Frames, and Data
Table 8. RCR/XCR Fields Controlling Elements per Frame and Bits per Element
RCR/XCR Field Control
Serial Port
McBSP0/1 Frame Phase Elements per Frame Bits per Element
Receive 1 RFRLEN1 RWDLEN1
001 12
010 16
011 20
100 24
101 32
110 Reserved
111 Reserved
The frame length and element length can be manipulated to effectively pack
data. For example, consider a situation in which four 8-bit elements are
transferred in a single-phase frame, as shown in Figure 11. In this case:
In this example, four 8-bit data elements are transferred to and from the McBSP
by the CPU or the DMA/EDMA controller. Four reads of DRR and four writes of
DXR are necessary for each frame.
CLKR
FSR
DR
Á Á
Á ÁÁ
RBR-to-DRR copy RBR-to-DRR copy RBR-to-DRR copy RBR-to-DRR copy
Á ÁÁ
CLKX
FSX
Á Á
DX
Á DXR-to-XSR copy DXR-to-XSR copy DXR-to-XSR copy DXR-to-XSR copy
Á
The example in Figure 11 can also be viewed as a data stream of a
single-phase frame of one 32-bit data element, as shown in Figure 12. In this
case:
- (R/X)PHASE = 0, indicating a single phase frame
- (R/X)FRLEN1 = 0b, indicating a 1-element frame
- (R/X)WDLEN1 = 101b, indicating 32-bit elements
In this example, one 32-bit data element is transferred to and from the McBSP
by the CPU or the DMA/EDMA controller. Thus, one read of DRR and one write
of DXR is necessary for each frame. As a result, the number of transfers is
one-fourth that of the previous example (Figure 11). This manipulation
reduces the percentage of bus time required for serial port data movement.
CLKR
FSR
DR
CLKX
FSX
DX
CLK(R/X)
FS(R/X)
Á 0-bit period
D(R/X)
data delay 0 Á B7 B6 B5 B4 B3
Á
1-bit period
Á
D(R/X)
data delay 1 B7 B6 B5 B4
2-bit period
Á
D(R/X)
data delay 2 Á B7 B6 B5
CLKR
FSR
2 Bit Periods
DR
Framing Bit B7 B6 B5
Table 11. Effect of RJUST Bit Values With 12-Bit Example Data ABCh
FS(R/X)
Á
20 bits
D(R/X)
Á
Legend: PxEy = phase x and element y.
Figure 15 shows the AC97 timing near frame synchronization. First the frame
sync pulse itself overlaps the first element. In McBSP operation, the
inactive-to-active transition of the frame synchronization signal actually
indicates frame synchronization. For this reason, frame synchronization can
be high for an arbitrary number of bit clocks. Only after the frame
synchronization is recognized as inactive and then active again is the next
frame synchronization recognized.
In Figure 16, there is a 1-bit data delay. Regardless of the data delay,
transmission can occur without gaps. The last bit of the previous (last) element
in phase 2 is immediately followed by the first data bit of the first element in
phase 1 of the next data frame.
CLKR
FSR
4.096-MHz CLKS
Sample point
FSR external
FSG, FSR_int,
FSX_int
2.048-MHz CLKG,
CLKR_int,
CLKX_int (first FSR)
DR, DX (first FSR) E1B7 E1B6 E1B5 E1B4 E1B3 E1B2 E1B1 E1B0 E2B7
CLKG, CLKR_int,
CLKX_int
(subsequent FSR)
DR, DX E32B0 E1B7 E1B6 E1B5 E1B4 E1B3 E1B2 E1B1 E1B0 E2B7
(subsequent FSR)
- CLKSP = 0: The rising edge of CLKS generates internal clocks CLKG and
CLK(R/X)_int.
The rising edge of CLKS detects the external FSR. This external frame sync
pulse resynchronizes the internal McBSP clocks and generates the frame
sync for internal use. The internal frame sync is generated so that it is wide
enough to be detected on the falling edge of the internal clocks.
CLKS
Sample point
FSR external
CLKG, CLKR_int,
CLKX_int (first FSR)
DR, DX (first FSR) E1B7 E1B6 E1B5 E1B4 E1B3 E1B2 E1B1 E1B0 E2B7
CLKG, CLKR_int,
CLKX_int
(subsequent FSR)
DR, DX E32B0 E1B7 E1B6 E1B5 E1B4 E1B3 E1B2 E1B1 E1B0 E2B7
(subsequent FSR)
FS(R/X)_int
CLK(R/X)_int
D(R/X) E32B0 E1B7 E1B6 E1B5 E1B4 E1B3 E1B2 E1B1 E1B0 E2B7
Figure 20 shows a single-phase data frame of one 8-bit element. Since the
transfer is configured for a 1-bit data delay, the data on the DX and DR pins
are available one bit clock after FS(R/X) goes active. This figure, as well as all
others in this section, use the following assumptions:
- FS(R/X)P = 0, specifying that active (high) frame sync signals are used
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
FS(R/X)
D(R/X) A1 A0 B7 B6 B5 B4 B3 B2 B1 B0 C7 C6 C5
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
FSR
DR A1 A0 B7 B6 B5 B4 B3 B2 B1 B0 C7 C6 C5
RRDY
DX A1 A0 B7 B6 B5 B4 B3 B2 B1 B0 C7 C6 C5
XRDY
DXR to XSR copy Write of DXR DXR to XSR copy Write of DXR
(B) (C) (C) (D)
Bit*clock frequency
Frame frequency +
Number of bit clocks between frame sync signals
The frame frequency may be increased by decreasing the time between frame
synchronization signals in bit clocks (which is limited only by the number of bits
per frame). As the frame transmit frequency is increased, the inactivity period
between the data frames for adjacent transfers decreases to 0. The minimum
time between frame synchronization pulses is the number of bits transferred
per frame. This time also defines the maximum frame frequency, which is
calculated by the following equation:
Bit*clock frequency
Maximum frame frequency +
Number of bits per frame
ÁÁ
Figure 23. Maximum Frame Frequency for Transmit and Receive
CLK(R/X)
ÁÁ
FS(R/X)
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
D(R/X) A2 A1 A0 B7 B6 B5 B4 B3 B2 B1 B0 C7 C6
Note:
For (R/X)DATDLY = 0, the first bit of data transmitted is asynchronous to
CLKX, as shown in Figure 13.
In reception, if not ignored (RFIG = 0), an unexpected FSR pulse discards the
contents of RSR in favor of the incoming data. Therefore, if RFIG = 0, an
unexpected frame synchronization pulse aborts the current data transfer, sets
RSYNCERR in SPCR to 1, and begins the reception of a new data element.
When RFIG = 1, the unexpected frame sync pulses are ignored.
In transmission, if not ignored (XFIG = 0), an unexpected FSX pulse aborts the
ongoing transmission, sets the XSYNCERR bit in SPCR to 1, and reinitiates
transmission of the current element that was aborted. When XFIG = 1,
unexpected frame sync signals are ignored.
CLK(R/X)
(R/X)SYNCERR
CLK(R/X)
D(R/X) A0 B7 B6 B5 B4 B3 B2 B1 B0 C7 C6 C5 C4
(R/X)SYNCERR
(low)
FSR
DR
CLKX
FSX
DX
Element 1
CLKR
DR
RBR-to-DRR copy
CLKX
DX
DXR-to-XSR copy
There are five serial port events that can constitute a system error:
RFULL = 1 in SPCR indicates that the receiver has experienced overrun and
is in an error condition. RFULL is set when the following conditions are met:
- DRR has not been read since the last RBR-to-DRR transfer.
- RBR is full and an RBR-to-DRR copy has not occurred.
- RSR is full and an RSR-to-RBR transfer has not occurred.
This data loss can be avoided if DRR is read no later than two and a half CLKR
cycles before the end of the third element (data C) in RSR, as shown in
Figure 29.
Either of the following events clears the RFULL bit to 0 and allows subsequent
transfers to be read properly:
- Reading DRR
- Resetting the receiver (RRST = 0) or the device
Figure 28 shows the receive overrun condition. Because element A is not read
before the reception of element B is complete, B is not transferred to DRR yet.
Another element, C, arrives and fills RSR. DRR is finally read, but not earlier
than two and one half cycles before the end of element C. New data D
overwrites the previous element C in RSR. If RFULL is still set after the DRR
is read, the next element can overwrite D if DRR is not read in time.
CLKR
FSR
DR A1 A0 B7 B6 B5 B4 B3 B2 B1 B0 C7 C6 C5 C4 C3 C2 C1 C0 D7
Figure 29 shows the case in which RFULL is set but the overrun condition is
averted by reading the contents of DRR at least two and a half cycles before
the next element, C, is completely shifted into RSR. This ensures that a
RBR-to-DRR copy of data B occurs before the next element is transferred from
RSR to RBR.
CLKR
FSR
DR A1 A0 B7 B6 B5 B4 B3 B2 B1 B0 C7 C6 C5 C4 C3 C2 C1 C0
RRDY
No Read of DRR (A) No RBR-to-DRR copy (B) Read of DRR (A)
RFULL RBR-to-DRR copy (A) RBR-to-DRR (B)
Note:
Note that the RSYNCERR bit in SPCR is a read/write bit, so writing a 1 to it
sets the error condition. Typically, writing a 0 is expected.
Receive frame
sync pulse occurs
Unexpected Case 2:
No
frame sync Normal reception
pulse ? Start receiving data
Yes
Case 3:
No
RFIG = 1 ? Abort reception.
Set RSYNCERR.
Start next reception.
Yes Previous element is lost.
Case 1:
Ignore frame pulse.
Receiver continues running.
DR A1 A0 B7 B6 B5 B4 C7 C6 C5 C4 C3 C2 C1 C0
RRDY ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Read of DRR Read of DRR
RBR-to-DRR copy
RBR-to-DRR copy
RSYNCERR
XRDY
DXR-to-XSR copy (B) Write of DXR (C) Write of DXR (D) DXR-to-XSR copy (D) Write of DXR (E)
- During transmission, DXR has not been loaded since the last DXR-to-XSR
copy, and all bits of the data element in XSR have been shifted out on DX.
During underflow condition, the transmitter continues to transmit the old data
in DXR for every new frame sync signal FSX (generated by an external device,
or by the internal sample rate generator) until a new element is loaded into
DXR by the CPU or the DMA/EDMA controller. XEMPTY is deactivated
(XEMPTY = 1) when this new element in DXR is transferred to XSR. In the
case when the FSX is generated by a DXR-to-XSR copy (FSXM = 1 in PCR
and FSGM = 0 in SRGR), the McBSP does not generate any new frame sync
until new data is written to the DXR and a DXR-to-XSR copy occurs.
When the transmitter is taken out of reset (XRST = 1), it is in a transmit ready
(XRDY = 1) and transmit empty (XEMPTY = 0) condition. If DXR is loaded by
the CPU or the DMA controller before FSX goes active, a valid DXR-to-XSR
transfer occurs. This allows for the first element of the first frame to be valid
even before the transmit frame sync pulse is generated or detected.
Alternatively, if a transmit frame sync is detected before DXR is loaded, 0s are
output on DX.
FSX
DX A1 A0 B7 B6 B5 B4 B3 B2 B1 B0 B7 B6 B5 B4
XRDY ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
DXR-to-XSR copy (B) Write of DXR (C)
XEMPTY
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
FSX
DX A1 A0 B7 B6 B5 B4 B3 B2 B1 B0 C7 C6 C5
XRDY
Write of DXR (C)
DXR-to-XSR copy (B) DXR-to-XSR copy (C)
XEMPTY
1) Wait for two CLKG cycles. The unexpected frame sync error
(XSYNCERR), if any, occurs within this time period.
Figure 35 shows the decision tree that the transmitter uses to handle all
incoming frame synchronization signals. The diagram assumes that the
transmitter has been started (XRST = 1). An unexpected transmit frame sync
pulse is defined as a sync pulse that occurs XDATDLY bit clocks earlier than the
last transmitted bit of the previous frame. Any one of three cases can occur:
- Case 2: FSX pulses with normal serial port transmission. This situation is
discussed in section 5.3. There are two possible reasons for a transmit not
to be in progress:
J This FSX pulse is the first one to occur after XRST = 1.
J The serial port is in the interpacket intervals. The programmed data
delay (XDATDLY) may start during these interpacket intervals before
the first bit of the next element is transmitted. Thus, if operating at
maximum packet frequency, frame synchronization can still be
received XDATDLY bit clocks before the first bit of the associated
element.
Note:
The XSYNCERR bit in SPCR is a read/write bit, so writing a 1 to it sets the error
condition. Typically, writing a 0 is expected.
Transmit frame
sync pulse occurs.
Unexpected Case 2:
No
frame sync Normal transmission
pulse ? Start new transmit.
Yes
Case 3:
No
XFIG = 1 ? Abort transfer.
Set XSYNCERR.
Restart current transfer.
Yes
Case 1:
Ignore frame pulse.
Transmitter continues running.
DX A1 A0 B7 B6 B5 B4 B7 B6 B5 B4 B3 B2 B1 B0
XRDY
Write of DXR (D)
DXR-to-XSR copy (B) Write of DXR (C) DXR-to-XSR (C)
XSYNCERR
The µ-law and A-law formats encode data into 8-bit code elements.
Companded data is always 8-bits-wide, so the appropriate (R/X)WDLEN1/2
must be cleared to 0, indicating an 8-bit serial data stream. If companding is
enabled and either phase of the frame does not have an 8-bit element length,
companding continues as if the element length is eight bits.
ÁÁÁÁÁ
SPRU580C Multichannel Buffered Serial Port (McBSP) 59
Companding Hardware
µ-LAW/A-LAW Companding
m-Law/A-Law HardwareOperation
Operation
LAW16 15 3 2 0
A-law Value 0
31 16 15 0
Don’t care LAW16
01 sign LAW16
10 LAW16 0
11 Reserved
Figure 40 shows two methods by which the McBSP can compand internal
data. Data paths for these two methods are indicated by (DLB) and (non-DLB)
arrows.
- Non-DLB: When both the transmit and receive sections of the serial port
are reset, DRR and DXR are internally connected through the companding
logic. Values from DXR are compressed as determined by the XCOMPAND
bits and then expanded as determined by the RCOMPAND bits. RRDY
and XRDY bits are not set. However, data is available in DRR four CPU
clocks after being written to DXR. The advantage of this method is its
speed. The disadvantage is that there is no synchronization available to
the CPU and the DMA/EDMA controller to control the flow of data.
ÁÁÁÁ
Figure 40. Companding of Internal Data
ÁÁÁÁ
(DLB)
(non-DLB)
ÁÁÁÁ ÁÁÁ controller
DX
ÁÁÁÁ XSR
ÁÁÁÁ
Compress
For the C621x/C671x/C64x DSP, a 32-bit bit reversal feature is also available.
See section 4.5.7.
The transmitter and the receiver of the McBSP can operate independently
from each other. Therefore, they can be placed in or taken out of reset individually
by modifying only the desired bit in the registers without disrupting the other
portion. The steps in the following sections discuss the initialization procedure
for taking both the transmitter and the receiver out of reset. To initialize only
one portion, configure only the portion desired.
The McBSP internal sample rate generator and internal frame sync generator
are shared between the transmitter and the receiver. Table 13 and Table 14
describe their usage base upon the clock and frame sync configurations of the
receiver and transmitter, respectively.
Internal External The McBSP internal sample rate generator is used but the internal frame
sync generator is not used by the receiver.
External External The McBSP internal sample rate generator and internal frame sync generator
are not used by the receiver.
External Internal The McBSP internal sample rate generator and internal frame sync generator
are not used by the transmitter. This configuration is only valid with FSGM = 0
where the McBSP transmitter generates FSX upon each DXR-to-XSR copy.
You can follow the general initialization sequence in section 7.1.
Internal External The McBSP internal sample rate generator is used by the transmitter but the
internal frame sync generator is not. You should follow the special initialization
sequence for McBSP as transmit frame sync master in section 7.2.
External External The McBSP internal sample rate generator and internal frame sync generator
are not used by the transmitter. You should follow the special initialization
sequence for McBSP as transmit frame sync master in section 7.2.
1) Ensure that no portion of the McBSP is using the internal sample rate
generator signal CLKG and the internal frame sync generator signal FSG
(GRST = FRST = 0). The respective portion of the McBSP needs to be in
reset (XRST = 0 and/or RRST = 0).
2) Program the control registers as required. Ensure the internal sample rate
generator and the internal frame sync generator are still in reset
(GRST = FRST = 0). Also ensure the respective portion of the McBSP is
still in reset in this step (XRST = 0 and/or RRST = 0).
3) Wait for proper internal synchronization. If the external device provides the
bit clock, wait for two CLKR or CLKX cycles. If the McBSP generates the
bit clock as a clock master, wait for two CLKSRG cycles. In this case, the
clock source to the sample rate generator (CLKSRG) is selected by the
CLKSM bit in SRGR.
4) Skip this step if the bit clock is provided by the external device. This step
only applies if the McBSP is the bit clock master and the internal sample
rate generator is used.
a) Start the sample rate generator by setting the GRST bit to 1. Wait two
CLKG bit clocks for synchronization. CLKG is the output of the sample
rate generator.
b) On the next rising edge of CLKSRG, CLKG transitions to 1 and starts
clocking with a frequency equal to 1/(CLKGDV + 1) of the sample rate
generator source clock CLKSRG.
5) Skip this step if the transmitter is not used. If the transmitter is used, a
transmit sync error (XSYNCERR) may occur when it is enabled for the first
time after device reset. The purpose of this step is to clear any potential
XSYNCERR that occurs on the transmitter at this time:
a) Set the XRST bit to 1 to enable the transmitter.
b) Wait for any unexpected frame sync error to occur. If the external
device provides the bit clock, wait for two CLKR or CLKX cycles. If the
McBSP generates the bit clock as a clock master, wait for two CLKG
cycles. The unexpected frame sync error (XSYNCERR), if any, occurs
within this time period.
c) Disable the transmitter (XRST = 0). This clears any outstanding
XSYNCERR.
7) Set the XRST bit and/or the RRST bit to 1 to enable the corresponding
section of the McBSP. The McBSP is now ready to transmit and/or receive.
a) If the DMA/EDMA is used to service the McBSP, it services the McBSP
automatically upon receiving the XEVT and/or REVT.
b) If CPU interrupt is used to service the McBSP, the interrupt service
routine is automatically entered upon receiving the XINT and/or RINT.
c) If CPU polling is used to service the McBSP, it can do so now by polling
the XRDY and/or RRDY bit.
8) If the internal frame sync generator is used (FSGM = 1), proceed to the
additional steps to turn on the internal frame sync generator. Initialization
is complete if any one of the following is true:
a) The external device generates frame sync FSX and/or FSR. The
McBSP is now ready to transmit and/or receive upon receiving external
frame sync.
b) The McBSP generates transmit frame sync FSX upon each
DXR-to-XSR copy. The internal frame sync generator is not used
(FSGM = 0).
Additional steps to turn on the internal frame sync generator (only applies if
FSGM = 1):
9) Skip this step if the transmitter is not used. If the transmitter is used, ensure
that DXR is serviced before you start the internal frame sync generator.
You can do so by checking XEMPTY = 1 (XSR is not empty) in SPCR.
10) Set the FRST bit to 1 to start the internal frame sync generator. The internal
frame sync signal FSG is generated on a CLKG active edge after 7 to 8
CLKG clocks have elapsed.
To ensure proper operation when the external device is the frame master, you
must assure that DXR is already serviced with the first word when a frame sync
occurs. To do so, you can keep the transmitter in reset until the first frame sync
is detected. Upon detection of the first frame sync, the McBSP generates an
interrupt to the CPU. Within the interrupt service routine, the transmitter is
taken out of reset (XRST = 1). This assures that the transmitter does not begin
data transfers at the data pin during the first frame sync period. This also
provides almost an entire frame period for the DSP to service DXR with the first
word before the second frame sync occurs. The transmitter only begins data
transfers upon receiving the second frame sync. At this point, DXR is already
serviced with the first word.
The interrupt service routine must first be setup according to the description
in step 9. Then follow this modified procedure for proper initialization:
1) Ensure that no portion of the McBSP is using the internal sample rate
generator signal CLKG and the internal frame sync generator signal FSG
(GRST = FRST = 0). The respective portion of the McBSP needs to be in
reset (XRST = 0 and/or RRST = 0).
2) Program SRGR and other control registers as required. Ensure the
internal sample rate generator and the internal frame sync generator are
still in reset (GRST = FRST = 0). Also ensure the respective portion of the
McBSP is still in reset in this step (XRST = 0 and/or RRST = 0).
3) Program the XINTM bits to 2h in SPCR to generate an interrupt to the CPU
upon detection of a transmit frame sync. Do not enable the XINT interrupt
in the interrupt enable register (IER) in this step.
4) Wait for proper internal synchronization. If the external device provides the
bit clock, wait for two CLKR or CLKX cycles. If the McBSP generates the
bit clock as a clock master, wait for two CLKSRG cycles. In this case, the
clock source to the sample rate generator (CLKSRG) is selected by the
CLKSM bit in SRGR.
5) Skip this step if the bit clock is provided by the external device. This step
only applies if the McBSP is the bit clock master and the internal sample
rate generator is used.
a) Start the sample rate generator by setting the GRST bit to 1. Wait two
CLKG bit clocks for synchronization. CLKG is the output of the sample
rate generator.
b) On the next rising edge of CLKSRG, CLKG transitions to 1 and starts
clocking with a frequency equal to 1/(CLKGDV + 1) of the sample rate
generator source clock CLKSRG.
6) A transmit sync error (XSYNCERR) may occur when it is enabled for the
first time after device reset. The purpose of this step is to clear any potential
XSYNCERR that occurs on the transmitter at this time:
a) Set the XRST bit to 1 to enable the transmitter.
b) Wait for any unexpected frame sync error to occur. If the external
device provides the bit clock, wait for two CLKR or CLKX cycles. If the
McBSP generates the bit clock as a clock master, wait for two CLKG
cycles. The unexpected frame sync error (XSYNCERR), if any, occurs
within this time period.
c) Disable the transmitter (XRST = 0). This clears any outstanding
XSYNCERR.
8) Enable the XINT interrupt by setting the corresponding bit in the interrupt
enable register (IER). In this step, the McBSP transmitter is still in reset.
Upon detection of the first transmit frame sync from the external device,
the McBSP generates an interrupt to the CPU and the DSP enters the
interrupt service routine (ISR). The ISR needs to perform these tasks in
this order:
a) Modify the XINTM bits to the value desired for normal McBSP
operations. If CPU interrupt is used to service the McBSP in normal
operations, ensure that the XINTM bits are modified to 0 to detect the
McBSP XRDY event. If no McBSP interrupt is desired in normal
operations, disable future McBSP-to-CPU interrupt in the interrupt
enable register (IER).
b) Set the XRST bit and/or the RRST bit to 1 to enable the respective
portion of the McBSP. The McBSP is now ready to transmit and/or
receive.
10) Upon detection of the second frame sync, DXR is already serviced and the
transmitter is ready to transmit the valid data. The receiver is also serviced
properly by the DSP.
- RRDY is not set to 1 upon reception of the last bit of the element.
- RBR is not copied to DRR upon reception of the last bit of the element.
Thus, RRDY is not set active. This feature also implies that no interrupts
or synchronization events are generated for this element.
- XEMPTY and XRDY are not affected by the end of transmission of the
related serial element.
An enabled transmit element can have its data masked or transmitted. When
data is masked, the DX pin is forced to the high-impedance state even though
the transmit channel is enabled.
Note:
For C64x DSP, RCER and XCER are replaced by RCERE0 and XCERE0,
respectively. Additional registers XCERE1, XCERE2, XCERE3, RCERE1,
RCERE2, and RCERE3 are also used in this mode.
For all C6000 devices, a total of 32 of the available 128 elements can be
enabled at any given time. The 128 elements comprise eight subframes (0
through 7), and each subframe has 16 contiguous elements. Even-numbered
subframes 0, 2, 4, and 6 belong to partition A; odd-numbered subframes 1, 3,
5, and 7 belong to partition B.
The number of elements enabled can be updated during the course of a frame
to allow any arbitrary group of elements to be enabled. This update is
accomplished using an alternating ping-pong scheme for controlling two
subframes (one odd-numbered and the other even-numbered) of 16
contiguous elements within a frame at any time. One subframe belongs to
partition A and the other to partition B.
Any one 16-element block from partition A and partition B can be selected,
yielding a total of 32 elements that can be enabled at one time. The subframes
are allocated on 16-element boundaries within the frame, as shown in
Figure 41. The (R/X)PABLK and (R/X)PBBLK fields in MCR select the
subframes in partition A and B, respectively. This enabling is performed
independently for transmit and receive.
Subframe # 0 1 2 3 4 5 6 7 0
(R/X)PABLK 0 1 2 3 0
Partition A 0-15 32-47 64-79 96-111 0-15
elements
(R/X)PBBLK 0 1 2 3
Partition B 16-31 48-63 80-95 112-127
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
elements
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
FS(R/X)
Transmit data masking allows an element enabled for transmit to have its DX
pin set to the high-impedance state during its transmit period. In systems
where symmetric transmit and receive provides software benefits, this feature
allows transmit elements to be disabled on a shared serial bus. A similar
feature is not needed for receive, because multiple receptions cannot cause
serial bus contention.
Note:
DX is masked or driven to the high-impedance state:
- During inter-packet intervals.
- When an element is masked regardless of whether it is enabled.
- When an element is disabled.
Following are descriptions of how each XMCM bit value affects operation in
normal multichannel selection mode:
- XMCM = 00b: The serial port transmits data over the DX pin for the
number of elements programmed in XFRLEN1. Thus, DX is driven during
transmit.
- XMCM = 10b: All elements are enabled, which means all the elements in
a data frame (XFRLEN1) are written to DXR and DXR-to-XSR copies
occur at their respective times. However, DX is driven only for those
elements that are selected via XP[A/B]BLK and XCER and is placed in the
high-impedance state otherwise. In this case, if XINTM = 00b, the number
of interrupts generated due to every DXR-to-XSR copy would equal the
number of elements in that frame (XFRLEN1).
Figure 42 shows the activity on the McBSP pins for all of the preceding XMCM
bit values with the following conditions:
In the following illustrations, the arrows indicating the occurrence of events are
only sample indications.
DX E0 E1 E2 E3
XRDY
DX E1 E3
XRDY
DX E1 E3
(d) XMCM = 11b, RPABLK = 00b, XPABLK = X, RCER = 1010b, XCER = 1000b
FS(R/X)
DR E1 E3
RRDY
Read of DRR
Read of DRR (E1)
(E3)
DX E3
XRDY
Note:
You must be careful not to affect the currently selected subframe when chang-
ing the selection.
The currently selected subframe is readable through the RCBLK and XCBLK
bits in MCR for receive and transmit, respectively. The associated channel
enable register cannot be modified if it is selected by the appropriate
(R/X)P[A/B]BLK register to point toward the current subframe. Similarly, the
(R/X)PABLK and (R/X)PBBLK bits in MCR cannot be modified while pointing to
or being changed to point to the currently selected subframe. If the total number
of elements is 16 or less, the current partition is always pointed to. In this case,
only a reset of the serial port can change the element enabling.
When the RMCME and XMCME bits are cleared to 0, the C64x McBSP is in
the normal multichannel selection mode. See section 8.2 for a detailed
description. In normal multichannel selection mode, RCERE1−RCERE3 and
XCERE1−XCERE3 are not used; RCERE0 and XCERE0 function as RCER
and XCER, respectively.
When the RMCME and XMCME bits are set to 1, the C64x McBSP has
128-channel selection capability. RCERE0−RCERE3 and XCERE0−XCERE3
are used to enable up to 128 channels. Since up to 128 channels can be
selected at one time, the (R/X)P[A/B]BLK and (R/X)CBLK values in MCR have
no effect in this mode. But, if necessary, the (R/X)CBLK value can be read to
determine the subframe that is active. Perform the following to enable up to
128 channels:
Following are descriptions of how each XMCM bit value affects operation in
the enhanced multichannel selection mode (similar to its function in normal
multichannel selection mode):
- XMCM = 00b: The serial port transmits data over the DX pin for the
number of elements programmed in XFRLEN1. Thus, DX is driven during
transmit.
- XMCM = 10b: All elements are enabled, which means all the elements in
a data frame (XFRLEN1) are written to DXR and DXR-to-XSR copies
occur at their respective times. However, DX is driven only for those
elements that are selected via XCERE0−XCERE3, and is placed in the
high-impedance state otherwise. In this case, if XINTM = 00b, the number
of interrupts generated due to every DXR-to-XSR copy would equal the
number of elements in that frame (XFRLEN1).
CLKX
Extra delay
if DXENA = 1 (processor 1)
Disable time
(processor 0)
No extra delay
Dead time even with DXENA = 1
DX B0 (processor 0) B7 (processor 1) B6 (processor 1)
In the case when two McBSPs are used to transmit data over the same TDM
line, bus contention occurs if DXENA = 0. The first McBSP turns off the
transmission of the last data bit (changes DX from valid to a high-impedance
state) after a disable time specified in the datasheet. As shown in Figure 43,
this disable time is measured from the CLKX active clock edge. The next
McBSP turns on its DX pin (changes from a high-impedance state to valid)
after a delay time. Again, this delay time is measured from the CLKX active
clock edge. Bus contention occurs because the dead time between the two
devices is not enough. You need to apply alternative software or hardware
methods to ensure proper multichannel operation in this case.
If you set DXENA = 1 in the second McBSP, the second McBSP turns on its
DX pin after some extra delay time. This ensures that the previous McBSP on
the same DX line is disabled before the second McBSP starts driving out data.
The DX enabler controls only the high-impedance enable on the DX pin, not
the data itself. Data is shifted out to the DX pin at the same time as in the case
when DXENA = 0. The only difference is that with DXENA = 1, the DX pin is
masked to a high-impedance state for some extra CPU cycles before the data
is seen on the TDM data line. Therefore, only the first bit of data is delayed.
Refer to the specific device datasheet for the exact amount of delay.
CLKX SCK
DX MOSI
DR MISO
FSX SS
CLKX SCK
DX MISO
DR MOSI
FSX SS
The clock stop mode (CLKSTP) of the McBSP provides compatibility with the
SPI protocol. The McBSP supports two SPI transfer formats that are specified
by the clock stop mode bits (CLKSTP) in SPCR. The CLKSTP bits in
conjunction with the CLKXP bit in PCR allows serial clocks to be stopped
between transfers using one of four possible timing variations, as shown in
Table 15. Figure 46 and Figure 47 show the timing diagrams of the two SPI
transfer formats and the four timing variations.
Note:
The digital loopback mode (DLB = 1 in SPCR cannot be used in conjunction
with the clock stop mode (CLKSTP = 1x).
10 0 Low inactive state without delay. The McBSP transmits data on the rising
edge of CLKX and receives data on the falling edge of CLKX.
11 0 Low inactive state with delay. The McBSP transmits data one-half cycle
ahead of the rising edge of CLKX and receives data on the rising edge of
CLKX.
10 1 High inactive state without delay. The McBSP transmits data on the falling
edge of CLKX and receives data on the rising edge of CLKX.
11 1 High inactive state with delay. The McBSP transmits data one-half cycle
ahead of the falling edge of CLKX and receives data on the falling edge of
CLKX.
Figure 46.
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
SPI Transfer with CLKSTP = 10b
CLKX (CLKXP=0)/SCK
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Á Á
CLKX (CLKXP=1)/SCK
D(R/X)/MOSI
(from master)†
Á B7 B6
Á B5 B4 B3 B2 B1 B0
D(R/X)/MISO
Á B7 B6
Á B5 B4 B3 B2 B1 B0
(from slave)‡
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
†
FSX/SS
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
If the McBSP is the SPI master (CLKXM = 1), MOSI=DX. If the McBSP is the SPI slave (CLKXM = 0), MOSI = DR.
‡ If the McBSP is the SPI master (CLKXM = 1), MISO=DR. If the McBSP is the SPI slave (CLKXM = 0), MISO = DX.
Á ÁÁ
D(R/X)/MISO
B7 B6 B5 B4 B3 B2 B1 B0
(from slave)‡
†
FSX/SS ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
If the McBSP is the SPI master (CLKXM = 1), MOSI=DX. If the McBSP is the SPI slave (CLKXM = 0), MOSI = DR.
‡ If the McBSP is the SPI master (CLKXM = 1), MISO=DR. If the McBSP is the SPI slave (CLKXM = 0), MISO = DX.
The CLKSTP bits in SPCR and the CLKXP bit in PCR select the appropriate
clock scheme for a particular SPI interface, as shown in Table 15. The
CLKSTP and CLKXP bits determine the following conditions:
- In clock stop mode, whether the clock is high or low when stopped
- In clock stop mode, whether the first clock edge occurs at the start of the
first data bit or at the middle of the first data bit
The CLKXP bit selects the edge on which data is transmitted (driven) and
received (sampled), as shown in Table 15.
Figure 46 is the timing diagram when CLKSTP = 10b. In this SPI transfer
format, the transition of the first clock edge (CLKX) marks the beginning of data
transfer, provided the slave enable (FSX/SS) is already asserted. Data
transfer is synchronized to the first clock edge.
Figure 47 is the timing diagram when CLKSTP = 11b. Data transfer begins
before the transition of the serial clock. Therefore, the transition of the slave
enable signal FSX/SS from high to low, instead of the transition of the serial
clock, marks the beginning of transfer in this SPI transfer format. In SPI master
mode, as well as SPI slave mode, the McBSP requires an FSX/SS edge for
each transfer. This means the FSX/SS signal must toggle for each word. The
McBSP clock stop mode requires single-phase frames ((R/X)PHASE = 0) and
one element per frame ((R/X)FRLEN = 0).
When the McBSP is configured to operate in SPI mode, both the transmitter
and the receiver operate together as a master or a slave. The McBSP is a
master when it generates clocks. When the McBSP is the SPI master, CLKX
drives both its own internal receive clock (CLKR) and the serial clock (SCK)
of the SPI slave. The FSR and CLKR signals should not be used in SPI mode.
These do not function as SPI signals like the FSX and CLKX signals. In
conjunction with CLKSTP enabled, CLKXM = 1 (in PCR) indicates that the
McBSP is a master, and CLKXM = 0 indicates that the McBSP is an SPI slave.
The slave enable signal (FSX/SS) enables the serial data input and output
driver on the slave device (the device not providing the output clock).
As the SPI master, the McBSP generates CLKX and FSX through the internal
sample rate generator. As discussed in section 4.3.1, the CLKSM bit in SRGR
should be set to specify either the CPU clock or the external clock input (CLKS)
as the clock source to the internal sample rate generator. The CLKGDV (clock
divide ratio) in SRGR should be programmed to generate CLKX at the required
SPI data rate. The McBSP generates a continuous clock (CLKX) internally and
gates the clock off (stops the clock) to the external interface when transfers are
finished. The McBSP receive clock is provided from the internal continuously
running clock, so the receiver and transmitter both work internally as if clocks
do not stop. Selection of the clock stop modes overrides the frame generator
bit fields (FPER and FWID) in SRGR.
Although the CLKX signal is generated externally by the master, the internal
sample rate generator of the McBSP must be enabled for proper SPI slave
mode operation. The internal sample rate clock is then used to synchronize
the input clock (CLKX) and frame sync (FSX) from the master to the CPU
clock. Accordingly, the CLKSM bit in SRGR should be left at the default value
(CLKSM = 1) to specify the CPU clock as the clock source of the sample rate
generator. Furthermore, the CLKGDV bits in SRGR must be set to a value
such that the rate of the internal clock CLKG is at least eight times that of the
SPI data rate. This rate is achieved by programming the sample rate generator
to its maximum speed (CLKGDV = 1) for all SPI transfer rates.
2) Program the necessary McBSP configuration registers (and not the data
registers) as required when the serial port is in the reset state
(XRST = RRST = 0). Write the desired value into the CLKSTP bits in
SPCR. Table 15 shows the various CLKSTP modes.
3) Set the GRST bit to 1 in SPCR to get the sample rate generator out of reset.
5) Depending upon whether the CPU or DMA services the McBSP, perform
step (a) if the CPU is used, or step (b) if the DMA is used.
a) If the CPU is used to service the McBSP. set XRST = RRST = 1 to
enable the serial port. Note that the value written to SPCR at this time
should have only the reset bits changed to 1 and the remaining
bit-fields should have the same values as in Step 2 and 4 above.
b) If the DMA is used to perform data transfers, the DMA should be
initialized first with the appropriate read/write syncs and the start bit
set to run. The DMA waits for the synchronization events to occur.
Now, pull the McBSP out of reset by setting XRST = RRST = 1.
6) Wait two bit clocks for the receiver and transmitter to become active.
11 Registers
Table 17 lists the McBSP registers and their memory addresses for the
C620x/C670x DSP, Table 18 lists the McBSP registers for the
C621x/C671x DSP, and Table 19 lists the McBSP registers for the C64x DSP.
See the device-specific datasheet for the memory address of these registers.
The McBSP control registers are accessible only via the peripheral bus (see
Figure 1). You should halt the McBSP before making changes to the serial port
control register (SPCR), receive control register (RCR), transmit control
register (XCR), and pin control register (PCR). Changes made to these
registers without halting the McBSP could result in an undefined state.
DRR‡ Data receive register 018C 0000 0190 0000 01A4 0000 11.1
DXR Data transmit register 018C 0004 0190 0004 01A4 0004 11.2
SPCR Serial port control register 018C 0008 0190 0008 01A4 0008 11.3
RCR Receive control register 018C 000C 0190 000C 01A4 000C 11.4
XCR Transmit control register 018C 0010 0190 0010 01A4 0010 11.5
SRGR Sample rate generator register 018C 0014 0190 0014 01A4 0014 11.6
MCR Multichannel control register 018C 0018 0190 0018 01A4 0018 11.7
RCER Receive channel enable register 018C 001C 0190 001C 01A4 001C 11.8
XCER Transmit channel enable register 018C 0020 0190 0020 01A4 0020 11.9
PCR Pin control register 018C 0024 0190 0024 01A4 0024 11.12
† The RBR, RSR, and XSR are not directly accessible via the CPU or the DMA/EDMA controller.
‡ The CPU and DMA/EDMA controller can only read this register; they cannot write to it.
§ Available only on C6202(B) DSP and C6203(B) DSP.
McBSPs on Device
Acronym Register Name McBSP 0 McBSP 1 Section
RBR† Receive buffer register RBR0 RBR1 −
McBSPs on Device
Acronym Register Name McBSP 0 McBSP 1 McBSP 2¶ Section
RBR† Receive buffer register RBR0 RBR1 RBR2 −
RCERE0 Enhanced receive channel enable register 0 RCERE00 RCERE01 RCERE02 11.10
RCERE1 Enhanced receive channel enable register 1 RCERE10 RCERE11 RCERE12 11.10
RCERE2 Enhanced receive channel enable register 2 RCERE20 RCERE21 RCERE22 11.10
RCERE3 Enhanced receive channel enable register 3 RCERE30 RCERE31 RCERE32 11.10
XCERE0 Enhanced transmit channel enable register 0 XCERE00 XCERE01 XCERE02 11.11
XCERE1 Enhanced transmit channel enable register 1 XCERE10 XCERE11 XCERE12 11.11
XCERE2 Enhanced transmit channel enable register 2 XCERE20 XCERE21 XCERE22 11.11
XCERE3 Enhanced transmit channel enable register 3 XCERE30 XCERE31 XCERE32 11.11
For devices with an EDMA, DRR is mapped to memory locations on both the
EDMA bus (data port) as well as the peripheral bus (configuration bus). See
the device-specific datasheet for the memory address of these registers. DRR
is accessible via the peripheral bus and via the EDMA bus. Both the CPU and
the EDMA can access DRR in all the memory-mapped locations. An access
to any EDMA bus location is equivalent to an access to DRR of the
corresponding McBSP. For example, a read from any word-aligned address
in a DRR location on the EDMA bus is equivalent to a read from the DRR of
the corresponding McBSP on the peripheral bus. It is recommended that you
set up the EDMA to use the EDMA bus for serial port servicing in order to free
up the peripheral bus for other functions.
For devices with an EDMA, DXR is mapped to memory locations on both the
EDMA bus (data port) as well as the peripheral bus (configuration bus). See
the device-specific datasheet for the memory address of these registers. DXR
is accessible via the peripheral bus and via the EDMA bus. Both the CPU and
the EDMA can access DXR in all the memory-mapped locations. An access
to any EDMA bus location is equivalent to an access to DXR of the
corresponding McBSP. For example, a write to any word-aligned address in
a DXR location on the EDMA bus is equivalent to a write to the DXR of the
corresponding McBSP on the peripheral bus. It is recommended that you set
up the EDMA to use the EDMA bus for serial port servicing in order to free up
the peripheral bus for other functions.
23 22 21 20 19 18 17 16
FRST GRST XINTM XSYNCERR XEMPTY XRDY XRST
R/W-0 R/W-0 R/W-0 R/W-0 R-0 R-0 R/W-0
15 14 13 12 11 10 8
DLB RJUST CLKSTP Reserved
R/W-0 R/W-0 R/W-0 R-0
7 6 5 4 3 2 1 0
DXENA† Reserved RINTM RSYNCERR RFULL RRDY RRST
R/W-0 R-0 R/W-0 R/W-0 R-0 R-0 R/W-0
†Available only on C621x/C671x DSP and C64x DSP.
Legend: R = Read only; R/W = Read/Write; -n = value after reset
24 SOFT For C621x/C671x and C64x DSP: Soft bit enable mode bit.
This bit is used in conjunction with FREE bit to determine
state of serial port clock during emulation halt. This bit has
no effect if FREE = 1.
YES 1 Soft mode is enabled. During emulation halt, serial port clock
stops after completion of current transmission.
Table 22. Serial Port Control Register (SPCR) Field Descriptions (Continued)
Bit field† symval† Value Description
21−20 XINTM 0−3h Transmit interrupt (XINT) mode bit.
Table 22. Serial Port Control Register (SPCR) Field Descriptions (Continued)
Bit field† symval† Value Description
14−13 RJUST 0−3h Receive sign-extension and justification mode bit.
− 3h Reserved
12−11 CLKSTP 0−3h Clock stop mode bit. In SPI mode, operates in conjunction
with CLKXP bit of pin control register (PCR).
DISABLE 0−1h Clock stop mode is disabled. Normal clocking for non-SPI mode.
ON 1 DX enabler is on.
Table 22. Serial Port Control Register (SPCR) Field Descriptions (Continued)
Bit field† symval† Value Description
5−4 RINTM 0−3h Receive interrupt (RINT) mode bit.
YES 1 DRR is not read, RBR is full, and RSR is also full with new
word.
15 14 8 7 5 4 3 0
Reserved RFRLEN1 RWDLEN1 RWDREVRS† Reserved
R-0 R/W-0 R/W-0 R/W-0 R-0
† Available only on C621x/C671x DSP and C64x DSP.
Legend: R = Read only; R/W = Read/Write; -n = value after reset
30−24 RFRLEN2 OF(value) 0−7Fh Specifies the receive frame length (number of words) in phase 2.
23−21 RWDLEN2 0−7h Specifies the receive word length (number of bits) in phase 2.
− 6h−7h Reserved
† For CSL implementation, use the notation MCBSP_RCR_field_symval
− 3h Reserved
14−8 RFRLEN1 OF(value) 0−7Fh Specifies the receive frame length (number of words) in phase 1.
7−5 RWDLEN1 0−7h Specifies the receive word length (number of bits) in phase 1.
− 6h−7h Reserved
† For CSL implementation, use the notation MCBSP_RCR_field_symval
15 14 8 7 5 4 3 0
Reserved XFRLEN1 XWDLEN1 XWDREVRS† Reserved
R-0 R/W-0 R/W-0 R/W-0 R-0
†Available only on C621x/C671x DSP and C64x DSP.
Legend: R = Read only; R/W = Read/Write; -n = value after reset
30−24 XFRLEN2 OF(value) 0−7Fh Specifies the transmit frame length (number of words) in
phase 2.
23−21 XWDLEN2 0−7h Specifies the transmit word length (number of bits) in phase 2.
− 6h−7h Reserved
† For CSL implementation, use the notation MCBSP_XCR_field_symval
− 3h Reserved
14−8 XFRLEN1 OF(value) 0−7Fh Specifies the transmit frame length (number of words) in
phase 1.
7−5 XWDLEN1 0−7h Specifies the transmit word length (number of bits) in phase 1.
− 6h−7h Reserved
† For CSL implementation, use the notation MCBSP_XCR_field_symval
15 8 7 0
FWID CLKGDV
R/W-0 R/W-1
Legend: R/W = Read/Write; -n = value after reset
30 CLKSP CLKS polarity clock edge select bit is only used when the
external clock (CLKS) drives the sample-rate generator clock
(CLKSM = 0).
27−16 FPER OF(value) 0−FFFh Frame period value plus 1 specifies when the next frame-sync
signal becomes active. Range is 1 to 4096 sample-rate generator
clock (CLKG) periods.
15−8 FWID OF(value) 0−FFh Frame width value plus 1 specifies the width of the frame-sync
pulse (FSG) during its active period.
7−0 CLKGDV OF(value) 0−FFh Sample-rate generator clock (CLKG) divider value is used as
the divide-down number to generate the required sample-rate
generator clock frequency.
† For CSL implementation, use the notation MCBSP_SRGR_field_symval
15 10 9 8 7 6 5 4 2 1 0
Reserved RMCME† RPBBLK RPABLK RCBLK Reserved RMCM
R-0 R/W-0 R/W-0 R/W-0 R-0 R-0 R/W-0
†Available only on C64x DSP.
Legend: R = Read only; R/W = Read/Write; -n = value after reset
25 XMCME For C64x DSP: Transmit 128-channel selection enable bit works
in conjunction with the RMCME bit.
22−21 XPABLK 0−3h Transmit partition A subframe bit. Enables 16 contiguous channels
in each subframe.
ENNOMASK 0 All channels are enabled without masking (DX is always driven
during transmission of data). DX is masked or driven to a
high-impedance state during (a) interpacket intervals, (b) when
a channel is masked regardless of whether it is enabled, or (c)
when a channel is disabled.
15−10 Reserved − 0 Reserved. The reserved bit location is always read as 0. A value
written to this field has no effect.
9 RMCME For C64x DSP: Receive 128-channel selection enable bit works
in conjunction with the XMCME bit.
8−7 RPBBLK 0−3h Receive partition B subframe bit. Enables 16 contiguous channels
in each subframe.
15 0
RCEA
R/W-0
Legend: R/W = Read/Write; -n = value after reset
15−0 RCEA OF(value) 0−FFFFh A 16-bit unsigned value used to disable (bit value = 0) or
enable (bit value = 1) reception of the nth channel within the
even-numbered 16-channel-wide subframe in partition A. The
16-channel-wide subframe is selected by the RPABLK bit in MCR.
† For CSL implementation, use the notation MCBSP_RCER_field_symval
15 0
XCEA
R/W-0
Legend: R/W = Read/Write; -n = value after reset
15−0 XCEA OF(value) 0−FFFFh A 16-bit unsigned value used to disable (bit value = 0) or
enable (bit value = 1) transmission of the nth channel within the
even-numbered 16-channel-wide subframe in partition A. The
16-channel-wide subframe is selected by the XPABLK bit in MCR.
† For CSL implementation, use the notation MCBSP_XCER_field_symval
Table 29. Enhanced Receive Channel Enable Registers (RCERE0−3) Field Descriptions
Table 30. Channel Enable Bits in RCEREn for a 128-Channel Data Stream
Table 31. Enhanced Transmit Channel Enable Registers (XCERE0−3) Field Descriptions
Table 32. Channel Enable Bits in XCEREn for a 128-Channel Data Stream
The serial port is configured via the serial port control register (SPCR) and the
pin control register (PCR). The PCR is also used to configure the serial port
pins as general-purpose inputs or outputs during receiver and/or transmitter
reset (for more information see section 10). The PCR contains McBSP status
control bits. The PCR is shown in Figure 59 and described in Table 33.
31 16
Reserved
R-0
15 14 13 12 11 10 9 8
Reserved XIOEN RIOEN FSXM FSRM CLKXM CLKRM
R-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
7 6 5 4 3 2 1 0
Reserved† CLKSSTAT DXSTAT DRSTAT FSXP FSRP CLKXP CLKRP
R-0 R-0 R/W-0 R-0 R/W-0 R/W-0 R/W-0 R/W-0
SP 0 DX, FSX, and CLKX pins are configured as serial port pins
and do not function as general-purpose I/O pins.
INPUT 0 Receive clock (not the CLKR pin) is driven by transmit clock
(CLKX) that is based on CLKXM bit. CLKR pin is in
high-impedance state.
Table 34 lists the changes made since the previous version of this document.
18 In section 3.4, changed last sentence to: The configuration is independent for receive and transmit.
38 In section 4.5.7, changed last sentence to: If the (R/W)WDREVRS and (R/X)COMPAND fields are
set as indicated above, but the element size is not set to 32-bit, operation is undefined.
Index
E I
element length 34 ignore frame synchronization 47
end-of-frame interrupt 73 initialization procedure 62
enhanced multichannel selection mode
input clock source mode (CLKSM) 23
(C64x DSP only) 73
enhanced receive channel enable register interface signals 13
(RCERE) 107 interrupts CPU 18
enhanced transmit channel enable register
(XCERE) 109
exception conditions 50 M
F maximum frame frequency 46
McBSP initialization for SPI mode 81
features 11 McBSP operation
FPER bits 99 as SPI master 80
frame configuration 18, 32 as SPI slave 81
frame frequency 46 standard 43
frame length 33 MCR 101
frame operation 20 multichannel control register (MCR) 101
frame sync signal generation 28 multichannel selection operation 68
frame detection for initialization 31 DX enabler (DXENA) 75
frame period (FPER) 29 changing element selection 73
frame width (FWID) 29 enabling and masking of channels 69
receive frame sync signal selection 30 end-of-block interrupt 73
transmit frame sync signal selection 31 enhanced multichannel selection mode
frame synchronization ignore 47 (C64x DSP only) 73
frame synchronization phases 32 multichannel enable 69
FREE bit 89 multiphase frame example 38
FRST bit 89
FSGM bit 99
FSRM bit 111 N
FSRP bit 111
notational conventions 3
FSXM bit 111
FSXP bit 111
FWID bits 99
O
G operation
McBSP standard 43
GRST bit 89 receive 44
GSYNC bit 99 transmit 45
X XSYNCERR bit 89
XWDLEN1 bits 97
XCBLK bits 101 XWDLEN2 bits 97
XCE bits 109 XWDREVRS bit 97