Has anyone done input capture with the full 48 MHz clock resolution (20.8 ns tick) on T3.1 with more than one input signal at the same time? For example, with two channels? Note I'm thinking about two unrelated frequencies, not a 2-channel quadrature encoder output.
I am using the very convenient FreqMeasure library on T3.1 with one channel https://www.pjrc.com/teensy/td_libs_FreqMeasure.html
When reading through FreqMeasureCapture.h
it seems there are four possible input pins, going to four distinct timer channels. Later in that file there are four sets of code conditionally compiled depending which of the four input captures is defined. I can only vaguely understand the code so far. Based on fig. 37-175 on page 946 of http://cache.freescale.com/files/32bit/doc/ref_manual/K20P121M100SF2RM.pdf it looks like each of the four possible timer channels has its own CnV capture register and CHnF capture flag.
I am using the very convenient FreqMeasure library on T3.1 with one channel https://www.pjrc.com/teensy/td_libs_FreqMeasure.html
When reading through FreqMeasureCapture.h
Code:
// Teensy 3.1
#elif defined(__MK20DX256__)
#define CAPTURE_USE_FTM1_CH0 // FTM1 CH0 is pin 3
//#define CAPTURE_USE_FTM1_CH1 // FTM1 CH1 is pin 4
//#define CAPTURE_USE_FTM2_CH0 // FTM2 CH0 is pin 32
//#define CAPTURE_USE_FTM2_CH1 // FTM2 CH1 is pin 25
it seems there are four possible input pins, going to four distinct timer channels. Later in that file there are four sets of code conditionally compiled depending which of the four input captures is defined. I can only vaguely understand the code so far. Based on fig. 37-175 on page 946 of http://cache.freescale.com/files/32bit/doc/ref_manual/K20P121M100SF2RM.pdf it looks like each of the four possible timer channels has its own CnV capture register and CHnF capture flag.
Last edited: