文档介绍:贺州学院
学生课程设计
课程名称单片机课程设计
授课学期 2010 学年至 2011 学年
第 2 学期
系部物理与电子信息工程系
专业通信工程
学号
姓名
任课教师
交稿日期
成绩
阅读教师签名
日期
基于单片机数字频率计
摘要
本方案以单片机为核心,被测信号先进入信号放大电路进行放大,再被送到波形整形电路整形为方波。利用单片机的计数器和定时器的功能对被测信号进行计数。编写相应的程序可以使单片机自动调节测量的量程,并把测出的频率数据送到显示电路显示。
本设计以AT89S52单片机为核心,应用单片机的算术运算和控制功能并采用LCD液晶显示屏将所测频率显示出来。系统简单可靠、操作简易,能基本满足一般情况下的需要。既保证了系统的测频精度,又使系统具有较好的实时性。本频率计设计简洁,便于携带,扩展能力强,适用范围广。
关键词:单片机,AT89S52,频率计,LCD液晶显示屏
ABSTRACT
This project is to the Single-Chip-Micro Controller as the measured signal firstly entried into the amplifier circuit to be amplified,then to be sent to waveform plastic circuit to be plasticed as square use of the performance of counter and timer of the Single-Chip-Micro Controller to count the measured corresponding program can make the Single-Chip-Micro Controller automatic adjust the range that send the counted frequency data to the show circuit to show.
This design is to the Single-Chip-Micro Controller of AT89S52 as the the Arithmatic operation and the control function of the Single-Chip-Micro Controller and use the LCD(Liquid crystal display) to show the measured only guaranteed the accuracy of the measured frequency but also make the system have a good real- design of the frequency meter designed simple,easy-take,wide expand ability and widely aplication range.
Key Words: Single-Chip-Micro Controller; AT89S52;frequency meter; LCD(Liquid crystal display)
目录
ABSTRACT 1
1方案设计 3
3
3
3
4
4
2 硬件设计 4
数字频率计的硬件系统框架 4
数字频率的单元电路设计 5
AT89S52芯片介绍 5
频率输入端口 7
时钟电路 7
复位电路 8
液晶屏的显示(LCD1602) 9
电源的输入 9
3 软件设计 10
软件设计规划 10
信号处理 10
定时器/计数器 10
程序流程图设计 11
4 系统测试 12
12
12
测试结果分析 12
5 总结 12
参考文献 13
附录 14
1 前言
用单片机和数字电路设计的频率计以读数直观、数字准确、功耗低、体积小、质量轻、信号稳定的优点,解决了现有技术中各种数字仪表由外加干电池供电,不能连续在电路中工作的问题,被电子工程人员广泛应用,并有着广阔的发展前