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.

BQ25622: BATTERY CURRENT SETTING FOR BQ25622

Part Number: BQ25622

Tool/software:

Hi ,

iam workng on bq25622 battery charger .

my battery current showing zero.

Please tell me the settings for battery current .

Kindly help me on this.

Thanks,

Naresh

  • Hi Naresh,

    Is the actual charge current measured manually 0A?

    Thanks,

    Ning

  • Hi Ning,

    Yes, battery current showing Zero amperes.

    Could you please help me with the register configurations?

    Please help me driver changes if any.

    Or else give me latest bq25622 latest driver.

    Please help, which is critical for us 

    My mail id is naresh.nakka@tessolve.com

    Thanks, 

    Naresh.

  • Naresh,

    Sent the sample driver. It's recommended to get familiar with the charger operations manually first via the EVM before developing the driver. 

    Thanks,

    Ning.

  • HI Ning , 

    Thanks for attatching driver .

    I am attaching my changes in the driver , which makes me charging , discarging and charging full showing bu i observed below issue.

    letsay ,when i read the statuus charging  , and battery current showing 2mA , after 10 min also showing same . if i reboot /power cycle only chagnes are reflecting ,

    Kindly help me on this  . its urgent.

    my changes are done with name comment name  "TESSOLVE" in driver .

    bq2562x_charger.c
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    // SPDX-License-Identifier: GPL-2.0
    // BQ2562X driver
    // Copyright (C) 2020 Texas Instruments Incorporated - http://www.ti.com/
    #include <linux/module.h>
    #include <linux/i2c.h>
    #include <linux/power_supply.h>
    #include <linux/regmap.h>
    #include <linux/types.h>
    #include <linux/gpio/consumer.h>
    #include <linux/interrupt.h>
    #include <linux/delay.h>
    #include <linux/usb/phy.h>
    #include <linux/acpi.h>
    #include <linux/of.h>
    #include <linux/gpio.h>
    #include <linux/of_gpio.h>
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    DTS changes are below 

    bat: battery {
    compatible = "simple-battery";
    constant-charge-current-max-microamp = <1040000>;
    constant-charge-voltage-max-microvolt = <4200000>;
    precharge-current-microamp = <100000>;
    charge-term-current-microamp = <60000>;
    };

    bq25622: charger@6b {
    compatible = "ti,bq25622";
    reg = <0x6b>;
    pinctrl-names = "default";
    pinctrl-0 = <&main_charger_pins>;
    interrupt-parent = <&main_gpio0>;
    gpios = <&main_gpio0 50 GPIO_ACTIVE_LOW>;
    interrupts =<49 IRQ_TYPE_EDGE_FALLING>;
    ti,watchdog-timeout-ms = <40000>;
    input-current-limit-microamp = <1000000>;
    input-voltage-limit-microvolt = <4600000>;
    monitored-battery = <&bat>;

    //interrupt-cells = <2>;
    //ac-detect-gpios = <&main_gpio0 50 GPIO_ACTIVE_LOW>;
    //charge-enable-gpios = <&main_gpio0 50 GPIO_ACTIVE_LOW>;
    //ti,watchdog-timeout-ms = <40000>;
    //input-current-limit-microamp = <1000000>;
    //input-voltage-limit-microvolt = <4600000>;
    };

    Thanks, 

    Naresh

  • HI Ning , 

    Thanks for attatching driver .

    I am attaching my changes in the driver , which makes me charging , discarging and charging full showing bu i observed below issue.

    letsay ,when i read the statuus charging  , and battery current showing 2mA , after 10 min also showing same . if i reboot /power cycle only chagnes are reflecting ,

    Kindly help me on this  . its urgent.

    my changes are done with name comment name  "TESSOLVE" in driver .

    bq2562x_charger.c
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    // SPDX-License-Identifier: GPL-2.0
    // BQ2562X driver
    // Copyright (C) 2020 Texas Instruments Incorporated - http://www.ti.com/
    #include <linux/module.h>
    #include <linux/i2c.h>
    #include <linux/power_supply.h>
    #include <linux/regmap.h>
    #include <linux/types.h>
    #include <linux/gpio/consumer.h>
    #include <linux/interrupt.h>
    #include <linux/delay.h>
    #include <linux/usb/phy.h>
    #include <linux/acpi.h>
    #include <linux/of.h>
    #include <linux/gpio.h>
    #include <linux/of_gpio.h>
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    DTS changes are below 

    bat: battery {
    compatible = "simple-battery";
    constant-charge-current-max-microamp = <1040000>;
    constant-charge-voltage-max-microvolt = <4200000>;
    precharge-current-microamp = <100000>;
    charge-term-current-microamp = <60000>;
    };

    bq25622: charger@6b {
    compatible = "ti,bq25622";
    reg = <0x6b>;
    pinctrl-names = "default";
    pinctrl-0 = <&main_charger_pins>;
    interrupt-parent = <&main_gpio0>;
    gpios = <&main_gpio0 50 GPIO_ACTIVE_LOW>;
    interrupts =<49 IRQ_TYPE_EDGE_FALLING>;
    ti,watchdog-timeout-ms = <40000>;
    input-current-limit-microamp = <1000000>;
    input-voltage-limit-microvolt = <4600000>;
    monitored-battery = <&bat>;

    //interrupt-cells = <2>;
    //ac-detect-gpios = <&main_gpio0 50 GPIO_ACTIVE_LOW>;
    //charge-enable-gpios = <&main_gpio0 50 GPIO_ACTIVE_LOW>;
    //ti,watchdog-timeout-ms = <40000>;
    //input-current-limit-microamp = <1000000>;
    //input-voltage-limit-microvolt = <4600000>;
    };

    Thanks, 

    Naresh

  • HI TI, 

    Kindly help me how to set the battery current in the driver ?

    could you please help me how to set this Ibat current ?

    this current (ibat_adc )shwoing zero from driver .

    static int bq2562x_get_ibat_adc(struct bq2562x_device *bq)
    {
    int ret;
    int ibat_adc_lsb, ibat_adc_msb;
    u16 ibat_adc;

    ret = regmap_read(bq->regmap, BQ2562X_ADC_IBAT_LSB, &ibat_adc_lsb);
    if (ret)
    return ret;

    ret = regmap_read(bq->regmap, BQ2562X_ADC_IBAT_MSB, &ibat_adc_msb);
    if (ret)
    return ret;
    printk("ibat_adc_lsb =%d ibat_adc_msb=%d \n", ibat_adc_lsb, ibat_adc_msb);

    ibat_adc = ((ibat_adc_msb << 8) | ibat_adc_lsb) >> BQ2562X_ADC_IBAT_MOVE_STEP;

    printk("ibat_adc = %d BQ2562X_ADC_IBAT_STEP_uV=%d \n" , ibat_adc, BQ2562X_ADC_IBAT_STEP_uV);
    return ibat_adc * BQ2562X_ADC_IBAT_STEP_uV;
    }

    SUMMary : 

    • when its charging mode ibat_adc_msb =0 & ibat_adc_lsb = 0 so , showing ibat_adc = 0 
    • but when its in discharging mode , ibat_adc_msb & ibat_adc_lsb values shwoing 

    Please help me how to set battery currentt ?

    Thanks,

    Naresh

  • HI Ning,

    Any update on this?

    Thanks, 

    Naresh

  • HI Ti,

    Any update on this.

    Actually, we dont have EVK with us.

    Thanks,

    Naresh

  • Hi,

    Are you able to charge when operating the board manually? Please refer to the UG at https://www.ti.com/lit/ug/sluuck2a/sluuck2a.pdf for step-by-step instructions on how to set up the charger for charging.

    Thanks,

    Ning.