The program make short (0.125s) test of the input signal to determine the prescaler value. Next is the actual counting with the proper prescaler value and then the result is send to the display.
This is fast breadboard proof-of-concept project, and I don't intend to make a finished product, for now at least. Of course there must be some sort of preamplifier/protection in front of the frequency counter in order to be usable.
In the pictures below is shown the breadboard and five different quartz crystals generating different frequencies. The differences between the value on the display and the value on the oscilloscope are negligible. I tested the schematic also with frequencies above 90 MHz and even above 100Mhz and the results was accurate, but of course most significant digit was lost in case of 100+ MHz.
Link for downloading the code and .hex files: LINK
The code is compiled with MikroC Pro. RA5/MCLR must be configured as I/O or if not there must be 10k resistor connected between RA5 and +5V. When programming the microcontroler with PICkit 3 the option "Tools/Use VPP First Program Entry" should be selected and the schematic should be disconnected from the power supply.