Other Parts Discussed in Thread: CC3200, TLV320AIC3254, LAUNCHXL-CC26X2R1
Hi everyone,
I just found a small mistake in the file AudioCodec.c which is part of the example programs for the CC3200 Audio BoosterPack:
When you ramp up the output volume of the TLV320AIC3254 codec from 0 to 100 using the function AudioCodec_speakerVolCtrl, you expect a volume increase by 1dB from step to step. However, you will notice two volume level steps, where the volume increases/decreases by much more than 1dB. This is because the threshold for clipping the level to +24dB is set to 97 instead of 91. The correct code looks like this (I added some additional comments to the code):
int AudioCodec_speakerVolCtrl(unsigned char codecId, unsigned char speaker, signed char volumeLevel)
{
short vol = 0;
if(volumeLevel < 4)
{ // volumeLevel < 4: mute
vol = 0x80;
}
else if (volumeLevel > 91) // original value of 97 is too large!
{ // volumeLevel > 91: +24dB
vol = 0x30;
}
else
{ // 4 <= volumeLevel <= 91
vol = 122 + (volumeLevel << 1);
}
AudioCodec_pageSelect(TI3254_PAGE_0);
AudioCodec_regWrite(TI3254_LEFT_DAC_VOL_CTRL_REG, (unsigned char )(vol&0x00FF));
AudioCodec_regWrite(TI3254_RIGHT_DAC_VOL_CTRL_REG, (unsigned char )(vol&0x00FF));
return 0;
}
Dear TI-Engineers: Please correct the number for the next release of the demo programs. Thank you.
P.S.:
This may be a simple typo or (more likely) the misunderstood hand writing of i.e. a German who uses to write the '1' like this . This looks very similar to the 7. Engineers should better know that when working together with Germans ;-)
I changed my hand writing because of this and use 'I' instead of '1' when working in international teams. (I am a German engineer.)