Edge Triggered wake up from system off mode in nRF51822...

Hello,

 I am working on nRF51822, SDK12.3.0 in IAR workbench.

I am use init pin 2 as an interrupt.

Device will advertise for 20 minute after 20 minute device go to sleep.I want to wake up the chip only when pin 2 detect falling edge. I have used following lines to configure the input pin before device going to sleep.

nrf_gpio_cfg_sense_set(2, NRF_GPIO_PIN_SENSE_LOW);

err_code = sd_power_system_off();
APP_ERROR_CHECK(err_code);
  

Since I can either put sense to high or low. For e.g. if I Use "GPIO_PIN_CNF_SENSE_Low" and if pin 2 input is low, the nRF wakes up as soon as i put it in system off mode.

Is there any way to make sense functionality into sensing the edge rather than level ?

Thanks & Regards,

Urvisha Andani

Parents
No Data
Reply
  • Hi,

    you can configure a level opposite to current one. The drawback is an additional false wake-up at rising edge, but it seems there is no other way.

    nrf_gpio_pin_sense_t level = nrf_gpio_pin_read(2) ? NRF_GPIO_PIN_SENSE_LOW : NRF_GPIO_PIN_SENSE_HIGH;
    nrf_gpio_cfg_sense_set(2, level);

Children
No Data