Using I2C for SMBus device communications


#124

You may want to look in these threads

[SOLVED] I2C requestFrom() - how to read > 32 bytes?
I2C - Increasing buffer size to 258 compilation error


#125

Thanks! Not sure why I didn’t search this forum first and assumed I was the first to have this problem :confused:


#126

Hello can some body tell is it possible to reset bq20z45 using arudino.i want to clear the Flags,mosfet status,capacity,current,cycle count,…
here i found software http://be2works.com which does it but in my country related hardware is not available.
any help is appreciated


#127

It’s possible but you need the register map and maybe SMBus formatting to get it to work.

To make life easier just source the TI EV2300 or EV2400 adapter somehow.


#128

thank you for replay but i know only soldering no programming .also sourcing TI EV2300 or EV2400 to bhutan will cost around $350 which is way expensive to me afford…

can you guide any way to do…this will help alot…
thank you…!


#129

You would need the Datasheet for the TI chip your trying to read and then create some code to read and write those registers you need to change using a Microcontroller of your choice.


#131

hey i got datasheet with registers can you create an example code how to read and write those registers…?


#132

I do not have time to help you with this.

You’re going to have to learn this yourself or search the web for Arduino code that is already written for this line of BQ devices. Search for the BQ40z50 and see if anything comes up, its a popular chip.


#133

Hello RWB!!!

Great fault finding so far :slight_smile:
I am working on the same project.But i need to pass battery voltage and current data from BMU to my arduino.My bmu has the BQ40z50. Im little bit lost… Can you repost your working code or give some basic example as reference point?

Thank you


#134

There will be plenty of examples out there like this https://github.com/ArminJo/Smart-Battery-Module-Info_For_Arduino but also others for other processors. You should also be able to get some ideas by looking at Particles code for their PMIC, or samples for other TI devices, many of them are similar.

For non-arduino style systems they won’t have the convenience of the Wire library so will implement I2C at quite a low level, the Wire library hides a lot of complexity.
If you find a full library it will include methods for every feature on the device, however (presumably) you only want a few select figures and you can get those with a few select commands.

I would recommend reading how to use Wire.read/write and experiment with reading some of the values off the chip. Once you can do that the only thing left is probably some maths to turn the values into numbers you can read.
Lastly I can also tell you that Linear BMU/PMICs typically have what they call “Linduino” libraries for their products in with their documentation, they need a little tweaking to work on a photon as they re-implement some I2C stuff for no apparent reason .


#135

Could you access to the bq with a valid response? if so, is the source code accessible?