# 50 MHz Frequency Counter

4.88889 5 9 Product

This is an accurate frequency counter (frequency meter). The unit has one input and it is able to measure the base frequency of any signal applied to that input from 0.1 Hz to 50 MHz. The result is displayed on a 2x16 character LCD display.

It offers a frequency resolution up to the amazing 1 Hz and has very good input sensitivity (up to some mV). Min and Max hold functions, frequency units’ selection and gate time adjustment are also supported. This work started as a PIC learning project, since it uses a base 8-bit PIC microcontroller but it turned out to be more than that. Although using an 8-bit PIC, a 24-bit counter is actually implemented.

Theory of operation

The frequency (f) of any periodic waveform can be calculated by counting the instances (N) of the waveform during a precise time interval (dt) from f=N/dt. The frequency measurement unit is the Hz and 1 Hz is defined as one instance per second. An obvious frequency measuring technique is presented in figure 1.

According to this technique, the input waveform must first be converted in an equivalent digital form. This digital form is actually a fast switching binary signal which preserves the frequency characteristics of the input waveform. Then, an edge-triggered digital counter is used to accurately count (starting from 0) the N occurred pulses in a precise time interval dt. This time interval is provided from an accurate (reference) time base. Afterwards, a PIC18F242 microcontroller is used to calculate the measured frequency from f=N/dt and display the result on a common display unit.

This counter is actually a 24bit counter. You maybe wonder how is this achieved using a PIC which has only 16-bit internal counters. This is because the PIC’s internal 16-bit Timer0 module (configured as a 16-bit counter), is used in series with the PIC’s internal prescaler (in 1:256 prescale mode) and we use a popular method to “extract” the 8-bit value of the prescaler. Read more about this method.