Generate User Board Touch Project

 Objective

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.

 Materials

Hardware Tools

Tool About Purchase
hwtool-50px.png
ATmega324PB
ATmega324PB
hwtool-50px.png
ATmega324PB
Xplained Pro
hwtool-50px.png
QT5 Xplained Pro
Extension Kit

Software Tools

Tool About Installers
Installation
Instructions
Windows Linux Mac OSX
swtool-28px.png
Atmel® Studio
Integrated Development Environment
Atmel® START (ASF4)
Integrated Software Framework
Web Based

 Procedure

1

Open Atmel Start

Go to start.atmel.com and select the CREATE NEW PROJECT option.

NewProject.png

2

Select Device and Create New Project

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

CreateNewProject.png

3

Add Software Components

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

AddSoftwareComponents.png

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).

AddComponents.png

QTouch Library Middleware will be added to the project.

Middleware.png

4

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.
    AddButton_new.png

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.
WarningForClocks.png
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.
    AddSliderNew.png

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.
EditSliderSettings1_new.png

5

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.

pinselection.png

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.
Matrix_new.png

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.

Table.png

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.

drivenshield_new.png

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.

drivenshield_support.png

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.

DebugInterface_new.png

6

Basic Parameters

Select the 'Parameters' tab.
Channel
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).

Channel_Parameters.png

Sensor
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.

Sensor_Parameters.png

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.

Freq_Hop_Auto_Tune.png

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

Sliders.png

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.

7

Notifications

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

Notifications.png

8

Summary

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

Summary.png

9

Export

After completing the configuration, click the EXPORT PROJECT option.

ExportProject.png

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

ExportProject_new.png

 Results

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.