【正文】
通信,為在計(jì)算機(jī)網(wǎng)絡(luò)和通信設(shè)備間的應(yīng)用提供了極好的物質(zhì)條件,現(xiàn)在的通信設(shè)備基本上都實(shí)現(xiàn)了單片機(jī)智能控制,從手機(jī),電話機(jī)、小型程控交換機(jī)、樓宇自動(dòng)通信呼叫系統(tǒng)、列車無線通信、再到日常工作中隨處可見的移動(dòng)電話,集群移動(dòng)通信,無線電對(duì)講機(jī)等。 單片機(jī)在醫(yī)用設(shè)備中的用途亦相當(dāng)廣泛,例如醫(yī)用呼吸機(jī),各種分析儀,監(jiān)護(hù)儀,超聲診斷設(shè)備及病床呼叫系統(tǒng)等等。 某些專用單片機(jī)設(shè)計(jì)用于實(shí)現(xiàn)特定功能,從而在各種電路中進(jìn)行模塊化應(yīng)用,而不要求使用人員了解其內(nèi)部結(jié)構(gòu)。如音樂集成單片機(jī),看似簡(jiǎn)單的功能,微縮在純電子芯片中(有別于磁帶機(jī)的原理),就需要復(fù)雜的類似于計(jì)算機(jī)的原理。如:音樂信號(hào)以數(shù)字的形式存于存儲(chǔ)器中(類似于ROM),由微控制器讀出,轉(zhuǎn)化為模擬音樂電信號(hào)(類似于聲卡)。 在大型電路中,這種模塊化應(yīng)用極大地縮小了體積,簡(jiǎn)化了電路,降低了損壞、錯(cuò)誤率,也方便于更換。 單片機(jī)在汽車電子中的應(yīng)用非常廣泛,例如汽車中的發(fā)動(dòng)機(jī)控制器,基于CAN總線的汽車發(fā)動(dòng)機(jī)智能電子控制器,GPS導(dǎo)航系統(tǒng),abs防抱死系統(tǒng),制動(dòng)系統(tǒng)等等。 此外,單片機(jī)在工商,金融,科研、教育,國(guó)防航空航天等領(lǐng)域都有著十分廣泛的用途。 學(xué)習(xí)應(yīng)用六大重要部分單片機(jī)學(xué)習(xí)應(yīng)用的六大重要部分 一、總線:我們知道,一個(gè)電路總是由元器件通過電線連接而成的,在模擬電路中,連線并不成為一個(gè)問題,因?yàn)楦髌骷g一般是串行關(guān)系,各器件之間的連線并不很多,但計(jì)算機(jī)電路卻不一樣,它是以微處理器為核心,各器件都要與微處理器相連,各器件之間的工作必須相互協(xié)調(diào),所以需要的連線就很多了,如果仍如同模擬電路一樣,在各微處理器和各器件間單獨(dú)連線,則線的數(shù)量將多得驚人,所以在微處理機(jī)中引入了總線的概念,各個(gè)器件共同享用連線,所有器件的8根數(shù)據(jù)線全部接到8根公用的線上,即相當(dāng)于各個(gè)器件并聯(lián)起來,但僅這樣還不行,如果有兩個(gè)器件同時(shí)送出數(shù)據(jù),一個(gè)為0,一個(gè)為1,那么,接收方接收到的究竟是什么呢?這種情況是不允許的,所以要通過控制線進(jìn)行控制,使器件分時(shí)工作,任何時(shí)候只能有一個(gè)器件發(fā)送數(shù)據(jù)(可以有多個(gè)器件同時(shí)接收)。器件的數(shù)據(jù)線也就被稱為數(shù)據(jù)總線,器件所有的控制線被稱為控制總線。在單片機(jī)內(nèi)部或者外部存儲(chǔ)器及其它器件中有存儲(chǔ)單元,這些存儲(chǔ)單元要被分配地址,才能使用,分配地址當(dāng)然也是以電信號(hào)的形式給出的,由于存儲(chǔ)單元比較多,所以,用于地址分配的線也較多,這些線被稱為地址總線。 二、數(shù)據(jù)、地址、指令:之所以將這三者放在一起,是因?yàn)檫@三者的本質(zhì)都是一樣的——數(shù)字,或者說都是一串‘0’和‘1’組成的序列。換言之,地址、指令也都是數(shù)據(jù)。指令:由單片機(jī)芯片的設(shè)計(jì)者規(guī)定的一種數(shù)字,它與我們常用的指令助記符有著嚴(yán)格的一一對(duì)應(yīng)關(guān)系,不可以由單片機(jī)的開發(fā)者更改。地址:是尋找單片機(jī)內(nèi)部、外部的存儲(chǔ)單元、輸入輸出口的依據(jù),內(nèi)部單元的地址值已由芯片設(shè)計(jì)者規(guī)定好,不可更改,外部的單元可以由單片機(jī)開發(fā)者自行決定,但有一些地址單元是一定要有的(詳見程序的執(zhí)行過程)。 三、P0口、P2口和P3的第二功能用法:初學(xué)時(shí)往往對(duì)P0口、P2口和P3口的第二功能用法迷惑不解,認(rèn)為第二功能和原功能之間要有一個(gè)切換的過程,或者說要有一條指令,事實(shí)上,各端口的第二功能完全是自動(dòng)的,不需要用指令來轉(zhuǎn)換。、RD信號(hào),當(dāng)微片理機(jī)外接RAM或有外部I/O口時(shí),它們被用作第二功能,不能作為通用I/O口使用,只要一微處理機(jī)一執(zhí)行到MOVX指令,不需要事先用指令說明。事實(shí)上‘不能作為通用I/O口使用’也并不是‘不能’而是(使用者)‘不會(huì)’將其作為通用I/O口使用。你完全可以在指令中按排一條SETB ,并且當(dāng)單片機(jī)執(zhí)行到這條指令時(shí),但使用者不會(huì)這么去做,因?yàn)檫@通常會(huì)導(dǎo)致系統(tǒng)的崩潰。四、程序的執(zhí)行過程:?jiǎn)纹瑱C(jī)在通電復(fù)位后8051內(nèi)的程序計(jì)數(shù)器(PC)中的值為‘0000’,所以程序總是從‘0000’單元開始執(zhí)行,也就是說:在系統(tǒng)的ROM中一定要存在‘0000’這個(gè)單元,并且在‘0000’單元中存放的一定是一條指令。 五、堆棧:堆棧是一個(gè)區(qū)域,是用來存放數(shù)據(jù)的,這個(gè)區(qū)域本身沒有任何特殊之處,就是內(nèi)部RAM的一部份,特殊的是它存放和取用數(shù)據(jù)的方式,即所謂的‘先進(jìn)后出,后進(jìn)先出’,并且堆棧有特殊的數(shù)據(jù)傳輸指令,即‘PUSH’和‘POP’,有一個(gè)特殊的專為其服務(wù)的單元,即堆棧指針SP,每當(dāng)執(zhí)一次PUSH指令時(shí),SP就(在原來值的基礎(chǔ)上)自動(dòng)加1,每當(dāng)執(zhí)行一次POP指令,SP就(在原來值的基礎(chǔ)上)自動(dòng)減1。由于SP中的值可以用指令加以改變,所以只要在程序開始階段更改了SP的值,就可以把堆棧設(shè)置在規(guī)定的內(nèi)存單元中,如在程序開始時(shí),用一條MOV SP,5FH指令,就時(shí)把堆棧設(shè)置在從內(nèi)存單元60H開始的單元中。一般程序的開頭總有這么一條設(shè)置堆棧指針的指令,因?yàn)殚_機(jī)時(shí),SP的初始值為07H,這樣就使堆棧從08H單元開始往后,而08H到1FH這個(gè)區(qū)域正是8031的第二、三、四工作寄存器區(qū),經(jīng)常要被使用,這會(huì)造成數(shù)據(jù)的混亂。不同作者編寫程序時(shí),初始化堆棧指令也不完全相同,這是作者的習(xí)慣問題。當(dāng)設(shè)置好堆棧區(qū)后,并不意味著該區(qū)域成為一種專用內(nèi)存,它還是可以象普通內(nèi)存區(qū)域一樣使用,只是一般情況下編程者不會(huì)把它當(dāng)成普通內(nèi)存用了。附錄B 英文文獻(xiàn)SCM is also known as microcontroller (Microcontroller Unit), monly used letters of the acronym MCU that it was first used in industrial control.Only a single chip by the CPU chip developed from a dedicated processor. The first design is by a large number of peripherals and CPU on a chip in the puter system, smaller, more easily integrated into a plex and demanding on the volume control device which. INTEL39。sZ80 is the first designed in accordance with this idea processor, then on the development of microcontroller and dedicated processors have parted ways.Are 8bit microcontroller early or4 bits. One of the most successful is the INTEL 8031, for a simple, reliable and good performance was a lot of praise. Then developed in 8031 out of MCS51 MCU Systems. SCM systems based on this system until now is still widely used. With the increased requirements of industrial control field, began a 16bit microcontroller, because the cost is not satisfactory but have not been very widely used. After 90 years with the great development of consumer electronics, microcontroller technology has been a huge increase. With INTEL i960 series, especially the later series of widely used ARM, 32bit microcontroller quickly replace highend 16bit MCU status and enter the mainstream market. The traditional 8bit microcontroller performance have been the rapid increase capacity increase pared to 80 the number of times. Currently, highend 32bit microcontroller clocked over 300MHz, the performance catching the mid9039。s dedicated processor, while the average model prices fall to one . dollars, the most highend model only 10 SCM systems are no longer only in the development and use of bare metal environment, a large number of proprietary embedded operating system is widely used in the full range of SCM. The handheld puters and cell phones as the core processing of highend microcontroller can even use a dedicated Windows and Linux operating systems.SCM is more suitable than the specific processor used in embedded systems, so it was up to the application. In fact the number of SCM is the world39。s largest puter. Modern human life used in almost every piece of electronic and mechanical products will be integrated single , telephone, calculator, home appliances, electronic toys, handheld puters and puter accessories such as a mouse with a 12 in both the Department of SCM. Personal puter will have a large number of SCM in the work. General car with more than 40 SCM, plex industrial control systems may even have hundreds of SCM in the same time work! SCM is not only far exceeds the number of PC and other puting the sum, or even more than the number of human beingsSingle chip, also known as singlechip microcontroller, it is not plete a certain logic chips, but to a puter system integrated into a to a microputer, and puter than just the lack of a microcontroller I / O devices. General talk: a chip bees a puter. Its small size, light weight, cheap, for the study, application and development of facilities provided. At the same time, learning to use the MCU is to understand the principle and structure of the puter the best choice.SCM and the puter functions internally with similar modules, such as CPU, memory, parallel bus, the same effect as well, and hard disk memory devices, and different is its performance of these ponents were relatively weak many of our home puter, but the price is low , usually not more than 10 yuan you can do with it ...... some control for a class is not very plicated electrical work is enough of. We are using automatic drum washing machine, smoke hood, VCD and so on appliances which could see its shadow! ...... It is primarily as a control section of the core ponentsIt is an online realtime control puter, control