TLV320AIC3101: ESP32 S3 With this Codec

Part Number: TLV320AIC3101

Tool/software:

Hi!

I have been developing a product for a while now and I have been recommended the Texas Instruments Codec TLV320AIC3101IRHBR. Unfortunately, I have never programmed a codec like this and am a little confused. I have ordered many boards with this and just need some help getting it going. This is connected to an ESP32S3 and I put the pins below. Basically, I need to know how to initialize this and send audio through I2S to it. The outputs of this are connected to a PAM8403 amp. This is only going to play mp3 at 44.1k in stereo. But I am not sure what things need to be initialized. I also have a potentiomter connected I want to use the ADC to control the volume. I have put the pins below. Can someone help me?

I2C_SDA = IO15
I2C_SCL = IO12
I2S_DOUT = IO17
I2S_DIN = IO18
I2S_WCLK = IO19
I2S_BCLK = IO20
I2S_MCLK = IO21
Potentiometer A0 = IO1

  • Hi,

    To set the registers to get your audio routing initialized, I would recommend using the EVM GUI software to generate I2C commands. You can download it from the EVM page, it is the software called "SLAC249": https://www.ti.com/tool/TLV320AIC3101EVM-K

    From the software's DAC preset for stereo playback to the line outs, here is the script that it gives:
    w 30 07 8A
    w 30 66 A0
    w 30 25 C0
    w 30 29 02
    w 30 2B 00
    w 30 52 80
    w 30 5C 80
    w 30 4B 80
    w 30 4E 80
    w 30 56 09
    w 30 5D 09
    w 30 4F 09

    You can further specify the clocks that you want to use with the GUI, which will generate the I2C you need in the Command Line Interface tab.

    As for the potentiometer into the ADC, I would recommend using an ADC on your ESP32 and then changing the volume of the DAC with I2C. You can change the digital volume of the DAC with page 0/register 43, specified in Table 49 in the datasheet.

    Let me know if you need more help or explanation!

    Best,
    Mir