【正文】
source current (IIL) because of the internal 1 also receives the loworder address bytes during Flash programming and verification. Port 2 Port 2 is an 8bit bidirectional I/O port with internal Port 2 output buffers can sink/source four TTL 1s are written to Port 2 pins they are pulled high by the internal pullups and can 7 be used as inputs. As inputs,Port 2 pins that are externally being pulled low will source current, because of the internal 2 emits the highorder address byte during fetches from external program memory and during accesses to external data memory that use 16bit addresses. In this application, it uses strong internal pullupswhen emitting 1s. During accesses to external data memory that use 8bit addresses, Port 2 emits the contents of the P2 Special Function 2 also receives the highorder address bits and some control signals during Flash programming and verification. Port 3 Port 3 is an 8bit bidirectional I/O port with internal Port 3 output buffers can sink/source four TTL 1s are written to Port 3 pins they are pulled high by the internal pullups and can be used as inputs. As inputs,Port 3 pins that are externally being pulled low will source current (IIL) because of the 3 also serves the functions of various special features of the AT89C51 as listed below: Port 3 also receives some control signals for Flash programming and verification. RST Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device. ALE/PROG Address Latch Enable 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 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. PSEN Program Store Enable is the read strobe to external program the AT89C51 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory. 8 EA/VPP External Access Enable. EA must be strapped to GND in order to enable the device 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 should be strapped to VCC for internal program pin also receives the 12volt programming enable voltage(VPP) during Flash programming, for parts that require12volt VPP. XTAL1 Input to the inverting oscillator amplifier and input to the internal clock operating circuit. XTAL2 Output from the inverting oscillator amplifier. Oscillator Characteristics XTAL1 and XTAL2 are the input and output, respectively,of an inverting amplifier which can be configured for use as an onchip oscillator, as shown in Figure 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 are no requirements on the duty cycle of the external clock signal, since the input to the internal clocking circuitry is through a dividebytwo flipflop, but minimum and maximum voltage high and low time specifications must be observed. 微型計(jì)算機(jī)控制 系統(tǒng) (單片機(jī)控制系統(tǒng)) 廣義地說, 微型計(jì)算機(jī)控制系統(tǒng)(單片機(jī)控制系統(tǒng)) 是用于處理信息的,這種 被用于處理的 信息可以是電話交談, 也可以是 儀器 的 讀數(shù)或 者是一個(gè) 企業(yè) 的 帳戶,但是各種情況下都涉及 到 相同的主要操作:信息 的 處理 、信息的 存儲(chǔ)和 信息的 傳遞。在常規(guī)的電子設(shè)計(jì)中,這些操作都是以功能平臺(tái)方式組合起來的,例如計(jì)數(shù)器,無論是電子 計(jì)數(shù)器 還是機(jī)械 計(jì)數(shù)器 ,都要存儲(chǔ)當(dāng)前 的數(shù)值 , 并且 按要求將該 數(shù)值 增 加 1。 一個(gè)系統(tǒng)例如 采用計(jì)數(shù)器的電子鐘之類的任一系統(tǒng)要使其存儲(chǔ)和處理能力遍布整個(gè)系統(tǒng),因?yàn)槊總€(gè)計(jì)數(shù)器都能存儲(chǔ)和處理一些 數(shù)字。 現(xiàn)如今,以微處理器為基礎(chǔ)的 系統(tǒng) 從常規(guī)的處理方法中分離了出來 ,它將 信息的9 處理, 信息的 存儲(chǔ)和 信息的 傳輸三個(gè)功能分離形成不同的系統(tǒng)單元。這種 主要將系統(tǒng)分成 三個(gè)主要單元的分離方法是馮 諾依曼在 20 世紀(jì) 40 年代所設(shè)想出來的,并且是針對微計(jì)算機(jī)的設(shè)想。從此 以后基本上 所有制成的計(jì)算機(jī)都是用這種結(jié)構(gòu)設(shè)計(jì)的,盡管 他們 包含 著 寬廣的物理形式 與物理結(jié)構(gòu) , 但 從根本上來說他們均是具有相同基本設(shè)計(jì) 的計(jì)算機(jī) 。 在 以微處理器為基礎(chǔ)的 系統(tǒng)中,處理是由 以微處理器為基礎(chǔ)的 系統(tǒng) 自身 完成的。存儲(chǔ)是利用存儲(chǔ)器電路,而 從系統(tǒng)中輸入和輸出 的信息傳輸 則是利用特定的輸入 /輸出( I/O)電路。要在一個(gè) 以 微處理器 為基礎(chǔ)的 時(shí)鐘中找出執(zhí)行 具有 計(jì)數(shù)功能的一個(gè)特殊 的 硬件 組成部分 是不可能的,因?yàn)闀r(shí)間存儲(chǔ)在存儲(chǔ)器中,而在固定的時(shí)間間隔下由微處理器控制增值。但是,規(guī)定系統(tǒng)運(yùn)轉(zhuǎn)過程的軟件 卻規(guī)定了 包含實(shí)現(xiàn)計(jì)數(shù)器 計(jì)數(shù)功能的單元 部分 。由于系統(tǒng)幾乎完全由軟件所定義,所以對微處理器結(jié)構(gòu)和其輔助電路這種看起來非常抽象的處理方法使其在應(yīng)用時(shí)非常靈活。這種設(shè)計(jì)過程主要是軟件工程,而且在生產(chǎn)軟件時(shí),就會(huì)遇到產(chǎn)生于常規(guī)工程中相似的構(gòu)造和維護(hù)問題。 圖 微型計(jì)算機(jī)的三個(gè)組成部分 圖 在一個(gè)微處理器控制系統(tǒng)中 是如何按照機(jī)器中的信息通信方式而聯(lián)接起來的。該系統(tǒng)由微處理器控制,微處理器 能夠?qū)ζ渥陨淼?存儲(chǔ)器和輸入 /輸出單元的信息傳輸 進(jìn)行管理 。外部的連接 部分 與工程系統(tǒng) 中 的其余部分(即非計(jì)算機(jī)部分)有關(guān)。 盡管圖中顯示的只有一個(gè)存儲(chǔ)單元, 但是在 實(shí)際中 卻 有 RAM和 ROM兩種不同的存儲(chǔ)器被使用。 在每一種情況下, 由于概念上的計(jì)算機(jī)存儲(chǔ)器更像一個(gè)公文柜,上述的 “存儲(chǔ)器 ”一詞是非常不恰當(dāng)?shù)模恍畔?被 存放在一系列已 數(shù)字標(biāo)記過的 的 “箱子 ”中,而且可 以按照 問題由 “箱子 ”的序列號(hào)進(jìn) 行 相關(guān) 信息的參考定位。 微計(jì)算機(jī) 控制系統(tǒng)經(jīng)常 使用 RAM(隨機(jī)存取存儲(chǔ)器),在 RAM中 , 數(shù)據(jù) 可以 被寫入,并且在需要 的時(shí)候,可以 被再次讀出。這種數(shù)據(jù)能以 任意一種 所希望的次序從存儲(chǔ)器中