Frequency Counter and Timer

In counter mode it provides 1Hz resolution up to 100Mhz. In timer mode maximum resolution is 0.0000001 Hz up to 1Hz. Resolution is reduced by one digit for each additional decade. Multiple frequency updates per second by employing a sliding window for calculation.

Parts needed (including extensions):

  • 1 * AVR ATmega8 - micro controller
  • 2 * 74HC93 - high speed cmos 4bit counter
  • 1 * 74HC573 - high speed cmos latch
  • 1 * 74LS47 - open collector bcd to 7 segment decoder
  • 2 * 74LS138 - 3 to 8 multiplexer
  • 1 * 16MHz Crystal Oscillator - or 1 or 4 MHz, see below
  • 8 * BC177 - or any pnp suitable to drive up to 7 LEDs
  • 4 * ODR-204 - (2 digits each) or any 7 segment LEDs with common anode
  • 7 * 1N4001 - or any other diode
  • 8 * 1kOhm 1/4W
  • 8 * 220Ohm 1/4W
  • 4 * 47kOhm 1/4W


This switch interface provides 7(8) additional input bits at the cost of only one Mega8 pin.The inputs are used for mode control switches as followes:

  • IS1: input select (for prescaler compensation)
  • IS2: method select (counter, auto, timer)
  • IS3: display select (frequency or duration)
  • IS4: reserved for future extensions

In case the AVR should be programmable in circuit, a few modifications must be made. In essence all third parties on wires used for programming are isolated using 47k resistors.

The resistors in combination with Mega8 gate capacity create a low pass. This is software compensated using increased settling time for the external counter.


This picture shows the test board with the full counter circuit except the 7 segment LEDs. Those are already mounted and soldered on a separate board. The wires on the top right connect to it. (One connector for digit selection and one for the actual 7 segment code.)

The crystal osciallator in the bottom right corner is for testing circuit and software.

This is the final board that will be put into the device. It has connectors for power, 7 segment code, digit selection, in circuit programming and TTL signal input.

Board size is defined by the case so the BC177s are mounted somewhat tight.

Some precision testing.

3d model of the front panel layout.

Only TTL input at this point but working. The "c" represents the comma in high precision timer mode.


Files found in the downloadable archives below are released under the GNU GPL.


Firmware 0.0.2 Source & Intel Hex

Danielli (Wed, 30 Nov 2011):
Beautiful but where can i find a cao view of the schematic?
Jarod Parker (Thu, 8 Dec 2011):
Sehr schnes Projekt. Allerdings arbeitet es bei mir nicht mit der hex-Dtei. Mu ich den Source-Code komplett bersetzen und womit ? AVR-Studio stolpert ber die Datei iom16.h :(

Gre, Jarod
Micha (Mon, 20 Feb 2012):
I used avra for assembly and sp12 for programming the Atmel. HTH
Olivier (Fri, 20 Feb 2015):
Rolf Brckmann (Sun, 5 Jul 2015):