LC709203F - OSError
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- _JonT_
- Posts: 10
- Joined: Thu Jan 05, 2023 3:30 pm
LC709203F - OSError
I am using an LC709203F battery gauge with a BQ27074 charger and a pico w. The application requires long-term availability and is meant to be running for days. However, after a few hours the Micropython application quits with an OSError 5. I have tracked this down to the LC709203F. If I disconnect the battery and reconnect it, all is well again. Looking at various forum posts, the issue seems to be that the LC709203F is putting itself to sleep and causing an I2C error to occur when it is accessed. The access function that I have written does actually wake the LC709203F up, but this does not seem to be addressing the issue. While I have seen lots of chatter about this issue, I haven't found anyone who has found a solution. Does anyone have any experience of this using Micropython?
- bidrohini
- Posts: 202
- Joined: Thu Oct 20, 2022 10:03 am
Re: LC709203F - OSError
Which library did you use?
This one? https://github.com/chris-reichl/MicroPython_LC709203F
This one? https://github.com/chris-reichl/MicroPython_LC709203F
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: LC709203F - OSError
What sampling interval are you using?
- _JonT_
- Posts: 10
- Joined: Thu Jan 05, 2023 3:30 pm
Re: LC709203F - OSError
In the test rig I was using I was sampling every 20 seconds.
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: LC709203F - OSError
That would do it.. the auto-sleep time is 1s to 1.5s.
The wakeup time is 400us, or about 40 pulses of the I2C clock. Try doing a dummy read to wake the chip up, then wait 1ms, and take a real reading.
The wakeup time is 400us, or about 40 pulses of the I2C clock. Try doing a dummy read to wake the chip up, then wait 1ms, and take a real reading.
- _JonT_
- Posts: 10
- Joined: Thu Jan 05, 2023 3:30 pm
Re: LC709203F - OSError
Thanks. I will have a try and report back. Did I miss that in the data sheet somewhere?
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: LC709203F - OSError
It's in Table 5 on page 6, toward the bottom of the table:
https://cdn-learn.adafruit.com/assets/a ... 1599248750
It's easy to miss that kind of thing until the becomes specifically relevant.
https://cdn-learn.adafruit.com/assets/a ... 1599248750
It's easy to miss that kind of thing until the becomes specifically relevant.
Please be positive and constructive with your questions and comments.