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

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
.GLOBAL
the*/
.GLOBAL
process_audio routine*/
.GLOBAL
.GLOBAL
.GLOBAL
.GLOBAL
.GLOBAL
.GLOBAL
.GLOBAL
.GLOBAL
//.EXTERN
//.EXTERN
//.EXTERN
.section /dm
/* AD1836 stereo-channel data holders - used for DSP processing of audio data received from codec */
.VAR
.VAR
.VAR
.VAR
.VAR
.VAR
.VAR
.VAR
.VAR
.VAR
.VAR
.VAR
.VAR
.VAR
.VAR
.VAR
/* TDM audio frame/ISR counter, for debug purposes */
.VAR
.section /pm pm_code;
Process_AD1836_Audio_Samples:
do_audio_processing:
playback_AD1836_left_DACs:
playback_AD1836_right_DACs:
/* get AD1836 left channel input samples, save to data holders for processing */
r0 = dm(rx0a_buf + Internal_ADC_L0); dm(Left_Channel_In0) = r0;
r0 = dm(rx0a_buf + Internal_ADC_L1); dm(Left_Channel_In1) = r0;
r0 = dm(rx0a_buf + AUX_ADC_L0);
/* get AD1836 right channel input samples, save to data holders for processing */
r0 = dm(rx0a_buf + Internal_ADC_R0); dm(Right_Channel_In0) = r0;
r0 = dm(rx0a_buf + Internal_ADC_R1); dm(Right_Channel_In1) = r0;
r0 = dm(rx0a_buf + AUX_ADC_R0);
call (pc, process_audio);
/* ---- DSP processing is finished, now playback results to AD1836 ---- */
r0 = dm(Left_Channel_Out0);
r1 = dm(Left_Channel_Out1);
r2 = dm(Left_Channel_Out2);
r3 = dm(Left_Channel_AD1852); dm(tx2a_buf + AUX_DAC_L0) = r3;
r0 = dm(Right_Channel_Out0);
r1 = dm(Right_Channel_Out1);
r2 = dm(Right_Channel_Out2);
r3 = dm(Right_Channel_AD1852); dm(tx2a_buf + AUX_DAC_R0) = r3;
Left_Channel_Out0;
Right_Channel_Out0;
Left_Channel_Out1;
Right_Channel_Out1;
Left_Channel_Out2;
Right_Channel_Out2;
Left_Channel_AD1852;
Right_Channel_AD1852;
Left_Channel_Out_Thru; /* These serve the same function for a different set of audio */
Right_Channel_Out_Thru;/* samples destined for the DACs*/
tx2a_buf;
rx0a_buf;
process_audio; /* Label of audio algorithm code listed in another file which executes */
Left_Channel_In0;
Left_Channel_In1;
Right_Channel_In0;
Right_Channel_In1;
Left_Channel_SPDIF_rx;
Right_Channel_SPDIF_rx;
Left_Channel_Out0;
Left_Channel_Out1;
Left_Channel_Out2;
Right_Channel_Out0;
Right_Channel_Out1;
Right_Channel_Out2;
Left_Channel_AD1852;
Right_Channel_AD1852;
Left_Channel;
Right_Channel;
audio_frame_timer = 0;
dm_codec;
/* These are the DMA buffers that hold the 8 channels of audio */
/* immediately pre-transmission and post-reception */
/* a procesing alogorithm on the audio data before it is output */
/* to the DACs */
/* output processed left ch audio samples to AD1836 */
dm(tx2a_buf + Internal_DAC_L0) = r0;
dm(tx2a_buf + Internal_DAC_L1) = r1;
dm(tx2a_buf + Internal_DAC_L2) = r2;
/* output processed right ch audio samples to AD1836 */
dm(tx2a_buf + Internal_DAC_R0) = r0;
dm(tx2a_buf + Internal_DAC_R1) = r1;
dm(tx2a_buf + Internal_DAC_R2) = r2;
/* Input values from AD1836 ADCs */
/* Output values for AD1836 DACs */
/* can use for intermediate results to next filter stage */
/* can use for intermediate results to next filter stage */
dm(Left_Channel_SPDIF_rx) = r0;
dm(Right_Channel_SPDIF_rx) = r0;
/* These will bring samples for the DACs back into
/* Process_AD1836_Audio_Samples routine from the

Related parts for AN1836-AN21161