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.

BQ34Z110 I2C w/ Ardunio

Other Parts Discussed in Thread: BQ34Z110

I'm trying to do data commands so that I can read the voltage,current, etc. Using code posted on this forum, I was able to access the data flash (checked subclass 112 and they match ), but I'm having trouble doing data commands.


I've been trying to get device id or chem id, and tried a few of the ways posted here already but its still not working.


My output is : DevID: 32. Shouldn't I be getting a device id like 0110? Edit: sometimes I get 2E...

I try a similar way to get the chemID and the output is: chemID: 30. Shouldn't the chemID be 0x0800? Edit: sometimes I get 2D...

Am I setting up my board incorrectly? Am I not writing the correct values? Any help would be much appreciated.


To get the device ID, I do

Wire.beginTransmission(0x55);
Wire.write(0x01); //Control
Wire.write(0x00); //Control
Wire.endTransmission();

Wire.beginTransmission(0x55);
Wire.write(0x01); //DevID
Wire.write(0x00); //DevID
Wire.endTransmission();

delay(0.1);
Wire.requestFrom(0x55, 2);
uint16_t q = Wire.read();
Serial.println(q,HEX);




  • Sonny

    Here is a document that I have posted on the forum before. It helps with working the various communications types on the device.

    Tom

    4152.bq34z100 DF access.pdf

  • Hi Tom,

    I tried the examples in that document, and keep getting fluctuating answers.

    First I calibrate the board (Calibrate coulomb counter, measure the voltage of the battery and calibrate it, calibrate board offset, draw 1A and calibrate pack current)

    Then, when trying to get the device type:
    1. Enter I2C command 00, Data Block 0100 in "Write I2C Data Block" and press Write Data button.
    2. Enter I2C command 00, Data Size 2 and pres Read Data, the GUI returns 65FB. When I repeat step 1 and hit Write Data multiple times, I read 1001, little endian for 0110, the correct answer.
    3. Then when I use "Read/Write I2C Byte" (enter command 00, byte 10 / command 01 byte 01 for bq34z110, then try to read 00 and 01) I get 65FB again. Sometimes I get 70FB, but never 1001.

    Something similar happens when I try to read the chem id.
    1. Enter I2C command 00, Data Block 0800 in "Write I2C Data Block" and press Write Data button.
    2. Enter I2C command 00, Data Size 2 and pres Read Data, the GUI returns 65FB or 70FB. When I repeat step 1 and hit Write Data multiple times, I read 0008, little endian for 0800, the correct answer.
    3. Then when I use "Read/Write I2C Byte" (enter command 00, byte 00 / command 01 byte 08 for bq34z110, then try to read 00 and 01) I get 70 FB again but never 00 08.

    Any ideas on how to get this working?
  • Also on a related note, I am calibrating the board through the bq-eval software, then reading the data flash to figure out how to calibrate it through I2C. After calibrating, the GUI the CC gain reads 0.404 miliohms. When I read the data flash at subclass 104 offset 0-3, (where CC gain is supposed to be) the values are 843C. Converting that to decimal gives 33852. How does this correspond to .404 miliohms? Is there a conversion I'm missing?
  • The CC Gain is stored as four bytes in the data flash and it has to be converted to floating point. The gauge uses a Xemics floating point number and the conversion is complicated. Here are a couple is documents to help with the conversion.

    8473.Host System Calibration Method.pdfslva148a.pdf

  • disregard this post

  • Thanks for the documents - I was able to get the board offset working but I have a question about the voltage offset. My voltage offset is -60, and it looks like the Pack V offset ranges from -128 to 127. I'm trying to write -60 to that the Pack V offset, but I'm confused as how to represent a negative number with only 1 byte. I want to write FFC4 (-60) but I can only write C4, which gives me an offset of 196.
  • The bq34z110 does not use the Pack Voltage Calibration. It just calibrates the voltage with the Voltage Divider parameter.
  • So all I have to do to calibrate the voltage through I2C is to update the voltage divider field in subclass  104 offsets 14,15 to the maximum voltage? I don't need to follow the steps outlined in the flowchart of Host System Calibration document?


    I'm trying to read the voltage through I2C. I calibrated the board using the GUI, then connect the board to my arduino, then send the data command to read voltage. The GUI reads the voltage exactly, while the value returned through I2C is anywhere from 200 - 500 mV off. What could be going wrong?