分类号密级______无锡职业技术学院毕业设计说明书题目:基于AT89S52的万年历设计英文题目:ThecalendardesignbasedonAT89S52学生姓名:张炜杰___专业:机电一体化技术_指导教师:曾文萱_职称:讲师__毕业设计说明书提交日期:2012年10月23日地址:控制技术学院目录I目录第一章设计方案论证················································11.1功能要求·····················································11.2方案确定·····················································11.2.1单片机芯片的选择方案和论证·······························11.2.2显示模块选择方案和论证···································21.2.3时钟芯片的选择方案和论证·································21.2.4电路设计最终方案确定·····································2第二章主控制器和外围器件··········································32.1AT89S52单片机················································32.2DS1302时钟芯片···············································32.2.1DS1302芯片介绍···········································32.2.2DS1302的应用·············································62.3数码管LED····················································72.4译码器74HC138················································72.5锁存器74LS244················································7第三章硬件设计····················································83.1电路设计框图·················································83.2系统概述·····················································83.3电源设计·····················································83.4单片机的复位电路·············································83.5单片机系统的晶振电路·········································93.6主电路设计··················································10第四章软件设计···················································124.1主程序设计··················································124.2键盘子程序设计··············································134.3日历时钟子程序设计··········································15目录II4.4显示子程序设计··············································17第五章系统调试···················································185.1软件调试····················································18第六章结论·······················································21致谢······························································22参考文献··························································23附录······························································24毕业设计任务书III毕业设计任务书毕业设计题目基于AT89S52的万年历设计指导教师曾文萱职称讲师专业名称机电一体化技术班级机电20701学生姓名张炜杰学号2060107137设计要求1.完成资料翻译一份(3000字以上)2.完成毕业设计调研报告一份;3.完成万年历硬件电路设计;4.完成相关程序设计;5.完成毕业设计说明书一份;6.完成课题相关图纸。完成毕业设计课题的计划安排序号内容时间安排1查阅相关书籍,完成毕业设计调研报告,熟悉相关软件。2012.09.01-2012.09.082完成系统总体设计2012.09.09-2012.09.123完成硬件系统设计及课题相关图纸的绘制2012.09.13-2012.09.254编写程序并调试通过2012.09.26-2012.10.045采用Protues软件完成万年历控制系统仿真2012.10.05-2012.10.116完成毕业设计说明书2012.10.12-2012.10.207定稿,准备答辩2012.10.21-2012.10.22答辩提交资料外文资料翻译,毕业设计调研报告毕业设计说明书,相关图纸计划答辩时间2012年10月23日无锡职业技术学院控制技术学院2012年9月1日毕业设计调研报告IV毕业设计调研报告在日新月异的21世纪里,家用电子产品得到了迅速发展。许多家电设备都趋于人性化、智能化,这些电器设备大部分都含有CPU控制器或者是单片机。单片机以其高可靠性、高性价比、低电压、低功耗等一系列优点,近几年得到迅猛发展和大范围推广,广泛应用于工业控制系统、通讯设备、日常消费类产品和玩具等。并且已经深入到工业生产的各个环节以及人民生活的各个方面,如车间流水线控制、自动化系统等、智能型家用电器(冰箱、空调、彩电)等。用单片机来控制的小型家电产品具有便携实用,操作简单的特点。时钟,自从它发明的那天起,就成为人类的朋友,但随着时间的推移,科学技术的不断发展,人们对时间计量的精度要求越来越高,应用越来越广。怎样让时钟更好的为人民服务,怎样让我们的老朋友焕发青春呢?这就要求人们不断设计出新型时钟。现今,高精度的计时工具大多数都使用了石英晶体振荡器,由于电子钟,石英表,石英钟都采用了石英技术,因此走时精度高,稳定性好,使用方便,不需要经常调校,数字式电子钟用集成电路计时时,译码代替机械式传动,用LED显示器代替显示器代替指针显示进而显示时间,减小了计时误差,这种表具有时,分,秒显示时间的功能,还可以进行时和分的校对,片选的灵活性好。时钟电路在计算机系统中起着非常重要的作用,是保证系统正常工作的基础。在一个单片机应用系统中,时钟有两方面的含义:一是指为保障系统正常工作的基准振荡定时信号,主要由晶振和外围电路组成,晶振频率的大小决定了单片机系统工作的快慢;二是指系统的标准定时时钟,即定时时间,它通常有两种实现方法:一是用软件实现,即用单片机内部的可编程定时/计数器来实现,但误差很大,主要用在对时间精度要求不高的场合;二是用专门的时钟芯片实现,在对时间精度要求很高的情况下,通常采用这种方法,典型的时钟芯片有:DS1302,DS12887,X1203等都可以满足高精度的要求。本文设计的日历和时钟的显示广泛用于小型智能家用电子产品,如电子钟。利用单片机进行控制,实时时钟芯片DS1302进行记时,外加掉电存储电路和显示电路,可实现时间的调整和显示。电子钟既可广泛应用于家庭,也可应用于银行、邮电、宾馆、医院、学校、企业、商店等相关行业的大厅,以及单位会议室、门卫等场所。因而,此设计具有相当重要的现实意义和实用价值。摘要V摘要本设计是基于51系列的单片机进行的实时日历和时钟显示设计,可以显示年月日时分秒及周信息,具有可调整日期和时间功能。在设计的同时对单片机的理论基础和外围扩展知识进行了比较全面准备。实时日历和时钟显示的设计过程在硬件与软件方面进行同步设计。硬件部分主要由AT89S52单片机,LED显示电路,以及调时按键电路等组成,系统通过LED显示数据,所以具有人性化的操作和直观的显示效果。软件方面主要包括时钟程序、键盘程序,显示程序等。本系统以单片机的汇编语言进行软件设计,为了便于扩展和更改,软件的设计采用模块化结构,使程序设计的逻辑关系更加简洁明了,以便更简单地实现调整时间及日期显示功能。所有程序编写完成后,在wave软件中进行调试,确定没有问题后,在Proteus软件中嵌入单片机内进行仿真。关键词:AT89S52;DS1302;LED摘要VIAbstractThisdesignisbasedon51seriesmonolithicintegratedcircuitsofareal-timecalendarandtheclockshowsthedesign,youcanshowhowandwhenaweek,hasmayadjustthedateandtimefunctions.inthedesignformonolithicintegratedcircuits,andperipheraltoexpandthebasictheoriesofknowledgewasfairlycomprehensivepreparation.Real-timecalendarandtheclockshowsthedesigninhardwareandsoftwaredesignofhardwarethatissynchronized.theleddisplayat89s52monolithicintegratedcircuits,andwhenshouldtheelectricalcircuits,thesystemthroughtheleddisplaydatasobehumanizedoperateandintuitivethateffect.includingthesoftwareapplicationprograms,thekeyboard,theprogram,etc.Thissystemtomonolithicintegratedcircuitsoftheassemblylanguageforeasilydevelopingsoftwaredesign,andchanges,softwaredesigntousemodulardesign,theprogramminglogicalrelationshipwithmoreandmoresoastorealizethetimeanddatedisplaythefunctions.allproceduresinwritingafterwaveofdebuggingthesoftwareandmakenoquestionoftheproteussoftwareembeddedmonolithicintegratedcircuits.KeyWords:AT89S52;DS1302;LED设计方案论证1第