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
- Build the Auto-tune enabled project and program the HEX file.
- Using the MPLAB® Data Visualizer, monitor the auto-tuned value (Prescaler or CSD).
- 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.
- Now the auto-tuned value is
avilable. Configure the auto-tuned values to the project generated without
auto-tune option.
- Open the project with the auto-tune charge option disabled.
- 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 usePRSC_DIV_SEL_2
.
- Program the project and monitor the touch parameters in Data Visualizer.
- Proced with Manual tuning.
Manual Tuning
- 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.
- Observe the Delta with CSD values 25, 20, 15, 10, 5 and zero.
- From these values, find the CSD for which the delta is not significantly less comparing to the delta with CSD of 30.
- Use that CSD value.
- With CSD = 30, the touch delta is 40 counts.
- With CSD = 25, 20, 15, the touch delta is 40 counts.
- 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.
- 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 usePRSC_DIV_SEL_2
.
#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 }
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 }