i built a small breakout board for npm1300 (QEAAD0 2516AA) to experiment with it. the twi pins are wired to the i2c ports of a raspberry pi 4 to control it, and i have attached it to a 1200mAh 3.7v lipo battery pack from adafruit (LP503562) with a 2-pin JST connector, along with a usb-c connector. here's the schematic and photo of the board (mostly just taken from the reference design):


it seems like the basics work, i can measure the output of one of the bucks to be roughly at 1.8v and the other roughly at 3v. i can see that the device negotiated the 3a "high power" mode, when plugged into my usb power supply, when polling the USBCDETECTSTATUS register from the raspberry pi:
$ i2cset -y 1 0x6b 0x02 0x05; i2cget -y 10x6b # check USBCDETECTSTATUS
0x0c
if i do this sequence, i can start charging the battery as well:
$ i2cset -y 1 0x6b 0x03 0x06 0x02 i # disable NTC
$ i2cset -y 1 0x6b 0x03 0x0C 0x08 i # set term voltage to 4.2V
$ i2cset -y 1 0x6b 0x03 0x0D 0x08 i # set term voltage to 4.2V
$ i2cset -y 1 0x6b 0x03 0x04 0x01 i # enable charging
at this point, the charge led turns on, and the battery does appear to charge, if i poll the adc to measure battery voltage, i can see that it is increasing. if i poll the battery charging status register, i can also see that the battery is detected and charging:
$ i2cset -y 1 0x6b 0x03 0x34; i2cget -y 1 0x6b # check BCHGCHARGESTATUS
0x09
as i have not set the charge parameters for current, it's charging at the default 34mA very slowly. eventually the battery maybe is charged, but the charge led stays on, though dimmed. if i rapidly poll the BCHGCHARGESTATUS register, i can see that the status is flapping between no battery detected, battery detected, and charging:
$ while [ 1 ]; do i2cset -y 1 0x6b 0x03 0x34; i2cget -y 1 0x6b; done
0x00
0x05
0x00
0x00
0x00
0x00
0x05
0x00
0x05
0x01
0x00
i also notice that if i unplug the battery, the behavior is the same. the charging led stays lit, though dim, and charge status flaps between no battery detected, battery detected, and charging. my two questions:
1. is there something wrong with my circuit or configuration that's causing the ghost battery detection even when the battery is not connected?
2. similarly, is there something i need to be doing differently so that the charger doesn't rapidly flap like that when the battery is connected? ideally the led would turn off when the battery is done charging.

