Hello everybody,
I bought a TMS320C6713 DSK board and found example code that realizes:
1. a tone output in the headphone
2. an audio loopback from the microphone to the headphone.
After I tested both variants the second didn't work. Here is the code:
/*
* main.c
*/
#include "dsk6713.h"
#include "dsk6713_aic23.h"
#include "DSKintr.h"
/* Codec configuration settings */
/* See dsk6713_aic23.h and the TLV320AIC23 Stereo Audio CODEC Data Manual */
/* for a detailed description of the bits in each of the 10 AIC23 control */
/* registers in the following configuration structure. */
DSK6713_AIC23_Config config = { \
0x0017, /* 0 DSK6713_AIC23_LEFTINVOL Left line input channel volume */ \
0x0017, /* 1 DSK6713_AIC23_RIGHTINVOL Right line input channel volume */\
0x00d8, /* 2 DSK6713_AIC23_LEFTHPVOL Left channel headphone volume */ \
0x00d8, /* 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 */ \
0x0081, /* 8 DSK6713_AIC23_SAMPLERATE Sample rate control (48 kHz) */ \
0x0001 /* 9 DSK6713_AIC23_DIGACT Digital interface activation */ \
};
void main(void){
DSK6713_AIC23_CodecHandle hCodec;
Uint32 test_save[100], sample_pair;
Int16 test_idx;
/* Initialize the interrupt system */
intr_reset();
/* dsk6713_init() must be called before other BSL functions */
DSK6713_init(); /* In the BSL library */
/* Start the codec */
hCodec = DSK6713_AIC23_openCodec(0, &config);
/* Change the sampling rate to 16 kHz */
DSK6713_AIC23_setFreq(hCodec, DSK6713_AIC23_FREQ_16KHZ);
test_idx = 0;
/* Read left and right channel samples from the ADC and loop */
/* them back out to the DAC. */
for(;;){
while(!DSK6713_AIC23_read(hCodec, &sample_pair));
test_save[test_idx] = sample_pair;
test_idx++;
if(test_idx == 100) test_idx = 0;
while(!DSK6713_AIC23_write(hCodec, sample_pair));
}
}
When I look into the vector "test_save" I found zeros, ones, 65534 and 65535.
I am sure that the mic I am using is working. I am using CCS V5.4
Has anybody any idea what is going on? Thank you in advance!