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-G1: bq27421-G1a could not enter hibernation mode.

Part Number: BQ27421-G1

Hello Sirs,

 Would you pls help to reply how BQ27421 enter hibernate mode ? TKS !

Attach file is test code .

void Amba_Gauge_Config(){

    //sealed to unsealed
//    Amba_I2C_Write_Word(0x00, 0x8000, 100);
//    Amba_I2C_Write_Word(0x00, 0x8000, 100);
	_gauge_enabled = true;

    Amba_I2C_Read_Word(0x06, &flags, 100);

    while(1){
        Amba_I2C_Write_Word(0x00, 0x0013, 100);
        Amba_I2C_Read_Word(0x06, &flags, 100);
        if(flags & 0x10) break;
    }

    Amba_Gauge_Standard_Data_Config(BATTERY_DESIGN_CAPACITY, BATTERY_DESIGN_ENERGY, BATTERY_TERMINATE_VOLTAGE, BATTERY_TAPER_RATE);
    Amba_Gauge_Fast_Hibernate_Config();

    while(1){
        Amba_I2C_Write_Word(0x00, 0x0042, 100);
        Amba_I2C_Read_Word(0x06, &flags, 100);
        if(!(flags & 0x10)) break;
    }
	
    return;
}

//refer to Quickstart Guide for bq27421-G1, Figure 2.Configure Standard Data Memory Parameters
void Amba_Gauge_Standard_Data_Config(uint16_t design_capacity, uint16_t design_energy, uint16_t terminate_voltage, uint16_t taper_rate){
    if(!_gauge_enabled) return;
    uint8_t old_checksum;
    uint8_t new_checksum;
    uint16_t old_dc;
    uint16_t old_de;
    uint16_t old_tv;
    uint16_t old_tr;

    uint16_t new_dc = (design_capacity<<8) + (design_capacity>>8);
    uint16_t new_de = (design_energy<<8) + (design_energy>>8);
    uint16_t new_tv = (terminate_voltage<<8) + (terminate_voltage>>8);
    uint16_t new_tr = (taper_rate<<8) + (taper_rate>>8);


    Amba_I2C_Write_Byte(0x61, 0x00, 100);
    Amba_I2C_Write_Byte(0x3E, 0x52, 100);
    Amba_I2C_Write_Byte(0x3F, 0x00, 100);

    while(1){
        Amba_I2C_Read_Byte(0x60, &old_checksum, 100);
        old_checksum = 0xFF - old_checksum;
        Amba_I2C_Read_Word(0x4A, &old_dc, 100);
        Amba_I2C_Read_Word(0x4C, &old_de, 100);
        Amba_I2C_Read_Word(0x50, &old_tv, 100);
        Amba_I2C_Read_Word(0x5B, &old_tr, 100);
        old_checksum = old_checksum - (old_dc&0xFF) - (old_dc>>8) - (old_de&0xFF) - (old_de>>8) - (old_tv&0xFF) - (old_tv>>8) - (old_tr&0xFF) - (old_tr>>8);

        Amba_I2C_Write_Word(0x4A, new_dc, 100);
        old_checksum += (design_capacity&0xFF) + (design_capacity>>8);
        Amba_I2C_Write_Word(0x4C, new_de, 100);
        old_checksum += (design_energy&0xFF) + (design_energy>>8);
        Amba_I2C_Write_Word(0x50, new_tv, 100);
        old_checksum += (terminate_voltage&0xFF) + (terminate_voltage>>8);
        Amba_I2C_Write_Word(0x5B, new_tr, 100);
        old_checksum += (taper_rate&0xFF) + (taper_rate>>8);

        new_checksum = 0xFF - old_checksum;

        Amba_I2C_Write_Byte(0x60, new_checksum, 100);

        Amba_I2C_Write_Byte(0x3E, 0x52, 100);
        Amba_I2C_Write_Byte(0x3F, 0x00, 100);
        Amba_I2C_Read_Byte(0x60, &old_checksum, 100);
        if(old_checksum == new_checksum)
            break;
    }
    return;
}

//refer to Quickstart Guide for bq27421-G1, Figure 5.Configure HIBERNATE Mode Data Memory Parameters
void Amba_Gauge_Fast_Hibernate_Config(){
    if(!_gauge_enabled) return;
    uint8_t old_checksum;
    uint8_t new_checksum;
    Amba_I2C_Write_Word(0x00, 0x0011, 100);

    Amba_I2C_Write_Byte(0x61, 0x00, 100);
    Amba_I2C_Write_Byte(0x3E, 0x44, 100);
    Amba_I2C_Write_Byte(0x3F, 0x00, 100);

    while(1){
        uint16_t hibernate_v;
        Amba_I2C_Read_Byte(0x60, &old_checksum, 100);
        old_checksum = 0xFF - old_checksum;
        Amba_I2C_Read_Word(0x49, &hibernate_v, 100);
        old_checksum = old_checksum - (hibernate_v&0xFF) - (hibernate_v>>8);
        hibernate_v = 0x8813;//5000
        Amba_I2C_Write_Word(0x49, hibernate_v, 100);
        old_checksum = old_checksum + (hibernate_v&0xFF) + (hibernate_v>>8);
        new_checksum = 0xFF - old_checksum;
        Amba_I2C_Write_Byte(0x60, new_checksum, 100);

        Amba_I2C_Write_Byte(0x3E, 0x44, 100);
        Amba_I2C_Write_Byte(0x3F, 0x00, 100);
        Amba_I2C_Read_Byte(0x60, &old_checksum, 100);
        if(new_checksum == old_checksum){
            break;
        }
    }

    Amba_I2C_Write_Byte(0x61, 0x00, 100);
    Amba_I2C_Write_Byte(0x3E, 0x50, 100);
    Amba_I2C_Write_Byte(0x3F, 0x00, 100);
    while(1){
        uint16_t fh_setting0;
        uint16_t fh_setting1;
        uint16_t fh_setting2;
        Amba_I2C_Read_Byte(0x60, &old_checksum, 100);
        old_checksum = 0xFF - old_checksum;
        Amba_I2C_Read_Word(0x4B, &fh_setting0, 100);
        Amba_I2C_Read_Word(0x58, &fh_setting1, 100);
        Amba_I2C_Read_Word(0x5A, &fh_setting2, 100);
        old_checksum = old_checksum - (fh_setting0&0xFF) - (fh_setting0>>8) - (fh_setting1&0xFF) - (fh_setting1>>8) - (fh_setting2&0xFF) - (fh_setting2>>8);
        fh_setting0 = 0x0;//0
        fh_setting1 = 0x100;//1
        fh_setting2 = 0x0;//0
        Amba_I2C_Write_Word(0x4B, fh_setting0, 100);
        Amba_I2C_Write_Word(0x58, fh_setting1, 100);
        Amba_I2C_Write_Word(0x5A, fh_setting2, 100);
        old_checksum = old_checksum + (fh_setting0&0xFF) + (fh_setting0>>8) + (fh_setting1&0xFF) + (fh_setting1>>8) + (fh_setting2&0xFF) + (fh_setting2>>8);
        new_checksum = 0xFF - old_checksum;
        Amba_I2C_Write_Byte(0x60, new_checksum, 100);

        Amba_I2C_Write_Byte(0x3E, 0x50, 100);
        Amba_I2C_Write_Byte(0x3F, 0x00, 100);
        Amba_I2C_Read_Byte(0x60, &old_checksum, 100);
        if(new_checksum == old_checksum){
            break;
        }
    }

    Amba_I2C_Write_Byte(0x61, 0x00, 100);
    Amba_I2C_Write_Byte(0x3E, 0x50, 100);
    Amba_I2C_Write_Byte(0x3F, 0x01, 100);
    while(1){
        uint8_t fh_setting3;
        Amba_I2C_Read_Byte(0x60, &old_checksum, 100);
        old_checksum = 0xFF - old_checksum;
        Amba_I2C_Read_Byte(0x43, &fh_setting3, 100);
        old_checksum = old_checksum - fh_setting3;
        fh_setting3 = 0x0;//0
        Amba_I2C_Write_Byte(0x43, fh_setting3, 100);
        old_checksum = old_checksum + fh_setting3;
        new_checksum = 0xFF - old_checksum;
        Amba_I2C_Write_Byte(0x60, new_checksum, 100);

        Amba_I2C_Write_Byte(0x3E, 0x50, 100);
        Amba_I2C_Write_Byte(0x3F, 0x01, 100);
        Amba_I2C_Read_Byte(0x60, &old_checksum, 100);
        if(new_checksum == old_checksum){
            break;
        }
    }
    return;
}

==========================================================================================================================

Refer to bq27421 Technical Reference Documentation Section [2.4.6 HIBERNATE Mode], the steps to make the chip enter hibernation mode are as followed:

l  Power on

l  SET_CFGUPDATE()

l  Set Hibernate V = 5000 mV

l  Set FH Setting 0 = 0

l  Set FH Setting 1 = 1

l  Set FH Setting 2 = 0

l  Set FH Setting 3 = 0

l  SOFT_RESET()

After that, the chip should enter hibernation mode when the voltage is less than 5000mv.

So we test it with the code in attached file.

 

Then we met the issue. There are two signs to make us infer that it did not enter hibernation mode but was in sleep mode:

1.    In the specification, the supply current of hibernation is about 9ua higher than shutdown, but we found that the actual test chip supply current is about 21ua higher than that in shutdown mode, which is just like the current in sleep mode.

2.    In the sleep and wait_hibernate state, the chip will update data every 20 seconds, which will cause the supply current value rise in the jump, and it happened.

 

In order to eliminate the possibility that the configuration error or conditions do not match, we did a few tests to reread the configuration.

The configuration is actually written correctly, and some status values are as follows:

Averagecurrent () 0x1 (mostly less than 1ma)

Voltage () 0xe39

CONTROL_STATUS () 0x5e

Flags () 0 0x18e

 

 

So, pls help us to check:

  1. Is there any direct way to check if the IC is in hibernation mode?
  2. Is our test method right to make the IC enter hibernation mode?

 

  • Hello Terry,

    1. The best way to check if the IC is in hibernation mode is by measuring the current into the BAT pin.

    2. The hibernate settings you have will not allow the IC to enter hibernate mode. Please refer to the power diagram in the TRM, Figure 2-2.

    For normal hibernate, you will need to wait for an OCV measurement (this could take up to an hour) for a cell.

    Thanks
  • Hello Kang Kang,

    Thanks your feedback first !

    1. The best way to check if the IC is in hibernation mode is by measuring the current into the BAT pin.

        <= Yes, we also did it in this way.

             And when we trying to make IC enter fast hibernation, the current is about 20uA higher than shutdown it.

    2. The hibernate settings you have will not allow the IC to enter hibernate mode. Please refer to the power diagram in the TRM, Figure 2-2.

       <= sorry for that our description made a misunderstanding. Our target is to make IC enter fast hibernation mode.

     We indeed followed Figure 2-2 and the instructions:

    Hibernate V = 5000 mV
    FH Setting 0
    = 0
    FH Setting 1
    = 1
    FH Setting 2
    = 0
    FH Setting 3 = 0

    About OCV, we also read the FLAG() and the value is 0x18e. The bit 7 of low byte is 1 which is OCVTAKEN.

    It indicates the OCV measurement is performed in relax mode.

    BTW, we set the output voltage to 3.6V of a stabilized voltage supply instead of plugging a battery.

    If there is something wrong, please feel free to let us know. Thank !

           



     

  • May I learned from you which device you are suing? bq27421-G1D or others? 

  • Hello Ake,

    P/N is BQ27421-G1a . TKS !
  • Please adding a SOFT_RESET comand 0x42 after modified your setting.
  • Hello Ake,

    Already added soft_reset before . 

    l  SET_CFGUPDATE()

    l  Set Hibernate V = 5000 mV

    l  Set FH Setting 0 = 0

    l  Set FH Setting 1 = 1

    l  Set FH Setting 2 = 0

    l  Set FH Setting 3 = 0

    SOFT_RESET()

  • I tried to perform a testing on EVM and measure the power consumption to check if FG enter hibernate.

     

    The steps are working for me.