Structure and function of the MCS-51seriesStructure and function of the MCS-51series one-chip computer MCS-51is a name of a piece of one-chip computer series which Intel Company produces.This company introduced8top-grade one-chip computers of MCS-51series in1980after introducing8one-chip computers of MCS-48series in1976.It belong to a lot of kinds this line of one-chip computer the chips have,such as8051,8031,8751, 80C51BH,80C31BH,etc.,their basic composition,basic performance and instruction system are all the same.8051daily representatives-51serial one-chip computers.An one-chip computer system is made up of several following parts:(1)One microprocessor of8(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 as8031, 8032,80C,etc..(4)Four8run side by side I/O interface P0four 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 as12megahertas 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 on8persons of arithmetic operation and unit ALU of logic operation while including one,the1 storing device temporarilies of8,storing device2temporarily,8's accumulationdevice ACC,register B and procedure state register PSW,etc.Person who accumulate ACC count by2input ends entered of checking etc.temporarily as one operation often,come from person who store1operation 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 on8051inside.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 of8for two,amounts to16.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 in8051one-chip computers,only need outer quartz crystal and frequency to finely tune the electric capacity,its frequency range is its 12MHZ of1.2MHZ.This pulse signal,as8051basic beats of working,namely the minimum unit of time.8051is 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 in8051slices (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. Procedure8051memory and8751slice procedure memory capacity4KB,address begin from0000H,used for preserving the procedure and form constant.Data8051-87518031of memory data memory128B,address false00FH,use for middle result to deposit operation,the data are stored temporarily and the data are buffered etc..In RAM of this128B,there is unit of32byteses that can be appointed as the job register, this and general microprocessor is different,8051slice RAM and job register rank one formation the same to arrange the location.It is not very the same that the memory of MCS-51series 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 ROMand 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.8051memories 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,8051memory address space is divided into three kinds:(1)In the slice,arrange blocks of FFFFH,0000H of location,in unison outside the slice(use16addresses).(2)The data memory address space outside one of64KB,the address is arranged from0000H64KB FFFFH(with16addresses)too to the location.(3)Data memory address space of256B(use8addresses).Three above-mentioned memory space addresses overlap,for distinguishing and designing the order symbol of different data transmission in the instruction system of8051: CPU visit slice,ROM order spend MOVC,visit block RAM order uses MOVX outside the slice,RAM order uses MOV to visit in slice.8051one-chip computer have four8walk abreast I/O port,call P0,P1,P2and P3. Each port is8accurate two-way mouths,accounts for32pins 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 high8address off;P0mouth is a two-way bus,send the introduction of8 low addresses and data/export in timesharingOutput grade,P3of mouth,P1of P1,connect with inside have load resistance of drawing,every one of they can drive4Model LS TTL load to output.As while inputting the mouth,any TTL or NMOS circuit can drive P1of8051one-chipcomputers as P3mouth 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 with1first.As to80C51one-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~P3Being restored to the throne is the operation of initializing of an one-chip computer.Its main function is to turn PC into0000H initially,make the one-chip computer begin to hold the conduct procedure from unit0000H.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 in8051China RST pin.Restore to the throne signal high level effective,should sustain24shake cycle(namely2machine cycles)the above its effective times.If6of frequency of utilization brilliant to shake,restore to the throne signal duration should exceed4delicate 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 for6brilliant to shake,can is it restore to the throne signal high level duration greater than2machine 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 thethrone 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系列之一--计算机芯片监控监-51名是一幅一个电脑晶片,英特尔公司生产系列.这家公司推出8级一个计算机芯片监控监-51系列之后,于1980年8引入一个计算机芯片监控监,于1976年48系列.。