Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

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

  1. #1

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

    I would like to know if the FreqMeasure end FreqMeasureMult library work Teensy4.x?

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,473
    Yes, FreqMeasure works. Use pin 22 for the frequency input.

    FreqMeasureMult is not yet ported to Teensy 4.0.

  3. #3
    Thanks Paul, I would like to use the library in a project. I will wait for the library update.

  4. #4
    Is anyone working on this?

    How difficult might it be? I may have a go if not too bad....

  5. #5
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •