Acquisition Control Parameters
DO_NOT_REMOVE
Acquisition controls are critical parameters that define how and when capacitive touch measurements are performed in Microchip’s touch libraries. This section covers parameters that control the touch measurement (also known as acquisition) behaviors that are common for all the sensors.
DEF_TOUCH_MEASUREMENT_PERIOD_MS
Description: This parameter defines the measurement period in milliseconds. The timer Interrupt Service Routine (ISR) will be set up according to this value. If the specified time is shorter than the measurement period, the touch measurement will occur consecutively without any breaks.
Range: 1 to 255
Default Value: 20
The following figure shows the measurement period and measurement time.
DEF_SENSOR_TYPE
Description: This parameter defines the type of acquisition measurement used for touch sensors. This also depends on the sensor design and/or layout.
Values:
- For Self-capacitance: NODE_SELFCAP
- For Mutual capacitance: NODE_MUTUAL
- For Self-capacitance with Driven Shield: NODE_SELFCAP_SHIELD
More Info: A self-capacitance sensor requires one Y-line sense pin per button.
A mutual capacitance sensor requires one X-line drive pin and one Y-line sense pin per button. This configuration can realize an N x M matrix of sensors by using N X-line and M Y-line connections.
Self-capacitance with a driven shield is used when shielding the sensor is necessary, especially in environments with noisy circuits near the touch sensors. Adding a ground shield can have an impact on touch performance (sensitivity and water tolerance). The driven shield acts as an alternative to the ground shield without compromising the sensitivity and water tolerance. A driven shield can be enabled either on adjacent sensors only or additionally using a dedicated shield sensor. Having a dedicated shield sensor improves both noise performance and water tolerance. Configuring the adjacent sensor as a driven shield improves water tolerance on touch surfaces.
DEF_PTC_CAL_AUTO_TUNE
Description: The calibration type selects which parameter should be automatically tuned for optimal charge transfer.
Range: (value) = (uint8_t)((DEF_PTC_TAU_TARGET << CAL_CHRG_TIME_POS) | DEF_PTC_CAL_OPTION)
More Info: This parameter consists of two bit-fields: Bits 3:0 = DEF_PTC_CAL_OPTION and Bits 7:4 = DEF_PTC_TAU_TARGET. See the following two entries for their definitions.
DEF_PTC_CAL_OPTION
Description: This parameter determines whether the auto-tune charge time feature is enabled. When enabled, the auto-tune charge time feature helps adjust the parameters to ensure full charging of the sensor electrode.
| Options | Description |
|---|---|
| CAL_AUTO_TUNE_NONE | This is the default value. The user-configured Charge Share Delay (CSD), prescaler, and Resistor Select (RSEL) are used by the touch library. |
| CAL_AUTO_TUNE_RSEL* | Enabling this option will automatically select the maximum internal resistor that can be used - based on sensor capacitance and given charge time CSD/prescaler. |
| CAL_AUTO_TUNE_PRSC* | Enabling this option will automatically adjust the prescaler and make sure that the sensor is fully charged. |
| CAL_AUTO_TUNE_CSD* | Enabling this option will automatically adjust CSD and make sure that the sensor is fully charged. |
DEF_PTC_TAU_TARGET
Description: The calibration target applies a limit to the charge transfer loss allowed, where a higher setting of a target ensures a greater proportion of the full charge is transferred.
Bits 7:4 Calibration Target
| Values | Description |
|---|---|
| CAL_CHRG_2TAU | This gives 2× the RC time constant for charging the sensor |
| CAL_CHRG_3TAU | This gives 3× the RC time constant for charging the sensor |
| CAL_CHRG_4TAU | This gives 4× the RC time constant for charging the sensor |
| CAL_CHRG_5TAU | This gives 5× the RC time constant for charging the sensor |
DEF_PTC_INTERRUPT_PRIORITY
Description: This defines the interrupt priority for the Peripheral Touch Controller (PTC) Interrupt Service Routine (ISR).
Range: 1 to 3 (for some devices, it is 1 to 7)
More Info: There will be a considerable number of interrupts when the number of sensors is greater. This could affect other high-priority interrupts used by the application; therefore, we recommend configuring the PTC interrupt as low-priority.
DEF_SEL_FREQ_INIT
Description: This defines the default PTC's acquisition frequency. If the Frequency Hop or Frequency Hop Autotune module is used, then the acquisition frequency will be dynamically updated by those modules.
Range: FREQ_SEL_0 to FREQ_SEL_15