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.
The best measurement results I've observed by testing the FreqPeriodDue library. https://github.com/enternoescape/Arduino-FreqPeriod-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 error list: real signal measured signal (Arduino-FreqPeriod-Due LIB) 230.000 Hz 248.520 Hz 220.000 Hz 237.288 Hz 210.000 Hz 227.027 Hz . . 100.000 Hz 103.703 Hz . . 50.000 Hz 50.909 Hz
The problem seems to be the wrong interrupt concept of this library. Here in the forum "Magician" recognised already this interrupt issue. http://forum.arduino.cc/index.php?topic=304631.15
attachInterrupt(periodPin, FreqPulse, FALLING);
But what is the solution, how it can be fixed?
Would be so great having finally a reliable period measurement LIB for the DUE as well!