This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

NRF51 SYSTEM ON - RTC + external interrupt

Is it possible to program an NRF51 to wake-up from SYSTEM ON by either RTC or external interrupt?

I have some sensors programmed to wake-up by RTC but I would also like the option of interrupting the sleep with a button press if I cannot wait. In essence, I would like the sleep to be interrupted by either - whichever happens first.

I'm working without a soft device.

Parents
  • Hi Gavin,

    Sure it has. Both RTCx HW peripheral as well as GPIOTE can wake you by interrupt if your code entered "sleep" by WFI/WFE ARM instructions. You can also be woken up from System OFF by GPIO signal (e.g. button press) but RTC cannot run so this is not available.

    Cheers Jan

  • Thanks Jan. If I wanted it to wake on either RTC or external interrupt, would I call WFI or WFE? At the moment I am calling WFE (see below) but it does not respond to the external interrupt.

    					// Enter System ON sleep mode
    				__WFE();  
    				// Make sure any pending events are cleared
    				__SEV();
    				__WFE();
    
Reply
  • Thanks Jan. If I wanted it to wake on either RTC or external interrupt, would I call WFI or WFE? At the moment I am calling WFE (see below) but it does not respond to the external interrupt.

    					// Enter System ON sleep mode
    				__WFE();  
    				// Make sure any pending events are cleared
    				__SEV();
    				__WFE();
    
Children
No Data
Related