Atmel QTouch Library User Guide

Atmel QTouch Library User Guide Atmel QTouch Library User Guide

prochild.co.kr
from prochild.co.kr More from this publisher
11.07.2015 Views

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

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

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!