Nav:  [home][elec][analysis] > [FreqCnt]
Go:  [FreqCnt] [Device] [Firmware]

Electronics -- Frequency Counter

Overview and Purpose

The device presented here can be used to count events as well as to measure frequencies and times. Most of it is built from discrete HC (high speed CMOS) logic and to be honest, if I needed to build such a device again, I would not build it as presented here but integrate things into a CPLD or a microcontroller instead. However, it was instructive not to do so and maybe it is interesting for other people as well (for what reason ever).


  • Frequency measurement from 0.1Hz to ≥10MHz; gate times of 0.1, 1 and 10 seconds.
  • Time measurement 0.001ms to 10000s (time clock 1MHz and 1kHz): measuring L/H time or 1, 10 or 100 complete pulses or time between input A and B transition.
  • 5-digit LED display with display hold.
  • Microcontroller-steered.
  • CMOS-compatible Schmitt-trigger inputs with over- and under-voltage protection.

Circuit design

The complete circuit design schematics are online but note again that I would not build the device with that amount of discrete logic again.

The circuit is divided into 8 separete module sheets (with the top ones in the list below being more interesting) and one connection diagram on how to put the modules together.

The above schematics are provided here with more or less amount of explanations. (I may add some more text when I get asked questions.)

Note: The schematics above may not reflect minor changes done after PCB creation (although I believe that I integrated or annotated most such changes) and lack some part values which were chosen after design (in this case a broad variety of values is suitable, e.g. for decoupling capacitors).
BTW, there is a decoupling cap between the device's negative supply voltage (GND) and power cable ground which is connected to the back plane. Furthermore, there is a 100k pull-up to pull the Microcontroller reset pin high.

Device design

Testing the frequency counter [13kb]
[click to enlarge: 154kb JPG]

The complete circuit was implemented using self-made PCBs and then built into a hard case with BNC inputs and 230V power supply (trafo supports 115V as well when changing some wires).

The image on the left shows the frequency counter being tested with half-open case. A freqency of about 28kHz is delivered by my small LTC1766-based oscillator which can be seen in front of the frequency counter (with the switch and the large potentiometer feeding the output into a coax cable; BTW, the dark-blue device below is my ICL8038-based oscillator). On the back plane you can see a 9-pin SUB-D connector with a 5-pin flat band cable attached which carries the 3 SPI signals, the reset pin and GND, attached to my Latch16Bit-based Atmel/AVR programmer. BTW, this 9-pin is compatible to the USB-based Atmel/AVR programmer actually built lateron.

There is a more detailed description with more images of the actual device: Read more...

Firmware design

Of course, since this device includes a microcontroller, it was necessary to develop some firmware. Due to the SPI interface (and the "natural" 1MHz system clock) the micorcontroller is easily in-system programmable.

The firmware itself controls core functions of the device. It makes sure that the mode switches from frequency counting to time measurement when I press the "mode up" button, steers the aquisition time for the frequency counter, makes sure the result gets displayed (i.e. flush the display latches on the counter board), and so on...

More information about the firmware is available on the frequency counter firmware page.

[home] [site map] [Impressum] [Datenschutz/privacy policy]
Valid HTML 4.01!
Copyright © 2004-2007 by Wolfgang Wieser
Last modified: 2007-07-18 15:55:31