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.

BQ24295: How to disable automatic D+/D- detection

Part Number: BQ24295
Other Parts Discussed in Thread: BQ24296

I have a device that needs to use the USB port for data as well as charging, so the D+ and D- lines are connected to the micro controller in the device. The microcontroller has the necessary hardware in its USB peripheral to perform the BC1.2 detection procedure and both the dead and good battery algorithms have been fully implemented in the firmware. The firmware sets the input current limit of the bq24295 appropriately.

Since the selection of input current limit is fully under the control of the firmware I would like to completely disable the detection built into the bq24295 as it is unnecessary and incorrectly overwrites the current limit set by the firmware. I have not been able to identify any register fields that would prevent the detection from running at all. The only field that sounds like it might be related is the DPDM_EN field (bit 7) of the Misc Operation Control Register (REG07), however that is to force the bq24295 to perform the detection procedure again, not to stop it from performing it in the first place.

Is it possible to stop the detection all together? I see that there are three reserved fields in the Misc register and one of them suspiciously has a reset value of 1. Does that by any chance stop the detection?

Thanks,

Rich

  • Hey Rich,

    The only way to disable the detection is through hardware. You may optionally short the D+/D- lines of the charger together, and isolate them from your actual circuit.

    This yields a maximum current limit that your MCU can override through I2C.You may also consider switching to the bq24296 as a drop-in replacement as it has a /PG and PSEL pin instead and will not perform USB detection.

    Regards,

    Joel H

  • Hi,

    Thanks for the quick response. The device in question already has the D+ and D- lines of the charger tied together, exactly like you have suggested. The problem arises when the charger's internal detection algorithm completes after the firmware has set its desired input current limit.

    Specifically the following occurs if the battery in the device is dead:

    1. User plugs in USB cable (charger IC begins detection)
    2. Firmware boots and sets 100mA limit (to comply with USB spec)
    3. Firmware decides that the battery is dead (according to BC1.2 spec) and therefore takes advantage of the Dead Battery Provision (DBP) to charge with a maximum input current of 100mA for up to 45 mins with no further detection.
    4. The charger IC detection completes and sets the current limit to 3A.

    I have now implemented a work around for this that consists of writing to the Input Source Control Register (REG00) every time there's an interrupt from the charger, but it would be nice if there was a cleaner solution.

    Thanks,
    Rich
  • Hey Rich,

    Is your host powered else-where or directly off of the SYS pin of the charger? Do you have other loads connected to the SYS pin?

    If no loads on SYS, I would recommend disabling charge until a valid input source is detected and you have changed the input current limit to your liking (post charger USB detection). This way, you won't pull current from the input source until your host decides.

    Regards,

    Joel H