当前位置:文档之家› 外文翻译---51系列单片机的结构和功能

外文翻译---51系列单片机的结构和功能

外文翻译---51系列单片机的结构和功能
外文翻译---51系列单片机的结构和功能

附录A

英文文献

Structure and function of the MCS-51 series Structure and function of the MCS-51 series one-chip computer MCS-51 is a name of a piece of one-chip computer series which Intel Company produces. This company introduced 8 top-grade one-chip computers of MCS-51 series in 1980 after introducing 8 one-chip computers of MCS-48 series in 1976. It belong to a lot of kinds this line of one-chip computer the chips have,such as 8051, 8031, 8751, 80C51BH, 80C31BH,etc., their basic composition, basic performance and instruction system are all the same. 8051 daily representatives- 51 serial one-chip computers .

An one-chip computer system is made up of several following parts: ( 1) One microprocessor of 8 (CPU). ( 2) At slice data memory RAM (128B/256B),it use not depositting not can reading /data that write, such as result not middle of operation, final result and data wanted to show, etc. ( 3) Procedure memory ROM/EPROM (4KB/8KB ), is used to preserve the procedure , some initial data and form in slice. But does not take ROM/EPROM within some one-chip computers, such as 8031 , 8032, 80C ,etc.. ( 4) Four 8 run side by side I/O interface P0 four P3, each mouth can use as introduction , may use as exporting too. ( 5) Two timer / counter, each timer / counter may set up and count in the way, used to count to the external incident, can set up into a timing way too, and can according to count or result of timing realize the control of the computer. ( 6) Five cut off cutting off the control system of the source . ( 7) One all duplexing serial I/O mouth of UART (universal asynchronous receiver/transmitter (UART) ), is it realize one-chip computer or one-chip computer and serial communication of computer to use for. ( 8) Stretch oscillator and clock produce circuit, quartz crystal finely tune electric capacity need outer. Allow oscillation frequency as 12 megahertas now at most. Every the above-mentioned part was joined through the inside data bus .Among them, CPU is a core of the one-chip computer, it is the control of the computer and command centre, made up of such parts as arithmetic unit and controller , etc.. The arithmetic unit can carry on 8 persons of arithmetic operation and unit ALU of logic operation while including one, the 1 storing device temporarilies of 8, storing device 2 temporarily, 8's accumulation device ACC, register B and procedure state register PSW, etc. Person who accumulate

ACC count by 2 input ends entered of checking etc. temporarily as one operation often, come from person who store 1 operation is it is it make operation to go on to count temporarily , operation result and loopback ACC with another one. In addition, ACC is often regarded as the transfer station of data transmission on 8051 inside . The same as general microprocessor, it is the busiest register. Help remembering that agreeing with A expresses in the order. The controller includes the procedure counter , the order is depositted, the order decipher, the oscillator and timing circuit, etc. The procedure counter is made up of counter of 8 for two, amounts to 16. It is a byte address counter of the procedure in fact, the content is the next IA that will carried out in PC. The content which changes it can change the direction that the procedure carries out . Shake the circuit in 8051 one-chip computers, only need outer quartz crystal and frequency to finely tune the electric capacity, its frequency range is its 12MHZ of 1.2MHZ. This pulse signal, as 8051 basic beats of working, namely the minimum unit of time. 8051 is the same as other computers, the work in harmony under the control of the basic beat, just like an orchestra according to the beat play that is commanded.

There are ROM (procedure memory , can only read ) and RAM in 8051 slices (data memory, can is it can write ) two to read, they have each independent memory address space, dispose way to be the same with general memory of computer. Procedure 8051 memory and 8751 slice procedure memory capacity 4KB, address begin from 0000H, used for preserving the procedure and form constant. Data 8051- 8751 8031 of memory data memory 128B, address false 00FH, use for middle result to deposit operation, the data are stored temporarily and the data are buffered etc.. In RAM of this 128B, there is unit of 32 byteses that can be appointed as the job register, this and general microprocessor is different, 8051 slice RAM and job register rank one formation the same to arrange the location. It is not very the same that the memory of MCS-51 series one-chip computer and general computer disposes the way in addition. General computer for first address space, ROM and RAM can arrange in different space within the range of this address at will, namely the addresses of ROM and RAM, with distributing different address space in a formation. While visiting the memory, corresponding and only an address Memory unit, can ROM, it can be RAM too, and by visiting the order similarly. This kind of memory structure is called the structure of Princeton. 8051 memories are divided into procedure memory space and data memory space on the physics structure, there are four memory spaces in all: The

procedure stores in one and data memory space outside data memory and one in procedure memory space and one outside one, the structure forms of this kind of procedure device and data memory separated form data memory, called Harvard structure. But use the angle from users, 8051 memory address space is divided into three kinds: (1) In the slice, arrange blocks of FFFFH , 0000H of location , in unison outside the slice (use 16 addresses). (2) The data memory address space outside one of 64KB, the address is arranged from 0000H 64KB FFFFH (with 16 addresses ) too to the location. (3) Data memory address space of 256B (use 8 addresses). Three above-mentioned memory space addresses overlap, for distinguishing and designing the order symbol of different data transmission in the instruction system of 8051: CPU visit slice, ROM order spend MOVC , visit block RAM order uses MOVX outside the slice, RAM order uses MOV to visit in slice.

8051 one-chip computer have four 8 walk abreast I/O port, call P0, P1, P2 and P3. Each port is 8 accurate two-way mouths, accounts for 32 pins altogether. Every one I/O line can be used as introduction and exported independently. Each port includes a latch (namely special function register ), one exports the driver and a introduction buffer . Make data can latch when outputting, data can buffer when making introduction , but four function of passway these self-same. Expand among the system of memory outside having slice, four port these may serve as accurate two-way mouth of I/O in common use. Expand among the system of memory outside having slice, P2 mouth see high 8 address off; P0 mouth is a two-way bus, send the introduction of 8 low addresses and data / export in timesharing

Output grade , P3 of mouth , P1 of P1 , connect with inside have load resistance of drawing , every one of they can drive 4 Model LS TTL load to output. As while inputting the mouth, any TTL or NMOS circuit can drive P1 of 8051 one-chip computers as P3 mouth in a normal way . Because draw resistance on output grade of them have, can open a way collector too or drain-source resistance is it urge to open a way, do not need to have the resistance of drawing outerly . Mouths are all accurate two-way mouths too. When the conduct is input, must write the corresponding port latch with 1 first . As to 80C51 one-chip computer, port can only offer milliampere of output electric currents, is it output mouth go when urging one ordinary basing of transistor to regard as, should contact a resistance among the port and transistor base , in order to the electricity while restraining the high level from exporting P1~P3 Being restored to the throne is the operation of initializing of an one-chip computer. Its main

function is to turn PC into 0000H initially , make the one-chip computer begin to hold the conduct procedure from unit 0000H. Except that the ones that enter the system are initialized normally,as because procedure operate it make mistakes or operate there aren't mistake, in order to extricate oneself from a predicament , need to be pressed and restored to the throne the key restarting too. It is an input end which is restored to the throne the signal in 8051 China RST pin. Restore to the throne signal high level effective , should sustain 24 shake cycle (namely 2 machine cycles ) the above its effective times. If 6 of frequency of utilization brilliant to shake, restore to the throne signal duration should exceed 4 delicate to finish restoring to the throne and operating. Produce the logic picture of circuit which is restored to the throne the signal: Restore to the throne the circuit and include two parts outside in the chip entirely. Outside that circuit produce to restore to the throne signal (RST ) hand over to Schmitt's trigger, restore to the throne circuit sample to output , Schmitt of trigger constantly in each S5P2 , machine of cycle in having one more , then just got and restored to the throne and operated the necessary signal insidly. Restore to the throne resistance of circuit generally, electric capacity parameter suitable for 6 brilliant to shake, can is it restore to the throne signal high level duration greater than 2 machine cycles to guarantee. Being restored to the throne in the circuit is simple, its function is very important. Pieces of one-chip computer system could normal running,should first check it can restore to the throne not succeeding. Checking and can pop one's head and monitor the pin with the oscillograph tentatively, push and is restored to the throne the key, the wave form that observes and has enough range is exported (instantaneous), can also through is it restore to the throne circuit group holding value carry on the experiment to change.

中文文献

51系列单片机的结构和功能

51系列单片机是英特尔公司生产的具有一定结构和功能的单片机产品。这家公司在1976年引入8位MCS - 48系列单片机后,于1980年又推出了8位高档的MCS - 51系列单片机。它包含很多种这类型的单片机,如8051,8031,8751,80C51BH,80C31BH等,它们的基本组成,基本性能和指令系统都是一样的。一般情况习惯用8051来代表51系列单片机。

一个单片机的系统是由以下几部分组成:(1)一个8位CPU微处理器。(2)静态随机存取存储器,能够储存程序运行过程中产生的数据。(3)程序存储器ROM / EPROM中(4KB/8KB),用来保存程序和一些初始数据。但是在一些单片机中不使用ROM / EPROM中,如8031,8032,80c系列等。(4)4个8排的I / O并行接口P0 ~P3,每个口可以用作输入,也可以用作输出。(5)2个定时器/计数器,每个定时器/计数器可设置计数用来计数外部事件,可以设置成常用的定时方式,并可以根据计算或结果控制单片机的运行。(6)五个中断源控制系统。(7)1个双向串行I / O口的UART(通用异步接收器/发送器UART),用于实现单片机的串行通信。(8)振荡器和时钟产生电路,需要外部电源的石英晶体微调电路,允许接在12v的振荡频率上。上述部分通过内部数据总线连接。其中,CPU是单片机的核心,它是单片机的控制和指挥中心,ALU算数逻辑运算单元可进行算术运算和逻辑运算,由1个8暂时存储器,和2个8位的累加器组成。Acc累加器是ALU运算结果的存放单元,一般数据通过它来传送。此外,Acc 往往被视为对8051内的数据传输中转站。和通常的微处理器一样,它是最繁忙的寄存器。有记忆功能并执行命令。该控制器包括程序计数器,可读写的存储器,振荡器和定时电路等。该程序计数器是有两对8或16位计数器,它是一个字节地址计数器,在个人电脑运行程序时,执行下一个单元的内容,程序执行时可以改变它的内容从而改变运行的结果。在8051芯片震荡电路中,需要外接石英晶体和微调电容,其频率范围为1.2MHz—12MHz。该脉冲信号,即为8051的工作周期,是最小的时间单位。8051和其他单片机一样,都有相同的控制和功能,就像乐队也有打击乐器一样。

在8051中有ROM(程序存储器,只能读取),和RAM(数据存储器,可以

读和写),他们有各自独立的内存地址空间,也有相同的处理方式。8051和8751

的程序存储器的存储容量为4KB,地址从0000H开始,在使用过程中其中的数

据不变。8051、8751、8031数据存储器的内存为128B,默认地址是00FH,用

于保存中间数据和缓存。在这128B的内存中,有32 byteses,被称作工作寄存

器,和常用的微处理器不同的是,8051的RAM是按功能来划分模块的。MCS -

51系列单片机和一般电脑的处理方式不同。一般电脑会自动分配地址空间,ROM 和RAM的计算机可以安排在不同的空间内,地址范围会根据ROM和RAM的

位置分配不同地址空间。在访问的内存,不管是ROM和RAM,只有一个地址

对应一个内存单元,都要按这个顺序访问。这种内存结构是所谓的普林斯顿结构。

8051的存储器按物理结构划分可分为程序存储器空间和数据存储空间,共有四个内存空间,按结构位置的不同分为内部程序存储空间、外部程序存储空间、内

部数据存储空间和外部数据存储空间。但从用户的使用角度看,8051存储器地

址空间被分成三类:(1)片内,安排FFFFH的块,片外的(使用16个地址)串

(2)外部数据存储器地址空间为64KB,地址是从0000H到FFFFH 口0000H地址。

(含16个地址)的位置排列也。(3)256B的数据存储器(使用8个地址)的地

址空间。上述三个重叠的内存空间地址,用8051指令系统的传输不同的数据和

使用的功能区分。CPU的访问内存时,访问ROM使用MOVC语句,访问RAM

块顺序使用片外操作的MOVX语句,访问内存片段使用MOV语句。

8051单片机有4个8并行的I / O端口,分别为P0,P1,P2和P3。每个端口是8位精确的双向口,共占了32针。每一个I / O线可作为独立的入口和出口。每个端口包括一个锁存器(即特殊功能寄存器),一个出口驱动器和引进缓冲器。使数据能够锁存输出,数据可以及时缓冲,其余四个具有相同的功能。接外部存储扩大它们的内存时,这四个口就可作为双向口常用的I / O口,这是,P2口看到高8位地址,P0口是一个公共两用口,传送输出低8的地址和数据。

P3口的输出级别小于P1,可以在里面绘制负载电阻,每一个都能驱动4个LS型TTL负载输出。作为输入口时,所有TTL或NMOS电路都可以驱动一个正常的方式8051 - P3口作为单片机的P1口。可以利用改变电阻的输出大小,直接地充当震荡开路,不需要添加外部电阻。其中每个口都是标准的双向口。当在当做输入口时,必须把相应的端口置1来锁闭输出。比如8051单片机,所有端

口提供的输出电流只能几毫安,用作输出口时接一个普通的晶体管,要稳定使用,还要接一定电阻。其主要功能是把初始地址设为0000H,使单片机从0000H的地址开始运行程序。除了正常进入系统的初始化,由于操作失误或操作过程错误,也要能够解决错误,重新运行。在8051中RST引脚是一个输入复位键,复位键高电平信号有效,要保证24倍以上的时钟周期(即2个机器周期)。如果收到高频的6v输入信号,单片机就会复位。

初始化时,需要两部分外部电路。外部电路采用施密特触发方式触发了复位键(RST),形成了复位信号输出电路,并把信号传送到每个引脚,按顺序到了复位引脚,就会迅速响应信号指令。复位功能的可靠性,适合6V电压的电容震荡电路,复位信号的周期可以大于两个机器周期。虽然复位电路的结构很简单,但它的功能是非常重要的。一个单片机系统能否正常运行,应先检查它有没有正确的复位电路。检查和检测其发出信号,用示波器显示时,结合复位电路很重要,观察波形时,输出口(瞬时)的波动范围是很大的,也可以通过复位电路对实验进行有必要的改变。

AT89C51单片机外文翻译

AT89C51外文翻译 Description The AT89C51 is a low-power, high-performance CMOS 8-bit microcomputer with 4K bytes of Flash Programmable and Erasable Read Only Memory (PEROM). The device is manufactured using Atmel’s high density nonvolatile memory technology and is compatible with the industry standard MCS-51? instruction-set and pinout. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C51 is a powerful microcomputer which provides a highly flexible and cost effective solution to many embedded control applications. Features ? Compatible with MCS-51? Products ? 4K Bytes of In-System Reprogrammable Flash Memory – Endurance: 1,000 Write/Erase Cycles ? Fully Static Operation: 0 Hz to 24 MHz ? Three-Level Program Memory Lock ? 128 x 8-Bit Internal RAM ? 32 Programmable I/O Lines ? Two 16-Bit Timer/Counters ? Six Interrupt Sources ? Programmable Serial Channel ? Low Power Idle and Power Down Modes The AT89C51 provides the following standard features: 4K bytes of Flash,128 bytes of RAM, 32 I/O lines, two 16-bit timer/counters, a five vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator and clock circuitry. In addition, the AT89C51 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port and interrupt system to continue functioning. The Power-down Mode saves the RAM contents but freezes the oscillator disabling all other chip functions until the next hardware reset.

51单片机实例程100讲全集

目录 目录 (1) 函数的使用和熟悉 (4) 实例3:用单片机控制第一个灯亮 (4) 实例4:用单片机控制一个灯闪烁:认识单片机的工作频率 (4) 实例5:将P1口状态分别送入P0、P2、P3口:认识I/O口的引脚功能 (5) 实例6:使用P3口流水点亮8位LED (5) 实例7:通过对P3口地址的操作流水点亮8位LED (6) 实例8:用不同数据类型控制灯闪烁时间 (7) 实例9:用P0口、P1 口分别显示加法和减法运算结果 (8) 实例10:用P0、P1口显示乘法运算结果 (9) 实例11:用P1、P0口显示除法运算结果 (9) 实例12:用自增运算控制P0口8位LED流水花样 (10) 实例13:用P0口显示逻辑"与"运算结果 (10) 实例14:用P0口显示条件运算结果 (11) 实例15:用P0口显示按位"异或"运算结果 (11) 实例16:用P0显示左移运算结果 (11) 实例17:"万能逻辑电路"实验 (11) 实例18:用右移运算流水点亮P1口8位LED (12) 实例19:用if语句控制P0口8位LED的流水方向 (13) 实例20:用swtich语句的控制P0口8位LED的点亮状态 (13) 实例21:用for语句控制蜂鸣器鸣笛次数 (14) 实例22:用while语句控制LED (15) 实例23:用do-while语句控制P0口8位LED流水点亮 (16) 实例24:用字符型数组控制P0口8位LED流水点亮 (17) 实例25:用P0口显示字符串常量 (18) 实例26:用P0 口显示指针运算结果 (19) 实例27:用指针数组控制P0口8位LED流水点亮 (19) 实例28:用数组的指针控制P0 口8 位LED流水点亮 (20) 实例29:用P0 、P1口显示整型函数返回值 (21) 实例30:用有参函数控制P0口8位LED流水速度 (22) 实例31:用数组作函数参数控制流水花样 (22) 实例32:用指针作函数参数控制P0口8位LED流水点亮 (23) 实例33:用函数型指针控制P1口灯花样 (25) 实例34:用指针数组作为函数的参数显示多个字符串 (26) 实例35:字符函数ctype.h应用举例 (27) 实例36:内部函数intrins.h应用举例 (27) 实例37:标准函数stdlib.h应用举例 (28) 实例38:字符串函数string.h应用举例 (29) 实例39:宏定义应用举例2 (29) 实例40:宏定义应用举例2 (29) 实例41:宏定义应用举例3 (30)

8051单片机的内部结构

8051是MCS-51系列单片机的典型产品,我们以这一代表性的机型进行系统的讲解。 8051单片机包含中央处理器、程序存储器(ROM)、数据存储器(RAM)、定时/计数器、并行接口、串行接口和中断系统等几大单元及数据总线、地址总线和控制总线等三大总线,现在我们分别加以说明: 中央处理器(CPU)是整个单片机的核心 部件,是8位数据宽度的处理器,能处理 8位二进制数据或代码,CPU负责控制、 指挥和调度整个单元系统协调的工作,完 成运算和控制输入输出功能等操作。 ·数据存储器(RAM): 8051内部有128个8位用户数据存储 单元和128个专用寄存器单元,它们是统 一编址的,专用寄存器只能用于存放控制 指令数据,用户只能访问,而不能用于存 放用户数据,所以,用户能使用的的RAM 只有128个,可存放读写的数据,运算的 中间结果或用户定义的字型表。 ·程序存储器(ROM): 8051共有4096个8位掩膜ROM,用于存放用户程序,原始数据或表格。 ·定时/计数器(ROM): 8051有两个16位的可编程定时/计数器,以实现定时或计数产生中断用于控制程序转向。 ·并行输入输出(I/O)口: 8051共有4组8位I/O口(P0、P1、P2或P3),用于对外部数据的传输。 ·全双工串行口: 8051内置一个全双工串行通信口,用于与其它设备间的串行数据传送,该串行口既可以 用作异步通信收发器,也可以当同步移位器使用。 ·中断系统: 8051具备较完善的中断功能,有两个外中断、两个定时/计数器中断和一个串行中断,可 满足不同的控制要求,并具有2级的优先级别选择。 ·时钟电路: 8051内置最高频率达12MHz的时钟电路,用于产生整个单片机运行的脉冲时序,但8051 单片机需外置振荡电容。

51单片机外文文献

The Introduction of AT89C51 Description The AT89C51 is a low-power, high-performance CMOS 8-bit microcomputer with 4K bytes of Flash programmable and erasable read only memory (PEROM). The device is manufactured using Atmel’s high-density nonvolatile memory technology and is compatible with the industry-standard MCS-51 instruction set. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C51 is a powerful microcomputer which provides a highly-flexible and cost-effective solution to many embedded control applications. Function characteristic The AT89C51 provides the following standard features: 4K bytes of Flash, 128 bytes of RAM, 32 I/O lines, two 16-bit timer/counters, one 5 vector two-level interrupt architecture, a full duplex serial port, one-chip oscillator and clock circuitry. In addition, the AT89C51 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port and interrupt system to continue functioning. The Power-down Mode saves the RAM contents but freezes the oscillator disabling all other chip functions until the next hardware reset. Pin Description VCC:Supply voltage. GND:Ground.

51单片机实用汇编程序库(word)

51 单片机实用程序库 4.1 流水灯 程序介绍:利用P1 口通过一定延时轮流产生低电平 输出,以达到发光二极管轮流亮的效果。实际应用中例如:广告灯箱彩灯、霓虹灯闪烁。 程序实例(LAMP.ASM) ORG 0000H AJMP MAIN ORG 0030H MAIN: 9 MOV A,#00H MOV P1,A ;灭所有的灯 MOV A,#11111110B MAIN1: MOV P1,A ;开最左边的灯 ACALL DELAY ;延时 RL A ;将开的灯向右边移 AJMP MAIN ;循环 DELAY: MOV 30H,#0FFH D1: MOV 31H,#0FFH D2: DJNZ 31H,D2 DJNZ 30H,D1 RET END 4.2 方波输出 程序介绍:P1.0 口输出高电平,延时后再输出低电 平,循环输出产生方波。实际应用中例如:波形发生器。 程序实例(FAN.ASM): ORG 0000H MAIN: ;直接利用P1.0 口产生高低电平地形成方波////////////// ACALL DELAY SETB P1.0 ACALL DELAY 10 CLR P1.0 AJMP MAIN ;////////////////////////////////////////////////// DELAY: MOV R1,#0FFH DJNZ R1,$ RET

五、定时器功能实例 5.1 定时1 秒报警 程序介绍:定时器1 每隔1 秒钟将p1.o 的输出状态改变1 次,以达到定时报警的目的。实际应用例如:定时报警器。程序实例(DIN1.ASM): ORG 0000H AJMP MAIN ORG 000BH AJMP DIN0 ;定时器0 入口 MAIN: TFLA G EQU 34H ;时间秒标志,判是否到50 个 0.2 秒,即50*0.2=1 秒 MOV TMOD,#00000001B;定时器0 工作于方式 1 MOV TL0,#0AFH MOV TH0,#3CH ;设定时时间为0.05 秒,定时 20 次则一秒 11 SETB EA ;开总中断 SETB ET0 ;开定时器0 中断允许 SETB TR0 ;开定时0 运行 SETB P1.0 LOOP: AJMP LOOP DIN0: ;是否到一秒//////////////////////////////////////// INCC: INC TFLAG MOV A,TFLAG CJNE A,#20,RE MOV TFLAG,#00H CPL P1.0 ;////////////////////////////////////////////////// RE: MOV TL0,#0AFH MOV TH0,#3CH ;设定时时间为0.05 秒,定时 20 次则一秒 RETI END 5.2 频率输出公式 介绍:f=1/t s51 使用12M 晶振,一个周期是1 微秒使用定时器1 工作于方式0,最大值为65535,以产生200HZ 的频率为例: 200=1/t:推出t=0.005 秒,即5000 微秒,即一个高电

单片机外文翻译--STC89C52处理芯片

外文资料翻译 STC89C52 processi ng chip Prime features: With MCS - 51 SCM product compatibility, 8K bytes in the system programmable Flash memory, 1000 times CaXie cycle, the static operation: 0Hz ~ 33Hz, triple encryption program memory, 32 programmed I/O port, three 16 timer/counter, the eight uninterrupted dual-career UART serial passage, low power consumption, leisure and fall after fall electric power mode can be awakened and continuous watchdog timer and double-number poin ter, power ide ntifier. Efficacy: characteristics STC89C52 is one kind of low power consumption, high CMOS8 bit micro-co ntroller, 8K in system programmable Flash memory. Use high-de nsity nonv olatile storage tech no logy, and in dustrial 80C51 product in structi on and pin fully compatible. The Flash memory chips allows programs in the system, also suitable for programmable conventional programming. In a single chip, have clever 8 bits CPU and on li ne system programmable Flash, in crease STC89C52 for many embedded control system to provide high vigorous application and useful solutions. STC89C52 has following standard efficacy: 8k byte Flash RAM, 256 bytes, 32 I/O port, the watchdog timer, two, three pointer numerical 16 timer/counter, a 6 vector level 2 continuous structure, the serial port, working within crystals and horological circuit. In addition, 0Hz AT89S52 can drop to the static logic operation, support two software can choose power saving mode. Idle mode, the CPU to stop working, and allows the RAM, timer/c oun ters, serial, continu ous to work. Protectio n asa na patter n, RAM content is survival, vibrators frozen, SCM, until all the work under a continuous or hardware reset. 8-bit microcontrollers 8K bytes in the system programmable Flash AT89S52 devices. Mouth: P0 P0 mouth is a two-way ope n drain I/O. As export, each can drive eight TTL logic level. For P0 port to write "1", foot as the high impeda nee in put. When access to exter nal programs and nu merical memory, also known as

51单片机实例(含详细代码说明)

1.闪烁灯 1.实验任务 如图4.1.1所示:在P1.0端口上接一个发光二极管L1,使L1在不停地一亮一灭,一亮一灭的时间间隔为0.2秒。 2.电路原理图 图4.1.1 3.系统板上硬件连线 把“单片机系统”区域中的P1.0端口用导线连接到“八路发光二极管指示模块”区域中的L1端口上。 4.程序设计内容 (1).延时程序的设计方法 作为单片机的指令的执行的时间是很短,数量大微秒级,因此,我们要 求的闪烁时间间隔为0.2秒,相对于微秒来说,相差太大,所以我们在 执行某一指令时,插入延时程序,来达到我们的要求,但这样的延时程 序是如何设计呢?下面具体介绍其原理:

如图4.1.1所示的石英晶体为12MHz,因此,1个机器周期为1微秒机器周期微秒 MOV R6,#20 2个 2 D1: MOV R7,#248 2个 2 2+2×248=498 20× DJNZ R7,$ 2个2×248 (498 DJNZ R6,D1 2个2×20=40 10002 因此,上面的延时程序时间为10.002ms。 由以上可知,当R6=10、R7=248时,延时5ms,R6=20、R7=248时, 延时10ms,以此为基本的计时单位。如本实验要求0.2秒=200ms, 10ms×R5=200ms,则R5=20,延时子程序如下: DELAY: MOV R5,#20 D1: MOV R6,#20 D2: MOV R7,#248 DJNZ R7,$ DJNZ R6,D2 DJNZ R5,D1 RET (2).输出控制 如图1所示,当P1.0端口输出高电平,即P1.0=1时,根据发光二极管 的单向导电性可知,这时发光二极管L1熄灭;当P1.0端口输出低电平, 即P1.0=0时,发光二极管L1亮;我们可以使用SETB P1.0指令使P1.0 端口输出高电平,使用CLR P1.0指令使P1.0端口输出低电平。 5.程序框图 如图4.1.2所示

51单片机的结构及其组成

51单片机的结构及其组成 在前面的五节课当中,我们讲述的都是一些基础概念的知识,从这节开始,我们就正式的切入到我们所在学习的对象--51单片机。 学习单片机的内部结构之前,我们先了解下我们现在正在使用的计算机的几大组成部份: 计算机的五个组成部份: 运算器:用于实现算术和逻辑运算。计算机的运算和处理都在这里进行; 控制器:是计算机的控制指挥部件,使计算机各部份能自动协调的工作; 存储器:用于存放程序和数据;(又分为内存储器和外存储器,内存储器就如我们电脑的硬盘,外存储器就如我们的U盘) 输入设备:用于将程序和数据输入到计算机(例如我们电脑的键盘、扫描仪); 输出设备:输出设备用于把计算机数据计算或加工的结果以用户需要的形式显示或保存(例如我们的打印机)。 注: 1、通常把运算器和控制器合在一起称为中央处理器(Central Processing Unit),简称CPU。 2、通常把外存储器、输入设备和输出设备合在一起称之为计算机的外部设备。 上面讲的是我们的个人办公计算机,那么51单片机的内部又有些什么部件组成呢? 1、中央处理单元(8位) 数据处理、测试位,置位,复位位操作 2、只读存储器(4KB或8KB) 永久性存储应用程序,掩模ROM、EPROM、EEPROM 3、随机存取内存(128B、128B SFR) 在程序运行时存储工作变量和资料 4、并行输入/输出口(I / O)(32条) 作系统总线、扩展外存、I / O接口芯片 5、串行输入/输出口(2条) 串行通信、扩展I / O接口芯片 6、定时/计数器(16位、加1计数) 计满溢出、中断标志置位、向CPU提出中断请求,与CPU之间独立工作 7、时钟电路 内振、外振。

外文翻译---51系列单片机的结构和功能

外文翻译---51系列单片机的结构和功能

外文资料翻译 英文原文: Structure and function of the MCS-51 series Structure and function of the MCS-51 series one-chip computer MCS-51 is a name of a piece of one-chip computer series which Intel Company produces. This company introduced 8 top-grade one-chip computers of MCS-51 series in 1980 after introducing 8 one-chip computers of MCS-48 series in 1976. It belong to a lot of kinds this line of one-chip computer the chips have such as 8051, 8031, 8751, 80C51BH, 80C31BH,etc., their basic composition, basic performance and instruction system are all the same. 8051 daily representatives- 51 serial one-chip computers . An one-chip computer system is made up of several following parts: (1) One microprocessor of 8 (CPU). (2) At slice data memory RAM (128B/256B),it use not depositing not can reading /data that write, such as result not middle of operation, final result and data wanted to show, etc. (3) Procedure memory ROM/EPROM (4KB/8KB ), is used to preserve the procedure , some initial data and form in slice. But does not take ROM/EPROM within some one-chip computers, such as 8031 , 8032, 80C ,etc.. (4) Four 8 run side by side I/O interface P0 four P3, each mouth can use as introduction, may use as exporting too. (5) Two timer / counter, each timer / counter may set up and count in the way, used to count to the external incident, can set up into a timing way too, and can according to count or result of timing realize the control of the computer. (6) Five cut off cutting off the control (universal asynchronous receiver/transmitter (UART) ), is it realize one-chip computer or one-chip computer and serial communication of computer to use for. (8) Stretch oscillator and clock produce circuit, quartz crystal finely tune electric capacity need outer. Allow oscillation frequency as 12 megahertz now at most. Every the above-mentioned part was joined through the inside data bus .Among them, CPU is a core of the one-chip computer, it is the control of the computer and command center, made up of such parts as arithmetic unit and controller , etc.. The arithmetic unit can carry on 8 persons of arithmetic operation and unit ALU of logic operation while including one, the 1 storing devices temporarily of 8, storing device 2 temporarily, 8's accumulation device ACC, register B and procedure state register PSW, etc. Person who accumulate ACC count by 2 input ends entered of checking etc. temporarily as one operation often, come from person who store 1 operation is it is it make operation to go on to count temporarily , operation result and loop back ACC with another one. In addition, ACC is often regarded as the transfer station of data transmission on 8051 inside. The same as general microprocessor, it is the busiest register. Help remembering that agreeing with a expresses in the order. The controller includes the procedure counter, the order is deposited, the

51单片机CPU的内部结构

51单片机CPU的内部结构 在前面的课程中,我们已知道了单片机内部有一个8位的CPU,同时知道了CPU 内部包含了运算器,控制器及若干寄存器。在这节课,我们就与大家一起来讨论一下51单片机CPU的内部结构及工作原理。 从上图中我们可以看到,在虚线框内的就是CPU的内部结构了,8位的MCS-51单片机的CPU内部有数术逻辑单元ALU(Arithmetic Logic Unit)、累加器A (8位)、寄存器B(8位)、程序状态字PSW(8位)、程序计数器PC(有时也称为指令指针,即IP,16位)、地址寄存器AR(16位)、数据寄存器DR(8位)、指令寄存器IR(8位)、指令译码器ID、控制器等部件组成。 1、运算器(ALU)的主要功能 A)算术和逻辑运算,可对半字节(一个字节是8位,半个字节就是4位)和单字节数据进行操作。 B)加、减、乘、除、加1、减1、比较等算术运算。 C)与、或、异或、求补、循环等逻辑运算。 D)位处理功能(即布尔处理器)。 由于ALU内部没有寄存器,参加运算的操作数,必须放在累加器A中。累加器A 也用于存放运算结果。 例如:执行指令 ADD A,B 执行这条指令时,累加器A中的内容通过输入口In_1输入ALU,寄存器B通过内部数据总线经输入口In_2输入ALU,A+B的结果通过ALU的输出口Out、内部

数据总线,送回到累加器A。 2、程序计数器PC PC的作用是用来存放将要执行的指令地址,共16位,可对64K ROM直接寻址,PC低8位经P0口输出,高8位经P2口输出。也就是说,程序执行到什么地方,程序计数器PC就指到哪里,它始终是跟蹿着程序的执行。我们知道,用户程序是存放在内部的ROM中的,我们要执行程序就要从ROM中一个个字节的读出来,然后到CPU中去执行,那么ROM具体执行到哪一条呢?这就需要我们的程序计数器PC来指示。 程序计数器PC具有自动加1的功能,即从存储器中读出一个字节的指令码后,PC自动加1(指向下一个存储单元)。 3、指令寄存器IR 指令寄存器的作用就是用来存放即将执行的指令代码。 在这里我们先简单的了解下CPU执行指令的过程,首先由程序存储器(ROM)中读取指令代码送入到指令寄存器,经译码器译码后再由定时与控制电路发出相应的控制信号,从而完成指令的功能。关于指令在单片机内部的执行过程,我们在后面将会以另一节课来进行详细的讲解。 4、指令译码器ID 用于对送入指令寄存器中的指令进行译码,所谓译码就是把指令转变成执行此指令所需要的电信号。当指令送入译码器后,由译码器对该指令进行译码,根据译码器输出的信号,CPU控制电路定时地产生执行该指令所需的各种控制信号,使单片机正确的执行程序所需要的各种操作。 5、地址寄存器AR(16位) AR的作用是用来存放将要寻址的外部存储器单元的地址信息,指令码所在存储单元的地址编码,由程序计数器PC产生,而指令中操作数所在的存储单元地址码,由指令的操作数给定。从上图中我们可以看到,地址寄存器AR通过地址总线AB与外部存储器相连。 6、数据寄存器DR 用于存放写入外部存储器或I/O端口的数据信息。可见,数据寄存器对输出数据具有锁存功能。数据寄存器与外部数据总线DB直接相连。 7、程序状态字PSW 用于记录运算过程中的状态,如是否溢出、进位等。 例如,累加器A的内容83H,执行: ADD A,#8AH ;累加器A与立即数8AH相加,并把结果存放在A中。 指令后,将产生和的结果为[1]0DH,而累加器A只有8位,只能存放低8位,即0DH,元法存放结果中的最高位B8。为些,在CPU内设置一个进位标志位C,当执行加法运算出现进位时,进位标志位C为1。 8、时序部件 由时钟电路和脉冲分配器组成,用于产生微操作控制部件所需的定时脉冲信号在后面的课程中我们将会安排一节课来讲解这些专用的寄存器。

51单片机简介外文翻译

51单片机简介 描述 AT89C51是一个低电压,高性能CMOS8位单片机带有4K字节的可反复擦写的程序存储器(PENROM)。和128字节的存取数据存储器(RAM),这种器件采用ATMEL公司的高密度、不容易丢失存储技术生产,并且能够与MCS-51系列的单片机兼容。片内含有8位中央处理器和闪烁存储单元,有较强的功能的AT89C51单片机能够被应用到控制领域中。 功能特性 AT89C51提供以下的功能标准:4K字节闪烁存储器,128字节随机存取数据存储器,32个I/O口,2个16位定时/计数器,1个5向量两级中断结构,1个串行通信口,片内震荡器和时钟电路。另外,AT89C51还可以进行0HZ的静态逻辑操作,并支持两种软件的节电模式。闲散方式停止中央处理器的工作,能够允许随机存取数据存储器、定时/计数器、串行通信口及中断系统继续工作。掉电方式保存随机存取数据存储器中的内容,但震荡器停止工作并禁止其它所有部件的工作直到下一个复位。 引脚描述 VCC:电源电压 GND:地 P0口: P0口是一组8位漏极开路双向I/O口,即地址/数据总线复用口。作为输出口时,每一个管脚都能够驱动8个TTL电路。当“1”被写入P0口时,每个管脚都能够作为高阻抗输入端。P0口还能够在访问外部数据存储器或程序存储器时,转换地址和数据总线复用,并在这时激活内部的上拉电阻。P0口在闪烁编程时,P0口接收指令,在程序校验时,输出指令,需要接电阻。 P1口:

P1口一个带内部上拉电阻的8位双向I/O口,P1的输出缓冲级可驱动4个TTL 电路。对端口写“1”,通过内部的电阻把端口拉到高电平,此时可作为输入口。因为内部有电阻,某个引脚被外部信号拉低时输出一个电流。闪烁编程时和程序校验时,P1口接收低8位地址。 P2口: P2口是一个内部带有上拉电阻的8位双向I/O口,P2的输出缓冲级可驱动4个TTL电路。对端口写“1”,通过内部的电阻把端口拉到高电平,此时,可作为输入口。因为内部有电阻,某个引脚被外部信号拉低时会输出一个电流。在访问外部程序存储器或16位地址的外部数据存储器时,P2口送出高8位地址数据。在访问8位地址的外部数据存储器时,P2口线上的内容在整个运行期间不变。闪烁编程或校验时,P2口接收高位地址和其它控制信号。 P3口: P3口是一组带有内部电阻的8位双向I/O口,P3口输出缓冲故可驱动4个TTL 电路。对P3口写如“1”时,它们被内部电阻拉到高电平并可作为输入端时,被外部拉低的P3口将用电阻输出电流。 P3口除了作为一般的I/O口外,更重要的用途是它的第二功能,如下表所示: 端口引脚第二功能 P3.0 RXD P3.1 TXD P3.2 INT0 P3.3 INT1 P3.4 T0 P3.5 T1 P3.6 WR P3.7 RD P3口还接收一些用于闪烁存储器编程和程序校验的控制信号。 RST: - 2 -

单片机毕业设计外文翻译--AT89S52

本科毕业设计(论文)外文翻译 外文资料翻译译文 AT89S52 主要性能 ●与MCS-51单片机产品兼容 ●8K字节在系统可编程Flash存储器 ●1000次擦写周期 ●全静态操作:0Hz~33Hz ●三级加密程序存储器 ●32个可编程I/O口线 ●三个16位定时器/计数器 ●八个中断源 ●全双工UART串行通道 ●低功耗空闲和掉电模式 ●掉电后中断可唤醒 ●看门狗定时器 ●双数据指针 ●掉电标识符 功能特性描述 AT89S52是一种低功耗、高性能CMOS8位微控制器,具有8K在系统可编程Flash 存储器。使用Atmel公司高密度非易失性存储器技术制造,与工业80C51产品指令和引脚完全兼容。片上Flash允许程序存储器在系统可编程,亦适于常规编程器。在单芯片上,拥有灵巧的8位CPU和在系统可编程Flash,使得AT89S52为众多嵌入式控制应用系统提供高灵活、超有效的解决方案。AT89S52具有以下标准功能:8k字节Flash,256字节RAM,32位I/O口线,看门狗定时器,2个数据指针,三个16位定时器/计数器,一个6向量2级中断结构,全双工串行口,片内晶振及时

钟电路。另外,AT89S52可降至0Hz静态逻辑操作,支持2种软件可选择节电模式。空闲模式下,CPU停止工作,允许RAM、定时器/计数器、串口、中断继续工作。掉电保护方式下,RAM内容被保存,振荡器被冻结,单片机一切工作停止,直到下一个中断或硬件复位为止。 引脚结构 方框图

VCC : 电源 GND :地 P0口:P0口是一个8位漏极开路的双向I/O口。作为输出口,每位能驱动8个TTL逻辑电平。对P0端口写“1”时,引脚用作高阻抗输入。当访问外部程序和数据存储器时,P0口也被作为低8位地址/数据复用。在这种模式下,P0具有内部上拉电阻。 在flash编程时,P0口也用来接收指令字节;在程序校验时,输出指令字节。程序校验时,需要外部上拉电阻。 P1口:P1 口是一个具有内部上拉电阻的8位双向I/O 口,p1 输出缓冲器能驱动4个TTL 逻辑电平。对P1端口写“1”时,内部上拉电阻把端口拉高,此时可以作为输入口使用。作为输入使用时,被外部拉低的引脚由于内部电阻的原因,将输出电流(IIL)。此外,P1.0和P1.2分别作定时器/计数器2的外部计数输入

51单片机50个实例代码

51单片机50个例程代码程序里有中断,串口等驱动,直接复制即可使用1-IO输出-点亮1个LED灯方法1 /*----------------------------------------------- 名称:IO口高低电平控制 论坛:https://www.doczj.com/doc/7b9973799.html, 编写:shifang 日期:2009.5 修改:无 内容:点亮P1口的一个LED灯 该程序是单片机学习中最简单最基础的, 通过程序了解如何控制端口的高低电平 ------------------------------------------------*/ #include //包含头文件,一般情况不需要改动, //头文件包含特殊功能寄存器的定义 sbit LED=P1^0;// 用sbit 关键字定义LED到P1.0端口, //LED是自己任意定义且容易记忆的符号 /*------------------------------------------------ 主函数 ------------------------------------------------*/ void main (void) { //此方法使用bit位对单个端口赋值 LED=1; //将P1.0口赋值1,对外输出高电平 LED=0; //将P1.0口赋值0,对外输出低电平 while (1) //主循环 { //主循环中添加其他需要一直工作的程序 } } 2-IO输出-点亮1个LED灯方法2 /*-----------------------------------------------

名称:IO口高低电平控制 论坛:https://www.doczj.com/doc/7b9973799.html, 编写:shifang 日期:2009.5 修改:无 内容:点亮P1口的一个LED灯 该程序是单片机学习中最简单最基础的, 通过程序了解如何控制端口的高低电平 ------------------------------------------------*/ #include //包含头文件,一般情况不需要改动, //头文件包含特殊功能寄存器的定义 /*------------------------------------------------ 主函数 ------------------------------------------------*/ void main (void) { //此方法使用1个字节对单个端口赋值 P1 = 0xFF; //P1口全部为高电平,对应的LED灯全灭掉, //ff换算成二进制是1111 1111 P1 = 0xfe; //P1口的最低位点亮,可以更改数值是其他的灯点亮 //0xfe是16进制,0x开头表示16进制数, //fe换算成二进制是1111 1110 while (1) //主循环 { //主循环中添加其他需要一直工作的程序 } } 3-IO输出-点亮多个LED灯方法1 /*----------------------------------------------- 名称:IO口高低电平控制 论坛:https://www.doczj.com/doc/7b9973799.html, 编写:shifang 日期:2009.5 修改:无 内容:点亮P1口的多个LED灯

51单片机外文翻译

描述 AT89C51是一个低电压,高性能CMOS8位单片机带有4K字节的可反复擦写的程序存储器(PENROM)。和128字节的存取数据存储器(RAM),这种器件采用ATMEL公司的高密度、不容易丢失存储技术生产,并且能够与MCS-51系列的单片机兼容。片内含有8位中央处理器和闪烁存储单元,有较强的功能的AT89C51单片机能够被应用到控制领域中。 功能特性 AT89C51提供以下的功能标准:4K字节闪烁存储器,128字节随机存取数据存储器,32个I/O口,2个16位定时/计数器,1个5向量两级中断结构,1个串行通信口,片内震荡器和时钟电路。另外,AT89C51还可以进行0HZ的静态逻辑操作,并支持两种软件的节电模式。闲散方式停止中央处理器的工作,能够允许随机存取数据存储器、定时/计数器、串行通信口及中断系统继续工作。掉电方式保存随机存取数据存储器中的内容,但震荡器停止工作并禁止其它所有部件的工作直到下一个复位。 引脚描述 VCC:电源电压 GND:地 P0口: P0口是一组8位漏极开路双向I/O口,即地址/数据总线复用口。作为输出口时,每一个管脚都能够驱动8个TTL电路。当“1”被写入P0口时,每个管脚都能够作为高阻抗输入端。P0口还能够在访问外部数据存储器或程序存储器时,转换地址和数据总线复用,并在这时激活内部的上拉电阻。P0口在闪烁编程时,P0口接收指令,在程序校验时,输出指令,需要接电阻。 P1口: P1口一个带内部上拉电阻的8位双向I/O口,P1的输出缓冲级可驱动4个TTL 电路。对端口写“1”,通过内部的电阻把端口拉到高电平,此时可作为输入口。因为

沈阳航空工业学院电子工程系毕业设计(外文翻译) 内部有电阻,某个引脚被外部信号拉低时输出一个电流。闪烁编程时和程序校验时,P1口接收低8位地址。 P2口: P2口是一个内部带有上拉电阻的8位双向I/O口,P2的输出缓冲级可驱动4个TTL电路。对端口写“1”,通过内部的电阻把端口拉到高电平,此时,可作为输入口。因为内部有电阻,某个引脚被外部信号拉低时会输出一个电流。在访问外部程序存储器或16位地址的外部数据存储器时,P2口送出高8位地址数据。在访问8位地址的外部数据存储器时,P2口线上的内容在整个运行期间不变。闪烁编程或校验时,P2口接收高位地址和其它控制信号。 P3口: P3口是一组带有内部电阻的8位双向I/O口,P3口输出缓冲故可驱动4个TTL 电路。对P3口写如“1”时,它们被内部电阻拉到高电平并可作为输入端时,被外部拉低的P3口将用电阻输出电流。 P3口除了作为一般的I/O口外,更重要的用途是它的第二功能,如下表所示: P3 RST: 复位输入。当震荡器工作时,RET引脚出现两个机器周期以上的高电平将使单片机复位。 - 2 -

相关主题
文本预览
相关文档 最新文档