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.

BQ40Z80: Control BQ40z80 using MCU for some functionality

Other Parts Discussed in Thread: BQ40Z80

Tool/software:

1. Can we configure the GPIO pins of the BQ40z80 to perform our specific task like enable/disable of charge/discharge ? I want them to communicate with MCU based on some conditions it needs to be performed. How to make the BQ40z80 perform based on the commands of the MCU ?
2. Can we connect the WAKEUP and SHUTDOWN pin of BQ40z80 to a single push button with different time interval of push for wakeup and shutdown ?
3. Can we perform the above function using MCU which in turn will be able to control the BQ40z80, if so how to make the BQ40z80 controllable by MCU, is there any reference or manual ?

  • Hello,

    1. Below are the capabilities of the GPIO pins of the bq40z80 device:

    2. This would not be safe due to the Wake Pin being tied between BAT and PACK while the shutdown pin is tied to Pin 17 and ground.

    3. The gauge would be able to enter and exit shutdown by commands sent by the MCU. More about this can be found in Section 6.6 of the bq40z80 Technical Reference Manual.

    In regards of making it controllable by the MCU, the document below can offer some direction, however it is meant for I2C:

    https://www.ti.com/lit/pdf/slua801 

    Regards,

    Anthony

  • Hello Anthony,
    Thanks for clearing the doubts regarding 1 and 3.
    For 2, May I know why exactly is it not safe ? As I need to have the wakeup and shutdown with one push button.
    And as an alternative can I use the MCU for this functionality which control the bq40z80 ? Is this possible if yes, may I know how exactly?

  • Hi Manas,

    On the bq40z80 EVM, there is a button labelled WAKE that allows the gauge to wake up by connecting the BAT and PACK+ pin. If this was the same button used for the shutdown button, it would be unsafe due to the amount of current.

    I am unclear whether you are aiming to exit SHUTDOWN or SLEEP mode, but there are ways to exit both in this scenario:

    To exit shutdown, the same button connected to the SHUTDN can be pressed again. This is depicted below:

    To exit sleep, the gauge will do this on its own if communication is received. This can be done by the MCU.

    Regards,

    Anthony 

  • Hello Anthony,
    Sorry for the confusion.
    What I want to achieve is that there will be one push button, the bq40z80 would be in shutdown mode initially, it needs to perform wake-up on one short press and fully turn on with a long press of the same push button.
    So can this be achieved by the bq40z80 or should it be done with the MCU?
    If this can be achieved by bq40z80 can I know the connections to be made for it?
    And if it's through MCU can I know in detail how?

  • Hi Manas,

    What I want to achieve is that there will be one push button, the bq40z80 would be in shutdown mode initially, it needs to perform wake-up on one short press and fully turn on with a long press of the same push button.

    I believe this is where I am getting confused. If the gauge is in shutdown initially, and the button is pressed causing a high to low transition on the shutdown pin, this should make the gauge enter normal mode. The gauge would be fully turned on at this point unless it falls into sleep mode after based on the current. However, the gauge can exit and stay out of sleep if communication is received by the gauge.

    Also, the shutdown pin debounce time cannot be altered, so it would not be possible to have two different actions based on how long the button is held.

    Regards,

    Anthony

  • Hello Anthony, 
    So, the shutdown mode is not possible.
    In that case with the single push button is it possible to make the gauge enter wake-up mode and then go to sleep mode after a short press of the push button?
    And is it possible to make it enter the normal mode with a long press of the push button?

  • Hi Manas,

    In that case with the single push button is it possible to make the gauge enter wake-up mode and then go to sleep mode after a short press of the push button?

    Entering Sleep Mode is reliant on the current being seen from the device, and if the current is below the Sleep Current Threshold amongst other conditions. I do not believe it is possible to force the gauge into sleep mode using a push button.

    And is it possible to make it enter the normal mode with a long press of the push button?

    A push button can be used to enter and exit shutdown, with the exit conditions seen below, however the debounce delay must be 1s.

    Regards,

    Anthony

  • Hello Anthony, 
    So what happens if the SHUTDOWN push button is pressed when the BQ is in off condition?
    And, thanks for clearing the doubt that the sleep mode from the push button is not possible.
    The BQ will enter the normal mode when the SHUTDOWN button is pressed when the BQ is in the OFF state. Is my understanding correct about this?
    And with the same SHUTDOWN button, it will perform SHUTDOWN if pressed again. Am I right regarding this?

    So if that can be done it's not necessary to keep the WAKEUP button?

  • Hi Manas,

    So what happens if the SHUTDOWN push button is pressed when the BQ is in off condition?

    If the device is in SHUTDOWN mode caused by the button being pressed, then pressing the button again will have it exit shutdown mode and enter normal mode. This button can only be used if the shutdown mode is entered using the button, which is known as the Emergency FET Shutdown mode. There are other Shutdown modes detailed in Section 5.4 of the TRM:

    https://www.ti.com/lit/ug/sluubc1d/sluubc1d.pdf?ts=1724768942716&ref_url=https%253A%252F%252Fwww.google.com%252F

    So if that can be done it's not necessary to keep the WAKEUP button?

    The Wake button is there to help the gauge exit a Voltage Based Shutdown. This button should not be needed if the DA Config in the data memory of the gauge is configured for the right amount of cells. 

    Regards,

    Anthony

  • Hi Antony,

    So it means that initially to power on the bq40z80, we cannot use the SHUTDOWN button. Is this correct?
    If so, then how will the bq40z80 be powered on initially?
    Or, will it be in SLEEP mode itself initially?

  • Hi Manas,

    So it means that initially to power on the bq40z80, we cannot use the SHUTDOWN button. Is this correct?

    Correct. When the gauge is initially powered on, it will be in a Voltage Based Shutdown. The exit condition for this is the voltage seen on the pack pin being greater than the start up voltage, so when power is introduced to the system it should exit shutdown on its own and enter normal mode.

    The shutdown button would not work here because it is not an Emergency FET shutdown.

    Regards,

    Anthony

  • Hi Anthony,

    The gauge will initially be in a voltage-based shutdown mode. Is this correct?
    When the pack pin voltage is greater than the start-up voltage, power is introduced and the gauge enters normal mode.

    Is this understanding correct?

    If so, it would be not necessary to use the wakeup button to power on the gauge?

  • Hi Manas,

    The gauge will initially be in a voltage-based shutdown mode. Is this correct?
    When the pack pin voltage is greater than the start-up voltage, power is introduced and the gauge enters normal mode.

    Is this understanding correct?

    This is correct.

    If so, it would be not necessary to use the wakeup button to power on the gauge?

    This depends on whether the DA Configuration parameter is set correctly to represent the amount of cells being attached before powering on. If the DA configuration is set for 4 cells and 4 cells are attached, the gauge should wake up. If the DA Config is set for 4 cells and 1 cell is attached, the wake button will be needed to wake the device up long enough to change the DA config.

    Regards,

    Anthony

  • Hi Anthony,

    I think this clears my doubt for now. I will ask a new question if any arises. Thank you for clearing up the doubts.

  • Hi Manas,

    Understood, please let us know if any questions arise.

    Regards,

    Anthony

  • Hello Anthony, 

    Related to the push button doubts, I mainly need to perform two functions 
    1. Power on/off 
    2. Battery Status

    Can these be on the same push-button with one function as a short press and the other as a long press?
    If yes, what needs to be done to achieve it?
    If not achieved using a single push button, using a separate push buttons what connections need to be done?

  • Hi Manas,

    If the push button is directly attached to the gauge, then having a push button with different functionality based on how long it is pressed is not possible. I believe that if you used your host MCU to perform certain actions to the gauge when the button is pushed for different times is possible, however we cannot provide insight to how to go about this from the MCU side.

    If you were to use different buttons, then to power on/power off can be done with a single button attached to the SHUTDN pin. This would allow the gauge to enter and exit shutdown mode.

    For Battery Status, I am slightly unclear on this. Are you looking for the gauge to read the battery status register or display the SOC via the LEDs when the button is pushed?

    Regards,

    Anthony

  • Hi Anthony,

    Thank you, got the clarity for implementing the push button, and will go forward with two different push buttons as it's much easier to implement. 

    For battery status, yes the gauge needs to display the SOC via LEDs when the button is pushed. What can be done to achieve this?

  • Hi Manas,

    For battery status, yes the gauge needs to display the SOC via LEDs when the button is pushed. What can be done to achieve this?

    This can be achieved using the DISP pin functionality of the device. How to configure this can be found in Section 9.1 of the bq40z80 TRM.

    Pins 13, 15, or 17 can be configured to be the DISP pin of the device.

    Regards,

    Anthony