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.

TLV320AIC3100: MCU Firmware reference for TLV3200AIC3100

Part Number: TLV320AIC3100

Hi Support team,

I'm trying with a design using MCU to interface with TLV320AIC3100. My application get the audio file from SD card and output to speaker via TLV320AIC3100 part. I did a hardware design follow the datasheet already. For the firmware code, I just found the TLV3200AIC3100 in kernel at below link. Do we have any basic firmware reference using MCU?

https://www.ti.com/product/TLV320AIC3100?utm_source=google&utm_medium=cpc&utm_campaign=asc-null-null-GPN_EN-cpc-pf-google-sa&utm_content=TLV320AIC3100&ds_k=TLV320AIC3100&DCM=yes&gclid=CjwKCAjwi9-HBhACEiwAPzUhHLrV5HphttLZTzCtu4k7wEK0SJHNW18Y4cuHQ_ycekpWSCS5-ZmPURoC1boQAvD_BwE&gclsrc=aw.ds#design-development##software-development

Thanks,

Lam

  • Or Could you give me the details of Initialize Sequence step by step to send audio data from MCU to speaker?

  • AIC3100_Init_Script.txt
    #			--------------------------------------------------------------- page 0 is selected 
    w 30 00 00
    #			 s/w reset
    > 01
    #			 PLL_clkin = BCLK,codec_clkin = PLL_CLK
    w 30 04 07
    > 91
    > 20
    > 00
    > 00
    #			 mode is i2s,wordlength is 16
    w 30 1b 00
    #			 NDAC is powered up and set to 4
    w 30 0b 84
    #			 MDAC is powered up and set to 4
    > 84
    w 30 12 84
    > 84
    #			 DOSR = 128, DOSR(9:8) = 0
    > 00
    #			             DOSR(7:0) = 128
    > 80
    #			 DAC => volume control thru pin disable 
    w 30 74 00
    #			 DAC => drc disable, th and hy
    w 30 44 00
    #			 DAC => 0 db gain left
    w 30 41 00
    #			 DAC => 0 db gain right
    > 00
    #			--------------------------------------------------------------- page 1 is selected
    w 30 00 01
    #			 De-pop, Power on = 800 ms, Step time = 4 ms
    w 30 21 4e
    #			 HPL and HPR powered up
    w 30 1f c2
    #			 LDAC routed to HPL, RDAC routed to HPR
    w 30 23 44
    #			 HPL unmute and gain 1db
    w 30 28 0e
    #			 HPR unmute and gain 1db
    > 0e
    #			 No attenuation on HP
    w 30 24 00
    w 30 25 00
    
    #			 MIC BIAS = AVDD
    w 30 2e 0b
    #			 MICPGA P = MIC 10k
    w 30 30 40
    #			 MICPGA M - CM 10k
    > 40
    #			--------------------------------------------------------------- page 0 is selected
    w 30 00 00
    #			 select DAC DSP mode 11 & enable adaptive filter
    w 30 3c 0b
    w 30 00 08
    w 30 01 04
    w 30 00 00
    #			 POWERUP DAC left and right channels (soft step disable)
    w 30 3f d6
    #			 UNMUTE DAC left and right channels
    > 00
    #			 POWERUP ADC channel
    w 30 51 80
    #			 UNMUTE ADC channel
    > 00
    #			--------------------------------------------------------------- page 1 is selected
    w 30 00 01
    #			 Unmute Class-D Left
    w 30 2a 1c
    #			 Unmute Class-D Right
    w 30 2b 1c
    #			 Power-up Class-D drivers
    w 30 20 c6
    
    

    This is an example of a script that has the I2C Commands that can take a Mic signal and send it to a speaker.

    The best approach is to actually get an evaluation board of the device. There is generally a software that comes with the EVM. This can be used to confirm the I2C Listing needed for a certain function.

    Once done this code can be run through an MCU.

  • Hi Sanjay,

    Thank you for your script. It is very helpful for me, appreciate it.

    Do you have the link for Evaluation board using TLV320AIC3100?

    Do you have the same script to initialize TLV320AIC3100 and send out the example audio data via I2C? Or Could you point me How is it different with the above script which get input audio from Mic?

    One more question about the script to understand clearly:

    # PLL_clkin = BCLK,codec_clkin = PLL_CLK
    w 30 04 07
    > 91
    > 20
    > 00
    > 00

    w 30 04 07 ==> w mean write, 0x30 is the I2C address of TLV320AIC3100, 0x4 is  register 4 address, 0x7 is the value to write to register. Is that right?

    What are the below number meaning???
    > 91 
    > 20
    > 00
    > 00

    Thank you very much for your kindly support! I appreciate it.

    Lam

  • Hi Lam,

    This script is programmed through I2C into the Chip. This sets up the device to connect external pins(Mics)to the ADC and also the Digitized signal is internally routed to a DAC and to an external speaker.

    Some Pins of the Chip also create AUDIO PCM data. This means that there are 4 pins Din,Do, BCLK and LRClk that make the Audio data available in a digital form. These are separate from I2C as the I2C is used only for configuration of the chip 

    Once you load this  script the digital audio is available on the pins i talk about.

    w 30 04 07 ==> w mean write, 0x30 is the I2C address of TLV320AIC3100, 0x4 is  register 4 address, 0x7 is the value to write to register. Is that right?   --Yes perfectly correct

    I am not sure i understand what 91 20 0 0 is. Maybe its something returned when the script executes on the EVM. For the code all lines that have w written to the left are the I2C.

    www.ti.com/.../slau302.pdf

  • Hi Sanjay,

    Thank you for your quick response. I have some comment inline

    "This script is programmed through I2C into the Chip. This sets up the device to connect external pins(Mics)to the ADC and also the Digitized signal is internally routed to a DAC and to an external speaker."

    [Lam Dinh] It mean that after we run the above script, any input from Mic can output directly to Speaker, right?

    "Some Pins of the Chip also create AUDIO PCM data. This means that there are 4 pins Din,Do, BCLK and LRClk that make the Audio data available in a digital form. These are separate from I2C as the I2C is used only for configuration of the chip"

    [Lam Dinh] Are there any difference on initialization by registers when we want to send digital audio data from MCU to TLV320AIC3100 and output directly to speaker by using DIN, BCLK, LRCLK (you mean WCLK???). Could you let me know the details steps or point me to any useful documents?

    Can we send out the digital audio data from MCU by using I2C interface, then output directly to Speaker (not using DIN, DOUT, BCLK, WCLK)? 

    Thank you for your help!

    Lam

  • I shall reply before 30/7

  •  It mean that after we run the above script, any input from Mic can output directly to Speaker, right?

    Sanjay: Yes the signal from the Mic is digitized by ADC then converted back into analog by DAC and driven to speaker

    Are there any difference on initialization by registers when we want to send digital audio data from MCU to TLV320AIC3100 and output directly to speaker by using DIN, BCLK, LRCLK (you mean WCLK???). Could you let me know the details steps or point me to any useful documents?

    Sanjay:   You can refer to the product folder of TLV320AIC3100 on ti.com. You will find the datasheet as well as the GUI software for the evaluation Board. using these 2 recources you can make a custom application that is different from the script I send.

    Can we send out the digital audio data from MCU by using I2C interface, then output directly to Speaker (not using DIN, DOUT, BCLK, WCLK)? 

    Sanjay: I2C interface can not be used to send or receive digital audio. it is for control of registers only

  • Hi Sanjay,

    Thank you for your support. Let me try on it.

    Thanks,

    Lam