kapraran / FreqCountESP

A frequency counter library for esp32
https://kapraran.github.io/FreqCountESP/
MIT License
33 stars 8 forks source link

Support optional External Trigger for counting reference. #5

Closed dpwe closed 2 years ago

dpwe commented 2 years ago

Hello, me again.

To better measure the accuracy of my 10 MHz xtal, I wanted to use an external 1PPS reference signal (from a GPS receiver) to trigger the pulse counts. This change enables this mode, selected by a different initializer call.

I found that the internal interval counter was ~15ppm slow compared to the external 1PPS reference. That's insignificant for many applications, but I'm trying to measure accuracy in the parts per billion.

This change is layered on top of my previous PR to use the ESP32 hardware pulse counter (to allow it to count frequencies as high as 10MHz). However, the change is in principal independent of that change.

dpwe commented 2 years ago

Also, FYI, I ported all this to the RP2040: https://github.com/dpwe/FreqCountRP2

kapraran commented 2 years ago

Thanks for your work 👍