JPS6341951A - Microcomputer - Google Patents

Microcomputer

Info

Publication number
JPS6341951A
JPS6341951A JP61186545A JP18654586A JPS6341951A JP S6341951 A JPS6341951 A JP S6341951A JP 61186545 A JP61186545 A JP 61186545A JP 18654586 A JP18654586 A JP 18654586A JP S6341951 A JPS6341951 A JP S6341951A
Authority
JP
Japan
Prior art keywords
power
watchdog
signal
circuit
timer
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
JP61186545A
Other languages
Japanese (ja)
Inventor
Hiroshi Koyama
博 小山
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.)
Sanyo Electric Co Ltd
Original Assignee
Sanyo 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 Sanyo Electric Co Ltd filed Critical Sanyo Electric Co Ltd
Priority to JP61186545A priority Critical patent/JPS6341951A/en
Publication of JPS6341951A publication Critical patent/JPS6341951A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To improve convenience in use by making it possible to select function as a watchdog timer is to be given to a timer circuit or not only when a power source is made on. CONSTITUTION:A timer overflow signal TOF outputted from a timer circuit 8 is outputted to an OR gate 3 through an AND gate 8 and becomes an initial set signal IRS only when a high level watchdog enable signal WENE is outputted from a flip-flop 7, that is, when a high level watchdog function selection signal WDSE is generated and given to an AND gate 6 while a power on flag POF is set ('1') and a power on flag signal POF, output of a power on flag generating circuit 5, is high level. In other words, a timer circuit 9 functions as a watchdog timer only when the flip-flop 7 is in a set state. Selection as to whether the watchdog function is to be used or not is made possible only just after a power source is made on. In case the watchdog fuction is not used, the timer circuit can be used for other purpose without any restriction.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はウォッチドッグ機能、即ちプログラムの暴走状
態あるいは無限ループからの脱出のための機能を備えた
マイクロコンピュータに関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a microcomputer equipped with a watchdog function, that is, a function for escaping from a program runaway state or an infinite loop.

〔従来技術〕[Prior art]

マイクロコンピュータシステムにおいては、ユーザが自
らプログラムを作成しこれを使用することが多い。この
ようなユーザ自ら作成したプログラムの使用に際しては
、バグの存在によるプログラムの暴走、あるいはループ
の解除条件が適正でないことによる無限ループ等が生じ
易い。そこで、所定時間内にプログラム全体、あるいは
プログラムを適宜に分割したブロックそれぞれの処理が
終了しない場合にはプログラムの暴走または無限ループ
の発生と見做してシステム全体をイニシャル°ノセノト
させる信号を出力するような、または所定のステップへ
ジャンプさせるマスク不可能な割込み信号を発生するよ
うなウォッチドッグ機能を備工たマイクロコンピュータ
が普及している。
In microcomputer systems, users often create and use programs themselves. When using such a program created by the user himself/herself, the program is likely to run out of control due to the presence of a bug, or an infinite loop may occur due to inappropriate loop release conditions. Therefore, if the entire program or the processing of each block of the program is not completed within a predetermined time, it is assumed that the program has gone out of control or an infinite loop has occurred, and a signal is output to initialize the entire system. Microcomputers equipped with a watchdog function that generates a non-maskable interrupt signal that causes a jump to a predetermined step or a jump to a predetermined step are becoming popular.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

ところで、従来のウォッチドッグ機能を有するマイクロ
コンピュータでは、この機能専用のタイマ回路、即ちウ
ォッチドッグタイマを備えている。
By the way, a conventional microcomputer having a watchdog function is equipped with a timer circuit dedicated to this function, that is, a watchdog timer.

このウォッチドッグタイマは、プログラム全体あるいは
プログラムを適宜に分割したブロックそれぞれの実行開
始時にセットされ、実行終了時にリセットされるのであ
るが、このウォッチドッグタイマかりセットされないま
まに所定時間を計時した場合には、イニシャルリセット
信号またはマスク不可能な割込み信号が発生され、これ
によりプログラムの暴走の停止、無限ループからの脱出
を行っていた。このため、ウォッチドッグ機能を使用し
ない場合には、そのためウオッチドフグタイマは無駄に
なるという不経済な面がある。
This watchdog timer is set at the start of execution of the entire program or each block into which the program is divided as appropriate, and is reset at the end of execution. In this case, an initial reset signal or a non-maskable interrupt signal was generated, which was used to stop the program from running out of control and escape from the infinite loop. Therefore, if the watchdog function is not used, the watchdog timer is wasted, which is uneconomical.

このような無駄を回避する方策としては、たとえばウォ
ッチドッグタイマとしての機能を含む複数の用途にプロ
グラムによりソフトウェア的に切換え得るような夕・イ
マ回路の構成が考えられる。
As a measure to avoid such waste, it is possible to configure the evening/timer circuit so that it can be switched by software to multiple uses, including the function as a watchdog timer, for example.

しかしこのようなプログラムによりタイマ回路をウォッ
チドッグタイマから他の用途に切換え得る構成を採る場
合、プログラムの暴走によりタイマ回路の用途がウォッ
チドッグタイマから他の用途に切り換わる可能性がある
。従って、ウォッチドッグ機能を使用している場合に、
ウォッチドッグタイマとして使用しているタイマ回路が
他の用途に使用されるような状態にプログラムが暴走し
てしまうと、せっかくのウォッチドッグ機能が全く無意
味になってしまう。
However, if a configuration is adopted in which the timer circuit can be switched from the watchdog timer to another use by such a program, there is a possibility that the program runs out of control and the timer circuit is switched from the watchdog timer to another use. Therefore, when using the watchdog function,
If the program goes out of control and the timer circuit used as a watchdog timer is used for other purposes, the watchdog function becomes completely meaningless.

他の方法として、たとえばタイマ回路を一旦つォノチド
ングタイマとして使用するように設定した場合には、他
の用途へのプログラムによる切換えが行えないような構
成とすることが考えられる。
As another method, for example, once the timer circuit is set to be used as a one-stop timer, it may be configured such that it cannot be switched to other uses by a program.

しかし、このようなタイマ回路の動作に特別の規定を設
ける構成は、タイマ回路の使い勝手を悪くし、またプロ
グラミング及びデバッグ時に種々の問題を生じ易くなる
However, such a configuration in which special regulations are provided for the operation of the timer circuit makes the timer circuit less convenient to use, and also tends to cause various problems during programming and debugging.

本発明は以上のような事情に鑑みてなされたものであり
、ウォッチドッグタイマとして使用されるタイマ回路が
、プログラムの暴走時にウォッチドッグタイマとして機
能しなくなることを回避し、またウォッチドッグ機能を
使用しない場合にはタイマ回路を他の用途に自由に使用
可使なマイクロコンピュータの提供を目的とする。
The present invention has been made in view of the above circumstances, and is intended to prevent a timer circuit used as a watchdog timer from ceasing to function as a watchdog timer when a program runs out of control, and to prevent a timer circuit used as a watchdog timer from failing to function as a watchdog timer when a program runs out of control. The purpose of the present invention is to provide a microcomputer whose timer circuit can be used freely for other purposes if the timer circuit is not used.

〔問題点を解決するための手段〕[Means for solving problems]

本発明は、その全体を初期状態にリセットするイニシャ
ルリセット信号を電源投入時に発生するパワーオンクリ
ア回路と、該パワーオンクリア回路が発生するイニシャ
ルリセット信号によりセットされ、プログラムの実行開
始時までにセット状態であることが読取られてリセット
されるパワーオンフラグの発生回路とを備えたマイクロ
コンビ二一夕において、前記パワーオンフラグがセット
状態である間にのみウォッチドッグ選択信号を出力する
回路と、該回路からウォッチドッグ選択信号が与えられ
ることにより、プログラムの処理時間が所定時間以上で
ある場合にオーバフロー信号を発生するウォ・ノチドノ
グタイマとして前記タイマ回路を機潰させるウォッチド
ッグイネーブル信号を出力する回路とを備えたことを特
徴とする。
In the present invention, an initial reset signal that resets the entire device to its initial state is set by a power-on clear circuit that generates when the power is turned on, and an initial reset signal that is generated by the power-on clear circuit, and is set by the time the program starts executing. a circuit for outputting a watchdog selection signal only while the power-on flag is in the set state; A circuit that outputs a watchdog enable signal that destroys the timer circuit as a watchdog timer that generates an overflow signal when a program processing time is longer than a predetermined time by receiving a watchdog selection signal from the circuit. It is characterized by having the following.

〔作用〕[Effect]

本発明のマイクロコンピュータでは、電源投入直後にお
いてのみウォッチドッグ機能を使用するか否かの選択が
可能になり、ウオッチドフグ機能が使用されない場合に
はタイマ回路を他の用途に何等の制約無しに使用可能で
ある。
In the microcomputer of the present invention, it is possible to select whether or not to use the watchdog function only immediately after power is turned on, and when the watchdog function is not used, the timer circuit can be used for other purposes without any restrictions. It is.

〔実施例〕 以下、本発明をその実施例を示す図面に基づいて詳述す
る。
[Example] Hereinafter, the present invention will be described in detail based on drawings showing examples thereof.

第1図は本発明に係るマイクロコンピュータの要部の構
成を示すブロック図である。
FIG. 1 is a block diagram showing the configuration of essential parts of a microcomputer according to the present invention.

図中1はM8源線であり、電源電圧Vccが印加されて
いる。
In the figure, 1 is an M8 source line, to which a power supply voltage Vcc is applied.

2は一端を電源線1に接続された手動操作自動復帰式の
イニシャルリセフトスイノチであり、その他端はORゲ
ート3の第1の入力端子に接続されている。従って、イ
ニシャルリセノトスイフチ2がオン操作されると電源電
圧VCCのパルス信号がORゲート3を介してイニシャ
ルリセット信号IR3として出力される。
Reference numeral 2 denotes a manually operated and automatically reset type initial reset whose one end is connected to the power supply line 1, and the other end is connected to the first input terminal of the OR gate 3. Therefore, when the initial reset switch 2 is turned on, a pulse signal of the power supply voltage VCC is outputted via the OR gate 3 as the initial reset signal IR3.

図中4はパワーオンクリア回路であり、本発明装置のメ
インスイッチが投入された場合にノ\イレヘルのパワー
オンクリア信号POCをORゲート3の第2の入力端子
に出力する。なお、このORゲート3に与えられたパワ
ーオンクリア信号POCはイニシャルリセット信号IR
5としてORゲート3から出力される。またこのパワー
オンクリア信号POCはR−Sフリップフロップである
パワーオンフラグ発生回路5のセット端子S及びR−S
フリップフロップ7のリセット端子Rに与えられている
In the figure, reference numeral 4 denotes a power-on clear circuit, which outputs a power-on clear signal POC of no return to the second input terminal of the OR gate 3 when the main switch of the device of the present invention is turned on. Note that the power-on clear signal POC given to this OR gate 3 is the initial reset signal IR.
5 from the OR gate 3. Further, this power-on clear signal POC is applied to the set terminals S and R-S of the power-on flag generating circuit 5, which is an R-S flip-flop.
It is applied to the reset terminal R of the flip-flop 7.

パワーオンフラグ発生回路5は上述の如< R−Sフリ
ップフロップであり、そのセット端子Sにパワーオンク
リア回路4の出力であるパワーオンクリア信号POCが
、リセット端子RにPOFリセット信号が与えられ、出
力端子QはANDゲート6の第1の入力端子及びパワー
オンフラグ信号出力ゲート10に接続されている。
The power-on flag generating circuit 5 is an R-S flip-flop as described above, and its set terminal S receives the power-on clear signal POC, which is the output of the power-on clear circuit 4, and its reset terminal R receives the POF reset signal. , the output terminal Q is connected to the first input terminal of the AND gate 6 and the power-on flag signal output gate 10.

従って、パワーオンクリア回路4からパワーオンクリア
化qpocが出力されると、パワーオンフラグ発生回路
5はセットされて(換言すれば、パワーオンフラグPO
Fがセットされて)その出力端子Qの出力であるパワー
オンフラグ信号5POFはハイレベルに転じる。またプ
ログラムの実行開始時のイニシャルルーチンにおいて一
旦バワーオンフラグPOFがセット(“ド)であること
が読取られると、ハイレベルのPOFリセット信号RP
OFが発生されてこれがパワーオンフラグ発生回路5の
リセット端子Rに与えられる。これにより、パワーオン
フラグ発生回路5はリセットされてその出力端子Qの出
力であるパワーオンフラグ信号5POFはローレベルに
転じる。
Therefore, when the power-on clearing qpoc is output from the power-on clear circuit 4, the power-on flag generating circuit 5 is set (in other words, the power-on flag PO
(F is set), the power-on flag signal 5POF, which is the output of its output terminal Q, changes to a high level. In addition, once it is read that the power-on flag POF is set (“do”) in the initial routine at the start of program execution, the POF reset signal RP goes high.
OF is generated and applied to the reset terminal R of the power-on flag generating circuit 5. As a result, the power-on flag generating circuit 5 is reset, and the power-on flag signal 5POF output from its output terminal Q changes to a low level.

ANDゲート6は、その一方の入力端子には上述の如く
パワーオンフラグ発生回路5の出力であるパワーオンフ
ラグ信号5POFが、他方の入力端子にはウォッチドッ
グ機能選択信号WDSEがそれぞれ与えられており、出
力端子はフリップフロップ7のセット端子Sに接続され
ている。
The AND gate 6 has one input terminal supplied with the power-on flag signal 5POF, which is the output of the power-on flag generation circuit 5, as described above, and the other input terminal supplied with the watchdog function selection signal WDSE. , the output terminal is connected to the set terminal S of the flip-flop 7.

従って、ANDゲート6はハイレベルのパワーオンフラ
グ信号5POFが与えられている間にのみ、換言すれば
パワーオンフラグPOFがセット(“1”)されている
間にのみハイレベルのウォッチドッグ機能選択信号−D
SEをフリップフロップ7のセット端子Sに出力する。
Therefore, the AND gate 6 selects the high-level watchdog function only while the high-level power-on flag signal 5POF is applied, in other words, only while the power-on flag POF is set (“1”). Signal-D
SE is output to the set terminal S of the flip-flop 7.

フリップフロップ7は、既述の如く、そのセット端子S
にはANDゲート6を介してウォッチドッグ機能選択信
号WDSEが、リセット端子Rにはパワーオンクリア回
路4の出力であるパワーオンクリア信号pocがそれぞ
れ与えられ、出力端子QはANDゲート8の一方の入力
端子に接続されている。
As mentioned above, the flip-flop 7 has its set terminal S
is supplied with the watchdog function selection signal WDSE through the AND gate 6, the power-on clear signal poc which is the output of the power-on clear circuit 4 is supplied to the reset terminal R, and the output terminal Q is supplied with one of the AND gates 8. connected to the input terminal.

従って、パワーオンフラグ発生回路5から出力されてい
るパワーオンフラグ信号5POFがハイレベルである間
にのみハイレベルのウォッチドッグ機能選択信号−〇S
Eが入力されると、ANDゲート6からクリップフロッ
プ7のセット端子Sにハイレベルの信号(ウォッチドッ
グ機能選択信号−〇SF)が与えられてフリップフロッ
プ7がセットされる。
Therefore, the watchdog function selection signal -〇S is at a high level only while the power-on flag signal 5POF output from the power-on flag generating circuit 5 is at a high level.
When E is input, a high level signal (watchdog function selection signal -○SF) is applied from the AND gate 6 to the set terminal S of the clip-flop 7, and the flip-flop 7 is set.

これにより、フリップフロップ7の出力端子Qからはハ
イレベルのウォッチドッグイネーブル信号WENEが出
力される。
As a result, the high level watchdog enable signal WENE is output from the output terminal Q of the flip-flop 7.

このクリップフロップ7の出力、即ちウォッチドッグイ
ネーブル信号−ENEは前述の如く へNOゲート8の
一方の入力端子に与えられているが、フリップフロップ
7かりセットされるのはそりセット端子Rにハイレベル
の信号が与えられた場合、具体的にはパワーオンクリア
回路4からパワーオンクリア信号POCが出力された場
合のみであるため、電源が継続して投入されている間は
フリップフロップ7のセット状態は継続される。
The output of the clip-flop 7, that is, the watchdog enable signal -ENE, is applied to one input terminal of the NO gate 8 as described above, but the output of the flip-flop 7 is set to a high level at the warp set terminal R. When the signal POC is given, specifically, only when the power-on clear signal POC is output from the power-on clear circuit 4, the flip-flop 7 remains in the set state while the power is continuously turned on. will continue.

図中9はタイマ回路であり、図示しない設定回路により
計時値を設定することが可能であり、またこの設定され
た計時値の計時が完了した場合にハイレベルのタイマオ
ーバフロー信号TOFを前述のANDゲート8の他方の
入力端子に出力する。そして、ANDゲート8の出力は
前述のORゲート3の第3の入力端子に接続されている
Reference numeral 9 in the figure is a timer circuit, and it is possible to set a time value by a setting circuit (not shown), and when the time measurement of the set time value is completed, a high level timer overflow signal TOF is sent to the above-mentioned AND It is output to the other input terminal of gate 8. The output of the AND gate 8 is connected to the third input terminal of the aforementioned OR gate 3.

従って、タイマ回路8から出力されるタイマオーバフロ
ー信号TOFは、フリップフロップ7からハイレベルの
ウォッチドッグイネーブル信号−ENEが出力されてい
る場合、叩ちパワーオンフラグPOFがセットじl”)
されていてパワーオンフラグ発生回路5の出力であるパ
ワーオンフラグ信号POFがハイレベルである間に、ハ
イレベルのウォッチドッグ機能選択信号WDSEが発生
されてANDゲート6に与えられた場合にのみANDゲ
ート8を介してORゲート3へ出力されてイニシャルリ
セット信号IR5となる。換言すれば、フリップフロッ
プ7がセット状態の場合にのみタイマ回路9はウォッチ
ドッグタイマとして機能する。
Therefore, the timer overflow signal TOF output from the timer circuit 8 does not set the hit power-on flag POF when the high-level watchdog enable signal -ENE is output from the flip-flop 7.
AND only when a high-level watchdog function selection signal WDSE is generated and applied to the AND gate 6 while the power-on flag signal POF, which is the output of the power-on flag generating circuit 5, is at a high level. It is output to the OR gate 3 via the gate 8 and becomes the initial reset signal IR5. In other words, the timer circuit 9 functions as a watchdog timer only when the flip-flop 7 is in the set state.

なお、ゲート10はパワーオンフラグ信号5POFをハ
ス11へ出力するためのゲートである。
Note that the gate 10 is a gate for outputting the power-on flag signal 5POF to the lotus 11.

以上のような構成の本発明のマイクロコンピュータの動
作について、第2及び3図のタイミングチャートに従っ
て以下に説明する。
The operation of the microcomputer of the present invention having the above configuration will be described below with reference to the timing charts of FIGS. 2 and 3.

ウォッチドッグ機能が選択された場合には第2図のタイ
ミングチャートに従って動作する。
When the watchdog function is selected, it operates according to the timing chart shown in FIG.

まず、電源が投入されると(alパワーオンクリア回路
4からハイレベルのパワーオンクリア信号POCが出力
されfbl、これがORゲート3を介してイニシャルリ
セット信号IR3として出力されfcl、またパワーオ
ンフラグ発生回路5の七ノド端子Sに与えられてパワー
オンフラグ発生回路5をセットするのでパワーオンフラ
グ信号5POFがハイレベルに転じる(d)、更にフリ
ップフロップ7も初期リセットされる。そして、このパ
ワーオンフラグ信号5POFがハイレベルを維持してい
る間に、ハイレベルのウォッチドッグ機能選択信号−[
)SEが与えられるとtel、ANDゲート6出力がハ
イレベルに転してフリップフロップ7がセットされ、ハ
イレベルのウォッチドッグイネーブル信号WEN^が出
力され、ANDゲート8の一方の入力端子に入力される
ifl。
First, when the power is turned on (al power-on clear circuit 4 outputs a high-level power-on clear signal POC fbl, this is output as an initial reset signal IR3 through OR gate 3 fcl, and a power-on flag is generated. Since the power-on flag signal 5POF is applied to the seventh node terminal S of the circuit 5 and sets the power-on flag generating circuit 5, the power-on flag signal 5POF changes to high level (d), and the flip-flop 7 is also initially reset. While the flag signal 5POF maintains the high level, the high level watchdog function selection signal -[
) SE is applied, tel, AND gate 6 output changes to high level, flip-flop 7 is set, high level watchdog enable signal WEN^ is outputted, and inputted to one input terminal of AND gate 8. Ru ifl.

そして、たとえばプログラムの実行が開始されそのイニ
シャルルーチンにおいて、パワーオンフラグ信号5PO
Fがハイレベルであること、即ちパワーオンフラグPO
Fのセット状態が読取られると、POFリセット信号R
POFが発生され、パワーオンフラグ発生回路5のリセ
ソ+−a子Rに与えられfg)、これによりパワーオン
フラグ発生回路5がリセットされる、即ちパワーオンフ
ラグPOFがリセット(“0”)される(dl。しかし
、フリップフロップ7はセフ)状態を維持しているので
、その出力端子Qからはハイレベルのウォッチドッグイ
ネーブル信号−ENAが継続して出力されている(f)
、これによりタイマ回路9はウォッチドッグタイマとし
て機能する。
Then, for example, when the program starts executing and in its initial routine, the power-on flag signal 5PO is activated.
F is at a high level, that is, the power-on flag PO
When the set state of F is read, the POF reset signal R
POF is generated and applied to the reset +-a terminal R of the power-on flag generation circuit 5 (fg), thereby resetting the power-on flag generation circuit 5, that is, the power-on flag POF is reset (to "0"). However, since the flip-flop 7 maintains the safe state, the high-level watchdog enable signal -ENA is continuously output from its output terminal Q (f).
, whereby the timer circuit 9 functions as a watchdog timer.

ところで、タイマ回路9はプログラムの実行が開始され
ると所定の時間が設定されて計時を開始する。そして、
タイマ回路9はそのプログラム全体が、あるいはそのプ
ログラムを適宜に分割した各ブロックそれぞれが終了す
るとリセットされる。
By the way, when the execution of the program is started, the timer circuit 9 is set to a predetermined time and starts counting time. and,
The timer circuit 9 is reset when the entire program or each block obtained by appropriately dividing the program ends.

しかし、プログラムの実行中にプログラムの暴走あるい
は無限ループが発生したような場合には、このリセット
が行われないままに所定時間の計時が完了するので、こ
の場合にはタイマ回路9はタイマオーバフロー信号TO
FをANDゲート8の他方の入力端子に出力するfh)
。この際、上述の如< ANDゲート8の一方の入力端
子にはハイレベルのウォッチトングイネーブル信号−E
NAが与えられているので、ANDゲート8出力はハイ
レベルに転じてORゲート3の第3の入力端子に与えら
れる。これにより、ORゲート3からはハイレベルのイ
ニシャルリセットIR3(3号が出力されるtel。
However, if a program runaway or an infinite loop occurs during program execution, the predetermined time measurement will be completed without this reset being performed. T.O.
fh) which outputs F to the other input terminal of AND gate 8.
. At this time, as described above, one input terminal of the AND gate 8 is supplied with a high-level watch tong enable signal -E.
Since NA is applied, the output of AND gate 8 changes to high level and is applied to the third input terminal of OR gate 3. As a result, the OR gate 3 outputs a high level initial reset IR3 (tel from which No. 3 is output).

なお、イニシャルリセットスイッチ2がオン操作された
場合fi+にも、ORゲート3からイニシャルリセット
信号IR3が出力される(C)ことは勿論である。
Note that, of course, when the initial reset switch 2 is turned on, the initial reset signal IR3 is also output from the OR gate 3 to fi+ (C).

一方、ウォッチドッグ機能が選択されない場合には第3
図のタイミングチャートに従って動作する。即ち、ウォ
ッチドッグ機能が選択されない場合には、ハイレベルの
ウォッチドッグ機能選択信号−〇SEが発生されないの
で、フリップフロップ7がセットされることはなく、従
ってハイレベルのウオッチドフグイネーブル信号−EN
Aが出力されることもない(f)、このため、仮にタイ
マ回路9からハイレベルの信号が出力されるような事態
が発生してへNOゲート8にタイマオーバフロー信号T
 OFとして与えられたとしても、ANDゲート8出力
はローレベルを維持するので、ORゲート3からイニン
ヤルリセット信号IR3が出力されることはない(c+
On the other hand, if the watchdog function is not selected, the third
It operates according to the timing chart shown in the figure. That is, when the watchdog function is not selected, the high-level watchdog function selection signal -0SE is not generated, so the flip-flop 7 is not set, and therefore the high-level watchdog enable signal -EN is not generated.
A is also not output (f). Therefore, if a situation occurs in which a high level signal is output from the timer circuit 9, the timer overflow signal T is sent to the NO gate 8.
Even if it is given as OF, the AND gate 8 output maintains a low level, so the initial reset signal IR3 is not output from the OR gate 3 (c+
.

なお、上記実施例では、ウォッチドッグタイマとしての
タイマ回路9がオーバフロー信号を出力した場合に、イ
ニシャルリセット信号IRSが発生されるように構成し
であるが、代わりにマスク不可能な(アンマスカブル)
割込み信号を出力してプログラムの実行を所定のステッ
プにジャンプさせる構成としてもよいことは勿論である
In the above embodiment, when the timer circuit 9 as a watchdog timer outputs an overflow signal, the initial reset signal IRS is generated.
Of course, a configuration may also be used in which an interrupt signal is output to cause the execution of the program to jump to a predetermined step.

〔効果〕〔effect〕

以上のように本発明では、電源の投入時にのみタイマ回
路にウォッチドッグタイマとしての#R清を付与するか
否かを選択し得るので、ウォッチドッグ機能が選択され
た場合には、たとえプログラムが暴走した場合にもタイ
マ回路はウォッチドッグタイマとしての機能を確実に維
持し、またウォッチドッグ機能が選択されなかった場合
にはタイマ回路のウォッチドッグタイマとしての機能を
顧慮する必要なしにプログラミングあるいはデバッグ等
が行えるので、非常に使い勝手のよいウォッチドッグ機
能を有するマイクロコンピュータが実現される。
As described above, in the present invention, it is possible to select whether or not to give the #R setting as a watchdog timer to the timer circuit only when the power is turned on. Therefore, when the watchdog function is selected, even if the program The timer circuit reliably maintains its function as a watchdog timer even in the event of a runaway, and if the watchdog function is not selected, programming or debugging is possible without having to consider the timer circuit's function as a watchdog timer. etc., thereby realizing a microcomputer with a watchdog function that is extremely easy to use.

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

第1図は本発明のマイクロコンピュータの要部の構成を
示すブロック図、第2.3図はその動作説明のためのタ
イミングチャートである。 2・−・イニシャルリセットスイッチ  4・・・パワ
ーオンクリア回路  5・・・パワーオンフラグ発生回
路  6・・・ANDゲート  7・・・フリップフロ
ップ  9・・・タイマ回路
FIG. 1 is a block diagram showing the configuration of essential parts of a microcomputer according to the present invention, and FIGS. 2 and 3 are timing charts for explaining its operation. 2... Initial reset switch 4... Power-on clear circuit 5... Power-on flag generation circuit 6... AND gate 7... Flip-flop 9... Timer circuit

Claims (1)

【特許請求の範囲】 1、その全体を初期状態にリセットするイニシャルリセ
ット信号を電源投入時に発生するパワーオンクリア回路
と、 該パワーオンクリア回路が発生するイニシ ャルリセット信号によりセットされ、プログラムの実行
開始時までにセット状態であることが読取られてリセッ
トされるパワーオンフラグの発生回路とを備えたマイク
ロコンピュータにおいて、 前記パワーオンフラグがセット状態である 間にのみウォッチドッグ選択信号を出力する回路と、 該回路からウォッチドッグ選択信号が与え られることにより、プログラムの処理時間が所定時間以
上である場合にオーバフロー信号を発生するウォッチド
ッグタイマとして前記タイマ回路を機能させるウォッチ
ドッグイネーブル信号を出力する回路と を備えたことを特徴とするマイクロコンピ ュータ。
[Scope of Claims] 1. A power-on clear circuit that generates an initial reset signal that resets the entire device to its initial state when the power is turned on; and a power-on clear circuit that is set by the initial reset signal generated by the power-on clear circuit to start program execution. A circuit for outputting a watchdog selection signal only while the power-on flag is in a set state; , a circuit that outputs a watchdog enable signal that causes the timer circuit to function as a watchdog timer that generates an overflow signal when a program processing time is longer than a predetermined time when a watchdog selection signal is applied from the circuit; A microcomputer characterized by being equipped with.
JP61186545A 1986-08-07 1986-08-07 Microcomputer Pending JPS6341951A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP61186545A JPS6341951A (en) 1986-08-07 1986-08-07 Microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP61186545A JPS6341951A (en) 1986-08-07 1986-08-07 Microcomputer

Publications (1)

Publication Number Publication Date
JPS6341951A true JPS6341951A (en) 1988-02-23

Family

ID=16190378

Family Applications (1)

Application Number Title Priority Date Filing Date
JP61186545A Pending JPS6341951A (en) 1986-08-07 1986-08-07 Microcomputer

Country Status (1)

Country Link
JP (1) JPS6341951A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03252886A (en) * 1990-03-02 1991-11-12 Nec Corp Single chip microcomputer
US6948103B2 (en) 2000-12-22 2005-09-20 Nec Electronics Corporation Watchdog timer and method for detecting abnormal operation of computer, and computer including the timer

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5099242A (en) * 1973-12-28 1975-08-06

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5099242A (en) * 1973-12-28 1975-08-06

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03252886A (en) * 1990-03-02 1991-11-12 Nec Corp Single chip microcomputer
US6948103B2 (en) 2000-12-22 2005-09-20 Nec Electronics Corporation Watchdog timer and method for detecting abnormal operation of computer, and computer including the timer

Similar Documents

Publication Publication Date Title
KR920004288B1 (en) Method and apparatus in a data processor for selectively disabling a power-down instruction
US4573117A (en) Method and apparatus in a data processor for selectively disabling a power-down instruction
US4408328A (en) Microprogram control circuit
JPS6341951A (en) Microcomputer
JPS5936832A (en) Reset circuit of microprocessor
KR0155045B1 (en) Watch dog timmer of self-service guard system
JPS622684Y2 (en)
JPS63111549A (en) Preventing circuit for abnormal working of microcomputer
SU1509904A1 (en) Device for disabling and restarting microprocessor at power faults
JPS5846448A (en) Interruption control circuit
JPS63146137A (en) Device for preventing runaway of program execution
JPS62205441A (en) Microcomputer
JP2867617B2 (en) Standby circuit
JPS60124734A (en) Interruption processing circuit to cpu
JPS63129426A (en) Timer module for data flow type computer
JPS63292246A (en) Program evaluation device
JP2870083B2 (en) Microcomputer with built-in watchdog timer
JP3025318U (en) Reset signal generator
KR930014021A (en) How to Debug User Program of PLC
JPH0149968B2 (en)
JPH0439693B2 (en)
JPH04151706A (en) Cpu reset circuit
JPH0786794B2 (en) Blackout control circuit
JPS61271524A (en) Resetting circuit for microprocessor
JPH06180764A (en) Microcomputer