Frequency Counter
-
Upload
eng-dennis-mwighusa -
Category
Documents
-
view
239 -
download
1
description
Transcript of Frequency Counter
FREQUENCY COUNTER/METERSCHOOL OF ELECTRICAL AND ELECTRONIC ENGINEERINGDEPARTMENT OF SIGNAL AND INFORMATION PROCESSINGEMBEDDED SYSTEM DESIGN PROJECTEng DENNIS MWIGHUSA ( ABSTRACTThe object of this project is to determine and display the frequency of the input power.Thisisdonebyusing8051microcontroller.Thecircuit ofourdesignedfrequencymeter includes 8051 microcontroller, Liquid rystal !isplay"L!#,athode $ay%scilloscope"$%# and &ariable power supply unit. The $% is used to display the frequency wa&eform of the gi&en input power. 'asedon the source code gi&en to the 8051 microcontroller it detects the frequency &alue anddisplays that &aluewiththehelpoftheL!employed. !ependingonthepowersupply the &alue of the frequency on the L! changes. 1(ost frequency counters wor) by using a *counter+ which accumulates the number ofe&ents occurring within a specific period of time. ,fter a preset period "1 second, fore-ample#, the &alue in the counter is transferred to a display and the counter is reset to.ero. /f the e&ent being measured repeats itself with sufficient stability and thefrequencyis considerablylower thanthat of the cloc)oscillator beingused, theresolution of the measurement can be greatly impro&ed by measuring the time requiredfor anentirenumber of cycles, rather thancountingthenumber of entirecyclesobser&ed for a pre0set duration. 1requency counters are commonly used in laboratories,factories, and field en&ironments to pro&ide direct frequency measurements of &ariousde&ices. The most common applications for frequency counters are measurement andcharacteri.ation of oscillator and transmitter frequencies. CONTENTS1. /ntroduction222222222222222222222222222..31.1 Types of frequency meter22222222222222222222.....3 1.4 'loc) !iagram22222222222222222222222...2 54. The 'asic Theory of 1requency ounter2222222222222222....5 4.1 'asic ounter ircuits22222222222222222222....263. 7ardware222222222222222222222222222228 3.1 (icrocontroller2222222222222222222222..2.283.1.1 1eatures2222222222222222222222222..83.1.4 9in diagram22222222222222222222222283.4 ounters222222222222222222222222222....83.3 /:01 9rescaler2222222222222222222222222...;3.5 /:04 9re0amplifier22222222222222222222222....;3.5 'y passing /:04,mplifier22222222222222222222....;3.6 /:04 9olarity >char nB while"1# f T(%!R0-15B intrR1B TL0R0-00B T70R0-00B T$0R1B %or/i001i2281i334f TL1R0-00B 20T71R0-00B T$1R1B while"T11RR0#B T$1R0B T11R0B g 90RTL0B lRTL0B 7RT70B )RlH7B >>7R7e0-f0B lcdcmd"0-0G#B delay"450#B lcdcmd"0-01#B delay"450#B >>lcdcmd"0-06#B >>delay"450#B >>lcdcmd"0-86#B >>delay"450#B lcddata1"E1requecyRE#B delay"100#B lcata/k41>>lcddata"7#B delay"450#B g g &oid lcdcmd"char &alue# f ldata R &alueB rsR0B 21rwR0B enR1B delay"4#B enR0B g >e&oid lcddata"int &alue# f ldataR&alueB rsR1B rwR0B enR1B delay"4#B enR0B ge> &oid delay"int time# f int i,jB for"iR0BiNtimeBiHH# for"jR0BjN145BjHH#B g &oid lcddata"int &alue# f int a*5+,i,sendR0,nR0B for"iR0B&aluehR0BiHH# f sendR&aluei10B &alueR&alueB a*i+RsendB nHHB g 22for"iRn01BiOR0Bi00# f ldataRa*i+H0-30B rsR1B enR1B delay"1#B enR0B g returnB g &oid lcddata1"char ename# f int iB for"iR0Bname*i+hRIj0IBiHH# f 91Rname*i+B rsR1B rwR0B enR1B delay"1#B enR0B g returnB 7.23