单片机数字频率计的设计方案.pdf

上传人:tbuqq 文档编号:4666438 上传时间:2019-11-24 格式:PDF 页数:20 大小:851.53KB
返回 下载 相关 举报
单片机数字频率计的设计方案.pdf_第1页
第1页 / 共20页
亲,该文档总共20页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

《单片机数字频率计的设计方案.pdf》由会员分享,可在线阅读,更多相关《单片机数字频率计的设计方案.pdf(20页珍藏版)》请在三一文库上搜索。

1、I / 20 摘要 在电子技术中,频率是最基本的参数之一,并且与许多电参量的测量方案、测量结果都 有十分密切的关系,因此频率的测量就显得更为重要。测量频率的方法有多种,其中电子 计数器测量频率具有精度高、使用方便、测量迅速,以及便于实现测量过程自动化等优 点,是频率测量的重要手段之一。电子计数器测频有两种方式:一是直接测频法,即在 一定闸门时间内测量被测信号的脉冲个数;二是间接测频法,如周期测频法。直接测频 法适用于高频信号的频率测量,间接测频法适用于低频信号的频率测量。本文阐述了基 于通用集成电路设计了一个简单的数字频率计的过程。 关键词: 频率,信号,周期 Abstract In elec

2、tronic technology,the frequency is the most basic one of the parameters,andwith a number of electrical parameters of the measurement program,measurement more important,There are several ways of mesuring frequency,in which electronic counter the frequency with high precision,easy to use ,quick measur

3、ements,and is easy to realize the advatages of automaion of measurement process is an important means of frequency measurement.Electronic Counter Frequency Measurement There are two ways:First,the directfrequency measurement method,thatis,the gate in a certain period of time measured the number of m

4、easured signal pulse 。2is indirect frequency measurement method,such as cycle frequency measurement method.Direct frequency measurement method for high-frequency signals offrequency measurement,indirect frequency measurement method for low- frequency signald of frequency measurement.In this paper,ba

5、sed on a commom integrated circuit design of a simple digital frequency meter process. Key words :frequency,signal,period II / 20 目录 摘要 一、引言 ,其精度会随着被测信号频率的下降而下降。 三、数字频率计设计 555 的逻辑符号 (b555 的引脚排列 图 4.2 13 / 20 2、施密特触发器 电路如图 4.3 所示,只要将脚2 和 6 连在一起作为信号输入端,即得到施密特触发 器。图 4.4 画出了 Vs、Vi 和 Vo的波形图。 设被整形变换的电压为正弦

6、波Vs,其正半波通过二极管D 同时加到 555 定时器的 2 脚和 6 脚,得到的 Vi 为半波整流波型。当Vi 上升到 2/3Vcc 时,Vo从高电平转换为低电 平;当 Vi 下降到 1/3Vcc 时,Vo又从低电平转换为高电平。 回差电压: VVccVcc=Vcc 图 4.3 555 施密特触发器图 4.4 555 施密特触发器的波形图 五、结束语 unsignedcharcode dispcode10=0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f 。 unsigned char a=0,b=0,c=0,d=0 。 unsigned i

7、nt pinlv=0。 unsigned long int count=0。 void delay( int j。 for(j=0。j。 void display( a=pinlv/1000。 /千位 b=pinlv/100%10。 /百位 c=pinlv%100/10。 /十位 d=pinlv%10。 /个位 P2=0xfe。 P0=dispcodea。 delay(。 P2=0xfd。 P0=dispcodeb。 delay(。 P2=0xfb。 P0=dispcodec。 delay(。 P2=0xf7 。 P0=dispcoded。 delay(。 /*void delay1(n in

8、t i,j 。 17 / 20 for(i=0。i for(j=0。j display(。 */ void main(void EA=0。 TMOD=0x51。 /T0定时 T1计数 TH0=15602/256。/0x3c,T0定时50ms TL0=15602%256。/0x00 T1=1。 ET0=1。 EA=1。 TR1=1。 TR0=1。 while(1 display(。 void time0(void interrupt 1 using 2 ET0=0。 count+。 if(count=20 /T1计数20次 count=0。 TR1=0。 pinlv=TH1*256+TL1 。 TH1=0。 TL1=0。 TR1=1。 TH0=15602/256。/0x3c TL0=15602%256。/ 0x00 TR0=1。 ET0=1。 /T1计数20次时产生中断,定时 1S到

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 其他


经营许可证编号:宁ICP备18001539号-1