




免费预览已结束,剩余8页可下载查看
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
英文翻译Single-chip componentsTo auto-complete single-chip basis, it should be the most important part of what it? Calculated as an example we calculate on an abacus math problems together. Cases: 36 +163 156-166 34. Now to carry out operations, first of all need a plan, followed by Pen and paper. We have to calculate the issue of record, and then count the first step, 163 156, add it with the results of 36 recorded in the paper, and then calculate 166 34, then it results from a minus, it has been the final outcome. Now, we use single-chip to complete the process, it is clear that it should be instead of thinking first of all the components for computing, which is the calculator; Secondly, there must be able to play the role of devices, which can remember the original subject, the raw data and intermediate results, but also remember to enable single-chip operation can be automatically prepared by the various orders. These devices called memory. In addition, the need to replace the role of the controller, it will be in accordance with an order prior to issuing various control signals so that the whole process can be calculated step by step manner. However, this three-part light enough, the original data and commands to be input, the results of the calculation to the output, are required by the order in which they sometimes need to wait. The first step: the first number from its storage unit (Location) in the check out to the computing device. Step two: the second number from its storage unit in the check out to the computing device; the third step: add; fourth step: End the sum of the results to the specified memory unit. All of these take a number, send a few, the sum of deposit, etc. are a few operations (Operation), we asked the computer to operate with the implementation of the various forms of writing down the order, which is instruction. But how can we identify them and to perform these operations? This is a single chip in the design by the designers of the instruction given to it by decision. A command, corresponding to a basic operation; single chip can implement all the commands, the command is the single-chip system (Iustruction Set), different types of single-chip, and its command system is also different. The use of single-chip, the prior should be the problem to be solved into a series of commands. These instructions must be selected to identify and implement single-chip instructions. Single-chip customers to solve their own problems by the instructions for the procedure, known as source code (Source Program). Usually divided into opcode instruction (Opcode) and operand (Operand) of two major parts. Operation of the computer code that the implementation of any operation, that is, the function of command; operand that participate in the operation or operand address is located (that is, the operand stored in the local code). Because the single chip is a programmable device, only recognize the binary code (0,1). Operation to single-chip, single-chip microcomputer system in all directions, must be the form of binary code to represent. For example, in Intels MCS-51 series single-chip, from a number of memory out of the accumulator to the CPU (in the computing device, the participation in computing, computing the results of the dedicated storage registers) for the command code 74H , an immediate increase in the number of accumulator the contents of the code for the 24H, together with the number of code immediately, send the number of accumulator to the internal RAM memory for the code, such as F6H F7H. These instructions are binary hexadecimal binary. MCS-51 MCU 8-bit word length, and sometimes, it is necessary to complete a certain operation can not be fully expressed bytes. Therefore, in the instruction in single-byte instruction, but also a number of byte instructions. By a series of binary 0 and 1 components, there is no obvious characteristics, poor memory, difficult to understand and easy to make mistakes. Therefore, the direct use of it is very difficult to write procedures. Thus, people with some Mnemonic (Mue monic) - usually the command function to replace the English abbreviation opcode, such as the MCS-51 in the transmission of several commonly used MOV (Move the acronym), add with Add (Addition of abbreviations ) as a mnemonic. In this way, there are clear instructions for each action features, ease of memory and understanding, not prone to error. Mnemonic used to prepare the process is called assembly language program. However, Mnemonic prepared to facilitate understanding of the process can be recognized only single-chip binary machine code, so, in order to allow single-chip can understand the assembly language program must then be replaced by a procedure consisting of binary machine code, which species of the conversion process, known as compilation. Compiled through manual look-up table method can be achieved, we will draw on PC machine through the so-called cross-assembler to complete. Posed by the user program binary, once the enter a single-chip, and then start single-chip, it can enter the process to implement the mandate. MCU - 51 CPU and memory 8051 single-chip CPU and the controller by the composition operator.8051 single-chip CPU and the controller by the composition operator. A calculator to complete the binary calculator arithmetic / logic operations as the core components ALU, registers plus TMP, accumulator ACC, register B, the procedures state symbol and Boolean processor PSW register. ACC is an eight accumulator register, which is working CPU registers the most frequent. In arithmetic, logic operations, the accumulator ACC are in operation before the operation a number of temporary (such as being summand), and computing and then save the results (such as algebra and). Register B major operation for multiplication and division. PSW register is also a mark of eight registers, used to store the results of some of the characteristics of computing, if not binary, such as by-bit. Its specific meaning of each are shown below. PSW CY AC FO RS1 RS0 OV - P to users, the most concerned about is the following four.1 binary symbol CY (PSW 7). It expressed whether the binary operation (or borrow). If the operation results in the highest places are binary (addition) or borrow (subtraction), the bit is 1, otherwise to 0. 2 auxiliary binary symbol AC. Also known as semi-binary logo, it reflects the number of two eight computing whether there is a half low of four binary, that is, the sum of low-four (or minus) it has binary (or borrow) and, if the AC for 1 state, otherwise to 0. 3 overflow flag OV. MCS-51 to reflect the number of operator symbols with the results of whether there is any overflow, the overflow, this bit is 1, otherwise to 0. 4 parity symbol P. Reflect the content of accumulator ACC parity, if the ACC results of computing even a 1 (for example, 11001100B, including 4 1), then P is 0, otherwise, P = 1. PSW other places, will be introduced at a later stage. PSW stored procedures as a result of the implementation of the state, it is also called the program status word? Calculator also includes a by-bit (bit) to carry out logic operations of the logic processor (also known as Boolean processor). Its function-bit instructions in the introduction that when. Second, the controller Controller is the nerve center of the CPU, which includes the timing control logic circuit, an instruction register, decoder, address pointer DPTR and the program counter PC, such as the stack pointer SP. This program counter PC is composed of 16-bit counter register. To single-chip implementation of a program, it is necessary in order to advance the program into an area of ROM memory. Single-chip action should be taken out of a sequence of instructions to be implemented. Therefore, there must be a circuit to find out where the command module address, the circuit is the program counter PC. When the single-chip implementation of procedures, to the PC into which the first instruction address, it took out one of each command (such as multi-byte instructions, each took out a command byte), PC will automatically increase the content of 1 to point to the next instruction address, so that the implementation of directives to the order. Encountered only when the transfer of command procedures, subroutine call instructions, or face failure (after the introduction), PC only go where needed. 8051 CPU碢Cs designated address, the corresponding unit from the ROM command byte out of storage on the instruction register, and then, in the instruction register decoder instruction code has been translated into various forms of control signals, these signals with a single Machine clock oscillator clock pulse generated in the timing and control circuit in combination to form a certain period of time according to changes in level and beat the clock, the so-called control of information, internal coordination in the CPU data transfer between registers, and other computing operation. A program memory Control computer program is a series of action commands, single-chip only recognized by the 0 and 1 consisting of machine code instructions. Such as the preparation of the foregoing order by Mnemonic MOV A, # 20H, understanding the code into the machine 74H, 20H: (written in binary is 01110100B and 00100000B). Deal with problems in the single-chip will be required before good procedures, tables, constants compiled into machine code into the microcontroller memory, the memory as the program memory. Program memory can be put on the chip or chip, chip-chip can also be set at the same time. As the PC program counter for 16-bit, the program memory 16-bit binary address can be used, therefore, the largest internal and external memory addresses from 0000H to FFFFH. 8051 there are 4k bytes of ROM, on the occupied by the 0000H 0FFFH minimum 4k bytes, this chip to expand the program memory address 1000H numbers should be started, if you use 8051 as a 8031, do not want to use chip 4kROM , all by-chip memory, the address number can be started by the 0000H. However, this should be the first 8051 feet (31) (that is, EA feet) remain low. When EA is high, the user 0FFFH in the range of 0000H to use the internal ROM, more than 0FFFH, the single-chip CPU access to external program memory automatically. Second, data storage Single-chip data memory RAM memory by reading and writing components. Its maximum capacity can be expanded to 64k, used to store real-time data input. 8051 there are 256 units of the internal data memory, in which 00H 7FH for internal random access memory RAM, 80H FFH register for the special zone. Actual use should be the first full use of internal memory, from the use of perspective, to understand the structure of internal data memory and address of the distribution is very important. Because the future directions in the study design of systems and procedures they will be frequently used. 8051 internal data memory address 00H to FFH by a total of 256 bytes of address space, the space was divided into two parts, of which the internal data RAM address 00H 7FH (that is, 0 127). The Special Function Registers used as the address of 80H FFH. 256 bytes in this also opened up a so-called digital address area, the region can not only byte addressing, but also by the bit (bit) addressable. For those who require data-bit operation can be stored to the region. From 00H to 1FH arranged the work of four groups of registers, each occupied by 8-byte RAM, recorded as R0 R7. Whether the choice of which set of registers, register by the aforementioned signs of RS1 and RS0 to choose. Add in the two different binary number, you can choose different groups of registers, as shown in Schedule 1. Third, special function register Special Function Register (SFR) address the range of 80H FFH. In the MCS-51, in addition to program counter register PC and four work areas, and the remaining 21 special function register SFR in this block. Of which five are double-byte register, which takes up a total of 26 bytes. The special function registers and address of the symbols see Table 2. Which can be with * bit addressable. Special Function Registers 8051 reflects the state of the state of 8051 is actually the word and control word register. CPU PSW is typical for a case. Special Function Registers in general these two categories, with the pin on the chip, and the other for chip control function. With the chip on the pin is the Special Function Registers P0 P3, they are in fact four of eight latches (one for each I / O port A), each additional latch corresponding output driver and input buffer constitutes a parallel port. MCS-51 a total of four such P0 P3 the parallel port provides 32 I / O lines, each line is a two-way, and has the second largest function. The rest used for chip control register, the accumulator A, marks register PSW, the data pointer DPTR function mentioned before, while others function registers part of the back of the further introduction Single-chip instruction and addressing mode To the normal operation of single-chip, to be programmed in advance, and then the procedure Add memory, and then from the CPU to implement the program. Procedure is composed by the directive, Directive is an essential component of the operation code and operands. Many varieties of single-chip, the design of how that operation code and operands, have their own requirements, and then there are instructions code varies, therefore, must be single-chip all the selected command, which is the so-called instruction sufficient understanding. Although the various series of single-chip systems have different commands, but also has its commonality. Instructions have a single-chip system, for other series of single-chip can play a role comprehend by analogy. MCS-51 single-chip applications, derived varieties, representative, therefore, here to MCS-51 series as an example of the command system command the composition and application.1, MOV A, # 20H The instructions said to 20H into the accumulator A of the number of (a special function register).译文:单片机的组成 单片机要自动完成计算,它应该具有哪些最重要的部分呢?我们以打算盘为例计算一道算术题。例:3616315616634。现在要进行运算,首先需要一把算盘,其次是纸和笔。我们把要计算的问题记录下来,然后第一步先算163156,把它与36相加的结果记在纸上,然后计算16634,再把它从上一次结果中减去,就得到最后的结果。现在,我们用单片机来完成上述过程,显然,它首先要有代替算盘进行运算的部件,这就是“运算器”;其次,要有能起到纸和笔作用的器件,即能记忆原始题目、原始数据和中间结果,还要记住使单片机能自动进行运算而编制的各种命令。这类器件就称为“存贮器”。此外,还需要有能代替人作用的控制器,它能根据事先给定的命令发出各种控制信号,使整个计算过程能一步步地进行。但是光有这三部分还不够,原始的数据与命令要输入,计算的结果要输出,都需要按先后顺序进行,有时还需等待。 如上例中,当在计算163156时,数字36就不能同时进入运算器。因此就需要在单片机上设置按控制器的命令进行动作的“门”,当运算器需要时,就让新数据进入。或者,当运算器得到最后结果时,再将此结果输出,而中间结果不能随便“溜出”单片机。这种对输入、输出数据进行一定管理的“门”电路在单片机中称为“口”(Port)。在单片机中,基本上有三类信息在流动,一类是数据,即各种原始数据(如上例中的36、163等)、中间结果(如16634所得的商4、余数30等)、程序(命令的集合)等。这样要由外部设备通过“口”进入单片机,再存放在存贮器中,在运算处理过程中,数据从存贮器读入运算器进行运算,运算的中间结果要存入存贮器中,或最后由运算器经“出入口”输出。 用户要单片机执行的各种命令(程序)也以数据的形式由存贮器送入控制器,由控制器解读(译码)后变为各种控制信号,以便执行如加、减、乘、除等功能的各种命令。所以,这一类信息就称为控制命令,即由控制器去控制运算器一步步地进行运算和处理,又控制存贮器的读(取出数据)和写(存入数据)等。第三类信息是地址信息,其作用是告诉运算器和控制器在何处去取命令取数据,将结果存放到什么地方,通过哪个口输入和输出信息等。 存贮器又分为只读存贮器和读写存贮器两种,前者存放调试好的固定程序和常数,后者存放一些随时有可能变动的数据。顾名思义,只读存贮器一旦将数据存入,就只能读出,不能更改(EPROM、E2PROM等类型的ROM可通过一定的方法来更改、写入数据编者注)。而读写存贮器可随时存入或读出数据。 实际上,人们往往把运算器和控制器合并称为中央处理单元CPU。单片机除了进行运算外,还要完成控制功能。所以离不开计数和定时。因此,在单片机中就设置有定时器兼计数器,其基本结构与本连载之(二)中的举例类似。到这里为止,我们已经知道了单片机的基本组成,即单片机是由中央处理器(即CPU中的运算器和控制器)、只读存贮器(通常表示为ROM)、读写存贮器(又称随机存贮器通常表示为RAM)、输入/输出口(又分为并行口和串行口,表示为I/O口)等等组成。实际上单片机里面还有一个时钟电路,使单片机在进行运算和控制时,都能有节奏地进行。另外,还有所谓的“中断系统”,这个系统有“传达室”的作用,当单片机控制对象的参数到达某个需要加以干预的状态时,就可经此“传达室”通报给CPU,使CPU根据外部事态的轻重缓急来采取适当的应付措施。 现在,我们已经知道了单片机的组成,余下的问题是如何将它们的各部分连接成相互关联的整体呢?实际上,单片机内部有一条将它们连接起来的“纽带”,即所谓的“内部总线”。此总线有如大城市的“干道”,而CPU、ROM、RAM、I/O口、中断系统等就分布在此“总线”的两旁,并和它连通。从而,一切指令、数据都可经内部总线传送,有如大城市内各种物品的传送都经过干道进行单片机指令系统与汇编语言程序 前面已经讲述了单片机的几个主要组成部分,这些部分构成了单片机的硬件。所谓硬件(Hardware),就是看得到,摸得到的实体。但是,光有这样的硬件,还只是有了实现计算和控制功能的可能性。单片机要真正地能进行计算和控制,还必须有软件(Software)的配合。软件主要指的是各种程序。只有将各种正确的程序“灌入”(存入)单片机,它才能有效地工作。单片机所以能自动地进行运算和控制,正是由于人把实现计算和控制的步骤一步步地用命令的形式,即一条条指令(Instruction)预先存入到存贮器中,单片机在CPU的控制下,将指令一条条地取出来,并加以翻译和执行。就以两个数相加这一简单的运算来说,当需要运算的数已存入存贮器后,还需要进行以下几步:第一步:把第一个数从它的存贮单元(Location)中取出来,送至运算器。 第二步:把第二个数从它所在的存贮单元中取出来,送至运算器; 第三步:相加; 第四步:把相加完的结果,送至存贮器中指定的单元。所有这些取数、送数、相加、存数等等都是一种操作(Operation),我们把要求计算机执行的各种操作用命令的形式写下来,这就是指令。但是怎样才能辨别和执行这些操作呢?这是在设计单片机时由设计人员赋予它的指令系统所决定的。一条指令,对应着一种基本操作;单片机所能执行的全部指令,就是该单片机的指令系统(Iustruction Set),不同种类的单片机,其指令系统亦不同。使用单片机时,事先应当把要解决的问题编成一系列指令。这些指令必须是选定的单片机能识别和执行的指令。单片机用户为解决自己的问题所编的指令程序,称为源程序(Source Program)。指令通常分为操作码(Opcode)和操作数(Operand)两大部分。操作码表示计算机执行什么操作,即指令的功能;操作数表示参加操作的数或操作数所在的地址(即操作数所存放的地方编号)。因为单片机是一种可编程器件,只“认得”二进码(0、1)。要单片机运作,单片机系统中的所有指令,都必须以二进制编码的形式来表示。例如,在Intel公司的MCS51系列单片机中,从存贮器中取出一数到CPU中的累加器(在运算器中,参与运算、存放运算结果的专用寄存器)的指令代码为74H,累加器内容加立即数的代码为24H,再加上立即数代码,累加器送数到内部RAM存贮器的代码为F6HF7H等。这些指令是用十六进制表示二进制的机器码。MCS51单片机的字长为8位,有时,要完成某些操作用一个字节尚不能充分表达。所以,在指令系统中有单字节指令,也有多字节指令。机器码是由一连串的0和1组成,没有明显的特征,不好记忆,不易理解,易出错。所以,直接用它来编写程序十分困难。因而,人们就用一些助记符(Mue monic)通常是指令功能的英文缩写来代替操作码,如MCS51中数的传送常用MOV(Move的缩写)、加法用Add(Addition的缩写)来作为助记符。这样,每条指令有明显的动作特征,易于记忆和理解,也不容易出错。用助记符来编写的程序称为汇编语言程序。但是,助记符编写的程序便于人理解,可单片机却只认识二进制机器代码,因此,为了让单片机能“读懂”汇编语言程序必须再转换成由二进制机器码构成的程序,这种转换过程,就称为“汇编”。汇编可借助于人工查表法来实现,也可借助PC机通过所谓“交叉汇编程序”来完成。由机器码构成的用户程序一旦“进入”了单片机,再“启动”单片机,就可让它执行输入程序所规定的任务。单片机8051的CPU由运算器和控制器组成。一、运算器运算器以完成二进制的算术/逻辑运算部件ALU为核心,再加上暂存器TMP、累加器ACC、寄存器B、程序状态标志寄存器PSW及布尔处理器。累加器ACC是一个八位寄存器,它是CPU中工作最频繁的寄存器。在进行算术、逻辑运算时,累加器ACC往往在运算前暂存一个操作数(如被加数),而运算后又保存其结果(如代数和)。寄存器B主要用于乘法和除法操作。标志寄存器PSW也是一个八位寄存器,用来存放运算结果的一些特征,如有无进位、借位等。其每位的具体含意如下所示。PSW CY AC FO RS1 RS0 OV P对用户来讲,最关心的是以下四位。 1 进位标志CY(PSW 7)。它表示了运算是否有进位(或借位)。如果操作结果在最高位有进位(加法)或者借位(减法),则该位为1,否则为0。 2 辅助进位标志AC。又称半进位标志,它反映了两个八位数运算低四位是否有半进位,即低四位相加(或减)有否进位(或借位),如有则AC为1状态,否则为0。 3 溢出标志位OV。MCS51反映带符号数的运算结果是否有溢出,有溢出时,此位为1,否则为0。 4 奇偶标志P。反映累加器ACC内容的奇偶性,如果ACC中的运算结果有偶数个1(如11001100B,其中有4个1),则P为0,否则,P=1。PSW的其它位,将在以后再介绍。由于PSW存放程序执行中的状态,故又叫程序状态字?运算
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 公租房代理申请合同范本
- 中铁建劳务分包合同范本
- 人才公寓委托租赁协议书
- 公司赔偿合同协议书范本
- epc项目审计合同范本
- 中医馆出售转让合同范本
- 入学房屋租赁协议书范本
- 农村阳光房合作合同范本
- 医疗注塑厂出售合同范本
- 加盟产品合同协议书范本
- 公司业务招待费管理制度
- 2025至2030年中国聚氨酯医用材料行业市场研究分析及投资潜力研究报告
- cmmm考试题及答案
- 2025中国中老年营养健康食品专题报告
- 无人机生产线项目可行性研究报告
- 零售药店培训试题及答案
- 防雷防静电培训考试试题及答案
- 混凝土索赔协议书
- 社保返还协议书
- 2025年湖南省国际工程咨询集团有限公司招聘笔试参考题库附带答案详解
- 中小学违规办学行为治理典型案例与规范要求
评论
0/150
提交评论