Hi
We got a problem enabling the amplifier.
After configuration (and before) the status register reads 0x7007. This indicated that the Amplifier mode is off. But how can it be off when the device is powered on and enabled in register 0x00?
Here is the initialisation code:
// Reset
out[0] = 0x00; // 0000 0000 - 0000 0010 Device control register: SW Reset
out[1] = 0x02;
I2C_WriteBlock(0x00, out, sizeof(out));
// Config serial
out[0] = 0x00; // 0000 0000 - 0001 1000 Serial interface control: Left Channel, 8 kHz + I2S data + I2S mode
out[1] = 0x18;
I2C_WriteBlock(0x01, out, sizeof(out));
osDelay(10);
// Power on
out[0] = 0x00; // 0000 0000 - 0000 0001 Device control register: Operating mode
out[1] = 0x01;
I2C_WriteBlock(0x01, out, sizeof(out));
if (I2C_ReadBlock(0, in, sizeof(in)) == 0) {
TRACE_BLK(TRC_TA_PLF, "SoundInit After: ", in, sizeof(in));
}
// Config clipping
out[0] = 0x00; // 0000 0000 0000 1000 Bypass control: clip control off
out[1] = 0x08;
I2C_WriteBlock(0x01, out, sizeof(out));
// Config Dynamic range compressor
out[0] = 0x92; // 1001 0010 1011 1010 Dynamic range compressor: clip control off
out[1] = 0xBA;
I2C_WriteBlock(0x01, out, sizeof(out));
// Config volume
out[0] = 0x10; // 0001 0000 0011 0000 Volume control register: 0dB
out[1] = 0x30;
I2C_WriteBlock(0x01, out, sizeof(out));
// Config power limiting
out[0] = 0x00; // 0000 0000 0000 0000 De-emphasis, soft/hard mute and power limiter: 0dB
out[1] = 0x00;
I2C_WriteBlock(0x01, out, sizeof(out));
// audio output enable
out[0] = 0x00; // 0000 0000 - 0000 1001 Device control register: Amplifier mode + Operating mode
out[1] = 0x09;
I2C_WriteBlock(0x01, out, sizeof(out));
if (I2C_ReadBlock(0, in, sizeof(in)) == 0) {
TRACE_BLK(TRC_TA_PLF, "SoundInit: ", in, sizeof(in));
}
And here is the read-back of all the registers:
SoundInit:
0009 0018 0007 0a18 0007 59dd c63e 651a
e53e 4616 d33e 4df3 ea3e 5ee0 f93e 0008
92ba 12a5 0004 1030 0000 7007
A sample of the serial data:
The schematic (Note: The TEST pins is grounded, however the NC pins are NC.):
Help needed. Both outputs are a 0V at all time, and no sound in the 4ohm speaker, not even a click.
Thanks
Kasper
Hi Kasper,
I am not 100% sure how to read your code.
For example:
// Config clipping
out[0] = 0x00; // 0000 0000 0000 1000 Bypass control: clip control off
out[1] = 0x08;
I2C_WriteBlock(0x01, out, sizeof(out));
Does it mean that 0x0008 is written to Register 0x01? If not, where do you specify the register address?
Best regards,
Tomas
Hi Kasper,
Ok then did you change properly the register address? From your code above you are first writing to the Device control register (0x00), but then always to the Serial interface input 1 register (0x01).
Best regards,
Tomas
Hi,
We are only using Serial interface input 1
You can see the result at the original post, here marked in red:
Header 1 |
---|
SoundInit: 0009 0018 0007 0a18 0007 59dd c63e 651a |
Register 0x00: 0x0009 (Amplifier mode and Operating mode)
Register 0x01: 0x0018 (Left channel, 8kHz, I2S data up to 24 bits, no SCK signal polarity inversion, I2S mode)
It should be in order.
And the status register: 0x7007
Kasper
Hi Kasper,
Have you had a chance to test more devices and have you observed this issue on all of them? If so, you can try to simplify the code by only writing the following commands.
// Reset
out[0] = 0x00; // 0000 0000 - 0000 0010 Device control register: SW Reset
out[1] = 0x02;
I2C_WriteBlock(0x00, out, sizeof(out));
// Config volume
out[0] = 0x16; // 0001 0110 0011 0000 Volume control register: 0dB
out[1] = 0x30;
I2C_WriteBlock(0x13, out, sizeof(out));
// Config serial
out[0] = 0x00; // 0000 0000 - 0001 1000 Serial interface control: Left Channel, 8 kHz + I2S data + I2S mode
out[1] = 0x18;
I2C_WriteBlock(0x01, out, sizeof(out));
// audio output enable
out[0] = 0x00; // 0000 0000 - 0000 1001 Device control register: Amplifier mode + Operating mode
out[1] = 0x09;
I2C_WriteBlock(0x00, out, sizeof(out));
if (I2C_ReadBlock(0, in, sizeof(in)) == 0) {
TRACE_BLK(TRC_TA_PLF, "SoundInit: ", in, sizeof(in));
}
Best regards,
Tomas
Hi Tomas
Thanks for answering. It seems to be a HW fault on the prototype.
Now readback of the settings is diferent:
SoundInit After:
0009 0018 0007 0a18 0007 59dd c63e 651a
e53e 4616 d33e 4df3 ea3e 5ee0 f93e 0008
92ba 12a5 0004 1030 0000 216f
Odd.
Thanks
Kasper
Hi Kasper,
It seems the TFA9879 is still not working, correct?
The status register indicates 0x216F which means that the I2S is incorrect.
Can you please make some scope pictures of the LRCK1 and SCK1? Is the LRCK1 and SCK1 jitter-free?
Best regards,
Tomas