How to Configure Timers for a Touch Project in MPLAB® Code Configurator (MCC) Melody

Last modified by Microchip on 2026/02/25 10:55

8-bit ATtiny, AVRDA Devices

Information

Note: Only Real-Time Counter (RTC) is supported.

Warning

Caution: Do not change the API Prefix field.

Include RTC from Device Resources.

Device Resources pane

Back to Top


Enable Overflow Interrupt.

Easy View tab

Back to Top

8-bit PIC® Devices

Warning

Caution: Do not change the API Prefix field.

The timer needs to be configured manually, and it must be selected in Touch Configurator.

Include the required timer from Device Resources > Drivers > Timer (for example, TMR0).

Device Resources pane

Back to Top


Select the same timer in Project Graph by clicking the touch_timer block and select the required timer from the drop down. 

PIC-8bit-Timer-Fig2.svg

And configure the TMR as shown. Clock Source for Timer peripheral should be LFINTOSC

TMR1 tab

Back to Top

ATmega328PB, ATmega324PB Devices

Warning

Caution: Do not change the API Prefix field.

The timer can be manually configured from Touch Configurator.

Include the required timer from Device Resources > Drivers (for example, TC0).

Device Resources pane

Back to Top


Include the touch_timer_handler in ISR.

ISR

Back to Top

dsPIC® Digital Signal Controllers (DSCs)

Warning

Caution: Do not change the API Prefix field.

The timer needs to be configured manually, and it must be selected in Touch Configurator.

In the Configure tab, ensure the required partner pin is selected.

Configure tab

Back to Top


For Timer1, select the required timer under Dependency Selector.

Timer1 dependency selector

Back to Top