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.

BQ4050EVM-561: Interfacing BQ4050EVM-561 with STM32F7 and fetch Batt. Pack Vtg and display on STM32F7 UART

Part Number: BQ4050EVM-561
Other Parts Discussed in Thread: BQ40Z50, BQSTUDIO

Hello,

I am trying to interface BQ4050EVM-561 with STM32F7 and fetch Batt. Pack Vtg and display on STM32F7 UART.

How should I proceed in this.

The device address is 0x17 ?

And the register address of battery pack vtg is mentioned as 0x09 on

Any specific tips?

Thank You,

Ameya

  • Hi Ameya,
    The bq40z50 uses SMbus protocol. More information on this can be found at www.ti.com/.../slua475.pdf
    The 8-bit address is 0x16/0x17, where the lowest bit indicates if it is a read ( bit is 1) or a write(bit is 0).
    You should be able to send a read word command of 0x09 with return length of 2-bytes to get the Voltage.

    You can also try this in the "Advanced Comm SMB" tab of bqStudio while monitoring it with a bus sniffer, and duplicate the sequence in your code:

    Regards,

    Swami

  • Hello Swami,

    Thanks for replying.

    I tried the above.

    But I'm not getting the desired result.

    As per my debug statements (on UART), There is an issue with the receive statement. *The receive statement doesn't seem to work.

    What could possibly be going wrong?

    Regards,

    Ameya.
  • Hello,

    Any updates?

    After sending read word command to 0x09 (by transmit function) I am getting the state of the SMBus in the receive function as "HAL_SMBUS_STATE_MASTER_BUSY_TX" which means "Master Data Transmission process is ongoing", what should be done?

    Thank You,

    Ameya
  • Hi Ameya,

    With your STM implementation, please increase the delay between sending commands and try again.

    If the issue still persists, please confirm that you are able to communicate with the gauge using the advanced comm window in bqStudio as shown above. If this works, please use a logic analyzer to check the waveform of the known good process against the waveform generated by the custom microcontroller code.

    Sincerely,
    Bryan Kahler