![Texas Instruments AM1808 Technical Reference Manual Download Page 1236](http://html.mh-extra.com/html/texas-instruments/am1808/am1808_technical-reference-manual_10945581236.webp)
Architecture
1236
SPRUH82C – April 2013 – Revised September 2016
Copyright © 2013–2016, Texas Instruments Incorporated
Multichannel Buffered Serial Port (McBSP)
25.2.12.1 General Initialization Procedure
This section provides the general initialization procedure.
1. With the McBSP still in reset (Power and Sleep Controller (PSC) in the default state):
(a) Program the PSC registers in the System Module to put the McBSP in the enable state (see the
Power and Sleep Controller (PSC)
chapter.
(b) Perform the necessary device pin multiplexing setup (see your device-specific data manual).
2. 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 in SPCR). The respective portion of the
McBSP needs to be in reset (XRST = 0 and/or RRST = 0 in SPCR).
3. 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).
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 and the SCLKME bit in PCR.
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/( 1) of the sample rate generator source clock CLKSRG.
6. 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. Setup data acquisition as required:
(a) If the EDMA is used to service the McBSP, setup data acquisition as desired and start the EDMA in
this step, before the McBSP is taken out of reset.
(b) If CPU interrupt is used to service the McBSP, enable the transmit and/or receive interrupt as
required.
(c) If CPU polling is used to service the McBSP, no action is required in this step.
8. 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 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.
9. 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).