自動(dòng)化專業(yè) 單片機(jī) 外文文獻(xiàn) 英文文獻(xiàn) 外文翻譯中英對(duì)照
《自動(dòng)化專業(yè) 單片機(jī) 外文文獻(xiàn) 英文文獻(xiàn) 外文翻譯中英對(duì)照》由會(huì)員分享,可在線閱讀,更多相關(guān)《自動(dòng)化專業(yè) 單片機(jī) 外文文獻(xiàn) 英文文獻(xiàn) 外文翻譯中英對(duì)照(17頁珍藏版)》請(qǐng)?jiān)谘b配圖網(wǎng)上搜索。
1、 Dormancy of the one-chip computer---restore to the throne in the operation way and improve anti- interference ability Abstract: Introduce a kind of dormancy of using- restore to the throne in theoperation way and improve the anti-interference ability method of the one-chip computer;Analyse its s
2、cope of application, provide and use the circuit concretly; Combine the instance, analyse the characteristic of 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 develo
3、pment 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, intelligent respect, replaced and enlarged the measuring that the circuit made up, control circuit by digital logical
4、circuit, operation originally to a great extent, use very extensivly. But because it have system halted, procedure 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 theh
5、ardware to guard the gate in dog's circuit etc, can make this problem havebetter settlement, but still the existing 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
6、 sometimes, but just guard the gate dog control link include and enter, adopt and guard the gate as to such a mistake 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 w
7、hen carry out and wait for the order. To these situations, we have tried the method restored to the throne voluntarily 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, t
8、he one-chip computer carries out the corresponding procedure, enters dormancy in time after finishing carrying out the task, wait to be restored to the throne nextly. Have solved above-mentioned problems well with this method , and has got better result in the agricultural voltage transformer compre
9、hensive protector experiment. Now take 51 serial one-chip computers as an example and probe into the concrete principle and implementation method, restored to the throne the signal as the high level. 1.A principle and implementation method 1.1 Restored to the throne the law regularly unconditional
10、ly 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 for the measuring instrument. In not running actually, sample the analog quantity of introduction wit
11、h A/D converter often, then store showing. This course is very fast, but steady for reading, the data per second are only 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
12、world up It carry out the next operation, this is to restore to the throne the law regularly In this way can make anti-interference 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 ti
13、me 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 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
14、 restored to the throne once unconditionally, once present the system halted during a job, can certainly resume when restored 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
15、to “pass〞 mistake. This kind is restored to the throne the advantage of dog's circuit for guarding the gate regularly, first, change waiting time into a dormancy state, time to shorten and may be interfered; Second, avoided happenning that the dog controls the death circulation of the link to includ
16、e guarding the gate. 1.2 The external condition is restored to the throne the law Some arrival that export or 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 i
17、s no heat to export, CPU only need 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 water wheels pulse constantly, anti-interference
18、 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 wheels 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
19、 . Similar application have half electron kilowatt-hour meter , go on one count just when the machinery degree wheels and transfers to a circle, 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 conf
20、irmed according to the external condition of this method. In some occasions, the time of the dormancy will be very long, very effective to improving anti-interference ability. 2 .The hardware realizes the main point 2.1 Restored to the throne regularly unconditionally Generally have 2 kinds of me
21、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 alarm signal after setting up warning time. This kind of method is suitable when
22、 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 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 fac
23、elift frequently, already omit the timer, gathered the corresponding signal for the phase place which measured the electric current signal at the same 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
24、 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; For writing down the instrument of the biggest or minimum,can use the window comparator. In order to realize the electronization that is regulated,c
25、an use the electronic electric potential device, establish upper and lower limits with the order of the one-chip computer. 2.3 Reduce cycle and restored to the throne the high electricity at ordinary times In Fig3, restored to the throne the signal during high level Tr, the one-chip computer is in
26、 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 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
27、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 restore 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
28、throne cycle determine data break cycle, low electricity is it measure, hancl over all time shown to greater than to want at ordinary times; Otherwise, cant present forever the mistake of the intact executive program.Monolithic integrated circuit in Ts and Tr period all can effectively the antijammi
29、ng, 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 differentiating circuit, like chart 1 center C30, R26, D9. 2.4 Treatment of output end sons (1) Restore to the throne straight pulse During all I/O m
30、outh 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 throne cycle appear the width for the straight pulse of Tr. This straight pulse will influence the normal output, 2 methods are dealt with: ①?
31、 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 reduced and connected the electric capacity in parallel. ② It is invalid to design the peripheral circuit into the high level. (2) Fault-tolerant
32、Choose the capacity that the output end connects the electric 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't still enable export
33、ing 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 Certainly, this kind of method will make the normal output change lag behind for one cycle, just really ref
34、lect the output end son. 2.5 has the electricity to measure and restore to the throne manually Some system is it make some initialize and operate to want at electricity for the first time. Restored to the throne and already become the beginning condition of normal running each time while adopting
35、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 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 sy
36、stem 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 throne in the end, is connected in parallel in the electric capacity both ends to the ground of above-mentioned pins. 3. The software realiz
37、es the main point 3.1 is it resume with zero clearing RAM to output Restore to the throne the last all pin turn high level into , is it should taKe place unnecessary change for low pin to make regularly, so, should resume the state.of all pins immediately after being restored to the throne. There
38、are 2 kinds of methods : ① Analyse and judge immediately after being restored to the throne 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 zero clearing one; But electrici
39、ty or manual to rstore 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 time allows, try one's best to take method 1. Restore to the throne cycle probability made mistakes to calculate very little, acc
40、ording 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 result very. 3.2 realizes crossing over and is restored to the throne alternate time sequence regularly to control Work in way of r
41、estoring 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, carry on measurement ,send off showing after being restored to the throne each time, have causality between restoring to the thr
42、one 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 electricity at ordinary times to smaller than to want, otherwise can't present forever the mistake of the intact execu
43、tive 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 , in order to determine what is done this cycle . That is to say every is it restore to the throne operation of cycle to stride ,
44、 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 protecting synthetically device of above-mentioned voltage transformer , is restored to the throne regularly according to the interva
45、l 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 according to this movement, such as Fig. 5. In 4 Fig, act as person who protect the beginning at the electricity, is it transmit
46、 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 measure the electric current. Start after finishing, if all going well, the location is put" normal sign ", person who protec
47、t 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 time. At having electricity for the first time, make all zero clearing to inside RAM, make
48、it is it time Ts to transmit power not to try =Dormancy after 25. After restoring to the throne, is it have electric pin to have electricity for the first time already, is it is it is it is it time the measuring of Ts to transmit power to try to get to go on to measure next time. If Ts * 0, is it in
49、 is it prolong period to transmit power, is it enter dormancy after the 1 to reduce Ts to prove. Act as Ts-1 = 0, the course which waited for 30s that should enter and lose electrical power. Just when Ts decreases progressively to 0, make it is it indicate to wait for not to lose electrical power Td
50、 =1500. When the procedure is restored to the throne beginning again, measure to Ts =0 but Td * 0, is it is it is it transmit power to try to cross already to indicate, at is it wait for the course of 30s to lose electrical power now. In this way, the whole process is transmitted each other by such
51、these parameters as Tr, Td , Ts etc, go on step by step. Result: Conclusion Anti-interference is an important problem in an electronic design, especially Important in the one-chip computer. This is because the one-chip computer has procedures to run particularity that flies, the consequence that
52、 it is interfered may be the system halted, may send out various kinds of mistakes 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 how to reduce the risk interfer
53、ed, it can befault-toierant how is it after and make mistakes. This text is it act as some exploration from two these to try hard, hope these elementary opinions can play some function of casting a brick to attract jade, helpful to everybody; Hope too every colleague explore together, improve our de
54、sign level together. 單片機(jī)休眠-復(fù)位運(yùn)行方式提高抗干擾能力 摘要:介紹一種用休眠-復(fù)位運(yùn)行方式提高單片機(jī)抗干擾能力的方法;分析其適用范圍,給出具體應(yīng)用電路;結(jié)合實(shí)例,分析這種運(yùn)行方式下硬件和軟件設(shè)計(jì)的特點(diǎn)。 關(guān)鍵詞:?jiǎn)纹瑱C(jī) 復(fù)位/休眠 抗干擾 引 言 隨著微電子技術(shù)的飛速開展,單片機(jī)的性能迅速提高,在運(yùn)算、邏輯控制、智能化方面顯示出非凡的優(yōu)勢(shì),在很大程度上取代了原來由數(shù)字邏輯電路、運(yùn)算放大電路組成的檢測(cè)、控制電路,應(yīng)用非常廣泛。但由于它存在著死機(jī)、程序跑飛等致命缺陷,使它在許多重要場(chǎng)合的應(yīng)用受到限制。在抗干擾方面的許多技術(shù),比方設(shè)軟件陷阱
55、、加硬件看門狗電路等,可使這一問題有較好的解決,但仍然存在問題:① 看門狗動(dòng)作時(shí),意味著已經(jīng)出現(xiàn)了錯(cuò)誤,且運(yùn)行了一段時(shí)間,這在有些場(chǎng)合是不允許的;② 有時(shí)程序出現(xiàn)死循環(huán)錯(cuò)誤,但是剛好把看門狗控制環(huán)節(jié)包含進(jìn)去,對(duì)于這樣的錯(cuò)誤采用看門狗無法識(shí)別;③ 在檢測(cè)控制周期比擬長(zhǎng)的系統(tǒng)中,單片機(jī)花大量時(shí)間等待外設(shè),執(zhí)行等待命令時(shí)同樣會(huì)受到干擾。針對(duì)這些情況,我們?cè)趯?shí)踐中嘗試了主動(dòng)復(fù)位的方法,采用等間隔的脈沖或根據(jù)外部條件對(duì)單片機(jī)進(jìn)行復(fù)位喚醒。每次復(fù)位后,單片機(jī)執(zhí)行相應(yīng)的程序,執(zhí)行完任務(wù)后及時(shí)進(jìn)入休眠,等待下次復(fù)位。用此方法較好地解決了上述問題,并在農(nóng)用變壓器綜合保護(hù)器實(shí)驗(yàn)中得到了較好的效果。下面以51系列單
56、片機(jī)為例探討具體原理與實(shí)現(xiàn)方法,復(fù)位信號(hào)為高電平。 1 原理與實(shí)現(xiàn)方法 1.1 無條件定時(shí)復(fù)位法 用定時(shí)器、專用時(shí)鐘芯片或其它脈沖產(chǎn)生器,按照設(shè)定的間隔定時(shí)產(chǎn)生復(fù)位信號(hào)。這種方法特別適合監(jiān)測(cè)儀表。在實(shí)際運(yùn)行中,往往是用A/D轉(zhuǎn)換器采樣輸入的模擬量,然后進(jìn)行存儲(chǔ)顯示。這一過程很快,但為了讀數(shù)穩(wěn)定,每秒數(shù)據(jù)更新不過1~2次,CPU的大量時(shí)間用于等待。如果讓CPU執(zhí)行完任務(wù)后直接進(jìn)入休眠,然后由外界復(fù)位喚醒它去執(zhí)行下一次操作,這就是定時(shí)復(fù)位法。這樣會(huì)使抗干擾能力大大增強(qiáng),主要有2點(diǎn):① 休眠時(shí),程序停止運(yùn)行,不會(huì)出現(xiàn)PC指針紊亂引起的程序跑飛。如果工作與休眠的時(shí)間比例為1:9,
57、也就是說,1s內(nèi)有0.1s的時(shí)間用來檢測(cè)、送顯示,有0.9s的時(shí)間休眠,程序受干擾的概率是全速運(yùn)行時(shí)的1/10,整體抗干擾能力提高了10倍。② 由于每1s無條件復(fù)位1次,一旦某次工作期間出現(xiàn)死機(jī),在下次復(fù)位時(shí)肯定得以恢復(fù)。對(duì)于只是顯示的儀表,某1s偶然出現(xiàn)的讀數(shù)錯(cuò)誤對(duì)下一次測(cè)量并沒有記憶,是可以承受的,屬“一過性〞錯(cuò)誤。這種定時(shí)復(fù)位相對(duì)于看門狗電路的優(yōu)點(diǎn),一是把等待時(shí)間改為休眠狀態(tài) ,縮短可能受干擾的時(shí)間;二是防止了恰好包含看門狗控制環(huán)節(jié)的死循環(huán)。 1.2 外部條件復(fù)位法 有些輸出或測(cè)量的啟動(dòng)是由外部控制的。如暖氣熱表,靠熱水水輪旋轉(zhuǎn)產(chǎn)生的脈沖計(jì)算熱量,沒有熱水流動(dòng),就沒有熱量
58、輸出,CPU只要保持原來數(shù)值即可,不需要計(jì)數(shù)??梢韵胂?,停暖時(shí)熱水水輪不轉(zhuǎn),CPU在春夏秋三季那么無事可做;如果讓其休眠,而不是時(shí)刻檢測(cè)有無水輪脈沖,抗干擾能力會(huì)大大增強(qiáng)。因此,只要把水輪脈沖與CPU的復(fù)位聯(lián)系起來,水輪每旋轉(zhuǎn)1周,CPU復(fù)位1次,熱表就可以正常工作了,這就是外部條件復(fù)位法。類似的應(yīng)用還有半電子式電度表,當(dāng)機(jī)械度盤旋轉(zhuǎn)1周時(shí)才進(jìn)行1個(gè)計(jì)數(shù),用戶不用電,CPU會(huì)一直休眠。這種方法的復(fù)位間隔不是固定的,而是根據(jù)外部條件確定的。在有些場(chǎng)合,休眠的時(shí)間會(huì)很長(zhǎng),對(duì)提高抗干擾能力非常有效。 2 硬件實(shí)現(xiàn)要點(diǎn) 2.1 無條件定時(shí)復(fù)位 一般有2種方法。① 使用定時(shí)器或?qū)S?/p>
59、時(shí)鐘芯片復(fù)位。圖1為使用555電路組成的定時(shí)電路;也可以使用X1126之類的時(shí)鐘芯片,設(shè)置報(bào)警時(shí)間后用報(bào)警信號(hào)喚醒CPU。這種方法適用于長(zhǎng)間隔定時(shí),還可以根據(jù)本次運(yùn)算的結(jié)果,臨時(shí)決定下一次的報(bào)警喚醒時(shí)間,非常靈活方便。② 使用系統(tǒng)固有的信號(hào)作為定時(shí)復(fù)位脈沖。例如使用50Hz工頻電源整形后作復(fù)位,既省略了定時(shí)器,同時(shí)又為檢測(cè)電流信號(hào)的相位采集了相應(yīng)的信號(hào),如圖2所示。 2.2 外部條件復(fù)位 把外部條件脈沖整形后送到復(fù)位端子。對(duì)于上述水輪或電表度盤產(chǎn)生的脈沖,可以使用施密特觸發(fā)器整形;對(duì)于記錄最大或最小值的儀器,可使用窗口比擬器。為了實(shí)現(xiàn)調(diào)節(jié)的電子化,可以使用電子電位器,用單片機(jī)指
60、令設(shè)定上下限。 2.3 復(fù)位周期與復(fù)位高電平時(shí)間 圖3中,復(fù)位信號(hào)在高電平Tr期間,單片機(jī)處在復(fù)位狀態(tài),程序不運(yùn)行,抗干擾能力最強(qiáng);高電平過后,單片機(jī)開始執(zhí)行程序。也就是說,復(fù)位信號(hào)的低電平Td期間是可供程序執(zhí)行的時(shí)間,這個(gè)時(shí)間要大于每次程序的執(zhí)行周期。合理選擇復(fù)位周期和復(fù)位信號(hào)的高電平占空比非常重要。對(duì)于單純顯示儀表,復(fù)位周期決定數(shù)據(jù)刷新周期,低電平時(shí)間要大于檢測(cè)、送顯示的全部時(shí)間;否那么,會(huì)出現(xiàn)永遠(yuǎn)不能完整執(zhí)行程序的錯(cuò)誤。單片機(jī)在Ts和Tr期間都能有效地抗干擾,但是最好還是把多余時(shí)間安排在Tr內(nèi)。當(dāng)程序執(zhí)行時(shí)間較長(zhǎng),要求盡量縮短Tr時(shí),可參加微分電路,如圖1中的C30、R2
61、6、D9。 2.4 輸出端子的處理 (1)復(fù)位期間的正脈沖 復(fù)位期間單片機(jī)的全部I/O口變成高電平。也就是說,正常輸出為低的引腳,會(huì)按照復(fù)位周期出現(xiàn)寬度為Tr的正脈沖。這個(gè)正脈沖會(huì)影響正常的輸出,有2個(gè)方法處理:① 在端子上并聯(lián)電容加以抑制,容量根據(jù)復(fù)位的Tr時(shí)間確定。減小Tr可以減小并聯(lián)電容。② 把外圍電路設(shè)計(jì)成高電平無效。 (2)容 錯(cuò) 適中選取輸出端并聯(lián)電容的容量,可以實(shí)現(xiàn)容錯(cuò)控制。在某個(gè)復(fù)位周期,因干擾輸出了錯(cuò)誤電平。由于電容的保持作用,在本周期內(nèi)尚不能使輸出變化到有效的電平;在下個(gè)周期,錯(cuò)誤被糾正。因此,只要不是連續(xù)2個(gè)周期出錯(cuò),輸出是可
62、容錯(cuò)的。當(dāng)然,這種方法會(huì)使正常的輸出變化滯后一個(gè)周期,才真正反映到輸出端子。 2.5 上電檢測(cè)與手動(dòng)復(fù)位 有些系統(tǒng)在初上電時(shí)要做一些初始化操作。采用復(fù)位方式運(yùn)行時(shí),每次復(fù)位已經(jīng)成為正常運(yùn)行的開始條件,無法區(qū)分是否初上電。在某引腳對(duì)地接一個(gè)1μF的電容,復(fù)位后檢測(cè)該引腳,如果是低電平就是初上電。如果給系統(tǒng)設(shè)立一個(gè)復(fù)位按鈕,也就是常見的手動(dòng)復(fù)位,這個(gè)按鈕不是連接在復(fù)位端,而是并聯(lián)在上述引腳對(duì)地的電容兩端。 3 軟件實(shí)現(xiàn)要點(diǎn) 3.1 輸出恢復(fù)與不清零RAM 定時(shí)復(fù)位后全部引腳變成高電平,使得本應(yīng)為低的引腳發(fā)生了不應(yīng)有的變化,因此,復(fù)位后要立即恢復(fù)所有引腳的狀態(tài)。
63、有2種方法:① 本次復(fù)位后立即進(jìn)行分析判斷,根據(jù)需要給出引腳狀態(tài);② 根據(jù)RAM中上一次留存下來的狀態(tài),這些RAM在定時(shí)復(fù)位時(shí)是不能清零的;而在初上電或手動(dòng)復(fù)位按下時(shí)應(yīng)清零,在軟件編制時(shí)要表達(dá)出來。如果計(jì)算時(shí)間允許,盡量采取方法1。因?yàn)檫B續(xù)2次復(fù)位周期都計(jì)算出錯(cuò)的概率很小,按照2.4表達(dá)的輸出端子并聯(lián)電容的處理方法,可以到達(dá)很好的抗干擾效果。 3.2 實(shí)現(xiàn)跨越定時(shí)復(fù)位間隔的時(shí)序控制 現(xiàn)在用復(fù)位方式工作,每次從頭開始反復(fù)執(zhí)行同一程序??煞譃?種情況:① 對(duì)于單純顯示儀表,每次復(fù)位后進(jìn)行測(cè)量、送顯示,兩次復(fù)位之間沒有因果關(guān)系,只需把原來的等待改為休眠即可。要注意的是,測(cè)量、送顯示用
64、的總時(shí)間要小于復(fù)位低電平時(shí)間,否那么會(huì)出現(xiàn)永遠(yuǎn)不能完整執(zhí)行程序的錯(cuò)誤。② 對(duì)于有時(shí)序控制的應(yīng)用,每次復(fù)位后,先要查看上個(gè)周期留下的標(biāo)志,以決定本周期做什么。也就是說,但凡跨過復(fù)位周期的操作,都是靠標(biāo)志傳遞的,這些標(biāo)志存放在內(nèi)部RAM中,只有初上電時(shí)才清零。例如,前面提到的變壓器綜合保護(hù)器,按照20ms的間隔定時(shí)復(fù)位。它在上電后,經(jīng)過一定的動(dòng)作順序到達(dá)正常工作狀態(tài),如圖4;根據(jù)這個(gè)動(dòng)作編寫軟件流程的一局部,如圖5。 在圖4中,當(dāng)保護(hù)器初上電時(shí),首先試送電0.5s,提示馬上就要送電;等待30s后正式送電。送電后的1s內(nèi)為啟動(dòng)時(shí)間,不進(jìn)行過電流檢測(cè)。啟動(dòng)完成后,如果一切正常,那么把“正常標(biāo)
65、志〞置位,保護(hù)器在下一個(gè)復(fù)位周期進(jìn)入正常運(yùn)行。試送電的0.5s延時(shí)是對(duì)復(fù)位進(jìn)行25次計(jì)數(shù)實(shí)現(xiàn)的,因?yàn)槊看螐?fù)位時(shí)間是20ms。初上電時(shí),對(duì)內(nèi)部RAM做全部清零,令試送電計(jì)時(shí)Ts=25后休眠。下一次被復(fù)位后,再檢測(cè)上電引腳已不是初上電,于是進(jìn)行到試送電計(jì)時(shí)Ts的檢測(cè)。如果Ts≠0,說明在送電延時(shí)期間,把Ts減1后進(jìn)入休眠。當(dāng)Ts-1=0時(shí),應(yīng)該進(jìn)入停電等待30s的過程了。就在Ts遞減到0的時(shí)候,令停電等待標(biāo)志Td=1500。當(dāng)程序再次由復(fù)位開始時(shí),檢測(cè)到Ts=0但是Td≠0,說明已經(jīng)越過了試送電,現(xiàn)在正處于停電等待30s的過程中。這樣,整個(gè)進(jìn)程由Tr、Td、Ts等這些參數(shù)相互傳遞著,一步步進(jìn)行下去
66、。 圖5 變壓器保護(hù)器局部程序流程 結(jié) 語 抗干擾是電子設(shè)計(jì)中的重要問題,在單片機(jī)中尤其重要。這是因?yàn)閱纹瑱C(jī)有程序跑飛的特殊性,它受到干擾的后果可能是死機(jī),也可能在死機(jī)前發(fā)出各種錯(cuò)誤或非法動(dòng)作,使整個(gè)系統(tǒng)產(chǎn)生致命性錯(cuò)誤。因此,僅僅保證單片機(jī)不死機(jī)還不夠,還要研究如何減少受干擾的風(fēng)險(xiǎn),以及出錯(cuò)后如何能夠容錯(cuò)。本文力圖從這兩方面作些探索,希望這些粗淺見解能夠起些拋磚引玉的作用,對(duì)大家有所幫助;也希望各位同仁一起探索,共同提高我們的設(shè)計(jì)水平。 10/30 17:12 C620軸撥桿的工藝規(guī)程及鉆2-Φ16孔的鉆床夾具設(shè)計(jì) 09/21 13:39 CA6140車床撥叉零件的機(jī)械加工工藝規(guī)程及夾具設(shè)計(jì)831003 08/30 15:37 CPU風(fēng)扇后蓋的注塑模具設(shè)計(jì) 09/20 16:19 GDC956160工業(yè)對(duì)輥成型機(jī)設(shè)計(jì) 08/30 15:45 LS型螺旋輸送機(jī)的設(shè)計(jì) 10/07 23:43 LS型螺旋輸送機(jī)設(shè)計(jì) 09/20 16:23 P-90B型耙斗式裝載
- 溫馨提示:
1: 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
2: 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
3.本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
5. 裝配圖網(wǎng)僅提供信息存儲(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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 建筑施工重大危險(xiǎn)源安全管理制度
- 安全培訓(xùn)資料:典型建筑火災(zāi)的防治基本原則與救援技術(shù)
- 企業(yè)雙重預(yù)防體系應(yīng)知應(yīng)會(huì)知識(shí)問答
- 8 各種煤礦安全考試試題
- 9 危險(xiǎn)化學(xué)品經(jīng)營(yíng)單位安全生產(chǎn)管理人員模擬考試題庫試卷附答案
- 加壓過濾機(jī)司機(jī)技術(shù)操作規(guī)程
- 樹脂砂混砂工藝知識(shí)總結(jié)
- XXXXX現(xiàn)場(chǎng)安全應(yīng)急處置預(yù)案
- 某公司消防安全檢查制度總結(jié)
- 1 煤礦安全檢查工(中級(jí))職業(yè)技能理論知識(shí)考核試題含答案
- 4.燃?xì)獍踩a(chǎn)企業(yè)主要負(fù)責(zé)人模擬考試題庫試卷含答案
- 工段(班組)級(jí)安全檢查表
- D 氯化工藝作業(yè)模擬考試題庫試卷含答案-4
- 建筑起重司索信號(hào)工安全操作要點(diǎn)
- 實(shí)驗(yàn)室計(jì)量常見的30個(gè)問問答題含解析