I'm porting a 3.6 project that used capacitive touch input to t4; hardware-wise, I'm happy to switch to a 2 pin arrangement as used by the old Capacitive Touch library by paul, with a drive output pin thru big resistor and a sense input pin.
however that code seems to use an interrupts-disabled busy loop to time how long it takes for the sense pin to transition. since I'm hoping to run a fairly heavy audio handler, im contemplating if i can use hardware to help do the timing instead of busy looping
I noticed the teensy freqcounter library specifies a particular pin to use, but doesnt yet list anything for t4. I'm assuming it's using some timer peripheral to make the pin stop the count. would that be a good strategy on t4? does it need particular pins?
alternatively, i guess i could set up an interrupt on edges of more or less any digital pin, tho i was worried about isr latency especially if the audio library leaves interrupts disabled for long ish periods... i have a hunch that's a non starter.
any advice on which-t4-peripheral-can-help-very-accurate-pin-state-transitions-while-audio-lib-is-busy gratefully received. if, following advice, i manage to make something work id be more than happy to share the code here. thanks!
however that code seems to use an interrupts-disabled busy loop to time how long it takes for the sense pin to transition. since I'm hoping to run a fairly heavy audio handler, im contemplating if i can use hardware to help do the timing instead of busy looping
I noticed the teensy freqcounter library specifies a particular pin to use, but doesnt yet list anything for t4. I'm assuming it's using some timer peripheral to make the pin stop the count. would that be a good strategy on t4? does it need particular pins?
alternatively, i guess i could set up an interrupt on edges of more or less any digital pin, tho i was worried about isr latency especially if the audio library leaves interrupts disabled for long ish periods... i have a hunch that's a non starter.
any advice on which-t4-peripheral-can-help-very-accurate-pin-state-transitions-while-audio-lib-is-busy gratefully received. if, following advice, i manage to make something work id be more than happy to share the code here. thanks!