Ceska verze

6 digit 10 MHz frequency meter (counter) II.

    This is a very simple frequency meter (counter) with Atmel AVR. It allows to measure frequencies up to 10MHz in 2 automatically selected ranges. It is based on the previous Simplest frequency meter, but it has 6 digits instead of 4. Lower range has a resolution of 1Hz and works up to 1MHz. Higher range has 10Hz resolution and works up to 10MHz A 6-digit LED display is used to display the measured frequency. The frequency meter is based on an Atmel AVR ATtiny2313 or ATTiny2313A microcontroller. The program to download and configuration bits setting you can find below. The microprocessor is clocked at 20MHz from crystal (the maximum allowable frequency). The measurement accuracy is determined by the accuracy of this crystal and C1 and C2 capacitance. Each half period of the measured signal must be greater than the period of the crystal oscillator (restriction of the AVR architecture). At 50% duty cycle you can therefore measure frequencies up to 10 MHz. The measured signal enters pin 9 (T1) - it clocks the timer/counter1 externally. Counting is performed by a 16-bit timer/counter1, its overflow increments an 8-bit register, forming a 24-bit result. Counting takes 1 second. It is then converted to the decadic form and displayed. The frequency is always displayed in kHz. Automatic range selection changes the position of the decimal point. The refresh rate is 1Hz. Cathodes of displays are connected to port B, the anodes to bits 0-4 and 5 of port D. Using superbright displays allows you to omit usual current amplifying transistors. The display is controlled in multiplex way. Frequency of the multiplex is 104.166 Hz. You can make the 6-digit display for example from three 2-digit LD-D028UR-C. Resistors R1 to R8 determine the current into the display and thus its brightness. They are chosen so that the current does not exceed the maximum output current (40 mA) of AVR pins. This frequency counter is powered from a supply of 4.5 to 5.5V. Consumption at 5V is about 15-35 mA, depending on the number of segments lit (most current consumption has the LED display). If the input of the frequency counter is "in free air", it can display meaningless values ​​because of high input impedance. You can prevent this by adding cca 100k resistor between input and GND.
You may also like: 10 MHz frequency meter (counter) III. with 0.000 001 Hz resolution.

Range 1 ... max 999.999 kHz, the resolution to 1Hz.
Range 2 ... max 9999.99 kHz, the resolution to 10Hz.

The program for download:
source code in Assembler (ASM)
compiled in HEX file (492 Bytes)
How to write the program into the AVR is described here.

I can send you the programmed microcontroller. For more info click here.


Schematic of Simple frequency meter (counter) II. up to 10 MHz with 6 digits


Configuration bits setting (in PonyProg).
(Hexadecimal values are Low Fuse: EF, High Fuse: D9.)


Simple frequency meter (counter) up to 10 MHz with 6 digits in operation, tested in breadboard. It shows 8230,43 kHz.


Simple frequency meter (counter) II. up to 10 MHz with 6 digits



Added: 16. 3. 2014
home