【正文】
號拉低時會輸出一個電流。 掉電方式保存 RAM 中的內(nèi)容,但振蕩器停止工作并禁止其它所有部件工作直到下一個硬件復(fù)位。ALE/ PROG : Address Latch Enable is an output pulse for latching the low byte of the address during accesses to external memory. 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. Note, however, that one ALE pulse is skipped during each access to external data memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALEdisable bit has no effect if the microcontroller is in external execution mode. 外文 原文 AT89S52 Description The AT89s52 is a lowpower, highperformance CMOS 8bit microputer with 8K bytes of Flash programmable and erasable read only memory(PEROM). The device is manufactured using Atmel’s highdensity nonvolatile memory technology and is patible with the industrystandard 80C51 and 80C52 instruction set and pinout. The onchip Flash allows the program memory to be reprogrammed insystem or by a conventional nonvolatile memory programmer. By bining a versatile 8bit CPU with Flash on a monolithic chip, the Atmel AT89s52 is a powerful microputer which provides a highlyflexible and costeffective solution to many embedded control applications. Pin Configurations: The AT89s52 provides the following standard features: 8K bytes of Flash, 256 bytes of RAM, 32 I/O lines, three 16bittimer/counters, a sixvector twolevel interrupt architecture, a fullduplex serial port, onchip oscillator, and clock circuitry. In addition, the AT89s52 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port, and interrupt system to continue functioning. The Powerdown mode saves the RAM contents but freezes the oscillator, disabling all other chip functions until the next hardware reset. Pin Description RST: Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device. 空閑方式停止 CPU 工作,但允許 RAM,定時 /計數(shù)器,串行通信口及中斷系統(tǒng)繼續(xù)工作。 在 Flash 編程時, P0 口接收指令字節(jié),而在程序校驗時,輸出指令字節(jié),校驗時,要求外接上拉電阻。P2 口: P2 是一個但帶有內(nèi)部上拉電阻的 8 位雙向 I/O 口, P2 的輸出緩沖級可驅(qū)動 (吸收或輸出電流 )4個 TTL邏輯門路。對 P3口寫入 “1”時,它們被內(nèi)部上拉電阻拉高并可作為輸入端口。ALE/ PROG :當(dāng)訪問外部程序存儲器或數(shù)據(jù)存儲器時, ALE(地址鎖存允許 )輸出脈沖用于鎖存地址的低 8 位字節(jié)。PSEN :程序存儲器 ( PSEN )輸出是外部程序存儲器的讀選通信號,當(dāng) AT89S52由外部程序存儲器取指令 (或數(shù)據(jù))時,每個機器周期兩次 PSEN 有效,即輸出兩個脈沖。 用戶也可以采用外部時鐘。程序會首先響應(yīng)中斷,進入中斷服務(wù)程序,執(zhí)行完中斷服務(wù)程序并僅隨終端返回指令,下一條要執(zhí)行的指令就是使單片機進入空閑 模式那條指令后面的一條指令。此外,加密位只能通過整片擦除的方法清除。 4.在高電壓編程方式時,將 ^EA/VPP 端加上 +12V編程電壓。加密位不可能直接變化。 (032H)=05H聲明為 5V編程電壓。用于聲明該器件的廠商、型號和編程電壓。寫周期完成后,有效的數(shù)據(jù)就會出現(xiàn)在所有輸出端上,此時,可進入下一個字節(jié)的寫周期,寫周期開始后,可在任意時刻進行數(shù)據(jù)查詢。 Vpp=12v Vpp=5v 芯片頂面標(biāo)識 at89s52 xxxx yyww at89s52 xxxx5 yyww 簽名字節(jié) (030H)=1EH (031H)=51H (032H)=FFH (030H)=1EH (031H)=51H (032H)=05H AT89S52的程序存儲器陣列是采用字節(jié)寫入方式編程的,每次寫入一個字節(jié),要對整個芯片內(nèi)的 PEROM 程序存儲器寫入一個非空字節(jié),必須使用片擦除的方式將整個存儲器的內(nèi)容清除。退出掉電模式的唯一方法是硬件復(fù)位,復(fù)位后將重新定義全部特殊功能寄存器但不改變 RAM中的內(nèi)容,在 VCC 恢復(fù)到正常工作電平前,復(fù)位應(yīng)無效,且 必須保持一定時間以使振蕩器重啟動并穩(wěn)定工作。 空閑模式: 在空閑工作模式狀態(tài), CPU 保持睡眠狀態(tài)而所有片內(nèi)的外設(shè)仍保持激活狀態(tài),這種方式由軟件產(chǎn)生。 時鐘振蕩器: AT89s52 中有一個用于構(gòu)成內(nèi)部振蕩器的高增益反相放大器,引腳 XTAL1 和 XTAL2 分別是該放大器的輸入端和輸出端。欲使 CPU 僅訪問外部程序存儲器 (地址為0000H—FFFFH), EA端必須保持低電平 (接地 )。 如有必要,可通過對特殊功能寄存器 (SFR)區(qū)中的 8EH單元的 D0 位置,可禁止 ALE 操作。 Flash編程或校驗時, P2亦接收高位地址和一些控制信號。作輸出口使用時,因為內(nèi)部存在上拉電阻,某個引腳被外部信號拉低時輸出一個電流 (IIL )。GND: 地 XTAL1I: nput to the inverting oscillator amplifier and input to the internal clock operating circuit. Port 0: Port 0 is an 8bit