JPS603654B2 - Microcomputer trouble detection circuit - Google Patents

Microcomputer trouble detection circuit

Info

Publication number
JPS603654B2
JPS603654B2 JP55160685A JP16068580A JPS603654B2 JP S603654 B2 JPS603654 B2 JP S603654B2 JP 55160685 A JP55160685 A JP 55160685A JP 16068580 A JP16068580 A JP 16068580A JP S603654 B2 JPS603654 B2 JP S603654B2
Authority
JP
Japan
Prior art keywords
microcomputer
output port
output
detection circuit
initial setting
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
Application number
JP55160685A
Other languages
Japanese (ja)
Other versions
JPS5785154A (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 Home Electronics Ltd
Original Assignee
NEC Home Electronics 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 filed Critical NEC Home Electronics Ltd
Priority to JP55160685A priority Critical patent/JPS603654B2/en
Publication of JPS5785154A publication Critical patent/JPS5785154A/en
Publication of JPS603654B2 publication Critical patent/JPS603654B2/en
Expired legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Description

【発明の詳細な説明】 本発明は、マイクロコンピュータにおけるソフトの暴走
等のトラブル検出回路に関する。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a circuit for detecting troubles such as software runaway in a microcomputer.

周知のようにマイクロコンピュータ(以下、マイコンと
称す。
As is well known, microcomputers (hereinafter referred to as microcomputers)

)におけるソフトの暴走には2種類ある。第1はノイズ
のためにマイコンがROMのプログラムを読み違え、開
ループに入ってしまい出てこれなくなることによるソフ
トの暴走である。第2はマイコンに大軍圧や大軍流が加
わることによりROMのプログラムの一部もしくは全部
が破壊され、マイコンとしても機能を矢なうことによる
ソフトの暴走である。従釆、上記ソフトの暴走が生じる
2種類の故障は外部から見るかぎりでは見分けがつかな
い。
) There are two types of software runaway. The first is software runaway due to the microcomputer misreading the ROM program due to noise, entering an open loop and not being able to exit. The second is a software runaway caused by the application of military pressure or style to the microcomputer, which destroys part or all of the program in the ROM, causing it to no longer function as a microcomputer. As a side note, the two types of failures that cause the software to run out of control cannot be distinguished from each other as long as they are viewed from the outside.

しかしながら、第1の故障ではマイコンにリセツトをか
ければ元の正常な動作に戻るのに対し、第2の故障はソ
フト自身が破壊されているためにマイコンにリセットを
かけても元の正常状態には戻らないという大きな相違が
ある。本発明はかかる点に着目し、その目的は、2種類
の故障の区別をつけ、第1の故障の場合には自動的にマ
イコンをリセットさせ、第2の故障の場合には自動的に
警報を鳴らすことにより、ソフトの暴走を検出する回路
を提供することになる。
However, in the case of the first failure, resetting the microcontroller will return it to its original normal operation, whereas in the second failure, the software itself has been destroyed, so even if the microcontroller is reset, it will not return to its original normal state. The big difference is that it won't come back. The present invention has focused on this point, and its purpose is to distinguish between two types of failures, to automatically reset the microcomputer in the case of the first failure, and to automatically issue an alarm in the case of the second failure. By sounding this, a circuit is provided to detect software runaway.

以下、本発明を実施例図面に従って説明する。第1図に
おいて、10はマイコンであり、所定のプログラムが記
憶蓄積され、外部端子として第1の出力ボートP,、第
2の出力ボートP2、リセット端子RESおよびマイコ
ンの各部を動作させる基準クロックパルスとして発振さ
れる基準信号を引き出したALE端子を有する。第1お
よび第2出力ボートP,およびP2′は通常時はローレ
ベルにある。またこのマイコン10はリセット端子RE
Sにローレベルのパルスが入力されるとりセットがかか
り、第2出力ボートP2は/・ィレベルに立ち上がり、
マイコンが走り始めて処理ルーチンを一度通過すると第
2出力ボートP2はローレベルに戻る。20は第1の故
障検出回路であり、第1出力ボートP,からのパルスS
P2が入力され、ソフトの暴走を検知したときローレベ
ルのパルスを前記マイコン10のリセット端子RESに
出力し、マイコン10をリセットさせる。
The present invention will be described below with reference to the drawings. In FIG. 1, numeral 10 is a microcomputer, in which a predetermined program is stored and stored, and external terminals include a first output port P, a second output port P2, a reset terminal RES, and a reference clock pulse for operating each part of the microcomputer. It has an ALE terminal from which a reference signal is oscillated. The first and second output ports P and P2' are normally at a low level. Also, this microcomputer 10 has a reset terminal RE.
When a low level pulse is input to S, a set is applied, and the second output port P2 rises to the level /.
When the microcomputer starts running and passes through the processing routine once, the second output port P2 returns to the low level. 20 is a first failure detection circuit, which receives pulses S from the first output port P,
When P2 is input and software runaway is detected, a low level pulse is output to the reset terminal RES of the microcomputer 10 to reset the microcomputer 10.

つまり、この第1故障検出回路2川ま第1の出力ボート
P,からのパルスSp2を第1のカゥン夕21のリセッ
ト端子Rに入力し、マイコン10の基準信号をクロツク
端子CLに受け、この基準信号の周期の2m倍された周
期TmのパルスSQmを第1カゥンタ21の出力端子Q
mから出力し、第1ィンバー夕22を介して反転された
パルスSomをマイコン10のリセット端子RESに入
力する。30は第2の故障検出回路であり、第2の出力
ボートP2からのパルスSp,が入力され、マイコン1
0のプログラム破壊に基づくソフトの暴走を検知したと
き、ハィレベルのパルスSすを出刀する。
That is, the pulse Sp2 from the first output port P of the first failure detection circuit 2 is inputted to the reset terminal R of the first counter 21, the reference signal of the microcomputer 10 is received at the clock terminal CL, and the pulse Sp2 from the first output port P is inputted to the reset terminal R of the first counter 21. A pulse SQm with a period Tm that is 2m times the period of the reference signal is sent to the output terminal Q of the first counter 21.
The pulse Som outputted from the microcomputer 10 and inverted via the first inverter 22 is input to the reset terminal RES of the microcomputer 10. 30 is a second failure detection circuit, into which the pulse Sp from the second output port P2 is input, and the microcomputer 1
When it detects software runaway due to program corruption in 0, it issues a high-level pulse S.

つまり、この第2故障検出回路3川ま先ず第2出力ボー
トP2からのパルスSp,が第2のィンバー夕32を介
して反転され、この反転したパルスSp,が第2のカウ
ンタ31のリセット端子Rに入力される。第2のカウン
タ31はマイコン10の基準信号をクロック端子CLに
受け、この基準信号の周期の2n(ただしn>m)倍さ
れた周期[nのパルスSQnを出力端子Qnから出力し
、さらにこのパルスSonをフリツプ・フロツプ33の
リセット入力端子Rに入力する。このフリップ・フロッ
プ33のセット入力端子Sにはマイコン10に供給され
る電源電圧VcがコンデンサCおよび抵抗器Rから構成
される遅延回路34を介して印加される。そして、フリ
ップ・フロップ33の反転出力端子Qから出力パルスS
亨が出力される。40は警報回路であり、出力パルスS
Qをェミッタ接地のNPN型トランジスタTRのベース
に受け、コレクタには電源電圧Vcが例えばブザー41
を介して印加される。
In other words, the pulse Sp from the second output port P2 of the second failure detection circuit 3 is inverted via the second inverter 32, and this inverted pulse Sp is sent to the reset terminal of the second counter 31. input to R. The second counter 31 receives the reference signal of the microcomputer 10 at the clock terminal CL, outputs a pulse SQn with a period [n] which is multiplied by 2n (where n>m) of the period of this reference signal from the output terminal Qn, and further A pulse Son is input to the reset input terminal R of the flip-flop 33. A power supply voltage Vc supplied to the microcomputer 10 is applied to a set input terminal S of this flip-flop 33 via a delay circuit 34 composed of a capacitor C and a resistor R. Then, an output pulse S is output from the inverting output terminal Q of the flip-flop 33.
Toru is output. 40 is an alarm circuit, and output pulse S
Q is received at the base of an NPN type transistor TR whose emitter is grounded, and a power supply voltage Vc is applied to the collector of a buzzer 41, for example.
applied via.

ここで、第2図は前記マイコン10のプログラムのフロ
ーチャートを示し、第3図はノイズ等によるすでに述べ
た第1の故障時におけるのタイミング図であり、第4図
はマイコンに大電圧や大電流が加わることによる第2の
故障時におけるタイミング図を示すものである。
Here, FIG. 2 shows a flowchart of the program of the microcomputer 10, FIG. 3 is a timing diagram at the time of the first failure due to noise etc., and FIG. 4 shows a flow chart of the program of the microcomputer 10. FIG. 10 shows a timing diagram at the time of a second failure due to the addition of

以下、第1図に示す実施例回路の動作について説明する
The operation of the embodiment circuit shown in FIG. 1 will be explained below.

先ずマイコン1川ま第2図のフローチャートにより処理
ルーチンを一周するまでは第2出力ボートP2はハィレ
ベルに維持される。つまり、第2の故障時には上記処理
ルーチンを抜けることができず、第2出力ボートP2は
/・ィレベルを維持するので、ブザー41が鳴り、前記
第2の故障も検知することができる。まず、第3図によ
り第1の故障の場合を説明する。
First, the second output port P2 is maintained at a high level until the microcomputer completes one cycle of the processing routine according to the flowchart of FIG. In other words, when the second failure occurs, the processing routine cannot be exited, and the second output port P2 maintains the level, so the buzzer 41 sounds and the second failure can also be detected. First, the case of the first failure will be explained with reference to FIG.

第2図に示すフローチャートにより、第1出力ボートP
,は処理ルーチンに入る直前で例えば5仏Secだけハ
イレベルとなる出力パルスSp2が出力され、処理ルー
チンを実行している間はローレベルに維持される。
According to the flowchart shown in FIG.
, outputs an output pulse Sp2 that becomes high level for, for example, 5 French seconds just before entering the processing routine, and is maintained at low level while the processing routine is executed.

このとき処理ルーチンの周期はTLなので、第1出力ボ
ートP,からはTL時間ごとにパルスSp2が出力され
ることになる。ところで第1カウンタ21の出力パルス
Somの1′2周期である期間TmはTm>TLに設定
される。したがって第1カウンタ21には常にリセット
がかかることになり、出力パルスSomは常にローレベ
ルとなる。ところが、第1の故障が起るとソフトの暴走
により、プログラムの流れが処理ルーチンから進むこと
ができず、出力パルスSp2が出力されなくなってしま
う。すると、出力パルスSp2が出力されない期間が期
間Tmを超え、第1カウンタ21にはリセットがかから
なくなる。その結果、前記出力パルスSomがハイレベ
ルとなってマイコン10にリセットがかかり、正常状態
に復帰する。なお、出力パルスSp,は出力パルスSo
mがハイレべルになった時点で/・ィレベルとなるが、
マイコン101こリセットがかかった時点からTL時間
経過後に出力パルスSp2が出力されるためにローレベ
ルに戻る。したがって出力パルスSp,がハィレベルと
なっているのはTL時間だけなので、出力パルスSon
およびSでは共にローレベルなのでブザーは鳴らない。
次に、第4図に従って第2の故障の場合を説明する。
At this time, since the cycle of the processing routine is TL, the pulse Sp2 is outputted from the first output port P every TL time. Incidentally, the period Tm, which is 1'2 cycles of the output pulse Som of the first counter 21, is set to Tm>TL. Therefore, the first counter 21 is always reset, and the output pulse Som is always at a low level. However, when the first failure occurs, the program flow cannot proceed from the processing routine due to software runaway, and the output pulse Sp2 is no longer output. Then, the period during which the output pulse Sp2 is not output exceeds the period Tm, and the first counter 21 is no longer reset. As a result, the output pulse Som becomes high level, the microcomputer 10 is reset, and returns to the normal state. Note that the output pulse Sp, is the output pulse So
When m reaches high level, it becomes /・i level,
Since the output pulse Sp2 is output after a time TL has elapsed since the microcomputer 101 was reset, it returns to the low level. Therefore, since the output pulse Sp, is at a high level only during the TL time, the output pulse Son
and S are both low level, so the buzzer does not sound.
Next, the second failure case will be explained according to FIG.

まず、第1の故障と同様に、第2の故障が起るといまら
くしてパルスSomがローレベルになることにより、マ
イコン10をリセットしようとする。
First, in the same way as the first failure, when the second failure occurs, the pulse Som suddenly changes to a low level, thereby attempting to reset the microcomputer 10.

ところが、プログラム自身が破壊されているためにリセ
ットされず、処理ルーチンを通過することもない。した
がって第2の故障発生後には出力パルスSp2が発生す
ることはなく、マイコン10をリセットしようとした時
点でハィレベルとなった出力パルスSp,はハィレベル
を維持し続け、このハィレベルの維持時間が第2カウン
タ31の出力パルスSonの1/2周期である期間Tn
を超える。その結果、出力パルスSQnはマイコン10
をリセットしようとした時点からTn時間経過後にハイ
レベルとなり、フリツプ・フロツプ33にリセットをか
ける。フリツプ・フロツプ33のセット入力端子Sには
電源電圧Vcが遅延回路34を介して入力され、端子S
をハイレベルを維持しているが、ハイレベルの出力パル
スSonが端子Rに加わることにより反転出力パルスS
Qはハィレべルに反転し、トランジスタTRはオンとな
りブザー41を鳴動する。以上の如く、本発明のマイコ
ンにおけるソフトの暴走の検出回路によれば、マイコン
にリセットをかければ元に戻る故障であるところのノイ
ズによるソフトの暴走と、マイコンにリセットをかけて
も元に戻らない故障すなわちマイコンに大電圧や大電流
が加わることによりプログラムが破壊されることによる
ソフトの暴走とを判別でき、前者のソフトの暴走の場合
には自動的にマイコンにリセットをかけて正常状態に復
帰せしめるとともに、後者のソフトの暴走の場合にはブ
ザーが8鳥ることにより検知できる。
However, since the program itself has been destroyed, it is not reset and does not pass through the processing routine. Therefore, after the occurrence of the second failure, the output pulse Sp2 is not generated, and the output pulse Sp, which became high level when the microcomputer 10 was tried to be reset, continues to maintain the high level, and this high level is maintained for the second time. A period Tn that is 1/2 period of the output pulse Son of the counter 31
Exceed. As a result, the output pulse SQn is
After time Tn has elapsed since the time when the flip-flop 33 was attempted to be reset, it becomes high level, and the flip-flop 33 is reset. The power supply voltage Vc is input to the set input terminal S of the flip-flop 33 via the delay circuit 34, and the terminal S
is maintained at a high level, but when the high level output pulse Son is applied to the terminal R, the inverted output pulse S
Q is inverted to a high level, transistor TR is turned on, and the buzzer 41 sounds. As described above, according to the software runaway detection circuit in a microcomputer of the present invention, software runaway due to noise is a malfunction that can be recovered by resetting the microcomputer, and software runaway due to noise cannot be recovered even if the microcomputer is reset. It is possible to determine whether the program is running out of control due to a large voltage or current being applied to the microcontroller, and in the case of the former software runaway, the microcontroller is automatically reset to return it to a normal state. In addition, in the latter case, if the software goes out of control, it can be detected by the buzzer sounding eight times.

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

第1図は本発明の実施例であり、第2図はマイクロ・コ
ンピュータのフ。 ログラムのフローチヤートであり、第3図および第4図
は実施例のタイミング図である。10:マイクロコンピ
ュータ、20:第1の故障検出回路、30:第2の故障
検出回路、40:警報回路、21,31:カゥンタ、2
2’32:インバータ、33:フリツプ・フロツプ、3
4:遅延回路、41:ブザー、Sp,:出力ボートP,
からの出力パルス、Sp2:出力ボートP2からの出力
パルス、SQm:カウンタ21の出力パルス、SQn:
カウンタ31の出力パルス、SQ:フリツプ・フロップ
33の反転出力パルス。 第1図 第3図 第2図 第4図
FIG. 1 shows an embodiment of the present invention, and FIG. 2 shows a diagram of a microcomputer. FIGS. 3 and 4 are timing diagrams of the embodiment. 10: Microcomputer, 20: First failure detection circuit, 30: Second failure detection circuit, 40: Alarm circuit, 21, 31: Counter, 2
2'32: Inverter, 33: Flip-flop, 3
4: Delay circuit, 41: Buzzer, Sp,: Output port P,
Sp2: Output pulse from output boat P2, SQm: Output pulse from counter 21, SQn:
Output pulse of counter 31, SQ: inverted output pulse of flip-flop 33; Figure 1 Figure 3 Figure 2 Figure 4

Claims (1)

【特許請求の範囲】[Claims] 1 蓄積された所定のプログラムに従って一定の処理ル
ーチンを処理実行すべくスタートされたときの初期設定
値が、互いに反転する第1と第2の値として出力される
一対の第1と第2出力ボートと、各部の演算処理を実行
するための駆動クロツクとして発振された基準信号が引
き出される基準クロツク端子とを備えるマイクロコンピ
ユータであって、 前記一定の処理ルーチンの処理実行
に入る前に前記第1出力ボートの初期設定値を反転し、
所定の時間の経過後にもとの前記初期設定値に戻し、前
記一定の処理ルーチンの処理実行を繰返すごとに前記反
転値が前記第1出力ボートから出現され、前記スタート
から前記一定の処理ルーチンの処理実行を1回終了した
後、前記第2出力ボートの前記初期設定値を反転し、こ
のマイクロコンピユータにリセツトがかけられたときの
み前記第2出力ボートを前記初期設定値に戻すようなマ
イクロコンピユータにおいて、 前記基準クロツク端子
から供給される前記基準信号に基づいて前記一定の処理
ルーチンの処理実行期間よりも長い第1の時間を計時し
、前記第1出力ボートの前記反転値が繰返し出現する時
間間隔を監視することによって、この間隔が前記第1の
時間を超えたときに前記マイクロコンピユータをリセツ
トする第1故障検出回路と、 前記第2出力ボートが前
記初期設定値を維持している間、前記基準クロツク端子
から供給される前記基準信号に基づいて前記第1の時間
よりも長い第2の時間を計時し、この第2の時間の計時
終了後に警報手段等の被制御部を作動する第2故障検出
回路とを設けたマイクロコンピユータのトラブル検出回
路。
1 A pair of first and second output ports in which initial setting values when a certain processing routine is started to be executed according to a stored predetermined program are output as first and second values that are inverted with each other. and a reference clock terminal from which a reference signal oscillated as a driving clock for executing arithmetic processing of each part is drawn out, the microcomputer comprising: a reference clock terminal from which a reference signal oscillated as a driving clock for executing arithmetic processing of each part is drawn out; Invert the boat's default settings,
After the lapse of a predetermined time, the initial setting value is returned to the original value, and each time the process execution of the certain process routine is repeated, the inverted value appears from the first output port, and the process of the certain process routine is continued from the start. A microcomputer that inverts the initial setting value of the second output port after completing one processing execution, and returns the second output port to the initial setting value only when a reset is applied to the microcomputer. A first time period longer than a processing execution period of the certain processing routine is measured based on the reference signal supplied from the reference clock terminal, and a time period during which the inverted value of the first output port repeatedly appears. a first fault detection circuit for monitoring an interval and resetting the microcomputer when the interval exceeds the first time; while the second output port maintains the initial setting value; A second time period that is longer than the first time period is measured based on the reference signal supplied from the reference clock terminal, and a controlled unit such as an alarm means is actuated after the second time period has been measured. 2. A trouble detection circuit for a microcomputer equipped with a trouble detection circuit.
JP55160685A 1980-11-17 1980-11-17 Microcomputer trouble detection circuit Expired JPS603654B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP55160685A JPS603654B2 (en) 1980-11-17 1980-11-17 Microcomputer trouble detection circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP55160685A JPS603654B2 (en) 1980-11-17 1980-11-17 Microcomputer trouble detection circuit

Publications (2)

Publication Number Publication Date
JPS5785154A JPS5785154A (en) 1982-05-27
JPS603654B2 true JPS603654B2 (en) 1985-01-30

Family

ID=15720247

Family Applications (1)

Application Number Title Priority Date Filing Date
JP55160685A Expired JPS603654B2 (en) 1980-11-17 1980-11-17 Microcomputer trouble detection circuit

Country Status (1)

Country Link
JP (1) JPS603654B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62114154A (en) * 1985-11-14 1987-05-25 Pioneer Electronic Corp Multidisc player

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62114154A (en) * 1985-11-14 1987-05-25 Pioneer Electronic Corp Multidisc player

Also Published As

Publication number Publication date
JPS5785154A (en) 1982-05-27

Similar Documents

Publication Publication Date Title
US4405982A (en) Arrangement for monitoring the function of a programmable electronic switching circuit
US4635258A (en) System for detecting a program execution fault
JP3520662B2 (en) Monitoring device for electronic control unit
JPS62157953A (en) Microcomputer provided with abnormality detecting function
JPS603654B2 (en) Microcomputer trouble detection circuit
JP4194748B2 (en) Arithmetic control unit
JP2002041493A (en) Microcomputer
JPH08202589A (en) Information processor and fault diagnostic method
JPH0792793B2 (en) Micro computer
JP2536789Y2 (en) Device for preventing malfunction of microcomputer system
JPH09237205A (en) Program runaway detection device
JPS5921061B2 (en) Runaway detection and recovery device for arithmetic processing unit
KR960042360A (en) Watchdog Methods and Circuits
JPH08142794A (en) Diagnosis circuit for runaway detecting circuit
JPS60126742A (en) Start supervisory system of information processing unit
JPH06139113A (en) Failure detector for watchdog timer
JP3005731B2 (en) Alarm protection circuit
JPS626262B2 (en)
JP3092199B2 (en) Timer
JPH04182743A (en) Restarting method for microprocessor
JPS59146354A (en) Runaway stopping device of microprocessor
JPH09212201A (en) Control circuit for production facility
JPS6154543A (en) Data processing system
JPH05158745A (en) Program runaway stopping device
JPH10171501A (en) Control circuit with watchdog