freq measure multi on teensy 4.0

vlelectroniclab

Active member
Hi everyone,
Many years ago I had done a project where I used tennsy3.2 with the freqmeasuremulti library.
Today I would like to update that project by putting teensy4.0, but I don't understand if the library is compatible and which pins I can't use.
I have to read 6 frequencies ranging from 0 to 1khz.
Thanks Vito
 
it is not clear to me which pin I cannot use when I read the frequency.

Check out the PWM page.


Scroll down to "PWM Frequency". You'll find a table of which timer resources correspond to which pins. Scan down the table to find the pin you're using. If any others are connected to that timer resource, you can assume those other pins are unusable for PWM or any other library which uses the hardware timers for pins (eg: PulsePosition, PWMServo)
 
From Github:

Teensy 4.x - can support all FlexPWM pin - some of these pins are on the same FlexIO object/subObject as such if you use any of these pins, they can impact how other pins that are that same subobject will work if you attempt to use them for some other sub-system that uses the same timer object.
Does that mean that each pin used for FreqMeasureMulti needs to use a different FlexPWM timer? Or just not share a timer with a different function, like PWM? I wasn't sure, reading the docs.

(I have a project that needs two FreqMeasureMulti pins and six PWM outputs, so I was checking that today when I saw this thread)
 
From Github:


Does that mean that each pin used for FreqMeasureMulti needs to use a different FlexPWM timer? Or just not share a timer with a different function, like PWM? I wasn't sure, reading the docs.

(I have a project that needs two FreqMeasureMulti pins and six PWM outputs, so I was checking that today when I saw this thread)
It is not necessary for each FreqMeasureMulti to be on a separate FlexPWM, but you should pick pins for FreqMeasureMulti that are on different FlexPWM than those you use for PWM. I'm forgetting the terminology, but a single FlexPWM has 12 output pins (4 modules x 3 pins a,b,x), so choose 6 pins for PWM on one or more FlexPWM, and a different FlexPWM for FreqMeasureMulti.
 
Last edited:
Back
Top