Below is a picture of what the CVD waveform should look like on a scope. Note that sensor lines are used both for scanning themselves and the other sensors. You may notice the sensor being pulled high and low during other sensor's scans.
The mTouch framework provides the ability to tune the timing of CVD waveform for specific hardware designs. The amount of parasitic capacitance, the size of the sensor, the size of the sensor's series resistor, and VDD all play a role in determining the amount of time required to charge/discharge during each step of the scan.
CVD Waveform Delay Configuration Options
- CVD_CHOLD_CHARGE_DELAY
This value determines the amount of time provided for charging the internal hold capacitor of the ADC.
If this value is too small: There will be noticable crosstalk between closely-indexed sensors that is not related to the hardware layout of the application.
If this value is too large: The mTouch ISR will take an unnecessarily long amount of time to execute.
To correctly set this value:
-
Set this value to 0, compile and program.
-
Look at the raw values on the mTouch GUI or through a terminal program.
-
Produce the largest shift possible on the sensor with the highest amount of capacitance by pressing on it. ("Highest Capacitance" usually corresponds to the sensor with the highest unpressed raw value.)
-
Do you notice a strange crosstalk behavior on a different sensor? If no, leave this value to 0. If yes...
-
Increase the delay until the crosstalk behavior is eliminated.
Once you've solved the crosstalk for the sensor with the highest amount of capacitance, the others will be fine as well and you have correctly tuned the Chold delay time.
- CVD_SETTLING_DELAY
This value determines the amount of time provided for the external sensor and internal hold capacitor to charge-average their voltages.
If this value is too small: The sensors will not be as sensitive as they could be and your sensor's readings will be VDD dependant.
If this value is too large: The noise immunity of the system will not be as robust as it could be.
To correctly set this value:
-
Set this value to 0, compile and program.
-
Look at the raw values on the mTouch GUI or through a terminal program while powering the system at the desired VDD level.
-
Adjust VDD by plus and minus 0.5V
-
Do you notice any change in the unpressed value as VDD is changing? If no, leave this value alone. If yes...
-
Increase the delay until the sensor's reading no longer changes as VDD changes.
Once this has occurred, the settling time has been correctly tuned to provide the maximum amount of sensitivity while minimizing the framework's susceptibility to noise.