This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TAC5212: AGC and DRC formulas

Part Number: TAC5212

Hello Team,

As far as I know the application note concerning the AGC and/or DRC of TAC5212 is still not available.

Nevertheless, is it possible to get the formulsa to set the AGC and DRC registers?

Note 1: The PurePath Console helps to configure the AGC and the DRC but it is not complete. Indeed, some registers related to AGC are not present in the GUI (for example registers 0x70 and 0x74 of page 27, and registers 0x08 and 0x0C of page 28).

Note 2: this topic is related to an existing topic https://e2e.ti.com/support/audio-group/audio/f/audio-forum/1514983/taa5212-agc-control-and-setting

Regards,

Sebastien

  • Hi Sebastien,

    All formulas we have defined for the AGC be found in this app note, even though it is for a different device: Using the Automatic Gain Controller in the TLV320ADCx140/PCMx140-Q1

    You can use the formulas in this app note and apply them to the registers found in the TAC5212 datasheet. If they're not in the app note, I'm not sure how readily available I can find them. However, the most relevant registers can all be found in PPC3.

    Best,

    Garret

  • Hi Garret,

    The formulas found in the mentioned application note are not valid for the TAC5212. Just for example, to set the target to -6dB as AGC Target Level, PurePath says:

    w a0 00 00
    w a0 7f 00
    w a0 00 1b
    w a0 60 ff ff e8 00

    meaning write 0xFFFFE800 in register 0x60 of page 0x1B. The application note says:

    set b0000 in AGC_LVL[3:0]

    BR,

    Sebastien

  • Hi Sebastien,

    This is because the device in the app note has fewer programmable levels (-6dB to -36dB in -2dB steps), so the table shown are the only list of options. Notice how there is no formula attached to these.

    Since there are more levels on the TAC5212, there would be a formula converting the dB value, similar to the other AGC features. To get the AGC target value formula for the TAC5212, unfortunately will have to wait for the release of the app note for that device, which is in development but not ready for release. Luckily, this is one you can find in PPC3. 

    The other features that do show formulas in the app note should be the same for the TAC5212.

    Best,

    Garret

  • Hi Garret,

    Unfortunately the other AGC features use other formulas too.

    I did reverse engineering of PPC3 and found out the formulas for most of the registers, except 0x70, 0x74 of page 27, and 0x08, 0x0C of page 28, because those registers can not be set with PPC3 GUI.

    It seems that I have to wait for the AGC AN release to confirm my formulas... Confused

    BR,

    Sebastien

  • Hi Sebastien,

    Good news! I have tracked down the equations for the registers you are looking for. Unfortunately, page 27 register 0x70 is listed as not changeable, but the other three registers with formulas are here:

    AGC_Equations.xlsx

    Best,

    Garret

  • Hi Garret,

    Thanks a lot for your Excel table.
    Below my comments after comparing the Excel results with PPC3 and my formulas:

    1. Page 27 register 0x68: PPC3 adds always 2560. For example 0dB gives "w a0 68 00 00 0a 00". Shall we add 2560 or not? Please confirm.

    2. Page 27 registers 0x64, 0x74, 0x78: PPC3 gives different results. According to my calculations, the results of those registers depend on the sampling rate (by default 48000Hz). In Excel, the formula shall be: =DEC2HEX(ROUND("VALUE"/1000*48000, 0), 8) . Please confirm.

    3. Page 27 register 0x70: after verification the value of this register is writable (changeable). It is not a read only register. Please confirm.

    Can you send me the Excel table for the DRC registers please?

    AGC_Equations_commented.xlsx

    BR,

    Sebastien

  • Hi Sebastien,

    It looks like the changes you made match better to the PPC3 values, so you should be able to use what you have comfortably.

    At this time, I do not have a similar document for the DRC, but I will actively seek it and let you know if I find.

    Best,

    Garret

  • Hi Garret,

    OK thus I will use my formulas for the AGC registers.

    And I will wait for the DRC document. The best would be to keep the topic open until the DRC topic is completed.

    BR,

    Sebastien

  • Hi Sebastien,

    After some searching it seems we do not have a similar document for the DRC in our database.

    However, all the DRC registers are available on PPC3 where you can set the values and obtain the resulting register values in the I2C Monitor.

    Best,

    Garret

  • Hi Garret,

    You are right: all DRC registers are available on PPC3 and I successfully found out the formulas for all registers, except Page 28 registers 0x24 and 0x28 (attack time constant and release time constant). It seems that the results of those registers are not linear.

    Is it possible to get the formulas for those two registers please?

    BR,

    Sebastien

  • Hi Sebastien,

    Today is a holiday for our team in the U.S. please expect a delayed response.

    Thank you,
    Jeff McPherson

  • Hi Sebastien,

    The formula for these registers is the same for 48kHz sampling, within 1 bit of accuracy:

    DRC_ATTACK_TC = DRC_RELEASE_TC = DEC2HEX(ROUND(2^31*(EXP(-1/(48*VAL))),0),8)

    Best,

    Garret

  • Hi Garret,

    Your formula works perfectly. Thanks a lot!

    I have now all AGC and DRC formulas. The issue is solved!

  • Hi Sebastien,

    I'm glad I could help.

    Best,

    Garret