JPS6186848A - Detection method for microcomputer runaway - Google Patents

Detection method for microcomputer runaway

Info

Publication number
JPS6186848A
JPS6186848A JP59206998A JP20699884A JPS6186848A JP S6186848 A JPS6186848 A JP S6186848A JP 59206998 A JP59206998 A JP 59206998A JP 20699884 A JP20699884 A JP 20699884A JP S6186848 A JPS6186848 A JP S6186848A
Authority
JP
Japan
Prior art keywords
converter
microcomputer
runaway
program
contents
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
JP59206998A
Other languages
Japanese (ja)
Inventor
Koji Tanagawa
棚川 幸次
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.)
Oki Electric Industry Co Ltd
Original Assignee
Oki Electric Industry 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 Oki Electric Industry Co Ltd filed Critical Oki Electric Industry Co Ltd
Priority to JP59206998A priority Critical patent/JPS6186848A/en
Publication of JPS6186848A publication Critical patent/JPS6186848A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To detect the runaway of a program in a real time by applying a D/A conversion to the contents of a program counter and monitoring the analog voltage. CONSTITUTION:An instruction is usually executed while the contents of a program counter 2 are increased successively. Thus the 2-bit digital digital values are supplied to the input of a D/A converter 4 in the order of 00 01 10 11-, and the output of the converter 4 is changed in the expected value. While the contents of the counter 2 are rewritten to the unexpected value when a microcomputer 1 has a runaway. Therefore the analog voltage obtained by the converter 4 through a D/A conversion is also set at an unexpected level at a time point when said runaway is produced. Thus a program runaway can be detected in real time by comparing the output of the converter 4 with an existing normal voltage waveform.

Description

【発明の詳細な説明】 (産業上の利用分野) この発明は、マイクロコンピュータの暴走検出方法に関
する。
DETAILED DESCRIPTION OF THE INVENTION (Field of Industrial Application) The present invention relates to a method for detecting runaway of a microcomputer.

(従来の技術) マイクロコンピュータの暴走検出方法として、従来、例
えば富士通乗積回路・マイクロコンピュータファミリ(
1982−4)P、264に示されているようなウォッ
チドッグタイマが知られている。
(Prior Art) Conventionally, as a method for detecting runaway of a microcomputer, for example, Fujitsu multiplication circuit/microcomputer family (
A watchdog timer as shown in No. 1982-4) P, 264 is known.

これは、マイクロコンピュータに内、滅されたタイマを
命令によって一定時間毎にリセットするようにプログラ
ムしておくもので、もし、マイクロコンピュータが暴走
し、プログラムの流れが異常になるとタイマのリセット
が一定時間毎ではなくなり、タイマがオーバフローする
ので、マイクロコンピュータが暴走したことを検出する
ことができる。
This is a program in which the microcomputer is programmed to reset a timer that has been blown out at regular intervals according to instructions.If the microcomputer goes out of control and the program flow becomes abnormal, the timer will be reset at regular intervals. Since the timer overflows instead of every hour, it is possible to detect that the microcomputer has gone out of control.

(発明が解決しようとする問題点) しかるに、この方法では、暴走の瞬間を検出できず、か
つ、マイクロコンピュータの動作状態(プログラムの流
ni監視できない。すなわち、マイクロコンピュータが
暴走してから、タイマがオーバフローするまでの期間は
、暴走を検出することができないし、また、正常動作時
にも、その内部動作を監視することができない。このた
め、プログラムのどの個所から暴走が起ったか知ること
ができず、暴走原因を追求する而ではほとんど効果のな
いものであった。
(Problems to be Solved by the Invention) However, with this method, the moment of runaway cannot be detected, and the operating state of the microcomputer (program flow cannot be monitored). Runaway cannot be detected until the program overflows, and its internal operations cannot be monitored even during normal operation.For this reason, it is difficult to know where in the program a runaway has occurred. However, pursuing the cause of the out-of-control behavior was largely ineffective.

ところで、シングルチップマイクロコンピュータにおい
て、内部動作の監視および暴走恢出のためには、マイク
ロコンピュータ内部のプログラムカウンタの内容を外部
に出力し、これを監視すればよいが、端子数が常に制限
されているシングルチップマイクロコンピュータでは、
このようなことは実現不可能であった。
By the way, in a single-chip microcomputer, in order to monitor internal operations and detect runaway operations, it is sufficient to output the contents of the program counter inside the microcomputer to the outside and monitor this, but the number of terminals is always limited. In single-chip microcomputers,
This was not possible.

(問題点を解決するだめの手段) そこで、この発明では、プログラムカウンタの出力に捗
り、コンバータを接続し、プログラムカウンタの内容を
D/A変換したアナログ電圧を1つの端子よりマイクロ
コンピュータ外部に出力し、その出力波形を監視する。
(Means for Solving the Problem) Therefore, in this invention, the output of the program counter is improved, a converter is connected, and the analog voltage obtained by D/A converting the contents of the program counter is outputted from one terminal to the outside of the microcomputer. and monitor its output waveform.

(作用) マイクロコンピュータのプログラムカウンタは、通常動
作時は、順次インクリメント(歩進)され、また、プロ
グラムの流れ全変化させる類の命令があると、その時点
で所望の内容に書き替えらねるが、いずれにせよ、プロ
グラムカウンタの内容をD/A変換すると、そのプログ
ラムカウンタの内容に対応したアナログ電圧を得ること
ができる。したがって、このアナログ電圧を、既知の正
常な電圧と比較して監視することによりプログラムカウ
ンタの動作状態、延いてはマイクロコンピュータ内部の
動作を監視することができ、暴走した場合は実時間でこ
れ全検出することができる。
(Function) During normal operation, the program counter of a microcomputer is sequentially incremented (steps), and if there is an instruction that completely changes the flow of the program, the program counter cannot be rewritten to the desired content at that point. In any case, by D/A converting the contents of the program counter, an analog voltage corresponding to the contents of the program counter can be obtained. Therefore, by monitoring this analog voltage by comparing it with a known normal voltage, it is possible to monitor the operating status of the program counter and, by extension, the internal operation of the microcomputer. can be detected.

(実施例) 第1図はこの発明の一実施例を示すブロック図であって
、1はマイクロコンピュータ、2はそのマイクロコンピ
ュータ1円のプログラムカウンタ、3は同リードオンリ
メモリ(以下ROMという)、4は同り/Aコンバータ
、5はマイクロコンピュータlの監視用出力端子である
。説明上、マイクロコンピュータlの他の構成蓋累は省
略しである。
(Embodiment) FIG. 1 is a block diagram showing an embodiment of the present invention, in which 1 is a microcomputer, 2 is a 1-yen program counter for the microcomputer, 3 is a read-only memory (hereinafter referred to as ROM), 4 is an analog/A converter, and 5 is a monitoring output terminal of the microcomputer l. For the sake of explanation, other components of the microcomputer I are omitted.

プログラムカウンタ2は、ROM3に記憶されている命
令を読み出すため、下位より2のべき乗の重みをもつ例
えば7本のアドレス出力を持ち、各各ROM3のアドレ
ス入力に接続されているが、このうち下位2本(カウン
トの始まり側2本)がD/Aコンバータ4へも接続され
る。そのシリ、コンバータ4は出力が監視用出力端子5
に接続されている。なお、前記のようにプログラムカウ
ンタ2から出力をqう、コンバータ4へ接続することは
、ディジタルパルスを分配するだけであるから単に接続
するだけでよい。
In order to read the instructions stored in the ROM 3, the program counter 2 has, for example, seven address outputs that have a weight of a power of 2 from the lower order, and are connected to the address inputs of each ROM 3. Two wires (two on the count start side) are also connected to the D/A converter 4. In that series, the output of converter 4 is the monitoring output terminal 5
It is connected to the. It should be noted that connecting the output from the program counter 2 to the converter 4 as described above only needs to be done to distribute digital pulses.

第2図はqう、コンバータ4の一具体例を示す。FIG. 2 shows a specific example of the converter 4.

この図のように、前記D/Aコンノく一夕4は、抵抗R
1,R2およびトランジスタQl、Q2からなる最も単
純な形態で実現できる。
As shown in this figure, the D/A connector 4 has a resistance R
1, R2 and transistors Ql, Q2.

第3図は監視用出力端子50波形例であり、囚は正常動
作の場合、CB)は暴走した場合の一例を示している。
FIG. 3 shows an example of the waveform of the monitoring output terminal 50, where CB shows an example of normal operation and CB shows an example of runaway.

この波形図を参照して第1図の動作を説明する。The operation of FIG. 1 will be explained with reference to this waveform diagram.

マイクロコンピュータ1は、通常は、つまり、ジャンプ
命令やコール命令などプログラムの流を変化させる類の
命令を実行しない状態では、プログラムカウンタ2の内
容が順次インクリメント(歩進)されながら命令全実行
していく。したがって、D/Aコンバータ4の入力には
OO→O1→10→11→00→01・・・という順で
2ビツトのディジタル値が入力される。ゆえに、これk
 D/Aコンバータ4でD/A変換すると、その出力す
なわち監視用出力端子5には、第3図(4)に示すよう
に、a+b+c+dという4つのアナログ電圧レベルが
プログラムカウンタ2の歩進に対応して出力される(第
3図囚は、プログラムカラ/り2の内容すなわちROM
3の番地が0〜8まで歩進した場合の監視用出力端子5
0波形を示している)。
Normally, when the microcomputer 1 does not execute instructions that change the program flow, such as jump instructions or call instructions, the microcomputer 1 executes all instructions while the contents of the program counter 2 are sequentially incremented. go. Therefore, 2-bit digital values are input to the input of the D/A converter 4 in the order of OO→O1→10→11→00→01... Therefore, this
When the D/A converter 4 performs D/A conversion, its output, that is, the monitoring output terminal 5, has four analog voltage levels, a+b+c+d, corresponding to the increment of the program counter 2, as shown in FIG. 3 (4). (Figure 3 shows the contents of the program color/re2, that is, the ROM
Output terminal 5 for monitoring when address 3 increments from 0 to 8
0 waveform).

また、プログラムの流れを変化させる類の命令があると
、プログラムカウンタ2の内容は所望の内容に書き換え
られるので、書き換えられた内容に対応するアナログ電
圧レベルがその時点で監視用出力端子5に出力される。
Furthermore, if there is a command that changes the flow of the program, the contents of the program counter 2 are rewritten to the desired contents, so the analog voltage level corresponding to the rewritten contents is output to the monitoring output terminal 5 at that point. be done.

このような正常動作に対して、いまマイクロコンピュー
タ1が暴走すると、プログラムカウンタ2の内容は、そ
の時点で曹き換えられ予期しない値になる。したがって
、プログラムカウンタ2の内容をジう、コンバータ4で
D//A変換して得たアナログ電圧も、暴走した時点で
予期しないレベルとなる。例えば、マイクロコンピュー
タlが2番地まで正常に動作し、3番地の命令全実行す
るときに暴走し0番地に戻ってしまい、再び2否地まで
実行した後、3番地で暴走し0番地に戻り、これ金繰り
返すとすると、第3図(8)に示すように、アナログ電
圧のレベルがCレベル(2番地に対応する)の次に本来
dレベル(3番地に対応する)に上昇するところがCレ
ベル(0番地に対応する)に下がってしまい、再びCレ
ベルまで上昇してdレベルになる時に再びCレベルに下
がるということ金くり返す。
In contrast to such normal operation, if the microcomputer 1 goes out of control, the contents of the program counter 2 will be overwritten at that point and become an unexpected value. Therefore, the analog voltage obtained by D//A conversion of the contents of the program counter 2 by the converter 4 also reaches an unexpected level at the time of runaway. For example, microcomputer l operates normally up to address 2, but when it executes all instructions at address 3, it goes out of control and returns to address 0. After executing again up to address 2, it runs out of control at address 3 and returns to address 0. , if this is repeated every time, as shown in Figure 3 (8), the point where the analog voltage level originally rises to the d level (corresponding to address 3) after the C level (corresponding to address 2) is C. It repeatedly goes down to the level (corresponding to address 0), rises to the C level again, and then falls back to the C level when it reaches the d level.

したがって、前記アナログ電圧が出力される監視用出力
端子5の電圧波形を既知の正常な電圧波形と比較して監
視することによりマイクロコンピュータ1内部の動作状
態を監視でき、暴走した場合はこれを実時間で検出でき
る。
Therefore, by monitoring the voltage waveform of the monitoring output terminal 5 from which the analog voltage is output by comparing it with a known normal voltage waveform, the internal operating state of the microcomputer 1 can be monitored, and if a runaway occurs, this can be implemented. Can be detected by time.

なお、上記一実施例では、財Aコンバータ4の入力は2
本としたが、入力は多い程、監視精度が上がるので好ま
しい。しかし、コストの面から3ないし4本が実用的で
ある。また、ジう、コンバータ4の入力は2のべき乗の
重みを持つことを前提に説明したが、こtにこだわるも
のでもない。
In the above embodiment, the input of the goods A converter 4 is 2.
The more input you have, the better the monitoring accuracy will be. However, from a cost standpoint, three to four wires are practical. Furthermore, although the explanation has been made on the premise that the input to the converter 4 has a weight of a power of 2, this is not restrictive.

(発明の効果) 以上のように、この発明の方法によれば、マイクロコン
ピュータ内部のプログラムカウンタの出力にD/Aコン
バータを接続し、そのD/Aコンバータの出力をマイク
ロコンピュータの外部に取出して監視するようにしたの
で、マイクロコンピュータ内部の動作を監視することが
でき、暴走した場合は実時間でこれを検出することがで
きる。また、この方法によれば、1つの端子より監視信
号(D/Aコンバータ出力)ヲマイクロコンピュータ外
部に出力し得るもので、したがって、端子数が常に制限
されているシングルチップマイクロコンピュータに特に
好適する。
(Effects of the Invention) As described above, according to the method of the present invention, a D/A converter is connected to the output of the program counter inside the microcomputer, and the output of the D/A converter is taken out to the outside of the microcomputer. Since it is monitored, the internal operation of the microcomputer can be monitored, and if it goes out of control, it can be detected in real time. Further, according to this method, the monitoring signal (D/A converter output) can be outputted to the outside of the microcomputer from one terminal, and therefore it is particularly suitable for single-chip microcomputers where the number of terminals is always limited. .

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

第1図はこの発明のマイクロコンピュータの暴走検出方
法の一実施例を説明するための回路図、第2図は第1図
のジう、コンバータの具体的回路図、第3図は上記一実
施例の動作を説明するための波形図である。 l・・・マイクロコンピュータ、2・・・プログラムカ
ウンタ、3・・・ROM、4・・・”/Aコンバータ、
5・・・監視用出力端子。 第1図 第2図 し−、−、、j 第3図
FIG. 1 is a circuit diagram for explaining one embodiment of the microcomputer runaway detection method of the present invention, FIG. 2 is a specific circuit diagram of the converter shown in FIG. FIG. 3 is a waveform diagram for explaining the operation of an example. l...Microcomputer, 2...Program counter, 3...ROM, 4..."/A converter,
5...Output terminal for monitoring. Figure 1 Figure 2 Shi-,-,,j Figure 3

Claims (1)

【特許請求の範囲】[Claims]  マイクロコンピュータ内部のプログラムカウンタの出
力にD/Aコンバータを接続し、そのD/Aコンバータ
の出力を1つの端子よりマイクロコンピュータの外部に
取出して監視することを特徴とするマイクロコンピュー
タの暴走検出方法。
A runaway detection method for a microcomputer, which comprises connecting a D/A converter to the output of a program counter inside the microcomputer, and taking out the output of the D/A converter from one terminal to the outside of the microcomputer for monitoring.
JP59206998A 1984-10-04 1984-10-04 Detection method for microcomputer runaway Pending JPS6186848A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP59206998A JPS6186848A (en) 1984-10-04 1984-10-04 Detection method for microcomputer runaway

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP59206998A JPS6186848A (en) 1984-10-04 1984-10-04 Detection method for microcomputer runaway

Publications (1)

Publication Number Publication Date
JPS6186848A true JPS6186848A (en) 1986-05-02

Family

ID=16532494

Family Applications (1)

Application Number Title Priority Date Filing Date
JP59206998A Pending JPS6186848A (en) 1984-10-04 1984-10-04 Detection method for microcomputer runaway

Country Status (1)

Country Link
JP (1) JPS6186848A (en)

Similar Documents

Publication Publication Date Title
US4956807A (en) Watchdog timer
US4141065A (en) Electric controller system with bumpless transfer
JPH0319571B2 (en)
EP0041701B1 (en) Multiple digital controller system
JPH08503802A (en) Microcomputer
JPH0357660B2 (en)
JPS6186848A (en) Detection method for microcomputer runaway
JP2003044323A (en) Arithmetic unit
JPS5946002B2 (en) Processing method during power outage and power restoration in sequence control equipment
JPS5821281B2 (en) arithmetic device
JPS601573A (en) Abnormality detection circuit for sensor
JPS6029403B2 (en) Timed circuit control method
JPS5837753A (en) Method for detecting program failure
SU1529229A1 (en) Device for monitoring the performance of microcomputers
JPS5939837Y2 (en) Gate signal stop device
JP2541301B2 (en) Failure detection method
JPH0142386B2 (en)
JP2516711B2 (en) Watchdog timer device
JPS5833758A (en) Programmable controller
JPS647391Y2 (en)
JPH0475147A (en) Time monitoring device in information processing system
JPH0650007Y2 (en) Abnormality monitoring device
JPS58114146A (en) Detecting for overrun of processor
KR960018893A (en) Controller with Watchdog Timer
JPH0277902A (en) Sampling trace system for programmable controller