89C51單片機(jī)簡(jiǎn)介-外文原文及譯文_第1頁(yè)
89C51單片機(jī)簡(jiǎn)介-外文原文及譯文_第2頁(yè)
89C51單片機(jī)簡(jiǎn)介-外文原文及譯文_第3頁(yè)
89C51單片機(jī)簡(jiǎn)介-外文原文及譯文_第4頁(yè)
89C51單片機(jī)簡(jiǎn)介-外文原文及譯文_第5頁(yè)
已閱讀5頁(yè),還剩5頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

89C51MicrocontrollerIntroductionMicrocontrollersareusedinamultitudeofcommercialapplicationssuchasmodems,motor-controlsystems,airconditionercontrolsystems,automotiveengineandamongothers.Thehighprocessingspeedandenhancedperipheralsetofthesemicrocontrollersmakethemsuitableforsuchhigh-speedevent-basedapplications.However,thesecriticalapplicationdomainsalsorequirethatthesemicrocontrollersarehighlyreliable.Thehighreliabilityandlowmarketriskscanbeensuredbyarobusttestingprocessandapropertoolsenvironmentforthevalidationofthesemicrocontrollersbothatthecomponentandatthesystemlevel.IntelPlaformEngineeringdepartmentdevelopedanobject-orientedmulti-threadedtestenvironmentforthevalidationofitsAT89C51automotivemicrocontrollers.ThegoalsofthisenvironmentwasnotonlytoprovidearobusttestingenvironmentfortheAT89C51automotivemicrocontrollers,buttodevelopanenvironmentwhichcanbeeasilyextendedandreusedforthevalidationofseveralotherfuturemicrocontrollers.TheenvironmentwasdevelopedinconjunctionwithMicrosoftFoundationClasses(AT89C51).Thepaperdescribesthedesignandmechanismofthistestenvironment,itsinteractionswithvarioushardware/softwareenvironmentalcomponents,andhowtouseAT89C51.Are8-bitmicrocontrollerearlyor4bits.OneofthemostsuccessfulistheINTEL8031,forasimple,reliableandgoodperformancewasalotofpraise.Thendevelopedin8031outofMCS51MCUSystems.SCMsystemsbasedonthissystemuntilnowisstillwidelyused.Withtheincreasedrequirementsofindustrialcontrolfield,begana16-bitmicrocontroller,butnotidealbecausethecosthasnotbeenverywidelyused.After90yearswiththegreatdevelopmentofconsumerelectronics,microcontrollertechnologyhasbeenahugeincrease.WithINTELi960series,especiallythelaterseriesofwidelyusedARM,32-bitmicrocontrollerquicklyreplacehigh-end16-bitMCUstatusandenterthemainstreammarket.Thetraditional8-bitmicrocontrollerperformancehavebeentherapidincreasecapacityincreasecomparedto80thenumberoftimes.Currently,high-end32-bitmicrocontrollerclockedover300MHz,theperformancecatchingthemid-90sdedicatedprocessor,whiletheaveragemodelpricesfalltooneU.S.dollar,themosthigh-endmodelisonly10dollars.ModernSCMsystemsarenolongeronlyinthedevelopmentanduseofbaremetalenvironment,alargenumberofproprietaryembeddedoperatingsystemiswidelyusedinthefullrangeofSCM.Thehandheldcomputersandcellphonesasthecoreprocessingofhigh-endmicrocontrollercanevenuseadedicatedWindowsandLinuxoperatingsystems.SCMreliesontheprogram,andcanbemodified.Throughdifferentprocedurestoachievedifferentfunctions,inparticularspecialuniquefeatures,thisisanotherdevicemucheffortneedstobedone,somearegreateffortsareverydifficulttoachieve.Anotverycomplexfunctionsifthe50'swiththeUnitedStatesdeveloped74series,orthe60'sCD4000seriesofthesepurehardwarebuttoned,thenthecircuitmustbealargePCBboard!ButiftheUnitedStatesifthe70'swithaseriesofsuccessfulSCMmarket,theresultwillbeadrasticchange!Justbecauseyouarepreparedbymicrocomputerprogramscanachievehighintelligence,highefficiencyandhighreliability!Introduction The8-bitAT89C51CHMOSmicrocontrollersaredesignedtohandlehigh-speedcalculationsandfastinput/outputoperations.MCS51microcontrollersaretypicallyusedforhigh-speedeventcontrolsystems.Commercialapplicationsincludemodems,motor-controlsystems,printers,photocopiers,airconditionercontrolsystems,diskdrives,andmedicalinstruments.TheautomotiveindustryuseMCS51microcontrollersinengine-controlsystems,airbags,suspensionsystems,andantilockbrakingsystems(ABS).TheAT89C51isespeciallywellsuitedtoapplicationsthatbenefitfromitsprocessingspeedandenhancedon-chipperipheralfunctionsset,suchasautomotivepower-traincontrol,vehicledynamicsuspension,antilockbraking,andstabilitycontrolapplications.Becauseofthesecriticalapplications,themarketrequiresareliablecost-effectivecontrollerwithalowinterruptlatencyresponse,abilitytoservicethehighnumberoftimeandeventdrivenintegratedperipheralsneededinrealtimeapplications,andaCPUwithaboveaverageprocessingpowerinasinglepackage.Thefinancialandlegalriskofhavingdevicesthatoperateunpredictablyisveryhigh.Onceinthemarket,particularlyinmissioncriticalapplicationssuchasanautopilotoranti-lockbrakingsystem,mistakesarefinanciallyprohibitive.Redesigncostscanrunashighasa$500K,muchmoreifthefixmeansbackannotatingitacrossaproductfamilythatsharethesamecoreand/orperipheraldesignflaw.Inaddition,fieldreplacementsofcomponentsisextremelyexpensive,asthedevicesaretypicallysealedinmoduleswithatotalvalueseveraltimesthatofthecomponent.Tomitigatetheseproblems,itisessentialthatcomprehensivetestingofthecontrollersbecarriedoutatboththecomponentlevelandsystemlevelunderworstcaseenvironmentalandvoltageconditions.Thiscompleteandthoroughvalidationnecessitatesnotonlyawell-definedprocessbutalsoaproperenvironmentandtoolstofacilitateandexecutethemissionsuccessfully.IntelChandlerPlatformEngineeringgroupprovidespostsiliconsystemvalidation(SV)ofvariousmicro-controllersandprocessors.Thesystemvalidationprocesscanbebrokenintothreemajorparts.Thetypeofthedeviceanditsapplicationrequirementsdeterminewhichtypesoftestingareperformedonthedevice.TheAT89C51providesthefollowingstandardfeatures:4KbytesofFlash,128bytesofRAM,32I/Olines,two16-bittimer/counters,afivevectortwo-levelinterruptarchitecture,afulldupleser-ialport,on-chiposcillatorandclockcircuitry.Inaddition,theAT89C51isdesignedwithstaticlogicforoperationdowntozerofrequencyandsupportstwosoftwareselectablepowersavingmodes.TheIdleModestopstheCPUwhileallowingtheRAM,timer/counters,serialportandinterruptsys-temtocontinuefunctioning.ThePower-downModesavestheRAMcontentsbutfreezestheoscil-latordisablingallotherchipfunctionsuntilthenexthardwarereset.PinDescriptionVCCSupplyvoltage.GNDGround.Port0Port0isan8-bitopen-drainbi-directionalI/Oport.Asanoutputport,eachpincansinkeightTTLinputs.When1sarewrittentoport0pins,thepinscanbeusedashighimpedanceinputs.Port0mayalsobeconfiguredtobethemultiplexedloworderaddress/databusduringaccessestoexternalprogramanddatamemory.InthismodeP0hasinternalpullups.Port0alsoreceivesthecodebytesduringFlashprogramming,andoutputsthecodebytesduringprogramverification.Externalpullupsarerequiredduringprogramverification.Port1Port1isan8-bitbi-directionalI/Oportwithinternalpullups.ThePort1outputbufferscansink/so-urcefourTTLinputs.When1sarewrittentoPort1pinstheyarepulledhighbytheinternalpullupsandcanbeusedasinputs.Asinputs,Port1pinsthatareexternallybeingpulledlowwillsourcecurrent(IIL)becauseoftheinternalpullups.Port1alsoreceivesthelow-orderaddressbytesduringFlashprogrammingandverification.Port2Port2isan8-bitbi-directionalI/Oportwithinternalpullups.ThePort2outputbufferscansink/sourcefourTTLinputs.When1sarewrittentoPort2pinstheyarepulledhighbytheinternalpullupsandcanbeusedasinputs.Asinputs,Port2pinsthatareexternallybeingpulledlowwillsourcecurrent(IIL)becauseoftheinternalpullups.Port2emitsthehigh-orderaddressbyteduringfetchesfromexternalprogrammemoryandduringaccessestoPort2pinsthatareexternallybeingpulledlowwillsourcecurrent(IIL)becauseoftheinternalpullups.Port2emitsthehigh-orderaddressbyteduringfetchesfromexternalprogrammemoryandduringaccessestoexternaldatamemorythatuse16-bitaddresses(MOVX@DPTR).Inthisapplication,itusesstronginternalpull-upswhenemitting1s.Duringaccessestoexternaldatamemorythatuse8-bitaddresses(MOVX@RI),Port2emitsthecontentsoftheP2SpecialFunctionRegister.Port2alsoreceivesthehigh-orderaddressbitsandsomecontrolsignalsdurinFlashprogrammingandverification.Port3Port3isan8-bitbi-directionalI/Oportwithinternalpullups.ThePort3outputbufferscansink/sou-rcefourTTLinputs.When1sarewrittentoPort3pinstheyarepulledhighbytheinternalpullupsandcanbeusedasinputs.Asinputs,Port3pinsthatareexternallybeingpulledlowwillsourcecurrent(IIL)becauseofthepullups.RSTResetinput.Ahighonthispinfortwomachinecycleswhiletheoscillatorisrunningresetsthedevice.ALE/PROGAddressLatchEnableoutputpulseforlatchingthelowbyteoftheaddressduringaccessestoexternalmemory.Thispinisalsotheprogrampulseinput(PROG)duringFlashprogramming.InnormaloperationALEisemittedataconstantrateof1/6theoscillatorfrequency,andmaybeusedforexternaltimingorclockingpurposes.Note,however,thatoneALEpulseisskippedduri-ngeachaccesstoexternalDataMemory.Ifdesired,ALEoperationcanbedisabledbysettingbit0ofSFRlocation8EH.Withthebitset,ALEisactiveonlyduringaMOVXorMOVCinstruction.Otherwise,thepinisweaklypulledhigh.SettingtheALE-disablebithasnoeffectifthemicrocontrollerisinexternalexecutionmode.PSENProgramStoreEnableisthereadstrobetoexternalprogrammemory.WhentheAT89C51isexecutingcodefromexternalprogrammemory,PSENisactivatedtwiceeachmachinecycle,exceptthattwoPSENactivationsareskippedduringeachaccesstoexternaldatamemory.EA/VPPExternalAccessEnable.EAmustbestrappedtoGNDinordertoenablethedevicetofetchcodefromexternalprogrammemorylocationsstartingat0000HuptoFFFFH.Note,however,thatiflockbit1isprogrammed,EAwillbeinternallylatchedonreset.EAshouldbestrappedtoVCCforinternalprogramexecutions.Thispinalsoreceivesthe12-voltprogrammingenablevoltage(VPP)duringFlashprogramming,forpartsthatrequire12-voltVPP.TheAT89C51codememoryarrayisprogrammedbyte-bybyteineitherprogrammingmode.Toprogramanynonblankbyteintheon-chipFlashMemory,theentirememorymustbeerasedusingtheChipEraseMode.DataPolling:TheAT89C51featuresDataPollingtoindicatetheendofawritecycle.Duringawritecycle,anattemptedreadofthelastbytewrittenwillresultinthecomplementofthewrittendatumonPO.7.Oncethewritecyclehasbeencompleted,truedataarevalidonalloutputs,andthenextcyclemaybegin.DataPollingmaybeginanytimeafterawritecyclehasbeeninitiated.Ready/Busy:TheprogressofbyteprogrammingcanalsobemonitoredbytheRDY/BSYoutputsignal.P3.4ispulledlowafterALEgoeshighduringprogrammingtoindicateBUSY.P3.4ispulledhighagainwhenprogrammingisdonetoindicateREADY.ProgramVerify:IflockbitsLB1andLB2havenotbeenprogrammed,theprogrammedcodedatacanbereadbackviatheaddressanddatalinesforverification.Thelockbitscannotbeverifieddirectly.Verificationofthelockbitsisachievedbyobservingthattheirfeaturesareenabled.Amicrocomputerinterfaceconvertsinformationbetweentwoforms.Outsidethemicrocomputertheinformationhandledbyanelectronicsystemexistsasaphysicalsignal,butwithintheprogram,itisrepresentednumerically.Thefunctionofanyinterfacecanbebrokendownintoanumberofoperationswhichmodifythedatainsomeway,sothattheprocessofconversionbetweentheexternalandinternalformsiscarriedoutinanumberofsteps.Ananalog-to-digitalconverter(ADC)isusedtoconvertacontinuouslyvariablesignaltoacorrespondingdigitalformwhichcantakeanyoneofafixednumberofpossiblebinaryvalues.Iftheoutputofthetransducerdoesnotvarycontinuously,noADCisnecessary.Inthiscasethesignalconditioningsectionmustconverttheincomingsignaltoaformwhichcanbeconnecteddirectlytothenextpartoftheinterface,theinput/outputsectionofthemicrocomputeritself.Outputinterfacestakeasimilarform,theobviousdifferencebeingthatheretheflowofinformationisintheoppositedirection;itispassedfromtheprogramtotheoutsideworld.Inthiscasetheprogrammaycallanoutputsubroutinewhichsupervisestheoperationoftheinterfaceandperformsthescalingnumberswhichmaybeneededforadigital-to-analogconverter(DAC).Thissubroutinepassesinformationinturntoanoutputdevicewhichproducesacorrespondingelectricalsignal,whichcouldbeconvertedintoanalogformusingaDAC.Finallythesignalisconditioned(usuallyamplified)toaformsuitableforoperatinganactuator.Thesignalsusedwithinmicrocomputercircuitsarealmostalwaystoosmalltobeconnecteddirectlytothe“outsideworld”andsomekindofinterfacemustbeusedtotranslatethemtoamoreappropriateform.Thedesignofsectionofinterfacecircuitsisoneofthemostimportanttasksfacingtheengineerwishingtoapplymicrocomputers.Wehaveseenthatinmicrocomputersinformationisrepresentedasdiscretepatternsofbits;thisdigitalformismostusefulwhenthemicrocomputeristobeconnectedtoequipmentwhichcanonlybeswitchedonoroff,whereeachbitmightrepresentthestateofaswitchoractuator.Tosolvereal-worldproblems,amicrocontrollermusthavemorethanjustaCPU,aprogram,andadatamemory.Inaddition,itmustcontainhardwareallowingtheCPUtoaccessinformationfromtheoutsideworld.OncetheCPUgathersinformationandprocessesthedata,itmustalsobeabletoeffectchangeonsomeportionoftheoutsideworld.Thesehardwaredevices,calledperipherals,aretheCPU’swindowtotheoutside.ThemostbasicformofperipheralavailableonmicrocontrollersisthegeneralpurposeI70port.EachoftheI/Opinscanbeusedaseitheraninputoranoutput.Thefunctionofeachpinisdeterminedbysettingorclearingcorrespondingbitsinacorrespondingdatadirectionregisterduringtheinitializationstageofaprogram.EachoutputpinmaybedriventoeitheralogiconeoralogiczerobyusingCPUinstructionstopinmaybeviewed(orread.)bytheCPUusingprograminstructions.SometypeofserialunitisincludedonmicrocontrollerstoallowtheCPUtocommunicatebit-seriallywithexternaldevices.Usingabitserialformatinsteadofbit-parallelformatrequiresfewerI/Opinstoperformthecommunicationfunction,whichmakesitlessexpensive,butslower.Serialtransmissionsareperformedeithersynchronouslyorasynchronously.Itsapplications

SCMiswidelyusedininstrumentsandmeters,householdappliances,medicalequipment,aerospace,specializedequipment,intelligentmanagementandprocesscontrolfields,roughlydividedintothefollowingseveralareas:

SCMhasasmallsize,lowpowerconsumption,controllingfunction,expansionflexibility,theadvantagesofminiaturizationandeaseofuse,widelyusedinstrument,combiningdifferenttypesofsensorscanberealized,suchasvoltage,power,frequency,humidity,temperature,flow,speed,thickness,angle,length,hardness,elemental,physicalpressuremeasurement.SCMmakesuseofdigitalinstruments,intelligence,miniaturization,andfunctionalitythantheuseofmorepowerfulelectronicordigitalcircuits.Suchasprecisionmeasuringequipment(powermeter,oscilloscope,variousanalyticalinstrument).89C51單片機(jī)簡(jiǎn)介單片機(jī)廣泛應(yīng)用于各個(gè)商業(yè)領(lǐng)域,比如:調(diào)制解調(diào)器,電動(dòng)機(jī)控制系統(tǒng),空調(diào)控制系統(tǒng),汽車(chē)發(fā)動(dòng)機(jī)和其他一些領(lǐng)域。這些單片機(jī)的高速處理速度和增強(qiáng)型外圍設(shè)備集合使得它們適合于這種高速事件應(yīng)用場(chǎng)合。然而,這些關(guān)鍵應(yīng)用領(lǐng)域?qū)@些單片機(jī)有高度可靠的要求。健壯的測(cè)試環(huán)境和用于驗(yàn)證這些無(wú)論在元部件層次還是系統(tǒng)級(jí)別的單片機(jī)的合適的工具環(huán)境保證了高可靠性和低市場(chǎng)風(fēng)險(xiǎn)。Intel平臺(tái)工程部門(mén)開(kāi)發(fā)了一種面向?qū)ο蟮挠糜隍?yàn)證它的AT89C51汽車(chē)單片機(jī)多線性測(cè)試環(huán)境。這種環(huán)境的目標(biāo)不僅是為AT89C51汽車(chē)單片機(jī)提供一種健壯測(cè)試環(huán)境,而且開(kāi)發(fā)一種能夠容易擴(kuò)展并重復(fù)用來(lái)驗(yàn)證其他幾種將來(lái)的單片機(jī)。開(kāi)發(fā)的這種環(huán)境連接了AT89C51。本文討論了這種測(cè)試環(huán)境的設(shè)計(jì)和原理,它的和各種硬件、軟件環(huán)境部件的交互性,以及如何使用AT89C51。早期的單片機(jī)都是8位或4位的。其中最成功的是INTEL的8031,因?yàn)楹?jiǎn)單可靠而性能不錯(cuò)獲得了很大的好評(píng)。此后在8031上發(fā)展出了MCS51系列單片機(jī)系統(tǒng)?;谶@一系統(tǒng)的單片機(jī)系統(tǒng)直到現(xiàn)在還在廣泛使用。隨著工業(yè)控制領(lǐng)域要求的提高,開(kāi)始出現(xiàn)了16位單片機(jī),但因?yàn)樾詢r(jià)比不理想并未得到很廣泛的應(yīng)用。90年代后隨著消費(fèi)電子產(chǎn)品大發(fā)展,單片機(jī)技術(shù)得到了巨大的提高。隨著INTELi960系列特別是后來(lái)的ARM系列的廣泛應(yīng)用,32位單片機(jī)迅速取代16位單片機(jī)的高端地位,并且進(jìn)入主流市場(chǎng)。而傳統(tǒng)的8位單片機(jī)的性能也得到了飛速提高,處理能力比起80年代提高了數(shù)百倍。目前,高端的32位單片機(jī)主頻已經(jīng)超過(guò)300MHz,性能直追90年代中期的專用處理器,而普通的型號(hào)出廠價(jià)格跌落至1美元,最高端的型號(hào)也只有10美元。當(dāng)代單片機(jī)系統(tǒng)已經(jīng)不再只在裸機(jī)環(huán)境下開(kāi)發(fā)和使用,大量專用的嵌入式操作系統(tǒng)被廣泛應(yīng)用在全系列的單片機(jī)上。而在作為掌上電腦和手機(jī)核心處理的高端單片機(jī)甚至可以直接使用專用的Windows和Linux操作系統(tǒng)。單片機(jī)是靠程序的,并且可以修改。通過(guò)不同的程序?qū)崿F(xiàn)不同的功能,尤其是特殊的獨(dú)特的一些功能,這是別的器件需要費(fèi)很大力氣才能做到的,有些則是花大力氣也很難做到的。一個(gè)不是很復(fù)雜的功能要是用美國(guó)50年代開(kāi)發(fā)的74系列,或者60年代的CD4000系列這些純硬件來(lái)搞定的話,電路一定是一塊大PCB板!但是如果要是用美國(guó)70年代成功投放市場(chǎng)的系列單片機(jī),結(jié)果就會(huì)有天壤之別!只因?yàn)閱纹瑱C(jī)的通過(guò)你編寫(xiě)的程序可以實(shí)現(xiàn)高智能,高效率,以及高可靠性!介紹8位AT89C51CHMOS工藝單片機(jī)被設(shè)計(jì)用于處理高速計(jì)算和快速輸入/輸出。MCS51單片機(jī)典型的應(yīng)用是高速事件控制系統(tǒng)。商業(yè)應(yīng)用包括調(diào)制解調(diào)器,電動(dòng)機(jī)控制系統(tǒng),打印機(jī),影印機(jī),空調(diào)控制系統(tǒng),磁盤(pán)驅(qū)動(dòng)器和醫(yī)療設(shè)備。汽車(chē)工業(yè)把MCS51單片機(jī)用于發(fā)動(dòng)機(jī)控制系統(tǒng),懸掛系統(tǒng)和反鎖制動(dòng)系統(tǒng)。AT89C51尤其很好適用于得益于它的處理速度和增強(qiáng)型片上外圍功能集,諸如:汽車(chē)動(dòng)力控制,車(chē)輛動(dòng)態(tài)懸掛,反鎖制動(dòng)和穩(wěn)定性控制應(yīng)用。由于這些決定性應(yīng)用,市場(chǎng)需要一種可靠的具有低干擾潛伏響應(yīng)的費(fèi)用-效能控制器,服務(wù)大量時(shí)間和事件驅(qū)動(dòng)的在實(shí)時(shí)應(yīng)用需要的集成外圍的能力,具有在單一程序包中高出平均處理功率的中央處理器。擁有操作不可預(yù)測(cè)的設(shè)備的經(jīng)濟(jì)和法律風(fēng)險(xiǎn)是很高的。一旦進(jìn)入市場(chǎng),尤其任務(wù)決定性應(yīng)用諸如自動(dòng)駕駛儀或反鎖制動(dòng)系統(tǒng),錯(cuò)誤將是財(cái)力上所禁止的。重新設(shè)計(jì)的費(fèi)用可以高達(dá)500K美元,如果產(chǎn)品族享有同樣內(nèi)核或外圍設(shè)計(jì)缺陷的話,費(fèi)用會(huì)更高。另外,部件的替代品領(lǐng)域是極其昂貴的,因?yàn)樵O(shè)備要用來(lái)把模塊典型地焊接成一個(gè)總體的價(jià)值比各個(gè)部件高幾倍。為了緩和這些問(wèn)題,在最壞的環(huán)境和電壓條件下對(duì)這些單片機(jī)進(jìn)行無(wú)論在部件級(jí)別還是系統(tǒng)級(jí)別上的綜合測(cè)試是必需的。IntelChandler平臺(tái)工程組提供了各種單片機(jī)和處理器的系統(tǒng)驗(yàn)證。這種系統(tǒng)的驗(yàn)證處理可以被分解為三個(gè)主要部分。系統(tǒng)的類型和應(yīng)用需求決定了能夠在設(shè)備上執(zhí)行的測(cè)試類型。AT89C51提供以下標(biāo)準(zhǔn)功能:4k字節(jié)FLASH閃速存儲(chǔ)器,128字節(jié)內(nèi)部RAM,32個(gè)I/O口線,2個(gè)16位定時(shí)/計(jì)數(shù)器,一個(gè)5向量?jī)杉?jí)中斷結(jié)構(gòu),一個(gè)全雙工串行通信口,片內(nèi)振蕩器及時(shí)鐘電路。同時(shí),AT89C51降至0Hz的靜態(tài)邏輯操作,并支持兩種可選的節(jié)電工作模式。空閑方式體制CPU的工作,但允許RAM,定時(shí)/計(jì)數(shù)器,串行通信口及中斷系統(tǒng)繼續(xù)工作。掉電方式保存RAM中的內(nèi)容,但振蕩器體制工作并禁止其他所有不見(jiàn)工作直到下一個(gè)硬件復(fù)位。引腳功能說(shuō)明·Vcc:電源電壓·GND:地·P0口:P0口是一組8位漏極開(kāi)路型雙向I/O口,也即地址/數(shù)據(jù)總線復(fù)用。作為輸出口用時(shí),每位能吸收電流的方式驅(qū)動(dòng)8個(gè)TTL邏輯門(mén)電路,對(duì)端口寫(xiě)“1”可作為高阻抗輸入端用。在訪問(wèn)外部數(shù)據(jù)存儲(chǔ)器或程序存儲(chǔ)器時(shí),這組口線分時(shí)轉(zhuǎn)換地址(低8位)和數(shù)據(jù)總線復(fù)用,在訪問(wèn)期間激活內(nèi)部上拉電阻。在Flash編程時(shí),P0口接受指令字節(jié),而在程序校驗(yàn)時(shí),輸出指令字節(jié),校驗(yàn)時(shí),要求外接上拉電阻。·P1口:P1是一個(gè)帶內(nèi)部上拉電阻的8位雙向I/O口,P1的輸出緩沖級(jí)可驅(qū)動(dòng)(吸收或輸出電流)4個(gè)TTL邏輯門(mén)電路。對(duì)端口寫(xiě)“1”,通過(guò)內(nèi)部的上拉電阻把端口拉到高電平,此時(shí)可作輸入口。作為輸入口使用時(shí),因?yàn)閮?nèi)部存在上拉電阻,某個(gè)引腳被外部信號(hào)拉低時(shí)會(huì)輸出一個(gè)電流(IIL)。Flash編程和程序校驗(yàn)期間,P1接受低8位地址?!2口:P2是一個(gè)帶有內(nèi)部上拉電阻的8位雙向I/O口,P2的輸出緩沖級(jí)可驅(qū)動(dòng)(吸收或輸出電流)4個(gè)TTL邏輯門(mén)電路。對(duì)端口寫(xiě)“1”,通過(guò)內(nèi)部的上拉電阻把端口拉到高電平,此時(shí)可作輸入口。作為輸入口使用時(shí),因?yàn)閮?nèi)部存在上拉電阻,某個(gè)引腳被外部信號(hào)拉低時(shí)會(huì)輸出一個(gè)電流(IIL)。在訪問(wèn)外部程序存儲(chǔ)器或16位四肢的外部數(shù)據(jù)存儲(chǔ)器(例如執(zhí)行MOVX@DPTR指令)時(shí),P2口送出高8位地址數(shù)據(jù),在訪問(wèn)8位地址的外部數(shù)據(jù)存儲(chǔ)器(例如執(zhí)行MOVX@RI指令)時(shí),P2口線上的內(nèi)容(也即特殊功能寄存器(SFR)區(qū)中R2寄存器的內(nèi)容),在整個(gè)訪問(wèn)期間不改變。Flash編程和程序校驗(yàn)時(shí),P2也接收高位地址和其他控制信號(hào)?!3口:P3是一個(gè)帶有內(nèi)部上拉電阻的8位雙向I/O口,P3的輸出緩沖級(jí)可驅(qū)動(dòng)(吸收或輸出電流)4個(gè)TTL邏輯門(mén)電路。對(duì)端口寫(xiě)“1”,通過(guò)內(nèi)部的上拉電阻把端口拉到高電平,此時(shí)可作輸入口。作為輸入口使用時(shí),因?yàn)閮?nèi)部存在上拉電阻,某個(gè)引腳被外部信號(hào)拉低時(shí)會(huì)輸出一個(gè)電流(IIL)?!ST:復(fù)位輸入。當(dāng)振蕩器工作時(shí),RST引腳出現(xiàn)兩個(gè)機(jī)器周期以上高電平將使單片機(jī)復(fù)位?!LE/PROG:當(dāng)訪問(wèn)外部程序存儲(chǔ)器或數(shù)據(jù)存儲(chǔ)器時(shí),ALE(地址鎖存允許)輸出脈沖用于鎖存地址的低8位字節(jié)。即使不訪問(wèn)外部存儲(chǔ)器,ALE仍以時(shí)鐘振蕩頻率的1/6輸出固定的正脈沖信號(hào),因此它可對(duì)外輸出時(shí)鐘或用于定時(shí)目的。要注意的是,每當(dāng)訪問(wèn)外部數(shù)據(jù)存儲(chǔ)器時(shí)將跳過(guò)一個(gè)ALE脈沖。對(duì)Flash存儲(chǔ)器編程期間,該引腳還用于輸入編程脈沖(PROG)。如有必要,可通過(guò)對(duì)特殊功能寄存器(SFR)區(qū)中的8EH單元D0位置位,可禁止ALE操作。該位置位后,只有一條MOVX和MOVC指令A(yù)LE才會(huì)被激活。此外,該引腳會(huì)被微弱拉高,單片機(jī)執(zhí)行外部程序時(shí),應(yīng)設(shè)置ALE無(wú)效?!SEN:程序存儲(chǔ)允許輸出是外部程序存儲(chǔ)器的讀選通型號(hào),當(dāng)89C51由外部存儲(chǔ)器取指令(或數(shù)據(jù))時(shí),每個(gè)機(jī)器周期兩次PSEN有效,即輸出兩個(gè)脈沖。在此期間,當(dāng)訪問(wèn)外部數(shù)據(jù)存儲(chǔ)器,這兩次有效的PSEN信號(hào)不出現(xiàn)?!A/VPP:外部訪問(wèn)允許。欲使CPU僅訪問(wèn)外部程序存儲(chǔ)器(地址為0000H—FFFFH),EA端必須保持低電平(接地)。需注意的是:如果加密位LB1被編程,復(fù)位時(shí)內(nèi)部會(huì)鎖存EA端狀態(tài)。89C51的程序存儲(chǔ)器陣列是采用字節(jié)寫(xiě)入方式編程的,每次寫(xiě)入一個(gè)字符,要對(duì)整個(gè)芯片的EPROM程序存儲(chǔ)器寫(xiě)入一個(gè)非空字節(jié),必須使用片擦除的方法將整個(gè)存儲(chǔ)器的內(nèi)容清楚。·數(shù)據(jù)查詢89C51單片機(jī)用數(shù)據(jù)查詢方式來(lái)檢測(cè)一個(gè)寫(xiě)周期是否結(jié)束,在一個(gè)寫(xiě)周期中,如需要讀取最后寫(xiě)入的那個(gè)字節(jié),則讀出的數(shù)據(jù)的最高位(P0.7)是原來(lái)寫(xiě)入字節(jié)的最高位的反碼。寫(xiě)周期開(kāi)始后,可在任意時(shí)刻進(jìn)行數(shù)據(jù)查詢?!eady/Busy:字節(jié)編程的進(jìn)度可通過(guò)Ready/Busy輸出信號(hào)檢測(cè),編程期間,ALE變?yōu)楦唠娖健癏”后P3.4(Ready/Busy)端被拉低,表示正在編程狀態(tài)(忙狀態(tài))。編程完成后,P3.4變?yōu)楦唠娖奖硎緶?zhǔn)備就緒狀態(tài)?!こ绦蛐r?yàn):如果加密位LB、LB2沒(méi)有進(jìn)行編程,則代碼數(shù)據(jù)可通過(guò)地址和數(shù)據(jù)線讀回原編寫(xiě)的數(shù)據(jù),采用下圖的電路,程序存儲(chǔ)器的地址由P1口和P2口的P2.0—P2.3輸入,數(shù)據(jù)由P0口讀出,P206、P2.7和P3.6、P3.7的控制信號(hào)見(jiàn)表6,PSEN保持低電平,ALE、EA和RST保持高電平。校驗(yàn)時(shí),P0口必須接上10k左右的上拉電阻。微機(jī)接口實(shí)現(xiàn)兩種信息形式的交換。在計(jì)算機(jī)之外,由電子系統(tǒng)所處理的信息以一種物理信號(hào)形式存在,但在程序中,它是用數(shù)字表示的。任一接口的功能都可分為以某種形式進(jìn)行數(shù)據(jù)庫(kù)變換的一些操作,所以外部和內(nèi)部形式的轉(zhuǎn)換是由許多步驟完成的。模擬-數(shù)字轉(zhuǎn)換器(ADC)用來(lái)將連續(xù)變化信號(hào)變成相應(yīng)的數(shù)字量,這數(shù)字量可是可能性的二進(jìn)制數(shù)值中的一固定值。如果傳感器輸出不是連續(xù)變化的,就不需模擬-數(shù)字轉(zhuǎn)換。這種情況下,信號(hào)調(diào)理單元必須將輸入信號(hào)變換成為另一信號(hào),也可直接與接口的下一部分,即微計(jì)算機(jī)本身的輸入輸出單元相連接。輸出接口采用相似的形式,明顯的差別在于信息流的方向相反;是從程序到外部世界。這種情況下,程序可稱為輸出程序,它監(jiān)督接口的操作并完成數(shù)字-模擬轉(zhuǎn)換器(DAC)所需數(shù)字的標(biāo)定。該子程序依次送出信息給輸出器件,產(chǎn)生相應(yīng)的電信號(hào),由DAC轉(zhuǎn)換成模擬形式。最后,信號(hào)經(jīng)調(diào)理(通常是放大)以形成適應(yīng)于執(zhí)行器操作的形式。在微機(jī)電路中使用的信號(hào)幾乎總是太小而不能被直接地連到“外部世界”,因而必須用某種形式將其轉(zhuǎn)換成更適宜的形式。接口電路部分的設(shè)計(jì)是使用微機(jī)的工程師所面臨最重要的任務(wù)之一。我們已經(jīng)了解到微機(jī)中,信號(hào)以離散的位形式表示。當(dāng)微機(jī)要與只有打開(kāi)或關(guān)閉操作的設(shè)備相連時(shí),這種數(shù)字形式是最有用的,這里每一位都可表示一開(kāi)關(guān)或執(zhí)行器的狀態(tài)。為了解決實(shí)際問(wèn)題,一個(gè)單片機(jī)不僅包括CPU,程序和數(shù)據(jù)存儲(chǔ)器,另外,它必須含有通過(guò)CPU訪問(wèn)外部信息的硬件。一旦CPU收集到數(shù)據(jù)信息和流程,它必須能夠改變外部領(lǐng)域的一部分,這些硬件設(shè)備稱作外圍設(shè)備,它們是CPU通往外部的窗口。單片機(jī)可利用外圍設(shè)備中最基本的用于一般用途的I/O接口,每個(gè)I/O接口既可作為輸入端又可作為輸出端,每個(gè)I/O接口的功能取決與程序初始化階段對(duì)數(shù)據(jù)方位寄存器相應(yīng)位進(jìn)行置一和清零操作,通過(guò)CPU指令對(duì)數(shù)據(jù)寄存器相應(yīng)位進(jìn)行置一和清零來(lái)置一和清零輸出端口,同樣輸入端口邏輯位也可以通過(guò)CPU指令訪問(wèn)。一些類型的串行口單元允許CPU與外部設(shè)備進(jìn)行串口通信,用串口位代替平行位進(jìn)行通信需要少許的I/O口,這樣使通信費(fèi)用降低但速度也相對(duì)慢些。串口傳送可以同步也可以異步?;趩纹瑱C(jī)和DSP的卷繞控制器數(shù)據(jù)采集和通訊設(shè)計(jì)基于MSP430單片機(jī)的柴油發(fā)電機(jī)監(jiān)控器的設(shè)計(jì)基于CPLD/FPGA和單片機(jī)的爆速儀設(shè)計(jì)基于單片機(jī)控制的晶閘管中頻感應(yīng)電源的研制基于十六位單片機(jī)的電力設(shè)備故障在線監(jiān)測(cè)裝置的設(shè)計(jì)與算法研究基于SPCE061A單片機(jī)的語(yǔ)音識(shí)別系統(tǒng)的研究基于PIC單片機(jī)的生物機(jī)能實(shí)驗(yàn)裝置的研究基于MotorolaMC68HC08系列單片機(jī)演示系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn)基于TCP/IP協(xié)議的單片機(jī)與INTERNET互連的設(shè)計(jì)與實(shí)現(xiàn)基于嵌入式實(shí)時(shí)操作系統(tǒng)和TCP/IP協(xié)議的單片機(jī)測(cè)控系統(tǒng)AVR8位嵌入式單片機(jī)在車(chē)載全球定位系統(tǒng)顯示終端中的應(yīng)用基于AVR單片機(jī)的250WHID燈電子鎮(zhèn)流器的研究基于單片機(jī)的TCP/IP技術(shù)研究及應(yīng)用基于P87C591單片機(jī)的CAN總線應(yīng)用層協(xié)議的研究基于單片機(jī)實(shí)現(xiàn)對(duì)二級(jí)倒立擺的控制C8051FXXX系列單片機(jī)仿真器的研制基于80C196MC單片機(jī)控制的變頻調(diào)速及配料控制系統(tǒng)的應(yīng)用研究基于單片機(jī)的膠印機(jī)控制系統(tǒng)開(kāi)發(fā)研究HYPERLINK"/

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論