无忧论文网 · 始于1999 · 学术论文辅导与论文发表推荐服务

单片机学习应用的六个重要部分

栏目
论文
具体类型
文献翻译
语言
中文
用途
范文参考
更新
关键词
单片机学习翻译
分类标签
翻译相关英语论文翻译
原站著录信息
原编号
lw201006031339598953
原文字数
1,357 字
原文件格式
DOC
原库登记日期
2010-06-03

摘要

总线:我们知道,一个电路总是由元器件通过电线连接而成的,在模拟电路中,连线并不成为一个问题,因为各器件间一般是串行关系,各器件之间的连线并不很多,但计算机电路却不一样,它是以微处理器为核心,各器件都要与微处理器相连,各器件之间的工作必须相互协调,所以需要的连线就很多了,如果仍如同模拟电路一样,在各微处理器和各器件间单独连线,则线的数量将多得惊人,所以在微处理机中引入了总线的概念,各个器件共同享用连线,所有器件的8根数据线全部接到8根公用的线上,即相当于各个器件并联起来,但仅这样还不行,如果有两个器件同时送出数据,一…

总线:我们知道,一个电路总是由元器件通过电线连接而成的,在模拟电路中,连线并不成为一个问题,因为各器件间一般是串行关系,各器件之间的连线并不很多,但计算机电路却不一样,它是以微处理器为核心,各器件都要与微处理器相连,各器件之间的工作必须相互协调,所以需要的连线就很多了,如果仍如同模拟电路一样,在各微处理器和各器件间单独连线,则线的数量将多得惊人,所以在微处理机中引入了总线的概念,各个器件共同享用连线,所有器件的8根数据线全部接到8根公用的线上,即相当于各个器件并联起来,但仅这样还不行,如果有两个器件同时送出数据,一个为0,一个为1,那么,接收方接收到的究竟是什么呢?这种情况是不允许的,所以要通过控制线进行控制,使器件分时工作,任何时候只能有一个器件发送数据(可以有多个器件同时接收)。器件的数据线也就被称为数据总线,器件所有的控制线被称为控制总线。在单片机内部或者外部存储器及其它器件中有存储单元,这些存储单元要被分配地址,才能使用,分配地址当然也是以电信号的形式给出的,由于存储单元比较多,所以,用于地址分配的线也较多,这些线被称为地址总线。


Application of single-chip learning
an important part of the six
A bus: We know that a circuit is always from the components connected through the wire in analog circuits, the connection does not become a problem because the devices are usually serial inter-relationship between the various devices connection, not many, but not the same as computer circuits, which is based on the microprocessor as the core, the device must be connected with the microprocessor, the device must be between the coordinated and so they need a lot of connections on If still the same as analog circuits, in the microprocessor and a separate connection between devices, while the number of lines will be more shocking, so the introduction of the microprocessor in the concept of a bus, all devices share the connection, all devices all the eight data lines from the eight common line, which is equivalent to all devices in parallel, but this is notwww.51lunwen.org enough alone, if there are two devices send data at the same time, a 0, a 1, then recipient received what is it? This is not allowed, there is a need to control through the control line so that devices work time, any time there can be only one device to send data (can have more than one receiving device at the same time). Data devices will be referred to as data bus, all the line of control devices known as the control bus. In the internal or external memory single-chip and other devices in the memory cell, the memory cell to be assigned addresses to use, the allocation of addresses is of course given in the form of electrical signals, and as a result of more storage units, so for address the allocation of more of the line, the line known as the address bus.
    Second, data, address, command: The reason why these three together because of the nature of these three are the same - the number of, or are a string of'0 'and'1', composed of sequence . In other words, the address, data commands are. Instruction: single-chip chip designers from a number of provisions, it is consistent with our common Mnemonic instruction has strict one-to-one relationship, not by the developer to change the MCU. Address: the search for single-chip internal, external storage units, input and output port based on the value of the internal unit's address has been provided for the chip designers, and can not be changed, the external unit can be single-chip developers to decide, but There are a number of address must be the unit (see the implementation of the procedure). Data: This is the object of processing by the microprocessor in the application of a variety of different circuits, in general, the data may be processed so situations:
address (such as MOV DPTR, # 1000H), that is, the address 1000H into the DPTR.
the way the words or control characters (such as MOV TMOD, # 3), 3 which controls the character.
constants (such as MOV TH0, # 10H) 10H that is constant from time to time.
The actual output value (for example, I received P1 lanterns to light the whole lamp, then the implementation of instruction: MOV P1, # 0FFH, dark to light the whole, the implementation of instruction: MOV P1, # 00H) here are the actual 0FFH and 00H output value. Another example is the font code for the LED, is the actual output value.
Understanding of the address, the nature of instructions, running is not difficult to understand why the process of running to fly, the data will be implemented as instructions.
    Third, P0 I, P2 and P3 I use the second function: P0 beginner I am often, P2 and P3 mouth I puzzled by the use of the second function that the original function of the second function and to have a switch between the process, or have a directive, in fact, the port's second feature is automatic, no need for instructions to convert. Such as P3.6, P3.7 are WR, RD signal, when the micro-plane schistosity external RAM or external I / O port, they were used as the second function, can not be used as general-purpose I / O port to use, as long as a A microprocessor implementation of the MOVX instruction, there will be a corresponding signal sent from the P3.6 or P3.7, with instructions that do not require advance. In fact 'can not be used as general-purpose I / O port use' is not 'can not' but (user) 'not' as a general-purpose I / O port to use. You can arrange the commands in a command SETB P3.7, and when the single-chip implementation of instructions that, it would P3.7 into a high, but users will not do so because This usually will lead to the collapse of the system.
    Fourth, procedures for the implementation of the process: single-chip power-on reset in 8051 after the program counter (PC) of the value of'0000 ','0000 always so procedures' unit started, that is to say: in the system ROM must exist in the'0000 'in this unit, and'0000' in the storage unit must be a command.
    Fifth, the stack: the stack is a region, is used to store data, the region does not have any unique position, that is, a part of internal RAM, special storage and access to its data, the so-called 'advanced after that last-in first-out ', and the stack data with special instructions, that is,' PUSH 'and' POP ', there is a special unit dedicated to its service, that is, the stack pointer SP, when they first PUSH instruction, the SP on (in the basis of the original value) plus 1 automatically, whenever the implementation of a POP instruction, SP on (in the basis of the original value) by 1 automatically. Because of the value of SP can be used to change directions, so as long as the initial stage in the procedure to change the value of the SP, you can set up the stack in the memory unit requirements, such as in the beginning of the proceedings, with a MOV SP, # 5FH instructions set up on the stack when the memory module from the beginning of the unit 60H. The total at the beginning of the general procedure that there is a stack pointer of the instruction set, because boot, SP initial value of 07H, thus 08H cell stack from the beginning of the next, and 08H to 1FH in the region 8031 is the second, three or four working register area, often used, this data would cause confusion. The author has prepared various procedures to initialize the stack is not exactly the same directive, which is the question of the author's habits. When the stack area is set up does not mean that the region as a special memory, it can still be the same memory region as the general use, but programmers generally do not use it as a common memory.
    Six, single-chip development process: the development process here is not what the general said the book started from the task analysis, we assume that has been designed and produced a good hardware, the following is the work of writing software. At the time of writing software, first we identified a number of constants