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.

BQ25629: Extra/unexpected ADC Done interrupts

Part Number: BQ25629
Other Parts Discussed in Thread: BQ25620,

Tool/software:

In our linux battery driver (BQ25620/2 driver obtained from TI but modified for BQ25629 by us) I've added the following code to the interrupt handler:

 // clear flags
ret = regmap_read(bq->regmap, BQ2562X_CHRG_FLAG_0, &val);
if (ret) {
dev_err(bq->dev, "Error reading chrg_flag_0: %d", ret);
} else if (val) {
dev_dbg(bq->dev, "Charger flag 0 0x%x", val);
}
ret = regmap_read(bq->regmap, BQ2562X_CHRG_FLAG_1, &val);
if (ret) {
dev_err(bq->dev, "Error reading chrg_flag_1: %d", ret);
} else if (val) {
dev_dbg(bq->dev, "Charger flag 1 0x%x", val);
}
ret = regmap_read(bq->regmap, BQ2562X_FAULT_FLAG_0, &val);
if (ret) {
dev_err(bq->dev, "Error reading fault_flag_0: %d", ret);
} else if (val) {
dev_dbg(bq->dev, "Fault flag 0x%x", val);
}

I wanted to see why our interrupt handler is constantly triggering.  The result, is that charger_flag_0 is coming back 0x40, which is ADC_DONE_FLAG. 
I don't know why this interrupt is constantly firing.  So I further set Charger_Mask_0 to 0x40 in order to supposedly mask this interrupt.
However, we still constantly get interrupts and always it's adc_done that is set.
We're using one-shot adc mode and no adc_en bit is being set while these interrupts are triggering.  What is the proper way to disable these interrupts?
Here is a raw register dump from i2c:
00: ff
01: ff
02: 40
03: 06
04: a0
05: 0d
06: 00
07: 0a
08: e0
09: 0e
0a: 20
0b: 03
0c: c0
0d: 0f
0e: 00
0f: 0b
10: 80
11: 00
12: 20
13: 00
14: 04
15: 1c
16: a0
17: 4f
18: 04
19: c0
1a: 3d
1b: 25
1c: 3f
1d: 40
1e: 00
1f: 04
20: 04
21: 00
22: 00
23: 40
24: 00
25: 00
26: 70
27: 00
28: 68
29: 01
2a: 00
2b: 00
2c: f8
2d: 12
2e: e4
2f: 12
30: 9e
31: 10
32: 9a
33: 10
34: cd
35: 01
36: 49
37: 00
38: 32
Here is a parsed output from that dump if I've interpreted the registers correctly:
0x2: Charge Current Limit: 2000mA
0x4: Charge Voltage Limit: 4360mV
0x6: Input Current Limit: 3200mA
0x8: Input Voltage Limit: 4760mV
0xc: VOTG Regulation: 5040mV
0xe: Minimal System Voltage: 0xb00: 3520mV
0x10: Precharge Current Regulation: 160mA - TODO if q4_fullon=1 min is 80mA
0x12: Termination Current Threshold: 40mA - TODO if q4_fullon=1 min is 60mA
0x14: Charge Control: (0x4)
 Q1_FULLON: 0
 Q4_FULLON: 0
 ITRICKLE: 10mA
 top-off timer: disabled
 Enable Termination: 1
 VINDPM_BAT_TRACK: VBAT+400mV
 Recharge Threshold offset: 200mV
0x15: Charge Timer Control: (0x1c)
 disable stat pin: 0
 Auto D+/D- detect: 0
 Force D+/D- detect: 0
 Enable DCP Bias: 1
 2x timer en: 1
 en safety timers: 1
 precharge safety timer: 0.62 hrs
 fast charge safety timer: 28 hrs
0x16: Charge Control 0: (0xa0)
 Auto OVP discharge: 1
 Force Discharge: 0
 Charge Enable: 1
 En HiZ: 0
 Force PMID discharge : 0
 wd timer reset: 0
 watchdog timer: disable
0x17: Charge Control 1: (0x4f)
 Reset: 0
 Therm Reg threshold: 120C
 Converter switching freq: 1.5Mhz (default)
 Converter drive stength: strong (default)
 VBus OVP: 18.5V
0x18: Charge Control 2: (0x4)
 Boost Bypass: 0
 OTG enable: 0
 Disable PFM in Boost Mode: 0
 Disable PFM in Forward buck mode: 0
 BATFET ctrl wvbus: 0
 BATFET ctrl delay time: 10s
 BATFET ctrl: normal
0x19: Charge Control 3: (0xc0)
 Peak discharge current protection: 12A
 VBat UVLO, Short: UVLO=2.2V Short=2.05V
 VBat OTG Min: 3V rising 2.8V falling
 Charge Rate: 1C
0x1a: NTC Control 0: (0x3d)
 TS Ignore: 0
 TS Hot Thresh: 60C
 TS Cold Thresh: -10C
 TS Warm ICHG: Unchanged
 TS Cool ICHG: 20%
0x1b: NTC Control 1: (0x25)
 Falling TH1,2,3 Thres: (0, 10, 15)C
 Rising TH4,5,6: (35, 45, 60)C
 TS warm voltage: VREG-200mV
0x1c: NTC Control 2: (0x3f)
 TS_VSET_SYM: 0
 TS_VSET_PREWARM: unchanged
 Prewarm Current (TH4,5): unchanged
 Precool Current (TH2,3): unchanged
0x1d: Charger Status 0: 0x40)
 ADC Conversion Status: 1
 Device in thermal regulation: 0
 VSys regulation: BAT > VSYSMIN
 IINDPM_STAT: Normal
 VINDPM_STAT: Normal
 Safety Timer Expired: 0
 Watchdog Timer Expired: 0
0x1e: Charger Status 1: 
 Charge Status: Not charging
 VBus Status: No qualified adapter or EN_AUTO_INDET=0
0x1f: Fault Status 0: (0x4)
 VBUS Fault: Normal
 Batt Fault: Normal
 VSys Stat: Normal
 OTG Fault Stat: 0
 Thermal Shutdown: 0
 TS Zone: Warm
0x20: Charger Flag 0: 0x4
 ADC Done: 0
 Thermal Regulation: 0
 VSYS Min Regulation: 0
 IINDPM: 0
 VINDPM: 1
 Safety Timer: 0
 Watchdog: 0
0x21: Charger Flag 1: 0x0
 Charge Status Changed: 0
 VBus Changed: 0
0x22: Fault Flag 0: 0x0
 VBus OVP or Sleep: 0
 VBat OCP or OVP: 0
 VSYS Over voltage or SYS short: 0
 OTG Over voltage or fault: 0
 TS Shutdown: 0
 TS Status Change: 0
0x23: Charger Mask 0: 0x40
0x24: Charger Mask 1: 0x0
0x25: Fault Mask 0: 0x0
0x26: ADC Control: (0x70)
 ADC En: 0
 ADC Rate: One Shot
 ADC Speed: 9 bit
 ADC Avg ctl: Single
 ADC Avg initial: Existing value
0x27: ADC Disables: 0x0
0x28: IBUS ADC: 360mA
0x2a: IBAT ADC: 0mA
0x2c: VBUS ADC: 4819.58mV
0x2e: VMMID ADC: 4799.7300000000005mV
0x30: VBAT ADC: 4232.73mV
0x32: VSYS ADC: 4228.75mV
0x34: TS ADC: 44.3021%
0x36: TDIE ADC: 36.5C
0x38: Part Info: 
 Part Number BQ25629
 Revision: 2
  • Hi Dennis, 

    Please see my comments below. 

    I have attempted to replicate your observations on a BQ25629EVM, but I observe expected behavior related to ADC_DONE_FLAG and setting ADC_DONE_MASK.  ADC_DONE_FLAG is only ever set after an ADC conversion is initiated with ADC_EN and when I set Charger_Mask_0 to 0x40 I no longer see any interrupts when repeatedly turning on the ADC in one shot mode. 

    Given this I have a couple follow-up questions. 

    -Can you confirm if  ADC_DONE_FLAG will no longer be set if you change ADC mode to continuous?

    -Referring to the register dump status registers indicate TS_WARM and charge status indicates not charging/charge terminated. I am wondering if any interrupts you are seeing are possibly due to device stopping charge or changing between TS_NORMAL and TS_WARM. 

    Another possibility is you are inadvertently enabling the ADC within your code. At this point in time we have not received any other reports of interrupts or ADC_DONE_FLAG not working properly on this device. 

    Best Regards,

    Garrett

  • Sorry I tried to delete this post.  I had a mistake in my debugging that rendered this issue a false issue.  It was not as I reported and our ADC_DONE is working as expected.  Thanks for looking into it.

  • Hi Dennis, 

    No worries, thanks for confirming that you are in fact not seeing an issue with ADC_DONE_FLAG. 

    Best Regards,

    Garrett