Author Topic: Attempts to read SMBUS through I2C not going so well.  (Read 798 times)

0 Members and 1 Guest are viewing this topic.

Offline RefrigeratorTopic starter

  • Super Contributor
  • ***
  • Posts: 1542
  • Country: lt
Attempts to read SMBUS through I2C not going so well.
« on: October 16, 2021, 02:38:30 pm »
I'm trying to interface a laptop battery through SMBUS with I2C but i'm not having much luck.
Battery acknowledges data but when i try to read internal registers it returns decimal 23, no matter what i'm trying to read.
Perhaps i'm doing something wrong?
Battery is operational and i know the pinout is correct because this is not my first time reading from it.
Difference being that previously i did it with an arduino nano with PackProbe code, but now i have an STM32.
Previously used code was not compatible so i'm trying to write my own.
Datasheet of the BMS IC:
https://www.ti.com/lit/ds/symlink/bq20z45-r1.pdf?ts=1634387207837&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FBQ20Z45-R1


Edit: included another screenshot where i attempt to read relative state of charge and get the same result. Also changed the readout to HEX.
« Last Edit: October 16, 2021, 02:46:31 pm by Refrigerator »
I have a blog at http://brimmingideas.blogspot.com/ . Now less empty than ever before !
An expert of making MOSFETs explode.
 

Offline RefrigeratorTopic starter

  • Super Contributor
  • ***
  • Posts: 1542
  • Country: lt
Re: Attempts to read SMBUS through I2C not going so well.
« Reply #1 on: October 16, 2021, 03:52:23 pm »
Checking SMBUS application notes shows that what i am getting is a successful read from the battery but the data received does not seem to change.
Perhaps the probem lies in the write section where i tell which register to load?
I have a blog at http://brimmingideas.blogspot.com/ . Now less empty than ever before !
An expert of making MOSFETs explode.
 

Offline RefrigeratorTopic starter

  • Super Contributor
  • ***
  • Posts: 1542
  • Country: lt
Re: Attempts to read SMBUS through I2C not going so well.
« Reply #2 on: October 16, 2021, 04:26:39 pm »
Found another SMBus application note, this time from texas instruments.
The BMS IC i'm trying to communicate with was made by them, so if anyone is to tell me how to do it, it's them, right?
And according to their diagrams my communications are correct also.
Although there is a small mistake on part of TI, see if you can spot it.

Not sure then why i'm getting wrong data. Perhaps i should try another battery pack? :-// :-//

« Last Edit: October 16, 2021, 04:35:27 pm by Refrigerator »
I have a blog at http://brimmingideas.blogspot.com/ . Now less empty than ever before !
An expert of making MOSFETs explode.
 

Offline RefrigeratorTopic starter

  • Super Contributor
  • ***
  • Posts: 1542
  • Country: lt
Re: Attempts to read SMBUS through I2C not going so well.
« Reply #3 on: October 16, 2021, 06:07:15 pm »
I didn't have a battery that i knew the pinout of but i had a bag of BMS boards that i pulled from old laptop packs.
Hooked one up and it works  :-+
So my comms were correct, but i guess the pack i was trying to read is bricked somehow  :-//
Anyways it works and all is well.  :)

Code: [Select]
Design Capacity: 4400
Design Voltage: 11100
Manufacture Date (Y-M-D): 2010-7-22
Serial Number: 8906
Specification Info: 49
Cycle Count: 815
Voltage: 4.74
Full Charge Capacity: 1322
Remaining Capacity: 0
Relative Charge(%): 0
Absolute Charge(%): 0
Minutes remaining for full charge: 65535
Cell 1 Voltage: 1434
Cell 2 Voltage: 1730
Cell 3 Voltage: 1577
Cell 4 Voltage: 0
State of Health: 536874816
Battery Mode (BIN): 0b1
Battery Status (BIN): 0b100101111010111
Charging Current: 0
Charging Voltage: 536874816
Temp: 23.35
Current (mA): 0
« Last Edit: October 16, 2021, 07:33:35 pm by Refrigerator »
I have a blog at http://brimmingideas.blogspot.com/ . Now less empty than ever before !
An expert of making MOSFETs explode.
 
The following users thanked this post: fullmoon6661


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf