毕业设计(论文)院校:学院专业:应用电子技术学号:学生姓名:指导老师:年月日单片机电子钟专业:应用电子技术1班级:指导教师:职称:作者:答辩日期:摘要近年来随着计算机在社会领域的渗透和大规模集成电路的发展,单片机的应用正在不断地走向深入,由于它具有功能强,体积小,功耗低,价格便宜,工作可靠,使用方便等特点,因此特别适合于与控制有关的系统,越来越广泛地应用于自动控制,智能化仪器,仪表,数据采集,军工产品以及家用电器等各个领域,单片机往往是作为一个核心部件来使用,在根据具体硬件结构,以及针对具体应用对象特点的软件结合,以作完善。本设计是定时闹钟的设计,由单片机AT89C51芯片和LED数码管为核心,辅以必要的电路,构成的一个单片机电子定时闹钟。电子钟设计可采用单片机来完成。数字电子钟是用数字集成电路构成的,用数码管显示“时”,“分”,“秒”的现代设计装置。若用数字电路完成,所设计的电路相当复杂,大概需要十几块数字集成块,其功能也主要依赖于数字电路的各功能模块的组合来实现,焊接的过程比较复杂,成本也非常高。若用单片机来设计制作完成,由于其功能的实现主要通过软件编程来完成,那么就降低了硬件电路的复杂性,而且其成本也有所降低,所以在该设计中采用单片机利用AT89C51,它是低功耗、高性能的CMOS型8位单片机。AT89C51单片机结合七段显示器设计的简易定时闹铃时钟,可以设置现在的时间及显示闹铃设置时间,若时间到则发出一阵声响,进一步可以扩充控制电器的启停。设计内容包括了秒信号发生器、时间显示电路、按键电路、供电电源以及闹铃指示电路等几部分的设计。采用四个开关来控制定时闹钟的工作状态,分别为:K1、设置时间和闹钟的小时:K2、设置小时以及设置闹钟的开关:K3、设置分钟和闹钟的分钟:K4、设置完成退出。本次做的数字钟是以单片机(AT89C51)为核心,结合相关的元器件,再配以相应的软件,达到制作简易数字钟的目的,其硬件部分难点在于元器件的选择、布局及焊接。2关键字:单片机AT89C51共阳极LED数码管显示器3AbstractInrecentyears,withcomputersintheinfiltrationandthedevelopmentoflarge-scaleintegratedcircuits.SCMapplicationissteadilydeepening,asithasstrongfunction,smallsize,lowpowerdissipation,lowprices,reliable,easytousefeatures,itisparticularlysuitedtoandcontrolofthesystem,increasinglywidelyusedinautomaticcontrol,intelligentinstruments,gauges,dataacquisition,militaryproductsandhouseholdappliances,andotherareas,isoftenmicrocontrollerasacorecomponenttouse,Inlightofspecifichardwarearchitecture,andapplication-specificsoftwarefeaturesobjectcombinetomakeperfect.ThisdesignisthedesignoftimingclockfromthemicrocontrollerAT89C51chipandLEDdigitaltubeasthecore,supplementedbythenecessarycircuitry,consistingofamicrocontrollerelectronictimeclock.MCUclockdesigncanbeusedtocomplete.Digitalelectronicclockiscomposedofdigitalintegratedcircuitsusingdigitaltubedisplaystime,sub,secondsofmoderndesignunit.Ifusingdigitalcircuitstocomplete,thedesignofthecircuitquitecomplextakesabout10afewnumberofManifoldanditsfunctionsaremainlydependentonthedigitalcircuitacombinationofthevariousfunctionalblockstoachievetheweldingprocessisrelativelycomplexandcostisveryhigh.IfdesignedwiththeMCUtocomplete,duetotherealizationofitsfunctionsmainlythroughsoftwareprogrammingtocomplete,thenreducethecomplexityofthehardwarecircuitry,anditscosthasdecreased,sotheuseofthedesignusedinmicrocontrollerAT89C51,itisalow-power,high-performanceCMOS8-bitmicrocontroller.AT89C51microcontrollerwithseven-segmentdisplaydesignedforsimpletimingalarmclock,youcansetthecurrenttimeanddisplaythealarmset-uptime,ifthetimetosoundawhileisissued,andfurthercouldexpandthestart-stopcontrolofelectricalappliances.Designedtoincludeasecondsignalgenerator,thetimedisplaycircuit,keycircuits,powersupplyandthealarminstructioncircuitdesignofseveralparts.Useoffourswitchestocontrolthetimingclockworkingstate,respectively:K1,setthetimeandclockhours:K2,setthehoursandsetthealarmswitch:K3,settheminuteandalarmclockminutes:K4,issettocompletewithdrawal.4ThefiguresdobellonSCM(AT89C51)atthecore,Combinedwiththecomponentsandfactoringinthecorrespondingsoftware,Easytoproducedigitalclockpurposes,aspartofthehardwarecomponentsisadifficultchoice,layoutandwelding.Keywords:SingleChipMicrocomputerAT89C51AtotalofanodeLEDdigitaltubedisplay5目录前言....................................................................................................................................6第一章AT89C51单片机概述.......................................................................................71.1AT89C51单片机的特点.....................................................................................71.2AT89C51单片机的引脚功能...........................................................................7第二章总体方案设计...............................................................................................102.1系统设计...........................................................................................................102.1.1电路组成及工作原理.....................................................................................102.2硬件系统...........................................................................................................102.2.1单片机系统.............................................................................................102.3时钟芯片的选择.................................................................................................113.1输入部分...........................................................................................................133.1.1电源模块.................................................................................................133.3输出部分...........................................................................................................153.3.1显示模块................................................................................................153.3.2LED显示驱动.....................................................................................153.3.3闹铃模块................................................................................................163、LED灯显示模块........................................................................................163.4电路相关参数...............................