Microchip ATSAMC20N17A Bruksanvisning

Läs nedan 📖 manual på svenska för Microchip ATSAMC20N17A (117 sidor) i kategorin Inte kategoriserad. Denna guide var användbar för 4 personer och betygsatt med 4.5 stjärnor i genomsnitt av 2 användare

Sida 1/117
Atmel QTouch
SAM C20 Safety Library
USER GUIDE
Introduction
Atmel® QTouch® Peripheral Touch Controller (PTC) offers built-in hardware
for buttons, sliders, and wheels. PTC supports both mutual and self
capacitance measurement 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.
The PTC is intended for acquiring capacitive touch sensor signals. 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/Opins. 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(drive line) 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.
The PTC supports two sets of libraries, the QTouch Library and the QTouch
Safety Library. The QTouch Library supports both mutual and self
capacitance methods. The QTouch Safety Library is available for both GCC
and IAR. The QTouch Safety Library also supports both the mutual
capacitance method and self capacitance method along with the additional
safety features.
Features
Implements low-power, high-sensitivity, environmentally robust
capacitive touch buttons, sliders, and wheels
Supports mutual capacitance and self capacitance sensing
Upto 256 channels in mutual-capacitance mode
Upto 32 channels in self-capacitance mode
Two pin per electrode in mutual capacitance mode - with no external
components
One pin per electrode in self capacitance mode - with no external
components
Load compensating charge sensing
Atmel-42679C-SAM-C20-QTouch-Safety-Library_User Guide-07/2016
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 desynchronization for high conducted immunity
Supports moisture tolerance
Atmel provided QTouch Safety Library firmware
Supports Sensor Enable and Disable at Runtime
Supports Quick Reburst Feature for Faster Response Time
Low Power Sensor Support
The following features are available only in the QTouch Safety Library:
CRC protection
Logical program flow sequence
Memory protection using double inverse mechanism
Library RAM relocation and
Compile-time and Run-time check
For more information about the capacitance related technological concepts, Refer Chapter 4 in Atmel
QTouch LibraryPeripheral Touch Controller User Guide [42195] available at www.atmel.com.
Product Support
For assistance related to QTouch capacitive touch sensing software libraries and related issues, contact
your localAtmel sales representative or log on to myAtmel Design Support portal to submit a support
request or access acomprehensive knowledge base. If you don’t have a myAtmel account, please visit
http://www.atmel.com/design-support/ to create a new account byclicking on “Create Account” in the
myAtmel menu at the top of the page. Once logged in, you will be able to access the knowledge base,
submit new support cases from the myAtmel page orreview status of your ongoing cases.
Atmel SAM C20 Safety Library [USER GUIDE]
Atmel-42679C-SAM-C20-QTouch-Safety-Library_User Guide-07/2016
2
Table of Contents
Introduction......................................................................................................................1
Features.......................................................................................................................... 1
1. Development Tools.................................................................................................... 5
1.1. Device Variants Supported........................................................................................................... 5
2. QTouch Safety Library .............................................................................................. 6
2.1. API Overview................................................................................................................................6
2.2. Sequence of Operation................................................................................................................ 8
2.3. Program Flow .............................................................................................................................. 9
2.4. Configuration Parameters...........................................................................................................10
2.5. Touch Library Error Reporting Mechanism.................................................................................25
2.6. Touch Library Program Counter Test..........................................................................................25
2.7. CRC on Touch Input Configuration.............................................................................................27
2.8. Double Inverse Memory Check.................................................................................................. 30
2.9. Application Burst Again Mechanism...........................................................................................35
2.10. Memory Requirement.................................................................................................................35
2.11. API Execution Time.................................................................................................................... 37
2.12. Error Intepretation.......................................................................................................................41
2.13. Data and Function Protection.....................................................................................................44
2.14. Moisture Tolerance..................................................................................................................... 45
2.15. Quick Re-burst............................................................................................................................47
2.16. Reading Sensor States...............................................................................................................47
2.17. Touch Library Suspend Resume Operation............................................................................... 48
2.18. Drifting On Disabled Sensors..................................................................................................... 50
2.19. Capacitive Touch Low Power Sensor.........................................................................................51
3. QTouch Safety Library API...................................................................................... 57
3.1. Typedefs.....................................................................................................................................57
3.2. Macros........................................................................................................................................57
3.3. Enumerations............................................................................................................................. 58
3.4. Data Structures...........................................................................................................................66
3.5. Global Variables......................................................................................................................... 74
3.6. Functions....................................................................................................................................76
4. FMEA.......................................................................................................................86
4.1. Double Inverse Memory Check.................................................................................................. 86
4.2. Memory Requirement.................................................................................................................86
4.3. API Execution Time.................................................................................................................... 87
4.4. Error Interpretation..................................................................................................................... 89
4.5. Data and Function Protection.....................................................................................................89
4.6. FMEA Considerations.................................................................................................................90
5. FMEA API................................................................................................................91
5.1. Typedefs.....................................................................................................................................91
5.2. Enumerations............................................................................................................................. 91
5.3. Data Structures...........................................................................................................................91
5.4. Global Variables......................................................................................................................... 97
5.5. Functions....................................................................................................................................97
5.6. Macros......................................................................................................................................104
6. System...................................................................................................................105
6.1. Relocating Touch Library and FMEA RAM Area...................................................................... 105
6.2. API Rules..................................................................................................................................108
6.3. Safety Firmware Action Upon Fault Detection......................................................................... 108
6.4. System Action Upon Fault Detection........................................................................................108
6.5. Touch Library and FMEA Synchronization............................................................................... 108
6.6. Safety Firmware Package.........................................................................................................110
6.7. SAM Safety Firmware Certification Scope................................................................................110
6.8. Hazard Time..............................................................................................................................111
6.9. ASF Dependency......................................................................................................................111
6.10. Robustness and Tuning............................................................................................................ 111
6.11. Standards compliance.............................................................................................................. 112
6.12. Safety Certification....................................................................................................................112
7. Known Issues.........................................................................................................114
8. References.............................................................................................................115
9. Revision History..................................................................................................... 116
Atmel SAM C20 Safety Library [USER GUIDE]
Atmel-42679C-SAM-C20-QTouch-Safety-Library_User Guide-07/2016
4
1. Development Tools
The following development tools are required for QTouch Safety Library development using Atmel
SMART | SAM C20 devices.
Development Environment:
IAR Embedded Workbench for ARM® 7.40.5.9739 for IAR Compiler
Atmel Software Framework 3.30.1
Atmel Studio 7.0.1006 for GCC Compiler
1.1. Device Variants Supported
QTouch Safety Library for SAM Devices is available for the following device variants.
Series Variant
SAM C20 J Series ATSAMC20J18A, ATSAMC20J17A, ATSAMC20J16A
SAM C20 G Series ATSAMC20G18A, ATSAMC20G17A, ATSAMC20G16A, ATSAMC20G15A
SAM C20 E Series ATSAMC20E18A, ATSAMC20E17A, ATSAMC20E16A, ATSAMC20E15A
Atmel SAM C20 Safety Library [USER GUIDE]
Atmel-42679C-SAM-C20-QTouch-Safety-Library_User Guide-07/2016
5
2. QTouch Safety Library
Atmel QTouch Safety Library makes it simple for developers to embed capacitive-touch button, slider,
wheel functionality into general-purpose Atmel SAM C20 microcontroller applications. The royalty-free
QTouch Safety Library provides library files for each device and supports different numbers of touch
channels, enabling both flexibility and efficiency in touch applications.
QTouch Safety Library can be used to develop single-chip solutions for many control applications, or to
reduce chip count in more complex applications. Developers have the latitude to implement buttons,
sliders, and wheels in a variety of combinations on a single interface.
Figure 2-1. Atmel QTouch Safety Library
2.1. API Overview
QTouch Safety Library API for PTC can be used for touch sensor pin configuration, acquisition parameter
setting as well as periodic sensor data capture and status update operations. The QTouch Safety Library
interfaces with the PTC module to perform the required actions. The PTC module interfaces with the
external capacitive touch sensors and is capable of performing mutual and self capacitance method
measurements.
Note:  From this section onwards, the program elements that are common to both mutual and self
capacitance technologies are represented using XXXXCAP or xxxxcap.
For normal operation, it is sufficient to use the Regular APIs. The Helper APIs provides additional
flexibility to the user application. The available APIs are listed in the following table.
Table 2-1. Regular and Helper APIs
Regular API Helper API
touch_xxxxcap_sensors_init touch_xxxxcap_sensor_get_delta
touch_xxxxcap_di_init touch_xxxxcap_sensor_update_config
touch_xxxxcap_sensor_config touch_xxxxcap_sensor_get_config
touch_xxxxcap_sensors_calibrate touch_xxxxcap_update_global_param
touch_xxxxcap_sensors_measure touch_xxxxcap_get_global_param
touch_xxxxcap_sensors_deinit touch_xxxxcap_update_acq_config
touch_xxxxcap_get_libinfo
touch_xxxxcap_calibrate_single_sensor
touch_xxxxcap_sensor_disable
touch_xxxxcap_sensor_reenable
touch_lib_pc_test_magic_no_1
touch_lib_pc_test_magic_no_2
Atmel SAM C20 Safety Library [USER GUIDE]
Atmel-42679C-SAM-C20-QTouch-Safety-Library_User Guide-07/2016
6
Regular API Helper API
touch_lib_pc_test_magic_no_3
touch_lib_pc_test_magic_no_4
touch_calc_xxxcap_config_data_integrity
touch_test_xxxcap_config_data_integrity
touch_xxxxcap_cnfg_mois_mltchgrp
touch_xxxxcap_cnfg_mois_threshold
touch_xxxxcap_mois_tolrnce_enable
touch_xxxxcap_mois_tolrnce_disable
touch_library_get_version_info
touch_disable_ptc
touch_enable_ptc
touch_suspend_ptc
touch_resume_ptc
touch_mutual_lowpower_sensor_enable_event_measure
touch_self_lowpower_sensor_enable_event_measure
touch_xxxxcap_lowpower_sensor_stop
touch_xxxxcap_mois_tolrnce_quick_reburst_enable
touch_xxxxcap_mois_tolrnce_quick_reburst_disable
Atmel SAM C20 Safety Library [USER GUIDE]
Atmel-42679C-SAM-C20-QTouch-Safety-Library_User Guide-07/2016
7
Figure 2-2. QTouch Safety library Overview
2.2. Sequence of Operation
The application periodically initiates a touch measurement on either mutual capacitance or self
capacitance sensors. At the end of each sensor measurement, the PTC module generates an end of
conversion (EOC) interrupt. The touch measurement is performed sequentially until all the sensors are
measured. Additional post-processing is performed on the measured sensor data to determine the touch
status of the sensors (keys/rotor/slider) position. The post processing determines the position value of the
sensors and the callback function is then triggered to indicate completion of measurement.
The recommended sequence of operation facilitates the CPU to either sleep or perform other functions
during touch sensor measurement.
Atmel SAM C20 Safety Library [USER GUIDE]
Atmel-42679C-SAM-C20-QTouch-Safety-Library_User Guide-07/2016
8
Figure 2-3. QTouch Application Sequence
2.3. Program Flow
Before using the QTouch Safety Library API, configure the PTC module clock generator source. The PTC
module clock can be generated using one of the eight generic clock generators (GCLK0-GCLK7).
Configure the corresponding generic clock multiplexer such that the PTC module clock is set between
400 kHz and 4 MHz.
The API initializes the QTouch Safety Library as well as the PTCtouch_xxxxcap_sensors_init
module. Additionally, it initializes the capacitance method specific pin, register, and global sensor
configuration.
The API initializes the memory for different pointers in thetouch_xxxxcap_di_init
touch_lib_xxxcap_param_safety structure.
The API configures the individual sensor. The sensor specifictouch_xxxxcap_sensor_config
configuration parameters can be provided as input arguments to this API.
The API calibrates all the configured sensors and prepares thetouch_xxxxcap_sensors_calibrate
sensors for normal operation. The auto tuning type parameter is provided as input argument to this API.
The API initiates a touch measurement on all the configuredtouch_xxxxcap_sensors_measure
sensors. The sequence of the mandatory APIs are depicted in the following illustration.
Atmel SAM C20 Safety Library [USER GUIDE]
Atmel-42679C-SAM-C20-QTouch-Safety-Library_User Guide-07/2016
9
Parameter Parameter Macros Description
Pin Configuration DEF_MUTLCAP_NODES Number of Mutual Capacitance nodes.
DEF_SELFCAP_LINES Number of Self Capacitance lines.
Sensor
Configuration
DEF_XXXXCAP_NUM_CHANNELS Number of Channels.
DEF_XXXXCAP_NUM_SENSORS Number of Sensors.
DEF_XXXXCAP_NUM_ROTORS_SLIDERS Number of Rotor/Sliders.
Acquisition
Parameters
DEF_XXXXCAP_FILTER_LEVEL_PER_N
ODE
The filter level setting controls the
number of samples collected to resolve
each acquisition.This is applicable for
individual channel
DEF_XXXXCAP_GAIN_PER_NODE Gain is applied for an individual channel
to allowa scaling-up of the touch delta.
DEF_XXXXCAP_AUTO_OS_PER_NODE Auto oversample controls the
automaticoversampling of sensor
channels when unstable signals are
detected. This is applicable forindividual
channel
DEF_XXXXCAP_FREQ_MODE Frequency mode setting allows users
toconfigure the bursting waveform
characteristicsto get better noise
performance for the system.
DEF_XXXXCAP_CLK_PRESCALE_PER_N
ODE
This method is used to select the PTC
prescaler.This is applicable for individual
channel.
DEF_XXXXCAP_SENSE_RESISTOR_PER
_NODE
This method is used to select the sense
resistor value. This is applicable for
individual channel.
DEF_XXXXCAP_CC_CAL_CLK_PRESCAL
E_PER_NODE
This method is used to select the PTC
prescalar for CC calibration. This is
applicable for individual channel.
DEF_XXXXCAP_CC_CAL_SENSE_RESIS
TOR_PER_NODE
This method is used to select the sense
resistorfor CC calibration. This is
applicable for individual channel
DEF_XXXXCAP_HOP_FREQS Frequency hops to be performed.
Maximum three frequency hops is
possible.
Atmel SAM C20 Safety Library [USER GUIDE]
Atmel-42679C-SAM-C20-QTouch-Safety-Library_User Guide-07/2016
11

Produktspecifikationer

Varumärke: Microchip
Kategori: Inte kategoriserad
Modell: ATSAMC20N17A

Behöver du hjälp?

Om du behöver hjälp med Microchip ATSAMC20N17A ställ en fråga nedan och andra användare kommer att svara dig




Inte kategoriserad Microchip Manualer

Inte kategoriserad Manualer

Nyaste Inte kategoriserad Manualer