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.

C6748 I2C read error

I'm seeing an occasional but consistently reproducible problem when reading from an I2C GPIO expander using a C6748 DSP

This happens only perhaps 1 in a hundred reads, and not in a particularly consistent fashion. I have a script which executes a number of I2C operations, but in short I'm writing a value to the IO expander, then reading it back to check the value.

Most of the time this is fine, but just occasionally the value read back is incorrect and is the previous value written/read back from the IO expander. If I read the value a second time i.e. just retry the read because its not the value I expected, then it is always correct.

Using a sniffer on the I2C bus has proved that the IO expander is sending the correct value, so it looks like the problem is in the C6748 I2C peripheral.

The driver is quite simple, just using polled mode as speed is not an issue, and I've been through the datasheet in detail to make sure it's being set up exactly as indicated, but this still seems to be happening. It's not a speed issue as the bus speed has been slowed right down, and I've tried adding delays in a number of places but without success, so it looks like a logic issue and the I2C peripheral is somehow "caching" the last value read.

I've searched the errata but I haven't found any reference to anything similar.

Unfortunately I cannot post the driver code as it belongs to a customer.

Has anyone seen anything similar, and have any suggestions?

  • Hi Ian,

    What i can suggest is try to reproduce the same issue with TI Provided code.
    If you have any of LogicPD or SDI board, as both are having GPIO Expander.

    You can refer (I2C_io_expander example) code.
    processors.wiki.ti.com/.../QuickStartOMAPL1x_rCSL
  • Hi Arvind,

    Unfortunately we don't have either of those boards, plus the reference code seems to be for CCSV4 using the CSL library on the C64XX, so I'm not sure how representative that would be?
    I realise the peripheral is probably very similar, if not the same, but I was hoping someone might have seen something similar on a C674X

    Thanks
    Ian
  • Hi,

    This happens only perhaps 1 in a hundred reads, and not in a particularly consistent fashion. I have a script which executes a number of I2C operations, but in short I'm writing a value to the IO expander, then reading it back to check the value.

    What is the time (sleep command may be used) interval between I2C commands executions ?
    Try to increase and check.

    I2C driver implementation is "GPIO bit bang" or actual I2C bus configuration used ?

    You can share the script which you execute commands.