Hi,
I have a problem when I try to read the Left AGC Noise Threshold Sticky Flag ( register 47).
At the first reading I read 0x40 and it's rigth because my signal is below the noise threshold. After the register is cleared and I can read 0.
But after that my register is always at 0 even when I have no signal on the input. What is the minimum time needed by the codec to update the register when the signal is below the noise threshold? There are anything to do to set Left AGC Noise Threshold sticky Flag at 1?
I know that my AGC configuration is right because if I use the non sticky flag it works.
Else this my function the read the register. Maybe there is an error on my function to read the register ?
Int16 AIC3204_rread( Uint16 regnum )
{
Uint16 wrbuf[1], rdbuf[1];
wait(0x200);
// 7-bit Device Address
wrbuf[0]= regnum & 0x007F;
// We have to write to the register before reading from it!
I2C_write(wrbuf, 1, CSL_I2C_CODEC_ADDR, TRUE, startStop, CSL_I2C_MAX_TIMEOUT);
// Delay is needed between write and read the register
wait(0x300);
// Read from the register.
I2C_read(rdbuf, 1, CSL_I2C_CODEC_ADDR, TRUE, startStop, CSL_I2C_MAX_TIMEOUT, FALSE);
wait(0x200);
return rdbuf[0]; // return the value
}
Thanks for your help
Best regards
Julien