Recently I discovered that using touchRead in my program causes analogRead (of a separate pin) to pick up some sawtooth noise.
I assume this is the touchRead functionality either capacitively coupling into the analogRead inputs, or else there is some residual signal left on the ADC's charging capacitor after it multiplexes off the touchRead pin.
Pseudocode:
I hooked up a scope probe to "pin_a" and saw that when my program uses touchRead, there is some high frequency noise on it. When I remove the touchRead call, this noise goes away.
Wondering if there is something I can do in software to mitigate this somewhat. Is it possible to turn off touchRead's square wave oscillator programmatically?
I assume this is the touchRead functionality either capacitively coupling into the analogRead inputs, or else there is some residual signal left on the ADC's charging capacitor after it multiplexes off the touchRead pin.
Pseudocode:
Code:
loop(){
int a = analogRead(pin_a)
int t = touchRead(pin_t)
// do something with values that takes about 10 milliseconds
}
I hooked up a scope probe to "pin_a" and saw that when my program uses touchRead, there is some high frequency noise on it. When I remove the touchRead call, this noise goes away.
Wondering if there is something I can do in software to mitigate this somewhat. Is it possible to turn off touchRead's square wave oscillator programmatically?