JPH086822A - Cpu device with runaway monitoring function - Google Patents

Cpu device with runaway monitoring function

Info

Publication number
JPH086822A
JPH086822A JP6138658A JP13865894A JPH086822A JP H086822 A JPH086822 A JP H086822A JP 6138658 A JP6138658 A JP 6138658A JP 13865894 A JP13865894 A JP 13865894A JP H086822 A JPH086822 A JP H086822A
Authority
JP
Japan
Prior art keywords
cpu
interrupt
external clock
watchdog
period
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
Application number
JP6138658A
Other languages
Japanese (ja)
Other versions
JP3163904B2 (en
Inventor
Manabu Hirao
学 平尾
Noriaki Kataoka
憲明 片岡
Kazumi Nakae
一美 中江
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Home Electronics Ltd
NEC Corp
Original Assignee
NEC Home Electronics Ltd
Nippon Electric Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by NEC Home Electronics Ltd, Nippon Electric Co Ltd filed Critical NEC Home Electronics Ltd
Priority to JP13865894A priority Critical patent/JP3163904B2/en
Publication of JPH086822A publication Critical patent/JPH086822A/en
Application granted granted Critical
Publication of JP3163904B2 publication Critical patent/JP3163904B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To securely detect a CPU being runaway through simple constitution. CONSTITUTION:An edge is detected from level variation at the time of runaway the switching of an external clock, which has cycles much longer than an interruption cycle of the CPU 22 as an object of monitoring, from a high level to a low level or vice versa, and it is judged whether or not the CPU 22 operates normally from whether or not the frequency (n) of interruption initiated in the high-level period or low-level period of the external clock up to the point is in the specified range (Nmin<=n<=Nmax). An oscillator 23 which generates the external clock can be connected not to the interruption input terminal of the CPU 22, but to the normal input port P0 and this device is specially effective in monitoring whether or not the low-function CPU 22 is runaway.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、CPUの暴走を簡単か
つ確実に検出できるようにした暴走監視機能付きCPU
装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a CPU with a runaway monitoring function that can easily and reliably detect a runaway of a CPU.
Regarding the device.

【0002】[0002]

【従来の技術】図6に示す従来の暴走監視機能付きCP
U装置1は、車載用電子機器に組み込まれたCPU2に
ウォッチドッグ回路3を接続し、CPU2に動作異常が
発見された場合に直ちにウォッチドッグ回路3がリセッ
トをかける構成になっている。CPU2は、動作プログ
ラムに規定されたメインジョブを実行するが、その途中
途中で内蔵タイマ(図示せず)により所定周期でタイマ
割り込みがかかるようになっている。また、タイマ割り
込み以外にも、外部の発振器3から送り込まれる動作プ
ログラム一巡処理時間よりも周期の短い診断パルスによ
っても割り込みがかかり、正常に動作している場合は割
り込み直後に出力ポートP1からウォッチドッグパルス
を出力する。このウォッチドッグパルスは、クリア入力
端子を介してウォッチドッグ回路4内に取り込まれて周
期判別され、周期異常が認められる場合はウォッチドッ
グ回路4のキャリー出力端子からCPU2のリセット入
力端子にリセット信号が送り込まれ、CPU2はリセッ
トされる。
2. Description of the Related Art CP with a conventional runaway monitoring function shown in FIG.
The U device 1 has a configuration in which a watchdog circuit 3 is connected to a CPU 2 incorporated in a vehicle-mounted electronic device and the watchdog circuit 3 immediately resets when an abnormal operation is found in the CPU 2. The CPU 2 executes the main job defined in the operation program, and a timer interrupt is applied at a predetermined cycle by an internal timer (not shown) in the middle of the process. In addition to the timer interrupt, an interrupt is generated by a diagnostic pulse sent from the external oscillator 3 and having a cycle shorter than the cycle of the operating program, and when operating normally, the watchdog is output from the output port P1 immediately after the interrupt. Output pulse. This watchdog pulse is taken into the watchdog circuit 4 through the clear input terminal and the cycle is discriminated. When a cycle abnormality is recognized, a reset signal is sent from the carry output terminal of the watchdog circuit 4 to the reset input terminal of the CPU 2. It is sent in and the CPU 2 is reset.

【0003】本例に示されるウォッチドッグ回路4は、
一定周期のクロックパルスを計数するタイマ(図示せ
ず)を内蔵しており、CPU2が正常に作動していると
きは、タイマがキャリー(桁上がり)出力を出す前にウ
ォッチドッグパルスによってタイマ値がクリアされる
が、CPU2がプログラムを正規に処理できずに暴走し
ているような場合は、ウォッチドッグパルスが全く出力
されないか又は出力されても周期が長びくために、タイ
マがクリアされる前にキャリー出力がCPU2のリセッ
ト入力端子に供給され、これによりCPU2に対しリセ
ットがかかるようになっている。
The watchdog circuit 4 shown in this example is
It has a built-in timer (not shown) that counts clock pulses of a fixed period, and when the CPU2 is operating normally, the timer value is changed by the watchdog pulse before the timer outputs carry (carry). If it is cleared, but the CPU 2 is not able to process the program normally and is running out of control, the watchdog pulse will not be output at all or the output will take a long period. The carry output is supplied to the reset input terminal of the CPU 2, whereby the CPU 2 is reset.

【0004】[0004]

【発明が解決しようとする課題】上記従来の暴走監視機
能付きCPU装置1は、CPU2が出力するウォッチド
ッグパルスの周期が長くなる故障か、或いはウォッチド
ッグパルスが全く出力されない故障については、キャリ
ー出力端子から出力されるリセット信号によりCPU2
はリセットされるが、ウォッチドッグパルスの周期が短
くなる故障、すなわちCPU2が割り込み入力端子への
割り込み入力に関係なくウォッチドッグパルスを出力す
る暴走等が発生したりすると、リセット信号が出力され
る前にタイマがクリアされ続けてしまうため、いつまで
もCPU2に対してリセットがかからず、異常を発見で
きないといった課題があった。また、上記従来の暴走監
視機能付きCPU装置1は、CPU2の割り込み入力ポ
ートINTPに発振器3を接続し、動作プログラム一巡
処理時間よりも短い周期で診断パルスを入力するため、
発振器3には発振周波数の高いものが要求され、また厳
密なエッジ検出は通常の入力ポート経由ではできないた
め、CPU2に備わった複数の割り込み入力ポートIN
TPのうちの一つを診断パルスのエッジ検出用に明け渡
さねばならず、このため従来の暴走監視機能付きCPU
装置1は、割り込み入力ポート数に制約のある低機能C
PU2を用いる場合には適用できないといった課題があ
った。
The conventional CPU device 1 with the runaway monitoring function has a carry output for a failure in which the cycle of the watchdog pulse output by the CPU 2 becomes long or a failure in which the watchdog pulse is not output at all. CPU2 by the reset signal output from the terminal
However, if the CPU2 is reset, but the cycle of the watchdog pulse becomes short, that is, the CPU2 outputs a watchdog pulse regardless of the interrupt input to the interrupt input terminal, the reset signal is not output. Since the timer continues to be cleared, the CPU 2 is not reset forever and there is a problem that an abnormality cannot be found. Further, in the above-described conventional CPU device 1 having the runaway monitoring function, the oscillator 3 is connected to the interrupt input port INTP of the CPU 2 and the diagnostic pulse is input at a cycle shorter than the operation program round-trip processing time.
Since the oscillator 3 is required to have a high oscillation frequency, and strict edge detection cannot be performed via a normal input port, a plurality of interrupt input ports IN provided in the CPU 2 are provided.
One of the TPs must be surrendered to detect the edge of the diagnostic pulse, which is why the conventional CPU with runaway monitoring function
Device 1 is a low-function C with a limited number of interrupt input ports.
There is a problem that it cannot be applied when PU2 is used.

【0005】また、CPUの暴走をより本格的に監視す
るため、例えば図7に示す従来の暴走監視機能付きCP
U装置11のように、CPU12の暴走監視用に専用の
監視用CPU13を用いるものも知られている。同装置
11の場合、CPU12の動作プログラムが複数のブロ
ックに分割してあり、各ブロックごとに必ず通過しなけ
ればならないステップの処理が完了するつどフラグを立
て、動作プログラムを一巡処理し終えた時点で全てのフ
ラグデータを専用のデータバス14を介してCPU12
から監視用CPU13に送り出す。このとき、監視用C
PU13は、データバス14を介して送り込まれた全フ
ラグデータを解析して診断に当たり、診断の結果異常が
発見された場合、直ちにリセット信号を発してCPU1
2をリセットするようになっていた。しかしながら、こ
の種の暴走監視機能付きCPU装置11は、動作プログ
ラムを一巡処理し終えた時点で、動作プログラム消化経
過を診断するため全てのフラグデータを解析しなければ
ならず、またフラグデータの送信に用いるためPU12
と監視用CPU13を専用のデータバスで接続しなけれ
ばならないだけでなく、監視用CPU13には収集した
フラグデータを解析する解析能力も要求されるため、全
体の回路構成が複雑化するといった課題を抱えるもので
あった。
In order to monitor CPU runaway more fully, for example, a conventional CP with runaway monitoring function shown in FIG.
There is also known a device such as the U device 11 which uses a dedicated monitoring CPU 13 for the runaway monitoring of the CPU 12. In the case of the device 11, the operation program of the CPU 12 is divided into a plurality of blocks, and a flag is set every time the processing of the steps that must pass through is completed for each block, and when the processing of the operation program has been completed. All flag data is sent to the CPU 12 via the dedicated data bus 14.
From the CPU 13 to the monitoring CPU 13. At this time, C for monitoring
The PU 13 analyzes all flag data sent via the data bus 14 for diagnosis, and immediately issues a reset signal to the CPU 1 when an abnormality is found as a result of the diagnosis.
It was supposed to reset 2. However, the CPU device 11 with the runaway monitoring function of this kind must analyze all flag data in order to diagnose the progress of the operation program when it completes the loop processing of the operation program, and also transmits the flag data. For use in PU12
The monitoring CPU 13 and the monitoring CPU 13 must be connected by a dedicated data bus, and the monitoring CPU 13 is also required to have an analysis capability of analyzing the collected flag data, which causes a problem that the entire circuit configuration becomes complicated. It was something I had.

【0006】[0006]

【課題を解決するための手段】本発明は、上記課題を解
決したものであり、所定の割り込み周期で割り込み処理
を実行するとともに、該割り込み処理の最後にウォッチ
ドッグパルスを外部出力し、該割り込み処理期間中は外
部クロック入力ポートが同一信号レベルである限り前記
割り込み処理のつど割り込み回数を歩進計数するととも
に、該外部クロック入力ポートの信号レベル反転を受け
て前記割り込み回数計数値を零リセットし、かつ前記割
り込み処理の開始時点で前記割り込み回数計数値をしき
い値判別し、該割り込み回数計数値が規定範囲を逸脱す
る場合は割り込み処理をせずに異常処理に移行するCP
Uと、該CPUの前記外部クロック入力ポートに前記割
り込み周期よりも十分大きな周期の外部クロックを入力
する発振器と、前記CPUが外部出力するウォッチドッ
グパルスの周期を監視し、周期異常があれば前記CPU
をリセットするウォッチドッグ回路とを具備したことを
特徴とするものである。
DISCLOSURE OF THE INVENTION The present invention is to solve the above-mentioned problems by executing interrupt processing at a predetermined interrupt cycle and outputting a watchdog pulse to the outside at the end of the interrupt processing. During the processing period, as long as the external clock input port has the same signal level, the number of interrupts is incremented each time the interrupt processing is performed, and the signal count of the external clock input port is inverted to reset the interrupt count value to zero. A CP that determines the threshold value of the interrupt count value at the start of the interrupt process, and shifts to the abnormal process without performing the interrupt process if the interrupt count value deviates from the specified range.
U, an oscillator for inputting an external clock having a period sufficiently larger than the interrupt period to the external clock input port of the CPU, and a period of a watchdog pulse externally output by the CPU. CPU
And a watchdog circuit for resetting.

【0007】また、本発明は、複数のブロックが処理順
に並ぶプログラムを実行し、そのさいに該各ブロックを
消化するつどフラグを立て、一巡処理を終えた時点でフ
ラグ総数を規定値と比較し、該フラグ総数が規定値に一
致する場合にだけウォッチドッグパルス出力ポートから
ウォッチドッグパルスを外部出力するCPUと、該CP
Uが外部出力するウォッチドッグパルスの周期を監視
し、周期異常があれば前記CPUをリセットするウォッ
チドッグ回路とを具備したことを特徴とするものであ
る。
The present invention also executes a program in which a plurality of blocks are arranged in processing order, sets a flag each time the blocks are exhausted, and compares the total number of flags with a specified value at the end of the loop processing. A CPU that outputs a watchdog pulse from a watchdog pulse output port only when the total number of flags matches a specified value;
A watchdog circuit for monitoring the cycle of the watchdog pulse externally output by U and resetting the CPU if there is a cycle abnormality is provided.

【0008】[0008]

【実施例】以下、本発明の実施例について、図1ないし
図5を参照して説明する。図1は、本発明の暴走監視機
能付きCPU装置の一実施例を示す回路ブロック図、図
2は、図1に示した回路各部の信号波形図、図3は、図
1に示したCPUによる割り込み処理動作を説明するた
めのフローチャートである。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described below with reference to FIGS. FIG. 1 is a circuit block diagram showing an embodiment of a CPU device with a runaway monitoring function of the present invention, FIG. 2 is a signal waveform diagram of each part of the circuit shown in FIG. 1, and FIG. 3 is a diagram of the CPU shown in FIG. 7 is a flowchart illustrating an interrupt processing operation.

【0009】図1に示す暴走監視機能付きCPU装置2
1は、例えば車載用電子制御ユニットに用いるCPU2
2を中心に、CPU22の暴走を監視して暴走を防止す
るために用いられる発振器23やウォッチドッグ回路2
4等を配置して構成されている。CPU22は、予めロ
ード済みの動作プログラムに従ってメインジョブを実行
するとともに、タイマ割り込みにより所定周期で各種の
割り込み処理を実行する。また、CPU22は、割り込
み処理を行うつど割り込み回数を歩進計数するカウンタ
25を内蔵している。このカウンタ25は、外部クロッ
ク入力ポートに供給される外部クロックのエッジ部分で
計数値を零リセットされ、再び零から割り込み回数の計
数を再開する。また、CPU22は、カウンタ25によ
って計数された割り込み回数nが規定範囲(Nmin≦
n≦Nmax)内にある場合にのみ、カウンタ25のイ
ンクリメント又はリセットを受けてウォッチドッグパル
ス出力ポートP1からウォッチドッグパルスを外部出力
するようになっている。
CPU device 2 with runaway monitoring function shown in FIG.
1 is, for example, a CPU 2 used in an in-vehicle electronic control unit
2, the oscillator 23 and the watchdog circuit 2 used to monitor the runaway of the CPU 22 and prevent the runaway.
4 and the like are arranged. The CPU 22 executes a main job in accordance with an operation program that has been loaded in advance, and also executes various interrupt processes at a predetermined cycle by a timer interrupt. Further, the CPU 22 has a built-in counter 25 that counts the number of interrupts stepwise each time interrupt processing is performed. The counter 25 is reset to zero at the edge portion of the external clock supplied to the external clock input port, and restarts counting the number of interrupts from zero again. Further, the CPU 22 determines that the number of interrupts n counted by the counter 25 is within a specified range (Nmin ≦
Only when n ≦ Nmax), the watchdog pulse output port P1 outputs the watchdog pulse to the outside by receiving the increment or reset of the counter 25.

【0010】発振器23は、CPU22の外部クロック
入力ポートP0に前記タイマ割り込み周期よりも十分大
きな周期の外部クロックを送り込むものであり、例えば
50ms程度の周期でハイレベルとロウレベルに交互に
切り替わる外部クロックを出力する。この外部クロック
は、ロウレベルからハイレベルへの切り替え時点すなわ
ち立ち上がりと、ハイレベルからロウレベルへの切り替
え時点すなわち立ち下がりとが重要な意味を有してお
り、CPU22がこの外部クロックの周期をタイマ割り
込み周期をもって計時することで暴走の有無が診断され
る。この計時動作は、外部クロックがハイレベルである
か又はロウレベルであるかだけを識別すればよいため、
エッジ検出のように信号レベルの変化を捕捉するための
時間微分を必要とせず、従って割り込み入力端子ではな
く通常の入力ポートP0においても可能である。すなわ
ち、外部クロック入力ポートP0のレベル検知だけで済
むため、比較的低機能のCPU22にも発振器23を接
続することができる。
The oscillator 23 sends an external clock having a period sufficiently larger than the timer interrupt period to the external clock input port P0 of the CPU 22. For example, the external clock alternately switches to a high level and a low level at a period of about 50 ms. Output. The external clock has a significant meaning at the time of switching from the low level to the high level, that is, at the rising edge and at the switching time of the high level to the low level, that is, at the falling edge. Whether or not there is a runaway is diagnosed by timing with. This timing operation only needs to identify whether the external clock is at a high level or a low level.
It does not require time differentiation for capturing a change in signal level as in edge detection, and is therefore possible not only at an interrupt input terminal but also at a normal input port P0. That is, since it is only necessary to detect the level of the external clock input port P0, the oscillator 23 can be connected to the CPU 22 having a relatively low function.

【0011】暴走監視にさいしては、まず図3に示すス
テップ(101)において、カウンタ25の計数値nが
規定最大値Nmax以下か否かが判定される。この場
合、計数値nが規定最大値Nmaxを越える場合は、直
ちにステップ(102)における異常処理に移行し、ウ
ォッチドッグパルス出力ポートP1からウォッチドッグ
パルスの出力が停止するために、これを受けたウォッチ
ドッグ回路24がCPU22のリセット入力端子にリセ
ット信号を供給し、CPU22をリセットする。
In the runaway monitoring, first, in step (101) shown in FIG. 3, it is determined whether or not the count value n of the counter 25 is less than or equal to the specified maximum value Nmax. In this case, if the count value n exceeds the specified maximum value Nmax, the process immediately proceeds to the abnormal processing in step (102) and the output of the watchdog pulse from the watchdog pulse output port P1 is stopped. The watchdog circuit 24 supplies a reset signal to the reset input terminal of the CPU 22 to reset the CPU 22.

【0012】一方、計数値nが規定最大値Nmax以下
である場合は、ステップ(103)において、1サイク
ルの割り込み処理を実行する。また、この割り込み処理
の実行と並行して、ステップ(104)に示したよう
に、外部クロック入力ポートP0をレベル検知する。そ
して、このときに外部クロック入力ポートP0のレベル
が変化していない場合は、図2(A),(B)に示した
ように、判断ステップ(105)の判断肯定結果を受け
て、ステップ(106)において、カウンタ25の計数
値に1を加算してインクリメントする。ただし、外部ク
ロック入力ポートP0におけるレベル変化から外部クロ
ックのエッジが検出された場合は、判断ステップ(10
5)の判断肯定結果に続き、判断ステップ(107)に
移行する。そして、このときに計数値nが規定最小値N
min以上であれば、続くステップ(108)において
カウンタ25の計数値nを零リセットする。ただし、計
数値nが規定最小値Nminに満たない場合は、ステッ
プ(109)における異常処理に移行する。このため、
ウォッチドッグパルス出力ポートP1からのウォッチド
ッグパルスの出力が停止し、これを受けたウォッチドッ
グ回路24がCPU22のリセット入力端子にリセット
信号を供給し、CPU22をリセットする。
On the other hand, when the count value n is equal to or less than the specified maximum value Nmax, one cycle of interrupt processing is executed in step (103). In parallel with the execution of this interrupt processing, the level of the external clock input port P0 is detected as shown in step (104). Then, if the level of the external clock input port P0 has not changed at this time, as shown in FIGS. 2A and 2B, in response to the positive determination result of the determination step (105), the step ( In 106), 1 is added to the count value of the counter 25 to increment it. However, when the edge of the external clock is detected from the level change at the external clock input port P0, the determination step (10
Subsequent to the positive determination result of 5), the process proceeds to a determination step (107). At this time, the count value n is the specified minimum value N
If it is greater than or equal to min, the count value n of the counter 25 is reset to zero in the subsequent step (108). However, when the count value n is less than the specified minimum value Nmin, the process proceeds to the abnormality processing in step (109). For this reason,
The output of the watchdog pulse from the watchdog pulse output port P1 is stopped, and the watchdog circuit 24 receiving this stops supplying the reset signal to the reset input terminal of the CPU 22 to reset the CPU 22.

【0013】ステップ(106),(108)において
カウンタ25の計数値をインクリメントするか又はリセ
ットし終えたあとは、最後のステップ(110)におい
てウォッチドッグパルスを出力し、割り込み処理を終了
する。従って、割り込み処理が正規に行われるつど、図
2(C)に示したように、ここでは割り込み処理2回に
1回の割りでウォッチドッグ回路24に対しウォッチド
ッグパルスが出力される。従って、割り込み周期の2倍
の周期で出力されるウォッチドッグパルスが1回でも欠
落すれば、ウォッチドッグ回路24はこれをウォッチド
ッグパルスの周期異常として捕らえ、直ちにリセット信
号を発することができる。
After the count value of the counter 25 is incremented or reset in steps (106) and (108), a watchdog pulse is output in the final step (110), and the interrupt processing is terminated. Therefore, every time the interrupt process is normally performed, as shown in FIG. 2C, the watchdog pulse is output to the watchdog circuit 24 once every two interrupt processes. Therefore, if the watchdog pulse output in a cycle twice as long as the interrupt cycle is lost even once, the watchdog circuit 24 can catch this as an abnormal cycle of the watchdog pulse and immediately issue a reset signal.

【0014】このように、上記暴走監視機能付きCPU
装置21によれば、暴走監視対象であるCPU22の割
り込み周期よりも十分に長い周期の外部クロックが、ハ
イレベルからロウレベル或いはロウレベルからハイレベ
ルに切り替わるさいにレベル検知をもってエッジを検出
し、外部クロックのそれまでのハイレベル期間又はロウ
レベル期間に発生した割り込み回数nが規定範囲(Nm
in≦n≦Nmax)内にあるか否かをもって、CPU
22の動作を正常又は異常と判断することができる。ま
た、発振器23の発振周期は、CPU22の動作プログ
ラムが1周する時間に合わせればよく、従って高速の発
振動作は不要である。また、CPU22も外部クロック
のレベルが変化したことをもってカウンタ25の計数値
を零リセットすればよいため、外部クロックをエッジ検
出機能をもった割り込み入力ポートへではなく信号レベ
ルの違いを検出することのできる通常の入力ポートP0
に接続することができ、これによりCPU22の割り込
み入力ポートINTPを暴走監視から解放することがで
きる。さらに、CPU22は、割り込み処理に入った直
後にカウンタ25の計数値nをもって異常判定を行った
のち、カウンタ25のインクリメント又はリセットを受
けてウォッチドッグパルスを出力するため、異常判定は
なされなかったもののウォッチドッグパルスを出力しな
いといったCPU22の処理異常についても、その場で
検知することが可能であり、ポート数に制約のある比較
的安価なCPU22に適用した場合に効用が大である。
As described above, the CPU with the runaway monitoring function
According to the device 21, the external clock whose period is sufficiently longer than the interrupt period of the CPU 22 which is the runaway monitoring target detects the edge by level detection when switching from the high level to the low level or from the low level to the high level, and detects the external clock. The number of interrupts n that occurred during the high level period or the low level period up to that point is within the specified range (Nm
in ≦ n ≦ Nmax)
The operation of 22 can be judged to be normal or abnormal. Further, the oscillation cycle of the oscillator 23 may be set to match the time required for the operating program of the CPU 22 to make one round, so that high-speed oscillation operation is unnecessary. Further, since the CPU 22 may reset the count value of the counter 25 to zero when the level of the external clock changes, the external clock is not detected to the interrupt input port having the edge detection function, but to detect the difference in signal level. Possible normal input port P0
, So that the interrupt input port INTP of the CPU 22 can be released from runaway monitoring. Further, since the CPU 22 makes an abnormality determination with the count value n of the counter 25 immediately after the start of the interrupt processing and then outputs the watchdog pulse upon receiving the increment or reset of the counter 25, the abnormality determination is not made. A processing abnormality of the CPU 22, such as not outputting a watchdog pulse, can be detected on the spot, and is very useful when applied to a relatively inexpensive CPU 22 having a limited number of ports.

【0015】図4に示す暴走監視機能付きCPU装置3
1は、CPU32の動作プログラムを1〜nのブロック
に分割し、各ブロックごとに必ず通過するステップにフ
ラグをセットする箇所が設けてある。CPU32は、各
ブロックを消化するつどフラグを立て、一巡処理を終え
た時点でフラグ総数を規定値と比較し、フラグ総数が規
定値nに一致する場合にだけウォッチドッグパルス出力
ポートP1からウォッチドッグパルスを外部出力する。
また、CPU32が外部出力するウォッチドッグパルス
は、信号線33を介してウォッチドッグ回路34に送り
出されるようになっており、ウォッチドッグ回路34が
ウォッチドッグパルスの周期異常を発見したときにCP
U32はリセットされる。
CPU device 3 with runaway monitoring function shown in FIG.
In No. 1, the operation program of the CPU 32 is divided into blocks of 1 to n, and each block is provided with a place where a flag is set to a step which always passes. The CPU 32 sets a flag each time each block is exhausted, compares the total number of flags with a specified value at the end of one round of processing, and only when the total number of flags matches the specified value n, the watchdog pulse output port P1 outputs a watchdog pulse. Output pulse externally.
The watchdog pulse externally output by the CPU 32 is sent out to the watchdog circuit 34 via the signal line 33. When the watchdog circuit 34 finds an abnormal cycle of the watchdog pulse, the CP
U32 is reset.

【0016】すなわち、CPU32が正常に動作してい
る場合は、図5に示したように、n個のブロックに分割
された動作プログラムをブロックごとに順調に処理し終
えた時点で、各ブロックを処理するつど立てられるフラ
グの総数はnに達する。このため、判断ステップ(n+
1)における判断が肯定され、出力ポートP1からウォ
ッチドッグパルスが出力される。ただし、フラグ総数が
nに達しておらず、判断ステップ(n+1)における判
断が否定された場合は、ウォッチドッグパルスが得られ
ず、そのためウォッチドッグ回路34によってCPU3
2はリセットされる。この暴走監視機能付きCPU装置
31は、CPU32自身に自らが個々のブロックを処理
するつど立てたフラグの総数を計数させ、その計数値が
規定値nに一致するかどうかの判断までをCPU32に
任せることにより、ウォッチドッグ回路34とCPU3
2をデータバスではなくウォッチドッグパルス用に1本
の信号線33で結ぶことができ、これにより全体の回路
構成を簡単化することができる。
That is, when the CPU 32 is operating normally, as shown in FIG. 5, when the operation program divided into n blocks has been smoothly processed for each block, each block is processed. The total number of flags raised each time it reaches n. Therefore, the judgment step (n +
The determination in 1) is affirmed, and the watchdog pulse is output from the output port P1. However, if the total number of flags has not reached n and the determination in the determination step (n + 1) is negative, the watchdog pulse cannot be obtained and therefore the watchdog circuit 34 causes the CPU 3
2 is reset. The CPU device 31 with the runaway monitoring function causes the CPU 32 itself to count the total number of flags set up each time it processes an individual block, and leaves it up to the CPU 32 to determine whether or not the counted value matches the specified value n. As a result, the watchdog circuit 34 and the CPU 3
2 can be connected not by the data bus but by one signal line 33 for the watchdog pulse, which can simplify the entire circuit configuration.

【0017】[0017]

【発明の効果】以上説明したように、本発明によれば、
暴走監視対象であるCPUの割り込み周期よりも十分に
長い周期の外部クロックが、ハイレベルからロウレベル
或いはロウレベルからハイレベルに切り替わるさいのレ
ベル変化を見てエッジを検出し、外部クロックのそれま
でのハイレベル期間又はロウレベル期間に発生した割り
込み回数が規定回数に一致するか否かをもって、CPU
の動作を正常又は異常と判断する構成としたから、発振
器の発振周期はCPUの動作プログラムが1周する時間
に合わせればよく、従って高速の発振動作は不要であ
り、またCPUも外部クロックのレベル検出をもってカ
ウンタの計数値を零リセットすればよいため、外部クロ
ックを生成する発振器をエッジ検出機能をもった割り込
み入力ポートへではなく信号レベルの違いを検出するこ
とのできる通常の入力ポートに接続することができ、こ
れによりCPUの割り込み入力ポートを暴走監視から解
放することができ、またCPUは、割り込み処理に入っ
た直後にカウンタの計数値をもって異常判定を行ったの
ち、カウンタのインクリメント又はリセットを受けてウ
ォッチドッグパルスを出力するため、異常判定はなされ
なかったもののウォッチドッグパルスを出力しないとい
ったCPUの処理異常についても、直ちに検知すること
が可能であり、ポート数に制約のある比較的低機能のC
PUを用いる場合等に特に適する等の優れた効果を奏す
る。
As described above, according to the present invention,
An external clock whose period is sufficiently longer than the interrupt period of the CPU that is the runaway monitor detects an edge by looking at the level change when switching from high level to low level or from low level to high level, and detects the high level of the external clock until then. The CPU determines whether the number of interrupts generated during the level period or the low level period matches the specified number.
Since the operation of is determined to be normal or abnormal, the oscillation cycle of the oscillator may be set to match the time required for the operating program of the CPU to make one round. Therefore, high-speed oscillation operation is not necessary, and the CPU also has the level of the external clock. Since it is only necessary to reset the count value of the counter to zero upon detection, connect the oscillator that generates the external clock to the normal input port that can detect the difference in signal level, not to the interrupt input port that has the edge detection function. This allows the interrupt input port of the CPU to be released from runaway monitoring, and the CPU performs the abnormality determination with the count value of the counter immediately after entering the interrupt processing and then increments or resets the counter. Since it receives a watchdog pulse and outputs a watchdog pulse, no abnormality judgment was made, but The process abnormalities and went CPU does not output a Chidogguparusu, it is possible to detect immediately, C of a relatively low functionality with limited number of ports
It has excellent effects such as being particularly suitable when using PU.

【0018】また、本発明は、暴走監視対象であるCP
Uが、複数のブロックが処理順に並ぶプログラムを実行
し、そのさいに該各ブロックを消化するつどフラグを立
て、一巡処理を終えた時点でフラグ総数を規定値と比較
し、該フラグ総数が規定値に一致する場合にだけウォッ
チドッグパルス出力ポートからウォッチドッグパルスを
外部出力し、ウォッチドッグ回路がこのウォッチドッグ
パルスの周期を監視し、周期異常があればCPUをリセ
ットする構成としたから、CPU自身に自らが個々のブ
ロックを処理するつど立てたフラグの総数を計数させ、
その計数値が規定値に一致するかどうかの判断までをC
PUに任せたことにより、ウォッチドッグ回路とCPU
をデータバスではなくウォッチドッグパルス用に1本の
信号線で結ぶだけでよく、これにより全体の回路構成を
簡単化し、特にポート数に制約のある低機能CPUを監
視する場合に適する等の優れた効果を奏する。
Further, according to the present invention, a CP which is a runaway monitoring target
U executes a program in which a plurality of blocks are arranged in processing order, sets a flag each time the blocks are exhausted, and compares the total number of flags with a specified value at the end of one round of processing. Only when the values match, the watchdog pulse output port outputs the watchdog pulse externally, the watchdog circuit monitors the cycle of this watchdog pulse, and resets the CPU if there is a cycle abnormality. Letting it count the total number of flags it has set each time it processes an individual block,
C until the count value matches the specified value
By leaving it to the PU, the watchdog circuit and CPU
Need only be connected with a single signal line for the watchdog pulse instead of the data bus, which simplifies the overall circuit configuration and is particularly suitable for monitoring low-function CPUs with a limited number of ports. Produce the effect.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の暴走監視機能付きCPU装置の一実施
例を示す概略回路ブロック図である。
FIG. 1 is a schematic circuit block diagram showing an embodiment of a CPU device with a runaway monitoring function according to the present invention.

【図2】図1に示した回路各部の信号波形図である。FIG. 2 is a signal waveform diagram of each part of the circuit shown in FIG.

【図3】図1に示したCPUによる割り込み処理動作を
説明するためのフローチャートである。
FIG. 3 is a flowchart for explaining an interrupt processing operation by the CPU shown in FIG.

【図4】本発明の暴走監視機能付きCPU装置の他の実
施例を示す概略回路ブロック図である。
FIG. 4 is a schematic circuit block diagram showing another embodiment of the CPU device with the runaway monitoring function of the present invention.

【図5】図4に示した暴走監視機能付きCPU装置の動
作を説明するためのフローチャートである。
5 is a flow chart for explaining the operation of the CPU device with a runaway monitoring function shown in FIG. 4. FIG.

【図6】従来の暴走監視機能付きCPU装置の一例を示
す概略回路ブロック図である。
FIG. 6 is a schematic circuit block diagram showing an example of a conventional CPU device with a runaway monitoring function.

【図7】従来の暴走監視機能付きCPU装置の他の一例
を示す概略回路ブロック図である。
FIG. 7 is a schematic circuit block diagram showing another example of a conventional CPU device with a runaway monitoring function.

【符号の説明】[Explanation of symbols]

21,31 暴走監視機能付きCPU装置 22,32 CPU 23 発振器 33 信号線 24,34 ウォッチドッグ回路 25 カウンタ P0 外部クロック入力ポート P1 ウォッチドッグパルス出力ポート 21, 31 CPU device with runaway monitoring function 22, 32 CPU 23 Oscillator 33 Signal line 24, 34 Watchdog circuit 25 Counter P0 External clock input port P1 Watchdog pulse output port

───────────────────────────────────────────────────── フロントページの続き (72)発明者 中江 一美 大阪府大阪市中央区城見一丁目4番24号 日本電気ホームエレクトロニクス株式会社 内 ─────────────────────────────────────────────────── ─── Continuation of the front page (72) Inventor Kazumi Nakae 1-42 Jomi, Chuo-ku, Osaka-shi, Osaka NEC Home Electronics Co., Ltd.

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 所定の割り込み周期で割り込み処理を実
行するとともに、該割り込み処理の最後にウォッチドッ
グパルスを外部出力し、該割り込み処理期間中は外部ク
ロック入力ポートが同一信号レベルである限り前記割り
込み処理のつど割り込み回数を歩進計数するとともに、
該外部クロック入力ポートの信号レベル反転を受けて前
記割り込み回数計数値を零リセットし、かつ前記割り込
み処理の開始時点で前記割り込み回数計数値をしきい値
判別し、該割り込み回数計数値が規定範囲を逸脱する場
合は割り込み処理をせずに異常処理に移行するCPU
と、該CPUの前記外部クロック入力ポートに前記割り
込み周期よりも十分大きな周期の外部クロックを入力す
る発振器と、前記CPUが外部出力するウォッチドッグ
パルスの周期を監視し、周期異常があれば前記CPUを
リセットするウォッチドッグ回路とを具備したことを特
徴とする暴走監視機能付きCPU装置。
1. An interrupt process is executed at a predetermined interrupt cycle, a watchdog pulse is externally output at the end of the interrupt process, and the interrupt signal is output as long as the external clock input port has the same signal level during the interrupt process period. In addition to counting the number of interrupts in each process,
The interrupt count value is reset to zero in response to the signal level inversion of the external clock input port, and the interrupt count value is discriminated as a threshold value at the start of the interrupt processing, and the interrupt count value falls within a specified range. CPU deviating from the above, the CPU shifts to abnormal processing without interrupt processing
And an oscillator for inputting an external clock having a period sufficiently larger than the interrupt period to the external clock input port of the CPU, and a period of a watchdog pulse externally output by the CPU. A CPU device with a runaway monitoring function, comprising a watchdog circuit for resetting
【請求項2】 複数のブロックが処理順に並ぶプログラ
ムを実行し、そのさいに該各ブロックを消化するつどフ
ラグを立て、一巡処理を終えた時点でフラグ総数を規定
値と比較し、該フラグ総数が規定値に一致する場合にだ
けウォッチドッグパルス出力ポートからウォッチドッグ
パルスを外部出力するCPUと、該CPUが外部出力す
るウォッチドッグパルスの周期を監視し、周期異常があ
れば前記CPUをリセットするウォッチドッグ回路とを
具備したことを特徴とする暴走監視機能付きCPU装
置。
2. A program in which a plurality of blocks are arranged in a processing order is executed, a flag is set each time the blocks are exhausted, and the total number of flags is compared with a prescribed value at the end of one round of processing, and the total number of flags is calculated. CPU that outputs a watchdog pulse externally from the watchdog pulse output port and the cycle of the watchdog pulse that is externally output by the CPU is monitored only when is equal to the specified value, and if there is a cycle abnormality, the CPU is reset. A CPU device with a runaway monitoring function, comprising a watchdog circuit.
JP13865894A 1994-06-21 1994-06-21 CPU device with runaway monitoring function Expired - Lifetime JP3163904B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP13865894A JP3163904B2 (en) 1994-06-21 1994-06-21 CPU device with runaway monitoring function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP13865894A JP3163904B2 (en) 1994-06-21 1994-06-21 CPU device with runaway monitoring function

Publications (2)

Publication Number Publication Date
JPH086822A true JPH086822A (en) 1996-01-12
JP3163904B2 JP3163904B2 (en) 2001-05-08

Family

ID=15227121

Family Applications (1)

Application Number Title Priority Date Filing Date
JP13865894A Expired - Lifetime JP3163904B2 (en) 1994-06-21 1994-06-21 CPU device with runaway monitoring function

Country Status (1)

Country Link
JP (1) JP3163904B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7496800B2 (en) 2005-06-06 2009-02-24 Denso Corporation Malfunction monitoring method and system
JP2009114932A (en) * 2007-11-06 2009-05-28 Keihin Corp Communication abnormality detection device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7496800B2 (en) 2005-06-06 2009-02-24 Denso Corporation Malfunction monitoring method and system
JP2009114932A (en) * 2007-11-06 2009-05-28 Keihin Corp Communication abnormality detection device

Also Published As

Publication number Publication date
JP3163904B2 (en) 2001-05-08

Similar Documents

Publication Publication Date Title
JPH0528063A (en) Microcomputer
JP2593915B2 (en) Double microcomputer system runaway prevention circuit
US8943303B2 (en) Monitoring circuit with a window watchdog
JPH086822A (en) Cpu device with runaway monitoring function
JPH06168163A (en) Method and device for monitoring cpu
JP3991782B2 (en) Electronic control unit
JP2001249154A (en) Disconnection detecting device for encoder and method for disconnection detection
JP2002091802A (en) Runaway monitoring device for electronic control system
JP2785847B2 (en) Load control device
JP5485823B2 (en) Inverter control circuit
US20030093725A1 (en) Method and circuit for monitoring microcomputer for onboard electronic control device
JPH0823326A (en) Clock fault detection circuit
JP2536789Y2 (en) Device for preventing malfunction of microcomputer system
JPH02252034A (en) Watchdog timer setting system
JPH04367944A (en) Method and device for detecting fault
JP3090069B2 (en) Control device
JPH0812656B2 (en) Microcomputer operation abnormality detection method
JP3396649B2 (en) Period monitoring circuit
JPS62125921A (en) Abnormality detecting device for crank angle sensor for engine
JP3308670B2 (en) Event-driven processing equipment failure detection device
KR20030066389A (en) Method and circuit arrangement for monitoring the operation of a processor
JP2004126731A (en) Abnormal operation monitoring circuit for cpu
JP2002351754A (en) Input noise discriminating method and its recording medium
JPH09237205A (en) Program runaway detection device
JPS60262252A (en) Monitor system for runaway of microprocessor

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20010130

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090302

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100302

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110302

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120302

Year of fee payment: 11

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130302

Year of fee payment: 12