




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認(rèn)領(lǐng)
文檔簡介
步進電機的知識什么是步進電機:步進電機是一種把電脈沖轉(zhuǎn)化為角位移的執(zhí)行機構(gòu)。通俗的說:當(dāng)驅(qū)動程序收到一個步進脈沖信號,將驅(qū)動步進電機軸旋轉(zhuǎn)一個固定的角度(步進角)。您可以通過控制脈沖個數(shù)來控制角位移,從而達到準(zhǔn)確定位的目的;同時,你可以通過控制脈沖頻率來控制電機的旋轉(zhuǎn)速度和加速度,實現(xiàn)速度控制的目的。步進電機的種類:步進電機分為三種:永磁式(PM),反應(yīng)式(VR)和混合式(HR)永磁式步進電機一般為兩相,轉(zhuǎn)矩和體積較小,步進角一步7.5度或15度;反應(yīng)式一般有三相可以實現(xiàn)大轉(zhuǎn)矩輸出,步進角一般是1.5度,但噪聲和振動大。在歐洲和美洲80個國家已被淘汰;混合式步進是混合了永磁式和反應(yīng)的優(yōu)勢。它由兩相和五相:一般兩相的步距角是1.8度,而的五相步距角為0.72度。是使用最廣泛的的步進電機。步進電機允許的最高表面溫度步進電機溫度過高首先會的磁性材料退磁,導(dǎo)致轉(zhuǎn)矩降低甚至失步,電機表面溫度允許的最大值取決于的磁性材料退磁點;一般來說,磁性材料退磁點在攝氏130度以上有些材料甚至高達攝氏200度高,所以步進電機表面溫度在攝氏80-90度是正常的。步進電機精度為多少?是否累積一般步進電機的精度為步進角的3-5%,且不累積如何確定步進電機驅(qū)動器直流電源電壓確定混合式步進電機驅(qū)動器的電源電壓范圍較廣(比如IM483的供電電壓12?48VDC),電源電壓通常根據(jù)電機的轉(zhuǎn)速和響應(yīng)要求來選擇。如果要求較快的運行速度較高的響應(yīng)速度就選用較高的電壓,但注意電源電壓的峰值不能超過驅(qū)動器的最大輸入電壓,否則可能會損壞驅(qū)動器。電流確定電源電流一般根據(jù)輸出相電流I來確定。如果采用線性電源,電源電流一般可取I的1.1?1.3倍;如果采用開關(guān)電源,電源電流一般可取I的1.5?2.0倍。步進電機的主要特性在步進電機關(guān)機時要確保沒有脈沖信號,當(dāng)電機運行時如果加入適當(dāng)?shù)拿}沖信號,它會轉(zhuǎn)過一定的角度(稱為步距角是)。轉(zhuǎn)速與脈沖頻率成正比。2龍式步進電機步距角7.5度,旋轉(zhuǎn)360度,需要48個脈沖來完成。3步進電機具有快速啟動和停止的優(yōu)良特性。4只要改變脈沖,可以很容易地改變電機軸旋轉(zhuǎn)的方向。因此,目前的打印機,繪圖儀,機器人設(shè)備以步進電機作為動力核心。步進電機控制的例子我們以四相單極步進電機為例:四個相繞組引出四個相和兩個公共線(連接到正極)。一相接地。會被激發(fā),。我們使用四相八拍控制,即第1階段第2階段交替反過來,會提高分辨率。步距角0.9°,可以轉(zhuǎn)移到控制電機勵磁是為了轉(zhuǎn)移如下:如果電機反轉(zhuǎn)的要求,傳輸?shù)募钚盘柨梢阅孓D(zhuǎn)的。2控制方案控制系統(tǒng)框圖如下該方案采用AT89S51的主要控制裝置。它是與AT89C51兼容,但也增加了SPI接口和看門狗模塊,這不僅使調(diào)試變得更容易,也更穩(wěn)定。單片機程序主要用于現(xiàn)場信號的采集和通過步進電機的運轉(zhuǎn)來計算的方向和速度信息。然后將信息發(fā)送到CPLD。CPLD使用EPM7128SLC84-15,ALTERA公司的MAX7000系列可編程邏輯器件EPM7128。具有高阻抗,電可擦除等特點,可用單位數(shù)為2500單位,工作電壓+5VCPLD接收脈沖后轉(zhuǎn)換為相應(yīng)的控制信號輸出到步進電機驅(qū)動器,從微控制器發(fā)送的信息。輸入后把控制信號發(fā)送到驅(qū)動電機繞組,以達到有效控制電機的目的。2.1為電機驅(qū)動器的硬件結(jié)構(gòu)電機驅(qū)動器通過下面的電路來實現(xiàn):R1?R8的電阻值為320Q。R9-R12的電阻值為2.2KQ。Q1?Q4作為達林頓401A,Q5-Q8為S8550oJ1,J2和步進電機連接到六個接口。步進電機優(yōu)點和缺點優(yōu)勢1。 電機的旋轉(zhuǎn)角度與脈沖數(shù)成正比;2。 當(dāng)電機停轉(zhuǎn)為最大轉(zhuǎn)矩(當(dāng)繞組勵磁時);3。 由于每一步準(zhǔn)確度為百分之三到五,而且誤差不會累積到下一步,因而具有更好定位精度和重復(fù)定位精度;4。 優(yōu)良的啟動和制動特性_;5。 沒有電刷,可靠性高,電機的壽命只是取決于電機軸承;6。 電機_僅由輸入脈沖數(shù)決定,可用于開環(huán)控制,這使得電機和控制結(jié)構(gòu)確定相對簡單系統(tǒng)成本7。 只是負(fù)載直接連接到電機軸也可以極其緩慢旋轉(zhuǎn)8。 速度與的脈沖頻率成正比,因此,有相對較寬的調(diào)速范圍缺點1。 如果沒有適當(dāng)?shù)目刂疲菀坠舱瘢?。 高速操作難度較大3。 難以獲得大轉(zhuǎn)矩4。 沒有體積小,重量輕,能耗低,效率高等方面優(yōu)勢5。 過載時會破壞同步性,工作時會發(fā)出時較大的振動和噪音步進電機驅(qū)動要求(1)為了滿足速度迅速上升或下降的要求,波形應(yīng)當(dāng)盡可能接近矩形以釋放回路電流流,繞組兩端的反電動勢,加速電流衰減(2)具有較高功率和效率步進電機驅(qū)動器,把輸入的脈沖信號轉(zhuǎn)化為角位移,每當(dāng)控制系統(tǒng)發(fā)出一個脈沖信號,步進電機驅(qū)動就旋轉(zhuǎn)一個步距角,步進電機的速度與的脈沖信號頻率成正比,因此,通過控制脈沖信號頻率,就可以精確控制電機轉(zhuǎn)速步進脈沖數(shù)決定準(zhǔn)確連接為電機步進電機驅(qū)動器有很多,我們應(yīng)該根據(jù)功率采取的合理的方式選擇驅(qū)動器最新的技術(shù)發(fā)展國內(nèi)和國際上對于驅(qū)動技術(shù)的研究十分活躍,高性能子驅(qū)動電路可以細(xì)分成幾千部分甚至任意細(xì)分,現(xiàn)在已經(jīng)能夠做到通過復(fù)雜的計算統(tǒng)一步距角,大大提高了步進電機的脈沖分辨率,減少或消除振動,噪聲和轉(zhuǎn)矩波動,步進電機有了更多“類伺服”功能實際作用:步距角細(xì)分驅(qū)動器出現(xiàn)之前,用戶需要選擇不同的相來獲取不同的步進電機步距角,以滿足自己的要求,如果使用細(xì)分驅(qū)動器,用戶可以通過更改驅(qū)動器號段,來改變實際的步距角,相數(shù)對實際步距角的作用幾乎可以忽略不計AT89C51的介紹描述AT89C51是一個擁有4K字節(jié)FLASH編程功能和可擦除只讀儲存器的低功耗,高性能CMOS8位微機(PEROM)。該設(shè)備是采用Atmel的高密度非易失性內(nèi)存技術(shù)并與工業(yè)標(biāo)準(zhǔn)的的MCS-51指令集和引腳兼容。芯片上的Flash允許程序存儲器通過系統(tǒng)或由傳統(tǒng)的非易失性存儲器編程重新編程。通過把一個多功能8位CPU與一個單一的芯片上的Flash相結(jié)合的,Atmel的AT89C51是一個功能強大微型計算機為許多嵌入式控制程序提供了高度靈活和成本效益的解決方案。功能特點AT89C51具有以下功能:4K字節(jié)的Flash,128字節(jié)RAM,32I/O口,兩個16位定時器/計數(shù)器,一個五向量2級中斷機構(gòu),一個全雙工串行口,芯片振蕩器和時鐘電路。此外,AT89C51支持頻率為0的靜態(tài)邏輯運算,并支持兩種節(jié)電模式。空閑模式時CPU停止工作,同時允許RAM,定時器/計數(shù)器,串口和中斷系統(tǒng)繼續(xù)運作。掉電模式保存RAM的內(nèi)容,但凍結(jié)振蕩器,禁用所有其他芯片功能,直到硬件復(fù)位。引腳描述VCC:電源電壓GND:地端口0:端口0是一個8位漏極開路雙向I/O端口。作為一個輸出端口,每個引腳可以驅(qū)動8個TTL輸入端。當(dāng)1寫入端口0引腳,引腳可作為高阻輸入端.端口0也可以設(shè)定成地址/數(shù)據(jù)在訪問外部程序和數(shù)據(jù)存儲器時的總線。在這種模式下,口0內(nèi)部上拉?電阻口0在Flash編程期間也可以收到代碼字節(jié),輸出程序改變的代碼字節(jié)。程序改變期間還要外部上拉電阻端口1端口1是一個具有內(nèi)部上拉電阻的8位雙向I/O端口端口1輸出緩沖器可以驅(qū)動四個TTL輸入?當(dāng)1被寫入端口1它們被內(nèi)部上拉電阻上拉為高電平并可以用作輸入口。作為輸入口時,由于內(nèi)部上拉電阻的作用,引腳被外部信號拉低時輸出一個電流,flash編程和校驗時端口1也會接收到低地址信號。端口2端口2是一個具有內(nèi)部上拉電阻的8位雙向I/O端口。端口2輸出緩沖器可以驅(qū)動四個TTL輸入。當(dāng)1S寫入端口2引腳他們被內(nèi)部上拉電阻拉到高電平,并可以用作輸入口。作為輸入口時,由于內(nèi)部上拉電阻的做用,端口2引腳被外部信號拉至低電平時,將輸出電流,端口2在訪問使用16位地址的外部數(shù)據(jù)存儲器時發(fā)出的高位地址字節(jié)。在此應(yīng)用中,它采用強大的內(nèi)部上拉電阻,發(fā)光1S。在訪問使用8位地址的外部數(shù)據(jù)存儲器時,端口2也會收到一些高八位地址信號或者控制信號。端口3端口3是一個具有內(nèi)部上拉電阻的8位雙向I/O端口。端口3輸出緩沖器可以驅(qū)動四個TTL輸入。當(dāng)1S被寫入端口3的引腳,他們被內(nèi)部上拉電阻拉到高電平,并可以用作輸入口。作為輸入口時,由于內(nèi)部上拉電阻的做用,端口2引腳被外部信號拉至低電平時,將輸出電流。端口3還為AT89C51提供各種特殊功能,如下:端口引腳第二功能P3.0RXDP3.1TXDP3.2INT0P3.3INT1P3.4T0P3.5T1P3.6WRP3.7RDRST復(fù)位輸入引腳。震蕩器運行時,兩個運行周期的高電平將使設(shè)備復(fù)位。ALE/PROG在訪問外部存儲器時地址鎖存使能輸出脈沖鎖存的低八位地址。該引腳也是程序在Flash編程時的PROG。正常運行時ALE以恒定的速率發(fā)出振蕩頻率的1/6的脈沖信號,可用作外部時鐘或定時。但是請注意,,在每次訪問外部數(shù)據(jù)存儲器都有一個ALE脈沖跳過。。如果需要,可以通過把0SFR置位為8EH來禁用ALE。此時,ALE僅執(zhí)行MOVX或MOVC指令。如果單片機在執(zhí)行外部的工作,應(yīng)將ALE設(shè)置為禁用。PSEN程序儲存允許輸出是外部程序存儲器的讀選通信號,當(dāng)AT89C51由外部程序存儲器讀取指令時,每個機器周期兩次PSEN有效,即輸出兩個脈沖。在此期間,當(dāng)訪問外部數(shù)據(jù)存儲器時,這兩次有效的PSEN信號不出現(xiàn)。EA/VPP外部訪問允許。EA必須綁到GND才能使設(shè)備開始在0000H到FFFFH位取代碼。但是請注意,如果鎖存位1被編程,EA將鎖存位置上復(fù)位。若EA為高電平則單片機執(zhí)行內(nèi)部程序。在Flash編程時,也可以使用使用12V編程電壓VCCXTAL1:震蕩器反相放大器及內(nèi)部時鐘發(fā)生器的輸入端。XTAL2:震蕩器反相放大器的輸出端。時鐘振蕩器的特性時鐘振蕩器是可以設(shè)置為內(nèi)部振蕩器的反相放大器XTAL1和XTAL2分別為其出入端和輸出端,如圖1所示。石英晶體或陶瓷諧振器都可以作為其材料。如圖2所示要想通過外部時鐘來驅(qū)動它,XTAL1工作時XTAL2應(yīng)懸空。對外部時鐘信號的占空比沒有特殊要求,因為外部時鐘信號是通過一個2分頻觸發(fā)器后作為內(nèi)部時鐘信號的,但最小高電平持續(xù)時間和最大的低電平持續(xù)時間應(yīng)該符合要求。
XTAL1外部振蕩電路EXTERNALOSCILLATORSIGNAL內(nèi)部振蕩電路閑散模式XTAL1外部振蕩電路EXTERNALOSCILLATORSIGNAL在閑散模式下,CPU停止工作,而所有其他元件依然處于工作狀態(tài)。該模式是通過軟件控制的。這種模式下,片上RAM和所有特殊功能寄存器的內(nèi)部數(shù)據(jù)不變。該模式可以由任何可用的終止指令或者硬件重置來終止當(dāng)由硬件復(fù)位來終止閑散工作模式時,中央處理器CPU通常是從激活空閑模式那條指令的下一條開始繼續(xù)執(zhí)行程序的,要完成內(nèi)部復(fù)位操作,硬件復(fù)位脈沖要保持兩個機器周期有效,在這種情況下,內(nèi)部禁止中央處理器CPU訪問片內(nèi)RAM,而允許訪問其他端口,這是為了避免可能對端口產(chǎn)生的意外寫入:激活空閑模式的指令后面的一條指令不應(yīng)是一條對端口或外部存儲器的寫入指令。掉電模式在掉電模式下,振蕩器停止運行,斷電指令是最后一條要執(zhí)行的指令。片上RAM和特殊功能寄存器保持原值,直到掉電模式終止。終止掉電唯一的方式是硬件復(fù)位。復(fù)位將重置SFR,但不改變RAM的內(nèi)容。復(fù)位不能被激活,直到VCC恢復(fù)到其正常水平,以確保有足夠長的時間使振蕩器重新啟動并穩(wěn)定。。模式程序存儲器ALEPSENP0P1P2P3閑散模式內(nèi)部11數(shù)據(jù)數(shù)據(jù)數(shù)據(jù)數(shù)據(jù)閑散模式內(nèi)部11浮空數(shù)據(jù)地址數(shù)據(jù)掉電模式外部00數(shù)據(jù)數(shù)據(jù)數(shù)據(jù)數(shù)據(jù)掉電模式外部00數(shù)據(jù)數(shù)據(jù)數(shù)據(jù)數(shù)據(jù)KnowledgeofTheStepperMotorWhatisasteppermotor:Steppermotorisakindofelectricalpulsesintoangulardisplacementoftheimplementingagency.Popularlittlelesson:Whenthedriverreceivesasteppulsesignal,itwilldriveasteppermotortosetthedirectionofrotationatafixedangle(andthestepangle).Youcancontrolthenumberofpulsestocontroltheangulardisplacement,soastoachieveaccuratepositioningpurposes;thesametimeyoucancontrolthepulsefrequencytocontrolthemotorrotationspeedandacceleration,toachievespeedcontrolpurposes.Whatkindsofsteppermotorsub-:Inthreesteppermotors:permanentmagnet(PM),reactive(VR)andhybrid(HB)permanentmagnetstepperusuallytwo-phase,torque,andsmaller,stepangleof7.5degreesorthegeneral15degrees;reactionstepisgenerallythree-phase,canachievehightorqueoutput,stepangleof1.5degreesisgenerally,butthenoiseandvibrationarelarge.80countriesinEuropeandAmericahavebeeneliminated;hybridstepperisamixofpermanentmagnetandreactiveadvantages.Itconsistsoftwophasesandthefive-phase:two-phasestepangleof1.8degreeswhilethegeneralfive-phasestepangleof0.72degreesgenerally.ThemostwidelyusedStepperMotor.Whatistokeepthetorque(HOLDINGTORQUE)Howmuchprecisionsteppermotor?Whetherthecumulative:Thegeneralaccuracyofthesteppermotorstepangleof3-5%,andnotcumulative.SteppermotortoallowtheminimumamountofsurfacetemperatureSteppermotortoallowtheminimumamountofsurfacetemperature:Steppermotorcausesthemotortemperatureistoohighthefirstmagneticdemagnetization,resultinginlossoftorquedownevenfurther,sothemotorsurfacetemperatureshouldbethemaximumalloweddependingonthemotordemagnetizationofmagneticmaterialpoints;Generallyspeaking,themagneticdemagnetizationpointsareabove130degreesCelsius,andsomeevenashighas200degreesCelsius,sothesteppermotorsurfacetemperatureof80-90degreesCelsiusisnormal.HowtodeterminethesteppermotordriverDCpowersupply:A.DeterminationofthevoltageHybridsteppingmotordriverpowersupplyvoltageisgenerallyawiderange(suchastheIM483supplyvoltageof12~48VDC),thesupplyvoltageisusuallybasedontheworkofthemotorspeedandresponsetotherequesttochoose.Ifthemotoroperatingspeedhigherorfasterresponsetotherequest,thenthevoltagevalueishigh,butnotethattheripplevoltagecannotexceedthemaximuminputvoltageofthedrive,oritmaydamagethedrive.B.DeterminationofCurrentPowersupplycurrentisgenerallybasedontheoutputphasecurrentdriveItodetermine.Ifalinearpowersupply,powersupplycurrentisgenerallypreferable1.1to1.3timestheI;ifweadopttheswitchingpowersupply,powersupplycurrentisgenerallypreferabletoI,1.5to2.0times.Themaincharacteristicsofsteppingmotor:Asteppermotordrivecanbeaddedoperatepulsedrivesignalmustbenopulsewhenthesteppermotoratrest,suchasIfaddingtheappropriatepulsesignal,itwilltoacertainangle(calledthestepangle)rotation.Rotationspeedandpulsefrequencyisproportionalto.2Dragonstepanglesteppermotorversionis7.5degrees,360degreesaround,takes48pulsestocomplete.3steppermotorhasinstantstartandrapidcessationofsuperiorcharacteristics.Changethepulseoftheorderof4,youcaneasilychangethedirectionofrotation.Therefore,thecurrentprinters,plotters,robotics,andsodevicesarethecoreofthesteppermotorasthedrivingforce.SteppermotorcontrolexampleWeusefour-phaseunipolarsteppermotorasanexample.ThestructureshowninFigure1:Fourfour-phasewindingleads(asopposedtophaseA1A2B1phasephaseB2)andtwopubliclines(tothepowerofpositive).Thewindingsofonephasetothepoweroftheground.Sothatthewindingswillbeinspired.Weusefour-phaseeight-beatcontrol,ie,1phase2phasealternatingturn,wouldenhanceresolution.0.9°perstepcanbetransferredtocontrolthemotorexcitationistransferredinorderasfollows:Iftherequirementsofmotorreversal,thetransmissionexcitationsignalcanbereversed.2controlschemeControlsystemblockdiagramisasfollowsTheprogramusesAT89S51asthemaincontroldevice.ItiscompatiblewiththeAT89C51,butalsoincreasedtheSPIinterfaceandthewatchdogmodule,whichnotonlymakesthedebuggingprocessbecomeseasyandalsomorestable.Themicrocontrollerintheprogrammainlyforfieldsignalacquisitionandoperationofthesteppermotortocalculatethedirectionandspeedinformation.ThensenttotheCPLD.CPLDwithEPM7128SLC84-15,EPM7128programmablelogicdeviceoflarge-scale,fortheALTERAcompany'sMAX7000family.Highimpedance,electricallyerasableandothercharacteristics,canbeusedforthe2500unit,theworkingvoltageof+5V.CPLDreceivesinformationsentfromthemicrocontrollerafterconvertedtothecorrespondingcontrolsignaloutputtothesteppermotordrive.Putthecontrolsignaldrivesthemotorwindingsaftertheinput,toachieveeffectivecontrolofthemotor.2.1ThehardwarestructureofthemotordriveMotordriveusingthefollowingcircuit:R1-R8inwhichtheresistancevalueof320Q.R9-R12resistancevalue2.2KQ.Q1-Q4asDarlingtonD401A,Q5-Q8fortheS8550.J1,J2andthesteppermotorconnectedtothesix-lead。AdvantagesanddisadvantagesofsteppermotorAdvantagesThemotorrotationangleisproportionaltothenumberofpulses;Whenthemotorstoppedwithamaximumtorque(whenthewindingexcitationtime);Sincetheaccuracyofeachstepinthethreepercenttofivepercent,andtheerrorwillnotaccumulatetothenextstepandthushasbetterpositionalaccuracyandrepeatabilityofmovement;Excellentresponsefromthestopandreverse;Intheabsenceofbrush,highreliability,itjustdependsonthelifeofthemotorbearinglife;Motorresponseonlydeterminedbythenumberofinputpulses,whichcanbeusedopenloopcontrol,whichmakesthemotorandcontrolstructurecanberelativelysimpleSystemcostJustloaddirectlyconnectedtothemotorshaftcanalsobeextremelyslowsynchronousrotation.Speedisproportionaltothepulsefrequency,andthusarelativelywidespeedrange.ShortcomingsIfnotproperlycontrolledpronetoresonance;Difficultoperationtoahigherspeed.DifficulttoobtainhightorqueThereisnoadvantageintermsofvolumeweight,lowenergyefficiency.Overloadwilldestroythesynchronization,theworkwillbeissuedwhenhigh-speedvibrationandnoise.Steppermotordriverequirements(1)toprovidefastriseandfallofcurrentspeed,thecurrentwaveformascloseaspossiblerectangle.Fortheperiodendedwiththereleaseoftheloopcurrentflow,toreducethewindingendsofthebackelectromotiveforce,toacceleratethecurrentdecay.(2)rhymewithhigherpowerandefficiency.Steppermotordriver,whichisthecontrolpulsesignalemittedintotheangulardisplacementofthesteppermotor,or:thecontrolsystemsendsapulsesignaleachthroughthesteppermotordrivetorotateastepangle.Thatisthesteppermotorspeedisproportionaltothefrequencyandpulsesignals.Therefore,thefrequencycontrolpulsesignal,tobeprecisemotorspeedcontrol;controlthenumberofsteppulsestoconnectthemotoraccurately.Steppermotordrivetherearemany,weshouldtakeareasonablechoiceofpowerrequirementsofthedrive,thefollowingwereintroducedvarioustypesoftypicaldrive.ThelatesttechnologicaldevelopmentsDomesticandinternationalresearchonthesub-drivetechnologyisveryactive,high-performancesub-drivercircuitcanbebrokendownintothousandsorevenanysubdivision.Nowabletodocomplicatedcalculationstomakeafterthebreakdownofuniformstepangle,whichgreatlyimprovestheresolutionofsteppermotorpulses,reduceoreliminatethevibration,noiseandtorqueripple,thesteppermotorismore"classserver"feature.Theactualroleofstepangle:intheabsenceofsub-drive,theuserselectadifferentnumberofphasesdependsmainlyonthesteppermotortomeettheirownrequirementsonthestepangle,Ifyouusethesub-drive,theusercanchangethedrivenumberofsegments,candramaticallychangetheactualstepanglesteppermotor'phases'ofchangeintheroleoftheactualstepangleisalmostnegligible.IntroductionofAT89C51DescriptionTheAT89C51isalow-power,high-performanceCMOS8-bitmicrocomputerwith4KbytesofFlashprogrammableanderasablereadonlymemory(PEROM).ThedeviceismanufacturedusingAtmel'shigh-densitynonvolatilememorytechnologyandiscompatiblewiththeindustry-standardMCS-51instructionsetandpinout.Theon-chipFlashallowstheprogrammemorytobereprogrammedin-systemorbyaconventionalnonvolatilememoryprogrammer.Bycombiningaversatile8-bitCPUwithFlashonamonolithicchip,theAtmelAT89C51isapowerfulmicrocomputerwhichprovidesahighly-flexibleandcost-effectivesolutiontomanyembeddedcontrolapplications.FunctioncharacteristicTheAT89C51providesthefollowingstandardfeatures:4KbytesofFlash,128bytesofRAM,32I/Olines,two16-bittimer/counters,afivevectortwo-levelinterruptarchitecture,afullduplexserialport,on-chiposcillatorandclockcircuitry.Inaddition,theAT89C51isdesignedwithstaticlogicforoperationdowntozerofrequencyandsupportstwosoftwareselectablepowersavingmodes.TheIdleModestopstheCPUwhileallowingtheRAM,timer/counters,serialportandinterruptsystemtocontinuefunctioning.ThePower-downModesavestheRAMcontentsbutfreezestheoscillatordisablingallotherchipfunctionsuntilthenexthardwarereset.PinDescriptionVCC:Supplyvoltage.GND:Ground.Port0:Port0isan8-bitopen-drainbi-directionalI/Oport.Asanoutputport,eachpincansinkeightTTLinputs.When1sarewrittentoport0pins,thepinscanbeusedashighimpedanceinputs.Port0mayalsobeconfiguredtobethemultiplexedloworderaddress/databusduringaccessestoexternalprogramanddatamemory.InthismodeP0hasinternalpullups.Port0alsoreceivesthecodebytesduringFlashprogramming,andoutputsthecodebytesduringprogramverification.Externalpullupsarerequiredduringprogramverification.Port1Port1isan8-bitbi-directionalI/Oportwithinternalpullups.ThePort1outputbufferscansink/sourcefourTTLinputs.When1sarewrittentoPort1pinstheyarepulledhighbytheinternalpullupsandcanbeusedasinputs.Asinputs,Port1pinsthatareexternallybeingpulledlowwillsourcecurrent(IIL)becauseoftheinternalpullups.Port1alsoreceivesthelow-orderaddressbytesduringFlashprogrammingandverification.Port2Port2isan8-bitbi-directionalI/Oportwithinternalpullups.ThePort2outputbufferscansink/sourcefourTTLinputs.When1sarewrittentoPort2pinstheyarepulledhighbytheinternalpullupsandcanbeusedasinputs.Asinputs,Port2pinsthatareexternallybeingpulledlowwillsourcecurrent,becauseoftheinternalpullups.Port2emitsthehigh-orderaddressbyteduringfetchesfromexternalprogrammemoryandduringaccessestoexternaldatamemorythatuse16-bitaddresses.Inthisapplication,itusesstronginternalpullupswhenemitting1s.Duringaccessestoexternaldatamemorythatuse8-bitaddresses,Port2emitsthecontentsoftheP2SpecialFunctionRegister.Port2alsoreceivesthehigh-orderaddressbitsandsomecontrolsignalsduringFlashprogrammingandverification.Port3Port3isan8-bitbi-directionalI/Oportwithinternalpullups.ThePort3outputbufferscansink/sourcefourTTLinputs.When1sarewrittentoPort3pinstheyarepulledhighbytheinternalpullupsandcanbeusedasinputs.Asinputs,Port3pinsthatareexternallybeingpulledlowwillsourcecurrent(IIL)becauseofthepullups.Port3alsoservesthefunctionsofvariousspecialfeaturesoftheAT89C51aslistedbelow:PortPinAlternateFunctionsP3.0RXD(serialinputport)P3.1TXD(serialoutputport)P3-2INTO(externalinterrupt0)P3.3INT1(externalinterruptV)P茂4TO(timer0externalinput;P3.5T1(timer1externalinput}P3.6WR(exte-rnaldatame-morywritestrobe)P3.7RD(externaldatamemaryreadstrobe)Port3alsoreceivessomecontrolsignalsforFlashprogrammingandverification.RSTResetinput.Ahighonthispinfortwomachinecycleswhiletheoscillatorisrunningresetsthedevice.ALE/PROGAddressLatchEnableoutputpulseforlatchingthelowbyteoftheaddressduringaccessestoexternalmemory.Thispinisalsotheprogrampulseinput(PROG)duringFlashprogramming.InnormaloperationALEisemittedataconstantrateof1/6theoscillatorfrequency,andmaybeusedforexternaltimingorclockingpurposes.Note,however,thatoneALEpulseisskippedduringeachaccesstoexternalDataMemory.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.XTAL1Inputtotheinvertingoscillatoramplifierandinputtotheinternalclockoperatingcircuit.XTAL2Outputfromtheinvertingoscillatoramplifier.OscillatorCharacteristicsXTAL1andXTAL2aretheinputando
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 建筑業(yè)安全責(zé)任協(xié)議書
- 租房交換協(xié)議書
- 造假就業(yè)協(xié)議書
- 道路修補協(xié)議書
- 聯(lián)防互助協(xié)議書
- 租賃模具協(xié)議書
- 房管所合同解除協(xié)議書
- 砂仁管理協(xié)議書
- 珠海市政府合作協(xié)議書
- 紙箱調(diào)價協(xié)議書
- 2025屆河南省許昌市名校高三下學(xué)期第二次模擬考試英語試題(原卷版+解析版)
- 蛛網(wǎng)膜下腔出血介入術(shù)后護理
- 2025年臨床執(zhí)業(yè)醫(yī)師考試的院前急救知識試題及答案
- 數(shù)據(jù)治理架構(gòu)試題及答案
- 會考地理綜合題答題模板+簡答題歸納-2025年會考地理知識點梳理
- 廣州中小企業(yè)招工難問題研究
- 2025年度綜合物業(yè)管理外包服務(wù)專項合同
- 2026年版廣西高等職業(yè)教育考試(新職教高考)普高生專用升高職大?!堵殬I(yè)適應(yīng)性測試》模擬試卷(第3套)
- 國家開放大學(xué)行管本科《城市管理學(xué)》期末紙質(zhì)考試總題庫2025春期版
- 軍隊文職招聘(臨床醫(yī)學(xué))近年考試真題題庫(含真題、典型題)(重點題)
- 《偽裝技術(shù)的簡介》課件
評論
0/150
提交評論