Generate User Board Touch Project


The following lab shows you how to create a QTouch® project in START where you can graphically add sensors and configure QTouch parameters. The resulting project supports GCC and IAR compilers. This project is generated to use ATmega324PB Xplained Pro along with QT5 Xplained Pro Extension Kit.


Hardware Tools

Tool About Purchase
Xplained Pro
QT5 Xplained Pro
Extension Kit

Software Tools

Tool About Installers
Windows Linux Mac OSX
Atmel® Studio
Integrated Development Environment
Atmel® START (ASF4)
Integrated Software Framework
Web Based



Open Atmel Start

Go to and select the CREATE NEW PROJECT option.



Select Device and Create New Project

Start typing atmega324pb in the Filter on device… box. Select 'ATmega324PB-MN' then click on CREATE NEW PROJECT.



Add Software Components

After project creation, the project dashboard will open as follows. Click Add software component to add the QTouch Library.


You can type touch in the Filter box to be able to find the library faster. Add the 'QTouch Library' by clicking the + icon and then clicking on Add component(s).


QTouch Library Middleware will be added to the project.



Add Sensors

The QT5 Xplained Pro has two mutual capacitance buttons and one mutual capacitance slider.

Adding Button
  • Select the 'QTouch' tab and then click on the Button drop-down menu.
  • Select 'Mutualcap' as the Technology and '2' as the Number of buttons.
  • Click Add button.

After adding the sensors (buttons/slider/wheel) for the first time, a warning pops up asking you to enter the CPU and peripheral (PTC, Timer, UART) default clock settings. For some of the devices, like the ATmega324PB, the QTouch clock settings are loaded by default and this warning pop-up does not appear.

  • Click Yes to load the QTouch default settings for the CPU and peripheral clocks.
  • Click No to configure the CPU and peripheral clocks manually.
Adding Slider
  • Click on the Slider drop-down menu.
  • Select 'Mutualcap' as the Technology and '1' as the Number of sliders.
  • Enter the Number of Channels per slider.
  • Click Add button.

Check Slider Button Count
The slider in QT5 is composed of 4 buttons.
  • Select the Slider and click on Settings gear icon and ensure that Number of Buttons is '4' - if not, change to '4' and click Apply.


Pin Assignment and Touch Data Debug Interface

Refer to the following ATmega324PB Xplained Pro EXT1 header and QT5 Xplained Pro documents for connection details.

Based on the design files, the X and Y lines should be selected as follows.


Touch Pin Assignment
Select the 'Pins' tab and select the correct X and Y lines for buttons and slider.

  • Drag and drop the channels to the required combination of X and Y.
  • Click on the channel displayed as X(Y) or Y(X) to toggle X to Y or Y to X.
  • The Matrix View is only provided in case of mutual cap in order to quickly drag and drop the sensors and configure the pins.

Click on Matrix View to switch to Table View and assign the X, Y pins from the drop-down list for each sensor. Click on Table View to switch back to Matrix View.


Driven Shield Pin Assignment
Click on the 'Driven Shield' tab to configure the driven shield pin.

  • It is enabled for the supported devices.

This feature is not supported for ATmega324PB device.


For supported devices, the driven shield can be enabled and the driven shield pin can be selected from the drop-down list when dedicated shield pin is enabled.


Touch Data Debug Interface
Click on the 'Debug' tab to configure the Data Streamer (UART) pins, which can be configured as shown below. Enable Data Streamer and modify the UART pins as shown.



Basic Parameters

Select the 'Parameters' tab.
The 'Channel' tab allows you to configure touch channel properties such as Oversamples (filter level), Digital Gain, Analog Gain, Series Resistor, CSD (additional cycles), Prescaler, Threshold, Hysteresis, and AKS_GROUP (adjacent key suppression).


Click on the 'Sensor' tab to configure sensor parameters such as Detect Integration, Away from Touch Recal Count, Away from Touch Recalibration Threshold, Touch Drift Rate, Away from Touch Drift Rate, Drift Hold Time, Re-burst mode, Max on Duration, Scan Rate and Acquisition Frequency.


Scroll Down the sensor page to configure Noise Handling. Frequency Hop can be enabled by selecting the Enable Frequency Hop checkbox. You can select up to 7 Frequency Steps and then configure the Hop Frequencies from the drop-down list. Hop Frequencies are fixed at compile time in Frequency Hop.

The auto-tune feature can be enabled by selecting the Enable Frequency Auto Tuning checkbox. Hop Frequencies are tuned by the library at runtime as per the Auto Tune Parameters thresholds configured during noisy conditions.


Click on the 'Sliders' tab to configure slider parameters such as Resolution, Dead Band, Position Hysteresis and Detect Threshold as shown below.


The 'Sliders' tab will be displayed as Sliders and Wheels if both sliders and wheels are configured. Whereas it is displayed as Wheels when Wheels only are configured.



Click on the 'Notifications' tab to check if there are any warnings or guidelines from START.




Click on the 'Summary' tab to review the project configuration and download the summary.




After completing the configuration, click the EXPORT PROJECT option.


Atmel Studio is enabled by default. Select IAR Embedded Workbench if required for the project, enter the file name and click Download Package.



Once you have finished configuring your project and are ready to export, you can either export to IAR or to Atmel Studio to start writing your application code.

© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.