

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、<p><b> 論文附件</b></p><p><b> ?。ㄒ唬┯⑽脑模?lt;/b></p><p> he single slice machine is also called tiny controller, is because it was used in the industry to control realm a
2、t the earliest stage.Single slice machine from inside chip have CPU appropriation processor to develop only since then.At the earliest stage of design the principle is to pass to integrate a great deal of peripherals and
3、 CPU in a chip, making calculator system smaller, integrating more easily into complicated of but to mention to request a strict control equipments in the middle.The I</p><p> The single slice of the earlie
4、r period all of machines are 8 or 4.Among them, the INTEL is most successful of 8031, because of in brief dependable but the function was quite good to acquire very big good opinion.Henceforth at 8031 up developed MCS51
5、serieses a single slice machine system.According to the single slice of this system machine system is still in the extensive usage till now.Because the industry controls the exaltation of[with] realm request, starting ap
6、pearing 16 single slice machin</p><p> Single slice the machine ratio appropriation processor is the most suitable to match to apply in the built-in system, so it got the most applications.In fact the singl
7、e slice machine is an amount the most calculators are in the world.The modern mankind are living medium use of assemble in almost each electronics and machine product have a single slice machine.All have 1-2 single slice
8、 machine in the computer accessorieses such as cellular phone, telephone, calculator, home appliances, electronic</p><p> SCM system software interference methods</p><p> In improving the abil
9、ity of anti-jamming system hardware, software interference with its flexible design, save hardware resources, more and more attention to reliability. Below the MCS-51 SCM system as an example, the computer system softwar
10、e interference methods for research.</p><p> A method of anti-jamming software</p><p> In engineering practice, anti-jamming software on the content of the main ones being: one, eliminate the
11、analog input signal noise (such as digital filtering technology); two, is running the program when the chaos back to the right track approach. In this paper, which made several effective methods of anti-jamming software.
12、</p><p> 1.1 redundant directives</p><p> CPU process is to take instructions from operating code, and then take a few operators. When the PC interference errors, procedures will be from the n
13、ormal track "flying", when flying to a double-byte instructions, if the instructions for a few moments landed on the operation, as the number-up operation operation code, procedural error will be . If the "
14、;fly" to the three-byte instructions, a greater probability of error.</p><p> In some key areas were inserted into single-byte instructions, or to be effective single-byte command rewrite directive kno
15、wn as redundancy. Is usually double-byte instructions and orders three bytes inserted after more than two bytes of the NOP. This flew to operate even if the number of flying procedures, the air operations of NOP because
16、of the existence of the directive to avoid being behind the operation as a number of implementation, automatically into the right track.</p><p> In addition, the system flows to play an important role in th
17、e directive such as RET, RETI, LCALL, LJMP, JC, and other instructions inserted before the two NOP, also could be flying into the right track procedures to ensure that the implementation of these important directives.<
18、;/p><p> 1.2 interception technology</p><p> The so-called blocking, is flying the procedure will lead the specified location and then an error handling. Traps are usually software used to block
19、flying procedures. Therefore must be reasonably designed trap, trap in the second to the appropriate location.</p><p> 1.2.1 software design traps</p><p> When flying into the non-process proc
20、edures, redundant command will not work. By software traps, interceptors flying procedures, to lead the specified location and then an error handling. Software trap is used to capture the flying process toward reduction
21、of import address 0000 H instructions. EPROM process in Central Africa usually fill in the following areas as software instructions trap:</p><p><b> NOP</b></p><p><b> NOP<
22、;/b></p><p> LJMP 0000H</p><p> Its native code for the 0000020000.</p><p> 1.2.2 trap arrangements</p><p> Usually in the process of the unused space filled EPR
23、OM 0000020000. Finally one should fill 020,000, when flying procedures fell on the area, to automatically orbit. In the user program, and various modules in the margins between the unit can also fill traps command. When
24、using the interference and interruption due to open, in the corresponding interrupt service procedures set up software trap, caught the wrong time can be interrupted. If an application system not yet used an external int
25、errupt,</p><p><b> NOP</b></p><p><b> NOP</b></p><p><b> RETI</b></p><p> Top of instruction available "RETI", can als
26、o be used "LJMP 0000H". If the fault diagnosis procedures and systems since the restoration of the design process reliable, complete with "LJMP 0000H" for the return instructions directly into the fau
27、lt diagnosis procedures, as soon as possible to deal with failure and recovery procedures of the operation.</p><p> Taking into account the capacity of program memory, software trap 1 K space in the general
28、 2-3 can be effectively blocked.</p><p> 1.3 software "watchdog" technology.</p><p> If out-of-control process into the "cycle of death", usually a "watchdog" tec
29、hnology to process from the "death cycle." By constantly testing procedures cycle running time, if the process cycle time exceeds the maximum running time cycle, the system that a "cycle of death", th
30、e need for error handling.</p><p> "Watchdog" technology can be hardware, software can be. In industrial applications, serious interference may sometimes be interrupted damage control word, closur
31、e of interruption. The system can not regularly "Weigou", hardware watchdog circuit failure. The software watchdog to be effective in solving such problems.</p><p> The author in practical applica
32、tion, using ring interrupted surveillance systems. T0 Watchdog timer with T1, with timer T1 surveillance main program, the main program Watchdog T0. This ring used the software "watchdog" has a good anti-jammin
33、g performance, greatly improving the system reliability. The need for frequent use of T1 timer serial communications monitoring and control system, the timer T1 can not be interrupted, may be diverted from the serial int
34、erruption to monitor (if using a MCS-52</p><p> 2 system failure treatment, since the resumption of the design process.</p><p> SCM system caused by interference or brown-out reset after reset
35、 it is an abnormal reduction should be carried out fault diagnosis and automatically reset before the resumption of non-normal state.</p><p> 2.1 normal reduction of non-recognition</p><p> ro
36、cedures for the implementation of always starting from 0000 H, resulting from the 0000 H program started four possibilities: one, booting the system power-on reset; Second, the software fault reset; three, watchdog overt
37、ime not Weigou hardware reset; four tasks Is being implemented in the brown-out reset after the call. In addition to the four cases in the first case, it is an abnormal reduction, the need to be identified.</p>&l
38、t;p> 2.1.1 reset the hardware and software reset of the identification</p><p> Here hardware reset that boot reduction and reset the watchdog, the registers have an impact on the reduction of hardware,
39、such as the reduction after the PC = 0000H, SP = 07H, PSW = 00H, and so on. The software will reset the SP, SPW had no effect. Therefore, the computer monitoring system, when the normal operation of procedures, will addr
40、ess more than SP set up 07 H, or PSW the first five users sign-in system at the normal operation of a set. So just detection system reset or SP-PSW.5 signs o</p><p> Figure 1 hardware and software reset ide
41、ntification flow chart In addition, as hardware reset state-chip RAM is random, and the software reset-chip RAM can be reset to maintain state, to select a film within one or two units as a power symbol. Zuoshang used t
42、o set up 40 H, signs, signs on, the word for the 78 H, if the system reset after 40 H unit content is not equivalent to 78 H, is that hardware reset, or software that is reset, to deal with mistakes. If the two modules f
43、or a power symbol, s</p><p> 2.1.2 boot reduction and reset the watchdog fault identification</p><p> Boot reduction and reset the watchdog fault because of the same hardware reset, to be the
44、correct identification, the use of general non-volatile RAM or EEROM. When the system during normal operation, set up a power-down can protect the observation unit. When normal operation at the time of the interruption W
45、eigou service program Zhongshi the observation unit to maintain the normal value (as AAH), and the main way in the unit cleared, the observation unit can be brown-out protection, the boot By</p><p> 2.1.3 b
46、oots reduction and the reduction of non-normal start-up identification</p><p> Monitoring system to identify the situation as a result of accidents in the system, such as brown-out conditions caused by the
47、boot boot reduction and reset, the process control system is particularly important. If a time for the control of standards of measurement and control systems, monitoring and control tasks required to complete a one hour
48、. In 50 minutes has been monitoring the implementation of the circumstances, the system voltage reduction caused abnormal, and then reset at this time if</p><p> 2.2 Non-normal reset after the system has re
49、sumed operation of the program design</p><p> On the order of some of the demanding process control system, the system of non-normal reset not, generally from out-of-control requirements that mandate a modu
50、le or restore operation. Therefore, monitoring and control system to make important data unit, the backup parameters, such as the system running, the system of the process, the current import, export value, the current v
51、alue of the clock, observation unit value, these data should not only regular backup, and if so Laws should also be back</p><p> When the system has to determine the reduction of non-normal circumstances, w
52、e should first restore the necessary data systems, such as the display module initialization, the expansion of chip-chip, such as the initialization. This was followed by another system of monitoring and control system s
53、tatus, operating parameters to be restored, including the display interface recovery. After further reduction before the mission, parameters, running time of recovery, re-entering the system running.</p><p>
54、 It should be pointed out that the real restoration of the operating system needs very careful to state the system to back up important data and to check the reliability of data to ensure recovery of the reliability of
55、data.</p><p> Secondly, the multi-task, multi-process measurement and control systems, data recovery to consider resumption of the order problem, the author of the practical application of data recovery pro
56、cess flow chart shown in Figure 2.</p><p> Figure in the restoration of basic data system is out of the back-up data covering the current system data. Basic system initialization means the chip, display, in
57、put and output method to initialize, attention should be paid to the initial input and output should not be mistaken action. And reset before the mandate of the mission is to initialize the state of implementation, opera
58、tion hours.</p><p><b> ?。ǘ┯⑽姆g:</b></p><p> 單片機(jī)也被稱為微控制器(Microcontroler),是因?yàn)樗钤绫挥迷诠I(yè)控制領(lǐng)域。單片機(jī)由芯片內(nèi)僅有CPU的專用處理器發(fā)展而來(lái)。最早的設(shè)計(jì)理念是通過(guò)將大量外圍設(shè)備和CPU集成在一個(gè)芯片中,使計(jì)算機(jī)系統(tǒng)更小,更容易集成進(jìn)復(fù)雜的而對(duì)提及要求嚴(yán)格的控制設(shè)備當(dāng)中。INTEL
59、的Z80是最早按照這種思想設(shè)計(jì)出的處理器,從此以后,單片機(jī)和專用處理器的發(fā)展便分道揚(yáng)鑣。</p><p> 早期的單片機(jī)都是8位或4位的。其中最成功的是INTEL的8031,因?yàn)楹?jiǎn)單可靠而性能不錯(cuò)獲得了很大的好評(píng)。此后在8031上發(fā)展出了MCS51系列單片機(jī)系統(tǒng)?;谶@一系統(tǒng)的單片機(jī)系統(tǒng)直到現(xiàn)在還在廣泛使用。隨著工業(yè)控制領(lǐng)域要求的提高,開(kāi)始出現(xiàn)了16位單片機(jī),但因?yàn)樾詢r(jià)比不理想并未得到很廣泛的應(yīng)用。90年代后隨
60、著消費(fèi)電子產(chǎn)品大發(fā)展,單片機(jī)技術(shù)得到了巨大的提高。隨著INTEL i960系列特別是后來(lái)的ARM系列的廣泛應(yīng)用,32位單片機(jī)迅速取代16位單片機(jī)的高端地位,并且進(jìn)入主流市場(chǎng)。而傳統(tǒng)的8位單片機(jī)的性能也得到了飛速提高,處理能力比起80年代提高了數(shù)百倍。目前,高端的32位單片機(jī)主頻已經(jīng)超過(guò)300MHz,性能直追90年代中期的專用處理器,而普通的型號(hào)出廠價(jià)格跌落至1美元,最高端的型號(hào)也只有10美元。當(dāng)代單片機(jī)系統(tǒng)已經(jīng)不再只在裸機(jī)環(huán)境下開(kāi)發(fā)和使
61、用,大量專用的嵌入式操作系統(tǒng)被廣泛應(yīng)用在全系列的單片機(jī)上。而在作為掌上電腦和手機(jī)核心處理的高端單片機(jī)甚至可以直接使用專用的Windows和Linux操作系統(tǒng)。</p><p> 單片機(jī)比專用處理器最適合應(yīng)用于嵌入式系統(tǒng),因此它得到了最多的應(yīng)用。事實(shí)上單片機(jī)是世界上數(shù)量最多的計(jì)算機(jī)?,F(xiàn)代人類生活中所用的幾乎每件電子和機(jī)械產(chǎn)品中都會(huì)集成有單片機(jī)。手機(jī)、電話、計(jì)算器、家用電器、電子玩具、掌上電腦以及鼠標(biāo)等電腦配件中都
62、配有1-2部單片機(jī)。而個(gè)人電腦中也會(huì)有為數(shù)不少的單片機(jī)在工作。汽車上一般配備40多部單片機(jī),復(fù)雜的工業(yè)控制系統(tǒng)上甚至可能有數(shù)百臺(tái)單片機(jī)在同時(shí)工作!單片機(jī)的數(shù)量不僅遠(yuǎn)超過(guò)PC機(jī)和其他計(jì)算的綜合,甚至比人類的數(shù)量還要多。 </p><p> 單片機(jī)系統(tǒng)軟件抗干擾方法</p><p> 在提高硬件系統(tǒng)抗干擾能力的同時(shí),軟件抗干擾以其設(shè)計(jì)靈活、節(jié)省硬件資源、可靠性好越來(lái)越受到重視。下面以MCS
63、-51單片機(jī)系統(tǒng)為例,對(duì)微機(jī)系統(tǒng)軟件抗干擾方法進(jìn)行研究。</p><p> 1 軟件抗干擾方法的研究</p><p> 在工程實(shí)踐中,軟件抗干擾研究的內(nèi)容主要是: 一、消除模擬輸入信號(hào)的嗓聲(如數(shù)字濾波技術(shù));二、程序運(yùn)行混亂時(shí)使程序重入正軌的方法。本文針對(duì)后者提出了幾種有效的軟件抗干擾方法。</p><p><b> 1.1 指令冗余&
64、lt;/b></p><p> CPU取指令過(guò)程是先取操作碼,再取操作數(shù)。當(dāng)PC受干擾出現(xiàn)錯(cuò)誤,程序便脫離正常軌道“亂飛”,當(dāng)亂飛到某雙字節(jié)指令,若取指令時(shí)刻落在操作數(shù)上,誤將操作數(shù)當(dāng)作操作碼,程序?qū)⒊鲥e(cuò)。若“飛” 到了三字節(jié)指令,出錯(cuò)機(jī)率更大。</p><p> 在關(guān)鍵地方人為插入一些單字節(jié)指令,或?qū)⒂行巫止?jié)指令重寫稱為指令冗余。通常是在雙字節(jié)指令和三字節(jié)指令后插入兩個(gè)字節(jié)以
65、上的NOP。這樣即使亂飛程序飛到操作數(shù)上,由于空操作指令NOP的存在,避免了后面的指令被當(dāng)作操作數(shù)執(zhí)行,程序自動(dòng)納入正軌。</p><p> 此外,對(duì)系統(tǒng)流向起重要作用的指令如RET、 RETI、LCALL、LJMP、JC等指令之前插入兩條NOP,也可將亂飛程序納入正軌,確保這些重要指令的執(zhí)行。</p><p><b> 1.2 攔截技術(shù)</b></p>
66、;<p> 所謂攔截,是指將亂飛的程序引向指定位置,再進(jìn)行出錯(cuò)處理。通常用軟件陷阱來(lái)攔截亂飛的程序。因此先要合理設(shè)計(jì)陷阱,其次要將陷阱安排在適當(dāng)?shù)奈恢谩?lt;/p><p> 1.2.1 軟件陷阱的設(shè)計(jì) 當(dāng)亂飛程序進(jìn)入非程序區(qū),冗余指令便無(wú)法起作用。通過(guò)軟件陷阱,攔截亂飛程序,將其引向指定位置,再進(jìn)行出錯(cuò)處理。軟件陷阱是指用來(lái)將捕獲的亂飛程序引向復(fù)位入口地址0000H的
67、指令。通常在EPROM中非程序區(qū)填入以下指令作為軟件陷阱:</p><p><b> NOP</b></p><p><b> NOP</b></p><p> LJMP 0000H</p><p> 其機(jī)器碼為0000020000。</p><p> 1.2.2
68、陷阱的安排</p><p> 通常在程序中未使用的EPROM空間填0000020000。最后一條應(yīng)填入020000,當(dāng)亂飛程序 落到此區(qū),即可自動(dòng)入軌。在用戶程序區(qū)各模塊之間的空余單元也可填入陷阱指令。當(dāng)使用的中斷因干擾而開(kāi)放時(shí),在對(duì)應(yīng)的中斷服務(wù)程序中設(shè)置軟件陷阱,能及時(shí)捕獲錯(cuò)誤的中斷。如某應(yīng)用系統(tǒng)雖未用到外部中斷1,外部中斷1的中斷服務(wù)程序可為如下形式:</p><p><b&g
69、t; NOP</b></p><p><b> NOP</b></p><p><b> RETI</b></p><p> 返回指令可用“RETI”,也可用“LJMP 0000H”。如果故障診斷程序與系統(tǒng)自恢復(fù)程序的設(shè)計(jì)可靠、 完善,用“LJMP 0000H”作返回指令可直接進(jìn)入故障診斷程序,盡早地處
70、理故障并恢復(fù)程序的運(yùn)行??紤]到程序存貯器的容量,軟件陷阱一般1K空間有2-3個(gè)就可以進(jìn)行有效攔截。</p><p> 1.3 軟件“看門狗”技術(shù)</p><p> 若失控的程序進(jìn)入“死循環(huán)”,通常采用“看門狗”技術(shù)使程序脫離“死循環(huán)”。通過(guò)不斷檢測(cè)程序循環(huán)運(yùn)行時(shí)間,若發(fā)現(xiàn)程序循環(huán)時(shí)間超過(guò)最大循環(huán)運(yùn)行時(shí)間,則認(rèn)為系統(tǒng)陷入“死循環(huán)”,需進(jìn)行出錯(cuò)處理。</p><p>
71、; “看門狗”技術(shù)可由硬件實(shí)現(xiàn),也可由軟件實(shí)現(xiàn)。 在工業(yè)應(yīng)用中,嚴(yán)重的干擾有時(shí)會(huì)破壞中斷方式控制字,關(guān)閉中斷。則系統(tǒng)無(wú)法定時(shí)“喂狗”,硬件看門狗電路失效。而軟件看門狗可有效地解決這類問(wèn)題。</p><p> 筆者在實(shí)際應(yīng)用中,采用環(huán)形中斷監(jiān)視系統(tǒng)。用定時(shí)器T0監(jiān)視定時(shí)器T1,用定時(shí)器T1監(jiān)視主程序,主程序監(jiān)視定時(shí)器T0。采用這種環(huán)形結(jié)構(gòu)的軟件“看門狗”具有良好的抗干擾性能,大大提高了系統(tǒng)可靠性。對(duì)于需經(jīng)常使用
72、T1定時(shí)器進(jìn)行串口通訊的測(cè)控系統(tǒng),則定時(shí)器T1不能進(jìn)行中斷,可改由串口中斷進(jìn)行監(jiān)控(如果用的是MCS-52系列單片機(jī),也可用T2代替T1進(jìn)行監(jiān)視)。這種軟件“看門狗”監(jiān)視原理是:在主程序、T0中斷服務(wù)程序、T1中斷服務(wù)程序中各設(shè)一運(yùn)行觀測(cè)變量,假設(shè)為MWatch、T0Watch 、T1Watch,主程序每循環(huán)一次,MWatch加1,同樣T0、T1中斷服務(wù)程序執(zhí)行一次,T0Watch、 T1Watch加1。在T0中斷服務(wù)程序中通過(guò)檢測(cè)T1
73、Watch的變化情況判定T1運(yùn)行是否正常,在T1中斷服務(wù)程序中檢測(cè)MWatch的變化情況判定主程序是否正常運(yùn)行,在主程序中通過(guò)檢測(cè)T0Watch的變化情況判別T0是否正常工作。若檢測(cè)到某觀測(cè)變量變化不正常,比如應(yīng)當(dāng)加1而未加1,則轉(zhuǎn)到出錯(cuò)處理程序作排除故障處理。當(dāng)然,對(duì)主程序最大循環(huán)周期、定時(shí)器T0和T1定時(shí)周期應(yīng)予以全盤合理考慮。限于篇幅不贅述。</p><p> 2 系統(tǒng)故障處理、自恢復(fù)程序的設(shè)
74、計(jì)</p><p> 單片機(jī)系統(tǒng)因干擾復(fù)位或掉電后復(fù)位均屬非正常復(fù)位,應(yīng)進(jìn)行故障診斷并能自動(dòng)恢復(fù)非正常復(fù)位前的狀態(tài)。</p><p> 2.1 非正常復(fù)位的識(shí)別</p><p> 程序的執(zhí)行總是從0000H開(kāi)始,導(dǎo)致程序從 0000H開(kāi)始執(zhí)行有四種可能:一、系統(tǒng)開(kāi)機(jī)上電復(fù)位;二、軟件故障復(fù)位;三、看門狗超時(shí)未喂狗硬件復(fù)位; 四、任務(wù)正在執(zhí)行中掉電后來(lái)電復(fù)位。四
75、種情況中除第一種情況外均屬非正常復(fù)位,需加以識(shí)別。</p><p> 2.1.1 硬件復(fù)位與軟件復(fù)位的識(shí)別</p><p> 此處硬件復(fù)位指開(kāi)機(jī)復(fù)位與看門狗復(fù)位,硬件復(fù)位對(duì)寄存器有影響,如復(fù)位后PC=0000H, SP=07H,PSW=00H等。而軟件復(fù)位則對(duì)SP、SPW無(wú)影響。故對(duì)于微機(jī)測(cè)控系統(tǒng),當(dāng)程序正常運(yùn)行時(shí),將SP設(shè)置地址大于07H,或者將PSW的第5位用戶標(biāo)志位在系統(tǒng)正常運(yùn)行
76、時(shí)設(shè)為1。那么系統(tǒng)復(fù)位時(shí)只需檢測(cè)PSW.5標(biāo)志位或SP值便可判此是否硬件復(fù)位。圖1是采用PSW.5作上電標(biāo)志位判別硬、軟件復(fù)位的程序流程圖。</p><p> 此外,由于硬件復(fù)位時(shí)片內(nèi)RAM狀態(tài)是隨機(jī)的,而軟件復(fù)位片內(nèi)RAM則可保持復(fù)位前狀態(tài),因此可選取片內(nèi)某一個(gè)或兩個(gè)單元作為上電標(biāo)志。設(shè) 40H用來(lái)做上電標(biāo)志,上電標(biāo)志字為78H,若系統(tǒng)復(fù)位后40H單元內(nèi)容不等于78H,則認(rèn)為是硬件復(fù)位,否則認(rèn)為是軟件復(fù)位,轉(zhuǎn)
77、向出錯(cuò)處理。若用兩個(gè)單元作上電標(biāo)志,則這種判別方法的可靠性更高。</p><p> 圖1 硬、軟件復(fù)位識(shí)別流程圖</p><p> 2.1.2 開(kāi)機(jī)復(fù)位與看門狗故障復(fù)位的識(shí)別</p><p> 開(kāi)機(jī)復(fù)位與看門狗故障復(fù)位因同屬硬件復(fù)位, 所以要想予以正確識(shí)別,一般要借助非易失性RAM或者EEROM。當(dāng)系統(tǒng)正常運(yùn)行時(shí),設(shè)置一可掉電保護(hù)的觀測(cè)單元。當(dāng)系統(tǒng)正常運(yùn)行時(shí),
78、在定時(shí)喂狗的中斷服務(wù)程序中使該觀測(cè)單元保持正常值(設(shè)為 AAH),而在主程中將該單元清零,因觀測(cè)單元掉電可保護(hù),則開(kāi)機(jī)時(shí)通過(guò)檢測(cè)該單元是否為正常值可判斷是否看門狗復(fù)位。</p><p> 2.1.3 正常開(kāi)機(jī)復(fù)位與非正常開(kāi)機(jī)復(fù)位的識(shí)別</p><p> 識(shí)別測(cè)控系統(tǒng)中因意外情況如系統(tǒng)掉電等情況引起的開(kāi)機(jī)復(fù)位與正常開(kāi)機(jī)復(fù)位,對(duì)于過(guò)程控制系統(tǒng)尤為重要。如某以時(shí)間為控制標(biāo)準(zhǔn)的測(cè)控系統(tǒng),完成一
79、次測(cè)控任務(wù)需1小時(shí)。在已執(zhí)行測(cè)控50分鐘的情況下,系統(tǒng)電壓異常引起復(fù)位,此時(shí)若系統(tǒng)復(fù)位后又從頭開(kāi)始進(jìn)行測(cè)控則會(huì)造成不必要的時(shí)間消耗。因此可通過(guò)一監(jiān)測(cè)單元對(duì)當(dāng)前系統(tǒng)的運(yùn)行狀態(tài)、系統(tǒng)時(shí)間予以監(jiān)控,將控制過(guò)程分解為若干步或若干時(shí)間段,每執(zhí)行完一步或每運(yùn)行一個(gè)時(shí)間段則對(duì)監(jiān)測(cè)單元置為關(guān)機(jī)允許值,不同的任務(wù)或任務(wù)的不同階段有不同的值,若系統(tǒng)正在進(jìn)行測(cè)控任務(wù)或正在執(zhí)某時(shí)間段,則將監(jiān)測(cè)單元置為非正常關(guān)機(jī)值。那么系統(tǒng)復(fù)位后可據(jù)此單元判系統(tǒng)原來(lái)的運(yùn)行狀態(tài),
80、并跳到出錯(cuò)處理程序中恢復(fù)系統(tǒng)原運(yùn)行狀態(tài)。</p><p> 2.2 非正常復(fù)位后系統(tǒng)自恢復(fù)運(yùn)行的程序設(shè)計(jì)</p><p> 對(duì)順序要求嚴(yán)格的一些過(guò)程控制系統(tǒng),系統(tǒng)非正常復(fù)位否,一般都要求從失控的那一個(gè)模塊或任務(wù)恢復(fù)運(yùn)行。所以測(cè)控系統(tǒng)要作好重要數(shù)據(jù)單元、參數(shù)的備份,如系統(tǒng)運(yùn)行狀態(tài)、系統(tǒng)的進(jìn)程值、當(dāng)前輸入、輸出的值,當(dāng)前時(shí)鐘值、觀測(cè)單元值等,這些數(shù)據(jù)既要定時(shí)備份,同時(shí)若有修改也應(yīng)立即予以備
81、份。</p><p> 當(dāng)在已判別出系統(tǒng)非正常復(fù)位的情況下,先要恢復(fù)一些必要的系統(tǒng)數(shù)據(jù),如顯示模塊的初始化、片外擴(kuò)展芯片的初始化等。其次再對(duì)測(cè)控系統(tǒng)的系統(tǒng)狀態(tài)、運(yùn)行參數(shù)等予以恢復(fù),包括顯示界面等的恢復(fù)。之后再把復(fù)位前的任務(wù)、參數(shù)、運(yùn)行時(shí)間等恢復(fù), 再進(jìn)入系統(tǒng)運(yùn)行狀態(tài)。</p><p> 應(yīng)當(dāng)說(shuō)明的是,真實(shí)地恢復(fù)系統(tǒng)的運(yùn)行狀態(tài)需 要極為細(xì)致地對(duì)系統(tǒng)的重要數(shù)據(jù)予以備份,并加以數(shù)據(jù)可靠性檢查
82、,以保證恢復(fù)的數(shù)據(jù)的可靠性。</p><p> 其次,對(duì)多任務(wù)、多進(jìn)程測(cè)控系統(tǒng),數(shù)據(jù)的恢復(fù)需考慮恢復(fù)的次序問(wèn)題,筆者實(shí)際應(yīng)用的數(shù)據(jù)恢復(fù)過(guò)程流程圖如圖2所示。圖中恢復(fù)系統(tǒng)基本數(shù)據(jù)是指取出備份的數(shù)據(jù)覆蓋當(dāng)前的系統(tǒng)數(shù)據(jù)。系統(tǒng)基本初始化是指對(duì)芯片、顯示、輸入輸出方式等進(jìn)行初始化,要注意輸入輸出的初始化不應(yīng)造成誤動(dòng)作。而復(fù)位前任務(wù)的初始化是指任務(wù)的執(zhí)行狀態(tài)、運(yùn)行時(shí)間等。</p><p> 圖2
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 眾賞文庫(kù)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 單片機(jī)外文翻譯-----單片機(jī)簡(jiǎn)介
- 單片機(jī)外文翻譯
- 單片機(jī)外文翻譯
- 外文翻譯-單片機(jī)
- 單片機(jī)外文翻譯9
- 單片機(jī)外文翻譯3
- 單片機(jī)介紹外文翻譯
- 單片機(jī)畢業(yè)外文翻譯
- 單片機(jī)外文翻譯3
- 外文翻譯---單片機(jī)介紹
- 外文翻譯--單片機(jī)歷史
- 單片機(jī)基礎(chǔ)外文翻譯
- 單片機(jī)系統(tǒng)外文翻譯
- 單片機(jī)歷史外文翻譯
- 單片機(jī)外文翻譯7
- 外文翻譯---單片機(jī)系統(tǒng)
- 單片機(jī)介紹外文翻譯
- 單片機(jī)外文翻譯4
- 單片機(jī)外文翻譯6
- 單片機(jī)原理外文翻譯
評(píng)論
0/150
提交評(píng)論