毕 业 设 计
中文题目 多功能电子秒表设计与制作 英文题目 The design and realization of
multi-functional electronic stopwatch
2011年 5月21日
诚信声明书
毕业设计(论文)诚信声明书
本人郑重声明:在毕业设计(论文)工作中严格遵守学校有关规定,恪守学术规范;我所提交的毕业设计(论文)是本人在 指导教师的指导下独立研究、撰写的成果,设计(论文)中所引用他人的文字、研究成果,均已在设计(论文)中加以说明;在本人的毕业设计(论文)中未剽窃、抄袭他人的学术观点、思想和成果,未篡改实验数据。
本设计(论文)和资料若有不实之处,本人愿承担一切相关责任。
学生签名:
年 月 日
I
摘要
摘 要
本设计的电子秒表系统采用STC-89C52RC单片机为中心器件,利用其定时器/计数器定时和记数的原理,结合显示电路、LED数码管以及外部中断电路来设计计时器和单总线温度计DS1820。另外硬件部分设置了存储和查看按键,可以对秒表上一次计时时间进行保存,供使用者查询。将软、硬件有机地结合起来,使得系统能够实现计时,测温度,存储数据和查看数据,设置超设值。能正确地进行计时,同时能记录3次时间。其中软件系统采用汇编语言编写程序,包括显示程序,定时中断服务,外部中断服务程序,延时程序等,并在WAVE中调试运行,硬件系统利用PROTEUS强大的功能来实现,简单切易于观察,在仿真中就可以观察到实际的工作状态。本设计主要特点功能多并且计时精度达到0.01s,解决了传统的由于计时精度不够造成的误差和不公平性。
关键词: 单片机,秒表,记录
II
Abstract
Abstract
The design of electronic systems using STC-89C52RC stopwatch as the center of the
device microcontroller,its timer / counter timing and counting principles,With display circuit, LED digital tubes, and external interrupt circuit to design a single timer and thermometer DS1820 bus. Another set of hardware store and view buttons, the last time the stopwatch can save time for user queries.The hardware and software organically combine to make the system to achieve timing, measuring temperature, storage of data and view data, set over set value. Can be correctly timed, and can record three hours. One software system written in assembly language programs, including display program, interrupt service, external interrupt, delay procedures, and WAVE in the commissioning, the hardware system used to implement powerful PROTEUS, a simple cut easy to observe, in simulation can be observed in actual working condition. The main features of multi-function design and timing accuracy of 0.01s, to solve the traditional result of a lack of accuracy because of timing errors and unfairness.
Key words: microcontroller, stopwatch, record
III
目录
目 录
1 绪论............................................................................................................................1
1.1 课题背景及目的.............................................................................................................1 1.2 课题研究内容和意义....................................................................................................2 2 概述.................................................................................................... ......................... ...............3
2.1外部中断模块...................................................................................................... ....... ...5
2.2定时器中断模块................................................................................................. ......... ..6
2.3数码管显示模块.................................................................................................. ......... .8
2.4 DS1820 单总线数字温度计................................................................ ...........................9
3 系统的设计与实现..................................................................................................................12
3.1硬件设计与分析.................................................................................................. ..........12
3.11 单片机的选择....................... ....................... ....................... ....................... .........12 3.12 LED显示器接口原理...... .............. ...... .............. ...... .............. ...... .............. .15 3.13 按键输入...... .............. ...... .............. ...... .............. ...... .............. ...... .............. ..19 3.2软件设计与分析.................................................................................................. .......... .20 3.2.1软件设计概述........................................................................................... ...........20 3.2.2程序流程图........................................................................................... ................21 3.2.3子程序模块设计............................................ ............................................ .....22
4 系统测试...................................................................................................................................25
4.1 安装软件.........................................................................................................................25
4.2 原理图.............................................................................................................................. 25 4.3 所需工具及电子元件...................................................................................................27 4.4 焊接....................................................................................................................................27 4.5 软件测试与硬件测试...................................................................................................28
4.5.1软件调试................................ ................................ ................................ .............29 4.5.2硬件调试...................... ....... ...................... ....... ...................... ....... ...................32
4.6系统时钟误差分析.........................................................................................................33 总结与展望............................................................................................................................. ....34
IV