基于Protues的单片机定时-计数器应用仿真实验设计(DOC)

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

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

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

资源描述

摘要单片机体积小,功耗小,价格低,用途灵活,无处不在,属于专用计算机。是一种特殊器件,需经过专门学习方能掌握应用,应用中需设计专用的硬件和软件。由于其内部自带两个16位计数器,所以近年来在计数器领域的应用也十分广泛,计数器种类很多,根据构成计数制的不同,可分为二进制计数器和非二进制计数器。根据计数器的增减趋势,又分为加法、减法和可逆计数器。还有可预置数和可编程序功能计数器等等。本设计通过一个由AT89C51单片机控制,结合显示电路、电源电路、LED数码管以及键盘电路等组成的一个简单的秒表系统,对单片机的定时器/计数器的定时和计数原理进行研究。该系统的核心部分是由单片机最小系统构成,在加上一系列外围电路组成。这个多功能秒表系统能够是实现两位LED显示,显示的最大时间为24小时59分钟59秒,每秒自动加1,能正确地进行计时,还具有快加、复位功能。同时还可以当做时钟来使用。通过C语言编写代码并使用Proteus仿真、调试,实现了LED显示屏实时时间显示,按键切换显示内容的显示状态。由于Protues具有很强大的仿真调试功能,使用它可以实现在没有单片机硬件仿真器的情况下仍然可以实现单片机系统的软硬件开发的仿真调试。本系统利用Protues这一功能绘制了LED显示屏原理图、单片机最小系统原理图以及整个完整的秒表系统的工作原理图。向Protues中下载代码,连接调试成功。关键词:单片机秒表protuseABSTRACTMicrocontrollerhasmanyadvantagessuchassmallsize,lowconsumption,lowprices,beusedwidely,andbeusedeverywhereandsoon.Itbelongtotheisinaprivatecomputer.Itisaspecialdevice,afterspecializedlearningyoucanmasterandapplicationit.Intheapplicationwemustbedesignedinadedicatedhardwareandsoftware.Theinteriorcomeswithtwo16-bitcounter,soinrecentyearsitbeusedwidelyinthecounterfield.Therearemanykindsofcounter,Accordingtoconstitutethenotationisdifferent,canbedividedintobinarycounterandthebinarycounter.Accordingtothecounteroftheincreaseanddecreaseofthetrend,anddividedintotheaddition,subtraction,andreversiblecounter.Andpresetnumberandprogrammablefunctioncounterandsoon.ThisdesignthroughtheAT89C51single-chipmicrocomputercontrol,combinedwiththeshowcircuit,thepowersupplycircuit,LEDdigitaltube,andkeyboardcircuitconsistingofasimplestopwatchsystem,thesinglechipmicrocomputertimer/counterofthetimingandcountprincipleforresearch.Thecoreofthesystemisthesmallestpartofmicrocomputersystemstructure,combinedwithaseriesofperipheryofcircuit.Themulti-functionstopwatchsystemcanrealizeistwoLEDdisplay,displaytimefor00-99secondspersecondtobeautomaticadd1,cancorrectlytoadd,subtract(fall)time,alsohasquicklyaddandresetfunction.ThroughtheClanguagewritingcodeanduseProteussimulation,commissioning,realizedtheLEDdisplayreal-timetimetoshow,switchbuttonshowingthecontentsofthedisplaystate.BecauseProtueshasverypowerfulsimulationcommissioningfunction,useitcanrealizeinnomicrocontrollerhardwaresimulationsuppressorcanstillachievetheSCMsystemhardwareandsoftwaredevelopmentofthesimulationtest.ThissystemUSESProtuesthisfunctiontodrawtheLEDdisplayprinciplediagram,singlechipminimizesystemdiagramandthecompleteastopwatchsystemworkprinciplediagram.Protuestodownloadthecode,connectiondebuggingsuccess.Keywords:microcontrollerstopwatchprotuse目录1前言............................................................................................................................12单片机控制电路的设计................................................................................................32.1单片机介绍..................................................................................................................................32.2单片机的特点和结构原理.......................................................................................................42.2.1单片机的特点....................................................................................................42.2.2单片机结构........................................................................................................52.3单片机最小系统电路设计.......................................................................................................73系统外围电路的设计...................................................................................................113.1键盘电路的设计.......................................................................................................................113.1.1按键电路的选择..............................................................................................113.1.2按键电路的故障及解决方法..........................................................................123.2显示电路的设计.....................................................................................................................123.2.1显示电路的介绍..............................................................................................123.2.2LED数码管的工作原理..................................................................................133.3晶振振荡电路的设计..............................................................................................................144系统软件的设计............................................................................................................164.1软件设计概述............................................................................................................................164.2软件设计流程图.......................................................................................................................164.3定时中断服务程序流程图.....................................................................................................174.3.1中断的介绍......................................................................................................174.3.2定时中断的设置..............................................................................................184.3.3定时中断程序..................................................................................................195Protues软件仿

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

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

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

×
保存成功