Universal frequency meter

This is 7-digit frequency meter measuring frequency from 10 Hz up to 1300 MHz. It is based on ideas of PIC16F84 based frequency meter.
The measuring range is divided into two subranges: 10Hz - 25MHz and 25 MHz - 1300MHz(depending on predivider). The decimal point is after MHz digit, but can be set at any position.

The same hardware can be used as digital scale (software should be addopted).

Hardware is very simple:

It contains:

  • PIC 16F84
  • 74HC137 (BCD -> 1 of 8 decoder)
  • SAB6456 VHF-UHF divider by 256
  • 7-digit calculator display (common cathode),
  • some resistors, capacitors and 2 switching diodes

Note: "Calculator display" means (say) 7 digit LED multiplexed display. Common cathode display is used. Software is written for common cathode. For common anode displays it requires some software and hardware modification (send me message if you need it).

PIC is used as 3 byte counter. If it counts 0.1 s maximum measured frequency is FF FF FF, e. g. 167.77215 MHz (theoretically) - practically 25 - 30 MHz. SAB6456 is used as 1:256 predivider. Its upper limit is 1300MHz.

The device uses internal prescaler of PIC as low byte of counter, TMR0 as middle byte and some register as high byte of counter. The software DOESN'T read anything from any input port. RA4 is used as prescaler input.

Measuring period is 100 000 us (HF) or 256 000 us (VHF and UHF).

The main steps during measuring period:

  1. start measurement,
  2. precode decimal value of digit to segments,
  3. if it's correct digit set decimal point,
  4. output to PortB,
  5. output digit number to PortA,
  6. test TMR0 overflow bite, if YES increase TimerH,
  7. leave digit to light,
  8. increase digit number,
  9. if less than 7 goto 2,
  10. else zero digit number, decrease counter and goto 2,
  11. stop measurement,
  12. test TMR0 overflow bite, if YES increase TimerH,
  13. shift out precounter content,
  14. check signal at RB0 and switch range accordingly,
  15. recode 3-byte value into 7 decimal numbers,
  16. goto 1.

Total timing formula:

Range: predivider: timing formula:
Low frequency - - - N = Fx * 100 000/4
VHF-UHF 256 N = Fx * 256 000/4
VHF-UHF  64 N = Fx *  64 000/4
VHF-UHF 128 N = Fx * 128 000/4

N = T*[7*(36 + 3*T1) + 6 + 3*T2] + 12 + 3*T3 + Z

where:

  • T,T1,T2,T3 - are initial values of timing loops,
  • Z - are additional fine tunig NOPs,
  • Fx - Xtal frequency in MHz.

The values for T,T1,T2,T3 and Z you can easily find using my program.

You can get source code. The source code is same for variants with predivider by 64, 128 or 256 (PCB may be modified, of course).

Some ideas were taken from "Simple low-cost digital frequency meter using a PIC 16C54" (frqmeter.asm) written by James Hutchby, MadLab Ltd. 1996.


This software is free for private usage. It was created for HAM radio community members. Commercial exploatation is allowed only with permission of authors.


Frequency meter schematics:

Shematics

Frequency meter PCB:(54x41 mm)

PCB

Components placement:

Components