Objective
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.
Materials
Software Tools
Tool | About | Installers |
Installation
Instructions |
||
---|---|---|---|---|---|
Windows | Linux | Mac OSX | |||
Atmel® Studio
Integrated Development Environment |
| | | | |
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.
QTouch® Library Middleware will be added to the project.
4
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.
5
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.
6
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.
7
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.
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.