【正文】
切換的過(guò)程,或者說(shuō)要有一條指令,事實(shí)上,各端口的第二功能完全是自動(dòng)的,不需要用指令來(lái)轉(zhuǎn)換。、RD信號(hào),當(dāng)微片理機(jī)外接RAM或有外部I/O口時(shí),它們被用作第二功能,不能作為通用I/O口使用,只要一微處理機(jī)一執(zhí)行到MOVX指令,不需要事先用指令說(shuō)明。事實(shí)上‘不能作為通用I/O口使用’也并不是‘不能’而是(使用者)‘不會(huì)’將其作為通用I/O口使用。你完全可以在指令中按排一條SETB ,并且當(dāng)單片機(jī)執(zhí)行到這條指令時(shí),但使用者不會(huì)這么去做,因?yàn)檫@通常會(huì)導(dǎo)致系統(tǒng)的崩潰。四、程序的執(zhí)行過(guò)程:?jiǎn)纹瑱C(jī)在通電復(fù)位后8051內(nèi)的程序計(jì)數(shù)器(PC)中的值為‘0000’,所以程序總是從‘0000’單元開始執(zhí)行,也就是說(shuō):在系統(tǒng)的ROM中一定要存在‘0000’這個(gè)單元,并且在‘0000’單元中存放的一定是一條指令。 五、堆棧:堆棧是一個(gè)區(qū)域,是用來(lái)存放數(shù)據(jù)的,這個(gè)區(qū)域本身沒(méi)有任何特殊之處,就是內(nèi)部RAM的一部份,特殊的是它存放和取用數(shù)據(jù)的方式,即所謂的‘先進(jìn)后出,后進(jìn)先出’,并且堆棧有特殊的數(shù)據(jù)傳輸指令,即‘PUSH’和‘POP’,有一個(gè)特殊的專為其服務(wù)的單元,即堆棧指針SP,每當(dāng)執(zhí)一次PUSH指令時(shí),SP就(在原來(lái)值的基礎(chǔ)上)自動(dòng)加1,每當(dāng)執(zhí)行一次POP指令,SP就(在原來(lái)值的基礎(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í)慣問(wèn)題。當(dāng)設(shè)置好堆棧區(qū)后,并不意味著該區(qū)域成為一種專用內(nèi)存,它還是可以象普通內(nèi)存區(qū)域一樣使用,只是一般情況下編程者不會(huì)把它當(dāng)成普通內(nèi)存用了。外文資料原文SinglechipSCM 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 [1] 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, controlline is that the scene is needed is a stronger antijamming ability, low cost, and this is, and offline puter (such as home PC), the main differenc