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.

TLV320AIC3204: Script to use headphone Mic

Part Number: TLV320AIC3204

Hello team,

I have designed a board with headphone jack:

- jack connector (SJ-43514-SMT-TR) mic line connected to IN3R/SCLK

I want to use the headset mic. with my current configuration I'm not able to get any sound recorded

My configuration:

S/w reset

NDAC=1  MDAC = 2

ADC OSR = 128

PRB_R4

Using internal ALDO

I/P common mode 0.9v

PTM R4

MICPGA delay 3.1

REF chg time 40ms

IN3R is routed to Right MICPGA with 20k resistance

CM is routed to Right MICPGA via CM1R with 20k resistance

Unmute Right mic

power up ADC

Unmute digital volume ctrl

Can you please help me with the configuration?

  • Yogesh, 

    The EVM GUI has presets that can guide you here.  Here is the script from the EVM it can help to guide your configuration. 

    I noticed a couple things:

    1.  The master analog power control is not enabled

    2. Micbias is not enabled. This may not matter for your situation, if you are using a MEMS mic or providing bias another way. but just in case. 

    best regards,

    -STeve Wilson

    ###############################################
    # On-Board Differential Microphone
    # ---------------------------------------------
    # PowerTune mode PTM_R4 is used for high
    # performance 16-bit audio. 
    #
    # For normal USB Audio, no hardware change
    # is required.
    #
    # If using an external interface, SW2.4 and
    # SW2.5 of the USB-ModEVM must be set to
    # HI and clocks can be connected to J14 of
    # the USB-ModEVM.
    #
    # IN3L/R is are routed differentially to the
    # LADC.
    ###############################################
    
    
    
    ###############################################
    # Software Reset
    ###############################################
    #
    # Select Page 0
    w 30 00 00
    #
    # Initialize the device through software reset
    w 30 01 01
    #
    ###############################################
    
    
    
    ###############################################
    # Clock Settings
    # ---------------------------------------------
    # The codec receives: MCLK = 11.2896 MHz,
    # BLCK = 2.8224 MHz, WCLK = 44.1 kHz
    ###############################################
    #
    # Select Page 0
    w 30 00 00
    #
    # NADC = 1, MADC = 2
    w 30 12 81 82
    #
    ###############################################
    
    
    
    ###############################################
    # Signal Processing Settings
    ###############################################
    #
    # Select Page 0
    w 30 00 00
    #
    # Set the ADC Mode to PRB_P1
    w 30 3d 01
    #
    ###############################################
    
    
    
    ###############################################
    # Initialize Codec
    ###############################################
    #
    # Select Page 1
    w 30 00 01
    #
    # Disable weak AVDD in presence of external
    # AVDD supply
    w 30 01 08
    #
    # Enable Master Analog Power Control
    w 30 02 00
    #
    # Select ADC PTM_R4
    w 30 3d 00
    #
    # Set the input powerup time to 3.1ms (for ADC)
    w 30 47 32
    #
    # Set the REF charging time to 40ms
    w 30 7b 01
    #
    ###############################################
    
    
    
    ###############################################
    # Recording Setup
    ###############################################
    #
    # Select Page 1
    w 30 00 01
    #
    # Powerup MIC BIAS
    w 30 33 40
    #
    # Route IN3L to LEFT_P with 10K input impedance
    w 30 34 04
    #
    # Route IN3R to LEFT_M with 10K input impedance
    w 30 36 04
    #
    # Unmute Left MICPGA
    w 30 3b 00
    #
    # Unmute Right MICPGA
    w 30 3c 00
    #
    # Select Page 0
    w 30 00 00
    #
    # Power up LADC/RADC
    w 30 51 c0
    #
    # Unmute LADC/RADC
    w 30 52 00
    #
    ###############################################
    

  • Hello Wilson,

    I'm using Internal ALDO

    for that my configuration:

    # Configure Power Supplies

    ###############################################

    #

    # Select Page 1

    w 30 00 01

    #

    # Power up AVDD LDO

    w 30 02 09

    #

    # Disable weak AVDD in presence of external

    # AVDD supply

    w 30 01 08

    #

    # Enable Master Analog Power Control

    # Power up AVDD LDO

    w 30 02 01

    #

    # Set full chip common mode to 0.9V

    # HP output CM = 1.65V

    # HP driver supply = LDOin voltage

    # Line output CM = 1.65V

    # Line output supply = LDOin voltage

    w 30 0A 3B

    #

    # Select ADC PTM_R4

    w 30 3d 00

    #

    # Select DAC PTM_P3/4

    w 30 03 00 00

    #

    # Set the input power-up time to 3.1ms (for ADC)

    w 30 47 32

    #

    # Set the REF charging time to 40ms

    w 30 7b 01

    And I'm using the headphone microphone 

    # Set MicPGA startup delay to 3.1ms
    w 30 47 32
    # Set the REF charging time to 40ms
    w 30 7b 01
    # Route IN3R to RIGHT_P with input impedance of 20K
    w 30 37 08
    # Route Common Mode to RIGHT_M with impedance of 20K
    w 30 39 80
    # Unmute Left MICPGA, Gain selection of 6dB to make channel gain 0dB
    # Register of 6dB with input impedance of 20K => Channel Gain of 0dB
    w 30 3b 0c
    # Unmute Right MICPGA, Gain selection of 6dB to make channel gain 0dB
    # Register of 6dB with input impedance of 20K => Channel Gain of 0dB
    w 30 3c 0c
    # Select Page 0
    w 30 00 00
    # Power up Left and Right ADC Channels

    w 30 51 c0
    # Unmute Left and Right ADC Digital Volume Control.
    w 30 52 00

  • My complete code

    # Initialize to Page 0
    w 30 00 00
    # S/W Reset to initialize all registers
    w 30 01 01
    # Power up NADC divider with value 1
    w 30 12 81
    # Power up MADC divider with value 2
    w 30 13 82
    # Program OSR for ADC to 128
    w 30 14 80
    # Select ADC PRB_R1
    w 30 3d 01

    # Select Page 1

    w 30 00 01

    # Power up AVDD LDO

    w 30 02 09

    # Disable weak AVDD in presence of external

    # AVDD supply

    w 30 01 08

    # Enable Master Analog Power Control

    # Power up AVDD LDO

    w 30 02 01

    # Set full chip common mode to 0.9V

    # HP output CM = 1.65V

    # HP driver supply = LDOin voltage

    # Line output CM = 1.65V

    # Line output supply = LDOin voltage

    w 30 0A 3B

    # Select ADC PTM_R4

    w 30 3d 00

    # Set the input power-up time to 3.1ms (for ADC)

    w 30 47 32

    # Set the REF charging time to 40ms

    w 30 7b 01

    # Set MicPGA startup delay to 3.1ms
    w 30 47 32
    # Set the REF charging time to 40ms
    w 30 7b 01
    # Route IN3R to RIGHT_P with input impedance of 20K
    w 30 37 08
    # Route Common Mode to RIGHT_M with impedance of 20K
    w 30 39 80
    # Unmute Left MICPGA, Gain selection of 6dB to make channel gain 0dB
    # Register of 6dB with input impedance of 20K => Channel Gain of 0dB
    w 30 3b 0c
    # Unmute Right MICPGA, Gain selection of 6dB to make channel gain 0dB
    # Register of 6dB with input impedance of 20K => Channel Gain of 0dB
    w 30 3c 0c
    # Select Page 0
    w 30 00 00
    # Power up Left and Right ADC Channels

    w 30 51 c0
    # Unmute Left and Right ADC Digital Volume Control.
    w 30 52 00

  • I'm still not able to record any audio after using the above configuration.

    I'm connecting the microphone to IN3_R, I think the problem is with the -ve terminal of the microphone, 

    I'm routing IN3_R to right mic positive, I don't know how to route right mic negative terminal.

  • Yogesh, 

    can you detail how you are setting up your computer to record audio?  I am able to record audio with the script provided.

    -Steve