Atmel QTouch Library User Guide
Atmel QTouch Library User Guide Atmel QTouch Library User Guide
Figure 39 QMatrix API Flow diagram for UC3LThe burst length values of each Touch channel must be specified using the qm_burst_length[]array in the main.c file. The burst length must be specified in the same order of Touch Channelnumbering.The touch_qm_sensors_init API initializes the QTouch Library as well as the CAT module anddoes the QMatrix method specific pin, register and Global Sensor configuration. Thetouch_qm_sensor_config API is used to configure individual sensor. The Sensor specificconfiguration parameter can be provided as input to this API.The touch_qm_sensors_calibrate API is used to calibrate all the configured sensors therebypreparing the sensors for acquisition. The touch_qm_sensors_start_acquisition API initiates aQMatrix method measurement on all the configured Sensors. This API takes the peripheral DMAchannels as an input. When a filter_callback function is enabled, the touch_event_dispatcherfunction calls the filter_callback function as soon as the raw acquisition data from the Sensors isavailable. The user can now optionally apply any filtering routine on the raw acquisition databefore the QTouch Library does any processing on this data. (For an overview of Filter callbackusage, refer Section 5.6.6.4 Example code). Once the QTouch Library has finished processingthe acquisition data from Sensors, the touch_event_dispatcher function calls themeasure_complete_callback function indicating the end of a single Touch measurementoperation. The measure_complete_callback provides the measured data and Touch statusinformation. The measured data is available in the same order of Touch Channel numbering.Note 1: The Host Application code can execute once a QMatrix acquisition is initiated with thetouch_qm_sensors_start_acqusition API. Care must be taken in the Host Application such thatthe touch_event_dispatcher function is called frequently in order to process the acquired data.For a single Touch measurement operation (between a touch_qm_sensors_start_acquisition APIcall and the measure_complete_callback function being called), the touch_event_dispatcherfunction may execute multiple times in order to resolve the Touch status of Sensors. Failing tocall the touch_event_dispatcher frequently can adversely impact the Touch Sensitivity.Note 2: Once the Touch Library has been initialized for QMatrix method using thetouch_qm_sensors_init API, a new qm_burst_length[x] value of a Touch channel must beupdated only using the touch_qm_channel_update_burstlen API. It is recommended to haveqm_burst_length array as global variable as the Touch Library updates this array when thetouch_qm_channel_update_burstlen API is called.Note 3: QMatrix burst length setting recommendation.For a given X Line, the burst length value of ALL enabled Y Lines MUST be the same or set to0x01(disabled). For example, the burst length value corresponding to (X0,Y1),(X0,Y2)...(X0,Yn)must be the same. In case of a scenario, wherein it is required to have a different a burst length,then the following option can be tried out - Enable the 1k ohm drive resistors on all the enabled Ylines by setting the corresponding bit in the CSARES register.Note 4: For QMatrix operation, the Analog comparators channels are used (using the ACIFBinterface) depending on the Y Lines enabled. For example, when Y lines Y2 and Y7 are enabledthe Analog comparator channels 2 and 7 are used by the CAT module for QMatrix operation.The user can uses the rest of the Analog comparator channels in the main application. TheQTouch Library enables the ACIFB using the Control register (if not already enabled by the mainapplication) when the touch_qm_sensors_init API is called.1248207K-AT42-09/11
QMatrix method Disable and Re-enable Sensor for UC3LThe touch_qm_channel_update_burstlen API can be used for Disabling and Re-enabling ofQMatrix Sensors. In order to Disable a sensor, the QMatrix burst length value of all the TouchChannels corresponding to the Sensor must be set to 1. For Example, when a Wheel or Slider iscomposed of 4 Touch Channels, the touch_qm_channel_update_burstlen API should be used toset the burst length of all the 4 Touch Channels to 1. For the case of a Button,touch_qm_channel_update_burstlen API should be used to set burst length of the correspondingsingle Touch Channel of the Button to 1. Similarly, when re-enabling a Sensor, appropriate burstlength must be set to all the Touch channels corresponding to the Sensor.When a QMatrix Sensor is Disabled or re-enabled, it is mandatory to force Calibration on allSensors. The Calibration of all Sensors is done using the touch_qm_sensors_calibrate API.Note: When disabling a Wheel or Slider, care must be taken to set the burst length of all theTouch channels corresponding to the Wheel or Slider to 1. If any of the Touch channels aremissed out, it may result in undesired behavior of the Wheel or Slider. Similarly when re-enablinga Wheel or Slider, burst length of all the Touch channels corresponding to the Wheel or Slidermust be set to an appropriate value. If any of the Touch Channels are left disabled with a burstlength value 1, it may result in undesired behavior of Wheel or Slider.QTouch Group A/B method sensor operation for UC3LQTouch Group A/B method pin selection for UC3LPlease refer AT32UC3L datasheet Table 28-2 Pin Selection Guide and Table 3-1 GPIOController Function multiplexing, for mapping between the QTouch method pin name(SNS/SNSK) and the GPIO pin. The CAT module provides an option to enable a nominal outputresistance of 1kOhm on specific CAT module pins during the burst phase. The Table belowcaptures the different QTouch method pin wherein a Resistive Drive can be optionally enabled.The rows marked with Grey indicate that Resistive Drive option is not available on that pin. Bycarefully choosing the QTouch method SNSK pins wherein Resistive Drive can be enabled,saving on external components is possible. Section 6.3.1.2 provides detail on the number of Pinand Touch channels required for different QTouch method sensor. Also, Section 6.3.11 indicatesthe various Pin Configuration options for the QTouch Library that can be used to specify a userdefined configuration.125
- Page 74 and 75: Selecting the right configurationTh
- Page 76 and 77: Figure 5-20 : Specifying QMatrix ac
- Page 78 and 79: Debug Support in Example applicatio
- Page 80 and 81: Support for different compiler tool
- Page 82 and 83: Maximum number of rotor / sliders s
- Page 84 and 85: Tips on pin assignments for the sen
- Page 86 and 87: ATtiny88)v1g1s2(ATtiny461,ATmega16a
- Page 88 and 89: X0,X1,X2,X3 are on PB0,PB1,PB2,PB3N
- Page 90 and 91: 1. The channel numbers are allocate
- Page 92 and 93: SNSK_array[1][1]=0x00; (SNSK odd ma
- Page 94 and 95: SNSK_array[1][0]=0x14; (SNSK even m
- Page 96 and 97: Figure 5-28: New Design Sensors in
- Page 98 and 99: Figure 5-31: Selecting the MCU for
- Page 100 and 101: Figure 5-34: Selecting the SNS and
- Page 102 and 103: 2. QTOUCH_STUDIO_MASKS needs to be
- Page 104 and 105: Figure 5-38: Selecting New Design3.
- Page 106 and 107: Figure 5-42: Start window of the co
- Page 108 and 109: Figure 5-45: Selecting the X,YA,YB,
- Page 110 and 111: The code can be copied using the
- Page 112 and 113: ApplicablereleaseQTouch libraries v
- Page 114 and 115: Device Specific LibrariesIntroducti
- Page 116 and 117: Table 8 Compiler tool chains suppor
- Page 118 and 119: maintains the States of QMatrix, QT
- Page 120 and 121: equired as shown in the case A of F
- Page 122 and 123: Figure 37 QMatrix method schematicQ
- Page 126 and 127: CAT Module Pin NameCSA0CSB0CSA1CSB1
- Page 128 and 129: The QTouch method acquisition using
- Page 130 and 131: Host Application codeUsing the init
- Page 132 and 133: Frozen Stop Stop Run Run Run Run On
- Page 134 and 135: Figure 45 Raw acquisition mode API
- Page 136 and 137: Figure 46 GNU Example project usage
- Page 138 and 139: the QTouch Library as QMatrix data
- Page 140 and 141: TOUCH_STATUS_CHANGE 0x0002u Status
- Page 142 and 143: sensor_type_tEnumerationUsesensor_t
- Page 144 and 145: OUT_OF_TOUCHIN_TOUCHCurrently the a
- Page 146 and 147: num_channel_signals uint8_t Length
- Page 148 and 149: touch_at_statusstructureInput / Out
- Page 150 and 151: UseData structure which holds the R
- Page 152 and 153: variable to the Touch library. The
- Page 154 and 155: structure.p_qta_config touch_qt_con
- Page 156 and 157: p_touch_sensor_param touch_qm_param
- Page 158 and 159: current_time_ms touch_time_t Curren
- Page 160 and 161: touch_ret_t touch_qt_sensor_config(
- Page 162 and 163: touch_qt_sensors_calibratetouch_ret
- Page 164 and 165: touch_qt_get_libinfotouch_ret_t tou
- Page 166 and 167: • This API updates the configurat
- Page 168 and 169: Rule Rule Description Advisory/Requ
- Page 170 and 171: VCCPA0No ConnectionPA1PA2ATtiny20PA
- Page 172 and 173: QTouch Library configuration parame
Figure 39 QMatrix API Flow diagram for UC3LThe burst length values of each Touch channel must be specified using the qm_burst_length[]array in the main.c file. The burst length must be specified in the same order of Touch Channelnumbering.The touch_qm_sensors_init API initializes the <strong>QTouch</strong> <strong>Library</strong> as well as the CAT module anddoes the QMatrix method specific pin, register and Global Sensor configuration. Thetouch_qm_sensor_config API is used to configure individual sensor. The Sensor specificconfiguration parameter can be provided as input to this API.The touch_qm_sensors_calibrate API is used to calibrate all the configured sensors therebypreparing the sensors for acquisition. The touch_qm_sensors_start_acquisition API initiates aQMatrix method measurement on all the configured Sensors. This API takes the peripheral DMAchannels as an input. When a filter_callback function is enabled, the touch_event_dispatcherfunction calls the filter_callback function as soon as the raw acquisition data from the Sensors isavailable. The user can now optionally apply any filtering routine on the raw acquisition databefore the <strong>QTouch</strong> <strong>Library</strong> does any processing on this data. (For an overview of Filter callbackusage, refer Section 5.6.6.4 Example code). Once the <strong>QTouch</strong> <strong>Library</strong> has finished processingthe acquisition data from Sensors, the touch_event_dispatcher function calls themeasure_complete_callback function indicating the end of a single Touch measurementoperation. The measure_complete_callback provides the measured data and Touch statusinformation. The measured data is available in the same order of Touch Channel numbering.Note 1: The Host Application code can execute once a QMatrix acquisition is initiated with thetouch_qm_sensors_start_acqusition API. Care must be taken in the Host Application such thatthe touch_event_dispatcher function is called frequently in order to process the acquired data.For a single Touch measurement operation (between a touch_qm_sensors_start_acquisition APIcall and the measure_complete_callback function being called), the touch_event_dispatcherfunction may execute multiple times in order to resolve the Touch status of Sensors. Failing tocall the touch_event_dispatcher frequently can adversely impact the Touch Sensitivity.Note 2: Once the Touch <strong>Library</strong> has been initialized for QMatrix method using thetouch_qm_sensors_init API, a new qm_burst_length[x] value of a Touch channel must beupdated only using the touch_qm_channel_update_burstlen API. It is recommended to haveqm_burst_length array as global variable as the Touch <strong>Library</strong> updates this array when thetouch_qm_channel_update_burstlen API is called.Note 3: QMatrix burst length setting recommendation.For a given X Line, the burst length value of ALL enabled Y Lines MUST be the same or set to0x01(disabled). For example, the burst length value corresponding to (X0,Y1),(X0,Y2)...(X0,Yn)must be the same. In case of a scenario, wherein it is required to have a different a burst length,then the following option can be tried out - Enable the 1k ohm drive resistors on all the enabled Ylines by setting the corresponding bit in the CSARES register.Note 4: For QMatrix operation, the Analog comparators channels are used (using the ACIFBinterface) depending on the Y Lines enabled. For example, when Y lines Y2 and Y7 are enabledthe Analog comparator channels 2 and 7 are used by the CAT module for QMatrix operation.The user can uses the rest of the Analog comparator channels in the main application. The<strong>QTouch</strong> <strong>Library</strong> enables the ACIFB using the Control register (if not already enabled by the mainapplication) when the touch_qm_sensors_init API is called.1248207K-AT42-09/11