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

Reduce power consumption Sense_High

Hi, i'm working on a custom board with microswitch (Crouzet V4) in order to get the position of a moving part inside a machine. This switch is in pullup mode with a 100k resistor.

This microswitch is here to wake up the entire system after the NRF52832 go to sleep mode.

Before going to sleep the NRF52 get last position of the switch to prepare wake up.

(ex: case 1 : the switch is pressed when the system go to sleep, the system wakes up on release
case 2 : the switch is release when the system go to sleep, the system wakes up on press).

{...
//top of the function not visible
nrf_drv_gpiote_in_config_t cls_1_config = GPIOTE_CONFIG_IN_SENSE_TOGGLE (true);
cls_1_config.pull = NRF_GPIO_PIN_PULLUP;
cls_1_config.hi_accuracy = true;
 
nrf_drv_gpiote_in_init (12, &cls_1_config, cls_fall_handler);
nrf_drv_gpiote_in_event_enable (12, true);

cls_fall_handler(12, NRF_GPIOTE_POLARITY_TOGGLE); //Handler that get the position and change the boolean IS_PRESS

if (IS_PRESS == false) //release
{
      nrf_gpio_cfg_sense_input (12, NRF_GPIO_PULLUP, NRF_GPIO_SENSE_LOW)
}
else
{
      nrf_gpio_cfg_sense_input (12, NRF_GPIO_PULLUP, NRF_GPIO_SENSE_HIGH)
}

sd_power_off_system_off();

}

This function works really well but i have now a problem with power consumption. If the system go to sleep looking for NRF_GPIO_SENSE_LOW I get low power consumption but if i get NRF_GPIO_SENSE_HIGH the power consumption is higher (170uA).

I was thinking it was the pullup resistors but if i remove the line :

nrf_gpio_cfg_sense_input (12, NRF_GPIO_PULLUP, NRF_GPIO_SENSE_HIGH)

the power consumption on sleep is normal (with no wake up possible of course)

So, my question is how to achieve low power consumption with an other function with the same behaviour. i've read on this forum that there is GPIO -> PORT function but i don't understand how it works.

Thanks you !

Parents Reply Children
No Data
Related