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.

wifi_audio_app - problem with AudioCodecRegWrite function

Other Parts Discussed in Thread: TLV320AIC3254

Hi everybody

In the wifi_audio_app, I'm using the AudioCodecRegWrite function to program codec registers. As you can see, this function read the registers after write it, and I can observe that some registers (not protected) the read value is different than the write value (like 4th, 5th or 6th register in Page 0, this is MDAC and DAC OSR registers). Why?

 I read values written into the write function, with the next code:

//******************************************************************************
//
// Writes to specfied register
// ulRegAddr - Register Address
// ucRegValue - 8 bit Register Value
//
//******************************************************************************
static unsigned long AudioCodecRegWrite(unsigned char ulRegAddr,unsigned char ucRegValue)
{
    unsigned char ucData[2];
    ucData[0] = (unsigned char)ulRegAddr;
    ucData[1] = ucRegValue;
    val[1]=ucData[1];
#if 0
    if(I2C_IF_ReadFrom(0x44,&ucRegAddr, 1, &ucRegData[0], 2) != 0)
        return -1;
#endif
    J=I2C_IF_Write(CODEC_I2C_SLAVE_ADDR, ucData, 2, 1);
    if(J !=0)
        return (1U<<31);
    MAP_UtilsDelay(27000);

    J=I2C_IF_ReadFrom(CODEC_I2C_SLAVE_ADDR, &ucData[0], 1,&val[0],1);
    if(J !=0)
        return (1U<<31);

    if(val[0] != val[1])
        ++I;

    LOG_MSG("[AudioCodecRegWrite] Reg %.2x\r\n",ucData[0]);
    LOG_MSG("[AudioCodecRegWrite] Desired value = %.2x\r\n",val[1]);
    LOG_MSG("[AudioCodecRegWrite] Written value = %.2x\r\n\r\n",val[0]);
	LOG_FLUSH();

    return 0;
}


On the other hand, the function uses a delay betwen write and read operation. It will be possible use a control register flag instead of the active waiting?

  • Hi Dav,


    Please provide us more details

    1. Which CODEC are you using

    2. What value you writing and what is the expected read value

    Thanks and Regards,

    Praveen

  • Hi Praveen,

    1. I'm sorry, I use the TLV320AIC3254 codec.

    2. For example when I write in the page 0, the 4th, 5th and 6th registers, I have the next results:

    Register             Value writing             Value read

     4 - 0x04                       0x03                           0x01

     5 - 0x05                       0x94                           0x00

     6 - 0x06                       0x3A                           0x00


    Thanks for your help.

  • Hey Dav,

    I am having same problem. Can you please tell me how were you able to solve it?

    Thanks,
    Hardik