Does FreqMeasure ou FreqMeasureMult library work with Teensy 4.x?

Status
Not open for further replies.
OK. So I have had look into making FreqMeasureMulti work for the t4 and it is all very confusing. Can someone give me some pointers please?

I am not sure which timer to use: flexpwm or GPT? Both can be triggered by waveform features. From the datasheet, flexpwm4 is attached to pins 22 (AD_B1_08 as used by FreqMeasure), 23 (AD_B1_09) and 3 (EMC_05). That gives 3 readings only. GPT1 is not attached to any pins and GPT2 is only attached to pin 15 (AD_B1_03). Can 1 pin take multiple readings? Or can a variety of timers be used across multiple pins?

This discussion is useful: https://forum.pjrc.com/archive/index.php/t-54265.html, especially Paul's post at 12-18-2018, 12:41 PM about 3/4 of the way down, and it wouldn't take much to rewrite for GPT2.

KurtE's FlexIO library and this discussion of GPIO: https://forum.pjrc.com/threads/58377.html are also interesting.

The file teensy4/imxrt.h contains all the definitions.

My goal is to measure the period of 4 square-wave frequencies in the range 1KHz to 100 KHz, up to 16 times a second. FreqCount won't provide enough resolution at this sample rate. FreqMeasure will and it seems to be accurate up to at least 200KHz on the t4 (according to my oscilloscope anyway).

Thanks for your help.
 
Status
Not open for further replies.
Back
Top