JPS644212B2 - - Google Patents

Info

Publication number
JPS644212B2
JPS644212B2 JP56139084A JP13908481A JPS644212B2 JP S644212 B2 JPS644212 B2 JP S644212B2 JP 56139084 A JP56139084 A JP 56139084A JP 13908481 A JP13908481 A JP 13908481A JP S644212 B2 JPS644212 B2 JP S644212B2
Authority
JP
Japan
Prior art keywords
microcomputer
data
abnormality
address
signal
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
JP56139084A
Other languages
Japanese (ja)
Other versions
JPS5840674A (en
Inventor
Isamu Kadowaki
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.)
Denso Ten Ltd
Original Assignee
Denso Ten 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 Denso Ten Ltd filed Critical Denso Ten Ltd
Priority to JP56139084A priority Critical patent/JPS5840674A/en
Publication of JPS5840674A publication Critical patent/JPS5840674A/en
Publication of JPS644212B2 publication Critical patent/JPS644212B2/ja
Granted legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0751Error or fault detection not based on redundancy

Description

【発明の詳細な説明】 本発明は、マイクロコンピユータが自ら異常を
判定するプログラムを備えたマイクロコンピユー
タの異常判定方法に関する。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a method for determining an abnormality in a microcomputer, which includes a program for the microcomputer to determine an abnormality by itself.

第1図に示すようにマイクロコンピユータ(以
下マイコンと略称する)10が異常になつたと
き、それを出力ポート11から出る何らかの信号
Sの変化として外部検知回路20に知らせ、該検
知回路からのリセツト信号でマイコン10
をシステムリセツトする方式がある。ところが従
来のリセツト方式では信号Sが例えば、マイコン
10が動作していれば出て、動作しなくなれば停
止するという様な単純なものであるので、実際に
マイコン異常となつても信号Sからは正常と判断
され、リセツトされないケースもある。
As shown in FIG. 1, when the microcomputer (hereinafter referred to as microcomputer) 10 becomes abnormal, this is notified to the external detection circuit 20 as a change in some signal S output from the output port 11, and a reset is issued from the detection circuit. Microcomputer 10 with signal
There is a method to reset the system. However, in the conventional reset method, the signal S is a simple signal that is output when the microcomputer 10 is operating, and stops when it stops operating, so even if the microcomputer actually malfunctions, the signal S is not output. There are cases where it is determined to be normal and is not reset.

本発明は、マイコン側にプログラムによる異常
検出機能を持たせ、上述したシステムであれば外
部検知回路に積極的にリセツトを促そうとするも
のである。本発明は、マイクロコンピユータの通
常の処理プログラムに従い制御データを作成し、
被制御機器を制御するシステムにおける該マイク
ロコンピユータの異常判定方法であつて、前記通
常の処理プログラムの一部に異常判定プログラム
を設け、該異常判定プログラムは前記被制御機器
に対する制御データを基準データとしてランダム
アクセスメモリ内の所定領域に書き込むステツ
プ、該基準データと所定の関係を有するデータを
該ランダムアクセスメモリ内の他の領域に書き込
むステツプ、該所定領域に書き込まれた基準デー
タと、該他の領域に書き込まれたデータとが前記
所定の関係を有するか否かを判断するステツプ及
び、該所定の関係を有しないとき異常と判定して
異常処理を行うステツプを含むことを特徴とする
が、以下図面を参照しながらこれを詳細に説明す
る。
The present invention provides a program-based abnormality detection function on the microcomputer side and actively urges the external detection circuit to reset the system as described above. The present invention creates control data according to a normal processing program of a microcomputer,
An abnormality determination method for a microcomputer in a system for controlling a controlled device, wherein an abnormality determination program is provided as a part of the normal processing program, and the abnormality determination program uses control data for the controlled device as reference data. writing data to a predetermined area in the random access memory; writing data having a predetermined relationship with the reference data to another area in the random access memory; writing the reference data written in the predetermined area and the other area; The method is characterized by comprising a step of determining whether or not the data written in the data has the predetermined relationship, and a step of determining that there is an abnormality when the predetermined relationship does not exist and performing abnormality processing. This will be explained in detail with reference to the drawings.

本発明ではマイコン10が正常に動作している
時にはマイコンの出力ポート11より正常動作に
対応する出力を発生させる。この出力Sはたとえ
ば一定周期のオンオフ信号のような簡単な信号で
もよいし、互いに相関関係を持つた多重信号パタ
ーンでもよい。前者の場合には第1図の検知回路
20は単純なF/V(周波数→電圧)交換回路に
より規定の周波数が出力ポート11より発生して
いるかどうかを判定するだけでよい。この時たと
えば出力ポート11の出力応答が停止した場合検
知回路20はリセツト用の入力ポート12にリセ
ツト信号を伝達する。
In the present invention, when the microcomputer 10 is operating normally, the output port 11 of the microcomputer generates an output corresponding to normal operation. This output S may be a simple signal such as an on/off signal with a constant period, or may be a multiple signal pattern having mutual correlation. In the former case, the detection circuit 20 of FIG. 1 only needs to determine whether a specified frequency is generated from the output port 11 using a simple F/V (frequency→voltage) switching circuit. At this time, for example, if the output response of the output port 11 stops, the detection circuit 20 transmits a reset signal to the input port 12 for reset.

上述した信号Sを本発明ではマイコン10の内
部プログラムにより発生する。一般に1チツプマ
イコンROM(読出し専用メモリ)、RAM(ランダ
ムアクセスメモリ)、内部レジスタ等を内蔵する。
このうちROMはマスク化された場合マイコンの
破壊時以外に内容は変化しないので、マイコン異
常(主として誤動作)判定には不向きである。一
方、内部レジスタの内容はマイコンの動作中任意
に変わり得るのでこれもマイコンの誤動作判定に
は使えない。残るRAMはマイコンの動作中必要
なデータを保持し、特に被制御機器に対する制御
動作に直接関係するフラグ類を含むので、本発明
ではこのRAMの動作をマイコン異常の判定に用
いる。
In the present invention, the above-mentioned signal S is generated by an internal program of the microcomputer 10. Generally, a 1-chip microcomputer has built-in ROM (read-only memory), RAM (random access memory), internal registers, etc.
Of these, when the ROM is masked, its contents do not change except when the microcomputer is destroyed, so it is not suitable for determining microcomputer abnormalities (mainly malfunctions). On the other hand, the contents of internal registers can change arbitrarily during the operation of the microcomputer, so this cannot be used to determine whether the microcomputer is malfunctioning. The remaining RAM holds data necessary during the operation of the microcomputer, and in particular includes flags directly related to control operations for the controlled equipment, so in the present invention, the operation of this RAM is used to determine whether the microcomputer is abnormal.

以下第2図〜第4図を参照しながら本発明の一
実施例を説明する。第2図はマイコン10の内部
RAM13の説明図である。本例ではこのRAM
13の特定のn個(n≧2)のアドレスA1,A2
……Aoを異常判定用に指定する。そして、マイ
コン10の通常の処理プログラム中に後述する制
御プログラムと判定プログラムを含める。制御プ
ログラムは先ずアドレスA1に基準データDを書
込む。そして、一例としては残りのアドレスA2
〜Aoには同じデータDかその反転データを書
込む。第3図aに示す例はn=3とし、アドレス
A1に基準データDを、またアドレスA2にそれと
同じデータDを、さらにアドレスA3には反転デ
ータを書込む制御プログラムの例である。動作
は「A1データ書き換え」から始まる。これはア
ドレスA1に基準データDを書込むことを意味す
る。次のステツプの「A2←A1」はアドレスA1
データ、つまりDをアドレスA2に転送してそこ
に同じものを書込むことを意味する。最後のステ
ツプの「A31」はアドレスA1のデータを反転
したものをアドレスA3に転送してそこに書込
むことを意味する。尚、基準データDはマイコン
10の動作に従がい、例えば1回目の制御プログ
ラム実行時にはD1で、2回目はD2、3回目はD3
……と変化することもある。
An embodiment of the present invention will be described below with reference to FIGS. 2 to 4. Figure 2 shows the inside of the microcomputer 10.
FIG. 3 is an explanatory diagram of the RAM 13. In this example, this RAM
13 specific n addresses (n≧2) A 1 , A 2 ,
...Specify A o for abnormality determination. A control program and a determination program, which will be described later, are included in the normal processing program of the microcomputer 10. The control program first writes reference data D to address A1 . And the remaining address A 2 as an example
The same data D or its inverted data is written to ~A o . In the example shown in Figure 3a, n=3 and the address
This is an example of a control program that writes reference data D to A1 , the same data D to address A2 , and inverted data to address A3 . The operation begins with "A 1 data rewrite". This means writing reference data D to address A1 . The next step "A 2 ←A 1 " means to transfer the data at address A 1 , that is, D, to address A 2 and write the same data there. The final step "A 31 " means that the data at address A 1 is inverted and transferred to address A 3 and written there. Note that the reference data D follows the operation of the microcomputer 10, for example, it is D1 at the first execution of the control program, D2 at the second time, D3 at the third time, etc.
...and may change.

アドレスA1としては、RAM13中の各種フラ
グ類のうちで、もしそのフラグがマイコンの被制
御機器に対する制御動作と無関係に改変されてし
まうと以後の制御動作に支障をきたすようなフラ
グを格納しているアドレスそのものとする。この
場合データDは当該フラグである。また、アドレ
スA1にデータDを入れ、残りのアドレスAi(i=
2〜n)にはデータDを1ビツトずつシフトした
ような、データDと特定の関係があり、且つ識別
可能な任意のパターンを入れることも考えられ
る。第3図の例のように、反転データを特定ア
ドレスに入れておくと、そのアドレスの内容が外
来ノイズ等により特定の方向の変化を受けやすい
(例えばクリアされる)という傾向を持つ場合に
異常動作の検出能力を向上させる上で有効であ
る。
Among the various flags in the RAM 13, address A1 stores flags that, if modified unrelated to the microcomputer's control operations for the controlled equipment, will cause problems in subsequent control operations. is the address itself. In this case, data D is the flag. Also, put data D in address A 1 and leave the remaining address Ai (i=
2 to n) may contain any discernable pattern that has a specific relationship with the data D, such as shifting the data D one bit at a time. As in the example in Figure 3, if you put inverted data in a specific address, an error occurs if the contents of that address tend to be easily changed (for example, cleared) in a specific direction due to external noise, etc. This is effective in improving the ability to detect motion.

本例では第3図bに示す如き判定プログラムに
よつてマイコン動作中にはあらかじめ定められた
A1と各Aiの関係が正しいかどうかを判定する。
この判定プログラムはいかなるRAMデータ異常
時にも必ず定期的に実行されるプログラムループ
内に設ける必要がある。このようなループは前述
の検知回路20を含むシステム構成を採用した時
には必ず存在する。そして上記判定プログラムが
異常を検出した時には出力ポート11の出力Sを
正常動作に対応するパターン以外のものに変更す
る。これにより検知回路20は動作異常を検出し
てマイコン10にリセツトをかけることができ
る。
In this example, a determination program as shown in Figure 3b determines whether a predetermined
Determine whether the relationship between A 1 and each A i is correct.
This determination program must be provided in a program loop that is executed periodically whenever there is an abnormality in the RAM data. Such a loop always exists when a system configuration including the aforementioned detection circuit 20 is adopted. When the determination program detects an abnormality, the output S of the output port 11 is changed to a pattern other than that corresponding to normal operation. This allows the detection circuit 20 to detect an abnormal operation and reset the microcomputer 10.

第3図bに示す判定プログラムの例は、アドレ
スA2内のデータがアドレスA1内のデータと等し
いか否か(正常であれば共にD)を判定し、イエ
スYであればアドレスA3内のデータがアドレス
A1内のデータを反転したものと等しいか否か
(正常であれば共に)を判定する。これもイエ
スYであれば出力ポート11のレベルを反転す
る。これをマイコン動作時は周期的に繰り返すの
で、正常時の出力ポート11の信号Sは第4図の
ようにパルス列となる。これに対し、マイコン異
常が生じて第3図bのいずれかのステツプでノ−
Nに分岐してしまうと出力ポート11のレベルは
H(ハイ)またはL(ロー)に固定される。従つて
検知回路20はこの信号Sの変化からマイコン異
常を知り、リセツト信号を発生できる。こ
のように被制御機器を制御するためのフラグ等の
制御データを用いて異常判定を行うため、異常判
定用に予め別途デジタルデータを記憶しておく
ROM等の記憶装置が不要となる。
The example of the determination program shown in FIG. 3b determines whether the data in address A 2 is equal to the data in address A 1 (if normal, both are D), and if YES, address A 3 The data inside is the address
Determine whether it is equal to the inverted version of the data in A1 (or both if normal). If this is also YES, the level of the output port 11 is inverted. Since this is repeated periodically during microcomputer operation, the signal S at the output port 11 during normal operation becomes a pulse train as shown in FIG. On the other hand, an error occurs in the microcomputer and a failure occurs in one of the steps in Figure 3b.
If the signal branches to N, the level of the output port 11 is fixed to H (high) or L (low). Therefore, the detection circuit 20 can detect an abnormality in the microcomputer from the change in the signal S and can generate a reset signal. In this way, since abnormality determination is performed using control data such as flags for controlling controlled equipment, separate digital data is stored in advance for abnormality determination.
Storage devices such as ROM are not required.

第4図は検知回路20の具体例である。この回
路の入力段はF/V変換回路21で、これにより
出力ポート11からの信号Sの周波数を電圧Vに
変換する。22は電圧比較器で、入力電圧Vが基
準電圧Vrefより高ければ出力をLにしている。こ
の状態はマイコン10が正常で信号Sが周期的に
レベルをL,H,L,H……と切替えている場合
(正常パターン)である。これに対しマイコン異
常で信号SのレベルがLまたはHに固定された場
合(異常パターン)は直流分のみとなりF/V変
換器21の出力Vは0になる。この結果電圧比較
器22の出力はLからHに立上るので、この立上
りをトリガ信号Tとして単安定回路23を起動す
る。単安定回路23はこの起動によつて一時的に
Lとなる信号を出力し、その立下りでマイ
コン10をリセツトする。
FIG. 4 shows a specific example of the detection circuit 20. The input stage of this circuit is an F/V conversion circuit 21, which converts the frequency of the signal S from the output port 11 into a voltage V. 22 is a voltage comparator, which outputs L if the input voltage V is higher than the reference voltage V ref . This state is when the microcomputer 10 is normal and the level of the signal S is periodically switched to L, H, L, H, etc. (normal pattern). On the other hand, when the level of the signal S is fixed at L or H due to an abnormality in the microcomputer (abnormal pattern), only the DC component becomes available, and the output V of the F/V converter 21 becomes 0. As a result, the output of the voltage comparator 22 rises from L to H, and this rise is used as a trigger signal T to activate the monostable circuit 23. The monostable circuit 23 outputs a signal that temporarily becomes L due to this activation, and resets the microcomputer 10 at the falling edge of the signal.

以上述べたように本発明によれば、マイコン自
らがその内部プログラムによつてRAM内のデー
タの正異常を判定するので、マイコン異常はもち
ろんのことデータ異常も積極的に検出できる利点
がある。更に予めROM等の記憶装置に記憶した
異常判定専用データを用いて異常判定を行う方式
と異なり、被制御機器を制御するための制御デー
タを用いて異常判定を行う方式のため、少ない記
憶装置あるいは記憶容量で実現可能である。
As described above, according to the present invention, since the microcomputer itself determines whether the data in the RAM is normal or abnormal using its internal program, there is an advantage that not only microcomputer abnormalities but also data abnormalities can be actively detected. Furthermore, unlike a method that performs abnormality determination using data dedicated to abnormality determination stored in a storage device such as ROM in advance, this method uses control data for controlling the controlled equipment to determine abnormality, so it requires less storage space or This can be achieved with the storage capacity.

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

第1図はマイクロコンピユータのシステムリセ
ツト方式の説明図、第2図〜第4図は本発明の一
実施例を示す図で、第2図はRAMの説明図、第
3図は異常判定プログラムの説明図、第4図は外
部検知回路の具体例を示すブロツク図である。 図中、10はマイクロコンピユータ、11は出
力ポート、13はRAMである。
Fig. 1 is an explanatory diagram of the system reset method of a microcomputer, Figs. 2 to 4 are diagrams showing an embodiment of the present invention, Fig. 2 is an explanatory diagram of the RAM, and Fig. 3 is an explanatory diagram of the abnormality determination program. The explanatory diagram, FIG. 4, is a block diagram showing a specific example of the external detection circuit. In the figure, 10 is a microcomputer, 11 is an output port, and 13 is a RAM.

Claims (1)

【特許請求の範囲】 1 マイクロコンピユータの通常の処理プログラ
ムに従い制御データを作成し、被制御機器を制御
するシステムにおける該マイクロコンピユータの
異常判定方法であつて、前記通常の処理プログラ
ムの一部に異常判定プログラムを設け、 該異常判定プログラムは前記被制御機器に対す
る制御データを基準データとしてランダムアクセ
スメモリ内の所定領域に書き込むステツプ、 該基準データと所定の関係を有するデータを該
ランダムアクセスメモリ内の他の領域に書き込む
ステツプ、 該所定領域に書き込まれた基準データと、該他
の領域に書き込まれたデータとが前記所定の関係
を有するか否かを判断するステツプ及び、 該所定の関係を有しないとき異常と判定して異
常処理を行うステツプを含むことを特徴とするマ
イクロコンピユータの異常判定方法。
[Scope of Claims] 1. A method for determining an abnormality in a microcomputer in a system that creates control data according to a normal processing program of the microcomputer and controls a controlled device, the method comprising: A determination program is provided, and the abnormality determination program includes the steps of: writing control data for the controlled device into a predetermined area in the random access memory as reference data; and writing data having a predetermined relationship with the reference data into other areas in the random access memory. a step of writing in the area; a step of determining whether the reference data written in the predetermined area and data written in the other area have the predetermined relationship; and a step of determining whether or not the reference data written in the predetermined area has the predetermined relationship; 1. A method for determining an abnormality in a microcomputer, the method comprising the step of determining an abnormality and performing abnormality processing.
JP56139084A 1981-09-03 1981-09-03 Fault deciding method of microcomputer Granted JPS5840674A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP56139084A JPS5840674A (en) 1981-09-03 1981-09-03 Fault deciding method of microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP56139084A JPS5840674A (en) 1981-09-03 1981-09-03 Fault deciding method of microcomputer

Publications (2)

Publication Number Publication Date
JPS5840674A JPS5840674A (en) 1983-03-09
JPS644212B2 true JPS644212B2 (en) 1989-01-25

Family

ID=15237106

Family Applications (1)

Application Number Title Priority Date Filing Date
JP56139084A Granted JPS5840674A (en) 1981-09-03 1981-09-03 Fault deciding method of microcomputer

Country Status (1)

Country Link
JP (1) JPS5840674A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0357403A (en) * 1989-07-14 1991-03-12 Iin Hoi Mui Paul Umbrella with illumination

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS60246447A (en) * 1984-05-22 1985-12-06 Nec Corp Fault informing system of microprogram control processor
JPS63129150A (en) * 1986-05-08 1988-06-01 Nippon Denso Co Ltd Protecting method for study data in control device for internal combustion engine

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5287943A (en) * 1976-01-19 1977-07-22 Mitsubishi Electric Corp Operation monitor system for micor processor
US4232377A (en) * 1979-04-16 1980-11-04 Tektronix, Inc. Memory preservation and verification system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0357403A (en) * 1989-07-14 1991-03-12 Iin Hoi Mui Paul Umbrella with illumination

Also Published As

Publication number Publication date
JPS5840674A (en) 1983-03-09

Similar Documents

Publication Publication Date Title
EP0173967B1 (en) Microprogram load unit
US6564177B1 (en) Electronic device
JPS644212B2 (en)
JPS6020779B2 (en) Composite computer system
JP3222010B2 (en) Programmable controller
JP3288114B2 (en) Microcomputer
JPS6161417B2 (en)
JPH04128961A (en) Multi-processor control system
JPH0751609Y2 (en) Failure information storage circuit of programmable controller
JPS6126701B2 (en)
JPH03113649A (en) Write data transfer device
JPH0535455B2 (en)
JPH0466644U (en)
JPH05344184A (en) Line connecting part monitor circuit
JPS62174845A (en) Memory selection control circuit
JPS58201109A (en) Circuit fault detecting method of numerical controller
JPH01155418A (en) Memory initialization controller
JPH06119467A (en) Microcomputer
JPS60140958A (en) Line control system
JPS63116250A (en) Memory control circuit
JPH03220649A (en) Parity check circuit
JPS63229697A (en) Data write control system
JPH02116933A (en) Control system for maneuvering apparatus
JPH04128939A (en) Microcomputer
JPS5856292A (en) Initializing system of memory