【正文】
接口電路部分的設(shè)計是使用微機(jī)的工程師所面臨最重要的任務(wù)之一。讀簽名字節(jié)的過程和單元030H、031H 和032H的正常校驗(yàn)相仿, 保持低電平,返回值意義如下:(030H) = 1EH 聲明產(chǎn)品由ATMEL 公司制造。激活相應(yīng)的控制信號。要注意的是,每當(dāng)訪問外部數(shù)據(jù)存儲器時將跳過一個ALE 脈沖。P2 口:P2 是一個帶有內(nèi)部上拉電阻的8 位雙向I/O 口,P2 的輸出緩沖級可驅(qū)動(吸收或輸出電流)4 個TTL 邏輯門電路。同時,AT89C51 降至0Hz 的靜態(tài)邏輯操作,并支持兩種可選的節(jié)電工作模式。本文討論了這種測試環(huán)境的設(shè)計和原理,它的和各種硬件、軟件環(huán)境部件的交互性,以及如何使用AT89C51。Intel 平臺工程部門開發(fā)了一種面向?qū)ο蟮挠糜隍?yàn)證它的AT89C51 汽車單片機(jī)多線性測試環(huán)境。這種系統(tǒng)的驗(yàn)證處理可以被分解為三個主要部分。作為輸入口使用時,因?yàn)閮?nèi)部存在上拉電阻,某個引腳被外部信號拉低時會輸出一個電流(IIL)。Flash 存儲器編程時,該引腳加上+12v 的編程允許電源Vpp,當(dāng)然這必須是該器件使用12v 編程電壓Vpp。89C51 的程序存儲器陣列是采用字節(jié)寫入方式編程的,每次寫入一個字符,要對整個芯片的EPROM 程序存儲器寫入一個非空字節(jié),必須使用片擦除的方法將整個存儲器的內(nèi)容清楚。圖211 編程電路 圖222 校驗(yàn)電路:利用控制信號的正確組合(表6)并保持ALE/PROG 引腳10ms 的低電平脈沖寬度即可將EPROM 陣列(4k 字節(jié))和三個加密位整片擦除,代碼陣列在片擦除操作中將任何非空單元寫入”1”,這步驟需在編程之前進(jìn)行。該子程序依次送出信息給輸出器件,產(chǎn)生相應(yīng)的電信號,由DAC 轉(zhuǎn)換成模擬形式。為了解決實(shí)際問題,一個單片機(jī)不僅包括CPU,程序和數(shù)據(jù)存儲器,另外,它必須含有通過CPU 訪問外部信息的硬件。(032H) = 05H 聲明為5 編程電壓。改變編程單元的地址和寫入的數(shù)據(jù),重復(fù)1—5 步驟,知道全部文件編程結(jié)束。這個放大器與作為反饋元件的片外石英晶體或陶瓷諧振器一起構(gòu)成自激振蕩器,振蕩電路參見圖5。該位置位后,只有一條MOVX 和MOVC 指令A(yù)LE 才會被激活。在訪問外部程序存儲器或16 位四肢的外部數(shù)據(jù)存儲器(例如執(zhí)行MOVX DPTR指令)時,P2 口送出高8 位地址數(shù)據(jù),在訪問8 位地址的外部數(shù)據(jù)存儲器(例如執(zhí)行MOVX RI 指令)時,P2 口線上的內(nèi)容(也即特殊功能寄存器(SFR)區(qū)中R2 寄存器的內(nèi)容),在整個訪問期間不改變。 圖121 AT89C51 方框圖商業(yè)應(yīng)用包括調(diào)制解調(diào)器,電動機(jī)控制系統(tǒng),打印機(jī),影印機(jī),空調(diào)控制系統(tǒng),磁盤驅(qū)動器和醫(yī)療設(shè)備。這些單片機(jī)的高速處理速度和增強(qiáng)型外圍設(shè)備集合使得它們適合于這種高速事件應(yīng)用場合。另外,部件的替代品領(lǐng)域是極其昂貴的,因?yàn)樵O(shè)備要用來把模塊典型地焊接成一個總體的價值比各個部件高幾倍。欲使CPU 僅訪問外部程序存儲器(地址為0000H—FFFFH),EA 端必須保持低電平(接地)。這種情況下,信號調(diào)理單元必須將輸入信號變換成為另一信號,也可直接與接口的下一部分,即微計算機(jī)本身的輸入輸出單元相連接。一些類型的串行口單元允許CPU 與外部設(shè)備進(jìn)行串口通信,用串口位代替平行位進(jìn)行通信需要少許的I/O 口,這樣使通信費(fèi)用降低但速度也相對慢些。在計算機(jī)之外,由電子系統(tǒng)所處理的信息以一種物理信號形式存在,但在程序中,它是用數(shù)字表示的。數(shù)據(jù)查詢89C51 單片機(jī)用數(shù)據(jù)查詢方式來檢測一個寫周期是否結(jié)束,在一個寫周期中,如需要讀取最后寫入的那個字節(jié),則讀出的數(shù)據(jù)的最高位()是原來寫入字節(jié)的最高位的反碼。10 Pf,而如使用陶瓷諧振器建議選擇40Pf177。PSEN:程序存儲允許輸出是外部程序存儲器的讀選通型號,當(dāng)89C51 由外部存儲器取指令(或數(shù)據(jù))時,每個機(jī)器周期兩次PSEN 有效,即輸出兩個脈沖。P3 口:P3 是一個帶有內(nèi)部上拉電阻的8 位雙向I/O 口,P3 的輸出緩沖級可驅(qū)動(吸收或輸出電流)4 個TTL 邏輯門電路。P0 口:P0 口是一組8 位漏極開路型雙向I/O 口,也即地址/數(shù)據(jù)總線復(fù)用。由于這些決定性應(yīng)用,市場需要一種可靠的具有低干擾潛伏響應(yīng)的費(fèi)用效能控制器,服務(wù)大量時間和事件驅(qū)動的在實(shí)時應(yīng)用需要的集成外圍的能力,具有在單一程序包中高出平均處理功率的中央處理器。AT89C51的概況The General Situation of AT89C51Chapter 1 The application of AT89C51Microcontrollers are used in a multitude of mercial applications such as modems, motorcontrol systems, air conditioner control systems, automotive engine and among others. The high processing speed and enhanced peripheral set of these microcontrollers make them suitable for such highspeed eventbased applications. However, these critical application domains also require that these microcontrollers are highly reliable. The high reliability and low market risks can be ensured by a robust testing process and a proper tools environment for the validation of these microcontrollers both at the ponent and at the system level. Intel Plaform Engineering department developed an objectoriented multithreaded test environment for the validation of its AT89C51 automotive microcontrollers. The goals of thisenvironment was not only to provide a robust testing environment for the AT89C51 automotive microcontrollers, but to develop an environment which can be easily extended and reused for the validation of several other future microcontrollers. The environment was developed in conjunction with Microsoft Foundation Classes (AT89C51). The paper describes the design and mechanism of this test environment, its interactions with various hardware/software environmental ponents, and how to use AT89C51. IntroductionThe 8bit AT89C51 CHMOS microcontrollers are designed to handle highspeedcalculations and fast input/output operations. MCS 51 microcontrollers are typically used for highspeed event control systems. Commercial applications include modems,motorcontrol systems, printers, photocopiers, air conditioner control systems, disk drives,and medical instruments. The automotive industry use MCS 51 microcontrollers in enginecontrol systems, airbags, suspension systems, and antilock braking systems (ABS). The AT89C51 is especially well suited to applications that benefit from its processing speed and enhanced onchip peripheral functions set, such as automotive powertrain control, vehicle dynamic suspension, antilock braking, and stability control applications. Because of these critical applications, the market requires a reliable costeffective controller with a low interrupt latency response, ability to service the high number of time and event driven integrated peripherals needed in real time applications, and a CPU with above average processing power in a single package. The financial and legal risk of having devices that operate