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

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
APPENDIX A:
Assembly Source Code Listing for 21161 EZ-KIT Lite
Audio Driver (Visual DSP Project Files)
21161 EZ-KIT System Initialization Routine
/***
*
*
*
*
*
*
*
*
*
*
*********************************************************************************/
/* ADSP-21161 System Register bit definitions */
#include
.GLOBAL
.GLOBAL
//.EXTERN
//.EXTERN
//.EXTERN
//.EXTERN
//.EXTERN
//.EXTERN
//.EXTERN
//.EXTERN
//.EXTERN
/*---------------------------------------------------------------------------*/
.section /pm pm_code;
_main:
wait_forever:
/*--------------------------------------------------------------------------------------*/
/* Note: This routine is first called at the Reset Vector in the Interrupt Vector Table */
/*--------------------------------------------------------------------------------------*/
INIT_21161_EZKIT.ASM
/* This may be required for disabling SPORT config for EZLAB debugger */
CALL Clear_All_SPT_Regs;
call init_21161_SDRAM_controller;
call Program_AD1836_regs_via_SPI;
call Init_AD1852_DACs;
call Program_SPORT02_TDM_Registers;
call Program_SPORT02_DMA_Channels;
call user_code_init;
IRPTL = 0x00000000;
bit set imask SP0I|SP2I;
bit set imask IRQ0I | IRQ1I | IRQ2I; /* irq0, irq1 and irq2 enabled */
ustat2 = dm(SP02MCTL);
bit set ustat2 MCE;
dm(SP02MCTL) = ustat2;
call Blink_LEDs_Test;
idle;
jump wait_forever;
ADSP-21161 EZ-KIT Initialization and Main Program Shell
Developed using the ADSP-21161 EZ-KIT LIte Evaluation Platform
"def21161.h"
_main;
Init_DSP;
init_21161_SDRAM_controller;
Program_SPORT02_TDM_Registers;
Program_AD1836_regs_via_SPI;
Program_SPORT02_DMA_Channels;
AD1836_Codec_Initialization;
Init_AD1852_DACs;
Reg_SPI_Code_init;
Clear_All_SPT_Regs;
user_code_init;
***************************************************
/* Clear and Reset SPORTs and DMAs */
/* Initialize External Memory */
/* Use SPORTs 1&3 to talk to AD1836 SPI interface */
/* and program AD1836 Registers*/
/* Initialize SPORTs for codec communications */
/* Start Serial Port 1 tx and rx DMA Transfers */
/* initialize user buffers */
/* clear pending interrupts */
/* start audio processing, enable SPORT1 tx & rx int */
/* Are We Alive? */
/* wait forever loop */
John Tomarakos
ADI DSP Applications Group
Revision 1.0
1/30/01
*
*
*
*
*
*
*
*
*
*

Related parts for AN1836-AN21161