JPH05282182A - CPU runaway detection method - Google Patents
CPU runaway detection methodInfo
- Publication number
- JPH05282182A JPH05282182A JP4074246A JP7424692A JPH05282182A JP H05282182 A JPH05282182 A JP H05282182A JP 4074246 A JP4074246 A JP 4074246A JP 7424692 A JP7424692 A JP 7424692A JP H05282182 A JPH05282182 A JP H05282182A
- Authority
- JP
- Japan
- Prior art keywords
- interrupt
- subroutine
- cpu
- timer
- runaway detection
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Landscapes
- Debugging And Monitoring (AREA)
Abstract
(57)【要約】
【目的】新たな回路を付加することなくウオッチドグタ
イマによるCPU暴走検知能力を高める。
【構成】メインルーチンの途中におかれるCPU暴走検
知サブルーチンが、正常時において適宜実行されるべき
割込サブルーチンが正常に実行していることを確認した
上でウオッチドグタイマへのリセット信号を出す。
(57) [Abstract] [Purpose] To improve the CPU runaway detection capability by the watchdog timer without adding a new circuit. A CPU runaway detection subroutine placed in the middle of a main routine issues a reset signal to a watchdog timer after confirming that an interrupt subroutine, which should be appropriately executed in normal times, is normally executed.
Description
【0001】[0001]
【産業上の利用分野】本発明は、ウオッチドッグタイマ
が接続されたCPUの暴走検知方法に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a runaway detection method for a CPU to which a watchdog timer is connected.
【0002】[0002]
【従来の技術】CPUの暴走を監視する方法にウオッチ
ドッグタイマを使用する方法がある。2. Description of the Related Art There is a method of using a watchdog timer as a method of monitoring runaway of a CPU.
【0003】このウオッチドッグタイマは、通常、リト
リガが可能なタイマで構成され、トリガされてから一定
時間再トリガなしに経過するとCPUに対しリセット信
号を出す。CPUは、このウオッチドッグタイマに対し
て同タイマがタイムアップする前にリセット信号を送っ
てリトリガさせる。このように、ウオッチドッグタイマ
がタイムアップする一定の期間以内に毎回リセット信号
を同タイマに対して出す必要があるために、そのための
サブルーチンはCPU暴走検知サブルーチンとして繰り
返し循環的に実行されるメインルーチン内に設定されて
いる。This watchdog timer is usually composed of a timer that can be retriggered, and outputs a reset signal to the CPU when a certain time has elapsed without being retriggered after being triggered. The CPU sends a reset signal to the watchdog timer to retrigger it before the timer times out. As described above, since it is necessary to issue the reset signal to the watchdog timer every time within a certain period of time up, the subroutine for that purpose is a main routine that is repeatedly and cyclically executed as a CPU runaway detection subroutine. It is set within.
【0004】[0004]
【発明が解決しようとする課題】しかし、このような単
純な暴走検知方法では、正常時において適宜実行される
べき割り込みサブルーチンが何らかのCPU側のトラブ
ルにより正常に実行されない場合には、その異常状態
(暴走状態)を検知できないという問題がある。However, in such a simple runaway detection method, when an interrupt subroutine that should be executed in a normal state is not normally executed due to some trouble on the CPU side, its abnormal state ( There is a problem that the runaway state) cannot be detected.
【0005】特に、上記適宜実行されるべき割り込みサ
ブルーチンが複写機のコピーランプや定着部の制御を行
うサブルーチンである場合、このような異常状態を検知
できないとなると火災発生など非常事態を起こしてしま
う可能性がある。In particular, when the interrupt subroutine to be appropriately executed is a subroutine for controlling the copy lamp and the fixing unit of the copying machine, if such an abnormal state cannot be detected, an emergency situation such as a fire will occur. there is a possibility.
【0006】本発明の目的は、CPUの暴走検知機能を
より強力なものにする方法を提供することにある。It is an object of the present invention to provide a method for making the runaway detection function of the CPU more powerful.
【0007】[0007]
【課題を解決するための手段】本発明は、繰り返し実行
されるメインルーチンの途中にCPU暴走検知サブルー
チンが設定され、該CPU暴走検知サブルーチンは実行
される毎にウオッチドッグタイマにリセット信号を出す
CPUの暴走検知方法において、前記CPU暴走検知サ
ブルーチンは、正常時において適宜実行されるべき割り
込みサブルーチンが正常に動作していることを確認した
上で前記リセット信号を出すことを特徴とする。According to the present invention, a CPU runaway detection subroutine is set in the middle of a repeatedly executed main routine, and a CPU that issues a reset signal to a watchdog timer each time the CPU runaway detection subroutine is executed. In the runaway detection method described in (1), the CPU runaway detection subroutine issues the reset signal after confirming that an interrupt subroutine that is to be appropriately executed in normal time is operating normally.
【0008】[0008]
【作用】繰り返し循環的に実行されるメインルーチンの
途中にはCPU暴走検知サブルーチンが設定されている
ために、このCPU暴走検知サブルーチンが毎回実行さ
れる時間間隔のうち最大の時間よりもウオッチドッグタ
イマのタイマ時間が長く設定されている。従って、CP
Uの暴走によってメインルーチンが走らなくなればCP
U暴走検知サブルーチンが実行されなくなるためにウオ
ッチドッグタイマに対するリセット信号が出されなくな
って、同タイマがタイムアップする。すなわちCPUに
対してウオッチドッグタイマよりリセット信号が出さ
れ、CPUはリセットされて全ての負荷が停止する。一
方、メインルーチンが繰り返し実行されている正常時に
おいても、通常は、所定の割込サブルーチンが適宜実行
されている。例えば、一定の時間間隔毎に実行されるタ
イマ割り込みサブルーチンがそれである。CPUの暴走
は必ずしもメインルーチンに影響を及ぼすだけではな
く、このタイマ割込サブルーチンなど一部のサブルーチ
ンに対してのみ影響を及ぼす場合がある。従って、この
ような割込サブルーチンだけがCPUの暴走によって実
行されない場合には、上記のCPU暴走検知サブルーチ
ンだけでは暴走状態を検知することはできない。そこ
で、CPU暴走検知サブルーチンに上記割込サブルーチ
ンが正常に実行されていることを確認するステップを含
ませ、これを確認したうえでウオッチドッグタイマに対
してリセット信号を出すようにしている。このようにす
ることで、メインルーチンが正常に走らなくなった場合
はもちろん、正常時において適宜実行されるべき割込サ
ブルーチンが正常に実行されなくなった場合も検知する
ことができる。Since the CPU runaway detection subroutine is set in the middle of the main routine that is repeatedly and cyclically executed, the watchdog timer is longer than the maximum time interval of the time intervals at which the CPU runaway detection subroutine is executed each time. The timer time is set too long. Therefore, CP
CP if the main routine stops running due to U's runaway
Since the U runaway detection subroutine is not executed, the reset signal for the watchdog timer is not issued and the timer times out. That is, a reset signal is output from the watchdog timer to the CPU, the CPU is reset, and all loads are stopped. On the other hand, even when the main routine is normally executed repeatedly, a predetermined interrupt subroutine is normally executed as appropriate. For example, it is a timer interrupt subroutine executed at regular time intervals. CPU runaway does not necessarily affect the main routine, but may affect only some of the subroutines such as this timer interrupt subroutine. Therefore, when only such an interrupt subroutine is not executed by the CPU runaway, the runaway state cannot be detected only by the CPU runaway detection subroutine described above. Therefore, the CPU runaway detection subroutine includes a step for confirming that the interrupt subroutine is normally executed, and after confirming this step, a reset signal is output to the watchdog timer. By doing so, it is possible to detect not only the case where the main routine does not run normally but also the case where the interrupt subroutine, which should be executed properly in normal time, does not execute normally.
【0009】[0009]
【実施例】図1は本発明に係る異常検知方法が実施され
るマイクロコンピュータのブロック図である。この例で
は、マイクロコンピュータは電子写真複写機を制御する
ものとしている。1 is a block diagram of a microcomputer in which an abnormality detecting method according to the present invention is implemented. In this example, the microcomputer controls the electrophotographic copying machine.
【0010】マイクロコンピュータはCPU10、RO
M11、RAM12、割込コントローラ16、ウオッチ
ドッグタイマ17および汎用のタイマ18とで構成され
ている。割込コントローラ16はウオッチドッグタイマ
17のタイムアップ信号及びタイマ18のタイムアップ
信号を受け、CPU10に対し割込信号とともに割込ア
ドレスを与える。また、CPU10はウオッチドッグタ
イマ17に対してタイマリセット信号を出力し、タイマ
18に対してはタイマ時間セット信号を出力する。CP
U10からの制御信号はI/O13を介してドライバ1
4に出力され、また、入力データは入力用IC15から
上記I/O13を介してCPU10に入力される。ドラ
イバ14にはクラッチ,ソレノイドなどの他、ヒータラ
ンプや露光ランプの各々の駆動部が接続されている。入
力用IC15には各種センサからの情報、例えば用紙サ
イズ、用紙の搬送経路に配置されている搬送スイッチな
どからの情報が入力する。The microcomputer includes a CPU 10 and an RO
It is composed of an M11, a RAM 12, an interrupt controller 16, a watchdog timer 17, and a general-purpose timer 18. The interrupt controller 16 receives the time-up signal of the watchdog timer 17 and the time-up signal of the timer 18, and gives the CPU 10 an interrupt address together with the interrupt signal. The CPU 10 also outputs a timer reset signal to the watchdog timer 17 and a timer time set signal to the timer 18. CP
The control signal from U10 is sent to the driver 1 via I / O13.
4 and the input data is input from the input IC 15 to the CPU 10 via the I / O 13. In addition to a clutch, a solenoid, etc., the driver 14 is connected with respective driving units of a heater lamp and an exposure lamp. Information from various sensors, for example, a sheet size, information from a transport switch arranged on the transport path of the sheet, is input to the input IC 15.
【0011】図2〜図5は、ROM11に記憶されてい
る制御ルーチンを示している。図2はメイン(通常)ル
ーチンである。このメインルーチンは、入出力制御を行
うサブルーチンステップを含む合計7つ(S1〜S7ま
で)のサブルーチンを含み、さらに暴走検知制御サブル
ーチンS8を含んでいる。このS1〜S8までの各サブ
ルーチンは繰り返して循環的に実行されていく。2 to 5 show a control routine stored in the ROM 11. FIG. 2 shows a main (normal) routine. This main routine includes a total of seven (S1 to S7) subroutines including subroutine steps for performing input / output control, and further includes a runaway detection control subroutine S8. The respective subroutines of S1 to S8 are repeatedly and cyclically executed.
【0012】ここで、図1におけるCPU10の割込動
作について説明する。割込のモードには、ノンマスカブ
ル割込モードとマスカブル割込モードがある。ノンマス
カブル割込モードは割込要求が発生すると必ずその割込
ルーチンへブランチするモードであり、マスカブル割込
モードとは割込の制御フラグによって割込要求が発生し
てもその許可/禁止状態で割込ルーチンへブランチする
か否かコントロールできるモードである。前者のノンマ
スカブル割込には、ウオッチドッグタイマ割込があり、
後者のマスカブル割込にはタイマ割込がある。図1にお
いてウオッチドッグタイマ17による割込はノンマスカ
ブル割込であり、タイマ18による割込はマスカブル割
込である。このようにウオッチドッグタイマに17によ
る割込はノンマスカブル割込であるために、CPUの暴
走によって図2に示すメインルーチンが正常に流れなく
なった場合にはCPU10に対し確実にリセット信号が
送られることなるが、タイマ18による割込はマスカブ
ル割込であるために、もしCPU10が暴走し割込の制
御フラグが禁止状態となれば、メインルーチンが正常に
流れていてもタイマ18からの割込は受け付けられなく
なってしまう。本実施例では、図3,図4のサブルーチ
ンを設定することによりこのような問題を解決し、マス
カブル割込が正常に受け付られないような暴走が生じた
場合も、検知できるようにしている。Now, the interrupt operation of the CPU 10 in FIG. 1 will be described. The interrupt modes include a non-maskable interrupt mode and a maskable interrupt mode. The non-maskable interrupt mode is a mode that branches to the interrupt routine whenever an interrupt request is generated.The maskable interrupt mode is the enable / disable state when an interrupt request is generated by the interrupt control flag. This mode allows you to control whether to branch to the built-in routine. The former non-maskable interrupt includes a watchdog timer interrupt,
The latter maskable interrupt has a timer interrupt. In FIG. 1, the interrupt by the watchdog timer 17 is a non-maskable interrupt, and the interrupt by the timer 18 is a maskable interrupt. Since the watchdog timer 17 interrupt is a non-maskable interrupt as described above, a reset signal is surely sent to the CPU 10 when the main routine shown in FIG. However, since the interrupt by the timer 18 is a maskable interrupt, if the CPU 10 runs out of control and the interrupt control flag is in the disabled state, the interrupt from the timer 18 will not occur even if the main routine is flowing normally. I will not be accepted. In the present embodiment, such a problem is solved by setting the subroutines of FIGS. 3 and 4, and even when a runaway that cannot normally accept a maskable interrupt occurs, it can be detected. ..
【0013】図3は正常時においてタイマ割込により一
定時間毎に実行されるべきタイマ割込サブルーチンを示
す。また、図4はメインルーチンのS8で実行される暴
走検知制御サブルーチンを示す。FIG. 3 shows a timer interrupt subroutine which should be executed at regular intervals by a timer interrupt during normal operation. Further, FIG. 4 shows a runaway detection control subroutine executed in S8 of the main routine.
【0014】先ず、図4の暴走検知サブルーチンについ
て説明する。最初に、S30において、WDTRESと
いうRAMアドレスの内容がAAH(16進)か否か判
断する。もし、AAHでなければ何も処理をしない。も
しAAHであれば、S31にてウオッチドッグタイマを
リセットし、WDTRESというRAMアドレスに00
Hをセットする(S32)。ここで、図3に示すように
タイマ割込処理に入ったとき、S20においてWDTR
ESというRAMアドレスにAAHをストアし、S21
にてタイマカウントアップ処理、S22において表示,
キー入力処理を行っている。従って、タイマ割込処理が
正常に実行されたかどうかの判断は、S30のステッ
プ、すなわちWDTRESというRAMアドレスの内容
がAAHになったか否かで判断することができる。図5
は、メインルーチンのS7の露光,ヒータ制御サブルー
チンに含まれるコピーランプ制御ルーチンを示してい
る。S40にてコピーランプのオンリクエストがセット
されていれば、S41にてコピーランプCLがオンして
いるか否かチェックし、オンしていなければS42にて
コピーランプCLをオンし、タイマに1.5秒をセット
する。このタイマは、図3のタイマ割込サブルーチンの
S21によってカウントアップされることになる。コピ
ーランプCLがオンしていればS44にてタイマのタイ
ムアップをチェックし、タイムアップしていればS45
にてコピーランプCLをオフし、S46でコピーランプ
CLのオンリクエストフラグをオフする。First, the runaway detection subroutine of FIG. 4 will be described. First, in S30, it is determined whether or not the content of the RAM address WDTRES is AAH (hexadecimal). If it is not AAH, nothing is processed. If it is AAH, the watchdog timer is reset in S31 and 00 is set to the RAM address WDTRES.
H is set (S32). Here, when the timer interrupt processing is entered as shown in FIG. 3, the WDTR is executed in S20.
Storing AAH in RAM address called ES, S21
, Count up timer, display at S22,
Key input processing is in progress. Therefore, it can be determined whether or not the timer interrupt process is normally executed by the step of S30, that is, whether or not the content of the RAM address WDTRES is AAH. Figure 5
Shows a copy lamp control routine included in the exposure / heater control subroutine of S7 of the main routine. If the copy lamp ON request is set in S40, it is checked in S41 whether or not the copy lamp CL is turned ON. If not, the copy lamp CL is turned ON in S42, and the timer is set to 1. Set 5 seconds. This timer is counted up by S21 of the timer interrupt subroutine of FIG. If the copy lamp CL is turned on, the time-up of the timer is checked in S44, and if the time is up, S45
In step S46, the copy lamp CL is turned off, and in step S46, the on-request flag of the copy lamp CL is turned off.
【0015】ここでタイマ割込はマスカブル割込である
ために、もしCPU10が暴走し、割込制御フラグが禁
止状態となれば、メインルーチンが正常に流れていて
も、タイマはタイムアップせず、コピーランプCLは点
灯しっぱなしとなり、発煙,発火を招く恐れがある。し
かし、本実施例では図3,図4に示すルーチンによっ
て、タイマ割込サブルーチンが正常に実行されない場合
にS40から直接抜けることによりウオッチドッグタイ
マへのリセット信号出力がされないようになるために、
メインルーチンが正常に走らなくなる場合と同様にウオ
ッチドッグタイマを働かせてCPU10をリセットさせ
ることができるようになる。Since the timer interrupt is a maskable interrupt, if the CPU 10 runs out of control and the interrupt control flag is disabled, the timer does not expire even if the main routine is flowing normally. The copy lamp CL remains lit, which may cause smoke and fire. However, in this embodiment, the routine shown in FIGS. 3 and 4 prevents the reset signal from being output to the watchdog timer by directly exiting from S40 when the timer interrupt subroutine is not normally executed.
As in the case where the main routine does not run normally, the watchdog timer can be activated to reset the CPU 10.
【0016】[0016]
【発明の効果】タイマ割込サブルーチンなど、正常時に
おいてメインルーチンとともに適宜実行されるべき割込
サブルーチンが正常に実行されない場合でもウオッチド
ッグタイマに対してリセット信号が出力されるようにな
るために、CPUの暴走検知能力が高まる。また、新た
にウオッチドッグタイマなどの回路を付加する必要もな
い。As described above, the reset signal is output to the watchdog timer even when an interrupt subroutine, such as a timer interrupt subroutine, which should be properly executed together with the main routine at normal time is not normally executed. The runaway detection capability of the CPU is enhanced. In addition, it is not necessary to add a circuit such as a watchdog timer.
【図1】本発明に係る暴走検知方法が実施されるマイク
ロコンピュータのブロック図FIG. 1 is a block diagram of a microcomputer in which a runaway detection method according to the present invention is implemented.
【図2】上記マイクロコンピュータで実行されるメイン
ルーチンFIG. 2 is a main routine executed by the microcomputer.
【図3】タイマ割込サブルーチン[Figure 3] Timer interrupt subroutine
【図4】暴走検知制御サブルーチン[Fig. 4] Runaway detection control subroutine
【図5】コピーランプ制御サブルーチンFIG. 5: Copy lamp control subroutine
10−CPU 17−ウオッチドッグタイマ 18−タイマ 10-CPU 17-Watchdog timer 18-Timer
Claims (1)
にCPU暴走検知サブルーチンが設定され、該CPU暴
走検知サブルーチンは実行される毎にウオッチドッグタ
イマにリセット信号を出すCPUの暴走検知方法におい
て、 前記CPU暴走検知サブルーチンは、正常時において適
宜実行されるべき割り込みサブルーチンが正常に動作し
ていることを確認した上で前記リセット信号を出すこと
を特徴とするCPUの暴走検知方法。1. A runaway detection method for a CPU, wherein a CPU runaway detection subroutine is set in the middle of a repeatedly executed main routine, and the CPU runaway detection subroutine issues a reset signal to a watchdog timer each time it is executed. In the runaway detection subroutine, the reset signal is issued after confirming that the interrupt subroutine that should be executed in normal time is operating normally, and the CPU runaway detection method.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP07424692A JP3145773B2 (en) | 1992-03-30 | 1992-03-30 | Runaway detection method for CPU controlling image forming apparatus |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP07424692A JP3145773B2 (en) | 1992-03-30 | 1992-03-30 | Runaway detection method for CPU controlling image forming apparatus |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH05282182A true JPH05282182A (en) | 1993-10-29 |
| JP3145773B2 JP3145773B2 (en) | 2001-03-12 |
Family
ID=13541618
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP07424692A Expired - Fee Related JP3145773B2 (en) | 1992-03-30 | 1992-03-30 | Runaway detection method for CPU controlling image forming apparatus |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3145773B2 (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2009064163A (en) * | 2007-09-05 | 2009-03-26 | Kyocera Mita Corp | Image forming apparatus and method of detecting cpu runaway thereof |
| WO2011158549A1 (en) | 2010-06-17 | 2011-12-22 | 日本電気株式会社 | Electronic apparatus, and setting adjustment method for same |
Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH02126342A (en) * | 1988-11-07 | 1990-05-15 | Jidosha Kiki Co Ltd | Method for detecting runaway of microcomputer |
-
1992
- 1992-03-30 JP JP07424692A patent/JP3145773B2/en not_active Expired - Fee Related
Patent Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH02126342A (en) * | 1988-11-07 | 1990-05-15 | Jidosha Kiki Co Ltd | Method for detecting runaway of microcomputer |
Also Published As
| Publication number | Publication date |
|---|---|
| JP3145773B2 (en) | 2001-03-12 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP2000102163A (en) | Method and apparatus for monitoring the voltage supply of a vehicle control device | |
| JPH05282182A (en) | CPU runaway detection method | |
| JP3651273B2 (en) | Self-shutoff diagnostic device | |
| JP2001190802A (en) | Gaming machine | |
| JPH06138000A (en) | Electronic controller | |
| JPH08263320A (en) | System operation management method and operation management device | |
| JP2774299B2 (en) | Bus synchronous control device | |
| JPH02281343A (en) | Cpu operation monitor system | |
| JP2020092326A (en) | Illegal signal processing device | |
| JPH0679279B2 (en) | Supervisory control device for microprocessor-applied equipment | |
| JPH09190360A (en) | Microcomputer and its runaway monitoring processing method | |
| JPS6318188B2 (en) | ||
| JP2001228929A (en) | System and method for updating authentication data | |
| JPH1069390A (en) | Device and method for task stall | |
| JPS61109069A (en) | Control system of copying machine | |
| JPH08106406A (en) | Runaway detecting device for multitrask program | |
| JP2000020353A (en) | Watchdog timer control method | |
| JPH02244208A (en) | Information processor control system | |
| JPS5814156A (en) | Controlling method for interruption copying in electrophotographic copier | |
| JPS63298516A (en) | Automatic resetting keyboard | |
| JPH1179596A (en) | Elevator operation control system | |
| JP2000351540A (en) | Elevator control system | |
| JP2001242901A (en) | Abnormality detection device for programmable controller | |
| JPH07295834A (en) | Debug monitor processing method/device | |
| JPH0991170A (en) | Failure detection device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20080105 Year of fee payment: 7 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090105 Year of fee payment: 8 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100105 Year of fee payment: 9 |
|
| LAPS | Cancellation because of no payment of annual fees |