I(2011届)专科毕业设计基于单片机数字秒表设计2011年6月学院(部):电气与信息工程学院专业:电气自动化学生姓名:陈沅班级:电气0632学号00532006指导教师姓名:周玉职称副教授最终评定成绩:II摘要近年来随着科技的飞速发展,单片机的应用正在不断的走向深入。本文阐述了基于单片机的数字电子秒表设计。本设计主要特点是计时精度达到0.001s,解决了传统的由于计时精度不够造成的误差和不公平性,是各种体育竞赛的必备设备之一。另外硬件部分设置了查看按键,可以对秒表上一次计时时间进行保存,供使用者查询。本设计的数字电子秒表系统采用AT89C52单片机为中心器件,利用其定时器/计数器定时和记数的原理,结合显示电路、LED数码管以及外部中断电路来设计计时器。将软、硬件有机地结合起来,使得系统能够实现五位LED显示,显示时间为0~99.999秒,计时精度为0.001秒,能正确地进行计时,同时能记录一次时间,并在下一次计时后对上一次计时时间进行查询。其中软件系统采用汇编语言编写程序,包括显示程序,定时中断服务,外部中断服务程序,延时程序等,并在WAVE中调试运行,硬件系统利用PROTEUS强大的功能来实现,简单切易于观察,在仿真中就可以观察到实际的工作状态。关键字:单片机;数字电子秒表;仿真IIIAbstractWiththerapiddevelopmentofscienceandtechnologyinrecentyears,SCMapplicationsareconstant-depthmanner.Inthispaper,basedonsinglechipdesignofdigitalelectronicstopwatch.Themaincharacteristicsofthisdesigntimingaccuracyof0.001s,tosolvethetraditionalresultofalackaccuracyduetotimingerrorsandunfair,andisavarietyofsportscompetitions,oneoftheessentialequipment.InadditionthehardwarepartofthesetViewbuttononthestopwatchcanbethelasttimetosavetimeforuserqueries.Thedesignofthemulti-functionstopwatchsystemusesSTC89C52microcontrollerasthecentraldevice,anduseitstimer/countertimingandthecountprinciples,combinedwithdisplaycircuit,LEDdigitaltube,aswellastheexternalinterruptcircuittodesignatimer.Thesoftwareandhardwaretogetherorganically,allowingthesystemtoachievetwoLEDdisplayshowsthetimefrom0to99.999seconds,Timingaccuracyof0.001seconds,Beabletocorrectlytimeatthesametimetorecordatime,andthenexttimeafterthelasttimethetimetosearch.automaticallyaddedasecondinwhichsoftwaresystemsusingassemblylanguageprogramming,includingthedisplayprogram,timing,interruptservice,externalinterruptserviceroutine,delayprocedures,keyconsumershakingprocedures,andWAVEinthecommissioning,operation,hardwaresystemusestoachievePROTEUSpowerful,simpleandeasytoobservethecutinthesimulationcanbeobservedontheactualworkingcondition.Keyword:LEDdisplay;High-precisionstopwatch;STC89C52Ⅲ目录绪论............................................................................................................................1第1章硬件设计..................................................................................................41.1总体方案的设计..............................................................................................41.2单片机的选择..................................................................................................51.3显示电路的选择与设计..................................................................................81.4按键电路的选择与设计................................................................................111.5时钟电路的选择与设计................................................................................121.6复位电路的选择与设计................................................................................141.7系统总电路的设计........................................................................................16第2章软件设计..................................................................................................192.1程序设计思想................................................................................................192.2系统资源的分配............................................................................................192.3主程序设计....................................................................................................202.4中断程序设计................................................................................................21第3章数字电子秒表的安装与调试..........................错误!未定义书签。3.1软件的仿真与调试........................................................................................263.2硬件的安装与调试........................................................................................263.3系统程序的烧录............................................................................................273.4数字电子秒表的精度调试............................................................................28结论..........................................................................................................................29致谢..........................................................................................................................30参考文献.....................................................................................................................31附录A资料...........................................................................................................32附录B程序...........................................................................................................37附录C电路原理图...........................................................................................44附录D硬件实物图...........................................................................................45湖南工业大学专科毕业设计(论文)1绪论秒表计时器是电器制造,工业自动化控制、国防、实验室及科研单位理想的计时仪器,它广泛应用于各种继电器、电磁开关,控制器、延时器、定时器等的时间测试。奥运男子百米飞人大战中,牙买加飞人博尔特以9秒69的成绩夺得冠军。而博尔特冲过终点的瞬间,荧屏显示其成绩为9秒68。相差的这个0.01秒,系由电子计时系统确认。奥运会男子100米蝶泳决赛上,美国选手菲尔普斯以50秒58的成绩惊险夺冠,距离“八金梦想”仅一步之遥。塞尔维亚选手查维奇以50.59秒获得银牌,只比菲尔普斯慢0.01秒。这种细微的差距,即使是现场大屏幕用经典超慢镜头回放,也无法分辨。2004年8月28日15点15分,中国选手孟关良/杨文军在雅典奥运会男子500米划艇决赛中,以1分40秒278的成绩获得中国在雅典奥运会的第28金。这是中国皮划艇项目的第一枚奥运金牌,也是