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.

TLV320AIC3212EVM-U: TLV320AIC3212EVM-U

Part Number: TLV320AIC3212EVM-U

Hi,

I am using CodecControl Application to control the TLV320AIC3212EVM-U module. TI has provided some example scripts for controlling mic, headset speakers, headset mic etc.

But I need the script to control the SPKLP, SPKLM, SPKRM, SPKRP (basically the Handsfree Speaker  output). Please provide a script.

Thanks!

  • Hi Vishal,

    Please refer to section 4.4 Stereo Class-D Speakers Example Scripts of the Applications Reference Guide for I2S in to speaker out configuration.

    The ARG has other Class-D use case scripts as well.

    #########################################################################################
    # Class-D Speaker Playback, 48kHz Sampling Rate
    # AVDDx_18, HVDD_18, CPVDD_18 = 1.8V; IOVDD, AVDD3_33, RECVDD_33 = 3.3V
    # SLVDD, SRVDD, SPK_V = 5V, DVdd = 1.8V
    # MCLK = 12.288MHz
    # PLL Disabled, DOSR = 128, PRB_P1
    # Audio Serial Interface #1 used with WCLK & BCLK as inputs to the device
    #########################################################################################
    #########################################################################################
    # Software Reset
    #########################################################################################
    w 30 00 00 # Initialize to Page 0
    w 30 7f 00 # Initialize to Book 0
    w 30 01 01 # Initialize the device through software reset
    d 1 # Delay 1 millisecond
    #########################################################################################
    # Power and Analog Configuration
    #########################################################################################
    w 30 00 01 # Select Page 1
    w 30 01 00 # Disable weak AVDD to DVDD connection, make analog supplies available
    w 30 7a 01 # REF charging time = 40ms
    #########################################################################################
    # Clock configuration
    # MCLK = 12.288 MHz, BCLK = 3.072 MHz, WCLK = 48 kHz (slave)
    #########################################################################################
    w 30 00 00 # Select Page 0
    w 30 04 00 # Set DAC_CLKIN as MCLK1 -- default not mandatory to program
    w 30 0b 81 # NDAC = 1
    w 30 0c 82 # MDAC = 2
    w 30 0d 00 80 # Program the OSR of DAC to 128,
    # DAC_FS = DAC_MOD_CLK / DOSR = 6.144MHz / 128 = 48kHz
    #########################################################################################
    # Audio Serial Interface Routing Configuration - Audio Serial Interface #1
    # ASI #1 playback
    #########################################################################################
    w 30 00 04 # Select Page 4
    w 30 01 00 # Audio Serial Interface #1 is set to I2S mode, 16-bit
    w 30 0a 00 # Route ASI#1 WCLK and BCLK to WCLK1 pin and BCLK1 pin
    #########################################################################################
    # Signal Processing Settings
    #########################################################################################
    w 30 00 00 # Select Page 0
    w 30 3c 01 # Set the DAC PRB Mode to PRB_P1
    #########################################################################################
    # Output Channel Configuration
    #########################################################################################
    w 30 00 01 # Select Page 1
    w 30 03 00 # Set PTM mode for Left DAC to PTM_P3 (default, writing here optional)
    w 30 04 00 # Set PTM mode for Right DAC to PTM_P3 (default, writing here optional)
    w 30 16 c3 # Enable DAC to LOL/R routing and power-up LOL/R
    w 30 2E 00 # Route LOL to SPK-Left @ 0dB
    w 30 2F 00 # Route LOR to SPK-Right @ 0dB
    w 30 30 11 # Set Left Speaker Gain @ 6dB, Right Speaker Gain @ 6dB
    w 30 2D 03 # Power-up Stereo Speaker
    w 30 00 00 # Select Page 0
    w 30 3f c0 # Power up the Left and Right DAC Channels
    w 30 40 00 # Unmute the DAC digital volume control

    Best Regards,

  • Yeah this is fine. Thanks.
    Also there is a script for ADC Record IN2L-R but no script for using IN3L-R. Please help in this aspect as well.

    Basically I need a script for Microphone Record through IN3L & IN3R.

    Thanks again!

  • Is this a stereo input on IN3L/IN3R or a differential input on IN3L/IN3R? The configuration will change depending on that.

    Here are some of the registers that you might want to look at:

    MIC BIAS - Book 0 / Page 1 / Register 51:

    Left Channel - Book 0 / Page 1 / Register 52-54

    Right Channel - Book 0 / Page 1 / Register 55-57.

    Best Regards.

  • It is a stereo input. Is there a ready to test script for it?

  • You can use the existing script and route IN3L and IN3R to the Left and Right channels, by setting the following registers

    B0_P1_R52 = 0x04

    B0_P1_R55 = 0x04