【正文】
MOVX RI)訪問外部數(shù)據(jù)存儲器時, P2口輸出 P2鎖存器的內(nèi)容。 設(shè)計巴巴工作室 P3 口: P3口是一個具有內(nèi)部上拉電阻的 8 位雙向 I/O 口, p2輸出緩沖器能驅(qū)動 4個 TTL 邏輯電平。作為輸入使用時,被外 部拉低的引腳由于內(nèi)部電阻的原因,將輸出電流( IIL)。在 flash編程和校驗時, P3口也接收一些控制信號。晶振工作時, RST 腳持續(xù) 2 個機(jī)器周期高電平將使單片機(jī)復(fù)位。特殊寄存器 AUXR(地址 8EH)上的 DISRTO 位可以使此功能無效。 ALE/ PROG : 地址鎖存控制信號( ALE)是訪問外部程序存儲器時,鎖存低 8位地址的輸出脈沖。 在一般情況下, ALE 以晶振六分之一的固定頻率輸出脈沖,可用來作為外部定時器或時鐘使用。 如果需要,通過將地址為 8EH 的 SFR 的第 0 位置“ 1”, ALE 操作將無效。否則, ALE 將被微弱拉高。 PSEN :外部程序存儲器選通信號( PSEN )是外部程序存儲器選通信號。 EA /VPP:訪問外部程序存儲器控制信號。 為了執(zhí)行 內(nèi)部程序指令, EA 應(yīng)該接 VCC。 XTAL1:振蕩器反相放大器和內(nèi)部時鐘發(fā)生電路的輸入端。 存儲器結(jié)構(gòu) MCS51器件有單獨的程序存儲器和數(shù)據(jù)存儲器。 程序存儲器: 如果 EA 引腳接地,程序讀取只從外部存儲器開始。 中斷 AT89S52有 6個中斷源:兩個外部中斷( INT0 和 INT1 ),三個定時中斷(定時器 0、 2)和一個串行中斷。 IE還包括一個中斷允許總控制位 EA,它能一次禁止所有中斷。對于 AT89S52, 位也是不能用的。它們?yōu)?AT89系列新產(chǎn)品預(yù)留。程序進(jìn)入中斷服務(wù)后,這些標(biāo)志位都可以由硬件清 0。 定時器 0和定時器 1標(biāo)志位 TF0 和 TF1在計數(shù)溢出的那個周期的 S5P2被置位。然而,定時器 2的標(biāo)志位 TF2在計數(shù)溢出的那個周期的 S2P2被置位,在同一個周期被電路捕捉下來。 Products ? 8K Bytes of InSystem Programmable (ISP) Flash Memory ? 1000 Write/Erase Cycles ? Fully Static Operation: 0 Hz to 33 MHz ? Threelevel Program Memory Lock ? 256 x 8bit Internal RAM ? 32 Programmable I/O Lines ? Three 16bit Timer/Counters ? Eight Interrupt Sources ? Full Duplex UART Serial Channel ? Lowpower Idle and Powerdown Modes ? Interrupt Recovery from Powerdown Mode ? Watchdog Timer ? Dual Data Pointer ? Poweroff Flag Description The AT89S52 is a lowpower, highperformance CMOS 8bit microcontroller with 8K bytes of insystem programmable Flash memory. The device is manufactured using Atmel’s highdensity nonvolatile memory technology and is patible with the industry standard 80C51 instruction set and pinout. The onchip Flash allows the programmemory to be reprogrammed insystem or by a conventional nonvolatile memory bining a versatile 8bit CPU with in system programmable Flash on a monolithicchip, the Atmel AT89S52 is a powerful icrocontroller which provides a highlyflexible and costeffective solution to many embedded control AT89S52 provides the following tandard features: 8K bytes of Flash, 256 bytes of RAM, 32 I/O lines, 設(shè)計巴巴工作室 Watchdog timer, two data pointers, three 16bit timer/counters, a sixvector twolevel interrupt architecture, a full duplex 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 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 interrupt or hardware reset. Pin Configurations Block Diagram 設(shè)計巴巴工作室 Pin Description VCC Supply voltage. GND Groun