i am using following code with DSK6713
#include "dsk6713_aic23.h" //codec support
Uint32 fs=DSK6713_AIC23_FREQ_8KHZ; //set sampling rate
#define DSK6713_AIC23_INPUT_MIC 0x0015
#define DSK6713_AIC23_INPUT_LINE 0x0011
Uint16 inputsource=DSK6713_AIC23_INPUT_MIC; //select input
#define N 2400000 //buffer size 300 secs
long i;
short buffer[N];
#pragma DATA_SECTION(buffer,".EXT_RAM") //buffer in ext memory
void main()
{
short recording = 0;
short playing = 0;
for (i=0 ; i<N ; i++) buffer[i] = 0;
DSK6713_DIP_init();
DSK6713_LED_init();
comm_poll(); //init DSK, codec
while(1) //infinite loop
{
if(DSK6713_DIP_get(3) == 0) //if SW#3 is pressed
{
i=0;
recording = 1; //start recording
while (recording == 1)
{
DSK6713_LED_on(3); //turn on LED#3
buffer[i++] = input_left_sample(); //input data
if (i>2000)
if (DSK6713_DIP_get(3)==1) //if SW#3 lifted
{
recording = 0; //stop recording
DSK6713_LED_off(3); //turn LED#3 off
}
}
}
if(DSK6713_DIP_get(0)==0) //if SW#0 is pressed
{
i=0;
playing = 1; //start playing
while (playing == 1)
{
DSK6713_LED_on(0); //turn on LED#0
output_left_sample(buffer[i++]); //output data
if (i>2000)
if (DSK6713_DIP_get(0) == 1) //if SW#1 is lifted
{
playing = 0; //stop playing
DSK6713_LED_off(0); //turn LED#0 off
}
}
}
}
}
this code records speech from mic when DIP 3 is kept pushed and LED 3 is on, stores it in memory and plays it back when DIP 0 is pressed down.
I have included all the support files and build program successfully. Even .out file is generated. But after loading and running program, when I press DIP 3, LED glows and when I release it LED is still on. And nothing happens further, LED remains on.
Is there something wrong with program? it is from standard text book. Can this be due to faulty mic? program just keep running and no error is shown...
Please it is urgent. Thanks in advance