青岛大学本科生毕业论文(设计)1数字电子钟的设计与仿真Digitalelectronicclockdesignandsimulation青岛大学本科生毕业论文(设计)2摘要20世纪末,电子技术获得了飞速的发展,在其推动下,现代电子产品几乎渗透了社会的各个领域,有力地推动了社会生产力的发展和社会信息化程度的提高,同时也使现代电子产品性能进一步提高,产品更新换代的节奏也越来越快。现代生活的人们越来越重视起了时间观念,可以说是时间和金钱划上了等号。对于那些对时间把握非常严格和准确的人或事来说,时间的不准确会带来非常大的麻烦,所以以数码管为显示器的时钟比指针式的时钟表现出了很大的优势。数码管显示的时间简单明了而且读数快、时间准确显示到秒。而机械式的依赖于晶体震荡器,可能会导致误差。数字钟是采用数字电路实现对“时”、“分”、“秒”数字显示的计时装置。数字钟的精度、稳定度远远超过老式机械钟。在这次设计中,我们采用LED数码管显示时、分、秒,以24小时计时方式,根据数码管动态显示原理来进行显示,用12MHz的晶振产生振荡脉冲,定时器计数。在此次设计中,电路具有显示时间的其本功能,还可以实现对时间的调整。数字钟是其小巧,价格低廉,走时精度高,使用方便,功能多,便于集成化而受广大消费的喜爱,因此得到了广泛的使用。关键字:单片机LED显示AbstractAttheendofthetwentiethCentury,electronictechnologyhasobtainedtherapiddevelopment,underitsimpetus,themodernelectronicproductsalmostpermeatedeachdomainsofthesociety,effectivelypromotedthedevelopmentofsocialproductivityandtheimprovementofsocialinformation-baseddegree,butalsomakesthemodernelectronicproductstofurtherimprovetheperformance,productupgradinghasbecomeincreasinglyfastpace.Modernlifeofpeoplemoreandmoreattentiontotheconceptoftime,canbesaidtobethetimeandmoneyisasign.For青岛大学本科生毕业论文(设计)3thosewhoholdverystrictintimeandaccuratelythepersonorthing,timeisnotaccuratewillbringgreattrouble,sodigitaltubedisplaypointerclockthanclockshowedagreatadvantage.Digitaltubedisplaytimeissimpleandfast,accuratetimereadingsshowedtothesecond.Whilemechanicaldependentoncrystaloscillators,mayleadtoerror.Digitalclockisadigitalcircuitimplementationofthewhen,sub,thesecondthefiguresshowthatthetimingdevice.Digitalclockprecision,stability,farmorethantheoldmechanicalclocks.Inthisdesign,weadoptLEDdigitaldisplaytubewhen,minutesandseconds,in24hourstime,accordingtotheprincipleofdynamicdisplayofdigitaltubedisplayisperformed,using12MHzcrystaloscillationpulse,atimercounting.Inthisdesign,thecircuithasthefunctionsoftimedisplay,alsocanrealizetheadjustmentoftime.Digitalclockisitssmallsize,lowprice,highprecisionoftraveltime,convenientuse,multiplefunctions,convenientintegrationandbytheconsumerfavorite,soithasbeenwidelyused.Keywords:singlechipLEDdispla青岛大学本科生毕业论文(设计)4目录第一章绪论.......................................................................................51.1数字电子钟的背景..........................................................................................51.2数字电子钟的意义...........................................................................................51.3数字电子钟的应用..........................................................................................5第二章整体设计方案和主要元器件的选型....................................62.1单片机的选择..................................................................................................62.2单片机的基本结构..........................................................................................8第三章数字钟的硬件设计...............................................................133.1最小系统设计................................................................................................133.2LED显示电路................................................................................................173.3键盘控制电路................................................................................................19第四章数字钟的软件设计.............................................................214.1系统软件设计流程图...................................................................................214.2数字钟的原理图...........................................................................................264.3主程序...........................................................................................................274.4时钟设置子程序...........................................................................................274.5定时器中断子程序.......................................................................................284.6LED显示程序................................................................................................294.7按键控制子程序...........................................................................................31第五章系统仿真............................................................................325.1PROTUES软件介绍........................................................................................325.2电子钟系统PROTUES仿真...........................................................................32第六章调试与功能说明.................................................................346.1硬盘调试.......................................................................................................346.2系统性能测试与功能说明...........................................................................346.3系统时钟误差分析.......................................................................................346.4软件调试问题及解决...................................................................................35结束语...............................................................................................36谢辞...................................................................................................37参考文献...........................................................................................38青岛大学本科生毕业论文(设计)5第一章绪论1.1数字电子钟的背景20世纪末,电子技术获得了飞速的发展,