(solved) error when trying to use I2C

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Re: (solved) error when trying to use I2C

Postby fly135 » Tue Dec 18, 2018 5:33 pm

Does it always error or just occasionally? I get occasional timeout errors and just try again.

John A

User avatar
mzimmers
Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

Re: (solved) error when trying to use I2C

Postby mzimmers » Tue Dec 18, 2018 5:43 pm

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?

Who is online

Users browsing this forum: No registered users and 107 guests