版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、<p> Dormancy of the one-chip computer---restore to the throne in the operation way and improve anti- interference ability </p><p> Abstract: Introduce a kind of dormancy of using- restore to the thro
2、ne in theoperation way and improve the anti-interference ability method of the one-chip computer;Analyse its scope of application, provide and use the circuit concretly; Combine the instance, analyse the characteristic o
3、f the hardware and software design under these kind of operation way. </p><p> Keyword: One-chip computer Restore to the throne /dormancy anti-interference Foreword</p><p> Introduction: </
4、p><p> With the development at full speed of the microelectric technique, the performance of the one-chip computer improves rapidly, demonstrate the outstanding advantage in the operation, logic control, intel
5、ligent 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 extensivly. But because it have system halted, pr
6、ocedure run critical defect of flying etc, make it limit in a lot of important</p><p> 1.A principle and implementation method</p><p> 1.1 Restored to the throne the law regularly unconditiona
7、lly</p><p> Use timer, special-purpose clock chip or other pulse generator, produce signal of restoring to the throne regularly according to interval that set for. This kind of method is especially suitable
8、 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 o
9、nly upgraded 1 -2 times, a large amount of time of CPU is used for waiting. Let CPU ca</p><p> 1.2 The external condition is restored to the throne the law</p><p> Some arrival that export or
10、measure is controlled by the outside. For instance, the hot form. of heating, rotate the pulse produced and calculate heat by hot water water wheels, there is no hot water to flow, there is no heat to export, CPU only ne
11、ed in fact keep number value, do not need to count. Can imagine hot water water wheels rotate when parking warm , CPU idle in will it be will it be one season autumn spring and summer, If let dormancy its , measure have
12、water wheels pulse constantly, a</p><p> 2 .The hardware realizes the main point</p><p> 2.1 Restored to the throne regularly unconditionally</p><p> Generally have 2 kinds of me
13、thods. ① Use theitimer or the special-purpose clock chip to be restored to the throne. Fig1, in order to use the timing circuit that 555 circuit makes up; Can use the clock chips of X1126 ,etc too , wake CPU up with the
14、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 fle
15、xible and convenient. ② The sign</p><p> 2.2 External conditions are restored to the throne </p><p> Send external condition pulse to and is restored to the throne the end son after having a f
16、acelift. To that above-mentioned water wheels or the ammeter spend a pulse produced, can use Schmitt's trigger to have a facelift; For writing down the instrument of the biggest or minimum,can use the window comparat
17、or. In order to realize the electronization that is regulated,can use the electronic electric potential device, establish upper and lower limits with the order of the one-chip computer.</p><p> 2.3 Reduce c
18、ycle and restored to the throne the high electricity at ordinary times</p><p> In Fig3, restored to the throne the signal during high level Tr, the one-chip computer is in the state of restoring to the thro
19、ne, the procedure does not run, anti-interference ability is the strongest; After the high level, the one-chip computer begins to hold the conduct procedure. That is to say, are restored to the throne and suitable for th
20、e 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 t</p><p> 2.4 Treatment of output end sons</p>
21、<p> (1) Restore to the throne straight pulse</p><p> During 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
22、according to restore to the 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 suppre
23、ss , capacity confirm according to Tr time that restore to the throne on the son in end. Reducing Tr can be reduced and connected the elect</p><p> Choose the capacity that the output end connects the elect
24、ric capacity in parallel fault-tolerantly and properly, can realize fault-tolerant control. Reduced cycle in a certain, because interfered exporting the wrong level. Because the keeping function of electric capacity, can
25、'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 succession, it is very fault-tolerant to export C
26、ertain</p><p> 2.5 has the electricity to measure and restore to the throne manually</p><p> Some system is it make some initialize and operate to want at electricity for the first time. Resto
27、red 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.
28、 In some pin connects the electric capacity of one ljIF to the ground, measure this pin after being restored to the throne, if low level to have electricity for the first time. Give</p><p> 3. The software
29、realizes the main point</p><p> 3.1 is it resume with zero clearing RAM to output</p><p> Restore to the throne the last all pin turn high level into , is it should taKe place unnecessary chan
30、ge 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 : ① Analyse and judge immediately after being restored to the throne
31、this time, provide the state of the pin according to the need; ② In being RAM it is the last last state that come down,these RAMs when restored.To the throne regularly can the ze</p><p> 3.2 realizes crossi
32、ng over and is restored to the throne alternate time sequence</p><p> regularly to control</p><p> Work in way of restoring to the throne now, start anew and carry out the same procedure repea
33、tedly each time. Can be divided into 2 kinds of situations: ① As to simple to show instrument, carry on measurement ,send off showing after being restored to the throne each time, have causality between restoring to the
34、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 throne low el</p><p> In 4 Fig,
35、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
36、transmitting power, does not measure 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 th
37、e next one. Try 0 that transmits power. 5s is it is it reali</p><p><b> Result:</b></p><p> Conclusion Anti-interference is an important problem in an electronic design, especially
38、 Important in the one-chip computer. This is because the one-chip computer has procedures to run particularity that flies, the consequence that it is interfered may be the system halted, may send out various kinds of mis
39、takes or illegal movements before the system halted too, make the whole system produce the mortality mistake. So, only guarantee it is not enough yet for one-chip computer not to crash, study </p><p> 單片機休眠
40、-復位運行方式提高抗干擾能力</p><p> 摘要:介紹一種用休眠-復位運行方式提高單片機抗干擾能力的方法;分析其適用范圍,給出具體應(yīng)用電路;結(jié)合實例,分析這種運行方式下硬件和軟件設(shè)計的特點。 關(guān)鍵詞:單片機 復位/休眠 抗干擾 引 言隨著微電子技術(shù)的飛速發(fā)展,單片機的性能迅速提高,在運算、邏輯控制、智能化方面顯示出非凡的優(yōu)勢,在很大程度上取代了原來由數(shù)字邏輯電路、運算放大電路組成的檢測
41、、控制電路,應(yīng)用非常廣泛。但由于它存在著死機、程序跑飛等致命缺陷,使它在許多重要場合的應(yīng)用受到限制。在抗干擾方面的許多技術(shù),比如設(shè)軟件陷阱、加硬件看門狗電路等,可使這一問題有較好的解決,但仍然存在問題:① 看門狗動作時,意味著已經(jīng)出現(xiàn)了錯誤,且運行了一段時間,這在有些場合是不允許的;② 有時程序出現(xiàn)死循環(huán)錯誤,但是剛好把看門狗控制環(huán)節(jié)包含進去,對于這樣的錯誤采用看門狗無法識別;③ 在檢測控制周期比較長的系統(tǒng)中,單片機花大量時間等待外設(shè),
42、執(zhí)行等待命令時同樣會受到干擾。針對這些情況,我們在實踐中嘗試了主動復位的辦法,采用等間隔的脈沖或根據(jù)外部條件對單片機進行復位喚醒。每次復位后,單片機執(zhí)行相應(yīng)的程序,執(zhí)行完任務(wù)后及時進入休眠,等待</p><p> 1.2 外部條件復位法有些輸出或測量的啟動是由外部控制的。如暖氣熱表,靠熱水水輪旋轉(zhuǎn)產(chǎn)生的脈沖計算熱量,沒有熱水流動,就沒有熱量輸出,CPU只要保持原來數(shù)值即可,不需要計數(shù)??梢韵胂?,停暖時熱
43、水水輪不轉(zhuǎn),CPU在春夏秋三季則無事可做;如果讓其休眠,而不是時刻檢測有無水輪脈沖,抗干擾能力會大大增強。因此,只要把水輪脈沖與CPU的復位聯(lián)系起來,水輪每旋轉(zhuǎn)1周,CPU復位1次,熱表就可以正常工作了,這就是外部條件復位法。類似的應(yīng)用還有半電子式電度表,當機械度盤旋轉(zhuǎn)1周時才進行1個計數(shù),用戶不用電,CPU會一直休眠。這種方法的復位間隔不是固定的,而是根據(jù)外部條件確定的。在有些場合,休眠的時間會很長,對提高抗干擾能力非常有效。2
44、硬件實現(xiàn)要點2.1 無條件定時復位 一般有2種方法。① 使用定時器或?qū)S脮r鐘芯片復位。圖1為使用555電路組成的定時電路;也可以使用X1126之類的時鐘芯片,設(shè)置報警時間后用報警信號喚醒CPU。這種方法適用于長間隔定時,還可以根據(jù)本次運算的結(jié)果,臨時決定下一次的報警喚醒時間,非常靈活方便。② 使用系統(tǒng)固有的信號作為定時復位脈沖。例如使用50Hz工</p><p> 2.2 外部條件復位把外部
45、條件脈沖整形后送到復位端子。對于上述水輪或電表度盤產(chǎn)生的脈沖,可以使用施密特觸發(fā)器整形;對于記錄最大或最小值的儀器,可使用窗口比較器。為了實現(xiàn)調(diào)節(jié)的電子化,可以使用電子電位器,用單片機指令設(shè)定上下限。2.3 復位周期與復位高電平時間圖3中,復位信號在高電平Tr期間,單片機處在復位狀態(tài),程序不運行,抗干擾能力最強;高電平過后,單片機開始執(zhí)行程序。也就是說,復位信號的低電平Td期間是可供程序執(zhí)行的時間,這個時間要大于每次程序的執(zhí)
46、行周期。合理選擇復位周期和復位信號的高電平占空比非常重要。對于單純顯示儀表,復位周期決定數(shù)據(jù)刷新周期,低電平時間要大于檢測、送顯示的全部時間;否則,會出現(xiàn)永遠不能完整執(zhí)行程序的錯誤。單片機在Ts和Tr期間都能有效地抗干擾,但是最好還是把多余時間安排在Tr內(nèi)。當程序執(zhí)行時間較長,要求盡量縮短Tr時,可加入微分電路,如圖1中的C30、R26、D9。2.4 輸出端子的處理(1)復位期間的正脈沖復位期間單片機的全部I/O口變
47、成高電平。也就是說,正常輸出為低的引腳,會按照復位周期出現(xiàn)寬度為Tr的正脈沖。這個正脈</p><p> 3 軟件實現(xiàn)要點3.1 輸出恢復與不清零RAM定時復位后全部引腳變成高電平,使得本應(yīng)為低的引腳發(fā)生了不應(yīng)有的變化,因此,復位后要立即恢復所有引腳的狀態(tài)。有2種方法:① 本次復位后立即進行分析判斷,根據(jù)需要給出引腳狀態(tài);② 根據(jù)RAM中上一次留存下來的狀態(tài),這些RAM在定時復位時是不能清零的;而在
48、初上電或手動復位按下時應(yīng)清零,在軟件編制時要體現(xiàn)出來。如果計算時間允許,盡量采取方法1。因為連續(xù)2次復位周期都計算出錯的概率很小,按照2.4敘述的輸出端子并聯(lián)電容的處理方法,可以達到很好的抗干擾效果。3.2 實現(xiàn)跨越定時復位間隔的時序控制現(xiàn)在用復位方式工作,每次從頭開始反復執(zhí)行同一程序??煞譃?種情況:① 對于單純顯示儀表,每次復位后進行測量、送顯示,兩次復位之間沒有因果關(guān)系,只需把原來的等待改為休眠即可。要注意的是,測量、
49、送顯示用的總時間要小于復位低電平時間,否則會出現(xiàn)永遠不能完整執(zhí)行程序的錯誤。② 對于有時序控制的應(yīng)用,每次復位后,先要查看上個周期留下的標志,以決定本周期做什么。也就是說,凡是跨過復位周期的操作,都是靠標志傳遞的,這些標志存放在內(nèi)部RAM中,只有初上電</p><p> 圖5 變壓器保護器部分程序流程結(jié) 語抗干擾是電子設(shè)計中的重要問題,在單片機中尤其重要。這是因為單片機有程序跑飛的特殊性,它受到干擾
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 眾賞文庫僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 單片機休眠-復位運行方式提高抗干擾能力
- 單片機設(shè)計外文翻譯--單片機的休眠運算復位和抗干擾能力完善
- 外文資料翻譯--單片機的休眠運算復位和抗干擾能力完善
- 單片機外文翻譯-----單片機簡介
- 單片機復位
- 單片機外文翻譯
- 單片機外文翻譯
- 外文翻譯-單片機
- 單片機外文翻譯---at89s52單片機
- 單片機外文翻譯--轉(zhuǎn)速表與單片機
- 單片機外文翻譯--at89s52單片機
- 單片機外文文獻翻譯---單片機控制系統(tǒng)
- 單片機外文翻譯----基于單片機的電動智能小車
- 單片機外文翻譯 ----at89c51單片機介紹
- 單片機外文翻譯9
- 單片機外文翻譯3
- 單片機外文翻譯2
- 單片機介紹外文翻譯
- 單片機畢業(yè)外文翻譯
- 單片機外文翻譯3
評論
0/150
提交評論