BQ27545-G1: BQ27545 I2C Command Formatting

Part Number: BQ27545-G1
Other Parts Discussed in Thread: BQ25619

Tool/software:

I hope this isn't too dumb a question but:

I am trying to access a BQ27545 chip (embedded in a LiPo Battery Pack) using I2C interface but I don't quite understand the command format. It says in the Data Sheet (page 26) "The bq27545-G1 uses a series of 2-byte standard commands to enable system reading and writing of battery information" and then goes on to list 2 command codes for each specified command (e.g. Voltage() 0x08/0x09).

How exactly do I issue these two command bytes ? The information for I2C command sequences in section 8.5.1.2 only shows one CMD[7:0]  word so:

1) Do I issue two complete command transactions ("START/ADDR/CMD/DATA/DATA/STOP") for 0x08 then 0x09

or

2) The two CMD bytes are somehow combined into one transaction that isn't shown in the Data Sheet (or I've missed it)

I have tried with the Control() command, I used 0x00, followed by two bytes of data 0x00 0x01 for DEVICE TYPE. This seems to work (all I2C bytes were correctly ACK'ed) but the 2 bytes of data I read after the command (from address 0x00) were 0x05 and 0x42 and not 0x05 0x45 as specified in the data sheet.

Can anyone please advise me where I am going wrong, I would be most grateful as I am quite a tight timescale for this project.

Regards

PhilipJ

  • Standard commands is synonymous with "register".

    So if you want to read Voltage(), command 0x08/0x09, you read one byte from register 0x08 and one byte from register 0x09 and then combine this into a 16-bit integer, which is the voltage in mV. You can either read this in two separate I2C transactions or you can perform an incremental read of both registers sequentially in one I2C transaction.

    Because there are only a limited number of I2C registers, the gauge only has a few standard commands and an indirect addressing mode using the Control() standard command.

    You can write an extended command consisting of 2 bytes (see TRM for a list) to Control() and then read results as explained in the TRM for the Control() standard command.

    In your example, it looks like you read the DeviceType as 0x0542, which is the bq27542. This implies that the gauge was programmed as a bq27542.

  • Hi,

    thanks for your reply, that all makes sense.

    You are correct about the chip type, I had confused myself by downloading the wrong datasheet.

    Also my voltage and temperature readings where completely wrong because --- I was reading the wrong I2C chip!! (Dohhhh!!!).

    We also have a BQ25619 charger chip on the mother board and I had a mistake in my code that was reading 8/9 of that chip hence a completely stupid value for the battery voltage.

    Thanks for your help

    PhilipJ