I've been trying to get the c5515 ezDSP to run standalone and I've looked through other forum posts and the wiki
about how to do this. I ported code from the GEL file into C code, and also included the same initialization steps from
the sample code provided by Spectrum Digital as suggested in the other forum posts and the wiki.
The code I am uploading to the board passes audio from the input straight to the output, but with the initialization
code added, I hear nothing from the output. There is no difference when I create a *.bin file and upload this to the board.
When I step through in debug mode, the program hangs after attempting to initialize the AIC3204 codec.
I am using CCS v5.1.1.00033 for Linux.
The code looks like this:
initialize(){
program_pll();
config_port();
SYS_GlobalIntEnable();
IER0 = 0x0010; // enable timer int
IER1 = 0x0004; // enable RTC int
Timer0Init();
reset_RTC();
enable_rtc_second_int();
//hangs at this line:
aic3204_hardware_init();
aic3204_init();
set_sampling_frequency_and_gain(44100, 20);
//also hangs if using this function from the sample code
//AIC3254_init();
set_i2s0_slave();
enable_i2s0();
StartTimer0();
SYS_EXBUSSEL = 0x6100;
USBSTK5515_ULED_init();
SAR_init();
}
void program_pll(){
Uint16 i;
//bypass the pll
CLKCFGMSW = 0x0;
#if (PLL_100M ==1)
CGCR2 = 0x8000;
CGCR4 = 0x0000;
CGCR3= 0x0806;
CGCR1 = 0x8BE8;
#elif (PLL_12M ==1)
CGCR2 = 0x8000;
CGCR4 = 0x0200;
CGCR3 = 0x0806;
CGCR1 = 0x82ED;
#elif (PLL_98M ==1)
// 98.304 MHz
CGCR2 = 0x8000;
CGCR4 = 0x0000;
CGCR3 = 0x0806;
CGCR1 = 0x82ED;
#endif
while ( (CGCR3 & 0x0008) == 0);
// Switch to PLL clk
CLKCFGMSW = 0x1;
// clock gating
// enable all clocks
SYS_PCGCR1 = 0;
SYS_PCGCR2 = 0xFF84;
// reset peripherals
SYS_PRCNTR = 0x02;
SYS_PRCNTRLR = 0x00fb;
for (i=0; i< 200; i++);
}
void config_port(){
// configure ports
SYS_EXBUSSEL = 0x6900; // parallel port: mode 6, serial port1: mode 2, serial port0: mode1
}
void SYS_GlobalIntEnable(void)
{
asm(" BIT (ST1, #ST1_INTM) = #0");
}
Uint16 fTimer =0;
void Timer0Init(void)
{
/* Timer0 Initialization */
// timer interval 0.5sec (2Hz)
// prescale = 1011 (devide by 4096)
// 98.304M/4096 = 24K
// 24K/12K = 2Hz (12K = 0x2EE0)
/* TIM0 EN | AutoReload disable | Prescale = 0(100/2 = 50MHz) ==> 20nsec */
CPU_TIM0_CTRL = 0x802E; // autoReload
//*CPU_TIM0_CTRL = 0x802C; // disable autoReload
CPU_TIM0_PLWR = 0x2EE0;
CPU_TIM0_PHWR = 0x0000;
CPU_TIM0_CLWR = 0x0000;
CPU_TIM0_CHWR = 0x0000;
/* Clearing timer Aggregation register*/
CPU_TIMINT_AGGR = 0x0007;
/* enable timer0 int flag*/
CPU_TIM0_IER = 0x0001;
}
Any insight as to what might be causing the AIC codec initialization to hang?
Thanks,
Andrew