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.

Compiler/TLV320AIC3254: TLV320AIC3254: 8khz 8 bit mono configurations

Part Number: TLV320AIC3254

Tool/software: TI C/C++ Compiler

Hello, TI !
Please help me
I use the example of the WiFi audio App, I need to change the configuration of the audio codec. The sound that I'm trying to reproduce has parameters of 8 KHz 8 bit mono.
I tried to use these parameters:

PLL_J = 40
PLL_R = 6
PLL_P = 1
PLL_D = 0

NDAC = 12
MDAC = 10
DOSR = 128

NADC = 12
MADC = 10
AOSR = 128

With these parameters, I can hear sound with a 16 kHz descritisation frequency, but I cannot hear sound with a 8 kHz descritisation frequency. Instead of 8 kHz sound, I hear a nasty noise. I'm trying to reproduce the 8 bit 8 kHz mono sound and I use this audio codec configuration:
audiocodec.c:

int AudioCodecConfig(unsigned char codecId, unsigned char bitsPerSample, unsigned short bitRate,
                      unsigned char noOfChannels, unsigned char speaker,  unsigned char mic)
{
    unsigned int    bitClk = 0;

    if(codecId == AUDIO_CODEC_TI_3254)
    {
        AudioCodecPageSelect(TI3254_PAGE_0);

        if(bitsPerSample == AUDIO_CODEC_8_BIT)  //AUDIO_CODEC_16_BIT
        {
            // Set I2S Mode and Word Length
            AudioCodecRegWrite(TI3254_AUDIO_IF_1_REG, 0x00);    
                                                                
        }
        else
        {
            return -1;
        }

        bitClk = 64000;
        if(bitClk == 64000) //512000
        {
            AudioCodecPageSelect(TI3254_PAGE_0);

            AudioCodecRegWrite(TI3254_CLK_MUX_REG, 0x03);       // PLL Clock is CODEC_CLKIN 0x03 
            AudioCodecRegWrite(TI3254_CLK_PLL_P_R_REG, 0x96);   // PLL is powered up, P=1, R=6
            AudioCodecRegWrite(TI3254_CLK_PLL_J_REG, 0x28);     // J=40
            AudioCodecRegWrite(TI3254_CLK_PLL_D_MSB_REG, 0x00); // D = 0

            AudioCodecRegWrite(TI3254_CLK_NDAC_REG, 0x8C);      // NDAC divider powered up, NDAC = 12 
            AudioCodecRegWrite(TI3254_CLK_MDAC_REG, 0x8A);      // MDAC divider powered up, MDAC = 10 
            AudioCodecRegWrite(TI3254_DAC_OSR_MSB_REG, 0x00);   // DOSR = 0x0080 = 128
            AudioCodecRegWrite(TI3254_DAC_OSR_LSB_REG, 0x80);   // DOSR = 0x0080 = 128

            AudioCodecRegWrite(TI3254_CLK_NADC_REG, 0x8C);      // NADC divider powered up, NADC = 12 
            AudioCodecRegWrite(TI3254_CLK_MADC_REG, 0x8A);      // MADC divider powered up, MADC = 10
            AudioCodecRegWrite(TI3254_ADC_OSR_REG, 0x80);       // AOSR = 128 ((Use with PRB_R1 to PRB_R6, ADC Filter Type A)
        }
        else
        {
            return -1;
        }


        // Configure Power Supplies
        AudioCodecPageSelect(TI3254_PAGE_1);        //Select Page 1

        AudioCodecRegWrite(TI3254_PWR_CTRL_REG, 0x08);  // Disabled weak connection of AVDD with DVDD
        AudioCodecRegWrite(TI3254_LDO_CTRL_REG, 0x01);  // Over Current detected for AVDD LDO
        AudioCodecRegWrite(TI3254_ANALOG_IP_QCHRG_CTRL_REG, 0x32); // Analog inputs power up time is 6.4 ms
        AudioCodecRegWrite(TI3254_REF_PWR_UP_CTRL_REG, 0x01);   // Reference will power up in 40ms when analog blocks are powered up

main:

AudioCodecReset(AUDIO_CODEC_TI_3254, NULL);                                          // Configure Audio Codec
AudioCodecConfig(AUDIO_CODEC_TI_3254, AUDIO_CODEC_8_BIT, 8000,
                     AUDIO_CODEC_MONO, AUDIO_CODEC_SPEAKER_ALL,
                     AUDIO_CODEC_MIC_NONE)

i2s_if.c:

void AudioCaptureRendererConfigure(unsigned char bitsPerSample,
                                    unsigned short bitRate,
                                    unsigned char noOfChannels,
                                    unsigned char RxTx,
                                    unsigned char   dma)
{
    unsigned long   bitClk;

    bitClk = bitsPerSample * bitRate * noOfChannels;

    if(dma)
    {
        if(bitsPerSample == 8)
        {
            MAP_PRCMI2SClockFreqSet(5120000);
            MAP_I2SConfigSetExpClk(I2S_BASE,5120000,512000,I2S_SLOT_SIZE_16|
                                    I2S_PORT_DMA);
        }
    }

    if(RxTx == I2S_MODE_RX_TX)
    {
        MAP_I2SSerializerConfig(I2S_BASE,I2S_DATA_LINE_1,I2S_SER_MODE_RX,
                                 I2S_INACT_LOW_LEVEL);
    }

    if(RxTx & I2S_MODE_TX)
    {
        MAP_I2SSerializerConfig(I2S_BASE,I2S_DATA_LINE_0,I2S_SER_MODE_TX,
                                 I2S_INACT_LOW_LEVEL);
    }

}

here all the changes I made to complete the task.  But every time I hear a 16 bit 16 kHz stereo sound, instead of the 8 bit 8 kHz mono I need. What could be the problem, any advice will help me

Thank you for your help.

George

  • Hi, Georgiy,

    Sorry for the delayed response. In order to understand your problem, I would like to know what is the expected digital output format for you, because this part cannot stream only one channel of data,  and also does not support 8-bit data size. I can see a problem in your setup as the bit clock is running at 64KHz, which is 8×Fs; this ratio is not  supported by the device, bit clock should be at least 32×Fs.

    The PLL coefficients are correct for the internal clock generation for an 8KHz application assuming a 512KHz MCLK is provided to the codec.

    Best Regards,

      -Diego Meléndez López
       Audio Applications Engineer

  • Thanks for your answer, can you tell me which device from TI supports the format I need? 
    8000 Hz 8000 bit mono

    George.

  • Hi, Georgiy,

    Unfortunately we don't have a device which supports an 8-bit mono digital signal. It may be possible to use the AIc3254 in 16-bit mode, as long as you adjust properly the bit clock to be at least 32×Fs.

    Best Regards,

      -Diego Meléndez López
       Audio Applications Engineer