Hello Im very new to I2C and I need some help trying to read a byte of information from my Li-ion battery fual gauge.
The ID of the gauge is 0xAA and I'm trying to read the SOC "State Of Charge" in reg 0x2c but im having a hard time getting it too work.
To read 1 byte the datasheet for the bq27510 states that it supports this I2C format for a 1 byte write:
START -> ADDR[6:0] 0 A -> CMD[7:0] A -> REPEATED START -> ADDR[6:0] 1 A -> DATA[7:0] N -> STOP
(ADDR = Device ID, CMD = Reg, 0= Write, 1= Read, A = Acknowledge, N = No Acknowledge, and P = Stop)
The datasheet also states that "The fuel gauge supports the standard I2C read, incremental read, one-byte write quick read, and functions. The7-bit device address (ADDR) is the most significant 7 bits of the hex address and is fixed as 1010101. The 8-bit
device address is therefore 0xaa or 0xab for write or read, respectively."
Does that mean I can keep the address 0xAA or would a have to change it too "170" the same would apply for the SOC reg address.
I've had a go at trying to solve this but with no luck. Can someone help