Generate QTouch® Surface Gesture Project
Objective
The following lab shows you how to create a QTouch® Surface project in Atmel® START, where you can add horizontal and vertical sensors, and configure surface and gesture parameters. The resulting project supports GCC and IAR compilers. This project is generated for the ATTiny1617 Water Tolerant 2D Touch Surface Kit.
Materials
Hardware Tools
Software Tools
Procedure
Open Atmel START
Go to microchip.com/start and select the CREATE NEW PROJECT option.
Select Device and Create New Project
Start typing attiny1617 on the Filter on device… box. Select 'ATtiny1617-MFR' 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
The ATtiny1617 Water Tolerant Touch Surface Kit has six self-cap channels in the horizontal (X-axis) direction and five self-cap channels in the vertical (Y-axis) direction.
Adding Surface
Atmel START loads the surface with the selected configuration and a warning pops up asking you to enter the CPU and Peripheral (PTC, Timer, UART) default clock settings.
- Click Yes to load QTouch default settings for the CPU and peripheral clocks.
- Click No to configure CPU and peripheral clocks manually.
Touch and Debug Interface Pin Selection
Click on the 'Pins' tab on the left side.
Based on the design files, Y lines should be selected as follows:
Pin Selection
Click on each channel to modify the assigned pin.
Select the channel from the channels list as per the hardware design files.
Driven Shield
Click on the 'Driven Shield' tab to enable and configure the driven shield.
- Click on the Enable Driven Shield check box
- Select the driven shield pin from the shield pin drop-down menu.
Debug
Click on the 'Debug' tab to enable and configure debug port pins.
- Configure UART TXD and RXD pins as per the hardware.
- UART default baud rate is 38400 bps for AVR devices and 115200 bps for SAM Devices.
- To modify default UART settings click on View/Configure UART
- Uncheck the Enable Data streamer check box to disable the debug port to save memory in the final application.
Parameters
Channel
Select the 'Parameters' tab. Channel properties such as Oversamples, Digital Gain, Analog Gain, Series Resistor, CSD (additional cycles), Prescaler, Threshold, Hysteresis, and Sensor Adjacent Key Suppression (AKS™) Group can be modified in this tab.
Sensor
Select the 'Sensor' tab. Sensor parameters such as Detect Integration, Away from Touch Recal Integration Count, Away from Touch Recalibration Threshold, Touch Drift Rate, Away from Touch Drift Rate, Drift Hold Time, Re-burst mode and Max on Duration can be modified in this tab.
Scroll down in the same tab to change Scan Rate, Acquisition Frequency, and Noise Handling using Frequency Hop. Frequency Hop can be enabled by selecting the Enable Frequency Hop check box.
The Frequency Hop auto-tune feature can be enabled by the Enable Frequency Auto Tune check box. When Frequency Hop is enabled, configuration parameters related to frequency hopping can be modified. Similarly, Frequency Hop auto-tune configuration parameters can be changed when Frequency Hop Auto Tune is enabled.
Surface
Select the 'Surface' tab. Surface parameters such as Position Resolution, Deadband Percentage, Median Filter, IIR Filter, Position Hysteresis, and Minimum Contact can be changed in this tab.
Gesture
Select the 'Gesture' tab. This tab displays gesture parameters when the check boxes are ticked. Otherwise, gestures are enabled and loaded with default settings for gesture parameters.
To disable the gestures after surface sensor creation, uncheck the Enable Gesture check box.
When all the gesture check boxes are enabled, it displays the gesture parameters as shown below. All the gesture time-related parameters are timed with 10 ms timer, e.g. if Tap Release Timeout is configured as 5, this means 5x10 = 50 ms.
Notifications
Click on 'Notifications' tab to check the notifications triggered by Atmel START.
Summary
Select 'Summary' tab which displays Project Configuration Summary and QTouch Library Module Versions. Click on Download Summary to download the summary information.
Export
After completing all the configuration, click the EXPORT PROJECT option. Atmel Studio IDE is selected by default. Aditionally, you can select the IAR IDE if required for the project, then enter the file name and click Download Pack.