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.

TLV320AIC3254: How to configure AIC3254 Stereo AGC function and what is the difference between setting Stereo AGC and Normal AGC?

Part Number: TLV320AIC3254

The document <Stereo AGC Functionality for the TLV320AIC3254> slaa474 says AIC3254 has the Stereo AGC and I can understand the Figure 1 in Page 2.

I have some problems below.

1.  How to enable Stereo AGC function? Do I need to set something in GDE or any register ?

2.  Why the parameters in AGC in GDE are different fromhe register settings in TLV320AIC3254 Application Reference Guide? Is there any difference between them?

The AGC_MAX_GAIN in GDE can only be set  within the accepted range -16.0 to 15.9999980926513671875 (+-24dB) 

The register in Application Reference Guide can be set from 0dB to 58.0dB.

  • Sorry to insert an error image. The third image should be above.

  • Hi,

    Welcome to E2E, Thanks for your interest in our products!.

    The Stereo AGC mentioned in the App note you point out is available outside the miniDSP of the device, so it is not required to implement it on PurePath Studio GDE.

    The AGC of PurePath studio is a different block, separate from the Stereo AGC mentioned in the app note, and offers more configuration options and fine tuning of the parameters, hence the difference.

    In order to configure the Stereo AGC you need to write the coefficients from Page 0 Registers 86-101. You can use the example code from section 5 of SLAA474

    The Stereo AGC function is done within the miniDSP of the device. The difference between the registers you point out is because the AGC on PurePath Studio is actually a different block with more configurable options which is not used for Stereo AGC implementation.

    Best Regards,

      -Diego Meléndez López
       Audio Applications Engineer

  • Hi,

    Thanks for your reply.

    I have tried the example code from section 5 of SLAA474. The test result of this Stereo AGC script is as same as the Normal AGC.

    I configure AIC3254 with Normal AGC by setting the Registers 86-101 in Page 0 such as you mentioned to configure the Stereo AGC.

    The scripts in Section 5 of SLAA474 seem to  be the same as the scripts that configure the Normal AGC procedure.

    Is there any difference between configuring the Stereo AGC and Normal AGC?

    Best Regards,

    Mark

  • Hi,

    Thanks for your reply.

    I have tried the example code from section 5 of SLAA474. The test result of this Stereo AGC script is as same as the Normal AGC.

    I configure AIC3254 with Normal AGC by setting the Registers 86-101 in Page 0 such as you mentioned to configure the Stereo AGC.

    The scripts in Section 5 of SLAA474 seem to be the same as the scripts that configure the Normal AGC procedure.

    Is there any difference between configuring the Stereo AGC and Normal AGC?

    Best Regards,

    Mark
  • Hi, Mark,

    First of al I would like to clarify about this question. The Stereo AGC is effectively done inside the miniDSP of the device, I was confused with the different AGC implementations this device has, so I have corrected above response. Sorry for the confusion. My previous response was incorrect, so I have corrected it. Please refer to below for clarification. 

    Stereo AGC function is achieved by using the miniDSP of the AIC3254 to implement a processing block called STAGC_R specific for Stereo AGC application. This custom processing block provides the required algorithms to perform a Stereo AGC application controlled by the AGC of the device.

    To evaluate the Stereo AGC functionality of this device, you can use the Stereo AGC function from the AIC3254 CS software. For an external implementation, you can take a look to the attached script, where the miniDSP code is the implementation of the STAGC_R processing block.

    ST_AGC.cfg

    Best Regards,

      -Diego Meléndez López
       Audio Applications Engineer

  • Hi

    Thanks for your reply.

    I have read  the manual of 『Stereo AGC Functionality for the TLV320AIC3254』 and comprehended the  Stereo AGC function and STAGC_R processing block.Thanks for your clarification again.

    Here I am still confused with some other questions. Could you please explain or answer for us? Thanks.

    1. You said Stereo AGC is achieved by using the miniDSP. As I know, only GDE software can generate the miniDSP code. But the GDE I downloaded from the TI website do not have Stereo AGC function. Does it have an update version that contains the Stereo AGC? If it does, could you please send me a new version GDE? My current GDE version is

    2. You said that we can use the Stereo AGC function from the AIC3254 CS software. Does it mean that we can use Stereo AGC function by AIC3254 CS? As I know, AIC3254 CS is a software that must use with AIC3254EVM-K or AIC3254EVM-U. Does the software must generate configure codes with EVM or can it generate codes without EVM?

    3. Our application for AIC3254 is  process a waveform that combines with 4Hz+8Hz+50Hz+128Hz+640Hz. The AIC3254 CS software Stereo AGC has a High Pass Filter.Can we disable it or can it not be used?

    4. If none of those three questions are right. Can we code the MiniDSP manually? Is there a guide manual for coding MiniDSP?

    Finnaly, if it is convenient  for you that you can generate the miniDSP code with our application demand? Here are the codes and settings we need to configure below.

     AGC Target Level Setting -12dB
    AGC Gain Hysteresis is ±0.5dB
    Channel AGC Hysteresis is 1.0dB
    Channel AGC Noise Threshold is -90dB
    Channel AGC Maximum Gain = 47dB
    Channel AGC Attack Time = 25 * 32 ADC Word Clocks,Scale Factor = 16
    Channel AGC Decay Time = 25 * 512 ADC Word Clocks
    Channel AGC Noise Debounce Time = 2^6 ADC Word Clocks
    Channel AGC Signal Debounce Time = 2^0 ADC Word Clocks

    That is  all the questions we confused.

    Thanks again for your kindly help and we appreciate very much for your explanation.

    By the way , we noticed that the guide manual and datasheet do not show what the ADC and DAC resolution of AIC3254 is.Could you please give us an answer about the resolution?

    Best Regards,

    Mark

  • Hi, Mark,

    Please refer to below comments.

    The Stereo AGC implementation is made within the miniDSP with the code of the coefficients I shared before. The GDE as you mention is used to configure the miniDSP with custom blocks, but there is no block available for Stereo AGC. The STAGC_R process flow is created by writing the coefficients on the code I sent to the miniDSP. You can see the process flows as pre-defined configurations of the miniDSP, where each one of them is made by writing the specific coefficients.

    The code required for the Stereo AGC process flow build can be found in the code I attached in my previous response. You can use it as reference and tune the AGC settings as the normal AGC. As you mention, the CS can log the registers written when the EVM is connected, but the code I sent is the one the CS actually uses to configure the EVM in Stereo AGC mode.

    The High-pass filter can be disabled by changing the high-pass filter coefficients from the STAGC_R code and set the filter as all-pass. These coefficients can be found at the beginning of the miniDSP code. For an all-pass filter, you can replace the code with the following coefficients:

    # (Bit 31-24) ------------ MSB ADC COEFF No. 1 (AGC HPF N0)
    > 7F
    # (Bit 23-16)
    > FF
    # (Bit 15-8)
    > FF
    # (Bit 7-0)
    > 00
    # (Bit 31-24) ------------ MSB ADC COEFF No. 2 (AGC HPF N1)
    > 00
    # (Bit 23-16)
    > 00
    # (Bit 15-8)
    > 00
    # (Bit 7-0)
    > 00
    # (Bit 31-24) ------------ MSB ADC COEFF No. 3 (AGC HPF D1)
    > 00
    # (Bit 23-16)
    > 00
    # (Bit 15-8)
    > 00
    # (Bit 7-0)
    > 00
    #

    There is no way to code manually the miniDSP, in order to use the Stereo AGC function with the AIC3254, you need to use the code to create STAGC_R process flow.

    The resolution of ADC and DAC of the AIC3254  is 24-bit.

    Best Regards,

      -Diego Meléndez López
       Audio Applications Engineer

  • Hi,

    Thanks again for your patient reply. It is really kind of your to help us resolve problems.

    I ordered an AIC3254EVM-K board and have received it yesterday. I tried the Stereo AGC function and input 2 channel different amplitude signal  through IN1. The Stereo AGC worked.

    Here I have a new problem.

    The Stereo AGC must work with proper MiniDSP coefs, just like the settings in the AIC3254 CS above.

    I would like to add those MiniDSP coefs into my projects such as the GDE exported format so that I can directly write those parameters to AIC3254 by a host microcontroller via I2C protocol.

    But first of all, GDE does not have the ability to generate codes that set the Stereo AGC as you said before. Secondly, AIC3254 CS software is a DEMO as I see. It can not generate the parameters that we need to set the Stereo AGC.

    So, is there a way to generate MiniDSP codes by GDE or AIC3254 CS to enable and set Stereo AGC? How can I use them or one of them to generate a .h code to combine with my project to write them to AIC3254 by I2C protocol?

    Thanks again for  your reply and we really appreciate that.

    Best Regards,

    Mark

  • Hi, Diego

    Colud you please help us about the problems we met above?

    And here are some other questions about the ADC and DAC resolution of AIC3254.

    1. You said that the ADC and DAC resolution of AIC3254 is 24bit. Does it be mentioned in the Datasheet or Reference Guide? Where can I find the parameter.

    2. The Audio Data Word length in AIC3254 Reference Guide can be set to 16bits/20bits/24bits/32bits in Page 0 / Register 27. Does it have any relationship with the resolution ?

    3. Can the resolution of AIC3254 be set in any register? If it can be set, which register should I set?

    Thanks again.

    Best Regards,

    Mark

  • Hi,Diego 

    Here is an easy GDE project with AIC3254. How can we add a 2 channel Stereo AGC by modify the projects or add the MiniDSP code?

    Thanks.

    Best Regards,

    Mark

  • Hi, Mark,

    As I mentioned before, the Stereo AGC works like a process flow, so it is not compatible with miniDSP use in the GDE. The code I shared before can be used to create the Stereo AGC process flow, you would need to change the format to be compliant with the .h file you mention.

    You may be able to create a custom stereo AGC application with PurePath Studio, however, the operation and control will be different to the STAGC_R (Stereo AGC processing block)  we are already discussing.

    The easiest way to implement the STAGC_R processing block in your end system would be to take the code I shared, then use a text editor to change the format used to the same as the driver file you need, then, load the custom AGC parameters for your configuration and make any adjustment on the codec routing and clock settings to make it compliant with your system.

    Best Regards,

      -Diego Meléndez López
       Audio Applications Engineer

  • Hi, Diego

    Thanks for your kind reply and we have made it work with Stereo AGC and it works well.

    Here we meet another problem.

    We have two separate driver codes, which are the codes of Stereo AGC  and the codes of normal AGC. But our cpu has small space to storage the codes.

    So how can we switch from one to another ? For example, how can we switch from Stereo AGC to Normal AGC or from Normal AGC to Stereo AGC?

    Is there any switch  codes or register settings?

    Thanks again for your help in advance.

    Best Regards,

    Mark

  • Hi, Mark,

    The Stereo AGC process flow is built on the miniDSP of the device. In order to switch to a mono AGC, you may try to configure the device with one of the defined processing blocks and configure the normal AGC as desired.

    The process to switch from Stereo to normal AGC  would be:

    1. Mute ADC
    2. Turn ADC Off
    3. Change processing from miniDSP to processing block
    4. Configure AGC
    5. Turn ADC ON
    6. Unmute ADC

    And from normal to Stereo AGC:

    1. Mute ADC
    2. Turn ADC Off
    3. Change processing from processing block to miniDSP
    4. Load miniDSP coefficients
    5. Configure AGC
    6. Turn ADC ON
    7. Unmute ADC

    Best Regards,

      -Diego Meléndez López
       Audio Applications Engineer

  • Hi Diego,

    Thanks for your help and we still have 2 questions need your help.

    1.You said that the resolution of ADC and DAC of AIC3254 is 24 bits. Do you confirm with that? We do not find any description in datasheet.

    Can it be set through register settings or it is a fixed parameter that do not need to set?

    2. The Page 0 /Register 27 Audio Interface Setting Register said that Audio Data Word length can be set to 16 bits/20 bits/24 bits/32 bits.

    Does it have any relationship with the resolution? If  I set it to 32 bits,how does it turn to 32 bits from the resolution (24 bits)? In other words, what is made of the Audio Data Word length?

    Thanks.

    Best Regards,

    Mark

    Audio Interface Setting Register

  • Hi Diego, Thanks for your help and we still have 2 questions need your help. 1.You said that the resolution of ADC and DAC of AIC3254 is 24 bits. Do you confirm with that? We do not find any description in datasheet. Can it be set through register settings or it is a fixed parameter that do not need to set? 2. The Page 0 /Register 27 Audio Interface Setting Register said that Audio Data Word length can be set to 16 bits/20 bits/24 bits/32 bits. Does it have any relationship with the resolution? If I set it to 32 bits,how does it turn to 32 bits from the resolution (24 bits)? In other words, what is made of the Audio Data Word length? Thanks. Best Regards, Mark
  • Mark,

    I have to correct, the resolution of this codec is 32-bit, it is fixed from the ADC and DAC operation point of view, where the digital data output is stored in either 16, 20, 24 or 32 bits accordingly.  

    Best Regards,

      -Diego Meléndez López
       Audio Applications Engineer