The TI E2E™ design support forums will undergo maintenance from July 11 to July 13. If you need design support during this time, open a new support request with our customer support center.

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.

BQ76905: Cannot communicate via I2C between STM32L5xx and BQ76905.

Part Number: BQ76905

Tool/software:

Hello,

I am trying to establish communication via I2C with the BQ76905 and the STM32L5xx Series. I have initalised the I2C1 line via CubeMX and am now trying to read cell voltages from the IC. I am using the functions provided by the code examples. However, everytime I try to use the DirectCommand to read or write, I keep falling into the error loop. In order to know if the command to read was executed correctly, I trigger a GPIO Pin (connected to the Oscillocope) to see if it worked, and it always fails. 



PACK1I2C is defined correctly. I created a new project just to test this I2C communication and it does not work. 

Any help or advice to move forward would be very much appreciated. I have been stuck here for a couple of days now. Thank you guys.

  • Hello Anand,

    Could you share a logic analyzer file of you trying to communicate via I2C? Are SCL and SDA measuring ~3.3V before you try to communicate? When you say error loop, what kind of ‘error’ are you seeing?

    Best Regards,
    Alexis

  • Hey Alexis,

    Thank you for your message. I am not exactly sure what you mean by the logic analyser file. Yes, SCL and SCA are 3.3V before I try and communicate. After some more debugging, I found that the problem seems to be here in the HAL_I2C_Master_Transmit Command

    if (I2C_WaitOnSTOPFlagUntilTimeout(hi2c, newTimeout, tickstart) != HAL_OK)

    It then it returns HAL_ERROR

     This means that I am not getting an ACK from the slave device. So I will contiune to investigate what the problem could be. I have pull up resistors connected. I am using the device address to read as 0x11 and to write as 0x10. Let me know if you have any tips.

    Kind Regards,


    Anand

  • Hello Anand,

    I am not exactly sure what you mean by the logic analyser file.

    A logic analyzer helps capture and display multiple logic signals from a digital system or digital circuit. Using a logic analyzer on the communication lines, can help determine if the part is actually communicating and help debug issues that pop up when trying to communicate.

    I am using the device address to read as 0x11 and to write as 0x10. Let me know if you have any tips


    This What is the I2C Device Address of the BQ769x2 Family FAQ may help your issue.

    Best Regards,
    Alexis