Skip to main content
Mohan1
Associate III
September 27, 2019
Question

Communication between stm32l476rc and fuel gauge(bq40z50r2) through I2C.

  • September 27, 2019
  • 2 replies
  • 1243 views

Hello sir, i am trying to send command to fuel gauge from stm32l476 to get data like voltage,current and temperature of battery but not getting sir.Even sda or scl line unable to see on oscilloscope. i written a code for i2c but not working .please give me suggestion.

This topic has been closed for replies.

2 replies

S.Ma
Principal
September 27, 2019

Did you put the pull-up resistors on the bus? the obvious first check.

Then find a SW GPIO bit bang I2C driver (I shared one on this forum, just not too sure how easy it is to retrieve it), and run it with a debugger.

To check if the GPIO SDA and SCL works, just try it manually through the GPIO registers on the debug watch window.

Mohan1
Mohan1Author
Associate III
September 27, 2019

thanks for your reply sir ,pull up resistor already i checked,it is there. you said that 'To check if the GPIO SDA and SCL works, just try it manually through the GPIO registers on the debug watch window' can you tell me more about this?

Tesla DeLorean
Guru
September 28, 2019

Configure the pins as GPIO outputs, and drive the pins alternately high and low, like you would with an LED

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Amel NASRI
Technical Moderator
September 30, 2019
To give better visibility on the answered topics, please click on "Best Answer" on the reply which solved your issue or answered your question.