【正文】
不同作者編寫(xiě)程序時(shí),初始化堆棧指令也不完全相同,這是作者的習(xí)慣問(wèn)題。 四、程序的執(zhí)行過(guò)程: 單片機(jī)在通電復(fù)位后 8051 內(nèi)的程序計(jì)數(shù)器( PC)中的值為‘ 0000’,所以程序總是從‘ 0000’單元開(kāi)始執(zhí)行,也就是說(shuō):在系統(tǒng)的 ROM 中一定要存在‘ 0000’這個(gè)單元,并且在‘ 0000’單元中存放的一定是一條指令。 三、 P0 口、 P2 口和 P3 的第二功能用法: 15 初學(xué)時(shí)往往對(duì) P0 口、 P2 口和 P3 口的第二功能用法迷惑不解,認(rèn)為第二功能和原功能之間要有一個(gè)切換的過(guò)程,或者說(shuō) 要有一條指令,事實(shí)上,各端口的第二功能完全是自動(dòng)的,不需要用指令來(lái)轉(zhuǎn)換。 二、數(shù)據(jù)、地址、指令: 之所以將這三者放在一起,是因?yàn)檫@三者的本質(zhì)都是一樣的 —— 數(shù)字,或者說(shuō)都是一串‘ 0’和‘ 1’組成的序列。 14 此外,單片機(jī)在工商,金融,科研、教育,國(guó)防航空航天等領(lǐng)域都有著十分廣泛的用途。如音樂(lè)集成單片機(jī),看似簡(jiǎn)單的功能,微縮在純電子芯片中(有別于磁帶機(jī)的原理),就需要復(fù)雜的類似于計(jì)算機(jī)的原理。例如工廠流水線的智能化管 可以這樣說(shuō),現(xiàn)在的家用電器基本上都采用了單片機(jī)控制,從電飯褒、洗衣機(jī)、電冰箱、空調(diào)機(jī)、彩電、其他 音響 視頻器材、再到 電子秤 量設(shè)備,五花八門(mén),無(wú)所不在。 單片機(jī)廣泛應(yīng)用于儀器儀表、家用電器、醫(yī)用設(shè)備、航空航天、專用設(shè)備的智能化管理及過(guò)程控制等領(lǐng)域,大致可分如下幾個(gè)范疇: 智能儀器 儀表上的應(yīng)用 單片機(jī)具有體積小、功耗低、控制功能強(qiáng)、擴(kuò)展靈活、微型化和使用方便等優(yōu)點(diǎn),廣泛應(yīng)用于儀器儀表中,結(jié)合不同類型的 傳感器 ,可實(shí)現(xiàn)諸如電壓、 功率 、頻率、濕度、溫度、流量、速度、厚度、角度、長(zhǎng)度、硬度、元素、壓力等物理量的測(cè)量。 單片機(jī)的應(yīng)用領(lǐng)域 目前單片機(jī)滲透到我們生活的各個(gè)領(lǐng)域,幾乎很難找到哪個(gè)領(lǐng)域沒(méi)有單片機(jī)的蹤跡 。因此,當(dāng)我們回顧嵌入式系統(tǒng)發(fā)展道路時(shí),不要忘記 Intel 和 Philips 的歷史功績(jī)。它所涉及的領(lǐng)域都與對(duì)象系統(tǒng)相關(guān),因此,發(fā)展 MCU 的重任不可避免地落在電氣、電子技術(shù)廠家。 起初模型 即 單片微型計(jì)算機(jī) ( Single Chip Microputer)階段,主要是尋求最佳的單片形態(tài)嵌入式系統(tǒng)的最佳體系結(jié)構(gòu)。各種產(chǎn)品一旦用上了單片機(jī),就能起到使產(chǎn)品升級(jí)換代的功效,常在產(chǎn)品名稱前冠以形容詞 —— “智能型”,如智能型洗衣機(jī)等。顧名思義,這種計(jì)算機(jī)的最小系統(tǒng)只用了一片集成電路,即可進(jìn)行簡(jiǎn)單運(yùn)算和控制。不過(guò),這種電腦,通常是指?jìng)€(gè)人計(jì)算機(jī),簡(jiǎn)稱 PC機(jī)。一個(gè)可視化高級(jí)語(yǔ)言編寫(xiě)的小程序里面即使只有一個(gè)按鈕,也會(huì)達(dá)到幾十 K 的尺寸!對(duì)于家用 PC 的硬盤(pán)來(lái)講沒(méi)什么,可是對(duì)于 11 單片機(jī)來(lái)講是不能接受的。 它是一種在線式實(shí)時(shí)控制計(jì)算機(jī),在線式就是現(xiàn)場(chǎng)控制,需要的是有較強(qiáng)的抗干擾能力,較低的成本,這也是和離線式計(jì)算機(jī)的(比如家用 PC)的主要區(qū)別。它的體積小、質(zhì)量輕、價(jià)格便宜、為學(xué)習(xí)、應(yīng)用和開(kāi)發(fā)提供了便利條件。汽車(chē)上一般配備 40 多部單片機(jī),復(fù)雜的工業(yè)控制系統(tǒng)上甚至可能有數(shù)百臺(tái)單片機(jī)在同時(shí)工作!單片機(jī)的數(shù)量不僅遠(yuǎn)超過(guò) PC機(jī)和其他計(jì)算的總和,甚至比人類的數(shù)量還要多。事實(shí)上單片機(jī)是世界上數(shù)量最多的 計(jì)算機(jī) 。目前,高端的 32 位單片機(jī)主頻已經(jīng)超過(guò) 300MHz,性能直追 90 年代中期的專用處理器,而普通的型號(hào)出廠價(jià)格跌落至 1 美元,最高端 [1]的型號(hào)也只有 10 美元。隨著工業(yè)控制領(lǐng)域要求的提高,開(kāi)始出現(xiàn)了 16位單片機(jī),但因?yàn)樾詢r(jià)比不理想并未得到很廣泛的應(yīng)用。 早期的單片機(jī)都是 8 位或 4 位的。s habit. When set up the stack zone, does not mean that the region bee a special memory, it can still use the same memory region as normal, but generally the programmer does not regard it as an ordinary memory used. 9 單片機(jī)介紹 單片機(jī)也被稱為 微控制器 ( Microcontroller Unit),常用英文字母的縮寫(xiě) MCU 表示單片機(jī),它最早是被用在工業(yè)控制領(lǐng)域。 PUSH 39。this unit , and in 0000 39。s instructions, and when the MCU execution to the instruction, the also make into a high, but users will not do so because this is usually will cause the system to collapse. Fourth, the program39。no39。139。 Therefore, the development of dedicated single chip SoC trend of the natural form. As the microelectronics, IC design, EDA tools development, application system based on MCU SoC design have greater development. Therefore, the understanding of the microcontroller chip microputer can be, extended to the singlechip microcontroller applications. MCU applications SCM now permeate all areas of our lives, which is almost difficult tofind traces of the field without SCM. Missile navigation equipment, aircraft, all types of instrument control, puter work munications and data transmission, 4 industrial automation, realtime process control and data processing, extensive use of various smart IC card, civilian luxury car security system, video recorder, camera, fully automatic washing machine control, and programcontrolled toys, electronic pet, etc., which are inseparable from the microcontroller. Not to mention the area of robot control, intelligent instruments, medical equipment was. Therefore, the MCU learning, development and application of the large number of puter applications and intelligent control of the scientists, engineers. SCM is widely used in instruments and meters, household appliances, medical equipment, aerospace, specialized equipment, intelligent management and process control fields, roughly divided into the following several areas: In the application of Intelligent Instruments SCM has a small size, low power consumption, controlling function, expansion flexibility, the advantages of miniaturization and ease of use, widely used instrument, bining different types of sensors can be realized Zhuru voltage, power, frequency, humidity, temperature, flow, speed, thickness, angle, length, hardness, elemental, physical pressure measurement. SCM makes use of digital instruments, intelligence, miniaturization, and functionality than electronic or digital circuits more powerful. Such as precision measuring equipment (power meter, oscilloscope, various analytical instrument). In the industrial control application With the MCU can constitute a variety of control systems, data acquisition system. Such as factory assembly line of intelligent control In Household Appliances Can be said that the appliances are basically using SCM, praise from the electric rice, washing machines, refrigerators, air conditioners, color TV, and other audio video equipment, to the electronic weighing equipment, varied, and omnipresent. In the field of puter works and munications applications MCU general with modern munication interface, can be easy with the puter data munication, working and munications in puter applications between devices had excellent material conditions, are basically all 5 munication