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.

BQ25798: Request for Driver Code or Example for BQ25798 Battery Charger IC

Part Number: BQ25798
Other Parts Discussed in Thread: BQ25792

Tool/software:

Hello,

I am working on a project that involves interfacing the BQ25798 battery charger IC via the I2C protocol. My goal is to configure the IC for battery management tasks such as setting input current limits, charge voltage/current, and monitoring battery parameters like voltage and current. Additionally, I aim to handle fault conditions such as over-voltage and over-temperature. The communication interface will operate at 400 kHz (Fast Mode).

I am looking for any existing driver code, libraries, or sample applications for the BQ25798 to streamline development. I have reviewed the datasheet and register map and explored the TI Resource Explorer and GitHub for relevant resources but could not locate suitable examples. I would appreciate guidance on specific initialization sequences, register-based configurations, or interrupt handling for this IC. If pre-existing libraries or application notes are available, they would be greatly beneficial.

Thank you for your assistance and support!

  • HI Pratham,

    The BQ25792 and BQ25798 share the same register set.  A linux driver for BQ25792 is at 

    https://git.ti.com/gitweb?p=ti-analog-linux-kernel/dmurphy-analog.git;a=commit;h=75997c21e9dfc0d54b7f774bfb37e6af796ff293.

    Regards,

    Jeff

  • Hii Jeff,

    I checked that drivers. According to that i created drivers for BQ25798 IC. But, I can't able to operate my device through this IC.

    I want to generate 5V at PMID pin of this IC from the connected battery, to operate my device on battery.

    please tell me what to do, to operate my device on battery only. Because, when I connect the battery my device doesn't gets power, I need to connect the adapter. But, when I remove the adapter while battery is connected my device operates on 5V.

    But, when i remove the battery and then again connects it, my device does not start.

    Please give me solution on below things:

    1. I need to operate my device on battery only with 5V supply.

    2. i need to control the PMID pin periodically for low power consumption.

    • When the device is active, I want to enable the PMID pin with a 5V output.
    • When entering low-power mode, I need to disable the PMID pin to minimize power consumption

    3. My device should worked on battery.

    Thank you for your assistance and support!

    Regards,

    Pratham

  • Hi Pratham,

    To confirm, you want:

    VBUS=PMID=5V to charge the battery 

    PMID remain at 5V when 5V supply at VBUS is removed  

    If so then you can use backup mode which requires the ACDRV1 FETs.  Backup mode auto turns on OTG mode very fast when VBUS drops below the backup mode threshold.  If the host disables OTG mode or VBUS is reapplied, the host must write to the charger to re-enable backup mode:

     The following sequence is used to switch from the battery power back to ACIN1 while simultaneously re-arming the backup mode: 1. Write BKUP_ACFET1_ON (REG0x16[0]) register bit to

    1. Setting BKUP_ACFET1 _ON = 1 will cause the device to set DIS_ACDRV = 0 and EN_ACDRV1 = 1. After that, backup mode is disabled, however, the charger remains in the normal OTG mode. The ACFET1-RBFET1 is turned on to connect the adapter to VBUS. The user must ensure the adapter voltage is equal to or higher than the charger VOTG voltage setting, otherwise, the charger OTG output might back drive the adapter connected to VBUS.

    2. Determine the source at ACIN1 is valid (is not in overvoltage and did not fail poor source detection) by reading back EN_ACDRV1 as 1.

    3. Set EN_OTG = 0, in order to exit OTG mode and enter the forward charging mode without PMID voltage crash. Setting BKUP_ACFET1_ON = 1, also clears BKUP_ACFET1_ON to 0 and sets EN_BACKUP to 1

    Regards,

    Jeff