Microchip ATSAMC21G18A Bedienungsanleitung


Lesen Sie kostenlos die 📖 deutsche Bedienungsanleitung für Microchip ATSAMC21G18A (100 Seiten) in der Kategorie Nicht kategorisiert. Dieser Bedienungsanleitung war für 14 Personen hilfreich und wurde von 2 Benutzern mit durchschnittlich 4.5 Sternen bewertet

Seite 1/100
User's Guide
QTouch® Modular Library Peripheral Touch Controller
User's Guide
Description
The Microchip QTouch® Peripheral Touch Controller (PTC) offers built-in hardware for capacitive touch measurement
on sensors that function as buttons, sliders, and wheels. The PTC supports both mutual and self-capacitance
measurements without the need for any external component. It offers superb sensitivity and noise tolerance, as well
as self-calibration, and minimizes the sensitivity tuning effort by the user. It also extends the support for capacitive
touch surface and gesture functionality.
The PTC is intended for autonomously performing capacitive touch sensor measurements. The external capacitive
touch sensor is typically formed on a PCB, and the sensor electrodes are connected to the analog charge integrator
of the PTC using the device I/O pins. The PTC supports mutual capacitance sensors organized as capacitive touch
matrices in different X-Y configurations, including Indium Tin Oxide (ITO) sensor grids. In Mutual Capacitance mode,
the PTC requires one pin per X-line (driveline) and one pin per Y-line (sense line). In Self-Capacitance mode, the
PTC requires only one pin with a Y-line driver for each self-capacitance sensor.
Features
Implements Low-Power, High-Sensitivity, Environmentally Robust Capacitive Touch Buttons
Supports Mutual Capacitance and Self-Capacitance Sensing
Up to 46 Buttons in Self-Capacitance mode
Up to 529 Buttons in Mutual Capacitance mode
Supports Lumped Mode Configuration
One Pin Per Electrode
Load Compensating Charge Sensing
Parasitic Capacitance Compensation for Mutual Capacitance mode
Adjustable Gain for Superior Sensitivity
Zero Drift Over the Temperature and VDD Range
No Need for Temperature or VDD Compensation
Hardware Noise Filtering and Noise Signal De-Synchronization for High Conducted Immunity
Atmel Start QTouch Configurator Support – Wizard Guided Touch Project Creation
Product Support
For assistance related to QTouch capacitive touch sensing software libraries and related issues, contact your local
Microchip sales representative or visit https://www.microchip.com/support/.
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 1
Table of Contents
Description..................................................................................................................................................... 1
Features......................................................................................................................................................... 1
Product Support............................................................................................................................................. 1
1. Introduction............................................................................................................................................. 5
2. Capacitive Touch Measurement..............................................................................................................6
2.1. Self-Capacitance..........................................................................................................................6
2.2. Mutual Capacitance......................................................................................................................7
3. Touch Sensors...................................................................................................................................... 10
3.1. Buttons....................................................................................................................................... 10
3.2. Proximity Sensor........................................................................................................................ 10
3.3. Lumped Sensor..........................................................................................................................10
3.4. Interpolated Sensors.................................................................................................................. 11
3.5. 2D Position Sensors................................................................................................................... 11
3.6. Mix and Match............................................................................................................................ 11
4. PTC....................................................................................................................................................... 12
4.1. Overview.................................................................................................................................... 12
4.2. Self-Capacitance........................................................................................................................12
4.3. Mutual Capacitance....................................................................................................................12
5. QTouch® Modular Library......................................................................................................................14
5.1. Introduction.................................................................................................................................14
5.2. QTouch® Library Modules.......................................................................................................... 14
5.3. Module Naming Conventions..................................................................................................... 14
5.4. QTouch® Library Application Interface....................................................................................... 16
5.5. Application Flow......................................................................................................................... 17
5.6. MISRA Compliance.................................................................................................................... 17
6. Acquisition Module................................................................................................................................ 19
6.1. Overview.................................................................................................................................... 19
6.2. Interface..................................................................................................................................... 19
6.3. Functional Description................................................................................................................19
6.4. Configuration..............................................................................................................................20
7. Boost Mode........................................................................................................................................... 26
7.1. Introduction.................................................................................................................................26
7.2. Configuration..............................................................................................................................26
8. Frequency Hop Module.........................................................................................................................32
8.1. Overview.................................................................................................................................... 32
8.2. Interface..................................................................................................................................... 32
8.3. Functional Description................................................................................................................33
8.4. Configuration..............................................................................................................................33
User's Guide
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 2
9. Frequency Hop Auto-Tune Module....................................................................................................... 36
9.1. Overview.................................................................................................................................... 36
9.2. Interface..................................................................................................................................... 36
9.3. Functional Description................................................................................................................37
9.4. Configuration..............................................................................................................................38
10. Touch Key Module.................................................................................................................................40
10.1. Overview.................................................................................................................................... 40
10.2. Interface..................................................................................................................................... 40
10.3. Functional Description................................................................................................................41
10.4. Configuration.............................................................................................................................. 42
11. Scroller Module..................................................................................................................................... 45
11.1. Overview.................................................................................................................................... 45
11.2. Interface..................................................................................................................................... 45
11.3. Functional Description................................................................................................................46
11.4. Configuration..............................................................................................................................47
12. 2D Surface (One-Finger Touch) CS Module......................................................................................... 50
12.1. Overview.................................................................................................................................... 50
12.2. Interface..................................................................................................................................... 50
12.3. Functional Description................................................................................................................51
12.4. Operation....................................................................................................................................52
12.5. Configuration.............................................................................................................................. 52
13. 2D Surface (Two-Finger Touch) CS/2T Module.................................................................................... 55
13.1. Overview.................................................................................................................................... 55
13.2. Interface..................................................................................................................................... 56
13.3. Functional Description................................................................................................................57
13.4. Operation....................................................................................................................................58
13.5. Configuration.............................................................................................................................. 58
14. Gestures Module...................................................................................................................................61
14.1. Overview.................................................................................................................................... 61
14.2. Interfaces to Module...................................................................................................................62
14.3. Configuration.............................................................................................................................. 62
15. Binding Layer Module........................................................................................................................... 65
15.1. Overview.................................................................................................................................... 65
15.2. Interface..................................................................................................................................... 65
15.3. Functional Description................................................................................................................66
15.4. Configuration.............................................................................................................................. 68
16. Building Applications Using Atmel START............................................................................................ 70
17. Using Data Visualizer with QTouch® Applications.................................................................................71
17.1. Overview.................................................................................................................................... 71
17.2. Datastreamer Module.................................................................................................................71
17.3. Debugging Using Data Visualizer...............................................................................................72
17.4. Debugging Using 2D Touch Surface Utility................................................................................ 76
User's Guide
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 3
18. Tuning Procedure..................................................................................................................................77
18.1. Tuning for Noise Performance....................................................................................................77
18.2. Tuning the Slider/Wheel Sensor.................................................................................................82
19. Known Issues........................................................................................................................................85
20. Appendix A - Revision History...............................................................................................................86
21. Appendix B - Acquisition Module API Reference.................................................................................. 87
22. Appendix C - Frequency Hop Module API Reference...........................................................................89
23. Appendix D - Frequency Hop Auto-tune Module API Reference.......................................................... 90
24. Appendix E - Touch Key Module API Reference...................................................................................91
25. Appendix F - Scroller Module API Reference....................................................................................... 92
26. Appendix G - 2D Surface (One-Finger Touch) CS Module................................................................... 93
27. Appendix H - 2D Surface (Two-Finger Touch) CS/2T Module.............................................................. 94
28. Appendix I - Gestures Module...............................................................................................................95
29. Appendix J - Binding Layer Module API Reference.............................................................................. 96
30. Appendix K - Device Support................................................................................................................ 97
The Microchip Website.................................................................................................................................98
Product Change Notification Service............................................................................................................98
Customer Support........................................................................................................................................ 98
Microchip Devices Code Protection Feature................................................................................................ 98
Legal Notice................................................................................................................................................. 98
Trademarks.................................................................................................................................................. 99
Quality Management System....................................................................................................................... 99
Worldwide Sales and Service.....................................................................................................................100
User's Guide
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 4
1. Introduction
The QTouch® Modular Library (QTML) provides the touch-sensing functionality of a QTouch Library under a modular
architecture. By dividing the library into functional units, an application developer can include only those modules
which provide functionality relevant to the target application, thereby saving both device memory and processing
time.
User's Guide
Introduction
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 5
2. Capacitive Touch Measurement
The QTouch Modular Library supports PTC measurement of self-capacitance and mutual capacitance touch sensors
on a selection of AVR®, Arm® Cortex-M0+, Arm Cortex-M23, and Arm Cortex-M4 microcontrollers.
In all current capacitive touch measurement methods, one of two basic functional approaches is implemented: Self-
capacitance or mutual capacitance.
2.1 Self-Capacitance
Self-capacitance refers to a capacitive measurement using a single sensor electrode to measure the apparent
capacitance between the electrode and the DC ground of the touch sensor MCU circuit.
At power-on or Reset, a baseline measurement of the capacitance is recorded and assumed to be the ‘Out Of Touch’
capacitance. Reference capacitance is the combination of Cp in parallel to the series pair Cg and Cx.
When a touch contact is applied, the capacitance is increased by the introduction of a parallel path to earth, via the
series combination of Ct and Ch. The increase is compared to the touch threshold, and if exceeded, the sensor is
indicated to be ‘In Touch.
Note:  Cx, the human body capacitance, varies by person and surroundings and is typically in the order of 100 pF to
200 pF. The touch contact Ct, however, is more consistent and much smaller at typically 1 pF to 5 pF, depending
primarily on the design and construction of the touch sensor and secondly on the size of the finger used to activate
the sensor.
As the dominant component in a pair of series capacitors is the smaller one, in this case, Ct, a well-designed and
tuned sensor shows very consistent sensitivity to touch contact with little dependence on the user.
User's Guide
Capacitive Touch Measurement
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 6
2.2 Mutual Capacitance
Mutual capacitance refers to a capacitive measurement using a pair of sensor electrodes to measure the apparent
capacitance between them. Typically, one electrode acts as the Driver (X), while the other is the receiver (Y). Each
physical location where an X electrode transfers charge to a Y electrode is a sensor node, and this is the location of
touch sensitivity.
User's Guide
Capacitive Touch Measurement
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 7
As with self-capacitance, a baseline measurement of the capacitance is recorded and assumed to be the ‘Out Of
Touch capacitance. Reference capacitance is the apparent capacitance between the X electrode and the Y
electrode. Unlike self-capacitance, the reference capacitance does not depend on an earth return.
Interaction between a mutual capacitance sensor and the human body is more complex. It may be modeled by
considering two separate touch contacts to the X and Y electrodes, where each is capacitively coupled to the body,
resistively connected to each other inside the body and capacitively coupled to earth via the human body
capacitance.
A touch contact has two competing effects:
The introduction of a conductive plate (finger) to both X and Y electrodes increases the capacitance between X
and Y. This occurs if any conductive part is placed over the sensor.
The addition of another capacitance (Ch + Cg) at the XY node provides an alternative path for the energy
emitted by the X electrode, reducing the amount of charge accumulated on the sensor. This effect is manifested
as an apparent reduction in the XY capacitance and occurs only if the body of material connected to the
conductive part has a significant self-capacitance.
When a real touch contact is placed, the second (reducing) effect is much greater than the first (increasing) effect,
and so a touch contact on a mutual capacitance sensor is indicated by an apparent reduction in sensor capacitance.
This apparent change in capacitance (delta) is compared to the configured touch threshold, and if it exceeds the
threshold, then the sensor is deemed to be in detect.
User's Guide
Capacitive Touch Measurement
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 8
User's Guide
Capacitive Touch Measurement
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 9
3. Touch Sensors
Capacitive sensors may be implemented to simply detect contact as a button replacement, or functionally extended
to provide a relative measurement of distance (proximity), 1D position (slider or wheel), 2D position (QTouch
Surface), or 3D position (QTouch Surface with proximity).
In each case, the modular library detects a touch contact by a change in capacitance exceeding a pre-configured
threshold. Once a contact has been confirmed, the various post-processing modules use the calculated touch delta to
interpolate amongst neighboring sensors and calculate the location of the touch position or relative proximity.
3.1 Buttons
The simplest implementation of a capacitive sensor is a button, where the sensor consists of a single node (one
electrode for self-capacitance, one pair of electrodes for mutual capacitance) and is interpreted as a binary state; In
Detect or Out of Detect.
3.2 Proximity Sensor
An extension of the button is a proximity sensor. A single sensor node is monitored for a change in capacitance
exceeding a pre-configured threshold. In the same way as the button, the sensor is considered to be when‘In Detect’
that threshold is exceeded. Once in detect, a relative measurement of the contact distance is made by scaling the
touch delta between two thresholds - the initial threshold and a second threshold.‘Detect’ ‘Full Contact’
Note:  As the proximity sensor relies on the capacitive load of a distant object, the ‘apparent distance’ to the contact
will depend on the shape and size of the contact.
I.e., an open hand in proximity at 10 cm will ‘appear’ closer than an extended finger at 10 cm, as it has a larger
influence on capacitance due to a larger surface area at the same distance.
Capacitance (C) is proportional to Area (A) and inversely proportional to distance (d). Also, the grounding has a
significant impact on sensitivity, and so does the range.
 
3.3 Lumped Sensor
A Lumped sensor is implemented as a combination of multiple sense lines (self-capacitance measurement) or
multiple drive and sense lines (mutual capacitance measurement) to act as one single sensor. This provides the
application developer with greater flexibility in the touch sensor implementation.
Improve the touch sensor responsiveness by reducing the number of measurements and therefore, the time
required for initial touch detection
Fast position resolution by binary search
Improved moisture rejection through ‘All but one’ key lumping in a touch button application
Provide wake-on-touch functionality on any key (up to maximum capacitance limits) with significantly lower
power consumption as only one sensor measurement is required for all keys
Dual-purpose sensor electrodes – e.g., individual keys may be lumped together to form a proximity sensor
Touch detection on a lumped sensor is implemented in the same way as a single node touch button. The capacitance
of the lump sensor is equal to or more than the sum of the individual sensors’ capacitance. Lumping too many sensor
may result in saturation. In general, the capacitance of the self-capacitance sensor is higher than the mutual
capacitance sensor. The number of sensor electrodes that can be lumped is relatively less for self-capacitance
designs.
User's Guide
Touch Sensors
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 10
4. PTC
4.1 Overview
The Microchip QTouch® Peripheral Touch Controller (PTC) offers built-in hardware for capacitive touch measurement
on sensors that function as buttons, sliders, and wheels. The PTC supports both mutual and self-capacitance
measurements without the need for any external components. It offers superb sensitivity and noise tolerance, as well
as self-calibration, and minimizes the sensitivity tuning effort by the user.
The PTC is intended for autonomously performing capacitive touch sensor measurements. The external capacitive
touch sensor is typically formed on a PCB, and the sensor electrodes are connected to the analog charge integrator
of the PTC using the device I/O pins. The PTC supports mutual capacitance sensors organized as capacitive touch
matrices in different X-Y configurations, including Indium Tin Oxide (ITO) sensor grids.
4.2 Self-Capacitance
In Self-Capacitance mode, the PTC requires only one pin with a Y-line driver for each self-capacitance sensor.
Figure 4-1. Self-Capacitance PTC Measurement
4.3 Mutual Capacitance
In Mutual Capacitance mode, the PTC requires one pin per X-line (driveline) and one pin per Y-line (sense line).
User's Guide
PTC
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 12
Figure 4-2. Mutual Capacitance PTC Measurement
User's Guide
PTC
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 13
5. QTouch® Modular Library
5.1 Introduction
The QTouch Modular Library provides the touch-sensing functionality of a QTouch Library under the redesigned
modular architecture. By dividing the library into functional units, it is possible for an application developer to include
only those modules which provide functionality relevant to the target application, thereby saving both device memory
and processing time.
5.2 QTouch® Library Modules
QTouch Library modules can be classified into three types based on the functionality, as shown below.
5.3 Module Naming Conventions
The naming conventions followed on the QTouch Library modules are given below.
qtm _ <module_name_identifier> _ <device_architecture> _ <module_ID> .
<file extension>
qtm / libqtm
An acronym that indicates QTouch module. All QTouch modules begin with qtm_
for easy identification.
For GCC modules, ” is prepended to the module name, thus it would belib
“ ”.libqtm
User's Guide
QTouch® Modular Library
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 14
module_name_identifier
acq – acquisition module with auto-tune
acq_runtime – acquisition module without auto-tune code
freq_hop – frequency hop module
freq_hop_auto_tune – frequency hop with auto-tune module
device_architecture
cm0p – for all Cortex M0+ post processing modules
cm4 – for all Cortex M4F post processing modules
samd1x – SAM D10/D11 acquisition modules only
t81x – all modules of AVR ATtiny817 device families
t161x - all modules of AVR ATtiny1617 device families
t321x - all modules of AVR ATtiny3217 device families
m328pb - all modules of AVR ATmega328PB device
m324pb- all modules of AVR ATmega324PB device
saml21 - SAM L21 acquisition module only
saml22 - SAM L22 acquisition module only
samc21 - SAM C21 acquisition module only
samc20 - SAM C20 acquisition module only
samd21 - SAM D21 acquisition module only
samda1 - SAM DA1 acquisition module only
samha1 - SAM HA1 acquisition module only
samd20 - SAM D20 acquisition module only
saml10 - SAM L10 acquisition module only
saml11 - SAM L11 acquisition module only
cm23 – for all Cortex M23 post processing modules
module_id Unique 16-bit identifier for each module
file_extension .a – GCC modules of AVR® and Arm® devices, IAR modules of Arm devices
.r90 – IAR modules of all AVR modules
User's Guide
QTouch® Modular Library
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 15
See examples below:
Table 5-1. Acquisition Module of AVR® ATmega328PB Device
GCC module libqtm_acq_m328pb_0x0001.a
IAR module qtm_acq_m328pb_0x0001.r90
Touch Keys Processing Module of SAM D2x, SAM DA1, SAM HA1, SAM D1x, SAM L2x, SAM C2x Devices
GCC module libqtm_touch_key_cm0p_0x0002.a
IAR module qtm_touch_key_cm0p_0x0002.a
Touch Keys Processing Module of SAM L1x Devices
GCC module libqtm_touch_key_cm23_0x0002.a
IAR module qtm_touch_key_cm23_0x0002.a
5.4 QTouch® Library Application Interface
In addition to library modules, the various components that are required to build the complete touch application are
given below.
1. Module API files.
2. and files.Touch.c Touch.h
3. .Common_components_api.h
4. .Touch_api_ptc.h
5. Module reburst flag.
6. Binding layer module.
5.4.1 Module API files
The API for each module is defined in its associated header file. Dependencies between modules are minimized and
implemented at the application level. This allows for easy porting of application code from one device to another –
only the hardware-dependent module configurations must be adjusted. The acquisition auto-tune and acquisition
manual tune modules have the same API file. All the other modules have their API file that needs to be linked to the
user application.
5.4.2 and filesTouch.c Touch.h
User options for each module are configured in application code, typically and , and shared withtouch.h touch.c
the library module by pointer reference. Similarly, arrays are created in application code for modules’ run-time data
and provided to the module via a pointer.
Configurations may be modified on-the-fly by application code in between measurement sweeps of the touch
sensors. All run-time data is available to the application code.
5.4.3 Common_components_api.h
The application requires structures and definitions common to all modules. The common definitions, macros, and the
data structures are placed in the file .“ ”qtm_common_components_api.h
5.4.4 Touch_api_ptc.h
This file contains all the module API files included in the content, and thus this single file is sufficient to be included
on the application source files wherever necessary.
User's Guide
QTouch® Modular Library
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 16
5.4.5 Module Reburst Flag
Module configuration and functionality are unique to each module, but any module may require a repeated
measurement of specific sensors. To achieve this, a signal conditioning module may temporarily change the
acquisition configuration, e.g., to disable those sensors not requiring reburst.
This is indicated to the application by the implementation of a common byte at the first location of the signal‘Status’
conditioning group data structure. A ’ in bit 7 indicates that the application should re-start measurement on the1
sensor group without waiting for the measurement cycle time-out.
Figure 5-1. uint8_t qtm_xxx_status
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Re-burst
Module specific status flags
5.4.6 Binding Layer Module
The binding layer module provides an easy interface of QTouch modules to the user application. The binding layer
binds all the configured modules in the appropriate sequence using minimal API functions. It takes care of the
initialization of modules, synchronizes the calling procedures, and handles the error statuses.
5.5 Application Flow
5.6 MISRA Compliance
QTouch Library modules source code is compliant with the rule set of MISRA 2004, with the following‘Required’
exceptions:
User's Guide
QTouch® Modular Library
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 17
Table 5-2. AVR® MCU Acquisition Modules and Exceptions
Acquisition Modules of ATmega32xPB, ATtiny81x, ATtiny161x, ATtiny321x Devices
MISRA Rule Definition Remarks
1.1
All code shall conform to ISO 9899:1990 Programming
languages – C, amended and corrected by ISO/IEC
9899/COR1:1995, ISO/IEC 9899/AMD1:1995, and
ISO/IEC 9899/COR2:1996
The compiler is configured to allow
extensions
8.5 There shall be no definitions of objects or functions in
a header file Inline functions are used in the header files
17.4 Array indexing shall be the only allowed form of
pointer arithmetic
The pointer of module data structures is
passed as a parameter and individual object
data are fetched by iterating the data
structure as an array index
Table 5-3. AVR® Postprocessing Modules and Exceptions
Touch_key, Binding Layer, Frequency Hop Auto Tune, Frequency Hop, Scroller, 2D Touch Surface and
Gesture
MISRA Rule Definition Remarks
17.4 Array indexing shall be the only allowed
form of pointer arithmetic
The pointer of module data structures is passed as a
parameter and individual object data are fetched by
iterating the data structure as an array index
Table 5-4. Arm® Acquisition Modules and Postprocessing Modules
Modules
MISRA Rule Definition Remarks
1.1
All code shall conform to ISO 9899:1990
Programming languages – C, amended and corrected
by ISO/IEC 9899/COR1:1995, ISO/IEC 9899/
AMD1:1995, and ISO/IEC 9899/COR2:1996
The compiler is configured to allow
extensions
17.4 Array indexing shall be the only allowed form of
pointer arithmetic
The pointer of module data structures is
passed as a parameter and individual object
data are fetched by iterating the data
structure as an array index
User's Guide
QTouch® Modular Library
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 18
6. Acquisition Module
6.1 Overview
The minimum requirement for a touch sensor application is an acquisition module, which implements all hardware-
dependent operations for configuration and measurement of capacitive touch or proximity sensors.
6.2 Interface
The data structure definitions and the API declarations are included in the API file
”. The data structure covers all the configurations and output dataqtm_acq_<device_id>_<module_id>_api.h
variables. This file should be included on the common API ’ file.touch_ptc_api.h
Touch.h
Macros and
constants
Qtm_acq_<device_i
d>_<Module_id>_a
pi.h
Touch_api_ptc
.h
Acquisition
Module
common_
components_api.h
Touch.c
Global variables declaration
and initialization, Helper API
functions
6.3 Functional Description
Acquisition modules are target specific, each having a hardware configuration structure depending on the touch
sensing technology and method applied.
User's Guide
Acquisition Module
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 19
Features Implemented in this Acquisition Module
Hardware Calibration for Sensor Nodes
Calibration of Prescaler/Resistor/Charge share delay to compensate for a time constant of sensor
electrodes
Calibration of internal compensation circuit to match sensor load
Self-Capacitance and Mutual Capacitance Sensor Touch Measurement with Normal Sequencing
Low-Power Mode of Automated Scanning Using Event System (Currently not Supported on Atmel Start
Configurator)
6.4 Configuration
6.4.1 Data Structures
The acquisition module implements all functionality required for making relative measurements of sensor
capacitance. This is the only module uniquely built for an individual device, as it must access and control the pins
used for touch sensor implementation.
As devices have different hardware features available, different configuration options are available on each device.
For the most efficient use of system resources – ROM and RAM – different sensor configuration structures are
required.
However, where the same variable name is used within the structure, the functionality controlled by that variable is
identical. Any dependent function should utilize a reference to the variable, and NOT rely on a reference to the
structure and pointer arithmetic.
User's Guide
Acquisition Module
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 20
Acquisition Group Configuration
A reference by a pointer to ’ will always point to the correct&ptc_qtlib_acq_gen1.freq_option_select
memory location, regardless of the device. However, any implementation based on pointer arithmetic will require re-
factoring if code is to be re-used from one device for another.
Parameter Size Range/Options Usage
num_sensor_nodes 16-bit 0 to 65535 The number of sensor nodes configured in the group
acq_sensor_type 8-bit
NODE_SELFCAP
NODE_MUTUAL
Defines the measurement method applied to this group of
nodes
calib_option_select 1 byte
Bits 3:0
Calibration type:
CAL_AUTO_TUNE_NONE
CAL_AUTO_TUNE_RSEL
CAL_AUTO_TUNE_PRSC
CAL_AUTO_TUNE_CSD*
The calibration type selects which parameter should be
automatically tuned for optimal charge transfer
Bits 7:4
Calibration target:
CAL_CHRG_2TAU
CAL_CHRG_3TAU
CAL_CHRG_4TAU
CAL_CHRG_5TAU
The calibration target applies a limit to the charge transfer
loss allowed, where a higher setting of a target ensures a
greater proportion of full charge is transferred
freq_option_select 1 byte FREQ_SEL_0 FREQ_SEL_15 to
Or FREQ_SEL_SPREAD
FREQ_SEL_0 FREQ_SEL_15 to inserts a delay cycle
between measurements during oversampling, where 0 is
the shortest delay, 15 the longest.
FREQ_SEL_SPREAD varies this delay from 0 to 15 in a
sawtooth manner during the oversampling set.
PTC_interrupt_priority** 1 byte 1 to 3 Interrupt priority level for the PTC
Note:  * - Not available on all devices.
** - Applicable for Arm® Cortex devices only.
Node Configuration
Similarly, node configuration structures vary depending on which device is used.
Number of X lines
Number of Y lines
Feature availability
User's Guide
Acquisition Module
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 21
Parameter Size Range/Options Usage
node_xmask 1/2/4/8 bytes (Bit field)
Set the bit(s) at location(s)
corresponding to X line
number(s).
Example:
X0 only = = 0x010b00000001
X0 and X2 = =0b00000101
0x05
1 byte is used for devices with
up to 8 “X” lines.
2 bytes, 4 bytes, 8 bytes are
used for devices up to 16, 32
and 46* “X” lines, respectively.
Note: 
*Can support up to 64 X lines.
node_ymask 1/2/4/8 bytes (Bit field)
Set the bit(s) at location(s)
corresponding to Y line
number(s).
Example:
Y5 only = = 0x200b00100000
Y1, Y2 and Y7 = 0b10000110
= 0x86
1 byte is used for devices with
up to 8 “Y” lines
2 bytes, 4 bytes, 8 bytes are
used for devices up to 16, 32,
and 46 “Y” lines, respectively.*
Note: 
*Can support up to 64 Y lines.
node_csd*1 byte 0 to 255
The number of delay cycles to
ensure charging of sensor node
capacitances.
(Applicable for AVR® ATtiny,
ATmega, Arm® SAM E54,
SAMCx, SAM L22 family only.)
User's Guide
Acquisition Module
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 22
...........continued
Parameter Size Range/Options Usage
node_rsel_prsc 1 byte
Bits 7:4 = RSEL
RSEL_VAL_0
RSEL_VAL_3*
RSEL_VAL_6*
RSEL_VAL_20
RSEL_VAL_50
RSEL_VAL_70*
RSEL_VAL_75*
RSEL_VAL_80*
RSEL_VAL_100
RSEL_VAL_120*
RSEL_VAL_200*
Internal Y line series resistor
selection.
* May not be available for all
devices.
SAM E5x, SAM D5x: 3 kΩ, 6
kΩ, 75 kΩ, 200 kΩ
SAM L22: 75 kΩ, 200 kΩ
AVR-DA: 70 kΩ, 80 kΩ, 120 kΩ,
200
Bits 3:0 = PRSC
PRSC_DIV_SEL_1
PRSC_DIV_SEL_2
PRSC_DIV_SEL_4
PRSC_DIV_SEL_6*
PRSC_DIV_SEL_8
PRSC_DIV_SEL_12*
PRSC_DIV_SEL_14*
PRSC_DIV_SEL_16*
PRSC_DIV_SEL_32*
PRSC_DIV_SEL_64 *
PRSC_DIV_SEL_128*
Clock Prescaler
The acquisition clock is derived
and scaled from CPU clock for
AVR® devices.
*May not be available for all
devices.
SAM E5x, SAM D5x, ATtiny: 16
kΩ, 32 kΩ, 64 kΩ, 128 kΩ
AVR-DA: 6, 12, 14 **
**The numbers correspond to
the prescaler value.
node_gain 1 byte
Bits 7:4 = Analog Gain
GAIN_1
GAIN_2
GAIN_4
GAIN_8
GAIN_16
Analog Gain Setting
Integration capacitor adjusted
to control integrator gain.
Bits 3:0 = Digital Gain
GAIN_1
GAIN_2
GAIN_4
GAIN_8
GAIN_16
Digital Gain Setting
The accumulated sum is scaled
to digital gain.
User's Guide
Acquisition Module
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 23
...........continued
Parameter Size Range/Options Usage
node_oversampling 1 byte
FILTER_LEVEL_1
FILTER_LEVEL_2
FILTER_LEVEL_4
FILTER_LEVEL_8
FILTER_LEVEL_16
FILTER_LEVEL_32
FILTER_LEVEL_64
FILTER_LEVEL_128*
FILTER_LEVEL_256*
FILTER_LEVEL_512*
FILTER_LEVEL_1024*
The number of samples to
accumulate for each
measurement.
Note: Oversampling must be
configured to be greater than or
equal to digital gain for correct
operation.
(Higher filter level values > 64
are available only on Arm®
SAM E54 family only.)
Note:  * - Not available on all devices.
6.4.2 Status and Output Data
While different target hardware requires that the configuration structure for sensor nodes varies from one device to
another, all acquisition modules conform to a standard sensor node data structure. Processed module output data
are stored in this data structure during run-time.
The outputs/status information may be used by other post-processing modules or by the application.
Parameter Size Range/Options Usage
node_acq_status 1 byte
Bit 7 Indicates node calibration error
NODE_CAL_ERROR
Bit 6 Rise Time calibration complete
Bit 5 -
Bit <4:2> (three bits)
Node calibration state
NODE_MEASURE
NODE_CC_CAL
NODE_PRSC_CAL
NODE_RSEL_CAL
NODE_CSD_CAL
Indicates whether a calibration is ongoing and its current
stage
Calibration Request Write to ‘ ’ to trigger calibration sequence on this node.1
(Reset to ’ by module once actioned.)0
Enabled Write to ’ to enable this node for measurement1
node_acq_signals 2 bytes Most recent measurement for this
sensor node.
16-bit unsigned value
Accumulated and scaled as per andnode_oversampling
node_gain_digital settings.
node_comp_caps 2 bytes Hardware calibration data Indicates the tuning of the compensation circuit for this node
User's Guide
Acquisition Module
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 24
Table 6-1. node_acq_status
Bit 7 6 5 4 3 2 1 0
Node
Calibration
Error
Rise time
calibration
complete
- Node State Calibrate
request Enabled
NODE_MEASURE 0
NODE_CC_CAL 1
NODE_PRSC_CAL 2
NODE_RSEL_CAL 3
NODE_CSD_CAL* 4
Note:  * - CSD calibration is not available on SAM D10/D11, SAM D2x, SAM L21 devices.
Acquisition Library State
Table 6-2. touch_lib_state_t
TOUCH_STATE_NULL 0
TOUCH_STATE_INIT 1
TOUCH_STATE_READY 2
TOUCH_STATE_CALIBRATE 3
TOUCH_STATE_BUSY 4
Return Parameter
Table 6-3.  Common Return Type, Used by All QTML Modulestouch_ret_t
TOUCH_SUCCESS 0
TOUCH_ACQ_INCOMPLETE 1
TOUCH_INVALID_INPUT_PARAM 2
TOUCH_INVALID_LIB_STATE 3
TOUCH_INVALID_POINTER 11
TOUCH_LIB_NODE_CAL_ERROR 14
Note:  Other values are reserved for future use.
User's Guide
Acquisition Module
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 25
7.2.1 Sensor Node Group
qtm_acquisition_control_t
A top-level container for an acquisition group
Contains pointers to group and node memory containing configurations and run-time data
Structure Contents
qtm_acquisition_control_t qtm_acq_node_group_config_t
(*qtm_acq_node_group_config);
qtm_acq_4p_saml10_config_t
(*qtm_acq_node_config);
qtm_acq_node_data_t (*qtm_acq_node_data);
qtm_acq_node_group_config_t
Common parameters, applied to all sensor nodes in the group
Parameter Size Range/Options Usage
num_sensor_nodes 16-bit 4 to 65532 The total number of sensor nodes
configured in the group, for example,
a number of 4P sets X4.
acq_sensor_type 8-bit NODE_MUTUAL_4P Parallel sets of 4 mutual capacitance
sensor nodes. Each set contains 4x
PTC X masks and 1x PTC Y masks
for the measurement of XY
capacitance.
calib_option_select 1 byte Bits 3:0 Calibration type Selects which parameter is auto-
tuned for charge transfer.
CAL_AUTO_TUNE_NONE No auto-tune for charge transfer
CAL_AUTO_TUNE_RSEL Series resistor tuned to the largest
value that allows full charge transfer
CAL_AUTO_TUNE_PRSC Prescaler tuned to the lowest
(fastest) value that allows full charge
transfer
CAL_AUTO_TUNE_CSD Charge share delay tuned to the
lowest value that allows full charge
transfer
Bits 7:4 Calibration target Target charge time for sensor
capacitance.
CAL_CHRG_2TAU Sensor charged for 2 x Time
constant
CAL_CHRG_3TAU Sensor charged for 3 x Time
constant
CAL_CHRG_4TAU Sensor charged for 4 x Time
constant
CAL_CHRG_5TAU Sensor charged for 5 x Time
constant
User's Guide
Boost Mode
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 27
...........continued
Parameter Size Range/Options Usage
freq_option_select 1 byte FREQ_SEL_0
to
FREQ_SEL_15
FREQ_SEL_0 FREQ_SEL_15 to
inserts a delay cycle between
measurements during oversampling,
where 0 is the shortest delay, 15 the
longest
FREQ_SEL_SPREAD FREQ_SEL_SPREAD varies this delay
from 0 to 15 in a sawtooth manner
during the oversampling set
ptc_interrupt_priority 1 byte 1 to 3 Arm® NVIC Interrupt priority
qtm_acq_saml10_node_config_t
Note:  This data structure is the specific configuration for SAM L10 PTC hardware.
Parameter Size Range/Options Usage
node_xmask[4] 4x4 bytes
(16 bytes)
4x8*
bytes (32
bytes)
*AVR-DA
Array/bit field Select X pin masks for
NODE_MUTUAL_4P.
Set the bit(s) at location(s)
corresponding to X line number(s).
For example:
X0 only = = X00b00000001 0x01
and X2 = = 0b00000101 0x05
node_ymask 4 bytes
8* bytes
*AVR-DA
(bit field) Select Y pin mask.
Set the bit(s) at location(s)
corresponding to Y line number(s).
For example:
Y5 only = = 0b00100000 0x20
Y1, Y2 and Y7 = = 0b10000110 0x86
node_csd 1 byte For SAM L1x:
0 to 255
For ATtiny81x,161x,
321x:
0 to 31
The number of delay cycles to ensure
the charging of the sensor node
capacitances
Note:  If auto-tune is enabled, this
value is used for initial compensation
capacitor calibration. Ensure it allows
sufficient time to charge the sensor.
User's Guide
Boost Mode
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 28
...........continued
Parameter Size Range/Options Usage
node_rsel_prsc 1 byte Bits 7:4 = RSEL
RSEL_VAL_0
RSEL_VAL_20
RSEL_VAL_50
RSEL_VAL_70*
RSEL_VAL_80*
RSEL_VAL_100
RSEL_VAL_120*
RSEL_VAL_200
Internal Y line series resistor selection
* May not be available for all devices
AVR-DA: 70 kΩ, 80 kΩ, 120 kΩ, 200
Bits 3:0 = PRSC
PRSC_DIV_SEL_1
PRSC_DIV_SEL_2
PRSC_DIV_SEL_4
PRSC_DIV_SEL_6*
PRSC_DIV_SEL_8
PRSC_DIV_SEL_12*
PRSC_DIV_SEL_14*
PRSC_DIV_SEL_16
Clock Prescaler
Acquisition clock is derived and scaled
from CPU clock for AVR® devices.
* May not be available for all devices.
AVR-DA: 6 , 12, 14 **
**The numbers correspond to the
prescaler value.
node_gain 1 byte Bits 7:4 = Analog Gain
GAIN_1
GAIN_2
GAIN_4
GAIN_8
GAIN_16
Analog Gain Setting
Integration capacitor adjusted to
control integrator gain.
Bits 3:0 = Digital Gain
GAIN_1
GAIN_2
GAIN_4
GAIN_8
GAIN_16
Digital Gain Setting
The accumulated sum is scaled to
Digital Gain.
User's Guide
Boost Mode
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 29
libqtm_acq_4p_saml1x_0x0033.a
qtm_acq_4p_saml1x_0x0033.a
ATtiny161x Modules:
libqtm_acq_4p_t161x_0x001b.a
qtm_acq_4p_t161x_0x001b.r90
ATtiny321x Modules:
libqtm_acq_4p_t321x_0x001b.a
qtm_acq_4p_t321x_0x001b.r90
AVR-DA Modules:
libqtm_acq_4p_avr_da_0x0038.a
qtm_acq_4p_avr_da_0x0038.r90
User's Guide
Boost Mode
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 31
8. Frequency Hop Module
8.1 Overview
The Frequency Hop module provides a way of filtering the noise during the sensor measurement by varying the
frequency of bursting the sensors. Module ID for frequency hop module is 0x0006 and the module name is in the
format given below.
GCC compiler libqtm_freq_hop_xxxxx_0x0006.a
IAR compiler (AVR® MCU) qtm_freq_hop_xxxxx_0x0006.r90
IAR compiler (Arm® MCU) qtm_freq_hop_xxxxx_0x0006.a
Note:  “xxxxx” – string based on the device architecture that the module is built.
8.2 Interface
The data structure definitions and the API declarations are included in the API file
’. The data structure covers all the configurations and output data variables. Thisqtm_freq_hop_0x0006_api.h
file should be included on the common API ’ file.touch_ptc_api.h
User
Application
Touch.h
Macros and
constants
Qtm_freq_hop_
0x0006_api.h
Touch_api_
ptc.h
Frequency
Hop Module
common_
components_api.h
Touch.c
Global variables declaration
and initialization, Helper
API functions
The default values of configurations should be defined on the and files. Global variables of thetouch.c touch.h
data structures have to be initialized in the file, and the reference of the structure has to be used on thetouch.c
application files.
User's Guide
Frequency Hop Module
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 32
8.3 Functional Description
The Frequency Hop module is interfaced between the Acquisition module and the rest of the post-processing
modules, as shown below.
Frequency Hop
Auto-Tune
Module
The Frequency Hop module applies a configurable cyclic frequency hopping algorithm, such that on each
measurement cycle a different sampling frequency is used. The module is initialized with predefined frequencies,
which are set by cyclic order during the consecutive measurement cycles.
The measured raw signal values from the acquisition module are then passed through . Finally, the“Median filter”
filtered value is stored back on the memory for further processing by the post-processing modules.
A number of frequencies provides effective filtering by processing more samples. However, this also increases the
buffer size used by the median filter and takes a number of measurement cycles to report filtered value. So, the
number of frequencies should be configured based on the RAM memory available.
8.4 Configuration
User's Guide
Frequency Hop Module
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 33
8.4.1 Data Structures
Parameter Size Range/Options Usage
num_sensors 1 byte 0-255 The number of sensors to
buffer data for median filter
num_freqs 1 byte 3-to-7
The number of frequencies
to cycle/depth of median
filter
*freq_option_select 2/4 bytes N/A
The pointer to the
acquisition library
frequency selection
parameter
*median_filter_freq 2/4 bytes N/A The pointer to the array of
selected frequencies
8.4.2 Status and Output Data
Parameter Size Range/Options Usage
module_status 1 byte N/A Module status – N/A
current_freq 1 byte 0-to-15 Current frequency step
*filter_buffer 2/4 bytes N/A
The pointer to the filter
buffer array for measured
signals
*qtm_acq_node_data 2/4 bytes N/A
The pointer to the node
data structure of the
acquisition group
Table 8-1. List of Supported Frequencies
PTC Clock = 4 MHz
PTC Frequency Delay Cycles Frequency [kHz]
0FREQ_SEL_0 66.67
1FREQ_SEL_1 62.5
2FREQ_SEL_2 58.82
3FREQ_SEL_3 55.56
4FREQ_SEL_4 52.63
5FREQ_SEL_5 50
6FREQ_SEL_6 47.62
7FREQ_SEL_7 45.45
8FREQ_SEL_8 43.48
9FREQ_SEL_9 41.67
10 FREQ_SEL_10 40
11 FREQ_SEL_11 38.46
12 FREQ_SEL_12 37.04
User's Guide
Frequency Hop Module
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 34
...........continued
PTC Clock = 4 MHz
PTC Frequency Delay Cycles Frequency [kHz]
13 FREQ_SEL_13 35.71
14 FREQ_SEL_14 34.48
15 FREQ_SEL_15 33.33
16 FREQ_SEL_SPREAD Variable frequencies
User's Guide
Frequency Hop Module
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 35
9. Frequency Hop Auto-Tune Module
9.1 Overview
The frequency hop auto-tune module is the superset of the frequency hop module with additionally providing noise
monitoring and tuning the frequency according to the measured noise factor.
The Module ID for the frequency hop auto-tune module is ‘0x0004’, and the module name is in the format given
below.
GCC compiler libqtm_freq_hop_auto_xxxxx_0x0004.a
IAR compiler (AVR® MCU) qtm_freq_hop_auto_xxxxx_0x0004.r90
IAR compiler (Arm® MCU) qtm_freq_hop_auto_xxxxx_0x0004.a
Note:  “xxxxx” – string based on the device architecture that the module is built.
9.2 Interface
The data structure definitions and the API declarations are included in the API file
’. The data structure covers all the configurations and output data variables.qtm_freq_hop_auto_0x0004_api.h
This file should be included on the common API file.touch_ptc_api.h
User's Guide
Frequency Hop Auto-Tune Module
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 36
User
Application
Touch.h
Macros and
constants
Qtm_freq_ho
p_auto_0x00
04_api.h
Touch_api_
ptc.h
Frequency
Hop Auto
-tune Module
common_
components_api.h
Touch.c
Global variables declaration
and initialization, Helper API
functions
The default values of the configurations should be defined on the and files. Global variables oftouch.c touch.h
the data structures have to be initialized in the file, and the reference of the structure has to be used on thetouch.c
application files.
9.3 Functional Description
The frequency hop auto-tune module is interfaced between the acquisition module and the rest of the post-
processing modules, as shown below.
User's Guide
Frequency Hop Auto-Tune Module
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 37
Frequency Hop
Auto-Tune
Module
The frequency hop auto-tune module applies a configurable cyclic frequency-hopping algorithm, such that on each
measurement cycle a different sampling frequency is used. Several preconfigured frequencies are implemented in
turn during consecutive measurement cycles.
Where ‘n’ frequencies are included in the cycle, an ‘n’-point median filter is applied to the output data.
To perform auto-tuning, the signals measured on each sensor node are recorded for each selected frequency. When
one frequency shows greater variance than the others, that frequency is removed from the measurement sequence
and replaced with another.
9.4 Configuration
9.4.1 Data Structures
Parameter Size Range/
Options Usage
num_sensors 1 byte 0 – 255 The number of sensors to buffer data for the median
filter
num_freqs 1 byte 3-to-7 The number of frequencies to cycle/depth of the
median filter
User's Guide
Frequency Hop Auto-Tune Module
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 38
...........continued
Parameter Size Range/
Options Usage
*freq_option_select Pointer 2/4
bytes Pointer The pointer to the acquisition library frequency
selection parameter
*median_filter_freq Pointer 2/4
bytes Pointer The pointer to the array of selected frequencies
enable_freq_autotune 1 byte 0 or 1 Disable ( ) or enable ( ) automatic retuning of hop0 1
frequencies
max_variance_limit 1 byte 1-to-255 Signal variance required to trigger returning of hop
frequency
Autotune_count_in 1 byte 1-to-255
The number of occurrences of
max_variance_limit to trigger retuning of hop
frequency
9.4.2 Status and Output Data
Parameter Size Range/Options Usage
module_status 1 byte N/A Module status – N/A
current_freq 1 byte 0-to-15 Current frequency step
*filter_buffer Pointer 2/4 bytes Pointer The pointer to the filter buffer array for measured
signals
*qtm_acq_node_data Pointer 2/4 bytes Pointer The pointer to the node data structure of the
acquisition group
*freq_tune_count_ins Pointer 2/4 bytes Pointer Pointing to the counter array to trigger frequency
change
User's Guide
Frequency Hop Auto-Tune Module
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 39
User
Application
Touch.h
Macros and
constants
Qtm_touch_key
_0x0002_api.h
Touch_api_
ptc.h
Touch Key
Module
common_
components_api.h
Touch.c
Global variables declaration
and initialization, Helper API
functions
10.3 Functional Description
The touch key module is responsible for the detection of a touch contact, where higher-level module(s) carry out
position interpolation, gesture recognition, contact tracking, etc.
Features implemented in the touch key module:
Timing Management for Detecting Towards Touch, Away from Touch
Software Calibration
Reference signal
Reference drift
Touch Detection State Machine
User's Guide
Touch Key Module
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 41
10.4 Configuration
10.4.1 Data Structures
Table 10-2. Group Configuration
Parameter Size Range/Options Usage
num_key_sensors 2 bytes 1-to-65535 The number of sensor keys in the group
sensor_touch_di 1 byte 0-to-255
The number of repeat measurements to
confirm touch detection and out-of-touch
detection
sensor_max_on_time 1 byte 0 (Disabled), 1-
to-255
The number of timer periods with sensor In
Detect before automatic ‘recal’
sensor_anti_touch_di 1 byte 0 (Disabled), 1-
to-255
The number of repeat measurements to
confirm anti-touch recalibration required
sensor_anti_touch_recal_thr 1 byte 0-to-5
Scale-down of touch threshold to set anti-
touch threshold.
0 = 100% Touch Threshold
1 = 50%
2 = 25%
3 = 12.5%
4 = 6.25%
5 = Maximum Recalibration
sensor_touch_drift_rate 1 byte 0 (Disabled), 1-
to-255
The number of timer periods to countdown
between towards touch drifts
User's Guide
Touch Key Module
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 42
...........continued
Parameter Size Range/Options Usage
sensor_anti_touch_drift_rate 1 byte 0 (Disabled), 1-
to-255
The number of timer periods to countdown
between away from touch drifts
sensor_drift_hold_time 1 byte 0 (Disabled), 1-
to-255
The number of timer periods to stop drifting
after touch event
sensor_reburst_mode 1 byte
0 = None
1 = Unresolved
(Quick reburst)
2 = All
None – Reburst is never set, measurements
according to application schedule.
Unresolved – Reburst is set, all sensors
suspended except those in same AKS as
the target sensor.
All – Reburst is set, no sensors are
suspended.
Table 10-3. Individual Sensor Configuration
Parameter Size Range/Options Usage
channel_threshold 1 byte 0-to-255 Minimum signal delta indicating touch contact
channel_hysteresis 1 byte 0 (50%)-to-4 (3.125%) Reduction of touch threshold to de-bounce when filtering
out removed touch contact
channel_aks_group 1 byte 0-to-255 Grouping of key sensors controlling simultaneous touch
detect.
10.4.2 Status and Output Data
Table 10-4. Group Data
Parameter Size Range/Options Usage
qtm_keys_status 1 byte
Bit 7: Reburst required
Bit 6-1: Reserved
Bit 0: Touch Detection
Indicates the current state of
the Touch Key Group
acq_group_timestamp 2 bytes 0-to-65535 Timestamp of last drift period
processed
dht_count_in 1 byte 0-to-‘ sensor_drift_hold_time Countdown to drift hold
release after a touch event
tch_drift_count_in 1 byte 0-to-‘ ’sensor_touch_drift_rate Countdown to next towards a
touch drift period
antitch_drift_count_in 1 byte 0-to-‘ ’sensor_anti_touch_drift_rate Countdown to the next away
from a touch drift period
Individual Key Sensor Data
The individual key sensor data is required by other post processing modules like Scroller. So, this data structure
definition is placed on the file.common_compoenents_api.h
Parameter Size Range/Options Usage
sensor_state 1 byte Bit field Touch key sensor state
sensor_state_counter 1 byte 0-to-255 The number of repeat measurements to confirm a touch
detection and an out-of-touch detection
User's Guide
Touch Key Module
© 2020 Microchip Technology Inc. User Guide DS40001986E-page 43


Produktspezifikationen

Marke: Microchip
Kategorie: Nicht kategorisiert
Modell: ATSAMC21G18A

Brauchst du Hilfe?

Wenn Sie Hilfe mit Microchip ATSAMC21G18A benötigen, stellen Sie unten eine Frage und andere Benutzer werden Ihnen antworten




Bedienungsanleitung Nicht kategorisiert Microchip

Bedienungsanleitung Nicht kategorisiert

Neueste Bedienungsanleitung für -Kategorien-