Page 3 of 3

Re: (solved) error when trying to use I2C

Posted: Tue Dec 18, 2018 5:33 pm
by fly135
Does it always error or just occasionally? I get occasional timeout errors and just try again.

John A

Re: (solved) error when trying to use I2C

Posted: Tue Dec 18, 2018 5:43 pm
by mzimmers
I won't say "always" but this is a highly repeatable problem, and I'm 99% sure that retries won't fix whatever's going on.

EDIT:

I spoke with an FAE for the company that supplies the fuel gauge (the device on the other end of the I2C); here's part of his response.

You can try sending 8 extra SCL pulses with SDA high, which can cause the slave to release the line in some fault states. If this happens at the end of a read sequence, it could because the slave does not receive a NACK and is therefore waiting for the master to send more clock pulses to read the next register. This is a common cause with all I2C devices that can cause the bus to get stuck.


As near as I can tell, this would involve bypassing the I2C library and bit-banging the GPIO myself. Is this a good idea?