PROTEUS仿真软件中英文资料.docx
传统的单片机教学实验中,采用硬件仿真器、实验箱或实验板,需采购大量的、昂贵的硬件设备,而且设备维护工作量也非常大。由于单片机应用技术涉及到数字电子、模拟电子、计算机甚至通信等多学科的知识,实践性又很强,在教学实验过程中必须软件硬件结合,也就是将单片机程序和外围电路相结合,若用实验箱则费用高,又不能充分利用,若用实验板则开发周期长,方案变更困难。利用PrOteUS仿真软件,设计了一个符合这种要求的、纯软件的单片机虚拟实验室系统既可调试单片机程序,也可仿真单片机外围器件的工作情况;既能充分利用学校计算机房现有计算机,减少硬件设备的维护工作量,还可为学生提供丰富的实验内容。本实验系统结合了单片机和外围电路,与实际工程系统非常接近,拉近了单片机学习与就业的距离。1. Proteus软件介绍Proteus是英国Labcenterelectronics公司开发的EDA工具软件。主要由原理布图的方法绘制电路并进行仿真的ISIS和PCB自动布线或人工布线电路仿真的ARES两个程序组成。ProteUS运行于WindowS操作系统上,可以动态实时仿真、分析(SPICE)各种模拟器件和集成器件。针对微处理器及其外围电路,可以直接在基于原理图的虚拟原型上编程,并实现软件代码级的调试,配合其提供的仿真图表或虚拟仪器如示波器、逻辑分析仪等可进行相应的测量与分析。DProteus软件的组成及特点Proteus仿真软件包含两个应用程序,ProteusISIS和ProteusaresPrOteUSISIS是PrOteUS系统的核心,拥有超过8000元件的大型元件库,包含几千个模拟和数字电路中常用的SPiCe模型及各种动态元件,如三极管、555定时器等基本元件,完全适合于仿真模型。同时ISIS也为用户提供了非常友好的作图界面,元件之间的连线方便、灵活、高效率,剪切、移动等操作借助鼠标可简单实现;另外,ISIS还支持层次图设计,支持WMF、BNP、DXF等多种图形输出格式。ProteUS的另外一个应用程序就是PrOteUS81"es,用于直接将ProteUSISIS得到的仿真原理图生成PCB版图。同时PrOteUS还提供了丰富的虚拟工具,如示波器、逻辑分析仪等,用户借助这些虚拟工具可以直接观察电路系统的硬件结果,尽管虚拟仪器的精度有限,但整个操作过程如同利用硬件仿真器和其他测试仪器直接进行硬件开发,还可以根据虚拟仪器的结果直接进行源代码的调试,以上过程不同于纯粹的软件仿真侧重于算法的验证,这种仿真过程是可以给用户带来直接的硬件开发经验。因此用Proteus可以实现单片机及外围电路的仿真非常方便,如单片机软件仿真系统,模拟电路仿真、数字电路仿真、单片机外围电路仿真、RS232动态仿真、I2C调试器、SPI调试器、键盘和LCD系统仿真等。2) PrOteUS的教学辅助意义借助Proteus的对CPU和外围电路强大的仿真能力以及丰富的资源库,可以有效地替代硬件仿真器进行先期的软硬件调试,等到仿真结果基本理想时再进行实际的硬件调试,这样的开发过程不仅高效,而且可以尽可能地减少损失,这对于解决实验室资源紧张的问题是一个很好的思路。对于刚接触单片机的学生来说,拥有一台计算机和一套Proteus软件,就可以很好地开展单片机的入门学习,还可以积累一些实用的硬件开发经验。2. Proteus教学应用实例下面通过声音报警器实例说明如何使用Proteus实现电路的设计与仿真。实例要求电路以AT89C51单片机为核心,实现发出“嘀、嘀、”的声音,嘀声的频率为IkHz,并且实现嘀,然后断,再如此循环下去。1)虚拟电路的建立运行PrOteUS的ISIS程序后,进入该仿真软件的主界面。主界面由菜单栏、工具栏、预览窗口、元件选择按钮、元件列表窗口、原理图绘制窗口和仿真进程控制按钮组成。通过元件选择按钮P命令,在弹出的PiCkDeViCeS窗口中选择电路所需的元件,放置元件并调整其相对位置,对元件参数设置及元器件问连线,完成单片机系统的硬件原理图绘制。微处理器及外围器件的VSS、VDD.VEE不需要连接,默认VSS=0VVDD=5VVEE=-5V、GND=OV,微处理器的时钟电路也不需要给出可直接从引脚引入。2)仿真文件编制添加在软件仿真中,主要采用Keil进行调试与仿真。打开KeiluVision2一Project一Newproject,弹出对话框,选择单片机型号。在Targetl一OptionsforTargetTargetl中进行资源设置。其中要注意的是,在OUtPUt子菜单中要选择CreateHexFile0软件和硬件的结合,就是一个完整的单片机应用系统。在这个过程中只需要将Keil仿真调试过产生的HEX文件,写入Proteus中的MCU芯片中,然后,在ProteUS中点击运行即可实现单片机的软、硬件联合仿真。实验中,先右键单击AT89C51,再左键单击,在弹出的EditCOmPonent对话框中的ProgramFiIe一栏选择仿真文件。3)调试和仿真ProteUS可以仿真运行,也可对单步调试。仿真运行时,可以看到外围电路显示部件状态的变化,可以利用ProteUS提供的观察工具,具体显示某一电路状态的变化。可以通过输入、输出接口电路与实验系统交互操作。单步调试时,可用单步执行、进入子程序、跳出子程序及执行到光标处等命令执行程序,也可以在程序中设置断点,执行到断点处。在调试过程中,随时观察程序的执行情况和单片机的系统资源等,可供调试时分析和查看。ProteUS仿真的优势是在实验系统运行时,可以利用按钮、开关、键盘输入信号和信息,通过发光二极管、数码管、LCD显示器及图形仪表输出信息,实现输入、输出的交互,实时地、直观地了解单片机指令与外围电路的执行结果及运行状态。ProteussimulationsoftwareSCMtraditionalteachingexperiment,usinghardwaresimulation,experimentalmeorexperimentalboard,takesalotofprocurement,expensivehardwaredevices,andequipmentmaintenanceworkloadisalsoverylarge.AsSCMapplicationofelectronictechnologyrelatedtodigital,analogelectronics,computersandevencommunications,andothermulti-disciplinaryknowledge,practicalandhighlyexperimentalintheprocessofteachingsoftwaretohardwareintegration,istheSCMprocessandtheexternalcircuitphaseCombination,iftheexperimentwithmeisthehighcost,andcannotbefullyutilized,iftheboardwillexperimentwithalongdevelopmentcycle,theprogrammechangesdifficult.Proteususeofsimulationsoftware,designedalinewiththerequirementsoftheSCMsoftware-onlyvirtuallaboratorysystemcandebugMCUprocedures,butalsoMCUperipheraldevicesimulationofthework;canlakefulladvantageoftheschoolcomputerroomExistingcomputerhardwareequipmentmaintenancetoreducetheworkload,butalsotoprovidestudentswithrichcontentoftheexperiment.Theexperimentalsystemcombinesthesinglechipandtheexternalcircuit,andtheactualsystemworksveryclose,narrowingtheSCMdistancelearningandemployment.1 .ProteussoftwareintroducedProteusisaBritishLabcenterelectronicsdevelopedbyEDAtools.MainlybytheprinciplesoflayoutandthemethodofdrawingcircuitsimulationoftheISISandPCBautomaticcircuitwiringorwiringoftheARESsimulationofthetwoprocedures.ProteusrunningontheWindowsoperatingsystem,itcanbedynamicreal-timesimulation,analysis(SPICE)varietyofanalogdevicesandintegrateddevices.Forthemicroprocessoranditsperipheralcircuitscanbedirectlybasedontheprincipleofthevirtualprototypeonprogrammingandtoachievetheleveldebuggingsoftwarecode,withitschartsprovidedbythesimulationorvirtualinstrumentssuchasoscilloscopes,logicanalyzer,andsocanmaketheappropriatemeasurementAndanalysis.Proteuscontainstwosimulationsoftwareapplications,ProteusISISandProteusares.ProteusISISProteusistheheartofthesystem,withmorethan8,000componentsofthemajorcomponents,includingthousandsofanaloganddigitalcircuitsusedintheSpicemodelandavarietyofdynamiccomponents,suchasthetransistor,555timer,andotherbasiccomponents,entirelysuitableforSimulationModel.AtthesametimeISISalsoprovidesuserswithaveryfriendlygraphicinterface,theconnectionbetweenthecomponentsconvenient,flexible,efficient,cut,suchasmobileoperatorscanusethemousetoachieveasimpleaddition,ISISalsosupportthelevelofdesignplans,supportWMF,BNP,DXFandothergraphicsoutputformat.ProteusAnotherapplicationistheProteus81"es,fordirectProteUSISISwillbethesimulationschematicgenerationPCBterritory.Proteusatthesametimealsoprovidedawealthofvirtualtools,suchasoscilloscopes,logicanalyzer,userswiththesevirtualtoolsCandirectlyobservetheresultsofthehardwarecircuitry,despitethelimitedaccuracyofthevirtualinstrument,buttheentireoperationprocessastheuseofhardwaresimulationandothertestingequipmentdirectlytohardwaredevelopment,virtualinstrumentcanalsodirecttheoutcomeofthesourcecodefordebugging,theaboveprocessUnlikepuresoftwaresimulationfocusontheverificationalgorithm,thissimulationprocesscanbebroughtdirectlytotheuser,shardwaredevelopmentexperience.SoProteuscanbeachievedusingSCMandexternalcircuitsimulationisveryconvenient,suchastheSCMsoftwaresimulationsystem,theanalogcircuitsimulation,digitalsimulation,SCMexternalcircuitsimulation,RS232dynamicsimulation,I2Cdebugger,SPIdebugger,KeyboardandLCDsystemsimulation,andsoon.2 .ProteusthesignificanceofteachingaidsWithProteusoftheCPUandtheexternalcircuitpowerfulsimulationcapabilitiesandrichresourcebase,canprovideaneffectivereplacementhardwareemulatortoadvancethehardwareandsoftwaredebugging,waituntilthesimulationresultswhenthebasicidealsandtheactualhardwaredebugger,thedevelopmentprocessnotonlyEfficient,butalsotominimizelosses,thislaboratoryresourcestoaddresstheproblemoftensionisagoodidea.TheGangJiechuSCMstudents,withacomputerandasetofProteussoftware,wecandevelopgoodstudySCMentry,butalsoaccumulatedsomeusefulexperienceinhardwaredevelopment.Second,ProteusTeachingGalleryBelowthroughthevoicealarmexampleofhowtousetheProteustoachievecircuitdesignandsimulation.CaseaskedCircuitAT89C51microcontrollerasthecoretoachievea"Di,Di,"thevoiceofthefrequencyofsoundDi1kHz,andachieveDi0.2S,andthenoff0.2S,thenthiscyclecontinue.1) theestablishmentofvirtualcircuitProteusoperationoftheISISprogram,thesimulationsoftwaretoenterthemaininterface.Interfacefromthemainmenubar,toolbar,thepreviewwindow,selectthebuttoncomponents,componentlistwindow,principlemappingprocesswindowandsimulationofcontrolbuttons.Pcomponentsthroughtheselectbuttonorderinthepop-upwindowPickDevicesselectthenecessarycircuitcomponents,placingcomponentsandadjustitsrelativeposition,thecomponentssetofparametersandaskedconnectcomponents,completedtheSCMsystemhardwareprinciplemapping.ThemicroprocessorandperipheraldevicesoftheVSS,VDD,VEEdonotneedtoconnect,bydefaultVSS=0V,VDD=5V,VEE=-5V,GND=0V,themicroprocessorclockcircuitdonotneedtobegivendirectlyfromthepinintroduction.2) AdddocumentationforthesimulationInthesimulationsoftware,usedmainlyKeildebuggingandsimulation.OpenKeiluVision2aProject-Newproject,pop-updialogbox,selecttheMCUmodels.InTargetl-OptionsforTargetTargetlintheresourcesettings.Oneshouldnotethat,inOutputinthesub-menutochooseCreateHexFile.Thecombinationofhardwareandsoftware,MCUisacompleteapplicationsystem.InthisprocesssimplytooKeilsimulationdebugtheHEXfile,writeProteusintheMCUchip,andthenclickontheProteusintherunningtoachievetheSCMsoftwareandhardwarejointsimulation.Experiments,thefirstright-clickAT89C51,thenleft-click,pop-updialogboxintheEditComponentProgramFilecolumnchoicesimulationdocument.3) debuggingandsimulationProteussimulationcanberun,butalsoonsingle-stepdebugging.Simulationrun,youcanseetheexternalcircuitcomponentsshowsthatthestatechange,wecanuseobservationtoolsprovidedbyProteus,aspecificshowcircuitstatuschanges.Caninputandoutputinterfacecircuitinteractionwiththeexperimentalsystem.Single-stepdebugging,availablesingle-step,intotheroutines,routinesandjumpedouttotheimplementationofthecursorandsoorderedtheimplementationofprocedures,canalsobesetupbreakpointintheproceedings,totheimplementationofthebreakpoint.Intheprocessofdebugging,atanytimeobservetheprocessandtheimplementationofSCMsystemresourcesavailablefordebugging,analysisandreview.Proteussimulationintheexperimentaretheadvantagesofthesystemisrunning,youcanusethebutton,switch,keyboardinputandinformation,throughthelight-emittingdiode,LED,LCDmonitorsandgraphicsinstrumentoutput,andinputandoutputofinteractive,real-time,intuitiveSCMunderstandingoftheexternalcircuitcommandandtheresultsoftheimplementationandoperationofstate.