AN1836-AN21161 Analog Devices, AN1836-AN21161 Datasheet - Page 37

no-image

AN1836-AN21161

Manufacturer Part Number
AN1836-AN21161
Description
Interfacing the ADSP-21161 SIMD SHARC DSP to the AD1836 (24-bit/96 kHz) Multichannel Codec
Manufacturer
Analog Devices
Datasheet
6. Processing AD1836 Audio Samples via the SPORT0 RX ISR
In this section we investigate example DSP instructions for processing data from the SPORT0 receive interrupt vector.
The ADSP-21161 typically processes newly received serial data by servicing SPORT interrupts, which redirects the program
sequencer to jump to a SPORT interrupt vector, where it can then call the interrupt service routine. When using the SPORTs to
process AD1836 TDM audio data samples, the application interrupt service routine code contain instructions which move audio
data from a given input channel to that channels processing algorithm and places results back to any desired tx DMA buffer
location, where it is shifted to the AD1836 where the data is converted back to an analog signal by the DACs.
Figure 26 below shows a high level logical view of the audio streams that can be processed when interfacing the AD1836 to the
SHARC DSP. With the AD1836's integrated stereo ADCs and DACs, each ADSP-21161 serial port TDM pair (SPORTs 0/2,
1/3) is capable of processing 8 input audio channels and send DSP output audio streams to 8 output channels. This type of
configuration will allow implementation of a 8 x 2 channel digital mixing console, or provide a low cost solution for running
surround algorithms requiring 8 channels for audio playback. With the use or both SPORT0 and SPORT2 in the TDM mode,
the ADSP-21161 can interface to up to 2 AD1836s, resulting in an audio system with 16 audio input and output channels.
In the reference AD1836 driver listed in Appendix A, the ADSP-21161’s SPORT0 Interrupt Vector/Interrupt Service Routine
is used to process incoming information from the AD1836 through the serial port. As was described earlier in section 3.4, the
information sent from the AD1836 is DMA-Chained (i.e., the SPORT receives the entire block of AD1836 audio frame data
before a SPORT interrupt occurs, and the DMA parameter registers are automatically reloaded by the DSP's I/O processor to
repeat the transfer of codec data) into the rx_buf0a[ ] buffer and an interrupt is generated when the rx buffer is filled with new
data from the previously completed audio frame. Therefore, when a RX interrupt routine is being serviced the data from all
active receive timeslots has been filled into the receive DMA buffer. When a TX interrupt routine is being services, the data
from the tx DMA buffer has fully been transferred out to the serial port in the previously completed audio frame. Output left
and right samples are filled into the transmit DMA buffer tx_buf2a[ ] for transmission out of SPORT. The programmer has
the option of executing the DSP algorithm from either the transmit DMA interrupt or the receive DMA interrupt.
Figure 27 shows the basic SPORT RX IRQ program flow structure for processing AD1836 audio data for the supplied DSP
assembly and C drivers. This diagram shows the flow of audio samples from the serial port data buffer registers, to the DMA
buffers, and from there, the audio samples are copied into temporary memory locations (double-buffered) to perform a
"talkthru" of unprocessed audio streams, or to be used as inputs for the audio processing routines. The output data is then
Figure 26. Logical View Of AD1836/SHARC Audio System
Analog Out1
Analog Out2
SP/DIF DAR
Analog Out3
(AD1852 O/P)
Analog Out 4
Analog In1
Analog In2
X (Unused)
Analog Stereo
Inputs/Outputs
21161 EZ-KIT
Lite's AD1836
Analog/Digital
Front End
Channel 1
Channel 3
Channel 4
Channel 7
Channel 8
Channel 2
Channel 5
Channel 6
ADSP-21161
Processing
Routines
DSP

Related parts for AN1836-AN21161