01.08.2013 Views

Chapter 22 Multichannel Audio Serial Port (McASP).pdf

Chapter 22 Multichannel Audio Serial Port (McASP).pdf

Chapter 22 Multichannel Audio Serial Port (McASP).pdf

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Functional Description www.ti.com<br />

<strong>22</strong>.3.10.4 Error Handling and Management<br />

To support the design of a robust audio system, the <strong>McASP</strong> includes error-checking capability for the<br />

serial protocol, data underrun, and data overrun. In addition, the <strong>McASP</strong> includes a timer that continually<br />

measures the high-frequency master clock every 32 AHCLKX/AHCLKR clock cycles. The timer value can<br />

be read to get a measurement of the clock frequency and has a minimum and maximum range setting that<br />

can set an error flag if the master clock goes out of a specified range.<br />

Upon the detection of any one or more errors (software selectable), or the assertion of the AMUTEIN input<br />

pin, the AMUTE output pin may be asserted to a high or low level to immediately mute the audio output. In<br />

addition, an interrupt may be generated if desired, based on any one or more of the error sources.<br />

<strong>22</strong>.3.10.4.1 Unexpected Frame Sync Error<br />

An unexpected frame sync occurs when:<br />

• In burst mode, when the next active edge of the frame sync occurs early such that the current slot will<br />

not be completed by the time the next slot is scheduled to begin.<br />

• In TDM mode, a further constraint is that the frame sync must occur exactly during the correct bit clock<br />

(not a cycle earlier or later) and only before slot 0. An unexpected frame sync occurs if this condition is<br />

not met.<br />

When an unexpected frame sync occurs, there are two possible actions depending upon when the<br />

unexpected frame sync occurs:<br />

1. Early: An early unexpected frame sync occurs when the <strong>McASP</strong> is in the process of completing the<br />

current frame and a new frame sync is detected (not including overlap that occurs due to a 1 or 2 bit<br />

frame sync delay). When an early unexpected frame sync occurs:<br />

• Error interrupt flag is set (XSYNCERR, if an unexpected transmit frame sync occurs; RSYNCERR,<br />

if an unexpected receive frame sync occurs).<br />

• Current frame is not resynchronized. The number of bits in the current frame is completed. The<br />

next frame sync, which occurs after the current frame is completed, will be resynchronized.<br />

2. Late: A late unexpected frame sync occurs when there is a gap or delay between the last bit of the<br />

previous frame and the first bit of the next frame. When a late unexpected frame sync occurs (as soon<br />

as the gap is detected):<br />

• Error interrupt flag is set (XSYNCERR, if an unexpected transmit frame sync occurs; RSYNCERR,<br />

if an unexpected receive frame sync occurs).<br />

• Resynchronization occurs upon the arrival of the next frame sync.<br />

Late frame sync is detected the same way in both burst mode and TDM mode; however, in burst mode,<br />

late frame sync is not meaningful and its interrupt enable should not be set.<br />

<strong>22</strong>.3.10.4.2 Buffer Underrun Error - Transmitter<br />

A buffer underrun can only occur for serializers programmed to be transmitters. A buffer underrun occurs<br />

when the serializer is instructed by the transmit state machine to transfer data from XRBUF[n] to XRSR[n],<br />

but XRBUF[n] has not yet been written with new data since the last time the transfer occurred. When this<br />

occurs, the transmit state machine sets the XUNDRN flag.<br />

An underrun is checked only once per time slot. The XUNDRN flag is set when an underrun condition<br />

occurs. Once set, the XUNDRN flag remains set until the processor explicitly writes a 1 to the XUNDRN<br />

bit to clear the XUNDRN bit.<br />

In DIT mode, a pair of BMC zeros is shifted out when an underrun occurs (four bit times at 128 × fs). By<br />

shifting out a pair of zeros, a clock may be recovered on the receiver. To recover, reset the <strong>McASP</strong> and<br />

start again with the proper initialization.<br />

In TDM mode, during an underrun case, a long stream of zeros are shifted out causing the DACs to mute.<br />

To recover, reset the <strong>McASP</strong> and start again with the proper initialization.<br />

3966 <strong>Multichannel</strong> <strong>Audio</strong> <strong>Serial</strong> <strong>Port</strong> (<strong>McASP</strong>) SPRUH73E–October 2011–Revised May 2012<br />

Submit Documentation Feedback<br />

Copyright © 2011–2012, Texas Instruments Incorporated

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!