Objective
The following lab shows you how to create a QTouch® Surface project in Microchip's 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 ATTiny1617 Water Tolerant Touch Surface Kit.
Materials
Hardware Tools
Tool | About | Purchase |
---|---|---|
ATTINY1617
ATTINY1617 |
| |
ATTINY1617
Water Tolerant Touch Surface Kit |
| |
Software Tools
Tool | About | Installers |
Installation
Instructions |
||
---|---|---|---|---|---|
Windows | Linux | Mac OSX | |||
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.
QTouch Library Middleware will be added to the project.
4
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
a
Select the 'QTouch' tab and then click on the 2D Surface drop-down menu.
b
Enter the Number of Horizontal channels as 6 and the Number of Vertical channels as 5.
c
Select 'Selfcap' from the Technology drop-down menu.
d
Select '1 & 2 Finger gestures' from the Gesture Type drop-down menu.
e
Click Add button
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.
5
Touch and Debug Interface Pin Selection
Click on the 'Pins' tab on the left side.
Refer to ATtiny1617 Water Tolerant Touch Surface Kit design files
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.
This feature is not supported on all devices. The Enable Driven Shield check box is greyed out when not supported.
a
Click on the Enable Driven Shield check box
b
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.
a
Configure UART TXD and RXD pins as per the hardware.
b
UART default baud rate is 38400 bps for AVR devices and 115200 bps for SAM Devices.
c
To modify default UART settings click on View/Configure UART
d
Uncheck the Enable Data streamer check box to disable the debug port in order to save memory in the final application.
6
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.
Note: All keys forming a touch surface should be configured with similar threshold and hysteresis, and all in the same Adjacent Key Suppression (AKS™) Group.
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.
Note: Detect Integration should not be more than two in surface and gesture projects.
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.
Note: Position resolution should be less than or equal to 8-bit, when gestures are enabled.
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.
Note: All '1 Finger' or both '1 & 2 Finger' gestures are enabled based on the gesture selection during surface sensor creation.
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.
Note: Ensure that while configuring Tap Release Timeout, Swipe Timeout, and Tap Hold Timeout you follow the equation:
Tap Release Timeout < Swipe Timeout < Tap Hold Timeout