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.

BQ25792: How to configure Bq25790 in the driver code

Part Number: BQ25792
Other Parts Discussed in Thread: BQ25790, , EV2400

Hello TI,

I am using the Bq25790 as the Battery charger, I have done the following changes in my device tree : 


bat: battery { 
compatible = "simple-battery";
constant-charge-current-max-microamp = <2040000>;
constant-charge-voltage-max-microvolt = <4352000>;
precharge-current-microamp = <180000>;
charge-term-current-microamp = <180000>;
};

charger@6b { 
compatible = "ti,bq25790";
reg = <0x6b>;
monitored-battery = <&bat>;
ti,watchdog-timeout-ms = <40000>;

input-voltage-limit-microvolt = <4500000>;
input-current-limit-microamp = <2400000>;
};

I want to boot my HW through the battery, But unable to boot. Can you please guide me what changes are required to be done either in the device tree or the driver code, I have refered your driver code provided for BQ25790. And can you please guide me how to configure the register settings provided in the driver code. 

Thanks & Regards,
Monica 

  • Hi Monica,

    BQ25790 has input OVP set to 7V.  If your input voltage is higher than 7V and you use the input MUX fets, you need to add a line of code that increases the OVP.  The register is REG0x10[5:4] as shown below:

    Other than that, the BQ25792 linux driver should work for the BQ25790 because the registers are the same.

    Regards,

    Jeff

  • Hi Jeff,
    In my driver the BQ25790_CHRG_CTRL_1 0x85 register is configured for 26V by default. And the input required for my Hw is 5V.
    I am able to charge my battery with default configuration but unable to power up my hardware through battery (without external supply).

    Thanks & Regards,
    Monica

  • HI Monica,

    There are no registers required for the battery to supply a voltage at SYS.  If there is shipFET between the BAT and battery, the SDRV automatically turns on by default.  With or without a shipFET, the internal BATFET from BAT to SYS turns on by default.  Is it possible that the driver code automatically puts the charger into ship or shutdown mode when input is removed?  Can you check to see if REG0x11[2:1] are being written

    Regards,
    Jeff

  • Hi jeff, 

    In my driver code the SDRV_CTRL register is set to 0h in IDLE mode itself, the Hw is booting through the external supply with battery connected to the IC as soon as I remove the supply the battery works but not booting with connected individually without external supply.

  • Hi Monica,

    When there is no supply, is the battery voltage at charger SYS output? 

    Regards,

    Jeff

  • Hello Jeff,

    My system has successfully booted after configuring the PROG resistors for 1s settings, However, when we attempt to measure the charging voltage of the battery, we are not getting the expected charging voltage; instead, we are obtaining the battery's voltage(i.e 3.8V).
    Also, when charging and also battery is connected we are not getting the correct VSYS (we are getting 3.8V).

    Please can you also guide me what else driver changes required, I am refering your https://git.ti.com/gitweb?p=ti-analog-linux-kernel/dmurphy-analog.git;a=commit;h=75997c21e9dfc0d54b7f774bfb37e6af796ff293 driver and 
    My vsys min value set to 00h 
    #define BQ25790_MIN_SYS_V 0x00 

    Thanks & Regards,
    Monica 

  • Hello Monica,

    The battery voltage will be in real time what is measured on the battery. It will only be the charge voltage once it has terminated. For example a 4.2 V regulation battery can read 3.6 V, 3.8 V, and 4.0 V before reaching its full charge voltage. It does not instantaneously output the full charge voltage of the battery. Please see Figure 9-10.

    As for the system, it will track the battery voltage once above the MINSYS setting. Please see Section 9.3.8.1.

    Regards,

    Mike Emanuel

  • Hello Michael,

    How can I retrieve the status and faulty register values using the cat command? If I check cat /sys/class/power_supply/bq25790-charger/status, it shows 'discharging' always. How can I troubleshoot and resolve this? and can you please tell me is there anything we are supposed to change on driver side for 1s settings.

    And also I can not access the registers using echo command as mentioned  in dbg_bq25790.c driver code. 

    Thanks,
    Monica

  • Hello Monica, 

    We do not support driver development explicitly when it comes to linux. Please use an EVM with EV2400 to learn how to use the device and work with its registers.

    Regards,

    Mike Emanuel