I基于单片机的数字时钟摘要20世纪末,电子技术获得了飞速的发展,在其推动下,现代电子产品几乎渗透了社会的各个领域,有力地推动了社会生产力的发展和社会信息化程度的提高,同时也使现代电子产品性能进一步提高,产品更新换代的节奏也越来越快。单片机模块中最常见的是数字钟,数字钟是一种用数字电路技术实现时、分、秒计时的装置,与机械式时钟相比具有更高的准确性和直观性,且无机械装置,具有更更长的使用寿命,因此得到了广泛的使用。本课题主要研究的是基于单片机的数字钟设计,采用AT89C51单片机作为系统的主控芯片,外接LED显示电路,按键电路,晶振电路,复位电路模块构成一个简单的数字钟。通过按键电路能对时、分、秒分别进行设置和实时调整,并将结果显示在数码管上。关键词:数字钟,单片机,数码管IIAbstractAuthor:chengdongTutor:wangxinElectronictechnologyhasbeendevelopedrapidlyinthe20century,withitsmodernelectronicproducts,pushedbyalmostpermeatedeveryareaofsocietyhasvigorouslypromotedsocialproductiveforcesdevelopmentandimprovementofsocialinformatizationlevel,alsomakemodernelectronicproductperformancefurtherimproved,andtherhythmofupgradeitsproductsisbecomingmoreandmorequickly.ThemostcommonSCMmoduleisadigitalclock,adigitalclockisakindofdigitalcircuittechnologyimplementation,minutesandseconds,thetimingdevicewithmechanicalclockcomparedwithhigheraccuracyandintuitiveandnomechanicaldevice,hasmorelongerservicelife,soithasbeenwidelyused.ThistopicresearchisthedigitalclockdesignbasedonSCM,AT89C51SCMasthemaincontrolchipsystem,externalLEDdisplaycircuit,keycircuits,crystalscircuit,resetcircuitmoduleconstituteasimpledigitalclock.Throughthekeycircuitscanrespectivelythediffculties,minutesandsecondssettingandreal-timeadjustment,andtheresultshowedthatinthedigitaltube.Keywords:digitalclockSCM;digitalIII目录1引言.....................................................................................................................12单片机介绍...........................................................................................................23数字钟硬件设计...................................................................................................33.1系统方案的确定..................................................................................................................................33.2功能分析...............................................................................................................................................33.3数字钟设计原理...................................................................................................................................33.3.1晶振电路...................................................................................................................................43.3.2复位电路...................................................................................................................................53.3.3数码显示电路...........................................................................................................................64.数字钟的软件设计...............................................................................................74.1程序设计内容.......................................................................................................................................74.2系统设计流程图..................................................................................................................................74.2.1主程序流程...............................................................................................................................74.2.2定时器中断流程.......................................................................................................................84.2.3时间显示流程图.........................................................................................................................95.系统调试.............................................................................................................105.1KeilC51软件环境简介...................................................................................................................105.2Proteus软件环境简介.....................................................................................................................105.3数字钟系统PROTEUS仿真调试结果..............................................................................................11参考文献.................................................................................................................13致谢.........................................................................................................................14附录.........................................................................................................................15元件列表....................................................................................................................................................15源程序........................................................................................................................................................15内蒙古大学鄂尔多斯学院12级电子信息科学与技术学年论文11引言在单片机技术日趋成熟的今天,其灵活的硬件电路和软件电路的设计,让单片机得到广泛的应用,几乎是从小的电子产品,到大的工业控制,单片机都起到了举足轻重的作用。单片机小的系统结构几乎是所有具有可编程硬件的一个缩影,可谓是“麻雀虽小,肝胆俱全”,单片机的学习和研究是对微机系统学习和研究的简捷途径。基于单片机的定时和控制装置在许多行业有着广泛的应用,而数字钟是其中最基本的,也是最具有代表性的一个例子,用数字电路实现对时、分、秒数字显示的计时装置。因为机具有体积小、功耗低、功能强、性价比高、易于推广应用的优点,在自动化装置、智能仪器表、过程控制、通信、家用电器等许多领域得到日益广泛的应用,因此具有很大的研究价值。内蒙古大学鄂尔多斯学院12级电子信息科学与技术学年论文22单片机介绍单片机是一种集成在电路芯片,是采用超大规模集成电路技术把具有数据处理能力的中央处理器CPU、随机存储器RAM、只读存储器ROM、多种I/O口和中断系统、定时器/计时器等功能(可能还包括显示驱动电路、脉宽调制电路、模拟多路转换