JP2864663B2 - Watchdog timer - Google Patents

Watchdog timer

Info

Publication number
JP2864663B2
JP2864663B2 JP2131819A JP13181990A JP2864663B2 JP 2864663 B2 JP2864663 B2 JP 2864663B2 JP 2131819 A JP2131819 A JP 2131819A JP 13181990 A JP13181990 A JP 13181990A JP 2864663 B2 JP2864663 B2 JP 2864663B2
Authority
JP
Japan
Prior art keywords
timer
signal
watchdog timer
logical value
gate
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.)
Expired - Lifetime
Application number
JP2131819A
Other languages
Japanese (ja)
Other versions
JPH0425948A (en
Inventor
孝紀 中村
修 松嶋
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 Corp
Original Assignee
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 Nippon Electric Co Ltd filed Critical Nippon Electric Co Ltd
Priority to JP2131819A priority Critical patent/JP2864663B2/en
Publication of JPH0425948A publication Critical patent/JPH0425948A/en
Application granted granted Critical
Publication of JP2864663B2 publication Critical patent/JP2864663B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はウォッチドッグ・タイマに関し、特にマイク
ロコンピュータに内蔵されるウォッチドッグ・タイマに
関する。
Description: TECHNICAL FIELD The present invention relates to a watchdog timer, and more particularly to a watchdog timer built in a microcomputer.

〔従来の技術〕[Conventional technology]

従来の技術を図を参照して説明する。第3図は従来の
ウォッチドッグ・タイマのブロック図である。従来のウ
ォッチドッグ・タイマはタイマ301,ウォッチドッグ・タ
イマクリア信号WCLR,クロック信号CLK,ウォッチドッグ
・タイマ出力信号WDTOから構成される。
A conventional technique will be described with reference to the drawings. FIG. 3 is a block diagram of a conventional watchdog timer. The conventional watchdog timer includes a timer 301, a watchdog timer clear signal WCLR, a clock signal CLK, and a watchdog timer output signal WDTO.

ウォッチドッグ・タイマは通常マイクロコンピュータ
内のCPU(図中不図示)と接続されて使用される。CPUは
ウォッチドッグ・タイマクリア信号を発生する命令をデ
コードすると、ウォッチドッグ・タイマクリア信号WCLR
を論理値“1"にする。ウォッチドッグ・タイマクリア信
号WCLRはタイマ301に入力される。
The watchdog timer is usually used by being connected to a CPU (not shown) in the microcomputer. When the CPU decodes the instruction that generates the watchdog timer clear signal, the watchdog timer clear signal WCLR
To the logical value “1”. The watchdog timer clear signal WCLR is input to the timer 301.

タイマ301は周期Tのタイマであり、クロック信号CLK
の立上がりでインクリメントし、CPUからのタイマクリ
ア信号WCLRが論理値“1"のときリセットされる。タイマ
301がオーバーフローするとオーバーフロー信号OVFを論
理値“1"にする。
The timer 301 is a timer having a period T, and has a clock signal CLK.
Is incremented at the rising edge of, and reset when the timer clear signal WCLR from the CPU has the logical value "1". Timer
When 301 overflows, the overflow signal OVF is set to the logical value “1”.

オーバーフロー信号OVFがウォッチドッグ・タイマ出
力信号WDTOである。
The overflow signal OVF is the watchdog timer output signal WDTO.

次に従来の技術の動作を説明する。 Next, the operation of the conventional technique will be described.

CPUがウォッチドッグ・タイマクリア信号WCLRを発生
する命令をデコードすると、ウォッチドッグ・タイマク
リア信号WCLRが論理値“1"になり、タイマ301はリセッ
トされる。
When the CPU decodes the instruction that generates the watchdog timer clear signal WCLR, the watchdog timer clear signal WCLR becomes a logical value “1”, and the timer 301 is reset.

タイマ301の周期がTであるから、CPUが実行するプロ
グラム中にTより短い間隔でウォッチドッグ・タイマク
リア信号WCLRを発生する命令をあらかじめ入れることに
より、タイマ301はオーバーフローする前にクリアされ
るため、CPUが正常に動作している間は、タイマ301のオ
ーバーフロー信号OVFは論理値“1"になることはなく、
ウォッチドッグ・タイマ出力信号WDTOは論理値“1"にな
らない。
Since the cycle of the timer 301 is T, the timer 301 is cleared before overflowing by inserting an instruction to generate the watchdog timer clear signal WCLR at a shorter interval than T in the program executed by the CPU in advance. During the normal operation of the CPU, the overflow signal OVF of the timer 301 does not become the logical value “1”.
The watchdog timer output signal WDTO does not become the logical value “1”.

しかし、CPUに異常が発生し、ウォッチドッグ・タイ
マクリア信号WCLRを発生する命令をデコードできなくな
ると、タイマ301はクリアされずにオーバーフローし、
オーバーフロー信号OVFが論理値“1"になり、ウォッチ
ドッグ・タイマ出力信号WDTOが論理値“1"になる。ウォ
ッチドッグ・タイマ出力信号WDTOを外部に出力すること
により、CPUに異常が発生したことを認識し所定の対処
をすることができる。
However, if an error occurs in the CPU and the instruction that generates the watchdog timer clear signal WCLR cannot be decoded, the timer 301 overflows without being cleared.
The overflow signal OVF becomes a logical value “1”, and the watchdog timer output signal WDTO becomes a logical value “1”. By outputting the watchdog timer output signal WDTO to the outside, it is possible to recognize that an abnormality has occurred in the CPU and take a predetermined countermeasure.

〔発明が解決しようとする課題〕[Problems to be solved by the invention]

従来の技術では、ウォッチドッグ・タイマクリア信号
を発生する命令を含んだループにおちいってデッドロッ
クした場合や、ウォッチドッグ・タイマクリア信号が論
理値“1"に固定された場合に、異常を検出できないとい
う問題点がある。
Conventional technology detects an error when a deadlock occurs in a loop containing an instruction that generates a watchdog timer clear signal, or when the watchdog timer clear signal is fixed to a logical value of “1”. There is a problem that can not be.

〔課題を解決するための手段〕[Means for solving the problem]

本発明のウォッチドッグ・タイマは所定のクリア信号
によりクリアされ、所定のクロックを計数し、所定時間
経過するとオーバーフローする第1の計数手段と、所定
期間の経過を検出する時間経過検出手段と、前記時間経
過検出手段が検出する所定期間に前記第1の計数手段を
クリアするクリア信号を計数する第2の計数手段とを備
え、前記第1の計数手段のオーバーフローと前記第2の
計数手段が所定の数だけ計数したことを検出したことの
論理和により異常検出信号を発生することを特徴とす
る。
The watchdog timer of the present invention is cleared by a predetermined clear signal, counts a predetermined clock, overflows when a predetermined time elapses, time elapse detection means for detecting elapse of a predetermined time period, A second counting means for counting a clear signal for clearing the first counting means during a predetermined period detected by the time lapse detecting means, wherein the overflow of the first counting means and the second counting means The abnormality detection signal is generated by the logical sum of the detection of counting the number of times.

〔実施例〕〔Example〕

次に本発明について図面を参照して説明する。第1図
は本発明を用いたウォッチドッグタイマのブロック図で
ある。ウォッチドッグ・タイマはタイマ101,タイマ102,
カウンタ103,ORゲート104から構成される。
Next, the present invention will be described with reference to the drawings. FIG. 1 is a block diagram of a watchdog timer using the present invention. The watchdog timer is timer 101, timer 102,
It comprises a counter 103 and an OR gate 104.

タイマ101は周期T1のタイマであり、クロック信号CLK
の立上がりでインクリメントし、CPUからのウォッチド
ッグ・タイマクリア信号WCLRが論理値“1"になるとリセ
ットされ、オーバーフローすると、オーバーフロー信号
OVF1を論理値“1"にする。オーバーフロー信号CVF1はOR
ゲート104に入力される。
The timer 101 is a timer having a period T1 and has a clock signal CLK.
Increments at the rising edge of the clock, and is reset when the watchdog timer clear signal WCLR from the CPU reaches the logical value “1”.
Set OVF1 to logical value "1". Overflow signal CVF1 is OR
Input to the gate 104.

タイマ102は周期T2のタイマであり、クロック信号CLK
の立上がりでインクメントし、オーバーフローすると、
オーバーフロー信号OVF2を論理値“1"にする。オーバー
フロー信号OVF2はカウンター103に入力される。
The timer 102 is a timer having a period T2 and has a clock signal CLK.
Increment at the rise of
The overflow signal OVF2 is set to the logical value “1”. The overflow signal OVF2 is input to the counter 103.

カウンター103は4ビットのカウンタで、タイマ102か
らのオーバーフロー信号OVF2が論理値“1"になるとリセ
ットされ、CPUからのタイマクリア信号WCLRが論理値
“1"のときインクリメントし、値が16になるとキャリー
信号CYを論理値“1"にする。キャリー信号CYはORゲート
104に入力される。
The counter 103 is a 4-bit counter. The counter 103 is reset when the overflow signal OVF2 from the timer 102 becomes a logical value “1”, and is incremented when the timer clear signal WCLR from the CPU is a logical value “1”. Set carry signal CY to logical value “1”. Carry signal CY is OR gate
Entered in 104.

ORゲート104は2入力のORゲートであり、タイマ101の
オーバーフロー信号OVF1とカウンタ103のキャリー信号C
Yのいずれかが“1"であると、ウォッチドッグ・タイマ
出力信号WDTOを論理値“1"にする。
The OR gate 104 is a two-input OR gate, and includes an overflow signal OVF1 of the timer 101 and a carry signal C of the counter 103.
If any of Y is “1”, the watchdog timer output signal WDTO is set to the logical value “1”.

次に本発明の動作を説明する。 Next, the operation of the present invention will be described.

タイマ101の動作は従来の技術と同じであり、ウォッ
チドッグ・タイマクリア信号WCLRを発生する命令をデコ
ードできなくなると、タイマ101はクリアされず、オー
バーフロー信号OVF1が論理値“1"になり、ORゲート204
の出力信号WDTOが論理値“1"になる。
The operation of the timer 101 is the same as that of the conventional technology. If the instruction that generates the watchdog timer clear signal WCLR cannot be decoded, the timer 101 is not cleared, the overflow signal OVF1 becomes a logical value “1”, and the OR operation is performed. Gate 204
Output signal WDTO becomes a logical value "1".

カウンタ103は4ビットのカウンタで、タイマ102の周
期がT2であることから、T2の期間にウォッチドッグ・タ
イマクリア信号WCLRを発生する命令が16回以上デコード
されると、カウンタ103のキャリー信号CYが論理値“1"
となり、ウォッチドッグタイマ出力信号WDTOが論理値
“1"になる。これにより、ウォッチドッグ・タイマクリ
ア信号WCLRを発生する命令を含むループにプログラムが
デットロックした場合にも割込みを発生できる。
The counter 103 is a 4-bit counter. Since the cycle of the timer 102 is T2, when the instruction to generate the watchdog timer clear signal WCLR is decoded 16 times or more during the period of T2, the carry signal CY of the counter 103 is output. Is the logical value “1”
And the watchdog timer output signal WDTO becomes the logical value “1”. Thus, an interrupt can be generated even when the program is deadlocked in a loop including an instruction for generating the watchdog timer clear signal WCLR.

本発明の第2の実施例について説明する。第2図は本
発明の第2の実施例のブロック図である。
A second embodiment of the present invention will be described. FIG. 2 is a block diagram of a second embodiment of the present invention.

ウォッチドッグ・タイマはタイマ201,カウンタ203,OR
ゲート204,NORゲート205,ANDゲート206から構成され
る。
Watchdog timer is timer 201, counter 203, OR
It comprises a gate 204, a NOR gate 205, and an AND gate 206.

タイマ201は周期T1の8ビットのタイマであり、クロ
ック信号CLKの立上がりでインクリメントし、CPUからの
ウォッチドッグ・タイマクリア信号WCLRが論理値“1"に
なるとリセットされ、オーバーフローすると、オーバー
フロー信号OVFを論理値“1"にする。オーバーフロー信
号OVF1はORゲート204に入力され、タイマ201の出力の4
〜7ビットは4NORゲート205に入力される。
The timer 201 is an 8-bit timer having a period T1 and is incremented at the rising edge of the clock signal CLK. The timer 201 is reset when the watchdog timer clear signal WCLR from the CPU becomes a logical value “1”. Set to logical value “1”. The overflow signal OVF1 is input to the OR gate 204,
77 bits are input to the 4NOR gate 205.

NORゲート205は4入力のNORゲートであり、タイマ201
のデータの4〜7ビットを入力し、タイマ201のデータ
の4〜7ビットがすべて論理値“0"のとき、出力を論理
値“1"にする。NORゲート205の出力はANDゲート206に入
力される。
The NOR gate 205 is a 4-input NOR gate, and the timer 201
When the 4 to 7 bits of the data of the timer 201 are all logical values "0", the output is set to the logical value "1". The output of the NOR gate 205 is input to the AND gate 206.

ANDゲート206は2入力のANDゲートであり、ウォッチ
ドッグ・タイマクリア信号WCLRとNORゲート205の出力を
入力し、ウォッチドッグ・タイマクリア信号WCLRとNOR
ゲート205の出力がいずれも論理値“1"の時出力を論理
値“1"にする。ANDゲート203の出力はカウンタ203に入
力される。
The AND gate 206 is a two-input AND gate, which receives the watchdog timer clear signal WCLR and the output of the NOR gate 205 and receives the watchdog timer clear signal WCLR and NOR.
When the output of each of the gates 205 is a logical value “1”, the output is set to a logical value “1”. The output of the AND gate 203 is input to the counter 203.

カウンター203は4ビットのカウンタで、タイマ201の
データの第4ビットが論理値“1"になるとリセットさ
れ、ANDゲート206の出力が論理値“1"のときインクリメ
ントし、値が16になるとキャリー信号CYを論理値“1"に
する。キャリー信号CYはORゲート204に入力される。
The counter 203 is a 4-bit counter. The counter 203 is reset when the fourth bit of the data of the timer 201 becomes a logical value “1”, and is incremented when the output of the AND gate 206 is a logical value “1”. Set the signal CY to the logical value “1”. Carry signal CY is input to OR gate 204.

ORゲート204は2入力のORゲートであり、タイマ203の
オーバーフロー信号OVF1とカウンタ203のキャリー信号C
Yのいずれかが論理値“1"であると、ウォッチドッグ・
タイマ出力信号WDTOを“1"にする。
The OR gate 204 is a two-input OR gate, and includes an overflow signal OVF1 of the timer 203 and a carry signal C of the counter 203.
If any of Y is logic value “1”, the watchdog
Set the timer output signal WDTO to “1”.

次に本発明の動作を説明する。 Next, the operation of the present invention will be described.

タイマ201の動作は第1の実施例と同じであり、ウォ
ッチドッグ・タイマクリア信号WCLRを発生する命令をデ
コードできなくなると、タイマ201はクリアされず、オ
ーバーフロー信号OVF1が論理値“1"になり、ORゲート20
4の出力信号WDTOが論理値“1"になる。
The operation of the timer 201 is the same as that of the first embodiment. If the instruction for generating the watchdog timer clear signal WCLR cannot be decoded, the timer 201 is not cleared and the overflow signal OVF1 becomes a logical value "1". , OR gate 20
The output signal WDTO of 4 becomes the logical value “1”.

カウンタ103がインクリメントするのはANDゲート206
が論理値“1"の時である。ANDゲート206の出力が論理値
“1"になるのはNORゲート205の出力が論理値“1"の期間
にウォッチドッグ・タイマクリア信号WCLRを発生する命
令がデコードされた場合であり、カウンタ203はタイマ2
01のデータが“0000000"から“00001111"の期間にウォ
ッチドッグ・タイマクリア信号WCLRを発生する命令をデ
コードした数をカウントし、16回以上であればキャリー
信号CYを論理値“1"にする。タイマ201のデータが“000
1000"になるとカウンタ203はクリアされる。
The counter 103 increments by the AND gate 206
Is when the logical value is “1”. The output of the AND gate 206 becomes the logical value “1” when the instruction for generating the watchdog timer clear signal WCLR is decoded while the output of the NOR gate 205 is the logical value “1”. Is timer 2
Counts the number of decoded instructions that generate the watchdog timer clear signal WCLR during the period from "0000000" to "00001111" of the 01 data. . Timer 201 data is “000
When the count reaches "1000", the counter 203 is cleared.

本実施例はタイマを1つしか使用しないため回路を小
型にすることができる。
In this embodiment, since only one timer is used, the size of the circuit can be reduced.

〔発明の効果〕〔The invention's effect〕

以上説明したように、本発明によりウォッチドッグ・
タイマクリア信号を発生する命令がデコードされない場
合だけでなく、ウォッチドッグ・タイマクリア命令をデ
コードし続けた場合にも割込みを発生することができる
ようになり、CPUの異常を早期に発見することができる
ことから安全なシステムの構築が可能となる。
As described above, according to the present invention, the watch dog
An interrupt can be generated not only when the instruction that generates the timer clear signal is not decoded, but also when the watchdog timer clear instruction is continuously decoded, enabling early detection of CPU errors. Because it can be done, it is possible to build a safe system.

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

第1図は本発明の第1の実施例のブロック図、第2図は
本発明の第2の実施例のブロック図、第3図は従来の技
術のブロック図である。 101,102,201,301……タイマ、103,203……カウンタ、10
4,204……ORゲート、205……NORゲート、206……ANDゲ
ート、CLK……クロック信号、WCLR……ウォッチドッグ
・タイマクリア信号、OVF,OVF1,OVF2……オーバーフロ
ー信号、CY……キャリー信号、WDTO……ウォッチドッグ
・タイマ出力信号。
FIG. 1 is a block diagram of a first embodiment of the present invention, FIG. 2 is a block diagram of a second embodiment of the present invention, and FIG. 3 is a block diagram of a conventional technique. 101, 102, 201, 301 ... Timer, 103, 203 ... Counter, 10
4,204: OR gate, 205: NOR gate, 206: AND gate, CLK: Clock signal, WCLR: Watchdog timer clear signal, OVF, OVF1, OVF2: Overflow signal, CY: Carry signal WDTO: Watchdog timer output signal.

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】所定のクリア信号によりクリアされ、所定
のクロックを計数し、所定時間経過するとオーバーフロ
ーする第1の計数手段と、所定期間の経過を検出する時
間経過検出手段と、前記時間経過検出手段が検出する所
定期間に前記第1の計数手段をクリアするクリア信号を
計数する第2の計数手段とを備え、前記第1の計数手段
のオーバーフローと前記第2の計数手段が所定の数だけ
計数したことを検出したことの論理和により異常検出信
号を発生するウォッチドッグ・タイマ。
1. A first counting means which is cleared by a predetermined clear signal, counts a predetermined clock, and overflows when a predetermined time elapses, a time elapse detecting means for detecting elapse of a predetermined period, and the time elapse detection A second counting means for counting a clear signal for clearing the first counting means during a predetermined period detected by the means, wherein the overflow of the first counting means and the second counting means are performed by a predetermined number. A watchdog timer that generates an abnormality detection signal based on the logical sum of detection of counting.
JP2131819A 1990-05-22 1990-05-22 Watchdog timer Expired - Lifetime JP2864663B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2131819A JP2864663B2 (en) 1990-05-22 1990-05-22 Watchdog timer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2131819A JP2864663B2 (en) 1990-05-22 1990-05-22 Watchdog timer

Publications (2)

Publication Number Publication Date
JPH0425948A JPH0425948A (en) 1992-01-29
JP2864663B2 true JP2864663B2 (en) 1999-03-03

Family

ID=15066844

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2131819A Expired - Lifetime JP2864663B2 (en) 1990-05-22 1990-05-22 Watchdog timer

Country Status (1)

Country Link
JP (1) JP2864663B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE1277666B (en) * 1966-01-18 1968-09-12 Elbe Kamera Gmbh Device for electromagnetic lock control
WO2008026283A1 (en) * 2006-08-31 2008-03-06 Fujitsu Limited Clock monitoring circuit, information processing apparatus and clock monitoring method
CN111309508B (en) * 2020-02-18 2023-06-13 西安微电子技术研究所 Embedded type satellite-borne computer watchdog circuit and working method thereof

Also Published As

Publication number Publication date
JPH0425948A (en) 1992-01-29

Similar Documents

Publication Publication Date Title
US5748948A (en) Reset signal generator
JPH0795291B2 (en) Watchdog timer
JPH0346854B2 (en)
JP2001184234A (en) Watch dog timer
JP2864663B2 (en) Watchdog timer
JP3764560B2 (en) Digital delay circuit and digital PLL circuit
US7467178B2 (en) Dual mode arithmetic saturation processing
KR100328825B1 (en) Error prevention circuit
JP2516711B2 (en) Watchdog timer device
JP2734243B2 (en) Watchdog timer
JP2001005695A (en) Watchdog timer
JP2693885B2 (en) Microcomputer
US6670823B2 (en) Detecting counter contents for time-critical applications
JP2830522B2 (en) Watchdog timer
JPH05151027A (en) Watch dog timer
SU1239857A1 (en) Counting device with check
JPH0586570B2 (en)
JPH0444123A (en) Method and circuit for detection of undefined instruction in microprocessor
SU1094031A1 (en) Square-low function generator
KR0161383B1 (en) Index period detecting apparatus in a floppy disc driver controller
JPS5911424A (en) Processing circuit of interruption signal
SU822359A1 (en) Sensory switching device
JP2680299B2 (en) Reset circuit for synchronous counter
JPH0346853B2 (en)
JPH03110638A (en) Watchdog timer