Saturday, 25 March 2017
  Home arrow Microwave Projects arrow RF/Microwave Counter  
Latest Articles
Main Menu
GMG News
World Microwave News
Job Opportunities
People at the GMG
Microwave Articles
Microwave Projects
Online Software
Discussion Board
Users QSOs
Users Links
Contact us
Login Form

Lost Password?
No account yet? Register
GMG RSS feed
Embed to your site!
RF/Microwave Freq. Counter

Simple RF/Microwave Frequency Counter

Matjaz Vidmar, S53MV

(please wait for the images to load)

1. History

Time and frequency are certainly the physical quantities that can be measured with the highest accuracy. Precise frequencies are also required in radio communications. Radio technology, including amateur-radio technology, started measuring frequencies with different kinds of absorption wave-meters. The most popular instrument among amateurs was certainly the grid-dip meter. The latter was only accurate enough at relatively low frequencies (below 30MHz) and with wide modulation formats (like AM voice).

Digital frequency counters could be built with vacuum tubes. Some specialized vacuum tubes, like the Philips E1T decade counter tube, included all counting and display hardware for one complete counting decade. Unfortunately all vacuum-tube counters as well as germanium-transistor flip-flops and early integrated-logic families were not fast enough to allow direct counting at practical frequencies used in radio communications.

A major breakthrough was represented by the TTL logic family. Inexpensive TTL chips became widely available around 1970 and allowed counting frequencies up to about 40MHz. Accurate digital frequency counters were finally within reach of all radio users including amateurs. Cheap LED displays became available just a few years later replacing expensive "nixie" display tubes and their associated high-voltage supplies. A 40MHz counter is more than adequate for any work at HF and can measure the frequencies of most crystal oscillators that are afterwards multiplied to the VHF or UHF frequency range.

I built my first frequency counter as a high-school student in just one weekend back in 1976. TTL chips were not available locally yet. My father brought me a few 7490 decade counters, a few 7447 7-digit decoders and a 1MHz reference crystal from West Germany. I remember that my father came home from his business trip on Friday evening while the counter was fully functional on Sunday evening on the same weekend! Finally I could find out where did the crystals of my homemade radios multiply in the 144MHz band...


Counting faster than the 40 or 50MHz allowed by the inexpensive TTL circuits was considered very expensive. Most amateur counters used expensive ECL decade counters: the 95H90 allowed reaching 300MHz while the 11C90 counted up to 600MHz. Finally around 1980 inexpensive ECL prescalers became available for frequency synthesizers of TV sets. Of course I upgraded my counter with one of the first such cheap prescalers, the Siemens S0436, reliably counting up to 1.4GHz!


The S0436 was not easy to use. Besides a nonstandard supply voltage of +6.8V and a nonstandard ECL output, this device divided the input frequency by 64. A rather simple solution was to divide the reference frequency of the counter gate by the same modulo 64 with a slow and cheap CMOS divider 4024. A single fast-switching transistor shifted the nonstandard ECL (CML) output of the S0436 to standard TTL signal levels.

Measuring frequencies much above 1GHz was still a difficult task. For example, receiving converters for satellite TV operating in the 4GHz and 11GHz bands used free-running oscillators at the final frequency making digital counters almost useless. Therefore the simplest absorption wave-meter was built, the famous Lecher wires. The Lecher wires include a section of parallel-wire transmission line and a moving short. The latter forms a half-wave resonator with the shorted end of the transmission line.


The shorted end of the transmission line is inductively coupled to the circuit under test, usually a microstrip resonator. When in resonance, the Lecher wires absorb some microwave power out of the circuit under test causing a measurable dip with a separate detector somewhere in the test circuit. The position of the first dip is not very accurate, the relative positions of the following dips are however very accurate.

The Lecher wires do not require any calibration except for measuring the positions of the dips. If an 1m long welding electrode is bent into 50cm long Lecher wires, this simple instrument can roughly measure frequencies above 300MHz and much more accurately above 600MHz. It makes sense to terminate the open end of the Lecher wires with a 270ohm resistor to avoid unwanted resonances.


The frequency range and accuracy of the Lecher wires is really surprising. The simple and rude instrument shown on the photo is able to measure frequencies beyond 10GHz with an accuracy better than 1% by counting several consecutive dips and measuring the distance between the first dip and last dip!

Professional microwave frequency counters are built as heterodyne receivers. The input signal is fed to a harmonic mixer and down-converted to a much lower intermediate frequency. The counter measures the local-oscillator frequency, multiplied by the appropriate harmonic number and adds or subtracts the resulting intermediate frequency. In this way both the LO and IF are well within the range of conventional digital counters.

Such a counter needs additional processing to find the harmonic multiplier and the sign of the resulting intermediate frequency. This information can be obtained by frequency modulating the LO and measuring the magnitude and phase of the FM deviation on the resulting IF.

I built such an experimental microwave counter back in 1982. All of the signal processing was done without any microprocessor, using just analog electronics and hardwired TTL logic! The local oscillator operated between 400MHz and 900MHz, well within the capabilities of the S0436 prescaler. This frequency counter eventually reached 6GHz but unfortunately its operation was quite unreliable. Therefore I decided not to publish its detailed circuit diagrams.




While digital volt-meters, ampere-meters and ohm-meters quickly became small and inexpensive hand-held instruments, digital frequency counters remained large and expensive laboratory equipment for many years. There were just a few attempts to market simple and inexpensive hand-held frequency counters. One such device was the hand-held frequency counter distributed by Radio Shack around 1997.


The Radio-Shack hand-held counter was really well designed. It included three different input stages, precisely matching the needs of an engineer: a low-frequency TTL input, a sensitive RF input and a microwave input specified to 1.3GHz but operating correctly well beyond 2GHz. Unfortunately this counter was offered with the wrong probe (a small telescopic antenna) to the wrong public. My unit is still running great after ten years. During this period it helped solving many problems in the field, of course using appropriate probes!

Does it still make sense and how to design a frequency counter today in 2007? The MC10ELxx and MC100ELxx logic families have been around for many years allowing direct counters up to at least 2GHz. Similar SiGe logic families introduced recently allow operation beyond 8GHz. Analog frequency dividers can be built from readily-available components for frequencies beyond 10GHz [1] although it is much simpler to use readily-available prescalers [2].

Microprocessors with integrated memory and peripherals certainly allow a substantial simplification of the hardware. On the other hand, one has to be very careful to avoid some useless features available with microprocessors like automatic switching between frequency and period counting or automatic input level and threshold adjustments. These "features" may work correctly in some instances while corrupting the measurements in other cases, like non-periodic or random signals or signals with extreme duty cycles far away from 50%.

Considering the accuracy of the available reference frequency, a direct counter is required up to 50MHz...200MHz. This figure matches the lowest frequency accepted by most microwave prescalers. Of course, binary-modulo prescalers like /64, /128, /256 etc can simply be used by multiplying the counter-gate period by the same number inside the microprocessor software. This is a much better solution than the pulse-swallow counters used to obtain decimal-division ratios with binary-modulo prescalers, but causing additional jitter on the measurements.

Therefore I decided to design a simple, easily-reproducible counter around a PIC 16F876A. The basic counter rate is extended to at least 180MHz using two 74Fxx devices. A divide-by-64 prescaler is used for higher frequencies up to at least 4.5GHz. All results of the measurement are shown on an inexpensive, 2x16 alphanumeric LCD module with large characters.


The counter has three inputs: a microwave (prescaled) input, an RF input and a TTL input. The microwave and RF inputs are AC coupled and terminated to a low impedance (around 50ohms). The TTL input is DC coupled and has a high input impedance. A progress-bar indicator is provided on the LCD for the gate timing.

Both the microwave and RF inputs have an additional feature, usually not found in frequency counters: a simple signal-level detector driving yet another bar indicator on the LCD module. This is very useful to check for the correct input-signal level as well as an indicator for circuit tuning or absorption-wave-meter dip display (Lecher wires).


2. Counter

The whole counter design is based on the PIC micro-controller 16F876A. The latter includes several peripherals and just a few of them are used in this project. The most important in this project are two internal, hardware counters/timers called TMR0 and TMR1. The TMR0 timer generates very precise interrupts every 100 microseconds (10kHz) from the 20MHz clock/reference. All required timings for the counter timebase are simply integer multiples of this basic period.

The TMR1 is used as a 16-bit (binary) input-signal counter. Its maximum counting frequency is just around 16.7MHz. Therefore, the first four flip-flops of the input-signal-counter chain are added externally as 74Fxxx-logic devices. The first two stages use one of the fastest 74Fxxx-series devices, the 74F50109 dual J/K-flip-flop. Further, the 74F50109 is also specified as metastable-immune and is therefore the ideal component for the counter gate.

A more conventional 74F74 dual D-flip-flop is used in the third and fourth stages. The TTL flip-flops require pull-up resistors to drive the PIC ports RC0, RC1, RC2 and RC3. RC0 is used as a clock input to the TMR1 at the same time. Replacing the 74F74 with a 74ACT74 could save some current and two pull-up resistors. The 74F50109 has the same pin-out and logical function as the 74F109, but the latter has a lower frequency limit and is not specified metastable-free.


The typical frequency limit of the 74F50109 is specified 150MHz. Driving the 74F50109 with a fast switching transistor 2N3960 (ft=1.6GHz) and a schottky diode 1N5712 to prevent saturation, reliable counting can be achieved up to 190-200MHz! Unlike conventional AND or OR gates, the J/K gate minimizes the jitter of the counting result (wandering of the last digit) regardless of the input signal. Since the /K input of the 74F50109 is inverted, two port pins (RA2 and RA3) of the PIC are required to drive the J and /K inputs with minimal skew.

On the other end, the counter needs to be extended beyond the 4 bits of the 74Fxxx logic and 16 bits of the TMR1 adding up to 20 bits of resolution. To avoid disrupting the operation of the main 100us timer, the TMR1 is not allowed to generate interrupts. The TMR1 overflow (interrupt) flag is checked during every 100us (TMR0)interrupt. The overflows are counted in two additional 8-bit registers. The overall counter resolution is therefore 36 bits.

These 36 bits are truncated to 32 bits, the upper 4 bits are not used. 32 bits allow counting beyond 400MHz with a resolution of 0.1Hz (gate time 10s). None of these counters is ever being reset! The counter value at the beginning of the measurement is stored and subtracted from the end value. Finally, the 32-bit binary result is converted to a 10-digit decimal number and the latter is displayed with the leading zeros blanked, decimal point and units (MHz or kHz).

The basic counter software allows three resolutions (selected with RC4 and RC5): 10Hz, 1Hz and 0.1Hz in direct counting mode (no prescaler), corresponding to gate times of 100ms, 1s and 10s. When used with a divide-by-64 prescaler, the three available resolutions become 1kHz, 100Hz and 10Hz, corresponding to gate times of 64ms, 640ms and 6.4s. All these gate times are obtained by counting the 100us (10kHz TMR0) interrupts.

The PIC 16F876A drives a standard LCD module with a HD44780 controller and a resolution of two rows of 16 characters each. The HD44780 requires 8 data lines (port B of the 16F876A) and three control signals: RegisterSelect (RC6), Read/Write (GND) and Enable (RC7). Since the data presented on the 8-bit-wide output port RB0-7 is only written to the HD44780, the R/W input is hardwired to ground (/Write). The LCD back-light LEDs are supplied through two 10ohm current-limiting resistors.


The input-signal level is fed to the only remaining PIC peripheral used in this project, the A/D converter. The latter has a resolution of 10 bits, but only the most significant 7 bits are used. These drive a bar indicator on the LCD module with 36 segments, corresponding to an input voltage between zero and 1.4V (full scale) on the analog inputs RA0 (MW mode) or RA1 (RF mode). The operating mode is selected with switches driving the digital inputs RA4 and RA5.

The main counter module is built on a single-sided printed-circuit board measuring 60mmX60mm. Good quality IC sockets are used for the PIC 16F876A and as connectors.


Most of the components are in SMD packages and are installed on the bottom (solder) side of the printed-circuit board. Due to the single-sided circuit, many jumpers are required. The PCB pattern is designed for 0805 jumpers marked 0R on the circuit diagram.


A 20MHz crystal is used both as a clock source for the PIC and as a frequency reference for the frequency counter. 20MHz crystals are usually designed either for 20pF-32pF parallel resonance or series resonance. Since the internal oscillator inside the PIC 16F876A is not able to oscillate on the correct frequency with large capacitors, a series inductor is required to bring the crystal on the exact frequency. The recommended 2.2uH inductor is suitable for 32pF parallel-resonance crystals.

Of course, the PIC 16F876A is also able to operate with an external clock source. This has to be connected to pin 9 while pin 10 is left open. If a high-quality frequency reference for 5MHz, 10MHz or 100MHz is available, it is recommended to multiply or divide its output to obtain the required 20MHz clock.

Other clock frequencies than 20MHz can be accepted by modifying the software to obtain the 10kHz TMR0 interrupt. The TMR0 time constant allows changing the clock in 80kHz frequency steps (4 clock cycles per instruction and divide-by-2 prescaler for the TMR0). Smaller clock steps of 40kHz can be obtained by inserting NOP instructions in the TMR0 interrupt routine, for example using a high-quality (telecom SDH) TCXO for 19.44MHz.


3. Front-ends

The counter is equipped with three different front-ends. The front-ends are built as separate modules to allow an easy interchange as better components (prescalers) become available or new requirements show up.


The prescaler front-end is designed around the NEC uPB1505 chip. The latter counts up to 4.9GHz and unlike the products from some other manufacturers its operation is very reliable. An ERA-2 MMIC is used to boost the input sensitivity and provide some protection for the uPB1505 at the same time. The ERA-2 can accept input-signal levels up to +15dBm (30mW). A 6dB attenuator behind the ERA-2 prevents saturating the uPB1505.


A 33kohm resistor can be used to kill the self oscillation of the uPB1505 around 2.6GHz, but this resistor also adversely affects the sensitivity and the maximum frequency of the prescaler. A BAT62-03W zero-bias schottky diode is used as a signal-level detector in the prescaler front-end. The gain of the ERA-2 sets the full scale on the bar indicator to about 0dBm.

The prescaler front-end is built on a single-sided printed-circuit board measuring 30mmX60mm. The 50ohm lines are built as coplanar waveguides on a 1.6mm-thick FR4 substrate. The input cable is soldered directly to the PCB. To avoid parasitic resonances between the PCB and metal grund-plane, two additional 39ohm damping resistors are installed in series with two mounting screws.


The RF front-end is designed for a high input sensitivity and low (close to 50ohm) input impedance. A high input impedance (as offered in many counters) is actually a disadvantage for RF measurements, last but no least corrupting the measurements due to low frequency (50Hz mains or switching powers supply) interference. The RF front-end includes a simple RF amplifier with a BFP196 transistor, an input protection with a 33ohm resistor and a LL4148 diode and a signal-level detector with a BAT62-03W zero-bias schottky diode.


The RF front end is built on a single-sided printed-circuit board measuring 20mmX60mm. The input cable is soldered directly to the PCB. Since the RF front-end does not include any hysteresis, it is not able to operate with sine-wave signals at very low frequencies.


The TTL front-end is a high-impedance input. DC coupling is necessary to measure pulses with arbitrary duty cycles. Further it includes hysteresis for reliable low-frequency measurements, regardless of the waveform. The circuit includes a BF998 MOSFET source follower and a 74F04 schmitt trigger. The output of the schmitt trigger is again DC coupled to the 2N3960 in the main counter module.


The TTL front end is built on a single-sided printed-circuit board measuring 20mmX60mm. The input cable is soldered directly to the PCB. The input protection is provided by the 470ohm resistor and the zener diodes inside the BF998 (breakdown voltage between 8V and 12V). Further protection could be obtained by additional zener diodes, however the latter may include a large capacitive loading (more than 100pF).


4. Probes

A very common problem of many frequency counters is that these are supplied to the end user without (any) suitable probes! In fact, most RF/microwave sources can not be connected directly to a counter input. The conventional oscilloscope probe is not a good solution for most RF/microwave measurements either. Worst of all, most counters are not even designed to be used with some useful probe types.

Any serious RF/microwave engineer has his/her own set of suitable attenuators, circulators, loads and directional couplers to connect spectrum analyzers, power meters, counters and other instruments to the circuit under test. A complete set of transitions between different RF connectors is also required. Finally, a number of pigtailed connectors to be soldered directly to the circuit under test is always of great help.

A very useful probe to be used with RF/microwave counters is a simple inductive pickup or in other words a 5mm diameter loop at the end of a short length of 50ohm coaxial cable. According to my own experience it does not make sense to make this loop much smaller or larger than 5mm. The same loop can be used from a few MHz up to several GHz. A small resistor (around 50ohm) can be installed in series with the loop to suppress any cable resonances.


The loop is simply approached to inductors or resonators in the circuit under test. The undesired loading of the circuit can be minimized by keeping the loop at the maximum distance that still provides a stable reading on the counter. Finally, the loop probe is never affected by low frequency (50Hz mains or similar) interference. Since the coupling to the circuit under test is not very efficient, it is rather unlikely to damage the counter with large RF signal levels.

A standard oscilloscope probe is a practical solution to measure low frequencies, pulsed signals and in some cases even RF signals.


In order to use an oscilloscope probe efficiently, the internal operation of the probe has to be understood. Most probes are equipped with a X1/X10 switch. Further there is a series damping resistor (around 500ohm) to avoid cable resonances that could both corrupt the oscilloscope display and severely disturb the circuit under test.


Finally, one should understand that although the TTL input of the counter operates in excess of 100MHz, the oscilloscope probe may reduce the upper frequency limit to 50MHz or even less!


5. Assembly

All counter modules require a +5V power supply. A 7805 regulator is a simple and efficient solution. Some additional components are required for interference and switching-transient suppression.


The 7805 regulator is bolted directly to the rear panel for heat-sinking.


Two DPDT switches are used for front-end selection.


An additional switch is used to select the gate time.


All four printed-circuit boards are single-sided, etched on an 1.6mm-thick FR4 laminate (image resolution is 150dpi).


The counter is installed in a box made of aluminum sheet. The bottom is made from 1mm-thick aluminum sheet, the cover is made from 0.6mm-thick aluminum sheet and the LCD is protected by a small piece of plexiglass.


The useful internal width is 200mm, depth 100mm and height 45mm.


The RF connectors, switches and LCD module are installed on the front panel.


The power-supply connector is installed on the rear panel.



6. Operation

Immediately after power-up, the counter displays the software version/date for about one second.


During normal operation, the leftmost characters of both rows are used as a vertical-bar display of the gate progress with 10 horizontal segments. The remaining 15 characters in the top row display the measured frequency. Three characters in the bottom row show the operating mode ("MW:", "RF:" or "TTL") and the remainig 12 characters are used as a horizontal-bar display of the signal strength with 36 vertical segments.

In the microwave mode both prototypes operated reliably up to 4.9GHz with an input-signal level of 0dBm (self-oscillating uPB1505 without 33kohm resistor). Below 3GHz the sensitivity improves to -30dBm. The 33kohm unbalancing resistor to stop self oscillations degrades this sensitivity by more than 10dB! Below 500MHz the sensitivity degrades again: the counter may count odd harmonics with too-low signal levels. The minimum usable frequency was found around 12MHz. The following picture shows the counter in the microwave mode with a gate time of 640ms corresponding to a resolution of 100Hz.


In the RF mode the 74F50109 allows counting up to about 220MHz. Reliable operation is possible up to 190-200MHz, depending on the internal wiring to the switches, with an input-signal level of 0dBm. The sensitivity improves from -20dBm at 180MHz down to -50dBm at 10MHz. The RF signal-level meter follows a similar increase in its sensitivity. This increase at lower frequencies matches the performance of the described loop probes! The following picture shows the counter in the RF mode with a gate time of 100ms corresponding to a resolution of 10Hz.


Unfortunately, the 74F50109, manufactured by Signetics (Philips) is not easily available. A 74F109 from the same manufacturer only operated up to about 140MHz. A combination of 74AC109 and 74AC74 (both from National Semiconductor) counted up to about 170MHz. The 74ACxxx logic circuits require a different input DC bias: replace the 2.2kohm resistor between the input and the collector of the 2N3960 with a 47kohm resistor. All four pull-up resistors can be omitted with 74ACxxx logic. Finally, the 2N3960 itself does not have many valid replacements. A 2N2369 will decrease the 74F50109 counting rate down to just 165MHz while RF and microwave transistors provide even worse results!


A much better choice is the 74LVC109. Although this device is specified for 3.3V operation, the maximum Vdd rating is 6.5V according to the 74LVC109 data sheet. Therefore it can replace the 74F50109 directly omitting the pull-up resistors. Since the 74LVC109 is a CMOS device, the 2.2kohm bias resistor between the input and the collector of the 2N3960 has to be replaced with a 33kohm resistor. The 74LVC109 allows the RF input of the counter to operate beyond 500MHz using a 74AC74 in the second stage! Above 500MHz counting may become unreliable due to limitiations of both the 74AC74 and the PIC 16F876A, the latter being guaranteed only to about 270MHz on the input. Further, in the 0.1Hz resolution mode, the 32-bit variables in the current software only allow counting to 429MHz.

Finally, for operation above 200MHz a careful internal wiring among the different modules is required. Efficient grounding of the shields of all coaxial cables is particularly important. It is suggested that a small piece of L-shaped, pre-tinned metal sheet is installed under both switches having all cable braids grounded to it as shown on the following picture.


In the TTL mode the prototypes operated reliably beyond 100MHz. This frequency limit is however reduced by the coaxial cable feeding TTL signals and even more when using oscilloscope probes. The input-signal level is not indicated in the TTL mode. The built-in hysteresis allows reliable counting of very low frequencies, like the 50Hz mains. The following picture shows the counter in the TTL mode with a gate time of 10s corresponding to a resolution of 0.1Hz.


The current software version does not detect the mode switching before the end of the gate period. Therefore one may have to wait up to 10 seconds for the gate period to expire and another 10 seconds to get some meaningful reading. The current software also does not make any use of the measured signal level. Therefore it will display the self-oscillating frequency of the prescaler with no signal input in the microwave mode or any other invalid data due to low signal levels in the RF or microwave modes.

The software is designed using the same rules as the whole counter: keep this project useful, simple and straightforward. A simple prescaler is therefore used in place of a considerably more complex direct microwave counter. Some simple 74Fxxx logic ensures enough overlap between the prescaled microwave frequency range and the direct RF frequency range. A TTL input with hysteresis is an efficient solution for low frequencies and extreme duty cycles. Finally, an input-signal level indicator is an inexpensive but very useful addition to a frequency counter.

Last but not least, all detailed information like PCB files or software source code are made available in the following ZIP archive:

Full-scale drawings, PDF datasheets, PCB files & PIC software

* * * * *

< Prev   Next >
Who's Online
Buy microwave components on-line

© 2017 Greek Microwave Group - Official Site

Get The Best Free Joomla Templates at