Quantcast
Channel: MSP low-power microcontroller forum - Recent Threads
Viewing all articles
Browse latest Browse all 22733

bq27441-G1 battery showing wrong value.

$
0
0

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;


Viewing all articles
Browse latest Browse all 22733

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>