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.

TLV320AIC3120EVM-U: Read and writing of CODEC registers via I2C using bus pirate

Part Number: TLV320AIC3120EVM-U

Hello - I am attempting to talk to the CODEC registers directly using a bus pirate connected to the SDA and SCL lines on the eval board.    I am issuing the commands to read a register, however I always receive an 0xFF as the register data.  Below is a sample command line I copied from the terminal program connected to the bus pirate:

I2C>  [0x30 0x0F [0x30 r]              ** Comment - this line can be interpreted as:  start condition, device address, register address, repeat start condition, device address, read data, stop condition
I2C START BIT
WRITE: 0x30 ACK
WRITE: 0x0F ACK
I2C START BIT
WRITE: 0x30 ACK
READ: 0xFF
NACK
I2C STOP BIT
I2C>

Note that all data sent is being acknowledged by the CODEC, however the data returned is not what I expected. 

Let me know if this should work as I expected or what changes may be needed.  I would like to verify that I can read and write the CODEC registers via I2C before attempting these operation with a microcontroller.

Thank you,

Chris

  • Hi Chris,

    From the psuedo sequence you shared, I noticed that your device address doesn't change after the repeated start to account for the Read bit being set. Maybe that's why you're not getting the expected result. The address is still valid so it'd still return an ACK but the data would be garbage (stuck high in this case).

    Let me know if this fixes the issue or I misunderstood something,
    Jeff McPherson

  • Hello Jeff, thanks for the help.   You are correct in what was happening. I got it working and was able to write data to a register on the codec and read it back using the bus pirate with the following command sequence:

    This line writes a 0x01 to register 0x15     [ is start condition    ] is stop condition

    [0x30 0x15 0x01]                

    This line correctly returns the 0x01 which was previously written to the CODEC, 0x31 is used to read the data back

    [0x30 0x15 [0x31 r]

    Thank you,  Chris