JPH0973404A - Watchdog timer circuit - Google Patents

Watchdog timer circuit

Info

Publication number
JPH0973404A
JPH0973404A JP7230363A JP23036395A JPH0973404A JP H0973404 A JPH0973404 A JP H0973404A JP 7230363 A JP7230363 A JP 7230363A JP 23036395 A JP23036395 A JP 23036395A JP H0973404 A JPH0973404 A JP H0973404A
Authority
JP
Japan
Prior art keywords
circuit
reset
program
signal
cpu
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.)
Pending
Application number
JP7230363A
Other languages
Japanese (ja)
Inventor
Hisaharu Tsuzuki
久治 都築
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.)
Marelli Corp
Original Assignee
Kansei Corp
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 Kansei Corp filed Critical Kansei Corp
Priority to JP7230363A priority Critical patent/JPH0973404A/en
Publication of JPH0973404A publication Critical patent/JPH0973404A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a watchdog timer circuit which securely puts program operation back in its normal state by entirely stopping the circuit operation of a microcomputer circuit itself and retrying it if the program runs away. SOLUTION: This circuit has a cyclic pulse monitor circuit which inputs cyclic pulses generated as a program on a CPU 2 operates normally, judges whether or not the program runs away from whether or not the cyclic pulses have periodicity, and outputs a reset trigger signal when judging that the program runs away, a program resetting means which receives the reset trigger signal from the cyclic pulse monitor circuit and outputs a reset signal stopping at least the program operation to the reset terminal of the CPU 2 at least once, and an oscillation circuit reset means which supplies a reset signal to the stand by terminal of the CPU 2 for a time longer than the effective time of the reset signal in synchronism with the reset signal from the program resetting means.

Description

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

【0001】[0001]

【発明の属する技術分野】この発明は、マイクロコンピ
ュータ(CPU)がプログラム暴走したときに正常に戻
すために用いられるウオッチドッグタイマ回路に関す
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a watchdog timer circuit used to return a microcomputer (CPU) to a normal state when a program runs out of control.

【0002】[0002]

【従来の技術】従来のこの種のウオッチドッグタイマ回
路を図3に示すマイクロコンピュータ回路に基づいて説
明する。すなわち、同図において、マイクロコンピュー
タ2は、STBY端子に例えばハイレベル信号が供給さ
れると、入力ポートPINに供給される信号を、発振回路
1から供給されるクロックパルスに基づいて作動するプ
ログラムで加工して制御信号等を作成し、出力ポートP
OUT から出力する。またマイクロコンピュータ2は、前
記プログラム作動が正常に行われているときにはP1端
子から、前記クロックパルスが分周されて作成されたP
−RUN信号をウオッチドッグタイマ回路3に出力す
る。
2. Description of the Related Art A conventional watchdog timer circuit of this type will be described with reference to a microcomputer circuit shown in FIG. That is, in FIG. 1, when the STBY terminal is supplied with, for example, a high-level signal, the microcomputer 2 changes the signal supplied to the input port PIN by a program that operates based on the clock pulse supplied from the oscillation circuit 1. Process and create control signals, etc., and output port P
Output from OUT. Further, the microcomputer 2 generates the P pulse generated by dividing the frequency of the clock pulse from the P1 terminal when the program operation is normally performed.
-The RUN signal is output to the watchdog timer circuit 3.

【0003】ウオッチドッグタイマ回路3は、エッジ検
出・ワンショット出力回路12、積分回路4、比較回路
5、第1タイマ回路6から構成され、マイクロコンピュ
ータ2のP−RUN端子から供給されるパルス信号をエ
ッジ検出・ワンショット出力回路12でエッジ検出し、
ワンショット出力後、積分回路4で積分し(ここでは周
波数/電圧変換に相当するもの)、その積分値を比較回
路5で基準値と比較して、積分値が基準値より低い場合
にはマイクロコンピュータ2がプログラム暴走している
と判断して比較回路5から第1タイマ回路6にリセット
トリガ信号を供給する。第1タイマ回路6は、比較回路
5からリセットトリガ信号が供給される毎に一定時間の
間出力をローレベル状態にして、マイクロコンピュータ
2のリセット端子RSTにリセット信号を供給し、マイ
クロコンピュータ2のプログラム作動を初期状態に戻
す。なお、前記積分回路4と比較回路5とによって暴走
検出回路が形成され、マイクロコンピュータ2がプログ
ラム暴走しているか否かを判断している。また、前記比
較回路5の出力は、積分回路4の積分出力が基準値を下
回ったとき、1回のみではなく周期的に複数回ローレベ
ル状態に切り替わる構成になっている。
The watchdog timer circuit 3 comprises an edge detection / one-shot output circuit 12, an integrating circuit 4, a comparing circuit 5, and a first timer circuit 6, and a pulse signal supplied from the P-RUN terminal of the microcomputer 2. Edge is detected by the edge detection / one-shot output circuit 12,
After one-shot output, the integration circuit 4 performs integration (corresponding to frequency / voltage conversion here), and the integrated value is compared with a reference value by a comparison circuit 5, and if the integrated value is lower than the reference value, a micro The comparison circuit 5 supplies a reset trigger signal to the first timer circuit 6 upon determining that the computer 2 is running out of program. The first timer circuit 6 sets the output to the low level for a certain period of time each time the reset trigger signal is supplied from the comparison circuit 5, and supplies the reset signal to the reset terminal RST of the microcomputer 2 to cause the microcomputer 2 to operate. Reset the program operation to the initial state. A runaway detection circuit is formed by the integration circuit 4 and the comparison circuit 5 to determine whether or not the microcomputer 2 is running out of program. Further, the output of the comparison circuit 5 is configured to switch to the low level state not only once but periodically a plurality of times when the integrated output of the integrating circuit 4 falls below the reference value.

【0004】[0004]

【発明が解決しようとする課題】しかしながら、上述し
たマイクロコンピュータ回路にあっては、マイクロコン
ピュータ2がプログラム暴走したときにはウオッチドッ
グタイマ回路3からのリセット信号に基づいてプログラ
ムを初期状態に戻して正常動作させるようにしていたの
で、プログラム動作の作動タイミングを決めているクロ
ックパルスが異常である場合には何度リセット信号をマ
イクロコンピュータ2に供給しても正常動作には戻らな
いという問題点があった。
However, in the above-mentioned microcomputer circuit, when the microcomputer 2 runs out of program, the program is returned to the initial state based on the reset signal from the watchdog timer circuit 3 and operates normally. Therefore, when the clock pulse that determines the operation timing of the program operation is abnormal, there is a problem that the reset operation is not returned to the normal operation no matter how many times it is supplied to the microcomputer 2. .

【0005】そこで、この発明は、上記のような問題点
に着目してなされたもので、プログラム暴走時にはマイ
クロコンピュータ回路そのものの回路動作を全面的に停
止して再度やり直すことによって確実にプログラム動作
を正常に戻すウオッチドックタイマ回路を得ることを目
的とする。
Therefore, the present invention has been made by paying attention to the above problems, and when the program goes out of control, the circuit operation of the microcomputer circuit itself is completely stopped and the program operation is surely performed again. The purpose is to obtain a watchdog timer circuit that returns to normal.

【0006】[0006]

【課題を解決するための手段】この発明に係るウオッチ
ドッグタイマ回路は、CPUのプログラムの正常動作に
伴って作成される周期パルスを入力して、その周期パル
スが周期性を有するか否かによってプログラム暴走を判
断し、プログラム暴走と判断した場合にリセットトリガ
信号を出力する周期パルス監視回路と、該周期パルス監
視回路からのリセットトリガ信号を受けて少なくてもプ
ログラム動作を停止させるリセット信号を1回、前記C
PUのリセット端子に供給するプログラムリセット手段
と、該プログラムリセット手段からのリセット信号に同
期し、かつそのリセット信号の有効時間よりも長い間、
前記CPUのスタンバイ端子にリセット信号を供給する
発振回路リセット手段とを有する。
A watchdog timer circuit according to the present invention inputs a periodic pulse created in accordance with a normal operation of a program of a CPU, and determines whether the periodic pulse has periodicity or not. A periodic pulse monitoring circuit that determines a program runaway and outputs a reset trigger signal when a program runaway is determined, and a reset signal that receives a reset trigger signal from the periodic pulse monitoring circuit and stops the program operation at least Times, said C
Program reset means supplied to the reset terminal of the PU and a reset signal from the program reset means, and for a period longer than the effective time of the reset signal,
And an oscillating circuit resetting means for supplying a reset signal to the standby terminal of the CPU.

【0007】[0007]

【発明の実施の形態】この発明による実施の形態の構成
を図1に示すが、それらの図において図3の従来例で説
明したものとウオッチドッグタイマ回路11が異なり、
他の構成部分は図3に示したものと同一のもの、または
均等なものであるので同一符号を付して、その詳細説明
を省略する。
FIG. 1 shows the configuration of an embodiment according to the present invention. In these figures, the watchdog timer circuit 11 is different from that described in the conventional example of FIG.
The other components are the same as or equivalent to those shown in FIG. 3, and therefore, the same reference numerals are given and detailed description thereof is omitted.

【0008】すなわち、ウオッチドッグタイマ回路11
は、エッジ検出・ワンショット出力回路12、積分回路
4、比較回路5、第1タイマ回路6、立下りエッジ検出
回路7、カウンタ回路8、遅延回路9及び第2タイマ回
路10等から構成され、立下りエッジ検出回路7は、前
記比較回路5から出力されるリセットトリガ信号の立下
りエッジを検出して(図2(C)参照)、カウンタ回路
8でその検出回数を1から5までカウントし、計数値が
1になったら出力をハイレベルにし、5になったら即座
に計数値を0にリセットして、出力をローレベル状態に
する(図2(D)参照)。
That is, the watchdog timer circuit 11
Is composed of an edge detection / one-shot output circuit 12, an integration circuit 4, a comparison circuit 5, a first timer circuit 6, a falling edge detection circuit 7, a counter circuit 8, a delay circuit 9, a second timer circuit 10, and the like, The falling edge detection circuit 7 detects the falling edge of the reset trigger signal output from the comparison circuit 5 (see FIG. 2C), and the counter circuit 8 counts the number of detection times from 1 to 5. When the count value becomes 1, the output is set to the high level, and when it becomes 5, the count value is immediately reset to 0 and the output is set to the low level state (see FIG. 2D).

【0009】遅延回路9は前記カウンタ8の出力の変化
を遅延させて出力する。すなわち、図2Fに示すように
カウンタ回路8の出力がローレベルに変化するとその変
化をt3時間遅延せしめて所定時間のみ出力をローレベ
ルにして、その後ハイレベルに変化させる。
The delay circuit 9 delays the change in the output of the counter 8 and outputs it. That is, as shown in FIG. 2F, when the output of the counter circuit 8 changes to the low level, the change is delayed for t3 time, the output is changed to the low level only for a predetermined time, and then changed to the high level.

【0010】第2タイマ回路10は、前記遅延回路9か
ら出力される信号(図2(F))の立ち下がりエッジを
基準として、その立ち下がりエッジ検出直後の所定時間
t2(>t3)の間出力をローレベル状態に維持して、
その後ハイレベルに切り換える。この第2タイマ回路1
0からの出力信号は、マイクロコンピュータ2のSTB
Y端子に供給されることによって、マイクロコンピュー
タ2は発振回路1の動作を停止させると共に、第1タイ
マ回路6にも供給されて、第1タイマ回路6のタイマ時
間をt0からt1(>t2)に延長して作動させる(図
2(H)参照)。
The second timer circuit 10 uses the falling edge of the signal (FIG. 2 (F)) output from the delay circuit 9 as a reference for a predetermined time t2 (> t3) immediately after the detection of the falling edge. Keep the output low level,
Then switch to high level. This second timer circuit 1
The output signal from 0 is the STB of the microcomputer 2.
By being supplied to the Y terminal, the microcomputer 2 stops the operation of the oscillation circuit 1 and is also supplied to the first timer circuit 6 to change the timer time of the first timer circuit 6 from t0 to t1 (> t2). And operate it (see FIG. 2 (H)).

【0011】なお、上記実施の形態では、第2タイマ回
路10からの出力信号に基づいてSTBY端子にローレ
ベル信号を供給したが、同一信号を用いてマイクロコン
ピュータ2及び発振回路1の電源を遮断しても良いこと
は言うまでもないことである。
In the above embodiment, the low level signal is supplied to the STBY terminal based on the output signal from the second timer circuit 10. However, the power supply to the microcomputer 2 and the oscillation circuit 1 is cut off using the same signal. It goes without saying that you can do it.

【0012】次に上記構成の作用説明を行う。電源が投
入されてマイクロコンピュータ2が発振回路1からのク
ロックパルス信号に基づいて動作すると(図2(A)の
区間T0の間)、その間マイクロコンピュータ2の端子
P1からP−RUN信号がエッジ検出・ワンショット出
力回路12を通して積分回路4に供給されるが、正規の
パルス信号であるので、積分結果(図2(B))は比較
回路5の基準値を上回っているので比較回路5の出力は
常にローレベルに維持され、マイクロコンピュータ2は
リセットされることはない。
Next, the operation of the above configuration will be described. When the power is turned on and the microcomputer 2 operates based on the clock pulse signal from the oscillation circuit 1 (during the period T0 in FIG. 2A), the P-RUN signal is detected from the terminal P1 of the microcomputer 2 during this period. The signal is supplied to the integrating circuit 4 through the one-shot output circuit 12, but since it is a normal pulse signal, the integration result (FIG. 2B) exceeds the reference value of the comparing circuit 5, so the output of the comparing circuit 5 is output. Is always kept at a low level, and the microcomputer 2 is never reset.

【0013】次に、マイクロコンピュータ2がプログラ
ム暴走を開始すると(図2(A)区間T1の間)、マイ
クロコンピュータ2の端子P1から出力されるP−RU
N信号がローレベルまたはハイレベルに維持され、パル
スでなくなるので積分回路4で周波数/電圧変換され
ず、出力は低下を開始して、比較回路5の基準値を下回
ると、リセットトリガ信号が第1タイマ回路6と、立下
りエッジ検出回路7に供給され、第1タイマ回路6は4
回目のリセットパルスまでは比較回路5からの出力と同
一状態になるが、5回目は図2(H)に示すように、第
2タイマ回路10からマイクロコンピュータ2のSTB
Y端子にリセット信号が供給されている時間t2より長
く、リセット信号が維持され、時間t1までの間延長さ
れる。すなわち、発振回路1が正常発振状態になってか
らプログラムを動作(リセット解除)させるようになっ
ている。
Next, when the microcomputer 2 starts program runaway (during section T1 in FIG. 2A), the P-RU output from the terminal P1 of the microcomputer 2 is output.
Since the N signal is maintained at the low level or the high level and is no longer a pulse, the frequency / voltage conversion is not performed in the integrating circuit 4, and the output starts decreasing, and when the output falls below the reference value of the comparing circuit 5, the reset trigger signal becomes 1 timer circuit 6 and the falling edge detection circuit 7, and the first timer circuit 6 outputs 4
Until the reset pulse for the first time, the output from the comparison circuit 5 is in the same state, but for the fifth time, as shown in FIG.
The reset signal is maintained longer than the time t2 during which the reset signal is supplied to the Y terminal, and is extended until time t1. That is, the program is operated (reset is released) after the oscillation circuit 1 is in the normal oscillation state.

【0014】すなわち、カウンタ8では比較回路5から
出力されるリセットトリガ信号の立ち下がりエッジの出
現回数を計数して、5回目を検出したとき、そのタイミ
ングを遅延回路9を用いて、t3時間遅延させる。その
t3時間の遅延の後に第2タイマ回路10からマイクロ
コンピュータ2のSTBY端子に発振回路1の発振動作
を停止させる信号をt2時間供給すると共に、第1タイ
マ回路6から出力される5回目のリセット信号の発生時
間をt1時間まで延長させる。
That is, the counter 8 counts the number of appearances of the falling edge of the reset trigger signal output from the comparison circuit 5, and when the fifth time is detected, the timing is delayed by the delay circuit 9 by t3 time. Let After the delay of t3 time, a signal for stopping the oscillation operation of the oscillation circuit 1 is supplied from the second timer circuit 10 to the STBY terminal of the microcomputer 2 for t2 time, and at the same time, the fifth reset is output from the first timer circuit 6. The signal generation time is extended to t1 hours.

【0015】[0015]

【発明の効果】以上説明したように、この発明よれば、
マイクロコンピュータのプログラム動作をリセットする
と共に、クロックパルスを作成する発振回路の動作もリ
セットするので、何らかの原因で発振周波数がずれた
り、停止したりしていても再スタートすることによって
マイクロコンピュータ回路の動作を確実に正常動作に戻
すことができるという効果が得られる。
As described above, according to the present invention,
The operation of the microcomputer circuit is reset by resetting the program operation of the microcomputer and also the operation of the oscillator circuit that creates the clock pulse, so even if the oscillation frequency shifts or stops for some reason, it restarts. It is possible to obtain the effect of reliably returning to normal operation.

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

【図1】本発明の実施の形態を説明するためのマイクロ
コンピュータ回路の回路ブロック説明図である。
FIG. 1 is a circuit block explanatory diagram of a microcomputer circuit for explaining an embodiment of the present invention.

【図2】図1におけるウオッチドッグタイマ回路の動作
を説明するためのタイミングチャートである。
FIG. 2 is a timing chart for explaining the operation of the watchdog timer circuit in FIG.

【図3】従来のマイクロコンピュータ回路に用いられて
いるウオッチドッグタイマ回路の回路ブロック説明図で
ある。
FIG. 3 is a circuit block diagram of a watchdog timer circuit used in a conventional microcomputer circuit.

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

1 発振回路 2 マイクロコンピュータ 3、11 ウオッチドッグタイマ回路 4 積分回路 5 比較回路 6、10 タイマ回路 7 立下りエッジ検出回路 8 カウンタ回路 9 遅延回路 12 エッジ検出・ワンショット出力回路 1 Oscillation circuit 2 Microcomputer 3, 11 Watchdog timer circuit 4 Integration circuit 5 Comparison circuit 6, 10 Timer circuit 7 Falling edge detection circuit 8 Counter circuit 9 Delay circuit 12 Edge detection / one-shot output circuit

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 CPU(2)のプログラムの正常動作に
伴って作成される周期パルスを入力して、その周期パル
スが周期性を有するか否かによってプログラム暴走を判
断し、プログラム暴走と判断した場合にリセットトリガ
信号を出力する周期パルス監視回路(4、5)と、該周
期パルス監視回路からのリセットトリガ信号を受けて少
なくともプログラム動作を停止させるリセット信号を1
回、前記CPUのリセット端子に供給するプログラムリ
セット手段と、該プログラムリセット手段からのリセッ
ト信号に同期し、かつそのリセット信号の有効時間より
も長い間、前記CPUのスタンバイ端子にリセット信号
を供給する発振回路リセット手段(7、8、9、10)
とを有することを特徴とするウオッチドッグタイマ回
路。
1. A program runaway is determined by inputting a periodic pulse created in accordance with a normal operation of a program of a CPU (2) and determining whether the periodic pulse has periodicity or not. In this case, a periodic pulse monitoring circuit (4, 5) that outputs a reset trigger signal, and at least a reset signal that receives the reset trigger signal from the periodic pulse monitoring circuit and stops the program operation
The reset signal is supplied to the reset terminal of the CPU, and the reset signal is supplied to the standby terminal of the CPU in synchronization with the reset signal from the program reset means and for a period longer than the valid time of the reset signal. Oscillation circuit reset means (7, 8, 9, 10)
And a watchdog timer circuit.
JP7230363A 1995-09-07 1995-09-07 Watchdog timer circuit Pending JPH0973404A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7230363A JPH0973404A (en) 1995-09-07 1995-09-07 Watchdog timer circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7230363A JPH0973404A (en) 1995-09-07 1995-09-07 Watchdog timer circuit

Publications (1)

Publication Number Publication Date
JPH0973404A true JPH0973404A (en) 1997-03-18

Family

ID=16906692

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7230363A Pending JPH0973404A (en) 1995-09-07 1995-09-07 Watchdog timer circuit

Country Status (1)

Country Link
JP (1) JPH0973404A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6343334B1 (en) 1998-10-20 2002-01-29 Mitsubishi Electric System Lsi Design Corporation Detector of an oscillation stopping and an apparatus for executing a treatment after the detection of an oscillation stopping
KR20180044845A (en) * 2016-09-21 2018-05-03 선전 구딕스 테크놀로지 컴퍼니, 리미티드 Resetting method for single chip computer system and single chip computer system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6343334B1 (en) 1998-10-20 2002-01-29 Mitsubishi Electric System Lsi Design Corporation Detector of an oscillation stopping and an apparatus for executing a treatment after the detection of an oscillation stopping
KR20180044845A (en) * 2016-09-21 2018-05-03 선전 구딕스 테크놀로지 컴퍼니, 리미티드 Resetting method for single chip computer system and single chip computer system
US11016548B2 (en) 2016-09-21 2021-05-25 Shenzhen GOODIX Technology Co., Ltd. Single chip system and reset method for single chip system

Similar Documents

Publication Publication Date Title
US5550489A (en) Secondary clock source for low power, fast response clocking
US20160335149A1 (en) Peripheral Watchdog Timer
US6943590B2 (en) Clock monitoring apparatus
US6754836B2 (en) Microcomputer capable of switching between low current consumption mode and normal operation mode
JPH0973404A (en) Watchdog timer circuit
JPH0844594A (en) Data processor
US7038506B2 (en) Automatic selection of an on-chip ancillary internal clock generator upon resetting a digital system
US6061803A (en) Variable frequency clock for an electronic system and method therefor
JPH07334392A (en) Resetting device and abnormal operation detector
US6496078B1 (en) Activating on-chip oscillator using ring oscillator
JP3314791B2 (en) Synchronization method for multiprocessor systems
JP3137025B2 (en) Runaway detection method for data processing system
JPH0720963A (en) Operation control circuit for clock oscillator
JP2000035903A (en) Runaway monitoring device for microcomputer
JPH076155A (en) Single chip microcomputer
JP3144811B2 (en) Monitoring timer circuit
JP2698260B2 (en) Watchdog timer device
KR0148528B1 (en) Microcontroller
JPH07235831A (en) Frequency abnormality detection circuit
JPH08305664A (en) Method and device for cpu monitoring
CN114696809A (en) Signal generation circuit and operating system
JPH0922403A (en) Integrated circuit having reset control function
JPH0883134A (en) Microcomputer
JPH08263177A (en) Method and circuit for resetting cpu
JPS63123138A (en) Detection circuit for out-of-control of microcomputer