JPS6345648A - Automatic runaway processor for microcomputer - Google Patents

Automatic runaway processor for microcomputer

Info

Publication number
JPS6345648A
JPS6345648A JP61188744A JP18874486A JPS6345648A JP S6345648 A JPS6345648 A JP S6345648A JP 61188744 A JP61188744 A JP 61188744A JP 18874486 A JP18874486 A JP 18874486A JP S6345648 A JPS6345648 A JP S6345648A
Authority
JP
Japan
Prior art keywords
runaway
processing
program
microcomputer
frequency
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
JP61188744A
Other languages
Japanese (ja)
Inventor
Joji Nagahira
譲二 永平
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP61188744A priority Critical patent/JPS6345648A/en
Publication of JPS6345648A publication Critical patent/JPS6345648A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To ensure automatic runaway detection of a program with high accuracy by providing a detection means which detects the runaway of the program from the holding value of an executing frequency holding means obtained when a prescribed time is lapsed and a runaway processing means. CONSTITUTION:An automatic runaway deciding means 10, an interrupting means 20 and an abnormality processing means 30 consist of a memory 1, an arithmetic part 2 and a control part 3. The means 10 includes a processing repetitive executing part 11, a main processing frequency memory 12 serving as an executing frequency holding means which holds the executing frequency of a main program, an interruption frequency memory 13 and a checking part 14. The memory 13 stores the interruption frequency NI received from the means 20 and the part 14 checks the main action executing frequency for each main processing, i.e., at every time the interruption frequency received from the means 20 exceeds the prescribed frequency NIC. The means 30 performs the processing against the program runaway of a microcomputer MC when the main processing has an abnormal action, i.e., when the program runaway is occurred.

Description

【発明の詳細な説明】 「産業上の利用分野」 本発明は、マイクロプロセッサの動作が正規のプログラ
ム実行状態から逸脱して異常な実行を行なっている場合
に、その異常を検知し、処理するマイクロコンピュータ
の自己暴走処理装置に関する。
[Detailed Description of the Invention] "Industrial Application Field" The present invention detects and processes the abnormality when the operation of a microprocessor deviates from the normal program execution state and performs abnormal execution. This invention relates to a self-runaway processing device for a microcomputer.

[従来の技術] 従来ノマイクロコンピュータの自己暴走処理装置として
は、マイクロコンピュータの外部にリトリガタイプの単
安定マルチ八イブレータを設けたものが知られている。
[Prior Art] Conventionally, as a self-runaway processing device for a microcomputer, one in which a retrigger type monostable multi-octabulator is provided outside the microcomputer is known.

即ち、そのマイクロコンピュータの所定ボートからプロ
グラム命令によりトリガ信号を所定の周期以内で単安定
マルチバイブレータに送り、その単安定マルチバイブレ
ータの出力端子をマイクロコンピュータのリセット端子
または割込端子に接続するものである。
That is, a trigger signal is sent from a predetermined port of the microcomputer to a monostable multivibrator within a predetermined period according to a program instruction, and the output terminal of the monostable multivibrator is connected to the reset terminal or interrupt terminal of the microcomputer. be.

そして、マイクロコンピュータからのトリガ信号の所定
周期よりも、単安定マルチバイブレータの出力パルスの
幅を長く設定することによって、単安定マルチバイブレ
ータを駆動するものである。従ってマイクロコンピュー
タが正常動作を行なっている限り、単安定マルチバイブ
レータには常にリトリガがかかり、その出力は常にオン
状態一定となる。ここで何らかの原因でプログラムが暴
走し、単安定マルチバイブレータにリトリガがかからな
い場合には、その出力がオン状態よりオフ状態に変化す
る。よってこの単安定マルチ八イブレータの出力状態を
検知することによりマイクロコンピュータの自己暴走を
検知することができる。
The monostable multivibrator is driven by setting the width of the output pulse of the monostable multivibrator to be longer than the predetermined period of the trigger signal from the microcomputer. Therefore, as long as the microcomputer is operating normally, the monostable multivibrator is always retriggered and its output is always on. If the program goes out of control for some reason and the monostable multivibrator is not retriggered, its output changes from the on state to the off state. Therefore, self-runaway of the microcomputer can be detected by detecting the output state of this monostable multi-octibrator.

[発明が解決しようとする問題点] 従って従来の装置においては、自己暴走を検知するため
に特別のハードウェアを必要とし、構成が複雑になると
共に設計時に検知構成を組み入れていない場合には中途
での機能追加はできなかった。
[Problems to be Solved by the Invention] Therefore, in conventional devices, special hardware is required to detect self-runaway, and the configuration becomes complicated and if a detection configuration is not incorporated at the time of design, It was not possible to add functionality.

[問題点を解決するための手段] この問題を解決するための一手段として、例えばマイク
ロコンピュータにおける所定のプログラムの実行回数を
保持する実行回数保持手段と、所定のプログラム実行毎
に実行回数保持手段をカウントアツプするカウントアツ
プ手段と、所定時間経過時の実行回数保持手段の保持値
によりプログラム暴走を検知する検知手段と、該検出手
段で検出したプログラム暴走を処理する暴走処理手段と
を4inえる。
[Means for Solving the Problem] As a means for solving this problem, for example, an execution number holding means for holding the number of executions of a predetermined program in a microcomputer, and an execution number holding means for each execution of a predetermined program are provided. A count up means for counting up the number of times, a detection means for detecting program runaway based on the value held in the execution count holding means when a predetermined time has elapsed, and a runaway processing means for processing the program runaway detected by the detection means are increased by 4 inches.

[作用コ かかる構成をマイクロコンピュータ内に組み込むことに
より、他の構成を殆ど必要としないでプログラムの暴走
検知及びプログラムの暴走に対する処理を行なえる。
[Operation] By incorporating such a configuration into a microcomputer, program runaway detection and program runaway processing can be performed with almost no other configuration required.

〔実施例〕〔Example〕

第1図は、本発明に係る一実施例を示すブロック図であ
り、第2図は、第1図に示す本実施例をより具体的に示
すブロック図である。
FIG. 1 is a block diagram showing one embodiment of the present invention, and FIG. 2 is a block diagram showing the embodiment shown in FIG. 1 in more detail.

第1図において、マイクロコンピュータMCは、メモリ
1と演算部2と制御部3とを有する。
In FIG. 1, a microcomputer MC has a memory 1, an arithmetic section 2, and a control section 3.

メモリ1は所定のプログラムおよび所定データを記憶す
るものであり、演算部2は所定の演算を行なうものであ
り、制御部3は、メモリlおよび演算部2等を制御しな
がら、メモリ1に格納されたプログラムを逐次実行する
ものである。
The memory 1 stores predetermined programs and predetermined data, the calculation unit 2 performs predetermined calculations, and the control unit 3 stores data in the memory 1 while controlling the memory 1 and the calculation unit 2, etc. The program is executed sequentially.

US2図に示す自己暴走判定手段10と割込手段20と
異常処理手段30とは、第1図に示すメモリ1とv!′
JX部2と制御883とによって構成されるものである
The self-runaway determination means 10, the interrupt means 20, and the abnormality processing means 30 shown in FIG. US2 are connected to the memory 1 and v! shown in FIG. ′
It is composed of the JX section 2 and the control 883.

ここで、自己暴走判定手段10は、マイクロコンピュー
タMCにおけるプログラム実行動作状態(以下、メイン
処理と称す)を監視するものであり、処理繰り返し実行
部11、メインプログラムの実行回数を保持する実行回
数保持手段であるメイン処理回数メモリ121割込回数
メモリ13及び検査部14とを有する。
Here, the self-runaway determination means 10 monitors the program execution operating state (hereinafter referred to as main processing) in the microcomputer MC, and the processing repeat execution unit 11 has an execution count holding unit that holds the number of executions of the main program. It has a main processing number memory 121, an interrupt number memory 13, and an inspection section 14, which are means.

メイン処理回数メモリ12はメイン処理の実行情報、具
体的にはメイン動作の回数を記憶するものであり、割込
回数メモリ13は割込手段20よりの割込み回数NIを
記憶するものである。また、検査部14はメイン処理毎
に(割込手段20よりの割込回数が所定数NIC経過し
た時点毎に)そのメイン動作実行回数を検査する。
The main processing number memory 12 is for storing main processing execution information, specifically the number of main operations, and the interrupt number memory 13 is for storing the number of interrupts NI from the interrupt means 20. Furthermore, the inspection unit 14 inspects the number of executions of the main operation for each main process (every time the number of interruptions from the interrupting means 20 has elapsed by a predetermined number of NICs).

なお、ここでいうメイン処理とは、ある1まとまりの処
理のことをいう。
Note that the main processing here refers to a certain set of processing.

割込手段20は、マイクロコンピュータMC(7)内部
タイマによって、周期的に割込を行なうものであり、マ
イクロコンピュータMCの内部タイマに替えて外部タイ
マを使用して実行してもよい。
The interrupt means 20 periodically interrupts using an internal timer of the microcomputer MC (7), and may be executed using an external timer instead of the internal timer of the microcomputer MC.

異常処理手段30は、メイン処理が異常動作をしたとき
に(プログラム暴走が発生したときに)マイクロコンピ
ュータMCのプログラム暴走に対する処理を行う手段で
あり、表示手段40に異常表示させたり、所定プログラ
ムの再スタート等を行なうものである。
The abnormality processing means 30 is a means for processing a runaway program of the microcomputer MC when the main processing malfunctions (when a program runaway occurs), and displays an abnormality on the display means 40, or displays a predetermined program. This is for restarting, etc.

次に、以上の構成より成る本実施例の動作を第3図(A
)、CB)のフローチャートを参照して説明する。
Next, the operation of this embodiment with the above configuration will be explained in FIG. 3 (A
), CB) will be explained with reference to the flowcharts.

最初に演算部2、制御部3におけるメイン処理を第3図
(A)のメイン処理フローチャートを参照して説明する
First, the main processing in the calculation section 2 and the control section 3 will be explained with reference to the main processing flowchart in FIG. 3(A).

まず、ステップS1でマイクロコンピュータMCのメモ
リ1に初期値を設定し1割込みを許容し、メイン処理回
数メモリ12をリセットする。
First, in step S1, an initial value is set in the memory 1 of the microcomputer MC, one interrupt is allowed, and the main processing number memory 12 is reset.

ここではメイン処理の回数Mを記憶しているメイン処理
回数メモリ12、及び割込手段よりの割込み数NIを保
持する割込回数メモリ13を共に“O″にセットする。
Here, both the main processing number memory 12, which stores the number M of main processing, and the interrupt number memory 13, which holds the number NI of interrupts from the interrupt means, are set to "O".

続くステップS2で処理繰り返し実行部11はメイン処
理を1口実行し、この処理が終了した時にステップS3
でメイン処理回数メモリ12を1つインクリメントし、
[M]=[M]+1として再びステップS2に戻る。
In the following step S2, the process repeat execution unit 11 executes one main process, and when this process is finished, the process repeats in step S3.
Increment the main processing number memory 12 by 1 with
[M]=[M]+1 and returns to step S2 again.

メイン処理においては処理実行毎にステップS2、ステ
ップS3を繰り返し実行して行く。
In the main process, steps S2 and S3 are repeatedly executed each time the process is executed.

次に自己暴走判定手段工oにおける暴走検知処理を第3
図(B)の割込み処理フローチャートを参照して説明す
る。
Next, the runaway detection process in the self-runaway determination means o is carried out in the third step.
This will be explained with reference to the interrupt processing flowchart shown in FIG.

ステップSIOで割込手段20又は他の外部装置等より
の割込みがかかると演算部2、制御部3は予め定められ
た割込み処理を実行する。そして割込み処理が終了する
とステップSllで割込回数メモリ13を1つインクリ
メントし[NI]=[NI]+1とし、続くステップS
12で割込回数メモリ13の保持割込回数(NI)が所
定の回数[NIC]の値より小さいが否かを調べる。こ
こで(NI)< (Nxc)の時には何もせず処理を抜
はメイン処理に戻る。(NI)< (NIC)でない時
にはステップS13に進み、メイン処理回数メモリ12
の値が[a<M<bl を満足しているか否かを調べ、
満足していなければステップ515に進み異常処理を行
う。
When an interrupt is generated from the interrupt means 20 or another external device in step SIO, the calculation section 2 and the control section 3 execute predetermined interrupt processing. When the interrupt processing is completed, the interrupt count memory 13 is incremented by one in step Sll to set [NI]=[NI]+1, and the subsequent step S
In step 12, it is checked whether the number of interrupts (NI) held in the interrupt number memory 13 is smaller than the value of the predetermined number [NIC]. Here, if (NI)<(Nxc), nothing is done, the process is skipped, and the process returns to the main process. If (NI)<(NIC), the process advances to step S13, and the main processing number memory 12
Check whether the value of satisfies [a<M<bl,
If not satisfied, the process advances to step 515 and abnormality processing is performed.

満足していればステップS13よリステップS14に進
み、メイン処理回数メモリ12及び割込回数メモリ13
をそれぞれ“O°゛にクリアして処理を抜け、メインル
ーチンにリターンする。
If satisfied, the process proceeds from step S13 to restep S14, where the main processing number memory 12 and the interrupt number memory 13 are stored.
are cleared to "O°", exit the process, and return to the main routine.

ここで上述の割込みの実行回数[NIC]は任意に定め
うるちのであり、メイン処理を1回実行した時に生じる
割込手段20よりの割込みの回数に応じて適時選択され
ることが望ましい。
Here, the above-mentioned number of interrupt executions [NIC] can be determined arbitrarily, and is preferably selected at an appropriate time depending on the number of interrupts from the interrupt means 20 that occur when the main process is executed once.

また、“a”′とb″°の各個は、[N I Cl回の
割込み処理が実行される間に実行されると予想されるメ
イン処理の実行回数に応じて定められる値であり、予想
されるメイン処理の実行回数の最小回数よりやや小なる
値を“a”とし、最大回数よりやや大なる値を”b“と
している。
Furthermore, each of “a”′ and b″° is a value determined according to the number of times the main process is expected to be executed while [N I Cl interrupt processes are executed; A value slightly smaller than the minimum number of times the main processing is executed is set as "a", and a value slightly larger than the maximum number is set as "b".

もし、メイン処理の実行中に、自己暴走にょって1つの
プログラムから他のプログラムへ異常にジャンプした場
合、又は割り込みが入らない場合には、ステップS13
においてメイン処理回数メモリ12の値Mが、所定の値
(つまり、a〜b)の間に入゛らない、この場合にはス
テップS13よりステップS15の異常処理に進み、表
示手段40にプログラム暴走を表示する等の処理を行う
If an abnormal jump occurs from one program to another due to self-runaway during execution of the main process, or if no interrupt occurs, step S13
In this case, the value M of the main processing number memory 12 does not fall within the predetermined range (that is, a to b). In this case, the process proceeds from step S13 to step S15, and the display means 40 displays a program runaway message. Perform processing such as displaying.

また、異常処理として表示手段40への表示でなく場合
によっては装置にイニシャルリセットを起動し、再びス
テップS1より再スタートさせてもよい、この場合には
マイクロコンピュータMCのリセット端子に公知の方法
でリセット信号を入力させればよい。
In addition, as an abnormality process, instead of displaying on the display means 40, depending on the case, the device may be started to initial reset and restarted from step S1. In this case, the reset terminal of the microcomputer MC may be All you have to do is input a reset signal.

なお、マイクロコンピュータMCの外部にカウンタを設
け、このカウンタに上記割込の回数をカウントさせ、自
己暴走の有無を判断させるようにしてもよい。
Note that a counter may be provided outside the microcomputer MC, and this counter may be configured to count the number of the above-mentioned interrupts, and to determine whether or not self-runaway has occurred.

また以上の説明においては、メイン処理を複数回実行し
た後に異常を検出(検知)するようにしており、比較的
長いプログラムに適している。つまり、プログラムが比
較的長い場合にはその割込み処理を1回実行する間に生
ずるメイン処理の回数が少ないので、その1回の割込み
処理ではメイン処理回数を発見し難いが、その割込みを
複数実行すればメイン処理回数を確実に検出でき、プロ
グラムの自己暴走の発見が確実に行われ、その処理が適
切になる。
Furthermore, in the above description, the abnormality is detected after the main processing is executed a plurality of times, which is suitable for relatively long programs. In other words, if the program is relatively long, the number of main processings that occur during one interrupt processing is small, so it is difficult to discover the number of main processings in one interrupt processing, but if the interrupt is executed multiple times. By doing so, the number of main processing times can be reliably detected, self-runaway programs can be detected reliably, and the processing can be carried out appropriately.

以上説明した様に本実施例によれば、マイクロコンピュ
ータの自己暴走を他の特別のハードウェア回路を必要と
せずに検出し、対処することができる。また、上記カウ
ンタ値が一定の範囲内に納まるか否かを調べることによ
り、単に所定時間内に所定割込みがなかった場合のみな
らず、割込みが多過ぎた場合にもこれを検出することが
でき。
As described above, according to this embodiment, self-runaway of a microcomputer can be detected and dealt with without the need for any other special hardware circuit. Furthermore, by checking whether the above counter value falls within a certain range, it is possible to detect not only cases where there are no specified interrupts within a specified period of time, but also cases where there are too many interrupts. .

非常に精度の高い自己暴走検出が行なえる。Self-runaway detection can be performed with extremely high accuracy.

[発明の効果] 以上説明した様に本発明によれば、非常に精度の高いプ
ログラムの自己暴走検出が行なえ、また、この自己暴走
検出のために特別のハードウェア構成の追加を必要とし
ないマイクロコンピュータの自己暴走処理装置が提供で
きる。
[Effects of the Invention] As explained above, according to the present invention, self-runaway detection of a program can be performed with extremely high accuracy, and a microprocessor that does not require the addition of a special hardware configuration for this self-runaway detection can be performed. A computer self-runaway processing device can be provided.

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

第1図は本発明に係る一実施例を示すブロック図、 第2図は本実施例の詳細ブロック図、 第3図(A)、CB)は本実施例の動作を示すフローチ
ャートである。 図中、■・・・メモリ、2・・・演算部、3・・・制御
部。 lO・・・自己暴走判定手段、11・・・処理繰り返し
実行部、12・・・メイン処理回数メモリ、13・・・
割込回数メモリ、14・・・検査部、20・・・割込手
段、30・・・異常処理手段、40・・・表示手段、M
C・・・マイクロコンピュータである。 特許出願人  キャノン株式会社 代理人 弁理士  大 塚 康 徳、、V−。 ;・−ll↑ □ 、−。 ・  ・ 、−÷。 (!□−!シ MC。 第1図 < MC 第2図 箪3図(A) メインタ/1理
FIG. 1 is a block diagram showing an embodiment according to the present invention, FIG. 2 is a detailed block diagram of the embodiment, and FIG. 3 (A) and CB) are flowcharts showing the operation of the embodiment. In the figure, ■...Memory, 2...Arithmetic unit, 3...Control unit. lO... Self-runaway determination means, 11... Processing repetition execution unit, 12... Main processing number memory, 13...
Interruption number memory, 14... Inspection unit, 20... Interruption means, 30... Abnormality processing means, 40... Display means, M
C... It is a microcomputer. Patent applicant Yasunori Otsuka, patent attorney, Canon Co., Ltd., V-. ;・-ll↑□ ,-.・ ・ , −÷. (!□-! MC. Figure 1 < MC Figure 2 Figure 3 (A) Mainter/1 Logic

Claims (5)

【特許請求の範囲】[Claims] (1)マイクロコンピュータにおける所定のプログラム
の実行回数を保持する実行回数保持手段と、前記所定の
プログラム実行毎に該実行回数保持手段をカウントアッ
プするカウントアップ手段と、所定時間経過時の前記実
行回数保持手段の保持値によりプログラム暴走を検知す
る検知手段と、該検出手段で検出したプログラム暴走を
処理する暴走処理手段とを有することを特徴とするマイ
クロコンピュータの自己暴走処理装置。
(1) Execution count holding means for holding the number of executions of a predetermined program in a microcomputer; count-up means for counting up the execution count holding means every time the predetermined program is executed; and the number of executions after a predetermined time elapses. A self-runaway processing device for a microcomputer, comprising a detection means for detecting a program runaway based on a value held by the holding means, and a runaway processing means for processing the program runaway detected by the detection means.
(2)検知手段は所定時間経過時の実行回数保持手段の
カウントアップ値が所定の範囲内でない時にプログラム
暴走とすることを特徴とする特許請求の範囲第1項記載
のマイクロコンピュータの自己暴走処理装置。
(2) Self-runaway processing of a microcomputer according to claim 1, wherein the detection means determines that the program has runaway when the count-up value of the execution number holding means after a predetermined time has elapsed is not within a predetermined range. Device.
(3)検知手段は所定時間の経過をマイクロコンピュー
タに備えられたタイマ計時手段の計時値により判定する
ことを特徴とする特許請求の範囲第1項又は第2項記載
のマイクロコンピュータの自己暴走処理装置。
(3) A self-runaway process of a microcomputer as set forth in claim 1 or 2, wherein the detection means determines the elapse of a predetermined time based on a measured value of a timer clocking means provided in the microcomputer. Device.
(4)暴走処理手段は、暴走状態を表示する表示手段を
作動させるものであることを特徴とする特許請求の範囲
第1項記載のマイクロコンピュータの自己暴走処理装置
(4) A self-runaway processing device for a microcomputer according to claim 1, wherein the runaway processing means operates a display means for displaying a runaway state.
(5)暴走処理手段は、所定プログラムを再スタートさ
せるものであることを特徴とする特許請求の範囲第1項
記載のマイクロコンピュータの自己暴走処理装置。
(5) A self-runaway processing device for a microcomputer according to claim 1, wherein the runaway processing means restarts a predetermined program.
JP61188744A 1986-08-13 1986-08-13 Automatic runaway processor for microcomputer Pending JPS6345648A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP61188744A JPS6345648A (en) 1986-08-13 1986-08-13 Automatic runaway processor for microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP61188744A JPS6345648A (en) 1986-08-13 1986-08-13 Automatic runaway processor for microcomputer

Publications (1)

Publication Number Publication Date
JPS6345648A true JPS6345648A (en) 1988-02-26

Family

ID=16229011

Family Applications (1)

Application Number Title Priority Date Filing Date
JP61188744A Pending JPS6345648A (en) 1986-08-13 1986-08-13 Automatic runaway processor for microcomputer

Country Status (1)

Country Link
JP (1) JPS6345648A (en)

Similar Documents

Publication Publication Date Title
JP2007534049A (en) Watchdog system and method for monitoring processor functionality
JPS6345648A (en) Automatic runaway processor for microcomputer
JPH06168163A (en) Method and device for monitoring cpu
JP2003210800A (en) Game machine
JP2965075B2 (en) Program execution status monitoring method
JP4322606B2 (en) Watchdog timer
JPS63163932A (en) System monitoring system for control computer
JP2006227962A (en) System and method for monitoring application task
JPS6345647A (en) Automatic runaway processor for microcomputer
JP4313858B2 (en) calculator
JPS61193236A (en) Self-runaway handling device of microcomputer
JPS61194539A (en) Self-runaway processor of microcomputer
JPH0334037A (en) Processing system for detection of system abnormality
JPH064318A (en) Error detecting system
JPS61193237A (en) Self-runaway handling device of microcomputer
JPH04280329A (en) Program abnormality detection system
JP2003044324A (en) Method, device and program for confirming abnormality detection
JP2009110110A (en) Monitoring control system, monitoring control method and monitoring control program
JP2002163008A (en) Circuit and method for detecting run-away of programable controller
JPS63280345A (en) Detection of program abnormality
JP2695785B2 (en) Processing state display method of processing unit
JPS6389941A (en) Monitor and control equipment for microprocessor applied equipment
JPH03152637A (en) Abnormality diagnostic system
JPH033041A (en) Time-out monitoring circuit
JP2725107B2 (en) Interrupt device