The response time of your system is going to be determined by the equation:
Suggestions for Making the Response Time Faster:
- 1. Decrease MTOUCH_SAMPLES_PER_SCAN to reduce the amount of oversampling.
This configuration option should never drop below 10 in normal applications. The higher this value is, the more stable the sensor's readings will be coming out of the acquisition ISR. However - the diminishing returns on this value follow an exponential curve. In other words, the increase in signal fidelity when changing from 10 to 20 samples is about the same as changing from 40 to 80.
- 2. Reduce the TMR0 Prescaler value.
This will increase the rate at which the timer's counter will increment. Do not set this value to 1:1 or the interrupt will occur too quickly to allow processing in the main loop. This value is determined by the application when it initializes the OPTION register. The framework does not adjust this register.
- 3. Increase the PIC's oscillator frequency.
This will increase the rate at which the timer's counter will increment, but will also increase the amount of power needed by the PIC.
- 4. Decrease MTOUCH_NUMBER_SENSORS.
The mTouch Framework scans all sensors completely before returning the result to be processed by the main loop application. Reducing the number of sensors being scanned will reduce the number of times the ISR must be called before new data is available.
- 5. Reduce the amount of debouncing required to change sensor states.
There are two debounce values available:
MTOUCH_DEBOUNCE_PRESS is for the RELEASE-to-PRESS transition.
MTOUCH_DEBOUNCE_RELEASE is for the PRESS-to-RELEASE transition.