FreqCount for multiple pins

Status
Not open for further replies.

bgutman

New member
Hello,
I need to measure the frequency for two pins. I know you can use the FreqMeasureMulti library for multiple pins but FreqMeasure is too slow. Since I am dealing with frequencies of several MHz, I need the FreqCount library. So is there a way to do use FreqCount for multiple pins, similar to the freqmeasuremulti function?
 
Do you need the frequency acquisition of all channels to be simultaneous, or can you multiplex the the inputs and alternate the samplings?
With a several MHz input signal, you will only need to sample for a few microseconds to get an accurate reading.
 
Hmm... maybe it's theoretically possible on Teensy 3.6 to bring in 2 more clock signals on pins 0 & 1 when configured as ALT4 setting (FTM_CLKIN0 and FTM_CLKIN1). Then those 2 would need to be routed to two of the FTM timers, by bits 24-27 in the SIM_SOPT4 register. Normally the FTM timers clock from F_BUS, by setting bits 4-3 in the FTM*_SC register to 01. But setting those to 11 should let the FTM timer clock from the external signal.

Of course, then someone would have to pretty much write a new version of the library using two of the FTM timers instead of LPTMR.


Edit: Teensy LC and 3.5 might also be able to do this, but Teensy 3.2 definitely can not. Those 2 pins on Teensy 3.2 lack the ALT4 option needed.
 
Last edited:
Status
Not open for further replies.
Back
Top