Fundamentally, a frequency counter has three main
components: a gate signal generator that produces a very
accurate gate time interval, usually in the .1 to 10 second
range; a counter chain that counts input clock pulses
under control of the gate; and a control unit. For example,
if the gate time is set to one second and the input signal is
5 MHz, then the counter chain will accumulate five
million input pulses in the one second interval — the exact
input frequency. A binary counter driven by an accurate
time reference oscillator (often a 10 MHz oscillator) is
usually used to get a precise one second gate interval by
opening the gate for exactly 10,000,000 pulses from the
This configuration works well if the input frequency is
equal to or greater than the 10 MHz reference. For
example, with a one second gate and an input frequency
of 10 MHz, the counter will get 10,000,000 clock
pulses for a 7/8 digit accuracy. However, with a
1,000 Hz input, the counter would reach only
1,000. That’s just a three-digit accuracy.
To get high accuracy for lower input
frequencies, the counter itself or the user must
switch to a period measurement. The roles of the
gate counter and input counter are swapped. A
period measurement operation (with seven-digit
accuracy) is discussed under the software section
of this article.
The frequency counter described here has the
performance shown in Photo 1. All measurements
use a one second gate time. At the top of Photo 1
is the frequency measured when the input signal is
the 10 MHz reference (line 1) and its period (line
2). The ‘F’ indicates that the reading was made by a
direct frequency measurement. For the center
display output, I multiplied the 10 MHz by six
and made a direct frequency measurement of
the 60 MHz signal. The bottom display output
is the most interesting.
Here, I set up an external 20-stage binary
counter using the 10 MHz as its input. This
counter divides the 10 MHz by 2^ 20 (1,048,576), giving
9.536743 Hz — exactly what the display reads. In this
case, a ‘P’ in line 2 indicates that a direct period type
measurement was used. Software in the PIC
microcontroller automatically chooses which type
measurement (frequency or period) is best.
Figure 1 shows the major components of my
frequency counter design. It’s based on a 28-pin
PIC16F886 and the 74F579 IC — a synchronous eight-bit
binary counter with three state outputs that can operate at
up to 85 MHz. This version differs from popular designs
that use the PIC internal components to do the gating and
counting functions. In my design, all critical timing
functions are moved from the PIC to the 74F579 counters.
The main building block of the counter is shown in
Figure 2. It has three 74F579 ICs in series to make a 24-
March 2015 23
■ FIGURE 1.
■ FIGURE 2. Basic counter module for both the gate and count banks. ■ PHOTO 1.