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.

TCA6416A: Glitches on I2C bus causing register corruption

Part Number: TCA6416A


Hi,

I am controlling a DC amp motor via a TI motor driver DRV8874PWPR, and controlling the motor driver chip via the port expansion chip. The motor pulls about 1.0 amp at 24 volts. Everything is fine normally, but when the motor hits a limit switch and stops, some voltage spikes are introduced into the I2C bus for some inexplicable reason (at least none that I can find so far) and this leads to register corruption when it happens. Here is my setup:

  • Vcci = 3.3 volts and Vccp = 5.0 volts
  • I2C bus speed is 100kHz
  • I2C data is transmitted over a ribbon cable 6" long, as is 5V (Vccp).
  • Pullups on SDA, SCL, Int, and Rst are all 10K and located near the TCA6416A port expander.
  • The TCA6416A is the only slave device on the I2C bus.
  • There are no pullups on either I2C line on the microcontroller board.
  • The data sheet did not show any of the standard bypass capacitors, so I neglected to add any myself. Vcci (3.3v) for the device is provided by a linear power supply nearby.


Do you have any suggestions on what I should do to eliminate this problem?

Also, I am unsure how to calculate the various capacitances that affect the choice of pull-ups for the SDA & SCL lines. If that is the problem (the 10k pullups are too large), any guidance on calculating bus capacitance is appreciated.

Thanks,

Scott

  • First, you should keep the motor's spikes away from the rest of the board. Does the motor have a flyback diode or some other kind of snubber circuit? Is its power supply properly decoupled?

    Second, to make the I²C bus less susceptible to high-frequency noise, add capacitors. This might require reducing the speed. (The total bus capacitance is the sume of the devices' input capacitances, the trace capacitances, and the cable capacitance. There are estimates, but you could just check the waveforms with an oscilloscope.)

    (And I assume that you have added the decoupling capacitors that you now know are needed.)

    Third, I²C has no checksumming. To work around transmission errors, read back the registers after each write, and repeat as needed.

  • Hi Scott,

    Are you able to verify what the register values are after the issue occurs (are you able to read the registers of the device)?

    Normally to configure the registers in the device, you would need to write directly to the device by call its address then writing to the register then setting data into the register. I'm not sure how high frequency noise from a motor could affect this but my assumption is the registers aren't getting corrupted but instead the device could just be getting reset/power cycled if the reset pin or Vcc line drops below it's Vpor. We should be able to verify this if you are able to read the registers of the device after you see the issue occur. 

    -Bobby