Hello,
We are trying to test the TLV320AIC3120. We have decided to test firstly the output with a sinus wave digitally created.
The TLV320AIC3120 receive a MCLK at 11.294118MHz and we use the PLL with the following configuration : J = 6, D = 9870, P = R = 1 and NDAC = 5 and MDAC = 3 in order to have fs = 44.1kHz.
We configure the DAC, like it is showed in 7.3.12.15 page 65 of the datasheet (with our PLL configuration obviously). We have done some little modifications :
- HPOUT muted and power-down (we use SPKP & SPKM outputs),
- Class-D driver output stage gain = 6dB (instead of 18),
- Class-D output analog volume = -20 dB (instead of -9)
The beep generator mode seems to work very well and we don't reach to produce the same sound with digital values send in I2S to the codec.
We don't know if it is the way we produce or the way we send the digital data or if it the configuration of the TLV320AIC3120.
Here how we produce and send the data :
#define PI 3.14159265358979323846
#define TAU (2.0 * PI)
[...]
u8 signal[65536];
u32 nsamples = 65536;
f64 t = 0;
s16 sin_value = 0;
u32 i = 0;
[...]
while(i < nsamples) {
t = ((((f64)i) / 4.0)) / (44100);
sin_value = 32767*sin(400 * TAU * t);
signal[i] = (sin_value >> 8) & 0xFF; // left msb
signal[i+1] = sin_value & 0xFF; // left lsb
signal[i+2] = signal[i]; // right msb
signal[i+3] = signal[i+1]; // right lsb
i += 4;
}
[...]
HAL_SAI_Transmit(&hsai_BlockA1, signal, nsamples/2, HAL_MAX_DELAY);
Thanks in advance.
Regards,
Malo



