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 |
---|---|---|
ATmega324PB
ATmega324PB |
| |
ATmega324PB
Xplained Pro |
| |
QT5 Xplained Pro
Extension Kit |
| |
Software Tools
Tool | About | Installers |
Installation
Instructions |
||
---|---|---|---|---|---|
Windows | Linux | Mac OSX | |||
Atmel® Studio
Integrated Development Environment |
| | | | |
Atmel® START (ASF4)
Integrated Software Framework |
| Web Based |
Procedure
3
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.
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.
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.
- 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.
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.
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.
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.
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).
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.
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.
Sliders
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.
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.
Table of Contents
|