nPM1300 Configuration

Hi,

I would like your support in reviewing and helping define the correct configuration for the NPM1300 charger in our application.

Here is the current configuration we are using:

npm1300_charger: charger {
    compatible = "nordic,npm1300-charger";
    status = "okay";
    term-microvolt = <4100000>;
    term-warm-microvolt = <4000000>;
    current-microamp = <130000>;
    dischg-limit-microamp = <1340000>;
    vbus-limit-microamp = <500000>;
    thermistor-ohms = <10000>;
    thermistor-beta = <3435>;
    charging-enable;
};

We are using the following battery: renata ICP621333PA-01 3.7V / 230mAh

Could you please confirm whether this configuration is appropriate for the battery in use? I noticed that the PMIC offers additional protection and safety configurations. If possible, I would appreciate your guidance on defining a recommended and more complete set of parameters.

We are also encountering a couple of issues:

  1. Occasionally, the PMIC does not detect the USB-C charger connection during boot.

  2. When the USB connection is not recognized, the fuel gauge reports 0% state of charge (SOC).

Any advice or suggestions to address these issues would be greatly appreciated.

Parents
  • Hello,

    From the first glance, the disttcharge limit (1.34 A) seems too high for such a small battery. The battery datasheet recommends to stay within 1C (240mA) or 2C bursts/non-continuous (480mA). 

    As for the USB detection issue, it is difficult to say without more information. First, what NCS version are you using? For a while we had some issues properly exposing the VBUS status register via the charger API, and the USB detection relied on interrupts. 

    Do you have any code snippets and logs to share, so that we can look into this? Particularly related to the start of the application, where the 0% value comes from.

    Best regards,

    Edvin

  • we are using NCS version 2.7.0.

    this function is called in boot and returns the usb connection status on init:

    int battery_init(void)
    {
        if (hal_fg_init() != 0) {
            LOG_ERR("failed to initialize fuel gauge HAL");
            return -1;
        } else {
            hal_fg_register_events_cb(charger_event_cb);
        }
        battery_info.flags.is_charger_connected = 0;
        battery_info.flags.is_full = 0;
        battery_info.flags.is_critical_level = 0;
        battery_info.flags.is_low_level = 0;
        battery_info.flags.unused = 0;
    
        if(battery_update_info() < 0) {
            return -1;
        }
        if(hal_fg_charger_connected()) {
            battery_info.flags.is_charger_connected = 1;
        }
        return 0;
    }
    
    bool hal_fg_charger_connected(void)
    {
        struct sensor_value val;
        bool connected;
        int ret;
    
        ret = sensor_attr_get(fuelgauge_device, SENSOR_CHAN_CURRENT, SENSOR_ATTR_UPPER_THRESH, &val);
        if (ret < 0) {
            LOG_ERR("failed to read npm1300 current");
            return false;
        }
    
        connected = (val.val1 != 0) || (val.val2 != 0);
    
        if (!connected) {
            /* the SENSOR_CHAN_CURRENT attr is not working properly so this code is needed.
             remove when npm1300 charger driver fix this issue. */
            float avg_current_mA;
    
            ret = hal_fg_get_data(NULL, &avg_current_mA, NULL, NULL);
            if (ret < 0) {
                return false;
            }
            connected = (avg_current_mA < 0);
        }
    
        return connected;
    }
    

Reply
  • we are using NCS version 2.7.0.

    this function is called in boot and returns the usb connection status on init:

    int battery_init(void)
    {
        if (hal_fg_init() != 0) {
            LOG_ERR("failed to initialize fuel gauge HAL");
            return -1;
        } else {
            hal_fg_register_events_cb(charger_event_cb);
        }
        battery_info.flags.is_charger_connected = 0;
        battery_info.flags.is_full = 0;
        battery_info.flags.is_critical_level = 0;
        battery_info.flags.is_low_level = 0;
        battery_info.flags.unused = 0;
    
        if(battery_update_info() < 0) {
            return -1;
        }
        if(hal_fg_charger_connected()) {
            battery_info.flags.is_charger_connected = 1;
        }
        return 0;
    }
    
    bool hal_fg_charger_connected(void)
    {
        struct sensor_value val;
        bool connected;
        int ret;
    
        ret = sensor_attr_get(fuelgauge_device, SENSOR_CHAN_CURRENT, SENSOR_ATTR_UPPER_THRESH, &val);
        if (ret < 0) {
            LOG_ERR("failed to read npm1300 current");
            return false;
        }
    
        connected = (val.val1 != 0) || (val.val2 != 0);
    
        if (!connected) {
            /* the SENSOR_CHAN_CURRENT attr is not working properly so this code is needed.
             remove when npm1300 charger driver fix this issue. */
            float avg_current_mA;
    
            ret = hal_fg_get_data(NULL, &avg_current_mA, NULL, NULL);
            if (ret < 0) {
                return false;
            }
            connected = (avg_current_mA < 0);
        }
    
        return connected;
    }
    

Children
No Data
Related