JP2005346359A - Timer circuit and microcomputer - Google Patents
Timer circuit and microcomputer Download PDFInfo
- Publication number
- JP2005346359A JP2005346359A JP2004164602A JP2004164602A JP2005346359A JP 2005346359 A JP2005346359 A JP 2005346359A JP 2004164602 A JP2004164602 A JP 2004164602A JP 2004164602 A JP2004164602 A JP 2004164602A JP 2005346359 A JP2005346359 A JP 2005346359A
- Authority
- JP
- Japan
- Prior art keywords
- microcomputer
- circuit
- cpu
- timer
- arithmetic processing
- 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
Links
Images
Abstract
Description
本発明は、タイマ回路、及びマイクロコンピュータに関し、特に、ウォッチドッグタイマ、及びこのウォッチドッグタイマを備えたマイクロコンピュータに関する。 The present invention relates to a timer circuit and a microcomputer, and more particularly to a watchdog timer and a microcomputer provided with the watchdog timer.
従来のウォッチドッグタイマは、マイクロコンピュータが正常に動作しているか否かをチェックし、異常動作を検出した場合に割り込み動作かリセット動作のうち何れかを選択する(例えば、特許文献1参照。)。 A conventional watchdog timer checks whether the microcomputer is operating normally, and selects an interrupt operation or a reset operation when an abnormal operation is detected (see, for example, Patent Document 1). .
ウォッチドッグタイマは、ウォッチドッグタイマのカウンタが、設定時間内にCPUによりカウンタクリアされなかった際(以下「タイムアウト」という)に、動作選択回路によって、割り込み動作かリセット動作のうち何れかを選択する。
しかし、従来のウォッチドッグタイマでは、動作選択回路が割り込み動作を選択した後にタイムアウトが連続した場合、割り込みルーチンが正常に実行されてないことが想定される。この場合、CPUにおいて必要な初期化や設定等が実行されず、マイクロコンピュータの動作のみならず、このマイクロコンピュータに接続されている他の回路にも悪影響を及ぼす恐れがあった。また、動作選択回路がリセット動作を選択した場合でも、CPUの暴走等によって割り込み動作に書き換えられてしまったときには、タイムアウトによるリセット動作が行えない。 However, in the conventional watchdog timer, when the timeout continues after the operation selection circuit selects the interrupt operation, it is assumed that the interrupt routine is not normally executed. In this case, necessary initialization and setting are not executed in the CPU, and there is a possibility that not only the operation of the microcomputer but also other circuits connected to the microcomputer may be adversely affected. Even when the operation selection circuit selects the reset operation, if the operation is rewritten to an interrupt operation due to a runaway of the CPU, the reset operation due to timeout cannot be performed.
そこで、上記問題に鑑み、本発明は、タイムアウトが連続して起こった場合に、強制的に演算処理装置のリセット動作を行い、マイクロコンピュータの初期化を行うことが可能なタイマ回路、及びマイクロコンピュータを提供することを目的とする。 Accordingly, in view of the above problems, the present invention provides a timer circuit capable of forcibly resetting an arithmetic processing unit and initializing a microcomputer when a timeout occurs continuously, and the microcomputer The purpose is to provide.
本発明の第1の特徴は、演算処理装置により初期化されずタイムアウトした場合にタイムアウト信号を出力するウォッチドッグタイマと、タイムアウト信号の出力回数をカウントし、カウント数が一定値に達した場合に、演算処理装置をリセットさせるリセット信号を出力する判定回路とを備えるタイマ回路であることを要旨とする。 The first feature of the present invention is that a watchdog timer that outputs a time-out signal when a time-out occurs without being initialized by the arithmetic processing unit, and the number of times the time-out signal is output is counted, and the count number reaches a certain value. The gist of the invention is that the timer circuit includes a determination circuit that outputs a reset signal for resetting the arithmetic processing unit.
本発明の第2の特徴は、演算処理装置と、演算処理装置により初期化されずタイムアウトした場合にタイムアウト信号を出力するウォッチドッグタイマと、タイムアウト信号の出力回数をカウントし、カウント数が一定値に達した場合に、演算処理装置をリセットさせるリセット信号を出力する判定回路とを備えるマイクロコンピュータであることを要旨とする。 The second feature of the present invention is that an arithmetic processing unit, a watchdog timer that outputs a time-out signal when a time-out occurs without being initialized by the arithmetic processing unit, and counts the number of times the time-out signal is output, When it reaches the above, the gist is that the microcomputer includes a determination circuit that outputs a reset signal for resetting the arithmetic processing unit.
本発明に係るタイマ回路、及びマイクロコンピュータによれば、演算処理装置を強制的にリセットすることにより、CPUの割り込みルーチンが正常に実行されてない場合、又はCPUのリセット動作が割り込み動作に書き換えられてしまった場合でも、マイクロコンピュータ及びマイクロコンピュータに接続されている他の回路の動作を回復させることができる。 According to the timer circuit and the microcomputer of the present invention, by forcibly resetting the arithmetic processing unit, the CPU interrupt routine is not executed normally, or the CPU reset operation is rewritten to the interrupt operation. Even in the case of failure, the operation of the microcomputer and other circuits connected to the microcomputer can be recovered.
(第1の実施の形態)
図1に示すように、本発明の第1の実施の形態に係る第1のマイクロコンピュータ50は、演算処理装置であるCPU1、タイマ回路30を備える。タイマ回路30は、ウォッチドッグタイマ2、判定回路3、動作選択回路4、ORゲート9を備える。CPU1は、配線54を介して外部とデータの入出力を行う。ウォッチドッグタイマ2及び判定回路3は、カウンタにより構成されている。CPU1とウォッチドッグタイマ2は、配線5で接続されている。CPU1と判定回路3は、配線6で接続されている。CPU1とORゲート9の入力端は、配線11で接続されている。CPU1と動作選択回路4は、配線12及び配線13で接続されている。ウォッチドッグタイマ2と判定回路3は、配線7で接続されている。ウォッチドッグタイマ2と動作選択回路4は、配線8で接続されている。ウォッチドッグタイマ2と発信回路16は、配線15で接続されている。判定回路3とORゲート9の入力端は、配線10で接続されている。ORゲート9の出力端と動作選択回路4は、配線14で接続されている。動作選択回路4は、ウォッチドッグタイマ2から配線8を介してタイムアウト信号TOが入力されたとき、CPU1へ割り込み信号INTかリセット信号RSTのうち何れかを出力する。判定回路3又はCPU1からリセット信号RSTが入力された場合は、動作選択回路4は、リセット信号RSTをCPU1へ出力する。リセット信号RSTが入力されない場合は、動作選択回路4は、割り込み信号INTをCPU1へ出力する。「リセット信号RST」とは、演算処理装置をリセットさせる信号をいう。「割り込み信号INT」とは、演算処理装置に割り込み処理をさせる信号をいう。図示していないが、マイクロコンピュータ50には、CPU1等の他、ROMやRAM等のメモリ、入出力ポート、通信ポート、タイマ、A/Dコンバータ等を備えている。
(First embodiment)
As shown in FIG. 1, the
次に図2を用いて、マイクロコンピュータ50の動作を説明する。
Next, the operation of the
(a)ステップS100において、ウォッチドッグタイマ2は、配線15から入力されるクロックCLKが入力される毎にカウント数が1つずつ変化することにより、クロックCLKの入力回数をカウントする。ステップS101において、CPU1が正常に動作している場合は、ステップS102において、ウォッチドッグタイマ2がタイムアウトする前に、CPU1から配線5を介してクリア信号CLRが入力され、ステップS103において、ウォッチドッグタイマ2は初期値にクリアされる。そして、ステップS100に戻り、再びウォッチドッグタイマ2はクロックCLKの入力回数のカウントを始める。
(A) In step S100, the
(b)ステップS101において、CPU1が正常に動作していない場合は、ウォッチドッグタイマ2はカウントを続ける。その結果、カウント数が一定値に達するとタイムアウトとなり、ステップS104において、タイムアウト信号TOを判定回路3及び動作選択回路4へ出力する。
(B) If the CPU 1 is not operating normally in step S101, the
(c)ステップS105において、判定回路3は、ウォッチドッグタイマ2により入力されたタイムアウト信号TOの入力回数をカウントする。ステップS106において、CPU1の動作が正常動作に回復した場合は、判定回路3がタイムアウトする前に、ステップS107において、CPU1から配線6を介してクリア信号CLRが入力され、ステップS108において、判定回路3は初期値にクリアされる。そして、ステップS105に戻る。
(C) In step S <b> 105, the determination circuit 3 counts the number of times the timeout signal TO input by the
(d)ステップS106において、CPU1が、未だ正常に動作しておらず、ウォッチドッグタイマ2が連続してタイムアウト信号TOを出力する場合は、判定回路3はカウントを続け、カウント数が一定値(例えば、2)に達するとタイムアウトとなり、ステップS109において、リセット信号RSTをORゲート9へ出力する。
(D) In step S106, when the CPU 1 is not yet operating normally and the
(e)ステップS110において、ORゲート9には、判定回路3から配線10を介してリセット信号RSTが入力され、CPU1から配線11を介してリセット信号RSTが入力される。ステップS111において、ORゲート9は、何れかのリセット信号RSTが入力された場合、リセット信号RSTを動作選択回路4へ出力する。
(E) In step S110, the OR
(f)ステップS111において、ORゲート9から配線14を介してリセット信号RSTが入力された場合は、動作選択回路4は、ステップS113において、リセット信号RSTをCPU1へ出力する。そして、ステップS115において、CPU1はリセットされる。
(F) In step S111, when the reset signal RST is input from the
本発明の第1の実施の形態に係るタイマ回路、及びマイクロコンピュータによれば、演算処理装置を強制的にリセットすることにより、CPUの割り込みルーチンが正常に実行されてない場合、又はCPUのリセット動作が割り込み動作に書き換えられてしまった場合でも、マイクロコンピュータ及びマイクロコンピュータに接続されている他の回路の動作を回復させることができる。 According to the timer circuit and the microcomputer according to the first embodiment of the present invention, the CPU interrupt routine is not normally executed by forcibly resetting the arithmetic processing unit, or the CPU is reset. Even when the operation is rewritten to the interrupt operation, the operation of the microcomputer and other circuits connected to the microcomputer can be recovered.
(第2の実施の形態)
図3に示すように、本発明の第2の実施の形態に係るマイクロコンピュータ50が備えるタイマ回路31は、本発明の第1の実施の形態に係るタイマ回路30とほぼ同様であるが、ORゲート9の入力端と動作選択回路4が、配線17で接続されており、ORゲート9の出力端とCPU1が、配線18で接続されている点で、本発明の第1の実施の形態に係るタイマ回路と異なる。また、動作選択回路4から配線17を介してリセット信号RSTがORゲート9へ出力され、CPU1から配線13を介して、リセット信号RSTが動作選択回路4へ入力される点で、本発明の第1の実施の形態に係るタイマ回路と異なる。
(Second Embodiment)
As shown in FIG. 3, the timer circuit 31 provided in the
次に図4を用いて、本発明の第2の実施の形態に係るタイマ回路の動作について説明する。ステップS100〜S108及びステップS115は、本発明の第1の実施の形態に係るタイマ回路の動作と同様である。 Next, the operation of the timer circuit according to the second embodiment of the present invention will be described with reference to FIG. Steps S100 to S108 and Step S115 are the same as the operation of the timer circuit according to the first embodiment of the present invention.
(a)ステップS106において、CPU1が、未だ正常に動作しておらず、ウォッチドッグタイマ2が連続してタイムアウト信号TOを出力する場合は、判定回路3はカウントを続け、カウント数が一定値に達するとタイムアウトとなり、ステップS209において、リセット信号RSTをORゲート9へ出力する。
(A) In step S106, when the CPU 1 is not yet operating normally and the
(b)CPU1から配線13を介して、リセット信号RSTが動作選択回路4へ入力された場合は、ステップS210において、動作選択回路4からリセット信号RSTがORゲート9へ出力される。
(B) When the reset signal RST is input from the CPU 1 to the
(c)ORゲート9には、ステップS209において判定回路3から配線10を介してリセット信号RSTが入力され、ステップS210において動作選択回路4から配線17を介してリセット信号RSTが入力される。ステップS211において、ORゲート9は、何れかのリセット信号RSTが入力された場合、リセット信号RSTをCPU1へ出力する。そして、ステップS115において、CPU1はリセットされる。
(C) The reset signal RST is input to the
本発明の第2の実施の形態に係るタイマ回路、及びマイクロコンピュータによれば、演算処理装置を強制的にリセットすることにより、CPUの割り込みルーチンが正常に実行されてない場合、又はCPUのリセット動作が割り込み動作に書き換えられてしまった場合でも、マイクロコンピュータ及びマイクロコンピュータに接続されている他の回路の動作を回復させることができる。 According to the timer circuit and the microcomputer according to the second embodiment of the present invention, the CPU interrupt routine is not normally executed by forcibly resetting the arithmetic processing unit, or the CPU is reset. Even when the operation is rewritten to the interrupt operation, the operation of the microcomputer and other circuits connected to the microcomputer can be recovered.
(その他の実施の形態)
図5に示すように、本発明の第1及び第2の実施の形態に係るマイクロコンピュータは、複数備えられてもよい。即ち、第1のマイクロコンピュータ50、第2のマイクロコンピュータ51、第3のマイクロコンピュータ52、ノード53、マイクロコンピュータ50とノードを接続するバス54、マイクロコンピュータ51とノードを接続するバス55、マイクロコンピュータ52とノードを接続するバス56が備えられる。マイクロコンピュータ50、51、52は、ノード53を介して外部と、又は相互にデータの入出力を行う。マイクロコンピュータ50は、スーパーバイザ機能を有し、第1のマイクロコンピュータ50、第2のマイクロコンピュータ51、及び第3のマイクロコンピュータ52からノード53へ入出力されるデータを制御する。例えば、マイクロコンピュータ51が機能しなくなった場合、マイクロコンピュータ50は、マイクロコンピュータ51で処理されるデータを、マイクロコンピュータ50又はマイクロコンピュータ52に割り振る。スーパーバイザ機能以外は、マイクロコンピュータ51及び52もマイクロコンピュータ50と同様の構成を有している。このようにマイクロコンピュータが複数備えられている場合でも、各マイクロコンピュータが独立して各演算処理装置を強制的にリセットすることにより、マイクロコンピュータに接続されている他のマイクロコンピュータの動作を回復させたり、マイクロコンピュータに接続されている他のマイクロコンピュータの負荷を減らすことができる。
(Other embodiments)
As shown in FIG. 5, a plurality of microcomputers according to the first and second embodiments of the present invention may be provided. That is, the
例えば、第1のマイクロコンピュータ50のCPU1が正常に動作しないため、スーパーバイザ機能が機能しない場合でも、第1のマイクロコンピュータ50が、CPU1を強制的にリセットすることにより、第2のマイクロコンピュータ51、第3のマイクロコンピュータ52へ入出力されるデータが正常に制御される。また、第2のマイクロコンピュータ51、第3のマイクロコンピュータ52も、それぞれ独立して演算処理装置を強制的にリセットすることにより、他のマイクロコンピュータへ割り振られたデータを、正常に処理できるようになる。
For example, even if the supervisor function does not function because the CPU 1 of the
第1の実施の形態、及び第2の実施の形態に係るタイマ回路では、発信回路16はマイクロコンピュータ50の外部にあるが、発信回路16はウォッチドッグタイマ2に内蔵されてもよい。また、第1の実施の形態及び第2の実施の形態に係る発信回路16は、CPU1に入力されるクロックであるシステムクロックを供給する発信回路であってもよいし、システムクロックとは独立したクロックを供給する発信回路であってもよい。
In the timer circuit according to the first embodiment and the second embodiment, the
1 CPU
2 ウォッチドッグタイマ
3 判定回路
4 動作選択回路
5〜8,10〜15,17,18 配線
9 ORゲート
16 発信回路
30 タイマ回路
31 タイマ回路
50,51,52 マイクロコンピュータ
53 ノード
54,55,56バス
CLK クロック
CLR クリア信号
INT 割り込み信号
RST リセット信号
TO タイムアウト信号
1 CPU
2 Watchdog timer 3
Claims (5)
前記タイムアウト信号の出力回数をカウントし、前記カウント数が一定値に達した場合に、前記演算処理装置をリセットさせるリセット信号を出力する判定回路
とを備えることを特徴とするタイマ回路。 A watchdog timer that outputs a timeout signal when a timeout occurs without being initialized by the arithmetic processing unit;
A timer circuit that counts the number of times the timeout signal is output and outputs a reset signal that resets the arithmetic processing unit when the count reaches a certain value.
前記演算処理装置により初期化されずタイムアウトした場合にタイムアウト信号を出力するウォッチドッグタイマと、
前記タイムアウト信号の出力回数をカウントし、前記カウント数が一定値に達した場合に、前記演算処理装置をリセットさせるリセット信号を出力する判定回路
とを備えることを特徴とするマイクロコンピュータ。 An arithmetic processing unit;
A watchdog timer that outputs a timeout signal when a timeout occurs without being initialized by the arithmetic processing unit;
A microcomputer comprising: a determination circuit that counts the number of times the timeout signal is output and outputs a reset signal that resets the arithmetic processing unit when the count reaches a certain value.
The microcomputer according to claim 4, further comprising an operation selection circuit that selects a reset operation of the arithmetic processing unit when the reset signal is input.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004164602A JP2005346359A (en) | 2004-06-02 | 2004-06-02 | Timer circuit and microcomputer |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004164602A JP2005346359A (en) | 2004-06-02 | 2004-06-02 | Timer circuit and microcomputer |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2005346359A true JP2005346359A (en) | 2005-12-15 |
Family
ID=35498682
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2004164602A Pending JP2005346359A (en) | 2004-06-02 | 2004-06-02 | Timer circuit and microcomputer |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2005346359A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN100397353C (en) * | 2006-07-26 | 2008-06-25 | 华为技术有限公司 | System and method for raising single-board exception handling ability |
CN104167973A (en) * | 2013-04-25 | 2014-11-26 | 大隈株式会社 | Inertia estimating method and inertia estimating appartus of position control apparatus |
-
2004
- 2004-06-02 JP JP2004164602A patent/JP2005346359A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN100397353C (en) * | 2006-07-26 | 2008-06-25 | 华为技术有限公司 | System and method for raising single-board exception handling ability |
CN104167973A (en) * | 2013-04-25 | 2014-11-26 | 大隈株式会社 | Inertia estimating method and inertia estimating appartus of position control apparatus |
US9952249B2 (en) | 2013-04-25 | 2018-04-24 | Okuma Corporation | Inertia estimating method and inertia estimation apparatus of position control apparatus |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20090187792A1 (en) | Circuit Arrangement and Method for Supporting and Monitoring a Microcontroller | |
US7861115B2 (en) | Multi-component system | |
US8392643B2 (en) | Data processing device, semiconductor integrated circuit device, and abnormality detection method | |
JP2005346359A (en) | Timer circuit and microcomputer | |
JP6049961B1 (en) | CPU monitoring device | |
US7506082B2 (en) | Data transferring system using USB and method thereof | |
JP4322606B2 (en) | Watchdog timer | |
KR100388961B1 (en) | data restoring control device of the flash ROM in the information processing system | |
EP3696628A1 (en) | Control device, and slave device conrol method | |
JP4567586B2 (en) | Processing equipment | |
JP4396572B2 (en) | Method for resetting signal processing apparatus | |
JP6906369B2 (en) | Computer systems, their control methods, and programs | |
KR100628109B1 (en) | Apparatus and Method of Watch-Dog of Camera module for Handhelds device using Hardware logic | |
JP2008217419A (en) | Interruption controller for automatically changing interruption level | |
JP2006163919A (en) | Duplex system | |
JP2024013979A (en) | electronic control unit | |
JP2005092314A (en) | Hang-up detecting device for microcomputer system | |
KR100975228B1 (en) | microcomputer with watchdog timer | |
JP5768434B2 (en) | Mutual monitoring system | |
JPH01310422A (en) | Resetting circuit for microcomputer | |
KR100595206B1 (en) | Method of error detecting camera sensor | |
JP2009130392A (en) | Electronic circuit and integrated circuit | |
JP2001337841A (en) | Task control unit | |
JP2007264856A (en) | Cpu monitoring system, device and method | |
JP2001043148A (en) | Microprocessor |