nPM1300 BCHGISETDISCHARGE

We're using the Nordic Zephyr library (SDK v2.5) to configure the nPM1300.  Using the library, the battery discharge current limit is set to 1000mA.  However, using a logic analyzer to decode the I2C traffic shows that 0x9A (decimal 154) is written to register 0x30A (BCHGISETDISCHARGEMSB) and 0x01 is written to register 0x30B (BCHGISETDISCHARGELSB).  There are a few questions related to this, referencing Section 6.2.11 of the datasheet (v1.1).

1. Instead of saying "two possible settings", tthe datasheet says "The two discharge current settings are found in the following table" (italics mine).  This implies that there are only two settings.  But I assume that these are just two example settings and other settings are possible.  Please confirm.

2. In Table 16, for 1000mA battery discharge it shows that the BCHGISETDISCHARGE register settings should be 207 (0xCF) and 0x01.  But that is not what is being written when our configuration code runs.  Is this a known bug with SDK v2.5, or could there be something else going on here?

3. I see no guidance on how to translate between the register settings and the current limit, except for the 2 settings shown in Table 16.  And those settings indicate the 9-bit value (the BCHGISETDISCHARGEMSB value appended with the single bit from BCHGISETDISCHARGELSB) should be scaled at about 2.4mA/bit.  Can you confirm that scaling is correct?

Parents
  • Hi Kevin

    I'm looking into your issue

    Regarding question 2. What is the value you are seeing? 

    Regards

    Runar

  • Update: 

    The battery current calculation uses the old definition of the battery current discharge limit, and the PS has not been updated yet to reflect this. As I understand it, the update is coming but I'm not sure about the timeline 

    NCS 2.5.0 is not updated to reflect this. 

    The Zephyr main driver was only very recently updated, and this change has not made its way into NCS yet:

    https://github.com/zephyrproject-rtos/zephyr/commit/ab6bca66ac9c3352559fdbe786cb38a34c8fa29c

    So PowerUP and NCS is at the moment using the old definition of the discharge limit configuration. After the next upmerge, NCS will start using the new definition, and the PowerUP overlay export functionality will be updated accordingly. At that point, you will get a compile error if you try to use an overlay with a discharge current limit other than 200 mA or 1000 mA.

    1. The table only shows the high and low value, is is possible to select values between min and high value

    2. 

    3. The PS at the moment states that you can calculable the battery current from the ADC measurement value 

    A value of 01 means the battery is discharging. During a discharge, the full scale current is the weighted sum of registers BCHGISETDISCHARGEMSB and BCHGISETDISCHARGELSB multiplied by 0.836.

    But the PS does not mention that the fullscale is actually calculated based on 270 mA or 1340 mA  values instead of 200 mA and 1000 mA as mentioned here:

    So to properly calculate the battery current, you need use an ADC fullscale value of 270 mA or 1340 mA, multiplied by 0.836.

    Regards

    Runar

Reply
  • Update: 

    The battery current calculation uses the old definition of the battery current discharge limit, and the PS has not been updated yet to reflect this. As I understand it, the update is coming but I'm not sure about the timeline 

    NCS 2.5.0 is not updated to reflect this. 

    The Zephyr main driver was only very recently updated, and this change has not made its way into NCS yet:

    https://github.com/zephyrproject-rtos/zephyr/commit/ab6bca66ac9c3352559fdbe786cb38a34c8fa29c

    So PowerUP and NCS is at the moment using the old definition of the discharge limit configuration. After the next upmerge, NCS will start using the new definition, and the PowerUP overlay export functionality will be updated accordingly. At that point, you will get a compile error if you try to use an overlay with a discharge current limit other than 200 mA or 1000 mA.

    1. The table only shows the high and low value, is is possible to select values between min and high value

    2. 

    3. The PS at the moment states that you can calculable the battery current from the ADC measurement value 

    A value of 01 means the battery is discharging. During a discharge, the full scale current is the weighted sum of registers BCHGISETDISCHARGEMSB and BCHGISETDISCHARGELSB multiplied by 0.836.

    But the PS does not mention that the fullscale is actually calculated based on 270 mA or 1340 mA  values instead of 200 mA and 1000 mA as mentioned here:

    So to properly calculate the battery current, you need use an ADC fullscale value of 270 mA or 1340 mA, multiplied by 0.836.

    Regards

    Runar

Children
No Data
Related