Idle Mode
Introduction
In Idle mode, only the processor clock is stopped and all peripherals continue to operate at the same frequency. When exiting this mode, the processor operates back to full speed. Typically, a few processor clock cycles are needed to enter and exit this mode. In a Linux® environment, this corresponds to Suspend-to-Idle.

The conditions to enter Idle Mode are:
- Event Sampling Clock: User-defined MCKx and user-defined peripheral clock
- Mode Entry: Wait-For-Interrupt (WFI)
- Main System bus clock(MCK1) at wake-up: User-defined
Enter Idle Mode
In Idle mode, the device power consumption is optimized versus response time. In this mode, only the processor clock is stopped. The peripheral clocks, including the DDR controller clock, can be enabled. The current consumption in this mode is application-dependent. This mode is entered via the WFI instruction and CPU_CLK disabling.
Exit Idle Mode
The processor can be awakened from an interrupt. The system resumes where it was before entering WFI mode.
In this example, the WKPU interrupt (connected to pin A8/WKPU0) is used as the wake-up source.

Bare-Metal Implementation Using the MPLAB® Development Ecosystem
The bare-metal code implementation is given below:
In this example for the SAMA7D65 Curiosity Development Board, the system enters a low-power Idle state by:
- Disabling the PIT interrupt
- Configuring the WKPU interrupt (connected to pin A8/WKPU0) as the wake-up source
- The processor is placed in WFI state
Note: Processor clock can be disabled by executing WFI - To exit the low power mode, press the WKPU switch on the Curiosity Board
- Enable PIT interrupt to execute the normal operation
The accompanying image is the reference from the SAMA7D65 data sheet:

To enable WKUP interrupt using MCC, launch MCC > Plugins > Interrupt Configuration > Enable Wakeup Interrupts and then generate the code as follows:

The code snippet is shown in the accompanying image:

The sample application file is available for reference.
Debug and Test the Application
- Debug and run the application or copy and paste boot.bin and harmony.bin to the SD card and insert it into the SD card slot at J10.
- Press the Reset button to run the application.
- Now press the User Button to interrupt the normal ADC application.
- Enter "5" in the serial console window to enter Idle mode.
- To exit Idle mode, press the WKPU switch on the board.
The serial console output is as shown in the accompanying image:

Notice that the normal ADC application resumes once the system exits idle mode.
Current Measurement Using PAC193x GUI
You can measure the power in all four channels as shown in the accompanying image:

To learn how to measure power, see the "Power Monitoring (PAC1934) on SAMA7D65 Curiosity Development Board Using an MPLAB® Harmony Application" page.