Good morning folks!
I'm having trouble running a very simple program. As from today, we are able to run a simple inout program that takes samples from the aic23 codec and writes them back to output. For example if we put a sinewave as an input we get the sample wave as an output. We can make additions between samples and get the resulting output right. BUT as soon as we try to multiply 2 samples (like in code below) the output is saturated. The following code (very simple) works EXCEPT the line in red wich is problematic. We thought this could be a format problem : what is the result of a Uint32bits*Uint32bits (assuming the ouuput of the write32 function is a 32bit value) operation? Does it result in a Uint32bits value? Second idea was that we do not use a correct target configuration ( but we can make a inout program work ...) .
Im sure this problem must seem ridiculous but im really stuck and i cant write any Signal processing program if I can't understand how to make a multiplication!!!!!
Regards
SR
My code (works except the RED line wich is problematic)
#include "dsk6455.h"
#include "dsk6455_aic23.h"
/* Codec configuration settings */
DSK6455_AIC23_Config config = {
0x0117, // 0 DSK6455_AIC23_LEFTINVOL Left line input channel volume
0x0017, // 1 DSK6455_AIC23_RIGHTINVOL Right line input channel volume
0x00d8, // 2 DSK6455_AIC23_LEFTHPVOL Left channel headphone volume
0x00d8, // 3 DSK6455_AIC23_RIGHTHPVOL Right channel headphone volume
0x0011, // 4 DSK6455_AIC23_ANAPATH Analog audio path control
0x0000, // 5 DSK6455_AIC23_DIGPATH Digital audio path control
0x0000, // 6 DSK6455_AIC23_POWERDOWN Power down control
0x0043, // 7 DSK6455_AIC23_DIGIF Digital audio interface format
0x0001 // 9 DSK6455_AIC23_DIGACT Digital interface activation
};
void main()
{
DSK6455_AIC23_CodecHandle hCodec;
Uint32 leftsample,rightsample;
// initializes the board
DSK6455_init();
DSK6455_DIP_init();
/* Start the codec */
hCodec = DSK6455_AIC23_openCodec(0, &config);
/* read a sample to the left channel */
while (!DSK6455_AIC23_read32(hCodec, &leftsample));
leftsample = leftsample*leftsample;
/* Send a sample to the right channel */
while (!DSK6455_AIC23_write32(hCodec, leftsample));
}
/* Close the codec */
DSK6455_AIC23_closeCodec(hCodec);
}