JPH01163845A - Control circuit for microcomputer - Google Patents

Control circuit for microcomputer

Info

Publication number
JPH01163845A
JPH01163845A JP62323203A JP32320387A JPH01163845A JP H01163845 A JPH01163845 A JP H01163845A JP 62323203 A JP62323203 A JP 62323203A JP 32320387 A JP32320387 A JP 32320387A JP H01163845 A JPH01163845 A JP H01163845A
Authority
JP
Japan
Prior art keywords
signal
microcomputer
res
reset
runaway
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
JP62323203A
Other languages
Japanese (ja)
Inventor
Fumio Yuasa
文夫 湯浅
Koichi Hotta
堀田 紘一
Yukichi Yazawa
裕吉 矢沢
Hideaki Sugawara
秀昭 菅原
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.)
Hitachi Heating Appliances Co Ltd
Original Assignee
Hitachi Heating Appliances 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 Hitachi Heating Appliances Co Ltd filed Critical Hitachi Heating Appliances Co Ltd
Priority to JP62323203A priority Critical patent/JPH01163845A/en
Publication of JPH01163845A publication Critical patent/JPH01163845A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To forcibly reset a microcomputer by providing the title control circuit for runaway detection to output the resetting signal of the microcomputer when the cycle of the signal of the microcomputer is out of a prescribed range. CONSTITUTION:When a microcomputer 1 runs away, for example, the cycle of a signal RES 1 becomes shorter than a TR1, and the signal RES 1 rises, a D latch 3 latches the value of a signal DATA, the signal DATA at such a time is still at High level because the cycle of the signal RES 1 is shorter than the TR1, and as this result, the signal at the same High level is outputted to a signal Q. Since the signal RES 1 rises at the High level, a signal RES 3 set by obtaining a NAND between the signals RES 1 and Q is at a Low level. For this reason, a signal RES 4 becomes at the High level, the microcomputer 1 is forcibly reset, and on the contrary, when the cycle of the signal RES 1 is longer than a TR2, the forcible reset can be carried out by the same action. Thus, the runaway microcomputer 1 can be forcibly reset.

Description

【発明の詳細な説明】 産業上の利用分野 本発明はマイクロコンピュータ制御システムにおけるマ
イクロコンピュータの暴走検出機能および暴走検出時の
強制リセット機能をもつ制御回路に関するものである。
DETAILED DESCRIPTION OF THE INVENTION Field of the Invention The present invention relates to a control circuit in a microcomputer control system that has a microcomputer runaway detection function and a forced reset function when runaway is detected.

従来の技術 従来マイクロコンピュータの暴走を検出するための手段
としては、(1)マイクロコンピュータの内蔵する暴走
検知機能(ウォッチ・ドッグ機能)を用いる方法、(つ
マイクロコンピュータの制御信号を外部回路または他の
マイクロコンピュータにて監視して暴走検出する方法な
どがとられてきた。
2. Description of the Related Art Conventionally, methods for detecting runaway in a microcomputer include (1) a method using the runaway detection function (watchdog function) built into the microcomputer; Methods such as monitoring with a microcomputer and detecting runaway have been used.

上記(1)の方式を以下説明する。第5図はマイクロコ
ンピュータ動作時の処理の流れを簡易的に示したもので
、太線矢印で示した流れがメインフローを表わし、■〜
[F]は表示処理、出力処理、キー取り込み処理などの
各メイン処理を示す。01O1■、■はサブ処理で各々
対応するメイン処理内で呼び出されて処理される。マイ
クロコンピュータは常時■→Φ−一−[F]→のの順で
各メイン処理とこれに付随するサブ処理を実行するため
、このメインフロー1周に要する時間、つまりプログラ
ムの走行時間はある規定できる範囲内の値となる。
The method (1) above will be explained below. Figure 5 simply shows the flow of processing when a microcomputer is operating, and the flow indicated by thick arrows represents the main flow.
[F] indicates each main process such as display processing, output processing, and key import processing. 01O1■ and ■ are sub-processes that are respectively called and processed within the corresponding main process. Since the microcomputer always executes each main process and its associated sub-processes in the order of ■→Φ-1-[F]→, the time required for one round of the main flow, that is, the running time of the program, is determined by a certain standard. The value is within the possible range.

暴走検出を行なうためにマイクロコンピュータの内部タ
イマーを専用に設け、一方プログラムにおいて1例えば
第6図で示したように第5図の[F]と[F]の処理の
間に、Oという処理を追加し、ここでは暴走検出用に設
けられた前記内部タイマーのリセットを行なうようにす
る。マイクロコンピュータが正常にメインフローを■→
■−−−■゛→のの順で実行している場合は毎回■処理
を行なってタイマーのリセットを行なうが、例えば暴走
が発生して破線矢印のようにO処理からの処理に移らず
に■処理に戻ってしまうような流れになると、■処理が
実行されなくなってタイマーがカウントをし続け、ある
時間が経過した時点でタイマーがオーバーフローしてし
まい、これによって暴走が検出できる。
In order to detect runaway, an internal timer of the microcomputer is dedicated, and on the other hand, in the program, as shown in FIG. In addition, here, the internal timer provided for detecting runaway is reset. The microcomputer normally runs the main flow ■→
■---■ If the process is executed in the order of ゛→, the ■ process is performed every time and the timer is reset, but for example, if a runaway occurs and the process does not move from the O process as shown by the dashed line arrow. ■If the flow returns to the process, ■the process will no longer be executed and the timer will continue to count, and after a certain period of time, the timer will overflow, and runaway can be detected.

暴走検出機能を有するマイクロコンピュータはこのオー
バーフローを直接ハード処理して、リセット用ポートに
リセット信号を送るという機能を持つ。
A microcomputer with a runaway detection function has the function of directly processing this overflow with hardware and sending a reset signal to the reset port.

上記(2)の方式は、このタイマー機能を外部回路また
は他のマイクロコンピュータで実現し、暴走を検出しよ
うとするマイクロコンピュータからメインフロー実行の
毎にタイマーのリセット信号を出力するものである。上
記(1)と同じ考え方で暴走時にこのリセット信号が出
力されなくなるため、外部に設けたタイマーが、プログ
ラムの走行時間から決められた規定値をオーバーし、こ
れを検出してマイクロコンピュータにリセット信号を送
るものである。
In the method (2) above, this timer function is realized by an external circuit or another microcomputer, and the microcomputer that attempts to detect runaway outputs a timer reset signal every time the main flow is executed. Using the same idea as in (1) above, this reset signal will not be output when the program runs out of control, so an external timer will detect when the program's running time exceeds a predetermined value and send a reset signal to the microcomputer. It is something to send.

発明が解決しようとする問題点 ところがこのような方式であると暴走の形態によっては
、つまり暴走時のプログラムの流れ方によっては検出で
きない場合が生じる。第6図において■処理を含む経路
でマイクロコンピュータが暴走した場合9例えば■→[
F]→[F]→■という流れで暴走した場合には■処理
が行なわれてタイマーがリセットされてしまうため、検
出することは不可能である。
Problems to be Solved by the Invention However, with such a system, depending on the form of runaway, that is, depending on the flow of the program at the time of runaway, it may not be possible to detect it. In Figure 6, if the microcomputer goes out of control on a path that includes ■ processing 9 For example, ■ → [
If there is a runaway in the flow of [F]→[F]→■, the process (2) is performed and the timer is reset, so it is impossible to detect it.

問題点を解決するための手段 この問題点を解決するためには、先に述べたプログラム
の走行時間がある範囲で規定されるという点に着目し、
走行時間を監視してこの規定範囲よりはずれた場合に暴
走と判定する手法を用いる。
Means for solving the problem In order to solve this problem, we should focus on the point that the running time of the program mentioned above is specified within a certain range.
A method is used in which the running time is monitored and if it deviates from this specified range, it is determined that the vehicle has run out of control.

こうすると、上記のような経路で暴走した場合は走行時
間が規定よりも短くなるためこれを検出できる分けであ
る。この手段はマイクロコンピュータ内部で行なおうと
するとハード処理だけでは難しく、ソフト処理、つまり
プログラムの助けを借りなければならないため、そのプ
ログラム自体が暴走してしまった場合には不可能であり
信頼性にかける。このためマイクロコンピュータの信号
の周期が規定された範囲をはずれた場合、マイクロコン
ピュータのリセット用の信号を出力する暴走検出用の制
御回路を設けたものである。
In this way, if the vehicle runs out of control on the route described above, the travel time will be shorter than the specified time, so this can be detected. If this method is attempted to be performed inside a microcomputer, it will be difficult to do so with only hardware processing, and it will require the help of software processing, that is, a program, which will be impossible and unreliable if the program itself goes out of control. put on. For this reason, a control circuit for detecting runaway is provided which outputs a signal for resetting the microcomputer when the period of the microcomputer signal deviates from a specified range.

作用 マイクロコンピュータのプログラムにおいてメインフロ
ー上にリセット信号を出力する処理を設け、メインフロ
ー実行毎に規定のパルス幅を有したリセット信号を出力
する。このリセット信号の周期は変動はするものの前述
のように規定されたある範囲に入っている。外部回路と
して、この信号の周期を監視できるように自身基準時間
を持った制御回路を設け、常時リセット信号の周期と、
自らの持つ基準時間との比較を行なう。リセット信号の
周期が自身の基準時間をはずれた場合は、マイクロコン
ピュータが暴走したと判定しマイクロコンピュータのリ
セットポートにリセット用の信号を送って強制的にリセ
ットする。
A process for outputting a reset signal on the main flow is provided in the program of the working microcomputer, and a reset signal having a prescribed pulse width is output every time the main flow is executed. Although the period of this reset signal varies, it falls within a certain range defined above. As an external circuit, a control circuit with its own reference time is provided so that the cycle of this signal can be monitored, and the cycle of the reset signal is constantly monitored.
Compare with your standard time. If the period of the reset signal deviates from its own reference time, it is determined that the microcomputer has gone out of control, and a reset signal is sent to the reset port of the microcomputer to force a reset.

実施例 以下本発明の一実施例を第1図〜第4図を参照して用い
て説明する。
EXAMPLE An example of the present invention will be described below with reference to FIGS. 1 to 4.

1はマイクロコンピュータである。2は二進カウンタ、
3はDラッチ、4は遅延回路、5はクロック信号発生回
路をそれぞれ示し、それらで制御回路を構成している。
1 is a microcomputer. 2 is a binary counter,
3 is a D latch, 4 is a delay circuit, and 5 is a clock signal generation circuit, which constitute a control circuit.

マイクロコンピュータ1のD端子からは正常時には周期
がT1以以下2以下のリセット信号RESIが出力され
ている。このリセット信号RES 1は遅延回路4によ
ってLowからHighの立ち上りのタイミングをtD
だけ遅らせてリセット信号RES2として二進カウンタ
2のリセット信号RESに入力されている。一方二進カ
ウンタ2の出力端子ONからはリセット信号RES 1
の解除後クロック信号発生回路5の基準クロック信号C
LKをN分周した信号を順次出力している。以上の信号
のタイミングチャートを第2図に示した。
The D terminal of the microcomputer 1 normally outputs a reset signal RESI having a period of T1 or more and 2 or less. This reset signal RES1 is controlled by the delay circuit 4 to adjust the rising timing from Low to High to tD.
It is inputted to the reset signal RES of the binary counter 2 as the reset signal RES2 after being delayed by the same amount. On the other hand, a reset signal RES 1 is sent from the output terminal ON of the binary counter 2.
After the release of the reference clock signal C of the clock signal generation circuit 5
Signals obtained by dividing LK by N are sequentially output. A timing chart of the above signals is shown in FIG.

第2図のように基準クロック信号CLKの周波数を選ん
で、ここではQn−、とQn比出力同時にHighにな
っている期間TR,〜TR,間に前記のT工とT8が入
るように設計している。Dラッチ3のDATA端子に入
力される信号DATAはQn−iとQn比出力NAND
をとったものであるからTR1〜TR,間のみLowで
他の期間はHighが入力されている。
The frequency of the reference clock signal CLK is selected as shown in Fig. 2, and the design is designed so that the above-mentioned T and T8 are inserted between the period TR, ~TR, in which Qn- and Qn ratio output are simultaneously high. are doing. The signal DATA input to the DATA terminal of D latch 3 is Qn-i and Qn ratio output NAND
Since the input signal is set to TR1 to TR, Low is input only during the period, and High is input during the other periods.

第3図に正常時の各部信号波形を示した。以下時間の経
過に従って動作を説明する。
Figure 3 shows the signal waveforms of various parts during normal operation. The operation will be explained below as time passes.

(1)信号RESIが立ち下った後A点(Qn−、とQ
nが両方Highに立ち上る直前)までDラッチ3はC
LOCK人力がLowの間は信号DATAの値f(i 
g hをそのままQ端子に出力する。このためQ端子か
ら出力される信号Qと信号RES 1 (7)NAND
をとった信号RES 3はHighとなっている。
(1) After the signal RESI falls, point A (Qn-, and Q
D latch 3 is C until immediately before both n rise to High.
While the LOCK input is Low, the value f(i
g Outputs h as is to the Q terminal. Therefore, the signal Q output from the Q terminal and the signal RES 1 (7) NAND
The signal RES3 that has taken the value is High.

(2)A点からB点(信号RESIが立ち上る直前)ま
で(1)と同様CLOCK入力はLowなのでDラッチ
3は信号DATAの値Lowを、信号Qとして出力し信
号RES 3はHighを継続する。
(2) From point A to point B (just before the signal RESI rises), as in (1), the CLOCK input is Low, so D latch 3 outputs the Low value of signal DATA as signal Q, and signal RES 3 continues to be High. .

(3)B点から6点(信号RES2が立ち上る直前)ま
で信号RESIが立ち上ることによりDラッチ3は信号
DATAの値Lowをラッチし、(ワと同じく信号Qは
Lowを出力して信号RES 3はHighを継続する
(3) As the signal RESI rises from point B to point 6 (just before the signal RES2 rises), the D latch 3 latches the low value of the signal DATA, and (same as W), the signal Q outputs the low value and the signal RES3 remains High.

(4)6点からD点(信号RES 1が立ち下る直前)
まで信号RES2が立ち上ると、二進カウンタ2がリセ
ットされQN出力はオールLowとなる。このため信号
DATAの値はHighとなるがすでに(3)でLow
のデータがラッチされているため、信号QはLow出力
を継続し、同じく信号RES3はHighのままである
(4) From point 6 to point D (just before signal RES 1 falls)
When the signal RES2 rises to the maximum, the binary counter 2 is reset and the QN outputs become all Low. Therefore, the value of the signal DATA becomes High, but it is already Low at (3).
Since the data is latched, the signal Q continues to output Low, and the signal RES3 also remains High.

(00点以降は上記(1)〜(4)の動作を繰り返す。(After 00 points, repeat the operations (1) to (4) above.

以上のようにRES3の信号は常時Highのため、マ
イクロコンピュータ1のリセット端子RESに入力され
る信号RES 4は常時Lowであり、リセットされる
ことはない。
As described above, since the signal RES3 is always High, the signal RES4 inputted to the reset terminal RES of the microcomputer 1 is always Low and is never reset.

ところが第4図のようにマイクロコンピュータ1が暴走
して例えば信号RES 1の周期がTR1より短くなっ
た場合には、次のようにしてマイクロコンピュータ1は
強制的にリセットされる。まず、信号RES 1が立ち
下った後B点(信号RESIが立ち上る直前)までは前
記正常時の(1)と同様の動作で信号RES 3がはH
ighになっている。ところが信号RES1が立ち上る
とDラッチ3は信号DATAの値をラッチするが、この
ときの信号DATAは信号RES 1の周期がTR□よ
り短いためまだHighであり、この結果信号Qには同
じ< Highの信号が出力される。信号RESIはH
ighに立ち上っているためこの信号Rr!、S1と信
号QのNANDをとった信号RES 3はLowになる
However, as shown in FIG. 4, when the microcomputer 1 goes out of control and, for example, the period of the signal RES1 becomes shorter than TR1, the microcomputer 1 is forcibly reset as follows. First, after the signal RES 1 falls until point B (just before the signal RESI rises), the operation is the same as in (1) during normal operation, and the signal RES 3 goes high.
It has become igh. However, when the signal RES1 rises, the D latch 3 latches the value of the signal DATA, but the signal DATA at this time is still High because the period of the signal RES1 is shorter than the TR□, and as a result, the signal Q has the same < High signal is output. Signal RESI is H
This signal Rr! , S1 and signal Q are NAND'ed together, and the signal RES3 becomes Low.

このため信号RES4は)Iighとなりマイクロコン
ピュータ1は強制的にリセットされる。逆に、信号RE
S 1の周期がTR2よりも長くなったときも同様の動
作によってこれを検出し、強制リセットを実行する。
Therefore, the signal RES4 goes high and the microcomputer 1 is forcibly reset. Conversely, the signal RE
When the period of S1 becomes longer than TR2, this is detected by the same operation and a forced reset is executed.

発明の効果 以上の説明のように本発明によって従来本質的に検出す
ることができなかったマイクロコンピュータの暴走が検
出可能となり、合わせて暴走したマイクロコンピュータ
を強制的にリセットすることによってシステムの安全性
を向上することが出来る。
Effects of the Invention As explained above, the present invention makes it possible to detect a runaway in a microcomputer, which was essentially undetectable in the past, and also improves system safety by forcibly resetting a runaway microcomputer. can be improved.

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

第1図は本発明に基づく一実施例を示した制御回路図で
、第2図から第4図はこの一実施例における各部の信号
波形図を示し、第5図はマイクロコンピュータの処理フ
ローの説明図、第6図はこれに暴走検知機能を加えた従
来の説明図である。 1・・・マイクロコンピュータ。 2・・・二進カウンタ、 3・・・Dラッチ、4・・・
遅延回路、 5・・・クロック信号発生回路。
Fig. 1 is a control circuit diagram showing an embodiment based on the present invention, Figs. 2 to 4 show signal waveform diagrams of various parts in this embodiment, and Fig. 5 shows a processing flow of a microcomputer. An explanatory diagram, FIG. 6, is an explanatory diagram of a conventional system in which a runaway detection function is added to this. 1...Microcomputer. 2... Binary counter, 3... D latch, 4...
delay circuit; 5... clock signal generation circuit;

Claims (1)

【特許請求の範囲】[Claims] ある規定された範囲の周期をもつ信号を常時出力するマ
イクロコンピュータと、このマイクロコンピュータの出
力信号を入力しその周期の変化を監視するとともに前記
出力信号の周期が規定された範囲をはずれた場合に前記
マイクロコンピュータのリセット用の信号を出力する制
御回路とで構成されたことを特徴とするマイクロコンピ
ュータの制御回路。
A microcomputer that constantly outputs a signal with a period within a specified range, and a microcomputer that inputs the output signal of this microcomputer and monitors changes in the period, and when the period of the output signal deviates from the specified range. A control circuit for a microcomputer, comprising: a control circuit that outputs a signal for resetting the microcomputer.
JP62323203A 1987-12-21 1987-12-21 Control circuit for microcomputer Pending JPH01163845A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62323203A JPH01163845A (en) 1987-12-21 1987-12-21 Control circuit for microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62323203A JPH01163845A (en) 1987-12-21 1987-12-21 Control circuit for microcomputer

Publications (1)

Publication Number Publication Date
JPH01163845A true JPH01163845A (en) 1989-06-28

Family

ID=18152193

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62323203A Pending JPH01163845A (en) 1987-12-21 1987-12-21 Control circuit for microcomputer

Country Status (1)

Country Link
JP (1) JPH01163845A (en)

Similar Documents

Publication Publication Date Title
US4636656A (en) Circuit for selectively extending a cycle of a clock signal
US6545508B2 (en) Detection of clock signal period abnormalities
US6008672A (en) Input signal reading circuit having a small delay and a high fidelity
JPH02283120A (en) Noise eliminator
JPH01163845A (en) Control circuit for microcomputer
JP3894787B2 (en) Receiver circuit
JPH07212413A (en) Reception circuit for asynchronous data
JPH05143480A (en) Monitor circuit for communication equipment
JPH05191470A (en) Communication condition recognizing method for start-stop transmission
JP2689778B2 (en) Runaway detection device for electronic control unit
JP2864779B2 (en) Pulse input circuit
JP2606458Y2 (en) Signal level monitoring circuit
JP2001077800A (en) Serial transmission transmission/reception circuit
JPH0147935B2 (en)
JPH01163992A (en) Microcomputer control circuit for high-frequency heating device
JPH01296838A (en) Noise detecting system for external input
JPS6115437A (en) Start bit detection circuit of serial data reception system
JP3014868B2 (en) Start bit detection device in data transmission device
JP2853374B2 (en) Frame synchronization circuit
JPH04239340A (en) Method and device for detection of software processing abnormality
CN118259068A (en) Voltage detection circuit, analog comparator and chip
JPH0767288B2 (en) Gate pulse controller for thyristor inverter
JPH0425240A (en) Burst signal monitoring circuit
JPH01163844A (en) Control circuit for microcomputer
JPH06319172A (en) Data transmission system for vehicle