【正文】
生產(chǎn)成本。 在改變系統(tǒng)中單片機(jī)執(zhí)行的應(yīng)用程序時,為了避免直接在單片機(jī)系統(tǒng)上進(jìn)行操作,常規(guī)的做法是用可下載的只讀存儲器來存儲應(yīng)用程序,即寫入到單片機(jī)掩模 ROM 中的裝載程序,單片機(jī)的掩模 ROM 集成到單片機(jī)中,并在生產(chǎn)單片機(jī)時一次性編程寫入。由于電路體積小,布線密集,而測試設(shè)備中使用的探針容易損壞,用起來很麻煩,就可能與 電路接觸不好。 應(yīng)用程序在寫入到存儲器中后就開始執(zhí)行,以便由單片機(jī)來執(zhí)行,單片機(jī)系統(tǒng)有可能不會像預(yù)期的那樣工作。 “計算機(jī) ”的這些其他元件是數(shù)據(jù)處理或存儲裝置,例如包含待執(zhí)行的只讀或隨機(jī)存儲器,時鐘和接口(串行或并行)。 準(zhǔn)確地說,這項發(fā)明涉及單片機(jī)集成電路,單片機(jī)通常是包含一臺“計算機(jī)”的全部或大部分元件的大規(guī)模集成電路,其功能不是預(yù)先確定的,而是取決于它執(zhí)行程序??刹捎脙煞N處理,將控制器做成一種通用的微計算機(jī),正像較強(qiáng)版本的業(yè)余計算機(jī)那樣;或者做成“包裹”式系統(tǒng),按照像電磁繼電器那樣的較老式的技術(shù)進(jìn)行設(shè)計,來取代控制器。 微計算機(jī)的另一主要工程應(yīng)用是在過程控制中。另有新 類型的期器件不必用紫外線燈而用電察除,所以稱為電可察除可編程只讀存儲器 EEPROM。另一類型 ROM(只讀存儲器)用來保持不受微處理器影響的固定的信息標(biāo)本;這些標(biāo)本在電源切斷后不會丟失,并通常用來保存規(guī)定微處理器化系統(tǒng)運(yùn)轉(zhuǎn)過程的程序。由于系統(tǒng)幾乎完全由軟件所定義,所以對微處理器結(jié)構(gòu)和其輔助電路這種看起來非常抽象的處理方法使其在應(yīng)用時非常靈活。 在微處理器系統(tǒng)中,處理是由微處理器本身完成的。這種通用程序具有將數(shù)據(jù)寫到數(shù)據(jù)處理和,或存儲設(shè)備的基本功能,寫入功能用于裝載程序,因為裝載程序并非永久地存儲在只讀存儲器重,所以可對單片機(jī)進(jìn)行測試,而與應(yīng)用程序無關(guān),并保持系統(tǒng)中能用的存儲器元件為標(biāo)準(zhǔn)類型。但是,規(guī)定系統(tǒng)運(yùn)轉(zhuǎn)過程的軟件包含實現(xiàn)計數(shù)器功能的單元。這種數(shù)據(jù) 能以任一所希望的次序從存儲器中讀出,不必按寫入時的相同次序,所以有“隨機(jī)” 存取存儲器。被廣泛使用的可編程 ROM 可利用特殊紫外線燈察除,并被成為 E PROM,即可察除可編程只讀存儲器的縮寫。大多數(shù)類型的 I/O 裝置在某種程度下可編程,允許不同形式的操作,而有些則包含特殊用途微處理器的 I/O 裝置不用主微處理器的直接干預(yù),就可實施非常復(fù)雜的操作。而且,過程控制器通常更為復(fù)雜,所以要將他們做成單獨(dú)的集成電路就更為困難。另一種選擇是將程序在 ROM 中,這樣他們就變成電子“硬件”的 一部分并常被稱為“固件”。換言之,其他元件就集成到單片機(jī)或輔助電路中。 在多數(shù)現(xiàn)實應(yīng)用中,由于應(yīng)用程序太大,單片機(jī)無法存儲,因此就存儲在單片機(jī)的外部存儲器中,這種只讀處而不能寫入的程序存儲器通常就是可編程只讀存儲器。 采用測試設(shè)備對于單片機(jī)的系統(tǒng)進(jìn)行故障診斷,其相關(guān)問題還有很多。單片機(jī)系統(tǒng)的這種故障診斷即費(fèi)時又麻煩,成本也高。 由于編程參數(shù)(編程電壓,外加電壓的持續(xù)時間等)隨著采用的技術(shù)而變化,每一種可編程存儲器以對應(yīng)的轉(zhuǎn)載程序密切相關(guān),裝載程序一次性寫進(jìn)單片機(jī)內(nèi)部的掩模存儲器中,存儲器因而就 限制為裝載程序要寫入的存儲器類型。 這項發(fā)明的另一個目的是提供一種單片機(jī)芯片,在系統(tǒng)出現(xiàn)故障時,可以借助于單片機(jī)準(zhǔn)確地定位系統(tǒng)中失效的器件。 the controller can be implemented as a generalpurpose microputer rather like a more robust version lf a hobby puter, or as a ?packaged? system, signed for replacing controllers based on older technologies such as electromagic relays. In the former case the system would probably be programmed in conventional programming languages such as the ones to9 be introduced later, while in the other case a specialpurpose language might be used, for example one which allowed the function of the controller to be described in terms of relay interconnections, In either case programs can be stored in RAM, which allows them to be altered to suit changes in application, but this makes the overall system vulnerable to loss lf power unless batteries are used to ensure continuity of supply. Alternatively programs can be stored in ROM, in which case they virtually bee part of the electronic ?hardware? and are often referred to as firmware. To be more precise ,the invention concerns a microcontroller integrated circuit .A microcontroller is usually a VLSI(Very Large Scale Integration) integrated circuit containing all or most of the ponents of a “puter”. Its function is not predefined but depends on the program that it executes. A microcontroller necessarily prises a processor core including a mand sequence (which is a device distributing various control signals to the instructions of a program),an arithmetic and logic unit (for processing the data) and registers(which are specialized memory units). The other ponents of the “puter” can be either internal or external to the microco