单片机毕业设计--英文翻译

上传人:r****d 文档编号:86347486 上传时间:2022-05-07 格式:DOC 页数:13 大小:51.50KB
返回 下载 相关 举报
单片机毕业设计--英文翻译_第1页
第1页 / 共13页
单片机毕业设计--英文翻译_第2页
第2页 / 共13页
单片机毕业设计--英文翻译_第3页
第3页 / 共13页
点击查看更多>>
资源描述
英文翻译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中数的传送常用MOVMove的缩写、加法用Add(Addition的缩写来作为助记符。这样,每条指令有明显的动作特征,易于记忆和理解,也不容易出错。用助记符来编写的程序称为汇编语言程序。但是,助记符编写的程序便于人理解,可单片机却只认识二进制机器代码,因此,为了让单片机能“读懂汇编语言程序必须再转换成由二进制机器码构成的程序,这种转换过程,就称为“汇编。汇编可借助于人工查表法来实现,也可借助PC机通过所谓“交叉汇编程序来完成。由机器码构成的用户程序一旦“进入了单片机,再“启动单片机,就可让它执行输入程序所规定的任务。单片机8051的CPU由运算器和控制器组成。一、运算器运算器以完成二进制的算术/逻辑运算部件ALU为核心,再加上暂存器TMP、累加器ACC、存放器B、程序状态标志存放器PSW及布尔处理器。累加器ACC是一个八位存放器,它是CPU中工作最频繁的存放器。在进行算术、逻辑运算时,累加器ACC往往在运算前暂存一个操作数如被加数,而运算后又保存其结果如代数和。存放器B主要用于乘法和除法操作。标志存放器PSW也是一个八位存放器,用来存放运算结果的一些特征,如有无进位、借位等。其每位的具体含意如下所示。PSW CY AC FO RS1 RS0 OV P对用户来讲,最关心的是以下四位。 1 进位标志CYPSW 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存放程序执行中的状态,故又叫程序状态字?运算器中还有一个按位bit进行逻辑运算的逻辑处理机又称布尔处理机。其功能在介绍位指令时再说明。二、控制器 控制器是CPU的神经中枢,它包括定时控制逻辑电路、指令存放器、译码器、地址指针DPTR及程序计数器PC、堆栈指针SP等。这里程序计数器PC是由16位存放器构成的计数器。要单片机执行一个程序,就必须把该程序按顺序预先装入存储器ROM的某个区域。单片机动作时应按顺序一条条取出指令来加以执行。因此,必须有一个电路能找出指令所在的单元地址,该电路就是程序计数器PC。当单片机开始执行程序时,给PC装入第一条指令所在地址,它每取出一条指令如为多字节指令,那么每取出一个指令字节,PC的内容就自动加1,以指向下一条指令的地址,使指令能顺序执行。只有当程序遇到转移指令、子程序调用指令,或遇到中断时后面将介绍,PC才转到所需要的地方去。8051 CPU碢C指定的地址,从ROM相应单元中取出指令字节放在指令存放器中存放,然后,指令存放器中的指令代码被译码器译成各种形式的控制信号,这些信号与单片机时钟振荡器产生的时钟脉冲在定时与控制电路中相结合,形成按一定时间节拍变化的电平和时钟,即所谓控制信息,在CPU内部协调存放器之间的数据传输、运算等操作。三、存储器 存储器是单片机的又一个重要组成局部,图6给出了一种存储容量为256个单元的存储器结构示意图。其中每个存储单元对应一个地址,256个单元共有256个地址,用两位16进制数表示,即存储器的地址00HFFH。存储器中每个存储单元可存放一个八位二进制信息,通常用两位16进制数来表示,这就是存储器的内容。存储器的存储单元地址和存储单元的内容是不同的两个概念,不能混淆。一、程序存储器 程序是控制计算机动作的一系列命令,单片机只认识由“0和“1代码构成的机器指令。如前述用助记符编写的命令MOV A,20H,换成机器认识的代码74H、20H:写成二进制就是01110100B和00100000B。在单片机处理问题之前必须事先将编好的程序、表格、常数汇编成机器代码后存入单片机的存储器中,该存储器称为程序存储器。程序存储器可以放在片内或片外,亦可片内片外同时设置。由于PC程序计数器为16位,使得程序存储器可用16位二进制地址,因此,内外存储器的地址最大可从0000H到FFFFH。8051内部有4k字节的ROM,就占用了由0000H0FFFH的最低4k个字节,这时片外扩充的程序存储器地址编号应由1000H开始,如果将8051当做8031使用,不想利用片内4kROM,全用片外存储器,那么地址编号仍可由0000H开始。不过,这时应使8051的第31脚即EA脚保持低电平。当EA为高电平时,用户在0000H至0FFFH范围内使用内部ROM,大于0FFFH后,单片机CPU自动访问外部程序存储器。二、数据存储器 单片机的数据存储器由读写存储器RAM组成。其最大容量可扩展到64k,用于存储实时输入的数据。8051内部有256个单元的内部数据存储器,其中00H7FH为内部随机存储器RAM,80HFFH为专用存放器区。实际使用时应首先充分利用内部存储器,从使用角度讲,搞清内部数据存储器的结构和地址分配是十分重要的。因为将来在学习指令系统和程序设计时会经常用到它们。8051内部数据存储器地址由00H至FFH共有256个字节的地址空间,该空间被分为两局部,其中内部数据RAM的地址为00H7FH即0127。而用做特殊功能存放器的地址为80HFFH。在此256个字节中,还开辟有一个所谓“位地址区,该区域内不但可按字节寻址,还可按“位bit寻址。对于那些需要进行位操作的数据,可以存放到这个区域。从00H到1FH安排了四组工作存放器,每组占用8个RAM字节,记为R0R7。究竟选用那一组存放器,由前述标志存放器中的RS1和RS0来选用。在这两位上放入不同的二进制数,即可选用不同的存放器组,如附表1所示。三、特殊功能存放器 特殊功能存放器SFR的地址范围为80HFFH。在MCS51中,除程序计数器PC和四个工作存放器区外,其余21个特殊功能存放器都在这SFR块中。其中5个是双字节存放器,它们共占用了26个字节。各特殊功能存放器的符号和地址见附表2。其中带号的可位寻址。特殊功能存放器反映了8051的状态,实际上是8051的状态字及控制字存放器。用于CPU PSW便是典型一例。这些特殊功能存放器大体上分为两类,一类与芯片的引脚有关,另一类作片内功能的控制用。与芯片引脚有关的特殊功能存放器是P0P3,它们实际上是4个八位锁存器每个I/O口一个,每个锁存器附加有相应的输出驱动器和输入缓冲器就构成了一个并行口。MCS51共有P0P3四个这样的并行口
展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 商业管理 > 商业计划


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!