基于单片机的电子闹钟设计(最终版)谢敏

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

基于单片机的电子闹钟设计作者姓名:谢敏专业名称:通信工程指导教师:赵杰讲师I摘要单片机自20世纪70年代问世以来,以其极高的性能价格比,受到人们的重视和关注,应用很广、发展很快。而51单片机是各单片机中最为典型和最有代表性的一种。本设计以AT89C51芯片为核心,辅以必要的外围电路,设计了一个结构简单,功能齐全的电子时钟,它由5V直流电源供电。在硬件方面,除了CPU外,使用八个七段LED数码管来进行显示,LED采用的是动态扫描显示,使用74LS245芯片进行驱动。通过LED能够较为准确地显示时、分、秒。四个简单的按键实现对时间的调整。软件方面采用C语言编程。整个电子钟系统能完成时间的显示、调时、校时和三组定时闹钟的功能。选用单片机最小系统应用程序,添加比较程序、时间调整程序及蜂鸣程序,通过时间比较程序触发蜂鸣,实现闹钟功能,完成设计所需求的软件环境。介绍并使用Keil单片机模拟调试软件,测试程序的可行性并用Proteus进行仿真。关键词:单片机定时器中断闹钟LEDIIABSTRACTBecauseofitsextremelyhighperformance-priceratio,thesingle-chipcomputer(SCC)hasbeenpaidgreatattentiontoeversinceitcameoutin1970sof20thCentury,andhasgainedanextensiveapplicablefieldandfastdevelopment.AmongallkindsofSCCS,51SCCisthemosttypicalandrepresentativeone.Thisdesign,adoptingAT89C51chipasthecorepartwithsomenecessaryperipheralcircuits,isasimpleelectronicclockwhichuses5VDCasthepowersupply.Inhardwareaspect,besidestheCPU,eightseven-segmentLEDdigi-tubesareusedfordisplay,whichworkinadynamicallyscanningdisplaymodeanddrivenby74SL245chip.TheLEDScanaccuratelyindicatehour、minuteandsecond.Fourbuttonscanbeusedtoadjustthetime.Whileinthesoftwareaspect,theprogramminglanguageisClanguage.Thewholeelectronicclocksystemhasfunctionsoftimedisplay,adjustment、timingandthreegroupsofalarmfunction.ChoosethesmallestSCMsystemapplications,addComparisonprocedures,timetoadjustproceduresandfaintbuzzingprocedures,Throughrelativelyfaintbuzzingtriggerprocedurestoachievealarmclockfunction,Completedthedesignneedsofthesoftwareenvironment.KeilintroducedandtheuseofSCMsoftwaresimulationdebugging,testingthefeasibilityandproteusbysimulation.Keywords:singleslicemachine,infixedtimemachine,breakoff,alarmclock,LEDIII目录摘要......................................................................................................................................................IABSTRACT.................................................................................................................................................II前言......................................................................................................................................................1第1章课题的背景..............................................................................................................................21.1课题的来源..................................................................................................................................21.2课题研究的目的和意义..............................................................................................................21.3应解决的主要问题及达到的技术要求.......................................................................................2第2章方案的选择和论证....................................................................................................................32.1单片机型号的选择......................................................................................................................32.2按键的选择..................................................................................................................................32.3显示器的选择..............................................................................................................................32.4计时部分的选择..........................................................................................................................32.5发音部分的设计..........................................................................................................................42.6显示器驱动电路...........................................................................................错误!未定义书签。2.7电源的选择..................................................................................................................................4第3章数字电子钟的设计原理和方法................................................................................................53.1设计原理......................................................................................................................................53.2硬件电路的设计..........................................................................................................................53.2.1AT89C51单片机简介..........................................................................................................53.2.2键盘电路的设计.................................................................................................................63.2.3段码驱动电路......................................................................................错误!未定义书签。3.2.4蜂鸣器驱动电路.................................................................................................................63.3软件部分的设计..........................................................................................................................93.3.1主程序部分的设计...........................................................................................................93.3.2中断定时器的设置...........................................................................................................113.3.3闹钟子函数..........................................................................................

1 / 32
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功