Teensy 4 - Used FreqCount Library, and serial output display first three digit only?

shurp

New member
Hey, I am currently using Teensy 4, and FreqCount library to measure frequency between 100kHz to 700KHz.
I am measuring signal from a function generator. I am not sure why, but I only get the first three digital on the serial output; image shown below of is a measurement of 105KHz signal.
Similarly, if I measure 600KHz, it only show 600 on the serial output.

Not sure what's going on.

measured 105KHz.PNG
 
That looks like the code presented here to work: pjrc.com/teensy/td_libs_FreqCount.html

Wonder if the function generator is providing usable output?

A PWM PIN could be set up on the same Teensy at similar frequency and measured and that would be expected to work.

Set the PWM Freq as desired and set the value at half the Bit value for even divided On/Off and jumper that output pin to the measure pin and see the results.
 
Hey, I am currently using Teensy 4, and FreqCount library to measure frequency between 100kHz to 700KHz.
I am measuring signal from a function generator. I am not sure why, but I only get the first three digital on the serial output; image shown below of is a measurement of 105KHz signal.
Similarly, if I measure 600KHz, it only show 600 on the serial output. Not sure what's going on.

This is not well-documented, but for T4.x, the argument to FreqCount.begin() is MICRO seconds, not MILLI seconds as for T3.x, so you are counting over just 1 ms instead of 1 sec as you wanted. If you update that argument from 1000 to 1000000, you will get the expected result. This example should be updated.
 
After updating the argument from 1000 to 1000000, I am able to get the right measurement. Thank you!
 
Back
Top