I am just beginner with my DSP program. I got a simple example about with this board. The result is good, but i can't figure out the relationship between my input and the binary number.
/*
* main.c
*/
#include "dsk6713.h"
#include "dsk6713_aic23.h"
#include "stdlib.h"
#include "math.h"
// Codec configuration settings
DSK6713_AIC23_Config config = { \
0x0017, /* 0 DSK6713_AIC23_LEFTINVOL Left line input channel volume */ \
0x0017, /* 1 DSK6713_AIC23_RIGHTINVOL Right line input channel volume */\
0x01f9, /* 2 DSK6713_AIC23_LEFTHPVOL Left channel headphone volume */ \
0x01f9, /* 3 DSK6713_AIC23_RIGHTHPVOL Right channel headphone volume */ \
0x0011, /* 4 DSK6713_AIC23_ANAPATH Analog audio path control */ \
0x0000, /* 5 DSK6713_AIC23_DIGPATH Digital audio path control */ \
0x0000, /* 6 DSK6713_AIC23_POWERDOWN Power down control */ \
0x0043, /* 7 DSK6713_AIC23_DIGIF Digital audio interface format */ \
0x0001, /* 8 DSK6713_AIC23_SAMPLERATE Sample rate control */ \
0x0001 /* 9 DSK6713_AIC23_DIGACT Digital interface activation */ \
};
void main()
{
DSK6713_AIC23_CodecHandle hCodec;
Uint32 readval;
// Initialize BSL
DSK6713_init();
//Start codec
hCodec = DSK6713_AIC23_openCodec(0, &config);
// Set frequency to 8KHz
DSK6713_AIC23_setFreq(hCodec, DSK6713_AIC23_FREQ_8kHZ);
for(;;)
{
// Read sample from the left channel
while (!DSK6713_AIC23_read(hCodec, &readval));
while (!DSK6713_AIC23_write(hCodec, readval));
}
// DSK6713_AIC23_closeCodec(hCodec); // Codec close is unreachable
}
With this i can put the Line_in to the Line_out. (my line_in_Left = line_in_right and they are sine signal with 100Hz and 1Vpp). But there is the question, if i check the readval, it will be a 32 bits number, and the first 16 bits are all 0. Just the last 16 bits changed. I can't figure out the relationship between the input Voltage and this binary number. Could someone give me a hand?
thx very much.