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.

TLV320AIC3104-Q1: Register Programming Sequence for Cellular+stereo headset connection

Part Number: TLV320AIC3104-Q1
Other Parts Discussed in Thread: TLV320AIC3104

Hello,

I'm using the TLV320AIC3104 audio convertor in one of my project. The audio convertor is connected to a Quectel EC21 Modem. Please find attached the schematic below. 

The Quectel EC21 ouputs digital audio (PCM) and controls the TLV320AIC3104 with I2C. I'm trying to get the I2S mode working, but not having much success so far. Here are the steps I followed. 

Parameters for the digital audio are as follows

BCLK=2048k

WCLK=8k

Quectel EC21 is the master and the TLV320AIC3104 the slave. 

I need fs(ref)=8ksps, where CODEC_CLK=256 fs(ref)

I'm not using the PLL, I'm just using the Clock Divider with Q=2.

BCLK is the  MCLK = 2048k

fs(ref)=2048k/(128x2)=8k which is equal to the WCLK. 

1) Check if I2C is working. I wrote the required values to register 25 to change the MIC BIAS voltage and checked with a multimeter and it works. So I've ruled out any issues with I2C.

2) Here is the register programming sequence I followed. 

  1. Software Reset by writing to register 1
  2. Leave Register 3 at RESET state, nothing to be changed here.
  3. Write value x82 to Register 102 to set CLKDIV_IN as BCLK.
  4. Write value 0x01 to Register 101 to set 'CODEC_CLKIN uses CLKDIV_OUT'
  5. No changes to Register 8 and Register 9, leave at default
  6. Register 17 = 0x0F,Route MIC2L to the Left ADC
  7. Register 18 = 0x0F,Route MIC2R to the Right ADC
  8. Register 40 = 0x40, Output Common-Mode Voltage Control=1.5V
  9. Register 25 = 0x80, MICBIAS as 2.5V
  10. Register 19= 0x7C, Power up Left ADC 
  11. Register 22= 0x7C, Power up Right ADC
  12. Register 15 = 0x00 Unmute left PGA
  13. Register 16 = 0x00 Unmute right PGA
  14. Register 7 = 0x0A, Route Left data to Left DAC, Route Right data to Right DACc
  15. Register 37=0xC0, Power up Left and Right DAC
  16. Register 43 = 0x00, Unmute Left digital volume control, set gain to 0 dB
  17. Register 44 = 0x00, Unmute Right digital volume control, set gain to 0 dB
  18. Register 47 = 0x80, DAC_L1 to HPLOUT Volume Control Register
  19. Register 51 = 0x0F, HPLOUT Output Level Control
  20. Register 64 = 0x80, DAC_R1 to HPROUT Volume Control Register
  21. Register 65 = 0x0F, HPROUT Output Level Control

What am I missing here?

3) Quectel EC21 provides an audio loop function where it loops input from the MIC into the earphones, when I turn it on, I'm able hear a buzz meaning the DAC is powered on, however, the mic doesn't pick up my voice at all. 

Is there any other method to test the playback and record feature using just I2C?

4) What do I with Register 37 and 38? Should some changes be made to those registers?

5) The headset detection does not seem to be working. I've checked the contents of Register 14, but no change. I tried settings bit D3=1 and checked if headset removal insert was being detected, still no change. No change to the register value of Register 96 either.

6) The audio codec is also heating up. I believe this maybe due to the HPRCOM/HPLCOM GND connection . Is that the reason? 

Thank you for your help!

  • Hi Pradeep,

    Thanks for providing SCH and register configuration for AIC3104. I'll review the same and will have all the questions answered after going thro the same.

    Best regards,

    Ravi

  • Hello Ravi,

    Thank you very much, looking forward to hearing from you again!

    Best Regards,
    Pradeep
  • Hello Ravi,

    I'm going nuts trying to get this codec working, please do show me a way out soon :)

    I've tried routing the DAC_L2 and DAC_R2 directly to the HPRLOUT and HPROUT output ports. No change. I can still hear some noise but not at all what I'm saying on the MIC. 

    I'm assuming the problem isn't the DAC but rather the ADC settings. Maybe the input at the mic isn't being converted to digital properly. Have I missed some settings here?

    Should I try setting the clock rates using the PLL instead of just using the Clock Divider with Q=2?

    Or have I made an error with the hardware?

    This is the configuration I used to connected the cellular headset audio jack to the audio codec. 

    Since the g of the headset is connected to ground, I connected HPRCOM and HPLCOM to analog ground.

    ---

    Does the TLV320AIC3104 have any functionality where it bypasses the ADC conversion and simply routes analog data from the mic to the headphones? I could, with such a function establish that it isn't a hardware issue.

    We are running out of time, hope to hear from TI soon.

  • Hi Pradeep,
    Please see my comments below -

    2. Evaluating the register config seems correct, but need to test the same on the EVM. I will do the same and will let you know if any corrections
    needed.

    3. I can configure the EVM for the same and will share the configuration.

    5. Regarding headphone detection, please refer to the app note linked below -
    www.ti.com/.../slaa454.pdf

    6. The thermal issue is related to HPLCOM/HPRCOM being tied to GND. Please disconnect the pins and you should be able to resolve the issue.
    You can also try ry configuring the HPLCOM and HPRCOM outputs as independent single-ended outputs (Page 0 / Register 37-38) and power down
    these outputs (Page 0 / Register 58 & 72).

    Best regards,
    Ravi
  • Hello Ravi,

    Thank you for your reply. 

    Ravi Patil said:
    Hi Pradeep,
    Please see my comments below -

    2. Evaluating the register config seems correct, but need to test the same on the EVM. I will do the same and will let you know if any corrections
    needed.

    3. I can configure the EVM for the same and will share the configuration.

    That would be a huge favour, thank you. 

    Ravi Patil said:

    6. The thermal issue is related to HPLCOM/HPRCOM being tied to GND. Please disconnect the pins and you should be able to resolve the issue.
    You can also try ry configuring the HPLCOM and HPRCOM outputs as independent single-ended outputs (Page 0 / Register 37-38) and power down
    these outputs (Page 0 / Register 58 & 72).

    I have tried programming the HPLCOM and HPRCOM as single ended outputs, and powered them down. I only hear random noise! 

    Thanks again for your time.

  • Hello Ravi,

    I've finally been able to find the error. It was with pins of the headphone jack where I'd swapped the AGND with the MIC. Changed it now and it works as it should. I'm only able to hear mono audio now, however I guess that it's another hardware issue and not software. 

    Thanks for your assistance.