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.

BQ25798EVM: Sequence for setting EN_CHG=0

Part Number: BQ25798EVM
Other Parts Discussed in Thread: BQ25798, BQ4050, BQSTUDIO

Hi, I am working on a product where the CE Pin is always pulled low, and we need firmware control over the charging on/off conditions for battery. In the middle of the charge cycle, if I write EN_CHG=0 in REG0F_Charger_Control_0 register, then the charging doesn't stop. The REG0F_Charger_Control_0 register reads back as 0xE1. Subsequently, setting the register value to 0xA2 doesn't work and continues to report 0xE1. The only way to recover is to disconnect the power adapter and battery. 

What is the correct approach to disable charging thru I2C while power adapter is plugged in and battery is being actively charged and CE pin is hardwired to always be low?

  • Hello,

    In the BQ25798, "Battery charging is enabled when EN_CHG bit is 1 and CE pin is LOW. CE pin must be pulled HIGH or LOW, do not leave floating."

    Also writing 0xA2 to REG0F enables charge as well as writing 0xE1. Please make sure bit 5 in REG0F is written low.

    Regards,

    Mike Emanuel

  • Hi Michael,

    Yes, the CE pin in my setup is always pulled LOW. At power up, the MCU sets the EN_CHG pin to 1 for enabling the charging. That works and the battery charges (I use BQ4050 fuel gauge evm and it reads back the current status of the cells). 

    However, when I need to explicitly halt the charging, only resetting the EN_CHG bit to 0 doesn't stop the charging until power supply adapter is removed. And, once I write the 0x02 or 0x82 to the REG0F, the value read back is 0xE1 - bit6 gets stuck till both the power adapter as well as the cells are disconnected. Writing 0xA2 to the REG0F doesn't re-enables the charging. So, the problem I see is 
    1. Stopping charging only by clearing the EN_CHG bit (while CE is pulled low) doesn't work. REG0F reports back as 0xE1
    2. Once REG0F reports 0xE1, only way to re-enable charging is complete power off / removing all cables. 

    I am using 3s Li-ion and the power supply is set to 14V, 2A max. 

  • Hello,

    What is your watchdog setting set at? The EN_CHG bit is reset by the watchdog timer.

    Regards,

    Mike Emanuel

  • Hi Mike,

    The watchdog is disabled by writing 0h to WATCHDOG_2:0 in REG10_Charger_Control_1.

  • Hello,

    When I disable the watchdog and disable charging by writing EN_CHG to 0 the charging stops. Can you please capture the I2C of the transaction when this is happening (waveform)? Also, is BQStudio being used to write to this register? If using the bit fields on the right, one has to press the "W" button to make the command go through. Please also send your registers before and after.

    Regards,

    Mike Emanuel

  • Hi Mike,

    While capturing the data using logic analyzer, I found the problem. I have BQ4050 on the same I2C pins and that uses the Smbus protocol. The firmware I was running on the MSPM0 mcu was having write errors to BQ25798, especially when the Smbus access to the fuel gauge preceded the write I2C to BQ25798. It caused incorrect values being written to BQ25798. I have fixed the driver and now it works.