This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

I2C Data line held low

I have a strange problem where the I2C data line is being held low, this obviously stops all communications on the bus. I cannot recover from this situation and there doesnt seem to be any common cause for this event occurring.

The data line has been set to open drain and has 10k pull ups, as does the clock line. Im unsure if its the micro or the device holding it low. (device = PCF8575).

If anyone has experienced this problem or have any ideas for a reason or solution, i would be greatfull.

  • diagnosing your problem:

    I am extensively using IIC but I have not worked with the 16x for a very long time, so forgive me if this does no apply.

    This will be somewhat fuzzy for the above reasons

    if your chip has hardware IIC goto 30
    if not
    change all port writes to go through a shadow register, then when the line is low, if the shadow is high it is the external device.

    30)
    if the 16x (I do not recall) has a port latch like the '51 check the port latch as above

    Erik

  • The XC161 does have an on chip I2C module, which im using. As the port pins have to be selected as alternate function pins to use the I2C module i have no real control over them. e.g. I can set the port pin register to 0 or 1 and they read back as expected but have no effect as the module is in control.

    I suspect it is the micro holding the data line low as i cannot reset the I2C module.

    Thanks for your help, any other ideas welcome.

  • cut the line held low and insert a very small <100R resistor across the cut. then your scope will tell you what device holds the line. then IMMEDIATELY replace the resistor with a short

    been there, done that

    Erik

  • Have you verified your signal integrity? With bad signal integrity, it isn't uncommon for a connected device to clock wrong, so at the end of a transfer, it is hung still emitting a data bit.

    I don't know for the built-in I2C controller in your chip, but in some situations, it may be needed to reconfigure the processor pins as normal outputs, and tick out enough clock pulses to get the device into a stable state. Then you can reactivate the I2C controller and restart the failed operation.