【正文】
, the work in harmony under the control of the basic beat, just like an orchestra according to the beat play that is manded.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 puter. Procedure 8051 memory and 8751 slice procedure memory capacity 4KB, address begin from 0000H, used for preserving the procedure and form constant. Data 80518751 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 byte that can be appointed as the job register, this and general microprocessor is diffent,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 MCS51 series onechip puter and general puter diposes the way in addition. General puter 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 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 000OH 64KB FFFFH(with 16 addresses)too to the location.(3)Data memory address space of 256B(use 8 addresses).Three abovementioned 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 onechip puter have four 8 walk abreast I/O port, call P0,P1,P2 and port is 8 accurate twoway 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 of passedaway these selfsame. Expand among the system of memory outside having slice, four ports these may serve as accurate twoway mouth of I/O in mon use. Expand among the system of memory outside having slice, P2 mouth see high 8 address off。 P0 mouth is a twoway 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 onechip puters as P3 mouth in a normal way. Because draw resistance on output grade of them have, can open a way collector too or drainsource resistance is it urge to open a way, do not need to have the resistance of drawing outerly. Mouths are all accurate twoway mouths too. When the conduct is input, must write the corresponding port latch with 1 first. As to 80C51 onechip puter, 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 onechip puter. Its main function is to turn PC into 0000H initially, make the onechip puter begin to hold the conduct procedure from unit 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 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’s 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 onechip puter 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 obse