SLUAAP1 may   2023 BQ25120A , BQ25121A , BQ25122 , BQ25123 , BQ25125 , BQ25150 , BQ25155 , BQ25157 , BQ25180

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1What is 0-V Charge Inhibition?
  5. 2Implement Charge Inhibition With a Charger
    1. 2.1 Measuring Battery Voltage using Battery Undervoltage Lockout
    2. 2.2 Executing a Battery Short Test
    3. 2.3 Example Implementation
  6. 3Summary
  7. 4References

Example Implementation

To demonstrate one possible implementation of the 2-V charge inhibition, the following example is provided. The set up for this example consists of an MSP430F5529 connected to a BQ25120A. For a broader example that applies to most chargers, the BUVLO setting is used to measure battery voltage rather than the Voltage Based Monitor function that is available on the BQ2512x family of devices.

A BAT_UV fault can be used as a trigger to begin the process of identifying that a battery is internally shorted. This test can be disruptive to charging, so it is best to confirm that a battery is critically discharged first before the test is run. In this case, the Charger_getBatteryCriticallyDischarged function is used to identify that battery voltage is low enough for a test to be run.

void Charger_handleBatUVFault(void){
    //Charge is Disabled
    Charger_disableCharge();
    
    //Check if battery is critically discharged
    if(Charger_getBatteryCriticallyDischarged()){
        
        //Run battery short test
        if(Charger_runBatteryShortTest()){
            
            //If Battery is Shorted set global flag
            Charger_BatteryShorted = true;
            return;
        }
    }
    
    //enable Charging
    Charger_enableCharge();
    return;
}

The battery monitoring flow can be demonstrated by the following line of code. For the purpose of low voltage charge inhibition, monitoring flow only requires that the battery is tested against the lowest voltage level. Using the other voltage levels can give an idea of what the battery voltage is for other purposes.

bool Charger_getBatteryCriticallyDischarged(void){
    uint8_t currentBuvlo, faultRegisterValue;
    bool batteryIsCriticallyDischarged;
    uint16_t ERR_NO;

    //Store Current BUVLO Setting
    currentBuvlo = Charger_getBUVLO();

    //Set BUVLO to Lowest Value
    Charger_setBUVLO(CHARGER_BUVLO_2p2V);

    //Read Fault Register
    StdI2C_P_RX_Single(CHARGER_I2C_ADDR,CHARGER_REG_FAULT    ,&faultRegisterValue  ,&ERR_NO);

    //Get BAT_UVLO Status
    batteryIsCriticallyDischarged = (faultRegisterValue & CHARGER_FAULT_BATUV_MASK);

    //Restore BUVLO Setting
    Charger_setBUVLO(currentBuvlo);

    return batteryIsCriticallyDischarged;
}

After identifying that the battery is critically discharged, a battery short test is run during which a low charge current is used and for a short period of time with the battery being periodically re-tested at various intervals. The current for this test, duration of this test, and intervals for re-testing can vary from battery to battery and application to application.

bool Charger_runBatteryShortTest(void){
    uint8_t pretermCurrent;
    uint8_t maxRetries = 5;
    
    //Store PreTerm current settings
    pretermCurrent = Charger_getPreTermCurrent();
    
    //Set PreTerm to 10mA
    Charger_setPreTermCurrent(CHARGER_PRETERM_10mA);

    for(int try = 0; try < maxRetries; try++){
        //Enable Charging for test
        Charger_enableCharge();
        
        //Start Periodic Retest timer
        Charger_startShortTestTimer();
        
        //Await timer elapse
        while(Charger_ShortTestTimerRunning);
        
        //Disable charging for Critical Discharge test
        Charger_disableCharge();

        //Test if critically discharged
        if (!Charger_getBatteryCriticallyDischarged()){
            
            //Return PreTerm current to previous setting
            Charger_setPreTermCurrent(pretermCurrent);
            
            //Report no short on battery
            return false;
        }
    }
    
    //Return PreTerm current to previous setting
    Charger_setPreTermCurrent(pretermCurrent);
    
    //Report Shorted battery
    return true;
}

Ultimately, if the charging does not result in the battery voltage increasing above the critically discharged threshold, a global flag indicating the battery short is set and charging is not allowed to resume. This is a flag that is checked upon charge enable, while set charging cannot be started.

void Charger_enableCharge(void){
    uint8_t registerValue;
    uint16_t ERR_NO;

    //Check if Battery is Shorted before enabling charge
    if(Charger_BatteryShorted){
       return;
    }

    //Clear Charge Disable Bit
    StdI2C_P_RX_Single(CHARGER_I2C_ADDR,    CHARGER_REG_ICHG,   &registerValue, &ERR_NO);
    registerValue &= ~(CHARGER_ICHG_DISABLE_MASK);
    StdI2C_P_TX_Single(CHARGER_I2C_ADDR,    CHARGER_REG_ICHG,  registerValue,  &ERR_NO);
    return;
}

The results of the implementation is shown in Figure 2-3 and Figure 2-4. In these tests, a battery simulator is used to demonstrate how a battery that is at a low voltage is prevented from charging if it stays low. A battery that recovers voltage during the short testing is allowed to resume charging.

After multiple battery voltage measurements without BAT recovering, charge is disabled indicated by INT going high and IBAT going to 0 mA.

GUID-20230509-SS0I-QNQX-Q1WM-PBFBJMWTBPWT-low.svg Figure 2-3 Shorted Battery Simulation
GUID-20230509-SS0I-RTDC-9MWD-PX2WZ45WGFFD-low.svg Figure 2-4 Recovered Battery Simulation.

BAT voltage rising after a couple re-attempts allows the device to exit the test and resume charging the battery.