ZL2PD Single Digit Frequency Counter

A single 7-segment LED display is used in
this shirt-pocket microprocessor-based frequency
counter which operates to beyond 65 MHz.
“In regione caecorum rex est luscus”
(In the land of the blind, the one-eyed man is king)
Desiderius Erasmus, Adagia (III, IV, 96)
Dutch philosopher (1466 - 1536)
Introduction
As
equipment becomes increasingly more compact, designers are often
obliged to follow suit by reducing the size of displays. At some point,
the usefulness of the display can become compromised. I, for one,
dislike having to peer intently at tiny displays in an attempt to read
vital information, if only because it serves as a reminder that my
eyesight is no longer the 20:20 model of optical perfection I’d like to
pretend it once was.
In the search for suitable displays for compact equipment, I explored
using a single seven-segment LED to display multiple digit information.
If successful, this could both deliver the required functionality and
minimise display size. With a suitably large LED digit, information
could also be seen from some distance without the need for eye strain.
But is such a display practical in real applications? This little
frequency counter suggests that it is. It is a lightweight and
remarkably rugged portable frequency counter which will readily operate
up to 65 MHz. While using only a large single LED display, it displays
a frequency with five digits of resolution (i.e. to the nearest kHz) in
a package which can be easily carried in a shirt pocket.
The Design
Some
initial tests showed that displaying multi-digit frequency measurements
on a single display is best handled by displaying the information in a
series of three digit bursts. Any more information than this seemed to
introduce the potential for confusion.
In this case, each set of three digits is sequentially displayed for
about 300mS per digit with a short inter-digit pause of about half this
duration. This is followed by a longer pause of about a second to
clearly flag the end of the three digits of information. There is
clearly something of a tradeoff in this timing. A longer duration for
each digit makes it easier to initially read the information, but the
overall time required to read all of the digits can quickly become
tedious.
In order to display five digits of frequency information, as in this
counter, I have used a “MHz/kHz” button to select the required set of
three digits, and matching LED indicator to clearly show the set of
digits being displayed. To display a frequency of 59.876 MHz, for
example, the counter displays 5 9. 8 (pause) repeatedly while in the
MHz mode (with a decimal point displayed along with the MHz units
numeral), and 8 7 6 (pause) repeatedly in the kHz mode.
A second button allows a measured frequency to be held in the counter.
I can use the counter with a short probe directly attached to the input
connector. In some cases, this can result in the display being out of
sight during the measurement. By touching the Hold button, the required
measurement is retained, and the counter can then be removed from the
equipment to allow the frequency display to be read.

Figure 1: Circuit diagram of the frequency counter.
With an eye on simplicity, the counter uses only two chips – an Atmel
AT89C2051 microprocessor and a low cost CMOS divider. A common BC549
NPN transistor acts as a buffer amplifier for the counter.
The buffered input is divided by 256 in the 74HC4060 divider. Use a
Philips IC here if possible, or at least simply avoid using a Fairchild
HC4060 here. I’m uncertain if processes have improved over at Fairchild
in the past couple of years, but their HC parts that I've tested seem
to be limited in operation to 25 MHz. The Philips HC devices I have
tried all work up to 80 MHz.
The microprocessor I used is an Atmel 89C2051, one of the 8051 family.
A low cost 10 MHz HC-49U crystal is used to clock the microprocessor,
and this forms the reference oscillator for the counter. The software
can be used with any standard 8051 family device (i.e. 89C51, 87C751
etc) and the code, as usual, is available at the foot of this page in
the Download section. I have posted both the fully commented source
code as well as the Intel-format HEX file.
Publishing the source code allows others to add features they may
prefer to the software, or to change basic functionality, such as pin
assignments. This may be desirable where specific components are being
used on a tight PCB layout and minor changes are required to get parts
to fit nicely. Most users will only require the HEX file which is used
to program chips with the standard software. The final code is quite
compact, requiring around 600 bytes of code space and 16 bytes of RAM.
The power supply regulator uses a tiny 78L05 three-pin regulator chip (Jaycar
ZV-1539). The input voltage can comfortably range from 8V to 15V. The
output current of this low power version of the standard 7805 regulator
is limited to 100mA, and the small package allows up to 500mW of power
dissipation. This counter draws about 25 mA, keeping operation well
within the limits of the regulator.
Although
the circuit diagram shows a battery as the power source, the prototype
enclosure didn’t allow for this. Instead, it uses a regular DC socket.
Battery life from periodic use with a 9V battery however will be quite
acceptable.
The seven-segment LED display is directly driven by the microprocessor
pins. Three spare pins on the microprocessor are shown on the circuit
diagram for frequency offsets. With suitable code, the frequency
displayed can be offset by a preset value to allow for commonly used IF
frequencies such as 455 kHz and 10.7 MHz. For example, if a receiver
has an IF of 455 kHz and is tuned to 3.536 MHz, the oscillator
(assuming high-side injection) would be 3991 kHz. By selecting an
offset of “-455 kHz”, the frequency counter will subtract 455 kHz from
the measured frequency before displaying the result. This allows the
counter to be used to display actual operating frequencies while using
frequency counted from a receiver local oscillator.
I didn’t have any requirement for this feature and so I did not add
that code into the software for this frequency counter. However, I have
made allowance for it in the design and, if there is sufficient
interest, I can post a suitable version of the code on my website.
Construction
The
prototype was built on a scrap of veroboard trimmed to fit the
available space. The photo above shows the general arrangement. It is
mounted in a small plastic case which has a single cutout on one face
for the LED display. The case I used is a Jaycar IP54-rated polystyrene
enclosure (Jaycar HB-6030) although I have my doubts over the IP54
moisture-proof rating of the case after the cutout window is made in
the side! IC sockets were also used, but these are not necessary
I
super-glued a piece of thin transparent red plastic over the window to
improve display contrast although the red LED display I used was very
bright. It's easily seen even in full sunlight. Any “common anode” type
LED display of any LED colour can be used. One good choice is the
Jaycar ZD-1857.
The ‘kHz’ indicator is just a standard 3mm or 5mm LED. Again, I used a red LED but any colour LED here will also work just fine.
I used a standard RCA phono socket for the RF input connector in the
prototype. I would have preferred to use a BNC connector here but it
was simply too large to fit the available panel space in the prototype
case. A larger case would solve the problem, but then the counter might
not fit so nicely in my pocket.
Operation
Operation
is as simple as the design. When the counter is powered up, it is set
into the normal frequency counter mode with MHz digits displayed
sequentially. Any leading zeros in the MHz range will be suppressed, so
9.259 MHz will be displayed as “9. 2 (pause)”. In the absence of any
input, only a single “0” will be repeatedly displayed followed by the
inter-display pause.
Pressing the ‘kHz/MHz’ button will change the display mode, and display “2 5 9 (pause)” for this example.
Pressing the ‘Hold’ button will retain the current frequency count to
allow the user to read the display at their leisure. The character “H”
(for Hold) is briefly displayed once to indicate the counter is
entering this mode. The ‘kHz/MHz’ button can be pressed to read each
set of three digits. Pressing the ‘Hold’ button again will exit the
Hold mode.
Copyright
This
design was described in the May/June 2008 issue of New Zealand's
amateur radio magazine "Break-In" . Break-In is published by NZART, New
Zealand's amateur radio organisation. The details shown on this website are reproduced with the permission of the editor.
Details about the magazine can be found at www.nzart.org.nz
(Note: 'Break-In' is a term used in ham radio to describe the method by
which an operator sending a message can hear the other party's signal
during brief transmission pauses)
Downloads:
Intel HEX file - Clicking on this link will allow you to download a
zipped HEX format file (1 kB) for programming an 89C2051 chip for use
in this counter.
Source File - Clicking on this link will allow you to download a zipped
Metalink compatible ASCII TEXT format source file (7 kB) for this
counter. This will allow the code to be modified by experienced 8051
programmers who may wish to add more features.
Want to go back to the main page? Click
here to
return directly.