PrincipleofMCU英文版_第1页
PrincipleofMCU英文版_第2页
PrincipleofMCU英文版_第3页
PrincipleofMCU英文版_第4页
PrincipleofMCU英文版_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、A microcontroller (or MCU) is a computer-on-a-chip. It is a type of microprocessor emphasizing self-sufficiency and cost-effectiveness, in contrast to a general-purpose microprocessor (the kind used in a PC). The majority of computer systems in use today are embedded in other machinery, such as tele

2、phones, clocks, appliances, vehicles, and infrastructure. An embedded system usually has minimal requirements for memory and program length and may require simple but unusual input/output systems. For example, most embedded systems lack keyboards, screens, disks, printers, or other recognizable I/O

3、devices of a personal computer. They may control electric motors, relays or voltages, and read switches, variable resistors or other electronic devices. Often, the only I/O device readable by a human is a single light-emitting diode, and severe cost or power constraints can even eliminate that. In c

4、ontrast to general-purpose CPUs, microcontrollers do not have an address bus or a data bus, because they integrate all the RAM and non-volatile memory on the same chip as the CPU. Because they need fewer pins, the chip can be placed in a much smaller, cheaper package. Integrating the memory and othe

5、r peripherals on a single chip and testing them as a unit increases the cost of that chip, but often results in decreased net cost of the embedded system as a whole. (Even if the cost of a CPU that has integrated peripherals is slightly more than the cost of a CPU + external peripherals, having fewe

6、r chips typically allows a smaller and cheaper circuit board, and reduces the labor required to assemble and test the circuit board). This trend leads to design. A microcontroller is a single integrated circuit, commonly with the following features: central processing unit - ranging from small and s

7、imple 4-bit processors to sophisticated 32- or 64-bit processors input/output interfaces such as serial ports (UARTs) other serial communications interfaces like I²C, Serial Peripheral Interface and Controller Area Network for system interconnect peripherals such as timers and watchdog RAM for

8、data storage ROM, EPROM, EEPROM or Flash memory for program storage clock generator - often an oscillator for a quartz timing crystal, resonator or RC circuit many include analog-to-digital converters This integration drastically reduces the number of chips and the amount of wiring and PCB space tha

9、t would be needed to produce equivalent systems using separate chips and have proved to be highly popular in embedded systems since their introduction in the 1970s. Some microcontrollers can afford to use a Harvard architecture: separate memory buses for instructions and data, allowing accesses to t

10、ake place concurrently. The decision of which peripheral to integrate is often difficult. The Microcontroller vendors often trade operating frequencies and system design flexibility against time-to-market requirements from their customers and overall lower system cost. Manufacturers have to balance

11、the need to minimize the chip size against additional functionality. Microcontroller architectures are available from many different vendors in so many varieties that each instruction set architecture could rightly belong to a category of their own. Chief among these are the 8051, Z80 and ARM deriva

12、tives.Abstract: Introduce a kind of dormancy of using- restore to the throne in the operation way and improve the anti-interference ability method of the one-chip computer; Analyses its scope of application, provide and use the circuit concretely; Combine the instance, analyze the characteristic of

13、the hardware and software design under these kind of operation way.Keyword: One-chip computer Restore to the throne /dormancy anti-interference Foreword .Introduction: With the development at full speed of the micro electric technique, the performance of the one-chip computer improves rapidly, demon

14、strate the outstanding advantage in the operation, logic control, intelligent respect, replaced and enlarged the measuring that the circuit made up, control circuit by digital logical circuit, operation originally to a great extent, use very extensively. But because it have system halted, procedure

15、run critical defect of flying etc, make it limit in a lot of important application of occasion. A lot of technology in anti-interference , for example set up the software trap, add the hardware to guard the gate in dog's circuit etc, can make this problem have better settlement, but still the ex

16、isting problem: Guard the gate dog at the movement, mean and appear mistake already and run some time, this is not allowed in some occasions; Procedure appear circulation mistake very much sometimes, but just guard the gate dog control link include and enter, adopt and guard the gate as to such a mi

17、stake dog unable to discern; In measure and control cycle among the long system, one-chip computer spend wait for the peripheral hardware a large amount of time, will be interfered too when carry out and wait for the order. To these situations, we have tried the method restored to the throne volunta

18、rily in practice, alternate pulse of adopting etc or restore to the throne waking according to external terms to the one-chip computer up. After being restored to the throne each time, the one-chip computer carries out the corresponding procedure, enters dormancy in time after finishing carrying out

19、 the task, wait to be restored to the throne neatly. Have solved above-mentioned problems well with this method , and has got better result in the agricultural voltage transformer comprehensive protector experiment. Now take 51 serial one-chip computers as an example and probe into the concrete prin

20、ciple and implementation method, restored to the throne the signal as the high level.A principle and implementation method1.1 Restored to the throne the law regularly unconditionallyUse timer, special-purpose clock chip or other pulse generator, produce signal of restoring to the throne regularly ac

21、cording to interval that set for. This kind of method is especially suitable for the measuring instrument. In not running actually, sample the analog quantity of introduction with A/D converter often, then store showing. This course is very fast, but steady for reading, the data per second are only

22、upgraded 1 -2 times, a large amount of time of CPU is used for waiting. Let CPU carry out and enter dormancy directly after the task , restore to the throne and wake by external world up It carry out the next operation, this is to restore to the throne the law regularly In this way can make anti-int

23、erference ability strengthen greatly , have 2 points mainly: . At the dormancy, procedure stop run, can appear PC indicator disorderly procedure that causes run and fly. Work time in dormancy proportion 1:9, that is to say 1 s have 0.1 time of s used for measuring, sending off showing, there is time

24、 dormancy of 0.9s, the probability that the procedure is interfered is 1/10 while running at full speed, whole anti-interference ability raise by 10 times. Because every 1s is restored to the throne once unconditionally, once present the system halted during a job, can certainly resume when restored

25、 to the throne next time. As to only instrument that show, some reading mistake that 1s appear accidentally there is no memory to the next measurement, be could bear , belong to “pass” mistake. This kind is restored to the throne the advantage of dog's circuit for guarding the gate regularly, fi

26、rst, change waiting time into a dormancy state, time to shorten and may be interfered; Second, avoided happening that the dog controls the death circulation of the link to include guarding the gate.1.2 The external condition is restored to the throne the lawSome arrival that export or measure is con

27、trolled by the outside. For instance, the hot form. of heating, rotate the pulse produced and calculate heat by hot water wheels, there is no hot water to flow, there is no heat to export, CPU only need in fact keep number value, do not need to count. Can imagine hot water wheels rotate when parking

28、 warm , CPU idle in will it be will it be one season autumn spring and summer, If let dormancy its , measure have water wheels pulse constantly, anti-interference ability can strengthen greatly. So, so long as link up the restoring to the throne of the pulse of the water wheels and CPU, the water wh

29、eels rotate a circle each time, CPU is restored to the throne once, hot form. can work normally , this is restored to the throne the law by the external condition . Similar application have half electron kilowatt-hour meter , go on one count just when the machinery degree wheels and transfers to a c

30、ircle, users do not need the electricity, CPU has been knowing the dormancy all the time . The restoring to the throne in the interval not to be regular, but confirmed according to the external condition of this method. In some occasions, the time of the dormancy will be very long, very effective to

31、 improving anti-interference ability.2 .The hardware realizes the main point2.1 Restored to the throne regularly unconditionallyGenerally have 2 kinds of methods. Use the timer or the special-purpose clock chip to be restored to the throne. Fig1, in order to use the timing circuit that 555 circuit m

32、akes up; Can use the clock chips of X1126 ,etc too , wake CPU up with the alarm signal after setting up warning time. This kind of method is suitable when the long interval is made, can also follow the result of this operation ,determine to wake time up in alarm next time temporarily, very flexible

33、and convenient. The signal of using the system to be inherent is as reducing the pulse regularly. Use 50Hz worker power make reducing after having a facelift frequently, already omit the timer, gathered the corresponding signal for the phase place which measured the electric current signal at the sa

34、me time, as Fig. 2 shows.2.2 External conditions are restored to the throne Send external condition pulse to and is restored to the throne the end son after having a facelift. To that above-mentioned water wheels or the ammeter spend a pulse produced, can use Schmitt's trigger to have a facelift

35、; For writing down the instrument of the biggest or minimum,can use the window comparator. In order to realize the electrification that is regulated,can use the electronic electric potential device, establish upper and lower limits with the order of the one-chip computer.2.3 Reduce cycle and restore

36、d to the throne the high electricity at ordinary timesIn Fig3, restored to the throne the signal during high level Tr, the one-chip computer is in the state of restoring to the throne, the procedure does not run, anti-interference ability is the strongest; After the high level, the one-chip computer

37、 begins to hold the conduct procedure. That is to say, are restored to the throne and suitable for the time that the procedure carries out during the low level Td of the signal, this time should be greater than the execution cycle of the procedure each time. It is restore to the throne cycle and res

38、tore to the throne high level of signal take empty than very much important to choose rationally. As to simple to show instrument, restore to the throne cycle determine data break cycle, low electricity is it measure, hank over all time shown to greater than to want at ordinary times; Otherwise, can

39、t present forever the mistake of the intact executive program. Monolithic integrated circuit in Ts and Tr period all can effectively the ant jamming, but is best the unnecessary time arrangement in Tr. When the program time is long, when as far as possible the request reduces Tr, may join the differ

40、entiating circuit, like chart 1 center C30, R26, D9. 2.4 Treatment of output end sonsRestore to the throne straight pulseDuring all I/O mouth of one-chip computer turn into the high level when restoring to the throne. That is to say output for low pin normally, will according to restore to the

41、throne cycle appear the width for the straight pulse of Tr. This straight pulse will influence the normal output, 2 methods are dealt with:   Connect in parallel electric capacity suppress , capacity confirm according to Tr time that restore to the throne on the son in end. Reducing Tr can be r

42、educed and connected the electric capacity in parallel. It is invalid to design the peripheral circuit into the high level. (2) Fault-tolerantChoose the capacity that the output end connects the electric capacity in parallel fault-tolerantly and properly, can realize fault-tolerant control. Reduced

43、cycle in a certain, because interfered exporting the wrong level. Because the keeping function of electric capacity, can't still enable exporting the change to the valid level within this cycle; Next cycle , the mistake is corrected. So, so long as does not make mistakes in 2 cycles in successio

44、n, it is very fault-tolerant to export Certainly, this kind of method will make the normal output change lag behind for one cycle, just really reflect the output end son.2.5 has the electricity to measure and restore to the throne manuallySome system is it make some initialize and operate to want at

45、 electricity for the first time. Restored to the throne and already become the beginning condition of normal running each time while adopting the way of restoring to the throne to run , it is unable to distinguish and have the electricity for the first time. In some pin connects the electric capacit

46、y of one1PF to the ground, measure this pin after being restored to the throne, if low level to have electricity for the first time. Give system set up one restore to the throne button, that is to say a common one manual to restore to the throne, this button is not joined and being restored to the t

47、hrone in the end, is connected in parallel in the electric capacity both ends to the ground of above-mentioned pins.3. The software realizes the main point3.1 is it resume with zero clearing RAM to outputRestore to the throne the last all pin turn high level into , is it should take place unnecessar

48、y change for low pin to make regularly, so, should resume the state. of all pins immediately after being restored to the throne. There are 2 kinds of methods : Analyze and judge immediately after being restored to the throne this time, provide the state of the pin according to the need; In being RAM

49、 it is the last state that come down, these RAM when restored. To the throne regularly can the zero clearing one; But electricity or manual to restore to the throne when pushing in conformity with zero clearing, is it embody to want when the software is worked outing at the beginning. If calculate t

50、ime allows, try one's best to take method 1. Restore to the throne cycle probability made mistakes to calculate very little, according to 2 for the 2nd time in succession. 4 output end son that narrate connect treatment method of electric capacity in parallel, can reach kind anti-interference re

51、sult very.3.2 realizes crossing over and is restored to the throne alternate time sequenceregularly to controlWork in way of restoring to the throne now, start anew and carry out the same procedure repeatedly each time. Can be divided into 2 kinds of situations: As to simple to show instrument, carr

52、y on measurement ,send off showing after being restored to the throne each time, have causality between restoring to the throne twice . need is it switch over to the dormancy to waiting original only. Should pay attention to, measurement, give total time used to show is it is it restore to the thron

53、e low electricity at ordinary times to smaller than to want, otherwise can't present forever the mistake of the intact executive program. For having application that time sequence controlled , after being restored to the throne each time , should check first that see the sign left last cycle , i

54、n order to determine what is done this cycle . That is to say every is it restore to the throne operation of cycle to stride , by is it transmit to indicate all, these indicate while leaving in inside RAM , the zero clearing only when have the electricity for the first time. For example, the protect

55、ing synthetically device of above-mentioned voltage transformer , is restored to the throne regularly according to the interval of 20ms. It reaches the normal working state through, certain movement order after having the electricity, such as Fig. 4; Write a part of the procedure of the software acc

56、ording to this movement, such as Fig. 5.In 4 Fig, act as person who protect the beginning at the electricity, is it transmit power 0 to try at first. 5s, points out and transmits power soon; Transmit power formally after waiting for 30s. It is start-up time in 1s after transmitting power, does not m

57、easure the electric current. Start after finishing, if all going well, the location is put" normal sign ", person who protect restore to the throne cycle enter normal running in the next one. Try 0 that transmits power. 5s is it is it realize to count once restoring to the throne to delay time, restore to the throne time 20ms each t

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论