Hello.... I'm trying to generate a signal wave and sending through the line out of the DSK and i made a bridge between line out and line in to graph if the wave is correct but didn't work... the output variable show a sine wave but input variable don't show anithing.... any suggestion????
#include <dsk6713.h>
#include <dsk6713_aic23.h>
#include <math.h>
DSK6713_AIC23_Config el_config = DSK6713_AIC23_DEFAULTCONFIG;
DSK6713_AIC23_CodecHandle el_handle0;
unsigned int in_r,in_l,out_r,out_l;
int n,N=1000,f;
float x[1000],y[1000];
void main ()
{
DSK6713_init();
el_handle0 = DSK6713_AIC23_openCodec(0, &el_config);
DSK6713_AIC23_setFreq(el_handle0, DSK6713_AIC23_FREQ_16KHZ);
DSK6713_LED_init();
DSK6713_DIP_init();
while(1)
{
if(DSK6713_DIP_get(0)==0)
{ DSK6713_LED_on(0);
f=50;
}
else if (DSK6713_DIP_get(1)==0)
{ DSK6713_LED_on(1);
f=100;
}
else if (DSK6713_DIP_get(2)==0)
{ DSK6713_LED_on(2);
f=200;
}
else if(DSK6713_DIP_get(3)==0)
{ DSK6713_LED_on(3);
f=500;
}
else
{ DSK6713_LED_off(0);
DSK6713_LED_off(1);
DSK6713_LED_off(2);
DSK6713_LED_off(3);
f=10;
}
for (n=0;n<N;n++)
{ x[n]=10*sin(2*3.1415*f/8000*n);
y[n]=10*cos(2*3.1415*f/8000*n);
out_l=x[n];
out_r=y[n];
while(!DSK6713_AIC23_write(el_handle0, out_l)); //Left channel write
while(!DSK6713_AIC23_write(el_handle0, out_r)); //Right channel write
while(!DSK6713_AIC23_read(el_handle0, &in_l)); //Left channel read
while(!DSK6713_AIC23_read(el_handle0, &in_r)); //Right channel read
}
}
}