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

How to react in __WFI ( )?

Hi,

i need to meassure Digital ports when i am in __WFI (); I noticed that WFi will hold the CPU so how would it bee possible to to react on digital Pins? Is it possible to measure with GPIOTE the digital pins while WFI ( ) and then wake the processor up?

Best regards Nils (:

  • Hi,

    From the reference manual:[i] "System ON mode is a fully operational mode, where the CPU and selected peripherals can be brought into a state where they are functional and more or less responsive depending on the sub power mode selected.

    In System ON mode the CPU can either be active or sleeping. The CPU enters sleep by executing the WFI or WFE instruction found in the CPU’s instruction set. In WFI sleep the CPU will wake up as a result of an interrupt request if the associated interrupt is enabled in the NVIC. In WFE sleep the CPU will wake up as a result of an interrupt request regardless of the associated interrupt being enabled in the NVIC or not.

    The system implements mechanisms to automatically switch on and off the appropriate power sources depending on how many peripherals are active, and how much power is needed at any given time. The power requirement of a peripheral is directly related to its activity level. The activity level is usually raised and lowered when specific tasks are triggered or events generated, see individual chapters describing the different peripherals for more information on how to optimize power consumption in System ON mode."[/i]

    Short summary: Configure an interrupt and enable this in NVIC. Or use WFE, and the MCU will be woken regardless of NVIC settings.

    Regards,

  • If you want to wake up on pin events, the most power efficient way is to enable SENSE on the pins in the PIN_CNF registers.

Related