Experimenting just again with the measurement of period time of square wave signal with a constantly decreasing frequency.Long measurement window times are not possible, because I need to see the change of the period time in the highest possible resolution.Therefore fast measurement cycles are very important.

The range of frequency is between 5kHz and 230 kHz. This equals to a span in period time from 200 uS to 4.35 uS.Should be no problem for the DUE.

It's capturing the period time values really fast and I'm writing them into a buffer array for later processing.But the problem is, the high frequency measurements are far away from correct and in the lower frequencies it is not really better!

The TC module channels available in the ATSAM3X8E working in capture mode can measure duty and period of digital signals directly on hardware. The capture objects available on tc_lib abstract the use of TC module channels in capture mode.

For doing what you want you should use capture objects, using them it is easy, just have a look to the example capture_test.ino which comes with the library. The library does not use function attachInterrupt() to measure the frequencies, but the interrupts of TC modules when using them in capture mode, so I think you will be able to get to higher frequencies. Have a try, but I think you can get to measure 1 Mhz signals correctly.

Please, just let me know if you get to something using tc_lib I hope it helps.

You do measure too much frequency, and I would expect jitter to be the reason (little disturbances resulting in FAILING interrupt although not the next wave high has been seen).

I had the same problem with infrared speed sensor giving too much jitter. From a colleague (a hardware guy) I learned that a Schmitt trigger would avoid the jitter. But I am more a software guy and did create a softawre solution to avoid jitter in my measurements. You can find the details in this posting(thread):http://forum.arduino.cc/index.php?topic=347579.msg2412336#msg2412336

Since you measure frequencies up to 250KHz setting dt=3 should work for you. I don't have the hardware to generate clean frequencies like you seem to have. Please try and let us know whether measurements get better by software jitter suppression.

Hi Dan! Have you test the library? I read several posts from you. I'm doing a project similar than yours and I want to ask you if you could get more accurate values with this library.It would be very useful for me

I wrote a library for AVR and Teensy3 which does this using timer capture.

https://www.pjrc.com/teensy/td_libs_FreqMeasure.html

It's designed to be extended to other chips by redefining macros for the various timers in FreqMeasureCapture.h. So far, nobody has bothered to port it to Due. I keep hoping someone might do it someday...