NRF52 GPIOTE PORT Event Consuming too much power

Hello all,

I am configuring a low power application for the nrf52832 board (custom board). This is a very low power application and I want the board to stay on sleep mode the majority of the time. I have configured a pin to wake up the device from sleep mode if an interrupt is recognized which is coming from a sensor. I have set this up as follows:

void gpio_init()
{
    ret_code_t err_code;
    
    // Init GPIOTE
    err_code = nrf_drv_gpiote_init();
    APP_ERROR_CHECK(err_code);

    // Configure pins
    //nrf_gpio_cfg_output(SWITCH_PIN);
    //nrf_gpio_cfg_output(WATCHDOG_PIN);
    nrf_gpio_cfg_output(MOSFET_PIN);
    //nrf_gpio_cfg_input(SUPERVISORY_PIN, NRF_GPIO_PIN_NOPULL);
    
    // Config struct
    nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_LOTOHI(false);
    in_config.pull = NRF_GPIO_PIN_PULLUP;
    
    // Init int_pin
    err_code = nrf_drv_gpiote_in_init(12, &in_config, input_pin_handle);
    APP_ERROR_CHECK(err_code);

    // Enable Int
    nrf_drv_gpiote_in_event_enable(12, true);
}

I additionally have a input_pin_handle function, which currently has no functionality (functionality is handled in main, I just need the board to wake up). The issue I am running into is that when I enable the gpio_init function, the current automatically spikes up to about 0.14mA and then intermittently raises further when an interrupt is received. When I get rid of the gpio_init function, the current stays at the reasonable value of around 3.00uA, but the system no longer receives an interrupt. I have read previousy that using GPIOTE should not raise your power consumption this much.

If anybody knows what I am doing wrong to have such a large current difference please let me know.

Best!

Parents Reply Children
No Data
Related