Hi Particle Community,
I'm working on a custom board based on the Particle M-SoM, using a custom implementation of the TI BQ24195 PMIC with a 3.7V LiIon battery and no fuel cell
. That's the same setup as particle and I roughly followed the Particle power module design. I'm trying to configure the PMIC via I2C to set specific parameters like VIN Vmin = 4800 mV, VIN Imax = 1500 mA, Charge Current = ~500 mA (512 mA min), Charge Voltage = 4100 mV, Thermal Regulation = 80°C, and disable the watchdog timer.
However, most changes aren't taking effect. The logs consistently show default or unexpected values:
- VIN Vmin: 5080 mV
- VIN Imax: 1500 mA (this one sticks)
- Charge Current: 4544 mA
- Charge Voltage: 4512 mV
- Thermal Regulation: 120°C
- Watchdog Timer: 160s
- Power source: OTG
- Charging state: Charge done
- DPM active: Yes
- Power good: Yes
- Particle Power source: unknown
- Particle Battery state: unknown
- Particle Battery charge: -1.000000 %
The device seems stuck in OTG (boost) mode, and the battery isn't charging. Even with the battery disconnected, the logs are similar.
Here's what I've tried:
- Using Particle Device OS API Calls: Started with the Particle Power Manager and PMIC APIs (e.g., SystemPowerConfiguration with features like DISABLE or DISABLE_CHARGING, and direct PMIC class methods). These were unsuccessful at changing anything on the PMIC—settings didn't apply, and we saw no differences in logs.
- Direct I2C Writes: Switched to raw I2C writes to the BQ24195 (address 0x6B), setting REG00=0x65 (VINDPM=4.84V, IINLIM=1.5A), REG02=0x00 (ICHG=512 mA), REG04=0x96 (VREG=4.096V), REG05=0x8B (disable watchdog), REG06=0x01 (TREG=80°C).
- Resetting Registers: Writing 0x8B to REG01 to reset to defaults.
- Exiting HIZ State: Checking and clearing REG00 bit 7 if set.
- Disabling OTG and Charging Temporarily: Writing 0x0B to REG01 to disable both, then re-enabling charging.
- Verification Reads: Reading back registers after writes, but values don't match what was written for charge current, voltage, thermal reg, etc.
Example code snippet (direct I2C approach):
`// In setup()
SystemPowerConfiguration conf;
conf.feature(SystemPowerFeature::DISABLE);
System.setPowerConfiguration(conf);
// Reset and configure registers
writeRegister(0x01, 0x8B); // Reset
delay(500);
writeRegister(0x01, 0x0B); // Disable OTG/charging
delay(500);
writeRegister(0x00, 0x65); // VIN settings
writeRegister(0x01, 0x1B); // Enable charging
writeRegister(0x02, 0x00); // ICHG=512 mA
writeRegister(0x04, 0x96); // VREG=4.096V
writeRegister(0x05, 0x8B); // Disable watchdog
writeRegister(0x06, 0x01); // TREG=80°C`
Logs with battery off are similar, showing OTG mode and no charging.
Has anyone encountered this on a custom M-SoM board or with the BQ24195? Is there a specific sequence to exit OTG mode or apply settings? Could the Particle OS be overriding despite DISABLE? Suggestions for debugging I2C or forcing the PMIC into the correct state would be appreciated!
Thanks!
Here is my power schematic: