Generate User Board Touch Project


The following lab shows you how to create a QTouch® project in Atmel 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.


Software Tools

Tool About Installers
Windows Linux Mac OSX
Atmel® Studio
Integrated Development Environment



Open Atmel Start

Go to and select the CREATE NEW PROJECT option.



Select Device and Create New Project

Start typing atmega324pb on the Filter on device… box. Select ATmega324PB-MN and proceed to 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.


QTouch® Library Middleware will be added to the project.



Add Sensors

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 Button Count.
  • Click Add button.

Adding Slider
  • Click on the Slider drop-down menu.
  • Select Mutualcap as the Technology and 1 as the Slider Count.
  • 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.
  • Update the mininum contact size to 20.


Sensor Properties

Button Settings
Select a Button and click the settings gear and the SENSOR PROPERTIES window will be displayed. Sensor Threshold, Hysteresis and AKS can be configured in this window. Update the Sensor Threshold to 10.


Similarly, update other button's "Sensor Threshold".

Slider Settings
Select the Slider and click the settings gear and the SENSOR PROPERTIES window will be displayed. Scroll down the setting window and update all the four button's Sensor Threshold to 10.



Pin Assignment and Touch Data Debug Interface

Refer to ATmega324PB Xplained Pro EXT1 header and QT5 Xplained Pro to know the connection details.

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


Select the Pins tab and select the correct X and Y lines for buttons and slider. It would be good to Reset the default assignment.


Also found in this tab is the Enable Driven Shield checkbox, which can be enabled for the supported devices as shown. This feature is not supported for ATmega324PB device.


Also found in this tab is the Enable Data Streamer checkbox, which can be enabled as seen below. Enable this and modify the UART pins as shown.



Basic Parameters

Select the Parameters tab. Touch channel properties such as prescaler, gain, filter level, and CSD can be changed in this tab.


The maximum allowed clock frequency for PTC is 4MHz. In megaAVR and tinyAVR, the PTC uses the same CPU clock. The prescaler option in the Parameter tab needs to be changed for all buttons such that the PTC clock frequency is less than 4MHz.

CPU clock frequency can be configured in CLOCKS tab as shown below. Click on the settings gear icon to configure the clock frequency.


Also in the Parameters tab, you will find key Sensor Touch Parameters like DI, and MOD as well as Sensor Acquisition Parameters such as acquisition frequency, measurement period, etc.



Advanced Parameters

In the Advanced tab, frequency hop can be enabled by selecting the Enable Frequency Hop.
The auto-tune feature can be enabled by Enable Frequency Auto Tune checkbox.


When Frequency Hop is enabled, configuration parameters related to frequency hopping can be changed.



After completing all the configuration, click the EXPORT PROJECT option.


Select the IDE 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.