Interrupt Handling in QTouch ADC

In case of ATtiny40, the Interrupts are disabled for each acquisition sample means once per charge transfers cycle and typically this is 1184 Instruction cycles. Depending on number of oversamples and channels, the total number of times the interrupts are disabled will vary.

Total number of times interrupts disabled = No of oversamples * No of channels

The Touch measurement will not be affected by longer ISR execution, only the response time will get affected . The acquisition time is a lot more predictable since a fixed amount of pulses/oversamples are used. The time to execute one measurement will depend on various software parameters like no of oversamples, Charge share delay and CPU Frequency.

For one button to execute with following below parameters, QTouch ADC takes around  0.7 msec. CPU Freq=4 MHZ, Number of oversamples=1, Charge Share Delay =1.