【正文】
ys the beginning of the general procedure with such a directive to set the stack pointer, because boot, SP initial value of 07H, 08H This unit from the beginning to stack next, and 08H to 1FH 8031 is the second in the region, three or four working register area, often used, this will lead to confusion of data. Different authors when writing programs, initialize the stack is not exactly the same directive, which is the author39。and39。unit must be stored in a single instruction. 5, the stack: Stack is a region, is used to store data, there is no special about the region itself is a part of internal RAM, special access to its data storage and the way that the socalled 39。s implementation:Reduction in power after the 8051 microcontroller within the program counter (PC) in the value of 0000 39。 but (user) 39。 form the sequence. In other words, addresses, instructions are also data. Instruction: from single chip designer provides a number of monly used instructions with mnemonic we have a strict correspondence between the developer can not be changed by the MCU. Address: the search for MCU internal, external storage units, input and output port based on the address of the internal unit value provided by the chip designer is good, can not be changed, the external unit can be single chip developers to decide, but there are a number of address units is a must (see procedures for the implementation of the process). Third, P0 port, P2 and P3 of the second function I use: Beginners often on the P0 port, P2 and P3 port I use the second function puzzled that the second function and have a switch between the original function of the process, or have a directive, in fact, the port The second feature is automatic, do not need instructions to convert. Such as , respectively WR, RD signal, when the microchip processing machines external RAM or external I / O port, they are used as a second function, not as a generalpurpose I / O port used, so long as a A microprocessor implementation of the MOVX instruction, there will be a corresponding signal sent from the or , no prior use of mands. In fact 39。s data connection is known as the data bus, the device is called line of control all the control bus. Internal or external memory in the microcontroller and other devices have memory cells, the memory cell to be assigned addresses, you can use, distribution, of course, to address given in the form of electrical signals, and as more memory cells, so, for the address allocation The line is also more of these lines is called the address bus.Second, data, address, mandThe reason why these three together because of the nature of these three are the same the number, or are a string of 39。s with a series of successful SCM market, the result will be a drastic change! Just because you are prepared by microputer programs can achieve high intelligence, high efficiency and high reliability!As the microcontroller on the costsensitive, so now the dominant software or the lowest level assembly language, which is the lowest level in addition to more than binary machine code language, and as so low why is the use? Many highlevel language has reached the level of visual programming Why is not it? The reason is simply that there is no home puter as a single chip CPU, not as hard as a mass storage visualization of small highlevel language program which even if only one button, will reach tens of K of size! For the home PC39。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。不同作者編寫(xiě)程序時(shí),初始化堆棧指令也不完全相同,這是作者的習(xí)慣問(wèn)題。四、程序的執(zhí)行過(guò)程:?jiǎn)纹瑱C(jī)在通電復(fù)位后8051內(nèi)的程序計(jì)數(shù)器(PC)中的值為‘0000’,所以程序總是從‘0000’單元開(kāi)始執(zhí)行,也就是說(shuō):在系統(tǒng)的ROM中一定要存在‘0000’這個(gè)單元,并且在‘0000’單元中存放的一定是一條指令。 三、P0口、P2口和P3的第二功能用法:初學(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’組成的序列。 此外,單片機(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è)范疇: 單片機(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í),