kapraran / FreqCountESP

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

Support optional External Trigger for counting reference. #5

Closed dpwe closed 1 year ago

dpwe commented 1 year 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 1 year ago

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

kapraran commented 1 year ago

Thanks for your work 👍