[nRF5340/nPM1304] Fail to configure PMIC charge current

Hi,

What specific steps must be followed to modify the charging current (BCHGISET) of the nPM1304?

The information I found says to disable the charger first (set BCHGENABLECLR to 0x01), then set BCHGISET, and finally enable the charger (set BCHGENABLESET to 0x01).

However, after following this method, although the write operation was successful, I found that the charging current of the nPM1304 is not the current I want, but is around 32mA, which is the same as the default charging current of the nPM1300.

Before disabling the charger, I read the register value as 0x01, and after writing 0x01, I read the value as 0x00, so I think the setting was successful. Could I have missed something or made a mistake in the steps?





Thank you very much for your help!

Best regards,
Kevin

  • Hello Kevin,

    The steps you followed is correct. What is the BCHGISET value you set in the code? The BCHGISET register value is 0x8. 

    What value you selected for VBUSINILIM0?

  • Hi  ,

    The BCHGISET value will be one of the following: 0x07 (3.5mA), 0x0A (5mA), 0x0E (7mA), 0x13 (9.5mA), 0x1A (13mA), 0x23 (17.5mA), 0x4C (38mA), 0x6A (53mA), and 0x8C (70mA).

    I have not set a value for VBUSINILIM0, so it should be using the default value. The value I read back is 0x01, which, according to the nPM1304 datasheet, corresponds to 100 mA.

    Therefore, could I assume that the maximum input current limit is set to 100 mA? However, all desired charging current values are below this maximum.

    Thank you very much for your help!

    Best regards,
    Kevin

  • Hello,

    Have you measured the charging current? Or you are relying on the current ADC reading?

    Note the current ADC full scale current scales with the charging current set. :"When charging, the full-scale current is the weighted sum of registers BCHGISETMSB and BCHGISETLSB multiplied by 1.25." So basically you would get always the same reading from the ADC if you change the charging current. 

  • Hi,

    Sorry for the late reply; I wasn't in the office the past few days.

    Yes, I did measure the current, and it was similar to the value I read. Sorry, I didn't quite understand your explanation of the ADC. I'm not sure if it's using the ADC value; I ported the npm13xx_fuel_gauge example to my custom code and then directly checked the current value.

    What's the difference between this method and reading an ADC value?

    Best regards,
    Kevin

  • Hello Kevin,

    I have following explanation from team.

    By "measuring the charging current" we actually mean using an external ampere-meter to check the actual current flowing into and out of the battery.

    The problem with reading the ADC (or the Zephyr npm13xx sensor driver) value is that it, unfortunately, doesn't take the actual charging current setting into account when calculating the return value. In Zephyr, the current range is taken from the Device Tree setting. It uses the DTS setting `current-microamp` for calculating the "full scale" value which it uses to then calculate the current measured by the ADC. When the charging current is changed by direct register writes, the sensor driver is not aware of this, so it keeps showing the same value due to the same "full scale" value.

    Hopefully, this makes it clear. 

Related