版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、<p><b> 51單片機簡介</b></p><p><b> 描述</b></p><p> AT89C51是一個低電壓,高性能CMOS8位單片機帶有4K字節(jié)的可反復(fù)擦寫的程序存儲器(PENROM)。和128字節(jié)的存取數(shù)據(jù)存儲器(RAM),這種器件采用ATMEL公司的高密度、不容易丟失存儲技術(shù)生產(chǎn),并且能夠與MCS-51系列
2、的單片機兼容。片內(nèi)含有8位中央處理器和閃爍存儲單元,有較強的功能的AT89C51單片機能夠被應(yīng)用到控制領(lǐng)域中。</p><p><b> 功能特性</b></p><p> AT89C51提供以下的功能標(biāo)準(zhǔn):4K字節(jié)閃爍存儲器,128字節(jié)隨機存取數(shù)據(jù)存儲器,32個I/O口,2個16位定時/計數(shù)器,1個5向量兩級中斷結(jié)構(gòu),1個串行通信口,片內(nèi)震蕩器和時鐘電路。另外,
3、AT89C51還可以進(jìn)行0HZ的靜態(tài)邏輯操作,并支持兩種軟件的節(jié)電模式。閑散方式停止中央處理器的工作,能夠允許隨機存取數(shù)據(jù)存儲器、定時/計數(shù)器、串行通信口及中斷系統(tǒng)繼續(xù)工作。掉電方式保存隨機存取數(shù)據(jù)存儲器中的內(nèi)容,但震蕩器停止工作并禁止其它所有部件的工作直到下一個復(fù)位。</p><p><b> 引腳描述</b></p><p> VCC:電源電壓 <
4、/p><p><b> GND:地</b></p><p><b> P0口:</b></p><p> P0口是一組8位漏極開路雙向I/O口,即地址/數(shù)據(jù)總線復(fù)用口。作為輸出口時,每一個管腳都能夠驅(qū)動8個TTL電路。當(dāng)“1”被寫入P0口時,每個管腳都能夠作為高阻抗輸入端。P0口還能夠在訪問外部數(shù)據(jù)存儲器或程序存儲器時,
5、轉(zhuǎn)換地址和數(shù)據(jù)總線復(fù)用,并在這時激活內(nèi)部的上拉電阻。P0口在閃爍編程時,P0口接收指令,在程序校驗時,輸出指令,需要接電阻。</p><p><b> P1口:</b></p><p> P1口一個帶內(nèi)部上拉電阻的8位雙向I/O口,P1的輸出緩沖級可驅(qū)動4個TTL電路。對端口寫“1”,通過內(nèi)部的電阻把端口拉到高電平,此時可作為輸入口。因為內(nèi)部有電阻,某個引腳被外部
6、信號拉低時輸出一個電流。閃爍編程時和程序校驗時,P1口接收低8位地址。</p><p><b> P2口:</b></p><p> P2口是一個內(nèi)部帶有上拉電阻的8位雙向I/O口,P2的輸出緩沖級可驅(qū)動4個TTL電路。對端口寫“1”,通過內(nèi)部的電阻把端口拉到高電平,此時,可作為輸入口。因為內(nèi)部有電阻,某個引腳被外部信號拉低時會輸出一個電流。在訪問外部程序存儲器或
7、16位地址的外部數(shù)據(jù)存儲器時,P2口送出高8位地址數(shù)據(jù)。在訪問8位地址的外部數(shù)據(jù)存儲器時,P2口線上的內(nèi)容在整個運行期間不變。閃爍編程或校驗時,P2口接收高位地址和其它控制信號。</p><p><b> P3口:</b></p><p> P3口是一組帶有內(nèi)部電阻的8位雙向I/O口,P3口輸出緩沖故可驅(qū)動4個TTL電路。對P3口寫如“1”時,它們被內(nèi)部電阻拉到高
8、電平并可作為輸入端時,被外部拉低的P3口將用電阻輸出電流。</p><p> P3口除了作為一般的I/O口外,更重要的用途是它的第二功能,如下表所示:</p><p> P3口還接收一些用于閃爍存儲器編程和程序校驗的控制信號。</p><p><b> RST:</b></p><p> 復(fù)位輸入。當(dāng)震蕩器工作時
9、,RET引腳出現(xiàn)兩個機器周期以上的高電平將使單片機復(fù)位。</p><p><b> ALE/:</b></p><p> 當(dāng)訪問外部程序存儲器或數(shù)據(jù)存儲器時,ALE輸出脈沖用于鎖存地址的低8位字節(jié)。即使不訪問外部存儲器,ALE以時鐘震蕩頻率的1/16輸出固定的正脈沖信號,因此它可對輸出時鐘或用于定時目的。要注意的是:每當(dāng)訪問外部數(shù)據(jù)存儲器時將跳過一個ALE脈沖時,
10、閃爍存儲器編程時,這個引腳還用于輸入編程脈沖。如果必要,可對特殊寄存器區(qū)中的8EH單元的D0位置禁止ALE操作。這個位置后只有一條MOVX和MOVC指令A(yù)LE才會被應(yīng)用。此外,這個引腳會微弱拉高,單片機執(zhí)行外部程序時,應(yīng)設(shè)置ALE無效。</p><p><b> PSEN:</b></p><p> 程序儲存允許輸出是外部程序存儲器的讀選通信號,當(dāng)AT89C51由
11、外部程序存儲器讀取指令時,每個機器周期兩次PSEN 有效,即輸出兩個脈沖。在此期間,當(dāng)訪問外部數(shù)據(jù)存儲器時,這兩次有效的PSEN 信號不出現(xiàn)。</p><p><b> EA/VPP:</b></p><p> 外部訪問允許。欲使中央處理器僅訪問外部程序存儲器,EA端必須保持低電平。需要注意的是:如果加密位LBI被編程,復(fù)位時內(nèi)部會鎖存EA端狀態(tài)。如EA端為高電平
12、,CPU則執(zhí)行內(nèi)部程序存儲器中的指令。閃爍存儲器編程時,該引腳加上+12V的編程允許電壓VPP,當(dāng)然這必須是該器件是使用12V編程電壓VPP。</p><p> XTAL1:震蕩器反相放大器及內(nèi)部時鐘發(fā)生器的輸入端。</p><p> XTAL2:震蕩器反相放大器的輸出端。</p><p><b> 時鐘震蕩器</b></p>
13、<p> AT89C51中有一個用于構(gòu)成內(nèi)部震蕩器的高增益反相放大器,引腳XTAL1和XTAL2分別是該放大器的輸入端和輸出端。這個放大器與作為反饋元件的片外石英晶體或陶瓷諧振器一起構(gòu)成自然震蕩器。 外接石英晶體及電容C1,C2接在放大器的反饋回路中構(gòu)成并聯(lián)震蕩電路。對外接電容C1,C2雖然沒有十分嚴(yán)格的要求,但電容容量的大小會輕微影響震蕩頻率的高低、震蕩器工作的穩(wěn)定性、起振的難易程序及溫度穩(wěn)定性。如果使用石英晶體,我們
14、推薦電容使用30PF±10PF,而如果使用陶瓷振蕩器建議選擇40PF±10PF。用戶也可以采用外部時鐘。采用外部時鐘的電路如圖示。這種情況下,外部時鐘脈沖接到XTAL1端,即內(nèi)部時鐘發(fā)生器的輸入端,XTAL2則懸空。由于外部時鐘信號是通過一個2分頻觸發(fā)器后作為內(nèi)部時鐘信號的,所以對外部時鐘信號的占空比沒有特殊要求,但最小高電平持續(xù)時間和最大的低電平持續(xù)時間應(yīng)符合產(chǎn)品技術(shù)條件的要求。</p><p&
15、gt; 內(nèi)部振蕩電路 外部振蕩電路</p><p><b> 閑散節(jié)電模式</b></p><p> AT89C51有兩種可用軟件編程的省電模式,它們是閑散模式和掉電工作模式。這兩種方式是控制專用寄存器PCON中的PD和IDL位來實現(xiàn)的。PD是掉電模式,當(dāng)PD=1時,激活掉電工作模式,單片機進(jìn)入掉
16、電工作狀態(tài)。IDL是閑散等待方式,當(dāng)IDL=1,激活閑散工作狀態(tài),單片機進(jìn)入睡眠狀態(tài)。如需要同時進(jìn)入兩種工作模式,即PD和IDL同時為1,則先激活掉電模式。在閑散工作模式狀態(tài),中央處理器CPU保持睡眠狀態(tài),而所有片內(nèi)的外設(shè)仍保持激活狀態(tài),這種方式由軟件產(chǎn)生。此時,片內(nèi)隨機存取數(shù)據(jù)存儲器和所有特殊功能寄存器的內(nèi)容保持不變。閑散模式可由任何允許的中斷請求或硬件復(fù)位終止。終止閑散工作模式的方法有兩種,一是任何一條被允許中斷的事件被激活,IDL
17、被硬件清除,即刻終止閑散工作模式。程序會首先影響中斷,進(jìn)入中斷服務(wù)程序,執(zhí)行完中斷服務(wù)程序,并緊隨RETI指令后,下一條要執(zhí)行的指令就是使單片機進(jìn)入閑散工作模式,那條指令后面的一條指令。二是通過硬件復(fù)位也可將閑散工作模式終止。需要注意的是:當(dāng)由硬件復(fù)位來終止閑散工作模式時,中央處理器CPU通常是從激活空閑模式那條指令的下一條開始繼續(xù)執(zhí)行程序的,要完成內(nèi)部復(fù)位操作</p><p><b> 掉電模式&l
18、t;/b></p><p> 在掉電模式下,振蕩器停止工作,進(jìn)入掉電模式的指令是最后一條被執(zhí)行的指令,片內(nèi)RAM和特殊功能寄存器的內(nèi)容在中指掉電模式前被凍結(jié)。退出掉電模式的唯一方法是硬件復(fù)位,復(fù)位后將從新定義全部特殊功能寄存器但不改變RAM中的內(nèi)容,在VCC恢復(fù)到正常工作電平前,復(fù)位應(yīng)無效切必須保持一定時間以使振蕩器從新啟動并穩(wěn)定工作。</p><p> 閑散和掉電模式外部引腳狀
19、態(tài)。</p><p><b> 程序存儲器的加密</b></p><p> AT89C51可使用對芯片上的三個加密位LB1,LB2,LB3進(jìn)行編程(P)或不編程(U)得到如下表所示的功能:</p><p> 當(dāng)LB1被編程時,在復(fù)位期間,EA端的電平被鎖存,如果單片機上電后一直沒有復(fù)位,鎖存起來的初始值是一個不確定數(shù),這個不確定數(shù)會一直保
20、存到真正復(fù)位位置。為了使單片機正常工作,被鎖存的EA電平與這個引腳當(dāng)前輯電平一致。機密位只能通過整片擦除的方法清除。</p><p> AT89C51 MCU Introduction</p><p> Description</p><p> The AT89C51 is a low-power, high-performance CMOS 8-bit mi
21、crocomputer with 4K bytes of Flash programmable and erasable read only memory (PEROM). The device is manufactured using Atmel’s high-density nonvolatile memory technology and is compatible with the industry-standard MCS-
22、51 instruction set and pinout. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with Flash on a monolithic ch
23、ip</p><p> Function characteristic</p><p> The AT89C51 provides the following standard features: 4K bytes of Flash, 128 bytes of RAM, 32 I/O lines, two 16-bit timer/counters, a five vector two
24、-level interrupt architecture, a full duplex serial port, on-chip oscillator and clock circuitry. In addition, the AT89C51 is designed with static logic for operation down to zero frequency and supports two software sele
25、ctable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port and interrupt system to </p><p> Pin Description</p><p> VCC:Supply voltage.</p>
26、;<p> GND:Ground.</p><p><b> Port 0:</b></p><p> Port 0 is an 8-bit open-drain bi-directional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are w
27、ritten to port 0 pins, the pins can be used as highimpedance inputs.Port 0 may also be configured to be the multiplexed loworder address/data bus during accesses to external program and data memory. In this mode P0 has i
28、nternal pullups.Port 0 also receives the code bytes during Flash programming,and outputs the code bytes during programverification. External pullups are requ</p><p><b> Port 1</b></p><
29、;p> Port 1 is an 8-bit bi-directional I/O port with internal pullups.The Port 1 output buffers can sink/source four TTL inputs.When 1s are written to Port 1 pins they are pulled high by the internal pullups and can b
30、e used as inputs. As inputs,Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pullups.Port 1 also receives the low-order address bytes during Flash programming and verific
31、ation.</p><p><b> Port 2</b></p><p> Port 2 is an 8-bit bi-directional I/O port with internal pullups.The Port 2 output buffers can sink/source four TTL inputs.When 1s are written
32、to Port 2 pins they are pulled high by the internal pullups and can be used as inputs. As inputs,Port 2 pins that are externally being pulled low will source current, because of the internal pullups.Port 2 emits the high
33、-order address byte during fetches from external program memory and during accesses to external data memory that use 16-bit addresses. In</p><p><b> Port 3</b></p><p> Port 3 is an
34、 8-bit bi-directional I/O port with internal pullups.The Port 3 output buffers can sink/source four TTL inputs.When 1s are written to Port 3 pins they are pulled high by the internal pullups and can be used as inputs. As
35、 inputs,Port 3 pins that are externally being pulled low will source current (IIL) because of the pullups.Port 3 also serves the functions of various special features of the AT89C51 as listed below:</p><p>
36、 Port 3 also receives some control signals for Flash programming and verification.</p><p><b> RST</b></p><p> Reset input. A high on this pin for two machine cycles while the osci
37、llator is running resets the device.</p><p><b> ALE/PROG</b></p><p> Address Latch Enable output pulse for latching the low byte of the address during accesses to external memory.
38、This pin is also the program pulse input (PROG) during Flash programming.In normal operation ALE is emitted at a constant rate of 1/6 the oscillator frequency, and may be used for external timing or clocking purposes. No
39、te, however, that one ALE pulse is skipped during each access to external Data Memory.</p><p> If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active
40、 only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode.</p><p><b> PSEN</b
41、></p><p> Program Store Enable is the read strobe to external program memory.When the AT89C51 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two P
42、SEN activations are skipped during each access to external data memory.</p><p><b> EA/VPP</b></p><p> External Access Enable. EA must be strapped to GND in order to enable the devi
43、ce to fetch code from external program memory locations starting at 0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset.EA should be strapped to VCC for internal pro
44、gram executions.This pin also receives the 12-volt programming enable voltage(VPP) during Flash programming, for parts that require12-volt VPP.</p><p><b> XTAL1</b></p><p> Input t
45、o the inverting oscillator amplifier and input to the internal clock operating circuit.</p><p><b> XTAL2</b></p><p> Output from the inverting oscillator amplifier.</p><
46、p> Oscillator Characteristics</p><p> XTAL1 and XTAL2 are the input and output, respectively,of an inverting amplifier which can be configured for use as an on-chip oscillator, as shown in Figure 1.Eith
47、er a quartz crystal or ceramic resonator may be used. To drive the device from an external clock source, XTAL2 should be left unconnected while XTAL1 is driven as shown in Figure 2.There are no requirements on the duty c
48、ycle of the external clock signal, since the input to the internal clocking circuitry is through a divide-by-two fli</p><p> Figure 1. Oscillator Connections Figure 2. External Clock Drive Configu
49、ration</p><p><b> Idle Mode</b></p><p> In idle mode, the CPU puts itself to sleep while all the onchip peripherals remain active. The mode is invoked by software. The content of t
50、he on-chip RAM and all the special functions registers remain unchanged during this mode. The idle mode can be terminated by any enabled interrupt or by a hardware reset.It should be noted that when idle is terminated by
51、 a hard ware reset, the device normally resumes program execution,from where it left off, up to two machine cycles before the internal reset</p><p> Power-down Mode</p><p> In the power-down m
52、ode, the oscillator is stopped, and the instruction that invokes power-down is the last instruction executed. The on-chip RAM and Special Function Registers retain their values until the power-down mode is terminated. Th
53、e only exit from power-down is a hardware reset. Reset redefines the SFRs but does not change the on-chip RAM. The reset should not be activated before VCC is restored to its normal operating level and must be held activ
54、e long enough to allow the oscillator to </p><p> Program Memory Lock Bits</p><p> On the chip are three lock bits which can be left unprogrammed (U) or can be programmed (P) to obtain the add
55、itional features listed in the table below.</p><p> When lock bit 1 is programmed, the logic level at the EA pin is sampled and latched during reset. If the device is powered up without a reset, the latch i
56、nitializes to a random value, and holds that value until reset is activated. It is necessary that the latched value of EA be in agreement with the current logic level at that pin in order for the device to function prope
溫馨提示
- 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. 眾賞文庫僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 外文文獻(xiàn)及翻譯-- 51單片機簡介
- 單片機外文翻譯-----單片機簡介
- 單片機外文翻譯 ----at89c51單片機介紹
- 單片機外文翻譯----51系列單片機的結(jié)構(gòu)和功能
- at89s51單片機外文翻譯
- at89c51單片機外文翻譯
- 89c51單片機外文翻譯
- 單片機畢業(yè)設(shè)計外文翻譯單片機at89c51
- 單片機外文翻譯--51單片機在編程電路中的應(yīng)用
- 畢業(yè)論文外文翻譯-單片機簡介
- 單片機外文翻譯--51單片機在編程電路中的應(yīng)用 (2)
- at89c52單片機簡介外文翻譯
- 單片機相關(guān)外文翻譯-- mcs -51系列單片機的功能和結(jié)構(gòu)
- 外文翻譯--at89c51單片機的介紹
- 外文翻譯--51系列單片機的功能和結(jié)構(gòu)
- 51單片機
- 單片機外文翻譯
- 單片機外文翻譯
- 單片機相關(guān)外文翻譯--mcs-51系列單片機的功能和結(jié)構(gòu)
- 8051單片機硬件簡介畢業(yè)論文外文翻譯
評論
0/150
提交評論