Part Number: BQ25155
Dear Team,
I can read correct VBAT voltage w/ VIN plugged; but will get wrong VBAT voltage w/ battery only.
I also want to set ADC_COMP1 to monitor VBAT less than 3.4V; if meet the criteria, will notify user low battery status.
I can get the ADC_COMP1 interrupt, but the ADC readout VBAT voltage is not correct.
Example:
VIN plugged - VBAT ADC readout 3.9V
VIN unplugged - then I will get ADC_COMP1 interrupt(flag2 = 0xC0), VBAT ADC readout 2.7V, actually VBAT voltage is around 3.9V
[Init Register]
BQ25155_RegWrite(BQ25155_MASK2, 0x31);//ADC_READY, COMP1
BQ25155_RegWrite(BQ25155_ADCCTRL0, 0x00);//disable ADC first
BQ25155_RegWrite(BQ25155_ADCCTRL1, 0x00);
BQ25155_RegWrite(BQ25155_ADCALARM_COMP1_M, 0x91);//set ADC COMP1 to VBAT low threshold MSB
BQ25155_RegWrite(BQ25155_ADCALARM_COMP1_L, 0x10);//set ADC COMP1 to VBAT low threshold, below 3.4V
BQ25155_RegWrite(BQ25155_ADCALARM_COMP2_M, 0x00);
BQ25155_RegWrite(BQ25155_ADCALARM_COMP2_L, 0x00);
BQ25155_RegWrite(BQ25155_ADCALARM_COMP3_M, 0x00);
BQ25155_RegWrite(BQ25155_ADCALARM_COMP3_L, 0x00);
BQ25155_RegWrite(BQ25155_ADC_READ_EN, 0x08);//enable VBAT ADC read
BQ25155_RegWrite(BQ25155_ADCCTRL0, 0xC3);//enable ADC measurement period 1min
[Log Output]
bq25155_get_battery_voltage_now - 0x7758, VBAT: 2797096
Low VBAT: 2797096uV, LOW_BATT_VOLT:3400000uV
flag2 - 0x80
bq25155_get_battery_voltage_now - 0x76F1, VBAT: 2787666
Low VBAT: 2787666uV, LOW_BATT_VOLT:3400000uV
flag2 - 0x80
bq25155_get_battery_voltage_now - 0x7674, VBAT: 2776222
Low VBAT: 2776222uV, LOW_BATT_VOLT:3400000uV
BR
Peter