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.

BQ27421 hibernate problem

Hi,

I am using BQ27421 to measure battery percentage (State of charge).

When system goes to sleep mode , I am putting BQ27421 into hibernate mode, It's also going into hibernate mode.

But When system wakes up and sends command to fuel gauge to clear hibernate bit, it wakes up but it shows wrong value of charge.

Before going to hibernate value was 0E, after coming out it was 03.

When I reset the system and configure it again value comes correctly (0C).

Does anybody has this issue? Any solution to this problem?

EDIT: Also another question is I am reading value from address  0x1C (SOC register) and I am printing it. But it shows wrong value. (May be fuelgauge is not calibrated).

Thanks.

  • Hi Maulik,

    We might need a few more details to figure out your situation.  Can you elaborate on your setup, system, and procedure, please?

    Is there significant current flowing during the time you wake the gauge from Hibernate?  It will take a few seconds for the gauge to take a new voltage reading after exiting from Hibernate and to update its predictions.  Significant current could affect the predictions.

    Regarding your second question: What do you mean by wrong value?  Can you share any log or data illustrating the behavior for both questions, please?

    Did you configure the gauge following the basic items in the bq27421 Quick Start Guide?

  • Hi dMax,

    Sorry for late reply.

    I got fuel gauge working, I just need to issue battery insert again after coming out of hibernate mode.

    Another question I have is when we are charging the device, and at that time fuel gauge shows battery at 100%.

    Is that correct behaviour?

  • Hi Max/Maulik,

    we are also using BQ27421 but in the driver we are not able to set the design capacity, terminate voltage, Default design Capacity.

    we used "GaugeStudio" to set the values but it loads default values when device gets reset.

    we are using the driver provided by TI only..

    Can you suggest us the best driver...

     

  • Hi Gopala,

    Which driver are you currently using?  You want to try to minimize current when the gauge initializes so that the starting point will be as accurate as possible.

    Here is our latest version of a driver that can initialize the configuration data memory (DM) of ROM based gauges (like bq27421 and bq27621). It's uploaded here:

    https://github.com/aneeshv/linux-bq27xxx

    Instructions for cloning:

    git clone https://github.com/aneeshv/linux-bq27xxx.git

    branch: bq274xx-dm-init

    What it does:

    In addition to the regular reporting functions (Voltage(), Current(), SOC() etc.) this driver has APIs for reading and writing the DM of the gauge. These APIs are in turn used for initializing the DM of ROM based gauges.

    The initialization happens at startup(about ~65s into the the startup) After startup we poll the status of ITPOR every 6 minutes and repeat the DM initialization if it’s set. The polling happens along with the polling of other parameters such as Current(), SOC() etc and the period for this polling loop is customizable.

    The registers to initialized in the DM may be specified in the code in an array like this:

    static struct dm_reg bq274xx_dm_regs[] = {  {82, 0, 2, 1000}, /* Qmax */  {82, 5, 1, 0x81}, /* Load Select */  {82, 10, 2, 1340}, /* Design Capacity */  {82, 12, 2, 3700}, /* Design Energy */  {82, 16, 2, 3250}, /* Terminate Voltage */  {82, 27, 2, 110}, /* Taper rate */ };

    What it doesn’t:

    It doesn’t have a mechanism to save and restore Ra values and Qmax as suggested in the Quick Start Guide.  This means it will reload default values ever time the battery is inserted.

  • Hi Max,

    As Maulik explained, the fuelgauge returns 100% as State of Charge (SOC) whenever charger is connected, Can you please help us on this?

    Also, we have observed very weird behavior. First time, when fuel gauge comes out of the hibernate it shows SoC as 27%. Then it again goes into hibernate for 15-20 mins. And after waking up it shows SoC as 54%. What could be the problem? Why there is inconsistencies in the battery level reading from fuel gauge?

    Please reply soon.

    Thanks,

    Dhaval

  • First, let me update where our driver information is currently located at:

    http://processors.wiki.ti.com/index.php/Linux/Android_Software_Solutions_for_TI_Single-cell_Gas_Gauges

    Now, can you please explain how you are configuring the gauge?  Did you get your driver working to update the gauge parameters or is everything at default?

  • How am I configuring means? I can set the total capacity of the battery and few other parameters. The driver is working correctly. What else do you need from my side? Can you please be more specific?