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.

BQ27411-G1: State of Charge not working on LPC microcontroller

Part Number: BQ27411-G1

hi,

So I'm working on a project involving the BQ27411-g1 to monitor the state of charge of a 3.7v lithium battery based on a LPC5411.
And the problem I'm running into, is that the fuelgauge only returns 0 for the state of charge. I'm using the library 'Battery babysitter' from sparkfun github.com/sparkfun/Battery_Babysitter.
I have ported this library to work with the LPC im using. Im able to ask for the device ID and it returns the correct value, aswell as some other functions like flags, status and voltage and this all seems to work fine. Although im not able to read the soc, it always returns 0. Eventhough I set the FLAG_BAT_DET and the capacity of the battery.  With this same library I got the fuelgauge working using an arduino while using the same curcuit as with the LPC. The only difference I can find is in the flags that are set, for the arduino the flags function returns 648. While for the LPC flags returns 654. So FLAG_SOC1 and FLAG_SOCF are set when using the LPC but on the Arduino they are not. I also cant seem to change this using the LPC.

Thanks in advance,
Thomas