Idle Mode

Last modified by Microchip on 2026/11/20 18:57

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.

Clock Config

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.

Wakeup Switch

Back to Top

Bare-Metal Implementation Using the MPLAB® Development Ecosystem

The bare-metal code implementation is given below:

Information

Note:  In this example Analog-to-Digital Converter (ADC) application, Periodic Interval Timer (PIT) interrupt is enabled.

In this example for the SAMA7D65 Curiosity Development Board, the system enters a low-power Idle state by:

  1. Disabling the PIT interrupt
  2. Configuring the WKPU interrupt (connected to pin A8/WKPU0) as the wake-up source
  3. The processor is placed in WFI state
    Note: Processor clock can be disabled by executing WFI
  4. To exit the low power mode, press the WKPU switch on the Curiosity Board
  5. Enable PIT interrupt to execute the normal operation

The accompanying image is the reference from the SAMA7D65 data sheet:

Data Sheet

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

Interrupt Configuration

The code snippet is shown in the accompanying image:

Code Snippet

The sample application file is available for reference.

Back to Top

Debug and Test the Application

  1. 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.
  2. Now press the User Button to interrupt the normal ADC application.
  3. Enter "5" in the serial console window to enter Idle mode.
  4. To exit Idle mode, press the WKPU switch on the board.

The serial console output is as shown in the accompanying image:

Serial Console Output

Notice that the normal ADC application resumes once the system exits idle mode.

Back to Top

Current Measurement Using PAC193x GUI

You can measure the power in all four channels as shown in the accompanying image:

Current Measurement

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

Back to Top

Collaterals

Back to Top