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.

BQ27621-G1: Accessing the data of subcommands using low-level functions

Part Number: BQ27621-G1

Hello,

I am having trouble accessing the DEVICE_TYPE subfunction of the Control() function. This is what I am doing:

I2C_SendStart();

I2C_WriteByte(0xAA);

I2C_WriteByte(0x00); // address of Control() command

I2C_writeByte(0x01); // also tried removing this line

I2C_writeByte(0x00); // address of the DEVICE_TYPE function

I2C_writeByte(0x01);

I2C_SendStop()

I2C_SendStart();

I2C_WriteByte(0xAB);

data1= I2C_readByte(sendAck = 1);

data2=I2C_readByte(sendAck = 0);

I2C_SendStop();

what I get back is wrong.I get 0xECFF when I should get 0x0621.

Can anyone explain why?

I also tried reversing the address order for the DEVICE_TYPE (i.e. first send 0x01 and then 0x00).