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.

BQ25790: How to exit OTG mode automatically when VBUS is applied?

Part Number: BQ25790
Other Parts Discussed in Thread: BQ25798

Hello,

MY GOAL

So what I want is when VBUS is applied and VBAT is applied, charging should start.

OTG_MODE is set to 1.

Then when I remove VBUS, 5V is present as a source on VBUS so that If I plug a device, this device will be powered.

If I plug back a host or power source, then it starts the charging.

SO WHAT IS THE PROBLEM

VBUS is applied and VBAT is applied, charging start=> OK

OTG_MODE is set to 1.

VBUS removed, Device plug => OK device is enumerated

VBUS removed, Host/Power plug => NOK, the battery is not charging

 

So, how the charging could be back automatically? 

Thank you

  • HI Maxime,

    Unfortunately, the charger has no way to know that a new voltage is applied at VBUS when OTG is also providing a voltage at VBUS, unless the applied voltage is higher than the OVP threshold in OTG mode.  The host software is responsible for controlling the transition from OTG back to charging.  Even the BQ25798 which has backup mode feature for fast transition into OTG on PMID pin from charge mode requires host action to transition from OTG back into charge mode after VBUS is reattached.

    Regards,

    Jeff

  • Jeff,

    Thank you for your response.

    To be back in Charging mode, only OTG_EN has to be driven low?

    So is the best way to do this,  the use of the CC driver controlled by the Soc in order to know if the charger need to act as OTG or Charging mode?

    Thank you

  • Hi Maxime,

    Yes, setting OTG_EN = 0 while CHRG_EN=1 resumes charging.

     I don't fully understand your suggestion.  Can you give me explanation.

    Some customers use a mechanical switch tied to host GPIO to detect adapter plug in. 


    Regards,

    Jeff

  • Hello Jeff,

    What I mean is that I have on my board a USB Type C connector and then a CC logic driver PTN5150AHXMP.

    This driver output a GPIO that is high in device mode and low in host mode.

    So, what I think is to use this pin indicator to know when a device is plug and then enable the OTG mode in this case.

    When this GPIO is back to high, I enable the charging.

    Thank you