How to set an interrupt on LDSW via GPIO in the NPM1300 using the nRF Connect SDK.

I am using NCS v2.5.1 and working on a project where I need to turn off the system using a button that triggers an interrupt on a GPIO. I want this GPIO to control a load switch to turn it on and off. Where both the GPIO and the load switch are part of the NPM1300. How can I achieve this using the nRF Connect SDK?

Is there any configuration available in overlay file? 

Parents
  • Hi Priyesh,

    I will make a new conversation thread here, to start anew.
    First, I recommend that you test with the nPM PowerUp application to get the functionality you need.

    I tried this now, and think I got what you want.
    Can you watch the video below, and confirm if this is what you need?

    Then you can use the "export" feature in nPM PowerUp to get the DTS configuration you need.

    Here are the options I used:

  • Yes, this is exactly what I want to do. I tried this with the nPM PowerUp application and the nPM1300EK board, and everything you suggested is working perfectly on that.

    However, when I export the configuration and add it to my project, it doesn't seem to work. Could you provide me with a sample or some guidance on how to make it work in my project? That would be really helpful.

    Thank you!

  • Hello, any update on this bug on the nPM1300 LDSW triggering.

  • The pin can be configured in the app. That should fix it:

    int err = gpio_pin_configure(pmic_gpio, 1, GPIO_INPUT | GPIO_ACTIVE_HIGH | GPIO_PULL_UP);
    if (err) {
      printk("gpio_pin_configure=%d\n", err);
    }

  • We've tried configuring the pin as suggested, but unfortunately, it's not working. We also attempted to set it up directly via I2C, but I couldn't find a solution that way either. Do you have any updates or additional suggestions on how to proceed with this?

  • Hi Priesh,

    I have taken over this ticket as Sigurd has been assigned to another task. I will check for updates and get back to you.

  • Sigurd Hellesvik said:
    The pin can be configured in the app. That should fix it:

    int err = gpio_pin_configure(pmic_gpio, 1, GPIO_INPUT | GPIO_ACTIVE_HIGH | GPIO_PULL_UP);
    if (err) {
      printk("gpio_pin_configure=%d\n", err);

    Priyesh Shahi said:
    We've tried configuring the pin as suggested, but unfortunately, it's not working.

    Here is the code Sigurd supposedly used when he tested the fix he suggested. I verified that the project builds for nrf52840dk_nrf52840. I commented out this line in src/main.c:

    printf("Hello World! %s\n", CONFIG_BOARD_TARGET);

    EDIT: Adding attachement.

    pmic_gpio_ldo.zip

Reply
  • Sigurd Hellesvik said:
    The pin can be configured in the app. That should fix it:

    int err = gpio_pin_configure(pmic_gpio, 1, GPIO_INPUT | GPIO_ACTIVE_HIGH | GPIO_PULL_UP);
    if (err) {
      printk("gpio_pin_configure=%d\n", err);

    Priyesh Shahi said:
    We've tried configuring the pin as suggested, but unfortunately, it's not working.

    Here is the code Sigurd supposedly used when he tested the fix he suggested. I verified that the project builds for nrf52840dk_nrf52840. I commented out this line in src/main.c:

    printf("Hello World! %s\n", CONFIG_BOARD_TARGET);

    EDIT: Adding attachement.

    pmic_gpio_ldo.zip

Children
No Data
Related