【正文】
n, the only I/O device readable by a human is a single lightemitting diode, and severe cost or power constraints can even eliminate that. In contrast to generalpurpose CPUs, microcontrollers do not have an address bus or a data bus, because they integrate all the RAM and nonvolatile memory on the same chip as the CPU. Because they need fewer pins, the chip can be placed in a much smaller, cheaper package. Integrating the memory and other peripherals on a single chip and testing them as a unit increases the cost of that chip, but often results in decreased cost of the embedded system as a whole. (Even if the cost of a CPU that has integrated peripherals is slightly more than the cost of a CPU + external peripherals, having fewer chips typically allows a smaller and cheaper circuit board, and reduces the labor required to assemble and test the circuit board). This trend leads to design. A microcontroller is a single integrated circuit, monly with the following features: central processing unit ranging from small and simple 4bit processors to sophisticated 32 or 64bit processors input/output interfaces such as serial ports (UARTs) other serial munications interfaces like I178。s memory. Depending on the device, the program memory may be permanent, readonly memory that can only be programmed at the factory, or program memory may be fieldalterable flash or erasable readonly memory. Since embedded processors are usually used to control devices, they sometimes need to accept input from the device they are controlling. This is the purpose of the analog to digital converter. Since processors are built to interpret and process digital data, . 1s and 0s, they won39。由于其發(fā)展非常迅速,舊的單片機(jī)的定義已不能滿足,所以在很多應(yīng)用場合被稱為范圍更廣的微控制器,但是目前在中國大陸仍多沿用 “單片機(jī) ”的稱呼。這樣就可以很容易的把單片機(jī)系統(tǒng)植入裝置內(nèi)部來控制裝置了。比如說,片上沒有數(shù)據(jù)存儲器,就必須要添加一些 RAM 的存儲芯片,雖然所添加存儲器的容量很靈活,但是至少還是要添加,另外還需要添加很多連線來傳遞芯片之間的數(shù)據(jù)。 一些現(xiàn)代的微控制器支持一些內(nèi)建的高級編程語言,比如 BASIC語言。除了通常的算術(shù)和邏輯要素 等 一般用途的微處理器,微控制器 還 集成了更多的要素,如讀寫存儲器的數(shù)據(jù)存儲,只讀存儲器 的 存儲程序,快閃記憶體的永久數(shù)據(jù)存儲,外設(shè),和輸入 /輸出接口。 微控制器 廣泛應(yīng) 用于自動控制產(chǎn)品和設(shè)備,如汽車發(fā)動機(jī)控制系統(tǒng),遠(yuǎn)程控制 系統(tǒng) ,辦公室機(jī)器 設(shè)備系統(tǒng) ,家用電器,電動工具,和玩具 等 。有些嵌入式系統(tǒng)是非常復(fù)雜的,很多 能夠達(dá)到 人 們的 要求 ,但由于 內(nèi)存和程序長度 的限制 ,軟件的復(fù)雜性 降低 。當(dāng)某些事件發(fā)生時,中斷系統(tǒng)能夠 讓 信號處理器暫停處理當(dāng)前的指令序列,并開始了中斷服務(wù)。 單片機(jī)程序必須符合現(xiàn)有的芯片程序存儲器 的要求 ,因為這將是代價高昂的系統(tǒng)提供了與外部 設(shè)備之間 可 以 擴(kuò)展 的存儲器 。 由于嵌入式處理器通常是 用來控制設(shè)備 的 ,他們有時需要接受輸入 設(shè)備 的 數(shù)據(jù)輸入,但 由于處理器內(nèi)置處理數(shù)數(shù)據(jù) 只有 1和 0 , 所以 它們將無法 直接處理 任何模擬信號。最常見的一種類型的 轉(zhuǎn)換器 是可編程間隔定時 轉(zhuǎn)換 器 。