Changing the Detect Hysteresis of a QTouch® Sensor

 Objective

In this lab, you will change the detect hysteresis of a button and analyze its impact. To explore this feature, you will tune the detect hysteresis value of the touch button and monitor the behavior.

This tutorial builds on the Intro to PTC and Analyze Touch Data Using QTouch® Analyzer projects. Make sure you've completed those before continuing with this hands-on exercise.

 Materials

Hardware Tools

Tool About Purchase
ATmega328PB-XplainedMini-50px.png
ATmega328PB Xplained Mini
Evaluation Kit

Software Tools

Tool About Installers
Installation
Instructions
Windows Linux Mac OSX
swtool-28px.png
Atmel® Studio
Integrated Development Environment

 Procedure

1

Stop Reading

If you've just completed the Detect Threshold Project you should click on Stop Reading.

StopReading.png

2

Open the QTouch Project Builder

In the Solution Explorer window, double-click on the .qtdgn file. Note that you may have named your project differently.

SolutionExplorerWindow.png

3

Change Button Settings

Select 'Button0' and click on the Settings icon.

Button0.png

In the 'Button0' settings, set the detect hysteresis to HYST_50.

DetectHysteresis.png

Note that the Detect Threshold is 75. We changed it from the original value during the Detect Threshold Project.

4

Generate Project

Go to the 'Project Generation' section and click Generate Project.

GenerateProject2.png

5

Build and Program

Build the solution.

Build.png

Program the application by clicking on the 'Start Without Debugging' icon.

Start.png

6

QTouch Analyzer

Open the QTouch Analyzer window by clicking on the icon as shown below.

LaunchAnalyzer.png

In the QTouch Analyzer window, click ReConnect.

ReConnect.png

Click on Start Reading.

StartReading.png

Use the 'Tabular View' to observe touch delta and state.

TabularView2.png

7

Detect State

Move a finger towards the sensor. When delta crosses the detect threshold (75), the sensor will go into the detect state.

8

Below Detect Threshold

Move the finger away from the sensor. The sensor will stay in the detect state even after the delta has fallen below the detect threshold.

BelowDelta.png

9

Detect Hysteresis

The sensor goes out of detect only after the delta value has fallen below the detect threshold by a value of more than 50% of the detect threshold (~38).

BelowDeltaStateOff.png

 Results

In this project, you observed that the touch button turns ON when the touch delta crosses the detect threshold, but it does not turn off until the touch delta falls below the detect threshold by the percentage value set in the Detect Hysteresis parameter.

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