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.

BQ27531-G1 with BQ24190: Enable USB OTG

Other Parts Discussed in Thread: BQ24190, BQ27531-G1, BQ24192

Hello,

we are using a BQ24190 charger IC connected to a BQ27531-G1 on a custom board. Charging works fine. But now I'm trying to enable the BQ24190s USB OTG boost converter to generate USB Vbus supply needed for host mode. To accomplish this, I'm sending the control subcommand OTG_ENABLE (0x0015) to the BQ27531. But this doesn't seem to work.

To make sure the Vbus generation works in general, I've connected the BQ24190 directly the the host processors I2C bus. Setting bits 4 and 5 in the power-on configuration register (0x01) to [10] enables the OTG boost converter as expected and I can see 5V on VBUS.

Are there any additional steps necessary to make the OTG_ENABLE subcommand to the BQ27531 work?

Thank you very much and best regards

  • There are a couple things to check here. First, make sure the OTG pin is pulled high to enable the feature (this in addition to sending the MAC command). Second, make sure the endinaness of the command is correct. Try switching the bytes and see if that works. Finally, make sure the Product Number in Charger data flash class is correct. The default is is 40, but this is for the bq24192 charger. For the bq24190 charger, the Product Number should be 32. This number must be correct, otherwise the gauge will not communicate with the charger. The charger will still charge, but it will be in default mode. Make sure to reset the gauge if you have to change this number.

    If that still doesn't help, please send us a GG file and list of commands that your host uses to interact with the gauge.

  • Thank you for your reply. The OTG pin is high. I'm also sure the command endianness is correct (other 2 byte commands work fine). Upon your advice I've changed the charger product number in the data flash to 32 and did a gauge reset. Now I'm able to read the charger registers using charger data commands. But unfortunately the OTG enable command still doesn't work.

    Chase7071949597 said:
    If that still doesn't help, please send us a GG file and list of commands that your host uses to interact with the gauge.

    The host CPU runs Linux (Android) and I'm using the driver from https://github.com/aneeshv/linux-bq27xxx and just added a function which sends the OTG enable subcommand. Apart from the charger product number I've changed nothing in the gauges configuration so it should still have factory settings.

    Thank you and best regards

  • Hello,

    unfortunately I'm still not able to use USB OTG with my BQ27531 - BQ24190 combination.

    In the meantime, among trying different things, I've captured the commands the driver uses to interact with the gauge (charger product number is set to 32, nothing else was changed in the gauges flash):

    Init:
    wr 0x00: 0x0002 # Fw Version
    rd 0x00: 0x0102
    rd 0x0a: 0x39   # Flags

    Update cycle, every 60s (just read current, capacity, etc.):
    rd 0x2c: 0x002c
    rd 0x16: 0x0077
    rd 0x12: 0x0919
    rd 0x0a: 0x0139
    rd 0x06: 0x0b77
    rd 0x2a: 0x0000
    rd 0x24: 0xf8cb
    rd 0x08: 0x0e38
    rd 0x08: 0x0e38
    rd 0x14: 0xfe05
    rd 0x14: 0xfe05
    rd 0x0c: 0x0418
    rd 0x08: 0x0e38
    rd 0x14: 0xfe05

    On OTG enable:
    rd 0x76: 0x1b   # charger POR register (just for debugging)
    wr 0x00: 0x0015 # OTG enable subcommand
    rd 0x00: 0x0000 # result of command (?)
    wr 0x00: 0x0000 # read gauge status (just for debugging)
    rd 0x00: 0x6284
    rd 0x76: 0x1b   # charger POR again - should be 0x2b or 0x3b - but hasn't changed


    Is there maybe missing something in the initialization (as there isn't really one), to enable the OTG subcommand?

    Thank you and best regards