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.

TLV320AIC3104: Reading issue from the TLV320AIC3104.

Part Number: TLV320AIC3104


Tool/software:

I am using the TLV320AIC3104 codec. I am writing to a register in the codec chip using I2C, but I am unable to read back the same value. Is this the expected device behavior?

i have attached the screenshot for same

  • Hi Rutuja,

    Where is the readback value in this code snippet? Can you probe the I2C lines to compare what exactly is happening in hardware?

    Best regards,
    Jeff McPherson

  • Hello Jeff,

    In the screenshot above, I first used the i2cget command to read the register value at address 0x10. Then, I wrote 0x11 to the same register using the i2cset command. However, when I read the same register again, it returns 0xFF instead of 0x11. I am facing the same issue with many registers — I am unable to read back the written values correctly.
    I also tried the same operation using SMBus and ioctl functions, but I got the same result. I would like to know whether this is expected hardware behavior or if there might be an issue in the driver code?
    Thanks and regards,
    Rutuja
  • Hi Rutuja,

    No this is not expected behavior. Constant 0xFF indicates that a device acknowledged the I2C transaction but did not return any data.

    i2cget command to read the register value at address 0x10

    The picture shows 0x19 as the register address, not 0x10. Is this a typo or am I misunderstanding the calculation?

    Also are there any registers where the read is expected? You mention many registers have the problem but is it all of them?

    There is also a quirk with this device that it only supports "repeat start" I2C read transactions. Some controllers will use a continuous read style instead. This will cause the device to incorrectly return the read value of the address +1. So using this continuous style, register 0x10 would instead return the value at 0x11. You can probe on a oscilloscope the I2C transaction to see if this is the case. You can also write to a value, and then read from the desired register address -1 to see if the result is matching.

    Best regards,
    Jeff McPherson

  • Hello Jeff,

    You're right—that was a typo. The correct register address should be 0x19, not 0x10. Thanks for catching that!

    I have checked the registers where a read response is expected, but I haven't received the expected results.
    As you mentioned, I also tried reading from the desired register, as well as from one address above and below it (+1 and -1), but still didn't get the expected output.

    In the screenshot above, register 0x16 has a value of 0x78. I'm trying to update this register to 0x20. However, when I read back from register 0x16, I still get 0x78, which is not the expected result.

    I also tried reading registers 0x15 and 0x17, but the results were not as expected either.

  • Hi Rutuja,

    Are there any registers where the read is expected, that isn't some trivial result like 0x7F or 0x00?

    Also can you double check that the values reported by the software are the same that show up on hardware using an oscilloscope? One example would be enough

    Thanks,
    Jeff McPherson