This idea started because I did not have enough money to buy the frequency measuring instrument
frequency measuring devices on the market are sold at high prices. This greatly hindered the development of my lab tool. I did have to make some measuring tool yourself to save money. this way I actually get a lot of valuable experience.
in the design of the frequency measurement tool I use microcontroller made by Atmel. I chose Atmega8A because it has the best price. in this project uses seven segments for displaying measurement results information. seven segment display is suitable for displaying the frequency value. I am less interested in using 16x2 LCD display to project the measuring instrument's frequency. I think less suitable for this
The frequency measuring instrument requires two components of the frequency divider. The first will divide the frequency by 8, and the next one so divide the frequency by 16. The total frequency division is 8x16 = 128. first frequency divider component uses LB3500. The next frequency divider using 74HC93. I chose these two components of the frequency divider as widely available in the market at a low price
LB3500 is able to divide the frequency up to 150 MHz. while testing can reach up to 200 MHz. meanwhile 74HC93 capable of dividing a frequency up to 60 MHz. This was deemed sufficient to establish the frequency measuring instrument that I need
LB3500 has impededansi high, so that it can measure the signal with a very small level. This is very advantageous in testing oscillator circuit. for the measurement of the frequency with greater power can be added attenuator. to measure the frequency of the transmitter does not need to be connected directly. simply by bringing the transmitter antenna and frequency measuring devices then it can be measured frequency
schematic without prescaller
in the development of projects involving microcontroller I always use Proteus Software. This is very exciting because a more attractive interface than similar software. without the help of Proteus software development possibilities will require more time. I highly recommend the Proteus software for all of you who want to save time and costs. in the project of making this frequency measuring tools for PCB design also using proteus software. so the simulation schematic and PCB design has been integrated into the software.
PCB Frequency counter
software development:
for software development microcontroller in making this frequency measuring devices I use software BASCOM-AVR. Here I will describe how to develop software for designing frequency measuring devices using BASCOM-AVR.
frequency measurement requires a gate signal at a specific time. in this project I used a 1 second gate signal. to make the signal 1 sec using Basom-AVR can avail the facility of Timer / Counter Atmega8A.
The following code below to create a gate signal 1 sec:
Tim0_isr:
Incr Ctr
If Ctr = 62500 Then
Ctr = 0
Fregword = Counter1
Counter1 = 0
Flong = Nextfregbyte
Nextfregbyte = 0
Rotate Flong , Left , 16
Flong = Flong Or Fregword
End If
return
The above code has included a calculation to obtain the frequency value. text green part is a calculation code
flong is variable frequency yan store values with 32bit wide. the value obtained from two variable frequency fregword and nextfreg. fregword variable takes the value of TCNT1 Register, Nextfreg variable is a variable that holds the artificial abundance of TCNT1. then the two variables are combined into a variable Flong.
flong is a binary variable, to display to go segment must be converted to BCD. to convert binary to BCD then the binary number to be divided by 10, the remainder of the quotient is the value of BCD. quotient in the top 10 again until the result is 0. and can easily be shown to go segment
The following code to convert Binary to BCD:
Fsing = Flong / 10
Dsing = Frac(fsing)
Seg1 = Dsing * 10
Fsing = Fsing / 10
Dsing = Frac(fsing)
Seg2 = Dsing * 10
Fsing = Fsing / 10
Dsing = Frac(fsing)
Seg3 = Dsing * 10
Fsing = Fsing / 10
Dsing = Frac(fsing)
Seg4 = Dsing * 10
Fsing = Fsing / 10
Dsing = Frac(fsing)
Seg5 = Dsing * 10
Fsing = Fsing / 10
Dsing = Frac(fsing)
Seg6 = Dsing * 10
to display the BCD to go segment is an easy matter. to display the BCD to go segment have several ways, among others Multiplex Scanning. as we will use in the manufacture of measuring tools project this frequency.
the following code to display seven segments:
do
Reset PORTC.0
Reset PORTC.1
Reset PORTC.2
Reset PORTC.3
Reset PORTC.4
Reset PORTC.5
Reset PORTC.6
select case digit
case 1:
PORTD=lookup(seg1,7seg)
set PORTC.0
case 2:
PORTD=lookup(seg2,7seg)
set PORTC.1
case 3:
PORTD=lookup(seg3,7seg)
set PORTC.2
case 4:
PORTD=lookup(seg4,7seg)
set PORTC.3
case 5:
PORTD=lookup(seg5,7seg)
set PORTC.4
case 6:
PORTD=lookup(seg6,7seg)
set PORTC.5
end select
incr digit
if digit=7 then
digit=1
end if
''óther code'
''
''
''other code
loop
green colored text is coded to display seven segments. data released to PORTD, headed scanning segments controlled by PORTC. variable seg 1, seg 2, seg3, 4 seg, seg 5, & seg6 is variable storage conversion result Binary to BCD.
to perform scanning of seg 1> seg 2> seg3> seg 4> seg 5> seg6 then the variable Digits in Raise one by one until the value reaches 7 and must be filled 1 again for the next scanning. note the above code.
PORTD=lookup(seg1,7seg) This code will take the pattern of the numbers 0 to 9 are stored in ROM. make your own pattern. This follows the pattern of the numbers 0 to 9 are stored in ROM
7seg:
Data &B10000000
Data &B11011001
Data &B01000100
Data &B01010000
Data &B00011001
Data &B00010010
Data &B00000010
Data &B11011000
Data &B00000000
Data &B00010000