The simplest frequency meter

This is probably the simplest frequency meter built on the ATtiny2313 microcontroller . It allows you to measure frequencies up to 10 MHz in four automatically switched ranges. The smallest range has a resolution of 1 Hz.

Frequency counter specifications

  • Band 1: 9.999 kHz, resolution 1 Hz.
  • Band 2: 99.99 kHz, resolution up to 10 Hz.
  • Band 3: 999.9 kHz, resolution up to 100 Hz.
  • Band 4: 9999 kHz, resolution up to 1 kHz.

Description of the frequency meter on the microcontroller

The Attiny2313 microcontroller operates from an external crystal oscillator with a clock frequency of 20 MHz (this is the maximum allowable frequency). The accuracy of the frequency meter is determined by the accuracy of the quartz. The minimum half-length of the measured signal should be longer than the period of the crystal oscillator (this is due to limitations of the architecture of the ATtiny2313 microcontroller). Therefore, 50 percent of the clock frequency of the generator is 10 MHz (this is the maximum value of the measured frequency).

The simplest frequency meterThe input signal through the resistor R9 is fed to pin 9 of the microcontroller. Counting is done using a 16-bit timer-counter. Overflow increases the 8-bit register by writing to a 24-bit variable. Further, this value is converted to a decimal value and displayed on the LED segments.

All measured frequency values ​​are always displayed in kHz. Automatic range selection changes the position of the decimal point. The data refresh rate is 1 Hz.

A four-digit LED indicator is used to display the measured frequency. The cathodes of the LED indicator are connected to port B, and the anodes to port D. Due to the multiplex mode of displaying information and the Super Bright indicator, there is no need to use key transistors to reduce the load on the ports of the microcontroller.

The multiplex frequency is 156.25 Hz. You can apply the CA56-12SRWA indicator. Resistors R1 … R8 limit the flowing current (it should be no more than 40 mA).

This frequency meter is powered by a stabilized 5V source, built on an integrated regulator 78L05 .

Installing fuses (in PonyProg):

The simplest frequency meter

Frequency meter operation checked in Proteus:

The simplest frequency meter

Download firmware and model in Proteus

Reference:  Link source

Leave a Reply