This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Sleep current with GPIOTE enabled

This test program is modified from examples\pin_change_int\main.c, I add the instructions to put the cpu to sleep. And I add nrf_gpio_input_disconnect() for all the pins except BSP_BUTTON_0 and BSP_LED_0. Everything else remains as original example.

int main(void)
{
    gpio_init();

    while (true)
    {
        // Enter System ON sleep mode
        __WFE();
        __SEV();
        __WFE();
    }
}

By using a DMM to measure the current, I get about 8 uA (I use external power, not USB). When I use the Nordic Power Profiler Kit, I also get similar average current. I notice the graph shows a peak about every 5.2 msec. image description

Is there some timer left running by default? Does the GPIOTE require some clock running during sleep?

I saw this thread, devzone.nordicsemi.com/.../ I ran the "System On" example, I get about 12 uA during sleep, but 2.6 uA was expected.

Parents
  • Hi,

    The example uses high accuracy mode which generates an IN event on the selected pin in the GPIOTE module directly. This uses more current than compared to using a GPIOTE->PORT event (low accuracy mode). For low power applications, you should use the GPIOTE->PORT event.

    You can set the GPIOTE module to low accuracy mode by calling the GPIOTE_CONFIG_IN_SENSE_TOGGLE() function with the .hi_accuracy flag set to false. (See line 90 in the example) :

    nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_TOGGLE(false);
    
Reply
  • Hi,

    The example uses high accuracy mode which generates an IN event on the selected pin in the GPIOTE module directly. This uses more current than compared to using a GPIOTE->PORT event (low accuracy mode). For low power applications, you should use the GPIOTE->PORT event.

    You can set the GPIOTE module to low accuracy mode by calling the GPIOTE_CONFIG_IN_SENSE_TOGGLE() function with the .hi_accuracy flag set to false. (See line 90 in the example) :

    nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_TOGGLE(false);
    
Children
Related