【正文】
te 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ǔ)和 信息的 傳遞。這種 主要將系統(tǒng)分成 三個(gè)主要單元的分離方法是馮 諾依曼在 20 世紀(jì) 40 年代所設(shè)想出來的,并且是針對微計(jì)算機(jī)的設(shè)想。要在一個(gè) 以 微處理器 為基礎(chǔ)的 時(shí)鐘中找出執(zhí)行 具有 計(jì)數(shù)功能的一個(gè)特殊 的 硬件 組成部分 是不可能的,因?yàn)闀r(shí)間存儲(chǔ)在存儲(chǔ)器中,而在固定的時(shí)間間隔下由微處理器控制增值。 圖 微型計(jì)算機(jī)的三個(gè)組成部分 圖 在一個(gè)微處理器控制系統(tǒng)中 是如何按照機(jī)器中的信息通信方式而聯(lián)接起來的。 在每一種情況下, 由于概念上的計(jì)算機(jī)存儲(chǔ)器更像一個(gè)公文柜,上述的 “存儲(chǔ)器 ”一詞是非常不恰當(dāng)?shù)?;信?被 存放在一系列已 數(shù)字標(biāo)記過的 的 “箱子 ”中,而且可 以按照 問題由 “箱子 ”的序列號進(jìn) 行 相關(guān) 信息的參考定位。 ROM可像 RAM一樣被讀取,但與 RAM不一樣的是不能用來存儲(chǔ)可變的信息。 微處理器在程序控制下處理數(shù)據(jù),并控制流向和來自存儲(chǔ)器和輸入 /輸出裝置的信息流。這通常是低成本應(yīng)用情況,例如用于微波爐和自動(dòng)洗衣機(jī)的控制器。 微計(jì)算機(jī)的另一主要工程應(yīng)用是在過程控制中??刹捎脙煞N處理,將控制器做成一種通用的微計(jì)算機(jī),正像較強(qiáng)版本的業(yè)余計(jì)算機(jī)那樣;或者做成 “包裹 ”式系統(tǒng),按照像電磁繼電器那樣的較老式的技術(shù)進(jìn)行設(shè)計(jì),來取 代控制器。 盡管大規(guī)模集成電路的應(yīng)用使小型和微型計(jì)算機(jī)的差別變得 “模糊 ”,更復(fù)雜的11 過程控制器需要小型計(jì)算機(jī)實(shí)現(xiàn)他們 的過程。壓力是一種普遍的工藝狀態(tài),它也是這個(gè)星球上的一個(gè)生活條件:我們生活在向上延伸許多英里的大氣海洋的底部。壓力的測量和控制,或者壓力的不足—真空,在典型的過程控制中是極為重要的。壓力測量是一個(gè)例外,但是,如果要離測量點(diǎn)幾百英尺外指示或記錄某種危險(xiǎn)化學(xué)品的高壓,就會(huì)有來自這個(gè)壓力所載的化學(xué)品所引 發(fā)的危險(xiǎn)。這也是最少數(shù)量的操作者有效的運(yùn)行工廠成為現(xiàn)實(shí)。氣動(dòng)變送器的標(biāo)準(zhǔn)輸出范圍是 20~ 100kPa,這信號幾乎在全球使用?;谟?jì)算機(jī)或微處理器的儀器或控制系統(tǒng)的應(yīng)用正推動(dòng)這類信號的應(yīng)用不斷增加。這里,輸出的電信號( 4~ 20mA DC),而輸入的過程壓力( 0~ 600kPa),這樣增益就為 : 12 此外我們在本設(shè)計(jì)中還必須對溫度進(jìn)行測量,溫度測 量在工業(yè)控制中是很重要的,因?yàn)樗鳛橄到y(tǒng)或產(chǎn)品狀態(tài)的直接指標(biāo),或者作為如反應(yīng)率、能量流、渦輪機(jī)效率和潤滑質(zhì)量等間接指標(biāo)。 電氣系統(tǒng)的優(yōu)點(diǎn)包括高的精度和靈敏度,能實(shí)現(xiàn)開關(guān)切換或掃描多個(gè)測量點(diǎn),可在測量元件和控制器之間長距離傳輸,出現(xiàn)事故時(shí)可 調(diào)換元件,快速響應(yīng),以及具有測量高溫的能力。片上閃存程序存儲(chǔ)器可以編程就可以在系統(tǒng)或由傳統(tǒng)的非易失性存儲(chǔ)器編程??臻e模式時(shí) CPU停止工作,而 RAM,定時(shí) /計(jì)數(shù)器,串行口和中斷系統(tǒng)繼續(xù)工作。 P0口 : kPamAkPamAkPakPa mAmAKr 420 ?????13 P0口為一個(gè) 8位漏級開路雙向 I/O口,每腳可吸收 8TTL門電流。 P1口: P1口是一個(gè)內(nèi)部提供上拉電阻的 8位雙向 I/O口, P1口緩沖器能接收輸出 4TTL門電流。并因此作為輸入時(shí), P2口的管腳被外部拉低,將輸出電流。 P2口在 FLASH編程和校驗(yàn)時(shí)接收高 八位地址信號和控制信號。 RST 復(fù)位輸入。請注意,但是,一個(gè) ALE脈沖被跳過在每次訪問外部數(shù)據(jù)存儲(chǔ)器。設(shè)置的 ALE 禁用位微控14 制器沒有影響,如果在外部執(zhí)行模式。因 此它可用作對外部輸出的脈沖或用于定時(shí)目的。另外,該引腳被略微拉高。但在訪問外部數(shù)據(jù)存儲(chǔ)器時(shí),這兩次有效的 /PSEN信號將不出現(xiàn)。 XTAL1:反向振蕩放大器的輸入及內(nèi)部時(shí)鐘工作電路的輸入。石晶振蕩和陶瓷振蕩均可