I found the code for a Freq counter on this ESP32 site from an Internet search but cannot find that Link once logged into this Forum.
Using ESP32 Wroom.
So , I build the counter and did some adjustments on the Gate time , works great .
But at a certain point of adjusting the Gate time the Freq roll over and increment but the Gate time was decremented.
I use a /40 prescaler and measure RF freqs in the 2 meter band , eg 136Mhz to 174Mhz.
Below is a note of the Gate time vs the Freq.
I am generating a Freq of 150.000 000Mhz with a Motorola System Analyzer.
Code: Select all
uint32_t sample_time = 999952; // sample time of 1 second to count pulses
//999967 = 150 0023 68
//999966 = 150 0022 08
//999964 = 150 0018 40
//999961 = 150 0014 08
//999955 = 150 0004 48
//999952 = 150 0001 60
//999951 = 150 3998 72 ???????