Teensy 4.0: Is it possible to control timing of teensy ADC with external clock?

MSzymanek

New member
Hi,

I'm working on reading some photosensor input from ADC2. I can get the ADC to read from 4 pins sequentially and output it by inheriting from AudioStream (Teensy Audio Library). My problem is that the only way I know of timing the ADC_ETC triggers is via the onboard Timer (such as fx in input_adc.cpp class). However, I would very much like to not use Teensy timer and use an external signal for ADC_ETC triggers, since the PCB I'm provided has a 44100 clock signal coming in via one of the pins, and that would be perfect for triggering the adc. As far as I'm aware, ADC_ETC module is triggered via XBAR, which has a number of different inputs to choose from, but nothing which suggests I can just take a signal from a pin and reroute it there as a clock.

To put things in perspective, this code sets the QTimer 4_3 to trigger the ADC_ETC:

Code:
	xbar_connect(XBARA1_IN_QTIMER4_TIMER3, XBARA1_OUT_ADC_ETC_TRIG00 + trigger);

Is there a way I can take input from a gpio pin and shove it in xbar as input for the adc trigger?
 
Back
Top