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

Get of interrupt factor after returning from the SYSTEM OFF

Hi, all.

I have been using the nRF51822 board, I am making a peripheral. The peripheral has been equipped with a sensor to multiple GPIO. (For example, sensor1 to P0.9 , sensor2 to P0.10 )

After the application has waking up the SYSTEM OFF mode, I want to get the PIN number of GPIO that was waking up the SYSTEM OFF mode. (wake-up by P0.9 , wake-up by P0.10) ※ Application has been returned from the SYSTEM OFF mode by the interruption of the GPIO.

How to get of interrupt factor(P0.9 or P0.10) after returning from the SYSTEM OFF mode?

Parents
  • Hi

    The only way to detect what pin caused the wakeup from System off mode is to manually read the state of the configured wakeup pins after waking up and starting up the chip. If you however use System On, then it is easier with e.g. app_button library which will generate an event on a button press with the pressed pin id as a parameter value. But of course, System On mode (2.6uA) consumes more current than System Off mode (0.6uA).

    Update 26.1.2015 Similar to how it is done in this example, you can read the state of pins with

    nrf_gpio_pin_read(BUTTON_0) == BTN_PRESSED 
    

    Just check if the state of buttons is equal to the wakeup state that you set with

    nrf_gpio_cfg_sense_input(BUTTON_1, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_SENSE_LOW)
    
  • I have a question about the contents of the "Update 26.1.2015".

    This detection method of interrupt is not a detection of Edge, but it is detection of the level.

    At the timing of reading the status of PIN, I never fail to get the factors of interrupt?

    Is there a detection method in the Edge?

Reply Children
No Data
Related