A Digital Frequency Display

By Phil Rice VK3BHR


This project is intended to be an accurate frequency display for a HF direct conversion or superhet receiver. It has user settable IF offsets so that it can calculate the actual receiver frequency. It also makes a nice 40MHz. frequency meter with 10Hz. resolution.

The design uses a PIC 16F84 single chip microcomputer to perform the frequency measurement and to format the result for display on a 16 character LCD display. It is based on a frequency meter and VFO stabiliser design by Eamon Skelton EI9GQ. It initially started as an exact copy however I couldn't resist the urge to modify the hardware and the software. It is now missing the VFO stabiliser function of Eamon's design, but has user settable IF offsets (which can be zero for DC receivers) and can handle high or low side local oscillators and display "USB" or "LSB" when appropriate.

How it works:

The input signal is buffered by a FET source follower then amplified by two 74LS00 NAND gates, biased into their linear region. Two further NAND gates allow the buffered input, or a signal from the PIC, to clock the 74HC393 8 bit binary counter. Overflow from the counter is counted by the PIC's internal 8 bit prescaler and 8 bit counter registers.

The PIC controls gating of the input signal into the 393 counter. At the conclusion of the counting period (0.4 second), the PIC tickles the 393 until it rolls over. The PIC counts how many clock pulses are needed and from this calculates the count in the 393. The PIC similarly flushes its internal prescaler as it can't be read directly. The final 8 bits of the count are read directly from the internal counter register. The complete count is formed by joining all 3 bytes together to make a 24 bit binary number, then dividing this by 4. (This limits the maximum measured frequency to just over 41.9MHz.)

The remainder of the PIC program adds or subtracts the IF offset (if required) converts the result into ascii characters appends "USB" or "LSB" if appropriate and sends the lot to a dot matrix display module (the type that uses a Hitachi HD4780 controller).

The hardware:

My version was assembled on matrix board (the type that has an array of copper donuts on a 0.1 inch grid). The whole circuit plugs onto the back of the LCD module. A longer connecting cable could be used as it carries only "slow" digital signals. Layout isn't too critical and the matrix board version works reliably to just over 40MHz.

Programming the IF offsets:

Two pins on the PIC (pins 12 and 13) select one of 3 IF offsets. Pin 11, when pulled low indicates that the local oscillator is on the high side of the received frequency. And finally, pin 10 when pulsed low, initiates programming of the selected IF offset frequency. While the IF offset is being programmed, the RF input must be connected to the appropriate BFO oscillator.

For normal operation, the RF input is connected the receiver's local oscillator and the PIC uses the stored values of the IF offsets to calculate the received frequency. If neither BFO selection pin is pulled low, the PIC calculates the average BFO frequency and uses this to calculate the received frequency. If no offset is required, just measure and store 0Hz for both offsets (or pull both pins 12 and 13 low to use the third offset).

Getting the software:

The source code for this version is available at FM1_005.asm

Conclusion:

Now you no longer need dials, pulleys, pointers and string to indicate what frequency your favourite receiver or transmitter is almost on. The display module, the PIC16F84 and all other parts can be obtained from Jaycar. Together, they can measure your frequency to a resolution of 10Hz. Accuracy is another matter since the measurement is referenced to a rather crude "on chip" oscillator. I would expect an error of +/- 100Hz. at 30MHz.even when calibrated. An external oscillator could be used to improve accuracy.