7.2 Charge Time Tuning

It is required that you ensure each sensor is fully charged during each measurement to get correct results. Most devices have a configurable “Charge Share Delay (CSD)” to adjust the charge time during each measurement. Increasing the CSD increases charge time. Some devices do not have CSD option. For such devices, the Prescaler can be used to increase the charge time. Increasing the Prescaler increases charge time.

Get Autotuned Value

  1. Build the Auto-tune enabled project and program the HEX file.
  2. Using the MPLAB® Data Visualizer, monitor the auto-tuned value (Prescaler or CSD).
  3. Power-OFF and power-ON a couple of times to ensure that the same Prescaler/CSD values are obtained.
    Note: For certain designs where parasitic capacitances are higher, auto-tune may not provide optimal results. Auto-tune CSD values may be too much (e.g., > 20). If such values are observed, assume that auto-tune has failed and proceed with manual tuning.
  4. Now the auto-tuned value is avilable. Configure the auto-tuned values to the project generated without auto-tune option.
    1. Open the project with the auto-tune charge option disabled.
    2. Configure the Prescaler/CSD which we noted in the previous step. To take tolerance into account, use higher values than the auto-tuned values.
      • In the case of CSD, use a 20% higher value. Example: If auto-tune CSD value is 10, then use 12.
      • In the case of the Prescaler, use one higher Prescaler value. Example: If the auto-tune Prescaler is PRSC_DIV_SEL_1, then use PRSC_DIV_SEL_2.
    3. Program the project and monitor the touch parameters in Data Visualizer.
  5. Proced with Manual tuning.

Manual Tuning

  1. If auto-tune was used, start with the values obtained from auto-tune. Otehrwise, keep a higher CSD value like 30 and obseve the touch delta.
  2. Observe the Delta with CSD values 25, 20, 15, 10, 5 and zero.
  3. From these values, find the CSD for which the delta is not significantly less comparing to the delta with CSD of 30.
  4. Use that CSD value.
Note: If CSD is not available, use the Prescaler. Observe delta with maximum allowed presclaer and reduce the prescaler to find the optimum prescaler value.
For example, assume the following
  1. With CSD = 30, the touch delta is 40 counts.
  2. With CSD = 25, 20, 15, the touch delta is 40 counts.
  3. With CSD = 10, the touch delta is 30 counts.

In this example, the highest delta value of 40 is found with a CSD value of 15. Increasing CSD beyond 15 does not help to increase the delta. So, it is better to use CSD = 15.

It is possible to finetune CSD by comparing the delta with CSD 14, 13, 12, and 11.

To take tolerance into account, use higher values than the values resulting from the manual tune.
  • In the case of CSD, use a 20% higher value. Example: If auto-tune CSD value is 10, then use 12.
  • In the case of the Prescaler, use one higher Prescaler value. Example: If the auto-tune Prescaler is PRSC_DIV_SEL_1, then use PRSC_DIV_SEL_2.
Sample Configuration in touch.h file with CSD set equal to 5: If CSD is not available, this field will be blank.
#define NODE_0_PARAMS
{
X(1), Y(3), 5, NODE_RSEL_PRSC(RSEL_VAL_0, PRSC_DIV_SEL_1),
  NODE_GAIN(GAIN_1, GAIN_1), FILTER_LEVEL_16
}
Sample Configuration in touch.h file with Prescaler set equal to PRSC_DIV_SEL_1.
#define NODE_0_PARAMS
{
X(1), Y(3), 0, NODE_RSEL_PRSC(RSEL_VAL_0, PRSC_DIV_SEL_1),
  NODE_GAIN(GAIN_1, GAIN_1), FILTER_LEVEL_16
}