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.

CCS/TLV320AIC3106: Register settings for microphone bypassing to speaker

Part Number: TLV320AIC3106
Other Parts Discussed in Thread: CC3200,

Tool/software: Code Composer Studio

Hi,

I am using TLV320AIC3106 with CC3200. Microphone configuration is completed and I am getting data out from the CODEC IC through I2S. Now I am need to out this data to speaker to validate the microphone input. What are the configuration needed for doing that?

This is the microphone configuration. 

AudioCodecPageSelect((unsigned char )0x00);
    AudioCodecRegWrite((unsigned char) CODEC_SW_RESET, codecPage0Regs.SW_RESET);
    // clock generation and control
    AudioCodecRegWrite((unsigned char) CODEC_CLOCK_GENERATION_CONTROL, (unsigned char) 0x02); // CODEC_CLKIN uses MCLK(CLKDIV_OUT)
    AudioCodecRegWrite((unsigned char) CODEC_ADDITIONAL_GPIO_CONTROL_B, (unsigned char)0x01);
    //   AudioCodecRegWrite((unsigned char) CODEC_PLL_A, 0x91);// CODEC_PLL_A_RESETVAL);
 //   AudioCodecRegWrite((unsigned char) CODEC_PLL_B, 0x60); // J value 24
 //   AudioCodecRegWrite((unsigned char) CODEC_PLL_C, 0x09);
 //   AudioCodecRegWrite((unsigned char) CODEC_PLL_D, 0x00);

    AudioCodecRegWrite((unsigned char) CODEC_GPIO1_CONTROL,  0x28);   // clock out on gpio1 pin

    AudioCodecRegWrite((unsigned char) CODEC_SAMPLE_RATE,0xAA);//0xAA);  // fs = fsref/n

    AudioCodecRegWrite((unsigned char) CODEC_MIC_BIAS_CONTROL,  0x80);// (unsigned char)0xC0);  // MIC bias

    //When selecting an input, unmute the PGAs after routing the input and powering up the ADC.
    AudioCodecRegWrite((unsigned char) CODEC_LINE2L_LEFT_ADC_CONTROL, 0x80);
    AudioCodecRegWrite((unsigned char) CODEC_LINE1L_LEFT_ADC_CONTROL, 0x7C);  // power up left ADC
    AudioCodecRegWrite((unsigned char) CODEC_LEFT_ADC_PGA_GAIN_CONTROL, 0x00); // unmute PGA

Below is the schematic attached.

Thanks & regards,

Vishnu Pradeep

  • Hi, Vishnu,

    Basically, if you are willing just to playback the mic input through the speaker output, you can configure the LINE2L Bypass [Reg 40] and then select LINE2L as the source for the MONO_LOP output [Reg  73].

    I have asked my colleague to take a look to this in case you have additional questions. 

    Best Regards,

      -Diego Meléndez López
       Audio Applications Engineer

  • Hi Diego,

    Thanks for the reply. Actually my application needs to playback the data received serially from external source. But now I need to check whether the mic and speaker is properly working.

    I will check with the registers you've mentioned.
    Can you please help me out with my main requirement, that is , data received through I2S have to play through speaker connected as in schematic.

    Thanks & regards,
    Vishnu Pradeep
  • Hi, Vishnu,

    Thanks for the feedback. In order to configure the DAC  as the source of the MONO_LOP output, you need to configure either Registers 75 or 78, according to the DAC channel. 

    I would recommend you to take a look to this app note, it features general guidelines about how to configure the codecs of the TLV320AIC310x family.

    Best Regards,

      -Diego Meléndez López
       Audio Applications Engineer

  • Hi Diego,

    This is my configuration,

    AudioCodecRegWrite((unsigned char) CODEC_CLOCK_GENERATION_CONTROL, (unsigned char) 0x02); // CODEC_CLKIN uses MCLK(CLKDIV_OUT)
    
       AudioCodecRegWrite((unsigned char) CODEC_ADDITIONAL_GPIO_CONTROL_B, (unsigned char)0x01);
    
       //   AudioCodecRegWrite((unsigned char) CODEC_PLL_A, 0x91);// CODEC_PLL_A_RESETVAL);
    
    //   AudioCodecRegWrite((unsigned char) CODEC_PLL_B, 0x60); // J value 24
    
    //   AudioCodecRegWrite((unsigned char) CODEC_PLL_C, 0x09);
    
    //   AudioCodecRegWrite((unsigned char) CODEC_PLL_D, 0x00);
    
       AudioCodecRegWrite((unsigned char) CODEC_GPIO1_CONTROL,  0x28);   // clock out on gpio1 pin
    
       AudioCodecRegWrite((unsigned char) CODEC_SAMPLE_RATE,0x00);//0xAA);  // fs = fsref/n
    
       AudioCodecRegWrite((unsigned char) CODEC_MIC_BIAS_CONTROL,  0x80);// (unsigned char)0xC0);  // MIC bias
    
       //When selecting an input, unmute the PGAs after routing the input and powering up the ADC.
    
       AudioCodecRegWrite((unsigned char) CODEC_LINE2L_LEFT_ADC_CONTROL, 0x80);
    
       AudioCodecRegWrite((unsigned char) CODEC_LINE1L_LEFT_ADC_CONTROL, 0x7C);  // power up left ADC
    
       AudioCodecRegWrite((unsigned char) CODEC_LEFT_ADC_PGA_GAIN_CONTROL, 0x00); // unmute PGA
    
       //================================================================= Speaker configurations
    
       // ==== bypass
    
       AudioCodecRegWrite((unsigned char)CODEC_HIGH_POWER_OUTPUT_STAGE_CONTROL,0x30);
    
       AudioCodecRegWrite((unsigned char)CODEC_LINE2L_MONO_LOPM_VOLUME_CONTROL,0x80);

    AudioCodecRegWrite((unsigned char)CODEC_MONO_LOPM_OUTPUT_LEVEL_CONTROL,0x0B);

    I am not getting anything in speaker.

    Thanks & regards,

    Vishnu Pradeep

  • Hi, Vishnu,

    Thanks for the feedback. The Mono Line Output seems to be correctly routed, however, it seems the output driver block is not turned ON. Please configure register 79 to unmute and turn ON MONO_LOP/M by writing a 0x09 to reg. 79.  (note that bit D0 should be R/W).

    Best Regards,

      -Diego Meléndez López
       Audio Applications Engineer

  • Hi Diego,


    Thanks for the response. I've configured register 79 also with 0x0B value and still no result! I'll take a look into the circuit and check again.

    Regards,
    Vishnu Pradeep
  • Hi Diego,

    Now I got the signal bypassed. But I couldn't make it work with external data sending through I2S. I am tring to playback the sound with the same data I am getting from the hardware codec in I2S. I tried to send back the 16 bit data back to audio codec through I2S with the below settings.

      AudioCodecPageSelect((unsigned char )0x00);
        AudioCodecRegWrite((unsigned char) CODEC_SW_RESET, codecPage0Regs.SW_RESET);
        // clock generation and control
        AudioCodecRegWrite((unsigned char) CODEC_CLOCK_GENERATION_CONTROL, (unsigned char) 0x02); // CODEC_CLKIN uses MCLK(CLKDIV_OUT)
        AudioCodecRegWrite((unsigned char) CODEC_ADDITIONAL_GPIO_CONTROL_B, (unsigned char)0x01);
        //   AudioCodecRegWrite((unsigned char) CODEC_PLL_A, 0x91);// CODEC_PLL_A_RESETVAL);
     //   AudioCodecRegWrite((unsigned char) CODEC_PLL_B, 0x60); // J value 24
     //   AudioCodecRegWrite((unsigned char) CODEC_PLL_C, 0x09);
     //   AudioCodecRegWrite((unsigned char) CODEC_PLL_D, 0x00);
    
        AudioCodecRegWrite((unsigned char) CODEC_GPIO1_CONTROL, 0x28);// 0x28);   // clock out on gpio1 pin
    
        AudioCodecRegWrite((unsigned char) CODEC_SAMPLE_RATE,0x00);//0xAA);  // fs = fsref/n
    
        AudioCodecRegWrite((unsigned char) CODEC_MIC_BIAS_CONTROL, 0xC0);// (unsigned char)0xC0);  // MIC bias
    
        //When selecting an input, unmute the PGAs after routing the input and powering up the ADC.
        AudioCodecRegWrite((unsigned char) CODEC_LINE2L_LEFT_ADC_CONTROL, 0x80);
        AudioCodecRegWrite((unsigned char) CODEC_LINE1L_LEFT_ADC_CONTROL, 0x7C);  // power up left ADC
        AudioCodecRegWrite((unsigned char) CODEC_LEFT_ADC_PGA_GAIN_CONTROL, 0x00); // unmute PGA
    
    AudioCodecRegWrite((unsigned char)CODEC_DAC_POWER_OUTPUT_DRIVER_CONTROL,0x80);
        AudioCodecRegWrite((unsigned char)CODEC_LEFT_DAC_DIGITAL_VOLUME_CONTROL,0x00);
        AudioCodecRegWrite((unsigned char)CODEC_DACL1_MONO_LOPM_VOLUME_CONTROL,0x80);

    Is there anything that I am missing in configuration??

    thanks & regards,

    Vishnu Pradeep