i2c on silicon image c8051f32x (using USBXpress)

381 views Asked by At

I have the I2C (SMBus) working properly in this uC and have a VB GUI which can communicate over USB (using USBXpress) and do I2C transactions from the uC to a separate IC. The problem is that I am having the uC poll a register on the IC every 1s. When I do an asynchronous GUI I2C transaction, every once in a while, I believe it collides with the polling I2C transaction and all the I2C data gets shifted at the GUI (i.e., register 0x00's data shows up on register 0x01) . The I2C data in the IC looks correct (by spying on the I2C bus with a LA). What exactly is happening and how can I fix this?

1

There are 1 answers

1
Stephen Doyle On

If the polling between the uC and I2C is happening over the same I2C bus as that used by your GUI app then you need to make sure that access to the I2C is controlled such that one transaction completes before the other is allowed to begin. Maybe you are doing this already but this is not clear from the question.

Also, posting some code or pseudo code of the uC code might help.