I am doing power optimizations on a custom hardware that has nrf9160 and nrf52833 on it. These are connected via GPIO pins and I use two pins to send interrupts to each other.
I noticed when I turn off the interrupts, nrf9160 has around 5.5 - 7 uA sleep current and nrf52833 has around 2 uA sleep current. But when I turn on the interrupts nrf9160 has around 40 uA sleep current and nrf52833 has 10 uA sleep current. I tested on several boards and all have similar results.
So why does GPIO interrupts cause higher sleep current and how can I lower it?
I use zephyr gpio api for configuring the pins and interrupts. For turning off the interrups I just comment out the following function.
static void com_gpio_init(void) { gp_gpio = device_get_binding(DT_LABEL(DT_NODELABEL(gpio0))); gpio_pin_configure(gp_gpio, COM_INT_OUT_PIN, GPIO_OUTPUT_INACTIVE); gpio_pin_configure(gp_gpio, COM_INT_IN_PIN, GPIO_INPUT | GPIO_PULL_DOWN); gpio_pin_interrupt_configure(gp_gpio, COM_INT_IN_PIN, GPIO_INT_EDGE_RISING); gpio_init_callback(&g_gpio_callback, com_gpio_callback_func, 1u << COM_INT_IN_PIN); gpio_add_callback(gp_gpio, &g_gpio_callback); }