Hi,
I have connected the battery bq27441-G1 to the MSP430fr5969, according to the document i am doing i2c communication, but not able set the values according ours. Without set the values showing 0xffff after setting showing some other. please suggest.
. i used this document as reference. I tried to read the device type also by using some control command which is in the document. But getting wrong values.
//to read the initial control status// //getting 0xffff
data = 0x00;
i2c_write(SLAVE_ADDR_BATTERY, BATT_CONTROL_1, 1, &data);
data = 0x00;
i2c_write(SLAVE_ADDR_BATTERY, BATT_CONTROL_2, 1, &data);
delay(3000);
i2c_read(SLAVE_ADDR_BATTERY, BATT_CONTROL_1, 1, (uint8_t *) &msb);
i2c_read(SLAVE_ADDR_BATTERY, BATT_CONTROL_2, 1, (uint8_t *) &lsb);
init_val = (msb << 8) | lsb;
//read the device type , getting 0x8e00
data = 0x00;
i2c_write(SLAVE_ADDR_BATTERY, BATT_CONTROL_1, 1, &data);
data = 0x01;
i2c_write(SLAVE_ADDR_BATTERY, BATT_CONTROL_2, 1, &data);
delay(3000);
i2c_read(SLAVE_ADDR_BATTERY, BATT_CONTROL_1, 1, (uint8_t *) &msb1);
i2c_read(SLAVE_ADDR_BATTERY, BATT_CONTROL_2, 1, (uint8_t *) &lsb1);
device_type = (msb1 << 8) | lsb1;