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.

I2C Communication Confusion

Other Parts Discussed in Thread: BQ34Z110

Dear TI

I have a circuit board with the BQ34Z110 on board I can communicate with the BQ34 with the EV2300 and the TI software However I need to implement my own communication to the BQ with a host microcontroller and this is where I have difficulties as the Datasheet is not very much clear on this

On page 28 of document SLUSB55A is a description of the I2C but not very helpful unfortunately

Is there any where a short example of using the Standard command set to read the Sate of charge remaining capacity ect. from the device

If I understand the Command Set correctly then the host should send the device address then 2 command bytes and the read back 2 bytes of data as shown on page 28 it is not the case or do the host send address 1 byte then read 1 byte back then again send the second byte of the commend and read then back the second data byte

 Please help to clear this confusion which one of the a,b,c or d structures (page 28)should I use for the host to communicate the Standard command set to the BQ34 and read back the Battery data

Thank you very much

Peter Erasmus

R&D Electric Vehicles

  • Peter

    I provided a detailed example of reading and writing Control Commands. Accessing the SOC and RM data will use the same process. Please refer to this link to see if it answers your questions. http://e2e.ti.com/support/power_management/battery_management/f/180/p/213060/820268.aspx#820268

    Regards
    Tom

  • Tom

    Thank you very much for your response and information I really appreciate it,

    However I noticed this is based on the GUI software I will take a look at it this week and see if I can find the correlation between this and what my Host should be ouputting

    I will try to work with this if i have problems I will be back with more specific questions at the moment everything still a bit unclear

    I do appreciate your help .

    Regards

    Peter

  • Dear Tom

    Please correct me!

    I want to send from my microcontroller standard command to read the SOC for example

    in my understanding I should send

    AA 02 03

    and then read what is send back from the BQ which should be something like this

    AB data data [2 bytes]

    Regards

    Peter

  • Peter

    I have some examples of reading Control Sub-commands on this e2e posting.

    http://e2e.ti.com/support/power_management/battery_management/f/180/p/213060/820268.aspx#820268
    Regards
    Tom
  • Tom

    Thank you for the reply I think I understand the sequence for Contol() commands plus subcommands

    however the examples show the use of the GUI tools I need to do this from a microcontroller,

    also the standard commands such as the SOC read out

    just help me to understand the logic here please

    I send  S AA 02 A P

    then     S AA 03 A P

    now i guess the SOC command bytes 0x02 and 0x03 are send to the BQ

    Now I do

    S AB   02 A  data from Bq A P

    S AB 03 data from Bq A P

    I am just not sure which sequences to follow as shown on page 28 of the BQ34Z110 Datasheet

    Please shed some light on this I would appreciate it highly

    Peter

  • Peter,

    The I2C transfer sequence for reading the Standard Command SOC will be like the example (d) on Figure 6 of the datasheet.

    Start-AA-ACK-02-ACK-Start-AB-ACK-(LSB of SOC)-ACK-(MSB of SOC)-ACK-STOP


    Tom

  • Tom

    Thank you this is really helpfull !!!.I do appreciate your time and reply

    I will give it a go now

    Peter

  • Hello Tom

    This works fine reading the standard commands 2 bytes at a time

    Start-AA-ACK-02-ACK-Start-AB-ACK-(LSB of SOC)-ACK-(MSB of SOC)-NACK-STOP

    However would it be possible to loop this squence by just replacing the NACK with an ACK and carry on reading until

    0x0D (Flags) then apply the NACK and stop this way I could read the block of Data.not sure if this is what the datasheet intends with incremental Block read

    Start-AA-ACK-02-ACK-Start-AB-ACK-(LSB of SOC)-ACK-(MSB of SOC)-ACK  ..............    NACK-STOP

    Thank you for helping out

    Peter

     

  • Peter,
    The device can support block reads. The controller just has to keep reading data and then send the STOP bit after it has received all of the data that it needs. The device will auto-increment the address.

    Tom

  • Tom

    Thanks a million

    I will do this now and read the block at one time

    Best Regards

    Peter

  • Tom

    Thankl you for all your help I have the basic communication running,There are still a few open question I will post when I am more sure that I am missunderstanding the basics.

    To others haveing the same problem in understanding how to communicate to the BQ device with a MCU

    (1) set the mcu as master device

    (2) Confugure the I2C module

    To read the Standard comman set  as a block of data follow the follwoing pattern

    START-0xAA- ACK-.CMD (0x02)-ACK-.START-0xAB-ACK-.DATA (LSB)-ACK-DATA (MSB) [ACK-] [NACK]- STOP

    keep on ACK the data bytes to read the number of bytes (do not send the NACK)you want on the last byte do not ACK but do a NACK and then a stop see screen print of this

    I will post the extended comnmand pattern when completed