FreqMeasureMulti Library on T4.1 or Micromod - which pins for 8 independent signals?

MichaelB

Member
I am transferring my project from T3.6 to T4.1 / Micromod (not decided yet).
I want to measure frequency and/or duty cycle of 8 independent signals and I am a little confused about Paul's notice in the description of the library:

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.

As you can see I am not very familiar with the FlexIO/-etc system, so I am not sure which pins to choose. Can someone please give advice?

Thank you!
 
If you look at file in FreqMeasureMultiIMXRT.cpp in the src folder of the library, you will see a table that defines all of the pins available for use by the library. Here's a quick summary:

For both T4.0 and T4.x, you can use pins 0-9, 22-25, 28-29, 33
For T4.0 you can also use 34-39
For T4.1 you can also use 42-47, 51, 54

You'll see that all of these pins are FlexPWM. The processor has 4 x FlexPWM modules (1-4), each with 4 sub-modules (0-3), and each of those with 3 input channels (A,B,X). That makes 4x4x3=48 total, but not all of those are brought to physical pins. There are a lot more than 8 available, but you'll probably use some of these pins for other things. When choosing pins, you can minimize conflicts by using pins from the same FlexPWM module as much as possible. If, for example, you need to generate PWM on other pins, you can avoid conflict by using pins from a different FlexPWM module, or better yet use pins that map onto Quad timers.
 
Back
Top