How to Create a Low-Power Sensor

Last modified by Microchip on 2026/02/23 13:27

Overview

This section provides step-by-step information for generating a low-power sensor using Touch Configurator in MPLAB® Code Configurator (MCC).

Note: To create a new project, follow the steps in the "Generate a Touch Project With MPLAB® Code Configurator (MCC) Melody" page for MCC Melody or the "Generate a Touch Project With MPLAB® Code Configurator (MCC) Harmony" page for MCC Harmony.

Creating a Low-Power Sensor

Open Touch Configurator

Select MCC and open Touch Configurator in the Resource Management (MCC) tab.

Touch Configurator

Back to Top


Create a Low-Power Sensor

Once the Touch Configurator is opened, in the Create tab, add the required number of buttons/sliders/wheels. Select the required sensor and click Configure as Low Power.

Create tab

Back to Top


Event System Driven Low-Power

To create Event System Driven Low Power, once the sensor is configured as low-power, open Touch Configurator > Configure > Low Power > Configure event system (this option will be checked by default).

Note: Event system driven low power can be configured with only one low-power sensor.

Touch tab

Note: In case multiple sensors are selected while enabling Low Power, upon enabling Configure event system, a dialog box appears indicating that only one sensor can be configured as low-power sensor and provides an option to select the low-power sensor from a drop-down.

Confirmation

The following animation shows how to configure an event system-based low-power sensor.

Configure tab

Back to Top


Configure Low-Power Without Event System

To create a Low Power sensor without event system, open Touch Configurator > Configure > Low Power and uncheck Configure event system. To configure Low Power parameters, select Configure > Low Power. The following parameters can be configured according to user requirements: Low power Measurement Period, Touch inactivity timeout, and Low power Drift Wakeup.

You can see the parameter details by hovering the mouse over the parameter value drop-downs in the configurator.

Configure tab

The following animation shows how to configure a Low Power sensor without event system.

Low power sensor without event system

Back to Top


Configure Lump as Low Power

Initially, the required sensors are selected, and Lump is configured. A detailed description for creating a lump sensor is provided in the "How to Create a Lump Sensor" page. Select the Lump Sensor and click Configure as Low Power.

Configure as Low Power

Once the lump sensor is configured as a low-power sensor, it can be set up either as Event system enabled or disabled, as given in Steps 3 and 4.

Important Notes: Update the specified hints in the Project Files and the Devices Resources tab.

Note: The first and second hints given can be added to the project after generation.

 Important notes

From Device Resources > System, add SLPCTRL, which is added in the Project Graph/Builder.

Project Graph/Builder

Application builder

 

Back to Top


Generate Low-Power Sensor Code
​​​​

Click Generate in the Resource Management (MCC) tab.

Resource Management (MCC) tab

Add touch_process() and call the sleep instruction in the main > while() loop as shown.

while loop

Back to Top