JPH1021107A - Microcomputer system - Google Patents

Microcomputer system

Info

Publication number
JPH1021107A
JPH1021107A JP8186837A JP18683796A JPH1021107A JP H1021107 A JPH1021107 A JP H1021107A JP 8186837 A JP8186837 A JP 8186837A JP 18683796 A JP18683796 A JP 18683796A JP H1021107 A JPH1021107 A JP H1021107A
Authority
JP
Japan
Prior art keywords
data
output
variable area
control
diagnostic
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
JP8186837A
Other languages
Japanese (ja)
Inventor
Hirotaka Kojima
浩孝 小島
Atsuro Ota
淳朗 大田
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.)
Honda Motor Co Ltd
NEC Home Electronics Ltd
NEC Corp
Original Assignee
Honda Motor Co Ltd
NEC Home Electronics Ltd
Nippon Electric 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 Honda Motor Co Ltd, NEC Home Electronics Ltd, Nippon Electric Co Ltd filed Critical Honda Motor Co Ltd
Priority to JP8186837A priority Critical patent/JPH1021107A/en
Publication of JPH1021107A publication Critical patent/JPH1021107A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To surely diagnose the fault of a CPU itself by reloading the contents in an input converting area, arithmetic work converting area or output converting area into write data for diagnosis stored inside a ROM and collating them with output expected data. SOLUTION: Out of one set of paired data in a ROM 8 selected beforehand first of all, are selected, and next, these output expected data OD to be outputted expected data are collated with data in an arithmetic work converting area A-2 and an output converting area A-3 provided by preceding operation. In this case, the matching of collation is discriminated concerning all the data of collating objects, in order to recover ordinary control, the contents in an input converting area A-1, arithmetic work converting area A-2 and output converting area A-3 are returned into initial state and afterwards, output processing is executed similarly to the time of ordinary control. When the nonmatching of collation is discriminated in any parameter, on the other hand, instruction execution abnormality processing is immediately executed and the alarm of such a state is issued to the outside and the operation of a CPU 10 is stopped.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、制御システム等へ
の適用に好適なマイクロコンピュータ装置に係り、特に
CPU自身(特に、ALU「Arithmetic and Logical U
nit」等に代表される演算部)の故障診断機能を備えた
マイクロコンピュータ装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microcomputer device suitable for application to a control system and the like, and more particularly to a CPU itself (in particular, an ALU "Arithmetic and Logical Unit").
The present invention relates to a microcomputer device provided with a failure diagnosis function of an arithmetic unit represented by "nit" or the like.

【0002】[0002]

【従来の技術】従来、高度の信頼性を要求される制御シ
ステム、例えば、車両用アンチロックブレーキシステム
(ABSという)等においては、制御対象に対して2台
のマイクロコンピュータ装置を設け、その2台のマイク
ロコンピュータの出力を照合し、異なる場合にはマイク
ロコンピュータの故障と診断するようにしたダブルマイ
コンシステムが採用されているが、このようなダブルマ
イコンシステムは当然ながら高価なものとなりシステム
全体のコストを押し上げる結果となっていた。
2. Description of the Related Art Conventionally, in a control system requiring a high degree of reliability, for example, an anti-lock brake system for a vehicle (referred to as an ABS), two microcomputer devices are provided for a controlled object. A double microcomputer system has been adopted in which the outputs of two microcomputers are collated, and if they differ, a microcomputer failure is diagnosed. The result was higher costs.

【0003】そこで、昨今、このような制御システムで
あっても、これを1台で賄うことができるようにした信
頼性の高いマイクロコンピュータ装置の開発が要望され
ている。このようなマイクロコンピュータ装置を実現す
るための一つの方法としては、当該マイクロコンピュー
タそれ自身に自己診断機能を持たせ、何らかの異常が発
生した場合にはこれを初期段階において確実に検出し、
必要な対応措置を採らせることにより、制御中に対象負
荷が誤動作を起こすことを未然に防止することが考えら
れる。
[0003] In recent years, there has been a demand for the development of a highly reliable microcomputer device capable of covering even such a control system with a single device. As one method for realizing such a microcomputer device, the microcomputer itself has a self-diagnosis function, and when any abnormality occurs, it is surely detected at an initial stage,
By taking necessary countermeasures, it is possible to prevent the target load from malfunctioning during control.

【0004】従来、マイクロコンピュータ装置の故障を
診断する方法としては、ROMのサムチェックによる方
法、ウォッチ・ドッグ・タイマによる制御周期監視によ
る方法、制御プログラムの各モジュールの実行監視によ
る方法等が知られている。
Conventionally, as a method of diagnosing a failure of a microcomputer device, a method based on a ROM sum check, a method based on monitoring a control cycle using a watch dog timer, a method based on monitoring execution of each module of a control program, and the like are known. ing.

【0005】しかしながら、ROMのサムチェックによ
る方法にあっては、プログラムやデータの異常について
はチェックできるものの、プログラムを実行するCPU
自身の異常に起因するマイクロコンピュータ装置の誤動
作については回避することができない。また、ウオッチ
・ドッグ・タイマによる制御周期監視並びに制御プログ
ラムの各モジュールの実行監視による方法にあっては、
所謂プログラムの異常に起因するマイクロコンピュータ
装置の動作異常については回避できるものの、そのよう
なプログラムの異常は生じていないものの、CPUのA
LUの異常により数値演算結果が間違っていることに起
因するマイクロコンピュータ装置の誤動作については回
避することができない。
[0005] However, in the method based on the checksum of the ROM, although a program or data can be checked for abnormality, the CPU that executes the program is checked.
A malfunction of the microcomputer device caused by its own abnormality cannot be avoided. Further, in the method of monitoring the control cycle by the watch dog timer and monitoring the execution of each module of the control program,
Although it is possible to avoid the operation abnormality of the microcomputer device due to the so-called program abnormality, although such a program abnormality has not occurred, the CPU A
It is not possible to avoid a malfunction of the microcomputer device due to an error in the numerical operation result due to an LU abnormality.

【0006】一方、プログラムの異常以外のCPU異常
に起因するマイクロコンピュータ誤動作を診断するため
の方法としては、例えば当該マイクロコンピュータに対
して、その外部より疑似信号を入力する一方、それに対
応して外部へ出力される出力信号をモニタし、このモニ
タされた出力信号を予め求められた正常時の出力信号と
照合することにより、故障診断を行うことが考えられ
る。
On the other hand, as a method for diagnosing a microcomputer malfunction caused by a CPU error other than a program error, for example, a pseudo signal is input from the outside to the microcomputer, and a corresponding external signal is input to the microcomputer. It is conceivable that a failure diagnosis is performed by monitoring an output signal output to the CPU and comparing the monitored output signal with a previously obtained normal output signal.

【0007】このような故障診断方法を、図3のブロッ
ク図、並びに、図4のフローチャートを参照して説明す
る。図3において、マイクロコンピュータ装置100
は、この例では、車両用ABS制御に用いられる電子制
御ユニット(以下、ECUという)であり、その外部入
力要素としては、ブレーキ操作子が操作されているか否
かを検出するブレーキスイッチ101と、当該ブレーキ
用操作子の操作ストロークを検出するためのストローク
センサ102と、前輪の回転速度に対応するパルス列を
出力するFr車輪速センサ103と、後輪の回転速度に
対応するパルス列を出力するRr車輪速センサ104と
が示されており、また出力要素としてはブレーキ用アク
チュエータを駆動するためのモータ105とソレノイド
106とが示されている。
[0007] Such a failure diagnosis method will be described with reference to the block diagram of FIG. 3 and the flowchart of FIG. In FIG. 3, a microcomputer device 100
In this example, is an electronic control unit (hereinafter referred to as ECU) used for vehicle ABS control, and its external input elements are a brake switch 101 for detecting whether or not a brake operator is operated, A stroke sensor 102 for detecting the operation stroke of the brake operating element, an Fr wheel speed sensor 103 for outputting a pulse train corresponding to the rotation speed of the front wheel, and an Rr wheel for outputting a pulse train corresponding to the rotation speed of the rear wheel A speed sensor 104 is shown, and a motor 105 and a solenoid 106 for driving a brake actuator are shown as output elements.

【0008】マイクロコンピュータ装置100の内部に
は、入力系としては、ブレーキスイッチ101からの信
号を取り込むためのブレーキスイッチ入力回路107
と、ストロークセンサ102からの信号を取り込むため
のストロークセンサ入力回路108と、Fr車輪速セン
サ103からの信号を取り込むためのFr車輪速センサ
入力回路109と、Rr車輪速センサ104からの信号
を取り込むためのRr車輪速入力回路110とが設けら
れており、出力系としては、モータ105に対して信号
を出力するためのモータドライバ回路111と、ソレノ
イド106に対して信号を出力するためのソレノイド信
号出力回路112とが設けられている。
The microcomputer 100 has a brake switch input circuit 107 for receiving a signal from the brake switch 101 as an input system.
, A stroke sensor input circuit 108 for receiving a signal from the stroke sensor 102, a Fr wheel speed sensor input circuit 109 for receiving a signal from the Fr wheel speed sensor 103, and a signal from the Rr wheel speed sensor 104. And an Rr wheel speed input circuit 110 for outputting a signal to the motor 105 and a solenoid signal for outputting a signal to the solenoid 106 as an output system. An output circuit 112 is provided.

【0009】CPU113は、このマイクロコンピュー
タ装置100の心臓部に位置するものであり、この例で
は8ビット構成の1チップマイクロコンピュータにて構
成されている。このCPU113内には、後に詳細に説
明するように、ABS用の各種プログラムの他に、故障
診断プログラム並びに各種データなどを格納させたRO
M114と、入力変数領域、演算作業変数、出力変数領
域の他、各種フラグやレジスタなどの領域が設けられた
RAM115とが内蔵されている。周知の如く、CPU
113における命令実行は、当該CPU113内に内蔵
された、プログラムカウンタ、命令デコード・ユニッ
ト、レジスタ、ALU、タイミング・コントロールユニ
ットなどを用いて行われるわけであるが、この例では説
明の便宜のためにそれら回路要素の中で、数値演算結果
に最も顕著に影響を及ぼすALU116のみが示されて
いる。尚、図において117はCPUの内部バス、10
7a,108a,109a,110a119a,120
aは内部入力回路、118a,111a,112aは内
部出力回路である。
The CPU 113 is located at the heart of the microcomputer device 100. In this embodiment, the CPU 113 is constituted by an 8-bit one-chip microcomputer. In the CPU 113, as will be described later in detail, in addition to various programs for ABS, a RO for storing a failure diagnosis program and various data are stored.
M114 and a RAM 115 provided with an input variable area, a calculation work variable, an output variable area, and areas such as various flags and registers are provided. As is well known, CPU
The instruction execution in 113 is performed using a program counter, an instruction decode unit, a register, an ALU, a timing control unit, and the like built in the CPU 113. In this example, for convenience of explanation, Of those circuit elements, only the ALU 116 that most significantly affects the numerical result is shown. In the figure, 117 is an internal bus of the CPU, 10
7a, 108a, 109a, 110a 119a, 120
a is an internal input circuit, and 118a, 111a, and 112a are internal output circuits.

【0010】次に、上述したマイクロコンピュータ装置
100において、故障診断のために新たに追加された要
素について説明する。模擬信号入力部118は、CPU
113から与えられた模擬信号入力要求に基づいて動作
し、予め用意された故障診断のための模擬信号を、ブレ
ーキスイッチ101,ストロークセンサ102,Fr車
輪速センサ103,Rr車輪速センサ104のそれぞれ
からの信号の替わりに、ブレーキスイッチ入力回路10
7,ストロークセンサ入力回路108,Fr車輪速セン
サ入力回路109,Rr車輪速センサ入力回路110へ
と入力する機能を有するものである。また、出力モニタ
部119,120は、モータドライバ回路111からモ
ータ105へと出力される出力信号並びにソレノイド信
号出力回路112からソレノイド106へ出力される信
号をそれぞれCPU113へと読み込ませる機能を有す
るものである。
Next, a description will be given of elements newly added to the microcomputer device 100 for failure diagnosis. The simulation signal input unit 118 includes a CPU
It operates based on the simulation signal input request given from 113, and outputs a simulation signal for failure diagnosis prepared in advance from each of the brake switch 101, the stroke sensor 102, the Fr wheel speed sensor 103, and the Rr wheel speed sensor 104. Signal instead of the brake switch input circuit 10
7. It has a function of inputting to the stroke sensor input circuit 108, the Fr wheel speed sensor input circuit 109, and the Rr wheel speed sensor input circuit 110. The output monitor units 119 and 120 have a function of reading the output signal output from the motor driver circuit 111 to the motor 105 and the signal output from the solenoid signal output circuit 112 to the solenoid 106 into the CPU 113, respectively. is there.

【0011】次に、CPU113内のROM114に格
納されたプログラムの構成を図4のフローチャートを参
照しながら説明する。同図に示されるように、このプロ
グラムは、ABS制御本来の目的のために用意された処
理(入力信号読み込み処理402、演算処理403、演
算結果判定処理404、出力データ書き替え処理40
5,406、信号出力処理407)と、故障診断のため
に用意された処理部分(模擬信号入力要求処理401、
出力信号モニタ処理408、出力信号照合処理409、
異常時処理410)とから構成されている。
Next, the configuration of a program stored in the ROM 114 in the CPU 113 will be described with reference to the flowchart of FIG. As shown in the drawing, this program includes processing prepared for the original purpose of the ABS control (input signal reading processing 402, calculation processing 403, calculation result determination processing 404, output data rewriting processing 40).
5, 406, signal output processing 407) and processing parts prepared for failure diagnosis (simulated signal input request processing 401,
Output signal monitor processing 408, output signal collation processing 409,
Abnormality processing 410).

【0012】即ち、プログラムが開始されると、まず模
擬信号入力要求が模擬信号入力部118へと与えられ
(ステップ401)、これによりブレーキスイッチ入力
回路107,ストロークセンサ入力回路108,Fr車
輪速センサ入力回路109,Rr車輪速センサ入力回路
110には、ブレーキスイッチ101,ストロークセン
サ102,Fr車輪速センサ103,Rr車輪速センサ
104からの信号の替わりに、模擬信号入力部118か
らの信号が与えられ、所謂模擬信号の入力が行われる。
That is, when the program is started, a simulation signal input request is first given to the simulation signal input section 118 (step 401), whereby the brake switch input circuit 107, the stroke sensor input circuit 108, the Fr wheel speed sensor Instead of signals from the brake switch 101, the stroke sensor 102, the Fr wheel speed sensor 103, and the Rr wheel speed sensor 104, a signal from a simulation signal input unit 118 is given to an input circuit 109 and an Rr wheel speed sensor input circuit 110. Then, a so-called simulation signal is input.

【0013】次いで、それら入力された模擬信号は、通
常の制御時と同様にして、ブレーキスイッチ入力回路1
07,ストロークセンサ入力回路108,Fr車輪速セ
ンサ入力回路109,Rr車輪速センサ入力回路110
を介して、CPU113のRAM115に取り込まれ
る。
Next, the input simulation signals are supplied to the brake switch input circuit 1 in the same manner as in normal control.
07, stroke sensor input circuit 108, Fr wheel speed sensor input circuit 109, Rr wheel speed sensor input circuit 110
Via the RAM 113 of the CPU 113.

【0014】次いで、これら取り込まれた入力信号に基
づき演算処理が実行され、ここではABSに必要なスリ
ップ率演算、ブレーキ制御判定、デューティ演算などが
行われる(ステップ403)。
Next, arithmetic processing is executed on the basis of the fetched input signals. Here, a slip ratio calculation, a brake control judgment, a duty calculation, etc. necessary for the ABS are performed (step 403).

【0015】その後、上記の演算処理で得られた演算結
果に基づき、所定の判定処理が実行され(ステップ40
4)、その判定結果がある値(A)若しくは(C)であ
る場合、モータ正転並びにソレノイドオンに相当するデ
ータがRAM115内の出力変数領域へと書き込まれ
(ステップ405)、制御状態が(B)である場合に
は、モータ停止並びにソレノイドオフに相当するデータ
が同様にしてRAM115内の出力変数領域に書き込ま
れる(ステップ406)。
Thereafter, a predetermined judgment process is executed based on the operation result obtained in the above operation process (step 40).
4) If the result of the determination is a certain value (A) or (C), data corresponding to motor normal rotation and solenoid ON is written to the output variable area in the RAM 115 (step 405), and the control state is changed to ( In the case of B), the data corresponding to the motor stop and the solenoid off are similarly written in the output variable area in the RAM 115 (step 406).

【0016】その後、RAM115の出力変数領域に書
き込まれた出力データは、モータドライバ回路111並
びにソレノイド信号出力回路112を介してモータ10
5並びにソレノイド106へとそれぞれ出力される(ス
テップ407)。
Thereafter, the output data written in the output variable area of the RAM 115 is transmitted to the motor 10 via a motor driver circuit 111 and a solenoid signal output circuit 112.
5 is output to the solenoid 106 (step 407).

【0017】その後、出力信号モニタ処理が実行され、
モータドライバ回路111並びにソレノイド信号出力回
路112から出力された信号は、出力モニタ部119並
びに出力モニタ部120を介してCPU113へと取り
込まれ(ステップ408)、その後出力信号照合処理が
実行される(ステップ409)。
Thereafter, output signal monitoring processing is executed,
The signals output from the motor driver circuit 111 and the solenoid signal output circuit 112 are taken into the CPU 113 via the output monitor 119 and the output monitor 120 (step 408), and then the output signal comparison processing is executed (step 408). 409).

【0018】ここで、外部へ出力された出力信号が予め
用意された正解データに相当する出力データと一致すれ
ば(ステップ409YES)、診断結果は正常として処
理は終了されるのに対し、両者が不一致の場合には(ス
テップ409NO)、予め用意された異常時処理が実行
され(ステップ410)、その旨を外部へ報知させた
り、或いは自動操作から手動操作へ切り替えるなどの適
宜な対応措置が採られる。
Here, if the output signal output to the outside matches the output data corresponding to the correct answer data prepared in advance (step 409 YES), the diagnosis result is determined to be normal, and the processing is terminated. If they do not match (NO in step 409), a prepared abnormal time process is executed (step 410), and an appropriate countermeasure such as notifying the fact to the outside or switching from automatic operation to manual operation is adopted. Can be

【0019】[0019]

【発明が解決しようとする課題】しかしながら、上述の
ような故障診断方法にあっては、先に説明した出力照合
処理(ステップ409)において、照合不一致が判定さ
れたとしても、その原因がCPU113それ自身、特に
ALU116を中心とする演算部にあることを特定でき
ないことに加え、演算途中結果にのみ誤りを生ずるよう
な演算部の異常に関しては全く診断できないという問題
がある。
However, in the above-described fault diagnosis method, even if the mismatch of the collation is determined in the output collation processing (step 409) described above, the cause is the CPU 113 or not. In addition to the fact that it is impossible to identify itself in the arithmetic unit, particularly the ALU 116, there is a problem that it is impossible to diagnose any abnormality in the arithmetic unit that causes an error only in the result of the arithmetic operation.

【0020】即ち、上述の診断方法の場合、診断を行う
に際しては、CPU113内の出力回路118a→疑似
信号入力部118→外部入力回路群(107〜110)
→CPU113の内部の入力回路(107a〜110
a)を順に経由する信号経路を経て、CPU113に模
擬信号を読み込ませ、これをRAM115内の入力変数
領域に書き込む。そのため、そのような信号経路に介在
された回路要素のいずれかに誤差ないしは異常が存在す
れば、それを原因としてRAM115内の入力変数領域
に書き込まれた模擬データそれ自体に誤りが生じている
場合もある。例えば、外部入力回路群107〜110の
いずれかに誤差乃至異常が存在すれば、仮に、模擬信号
入力部118から正常な信号が出力されていたとしても
RAM115の入力変数領域には誤ったデータが書き込
まれることとなるし、また模擬信号入力部118自体に
誤差ないしは異常が存在すれば外部入力回路107〜1
10が正常であっても、同様な結果が生ずることとな
る。殊に、車輪速センサ103,104からの周期的な
パルス列をCPU113に取り込ませるための車輪速セ
ンサ入力回路109,110に関しては、パルス列の周
期を繰り返し計測するというその検出原理のために、模
擬信号入力部118からそれらセンサ入力回路109,
110に対して指定された模擬信号に相当する周期デー
タを正確に取り込ませることはなかなか困難であり、そ
の結果、模擬信号入力部118並びに車輪速センサ入力
回路109,110を経由して、RAM115内の入力
変数領域に、予め決められた模擬信号に相当する車輪速
データを正確に書き込めない場合もある。このように、
RAM115に書き込まれた入力変数データそれ自体が
誤っている場合も考慮すると、前述の出力照合処理(ス
テップ409)にて照合不一致が判定された場合、これ
を直ちにCPU113内のALU116の異常と決めつ
けることには問題がある。
That is, in the case of the above-described diagnosis method, when performing a diagnosis, the output circuit 118a in the CPU 113 → the pseudo signal input section 118 → the external input circuit group (107 to 110)
→ Input circuit (107a to 110) inside CPU 113
The simulation signal is read by the CPU 113 via the signal path sequentially passing through a), and the simulation signal is written to the input variable area in the RAM 115. Therefore, if there is an error or abnormality in any of the circuit elements interposed in such a signal path, if an error occurs in the simulation data itself written in the input variable area in the RAM 115 due to the error or abnormality. There is also. For example, if an error or abnormality exists in any of the external input circuit groups 107 to 110, erroneous data is stored in the input variable area of the RAM 115 even if a normal signal is output from the simulation signal input unit 118. In this case, if there is an error or abnormality in the simulation signal input unit 118 itself, the external input circuits 107-1
A similar result will occur if 10 is normal. In particular, with respect to the wheel speed sensor input circuits 109 and 110 for causing the CPU 113 to receive the periodic pulse trains from the wheel speed sensors 103 and 104, the simulation signal is used because of the detection principle of repeatedly measuring the pulse train cycle. From the input unit 118, the sensor input circuits 109,
It is very difficult to accurately input the periodic data corresponding to the designated simulation signal to the simulation signal 110. As a result, the simulation data input section 118 and the wheel speed sensor input circuits 109 and 110 are used to store the data in the RAM 115. In some cases, it is not possible to accurately write wheel speed data corresponding to a predetermined simulation signal in the input variable area. in this way,
In consideration of the case where the input variable data itself written in the RAM 115 is wrong, if the collation mismatch is determined in the above-described output collation processing (step 409), this is immediately determined as an abnormality of the ALU 116 in the CPU 113. Has a problem.

【0021】同様にして、診断処理に際しては、CPU
113の内部の出力回路群111,112→出力モニタ
部119,120→CPU113の内部の入力回路11
9a120aを経由する信号経路を通して、出力データ
をCPU113に取り込み、これを最終的にRAM11
5内の出力変数領域に書き込むようにしている。そのた
め、そのような経路に介在された回路要素のいずれかに
誤差乃至異常が存在すれば、RAM115内の出力変数
領域に書き込まれた出力変数データそれ自体に誤りが存
在することもあり得る。例えば、モータドライバ回路1
11若しくはソレノイド信号出力回路112からの出力
信号は正しいにも拘らず、出力モニタ部119若しくは
120が正常に動作していなければ、RAM115の出
力変数領域に書き込まれる出力データは誤った値となる
虞れがある。そのため、このような出力データに基づい
て行われた出力照合処理(ステップ409)において照
合不一致が判定された場合、これを直ちにCPU113
内のALU116に異常があるものと決めつけることに
は問題がある。
Similarly, in the diagnosis processing, the CPU
Output circuit groups 111 and 112 inside 113 → output monitor sections 119 and 120 → input circuit 11 inside CPU 113
9a through the signal path passing through 120a, the CPU 113 captures the output data,
5 is written in the output variable area. Therefore, if there is an error or abnormality in any of the circuit elements interposed in such a path, an error may exist in the output variable data itself written in the output variable area in the RAM 115. For example, motor driver circuit 1
11 or the output signal from the solenoid signal output circuit 112 is correct, but if the output monitor 119 or 120 is not operating normally, the output data written to the output variable area of the RAM 115 may have an incorrect value. There is. Therefore, in the case where the collation mismatch is determined in the output collation processing (step 409) performed based on such output data, this is immediately determined by the CPU 113.
There is a problem in deciding that there is an abnormality in the ALU 116 inside.

【0022】加えて、上述の診断方法にあっては、予定
された模範出力変数データと比較されるべき対象は、最
終的に外部出力回路111,112からモニタされた信
号に限られるため、例えば、制御演算の途中で得られた
演算作業変数データである何等かの数値データを、特定
の閾値と比較して2値化し、その結果をCPU113の
内部の出力回路並びに外部の出力回路を経由して負荷に
与えるようなプログラムが組まれていたような場合、A
LU116の異常により数値演算結果に誤りが生じてい
たにも拘らず、そのようにして得られた誤った数値デー
タの値がたまたま閾値以内に収っていたりすると、外部
に得られる2値信号の値には正常な場合と何等相違がな
く、その結果、このようなALU116の異常を判定す
ることができない。例えば、何等かの数値演算結果を閾
値80H(16進数)と比較して弁別2値化し、80H
(16進数)以上であればオン、80H(16進数)未
満であればオフとするようなプログラムが組まれている
ような場合、数値演算結果がA0H(16進数)となる
べきところ、ALUの異常によりそれが90H(16進
数)となっていても、出力信号をモニタするだけの方法
では、このようなALUの誤動作を診断することができ
ないのである。
In addition, in the above-described diagnostic method, the object to be compared with the expected model output variable data is limited to the signals finally monitored from the external output circuits 111 and 112. Any numerical data which is operation variable data obtained during the control operation is compared with a specific threshold value and binarized, and the result is passed through an output circuit inside the CPU 113 and an external output circuit. If a program that gives the load
In spite of the fact that an error has occurred in the numerical operation result due to an abnormality of the LU 116, if the value of the erroneous numerical data thus obtained happens to fall within the threshold value, the externally obtained binary signal There is no difference in the value from the normal case, and as a result, such an abnormality of the ALU 116 cannot be determined. For example, any numerical operation result is compared with a threshold value of 80H (hexadecimal number) to be discriminated into a binary value.
(Hexadecimal number) or more, if the program is set to turn off if less than 80H (hexadecimal number), the numerical operation result should be A0H (hexadecimal number) Even if the value is 90H (hexadecimal) due to an abnormality, it is not possible to diagnose such a malfunction of the ALU by only monitoring the output signal.

【0023】更に、図4のステップ404並びにステッ
プ405に示されるように、同一の出力状態(モータ正
転,ソレノイドオン)をもたらす演算途中結果が、演算
結果(A)と演算結果(C)とのように複数存在するよ
うな場合、出力状態をモニタするだけでは、ALUの異
常により本来出力状態が(A)となるべきところを、出
力状態が(C)となってしまったような異常ついては、
判定することができない。
Further, as shown in Steps 404 and 405 of FIG. 4, the intermediate calculation results that result in the same output state (motor normal rotation, solenoid ON) are the calculation results (A) and (C). In the case where there are a plurality of such cases, simply monitoring the output state means that the output state should be (A) due to the abnormality of the ALU, but the output state should be (C). ,
Cannot be determined.

【0024】このように、外部入力回路を介して模擬信
号を与えて制御プログラムをシミュレートし、その結果
を外部出力回路を介してモニタし、そのモニタ結果を予
め用意された正常時のデータと照合して、故障診断を行
う故障診断方法にあっては、仮に故障が診断されたとし
ても、直ちにそれをもってCPU自身の異常を判定する
ことが難しいことに加え、このような診断方法ではプロ
グラムの組み方によっては、CPU自身特にALUを中
心とする演算部の異常に起因する途中演算結果の異常に
関しては全く対応することができないという問題点があ
った。
As described above, the control program is simulated by giving the simulation signal through the external input circuit, the result is monitored through the external output circuit, and the monitored result is compared with the normal data prepared in advance. In the failure diagnosis method of collating and performing the failure diagnosis, even if the failure is diagnosed, it is difficult to immediately determine the abnormality of the CPU itself based on the failure diagnosis. There is a problem that depending on the assembling method, it is impossible to cope with an abnormality in the intermediate calculation result caused by an abnormality in the arithmetic unit, especially the ALU, in particular.

【0025】この発明は、上述の問題点を解決するため
になされたものであり、その目的とするところは、CP
U自身の故障を的確に診断する機能を備えたマイクロコ
ンピュータ装置を提供することにある。
The present invention has been made to solve the above-mentioned problems, and has as its object the purpose of the present invention.
An object of the present invention is to provide a microcomputer device having a function of accurately diagnosing a failure of U itself.

【0026】[0026]

【課題を解決するための手段】この出願の請求項1に記
載の発明は、外部から信号を入力するための信号入力回
路と、外部へと信号を出力するための信号出力回路と、
制御プログラムを格納させたROMと、前記制御プログ
ラムで使用される入力変数データ、演算作業変数デー
タ、出力変数データをそれぞれ格納するための入力変数
領域、演算作業変数領域、出力変数領域がそれぞれ設け
られたRAMと、前記ROMに格納された制御プログラ
ムを実行するためのCPUとを備えたマイクロコンピュ
ータ装置において、前記ROM内には、特定の制御状態
に対応する、少なくとも一組の診断用書込データと出力
期待データとを新たに格納すると共に、動作モードが診
断モードに設定されているときは、前記入力変数領域又
は演算作業変数領域又は出力変数領域の内容を、前記R
OM内に格納された診断用書込データに書き替えると共
に出力期待データと照合することにより前記照合結果に
基づいて前記CPU自身の動作を診断し得るように構成
したことを特徴とするマイクロコンピュータ装置にあ
る。
According to a first aspect of the present invention, there is provided a signal input circuit for externally inputting a signal, a signal output circuit for externally outputting a signal,
A ROM in which a control program is stored, and an input variable area, an operation work variable area, and an output variable area for storing input variable data, operation work variable data, and output variable data used in the control program are provided, respectively. And a CPU for executing a control program stored in the ROM, wherein at least one set of diagnostic writing data corresponding to a specific control state is stored in the ROM. And the expected output data are newly stored, and when the operation mode is set to the diagnostic mode, the contents of the input variable area, the operation work variable area, or the output variable area are stored in the R variable.
A microcomputer device configured to rewrite the diagnostic write data stored in the OM and collate with expected output data to diagnose the operation of the CPU itself based on the collation result. It is in.

【0027】ここでいう『マイクロコンピュータ装置』
には、信号入力回路と、信号出力回路と、ROMと、R
AMと、CPUとが備えられている。
The “microcomputer device” here
Has a signal input circuit, a signal output circuit, a ROM,
An AM and a CPU are provided.

【0028】ここで、『信号入力回路』には、外部セン
サやスイッチから入力された2値信号を取り込むものに
限らず、アナログ信号をA/Dに変換して取り込むも
の、パルス列を周期に変換して取り込むものなどのよう
な様々な形式のものが含まれるであろう。
Here, the "signal input circuit" is not limited to a circuit for taking in a binary signal inputted from an external sensor or a switch, a circuit for taking in an analog signal after converting it into an A / D, or a circuit for converting a pulse train into a cycle. A variety of formats may be included, such as importing.

【0029】また、『信号出力回路』には、CPUから
出力されるデジタルデータを、D/A変換回路を介して
アナログ信号として出力するもの、そのままオンオフ信
号として出力するものなど種々の形態のものが含まれる
であろう。
The "signal output circuit" includes various types of digital signal output from the CPU through a D / A conversion circuit as an analog signal, an output as an on / off signal as it is, and the like. Will be included.

【0030】また、『RAM』と『ROM』とは、例え
ば8ビット構成の制御用1チップマイクロコンピュータ
等のように、CPUそれ自体に内蔵されているものも含
まれる。
The "RAM" and "ROM" include those built in the CPU itself, such as an 8-bit control one-chip microcomputer.

【0031】ROM内には、『制御プログラム』が格納
される。この『制御プログラム』には、『信号入力処
理』と、『制御演算処理』と、『信号出力処理』とを含
めることができる。これら3つの処理は、時間帯を異な
らせて時分割的に行わわれるのが一般であるが、この発
明では必ずしもそれには限られない。例えば、特定の入
力データについて信号入力処理を行うと共に、直ちにそ
れに関する制御演算処理を実行し、その後該当する出力
データを出力信号として外部へと出力するといった、所
謂都度実行方式を用いることもできる。この場合、後述
するRAMの入力変数領域、演算作業変数領域、出力変
数領域のそれぞれには、該当するデータがランダムなタ
イミングで書き込まれるであろう。尚、ここで『入力変
数領域』、『演算作業変数領域』、並びに、『出力変数
領域』とは、外部から取り込まれる入力変数データ、演
算途中で使用される演算作業変数データ、並びに、外部
へと出力されるべき出力変数データの格納領域として機
能する領域であり、これらの領域は必ずしもメモリ上に
おいて物理的に一塊にブロック化されて存在するもので
はなく、個々の変数がメモリ上に適当に分散して存在す
る場合も含まれるものである。
A "control program" is stored in the ROM. The “control program” can include “signal input processing”, “control calculation processing”, and “signal output processing”. These three processes are generally performed in a time-division manner with different time zones, but the present invention is not necessarily limited thereto. For example, it is also possible to use a so-called execution method in which a signal input process is performed on specific input data, a control operation process relating to the specific input data is immediately performed, and then the corresponding output data is output to the outside as an output signal. In this case, the corresponding data will be written at random timing in each of the input variable area, the operation work variable area, and the output variable area of the RAM described later. Here, the “input variable area”, “calculation work variable area”, and “output variable area” are input variable data taken in from outside, calculation work variable data used during the calculation, and These are areas that function as storage areas for output variable data to be output, and these areas do not necessarily exist physically in blocks in memory, and individual variables are appropriately stored in memory. This includes the case where they are dispersed.

【0032】ROM内には、特定の制御状態に対応す
る、少なくとも一組の診断用書込データと出力期待デー
タとが格納される。ここで、『特定の制御状態』とは、
制御負荷を特定の状態に制御している状態のことを意味
している。例えば、ABSの場合であれば、急ブレーキ
を掛けた場合のようにABSが動作している状態、通常
の走行中に軽くブレーキを掛けた場合のようにABSが
動作していない状態、を挙げることができる。
The ROM stores at least one set of diagnostic write data and expected output data corresponding to a specific control state. Here, the "specific control state"
This means that the control load is controlled to a specific state. For example, in the case of ABS, a state in which the ABS is operating, such as when sudden braking is applied, and a state in which the ABS is not operating, such as when the brake is applied lightly during normal driving, are given. be able to.

【0033】『診断用書込データ』には、ある特定の制
御状態をシミュレートするのに必要とされる各種のデー
タが含まれる。一般に、この種の制御演算は、単に入力
変数データのみならず、それまでの演算来歴等を反映し
た演算作業変数領データ、更には、場合によっては、出
力変数データまでをも参照して行われる。そのため、こ
こで言う『診断用書込データ』には、ある特定の制御状
態をシミュレートするのに必要とされる全てのデータが
含まれる。
"Diagnosis write data" includes various data required to simulate a specific control state. Generally, this type of control operation is performed not only by input variable data but also by reference to operation work variable data reflecting the operation history and the like, and in some cases, even output variable data. . Therefore, the "diagnosis write data" referred to here includes all data necessary to simulate a specific control state.

【0034】また、『出力期待データ』には、ある特定
の制御状態をシミュレートした結果、CPUが正常に動
作した場合に得られると期待されるデータの内、照合対
象とする任意のデータの全てが含まれる。特に、この
『出力期待データ』には、最終的に外部に送出されるべ
き出力変数データのみならず、演算途中結果やそれまで
の演算来歴を反映した演算作業変数データも含まれる。
ここで、『出力期待データ』として照合するデータは必
ずしも全てのデータではなく任意に設定すればよいと考
えられる。
The “output expected data” includes, among data expected to be obtained when the CPU operates normally as a result of simulating a specific control state, arbitrary data to be collated. Everything is included. In particular, the "expected output data" includes not only output variable data to be finally sent to the outside but also operation work variable data reflecting the result of the operation and the operation history up to that time.
Here, it is considered that the data to be collated as “output expected data” is not necessarily all data, but may be set arbitrarily.

【0035】ROM内に格納された制御プログラムに
は、『診断用データ書き替え処理』と、『データ照合処
理』とを付加することができる。ここで、『診断用デー
タ書き替え処理』は、先に述べた診断方法とは異なり、
外部入力回路などを一切経由することなく行なうことが
できる。同様に、『データ照合処理』においても、出力
データの照合は、従来方法とは異なり、外部出力信号を
一切モニタすることなく、直接ROMに格納された出力
期待データを用いて行なうことができる。そして、それ
ら『データ書き替え処理』並びに『データ照合処理』
は、動作モードが診断モードに設定されていることを条
件として行われる。ここで、『診断モード』の設定は、
電源投入直後のイニシャライズ処理において、或いは、
当該制御システムに固有な待機時間帯などに行なうこと
ができる。具体的な一例としては、制御システムが車両
用ABSであるような場合、電源投入直後のイニシャラ
イズ処理において、或いは、少なくとも車両が停止して
電子制御によるブレーキ操作が行われていない時期など
を選択すれば良いであろう。
The control program stored in the ROM can be supplemented with "diagnosis data rewriting processing" and "data collation processing". Here, the “diagnostic data rewriting process” is different from the diagnostic method described above.
This can be performed without going through any external input circuit or the like. Similarly, in the "data collation process", unlike the conventional method, the collation of the output data can be performed directly using the expected output data stored in the ROM without monitoring any external output signal. And "data rewriting process" and "data collation process"
Is performed on condition that the operation mode is set to the diagnostic mode. Here, the setting of "diagnosis mode"
In the initialization process immediately after turning on the power, or
This can be performed during a standby time zone unique to the control system. As a specific example, when the control system is a vehicle ABS, in the initialization processing immediately after turning on the power, or at least a time when the vehicle is stopped and the brake operation by the electronic control is not performed is selected. It would be good.

【0036】尚、本発明の主たる目的とするところは、
外部入力回路や外部出力回路と言った周辺回路の影響を
回避した状態において、診断用書込データに基づき制御
プログラムのシミュレートを行い、その結果を出力期待
データと照合することにより、CPU自身の動作を診断
するものであり、その診断結果をどのように利用すべき
かについては必ずしも要件とするものではない。これに
ついては、CPU自身の動作異常が判定された場合、C
PUの動作を停止させたり、或いは自動モードから手動
モードへ切り替えたり、或いはその旨を外部へ報知して
別途適切な対応措置を採らせるなど様々なケースが考え
られるであろう。
The main object of the present invention is to
In a state in which the influence of peripheral circuits such as an external input circuit and an external output circuit is avoided, the control program is simulated based on the diagnostic write data, and the result is compared with the expected output data, whereby the CPU itself can be evaluated. The operation is diagnosed, and how to use the diagnosis result is not always a requirement. Regarding this, when it is determined that the operation of the CPU itself is abnormal, C
Various cases may be considered, such as stopping the operation of the PU, switching from the automatic mode to the manual mode, or notifying the fact to the outside and taking appropriate appropriate countermeasures.

【0037】そして、この請求項1に記載の発明によれ
ば、動作モードが診断モードに設定されていることを条
件として、診断用書込データで書き替えられた入力変数
領域並びに演算作業変数領域、さらに必要な場合には、
出力変数領域の内容に基づき制御プログラムの実行(シ
ミュレート)が行われ、その実行結果により得られた演
算作業変数領域並びに出力変数領域の内容は、予め用意
された出力期待データと照合される。その為、本発明の
制御プログラムシミュレートによる故障診断にあって
は、外部入力回路や外部出力回路を一切経由しないこと
により、CPU自身の動作を的確に診断することができ
る。
According to the first aspect of the present invention, the input variable area and the operation work variable area rewritten with the diagnostic write data on condition that the operation mode is set to the diagnostic mode. , And if needed,
The control program is executed (simulated) based on the contents of the output variable area, and the contents of the operation work variable area and the output variable area obtained from the execution result are collated with the output expected data prepared in advance. Therefore, in the failure diagnosis by the control program simulation of the present invention, the operation of the CPU itself can be accurately diagnosed by not passing through any external input circuit or external output circuit.

【0038】また、この請求項1の発明にあっては、先
に述べた診断方法のように、外部出力回路からモニタさ
れた出力データではなく、RAMの出力変数領域並びに
演算作業領域に書き込まれた内容と出力期待データとを
用いて、シミュレート結果の正誤判定を行う為、診断に
際して出力変数領域の内容を外部出力回路へと送出する
ことが不要となり、その為制御対象負荷に何等影響を与
えることなくこの種の診断を行うことができる。
According to the first aspect of the present invention, instead of the output data monitored from the external output circuit as in the diagnosis method described above, the data is written to the output variable area and the operation work area of the RAM. It is not necessary to send the contents of the output variable area to the external output circuit at the time of diagnosis because the correct / incorrect judgment of the simulation result is performed using the contents and the expected output data. This type of diagnosis can be made without giving.

【0039】更に、RAMの演算作業変数領域並びに出
力変数領域のデータを用いてシミュレート結果の正誤判
定を行えることから、外部へと出力されるべき最終出力
データのみならず、その途中演算結果に相当するデータ
についても、シミュレート結果の正誤判定に利用するこ
とができ、その為途中演算結果については誤りであって
も、最終出力データについては正常時と変わりがないと
いったALUの異常動作についても、これを的確に診断
することができる。即ち、このようなALUの異常動作
とは、例えば先に説明したように、途中演算結果として
得られた数値データを特定の閾値と比較して2値化弁別
し、その結果を外部へと出力しているようなプログラム
の場合や、或いは複数の数値演算結果若しくは論理演算
結果の論理和をとって最終的な出力データを生成するよ
うな場合である。
Furthermore, since the correctness / incorrectness of the simulation result can be determined by using the data of the calculation work variable area and the output variable area of the RAM, not only the final output data to be output to the outside but also the calculation result in the middle thereof can be obtained. The corresponding data can also be used to determine whether the simulation result is correct or not. Therefore, even if the intermediate calculation result is incorrect, the ALU abnormal operation such that the final output data does not change from the normal state can be used. This can be accurately diagnosed. That is, such an abnormal operation of the ALU means that, for example, as described above, the numerical data obtained as an intermediate calculation result is compared with a specific threshold value to binarize and discriminate, and the result is output to the outside. This is the case where the program performs such a program, or the case where the final output data is generated by taking the logical sum of a plurality of numerical operation results or logical operation results.

【0040】この出願の請求項2に記載の発明は、前記
診断用書込データ、並びに、前記出力期待データは、複
数組だけ設けられ、かつ前記診断用データ書き替え処理
では、前記複数組から選択された一組のデータを構成す
る診断用書込データにより、前記入力変数領域の全部若
しくは一部、並びに、演算作業変数領域の全部若しくは
一部、及び/又は、出力変数領域の全部若しくは一部の
内容を書き替えるものであり、前記データ照合処理で
は、前記複数組から選択された一組のデータを構成する
出力期待データと、制御演算処理の実行により書き替え
られた前記演算作業変数領域の全部若しくは一部、及び
/又は、前記出力変数領域の全部若しくは一部の内容と
を照合するものである、ことを特徴とする請求項1に記
載のマイクロコンピュータ装置にある。
In the invention described in claim 2 of the present application, the diagnostic write data and the output expectation data are provided only in a plurality of sets, and in the diagnostic data rewriting processing, the plurality of sets are read from the plurality of sets. By the diagnostic writing data constituting the selected set of data, all or a part of the input variable area, all or a part of the operation work variable area, and / or all or a part of the output variable area. In the data collation processing, the output collation data constituting one set of data selected from the plurality of sets and the operation work variable area rewritten by execution of the control operation processing are included in the data collation processing. 2. The microcomputer according to claim 1, wherein all or part of the output variable area and / or all or part of the output variable area are collated. In the over the other apparatus.

【0041】ALUなどに代表される演算部の故障は、
そのような演算部に対して1若しくは2以上の特定パタ
ーンの数値演算を行わせた場合に顕著に表れるものと考
えられる。一方、制御システムの側から見た場合にも、
特に制御信頼性を要求される幾つかの制御状態が存在す
ると考えられる。従って、そのような演算部の状態を診
断するに好適な制御状態若しくは特に信頼性に対応し
て、診断用書込データ、並びに、出力期待データを複数
組設けておけば、この種のマイクロコンピュータを用い
た制御システムにおける信頼性を一層高めることができ
るであろう。
The failure of the arithmetic unit represented by the ALU or the like
It is conceivable that this will be noticeable when one or more specific patterns of numerical operations are performed on such an operation unit. On the other hand, when viewed from the control system side,
In particular, it is considered that there are some control states that require control reliability. Therefore, if a plurality of sets of diagnostic writing data and expected output data are provided in correspondence with a control state suitable for diagnosing the state of such an operation unit or particularly reliability, this kind of microcomputer Will be able to further enhance the reliability of the control system using the.

【0042】この出願の請求項3に記載の発明は、前記
データ書き替え処理には、書き替えに先立って、前記R
AM内の特定の変数領域の内容を退避させる変数退避処
理が含まれており、かつ前記データ照合処理には、照合
一致を条件として、前記信号出力処理に先立ち、前記退
避されていた特定の変数領域の内容を復帰させる変数復
帰処理が含まれているこを特徴とする請求項1に記載の
マイクロコンピュータ装置にある。
According to a third aspect of the present invention, in the data rewriting process, the data rewriting process is performed prior to rewriting.
A variable saving process for saving the contents of a specific variable area in the AM is included, and the data collating process is performed on the condition that a matching match is made, and before the signal output process, the specific variable saved is saved. 3. The microcomputer according to claim 1, further comprising a variable return process for restoring the contents of the area.

【0043】前述したように、どのような状態の時に診
断モードに設定すべきかについては、幾つかの場合が考
えられる。例えば、電源投入直後であって、まだ制御プ
ログラムへの実行へ移行する以前の所謂イニシャル状態
である場合、或いは、一旦制御は開始したものの、車両
が停止して電子制御によるブレーキ操作がおこなわれて
いない様な状態が挙げられる。それら幾つかの中で、既
に何らかの制御が行われた後にあっては、RAM内の入
力変数領域、演算作業変数領域、並びに、出力変数領域
の中には、様々なデータが書き込まれた状態にあり、そ
れらのデータの中には、制御再開にあたってその直前の
状態を必要とするようなデータも存在すると考えられ
る。にも拘らず、診断モードに際して、それらのデータ
が診断用データ書き替え処理並びに制御プログラムのシ
ミュレートの際の実行により書き替えられるとすれば、
その後の制御に支障を来す虞れも考えられる。
As described above, there are several cases in which the diagnostic mode should be set in what state. For example, immediately after the power is turned on and in a so-called initial state before the transition to the execution of the control program, or when the control is started once but the vehicle is stopped and the brake operation by the electronic control is performed. There is no such condition. In some of them, after some control has already been performed, various data are written in the input variable area, the operation work variable area, and the output variable area in the RAM. It is conceivable that some of these data require the state immediately before the control is resumed. Nevertheless, if the data is rewritten by the diagnostic data rewriting process and the execution at the time of simulating the control program in the diagnostic mode,
It is also conceivable that subsequent control may be hindered.

【0044】そこで、この発明では、そのような診断後
に尚も必要とするデータについては、予めRAM内の所
定エリアに退避させ、診断終了後制御再開にあたってこ
れを再びRAM内の所定の変数領域に復帰させるのであ
る。
Therefore, in the present invention, data that is still required after such a diagnosis is saved in a predetermined area in the RAM in advance, and when the control is resumed after the diagnosis is completed, the data is again stored in a predetermined variable area in the RAM. Let it return.

【0045】そのようにすれば、一旦制御が開始された
後、その途中で故障診断がおこなわれる場合であって
も、そのような故障診断によって制御が中断され、制御
対象負荷に悪影響を与えることを未然に防止できる。
By doing so, even if the fault diagnosis is performed in the middle after the control is started once, the control is interrupted by such a fault diagnosis, and the load to be controlled is adversely affected. Can be prevented beforehand.

【0046】この出願の請求項4に記載の発明は、前記
出力データ照合処理では、照合不一致を条件として、所
定の命令実行異常処理への移行を行うことを特徴とする
請求項1に記載のマイクロコンピュータ装置にある。
The invention according to claim 4 of the present application is characterized in that, in the output data collation processing, a transition to a predetermined instruction execution abnormality processing is performed on condition that the collation does not match. It is in a microcomputer device.

【0047】前述したように、請求項1に記載の発明
は、外部入力回路や外部出力回路の影響を受けることな
く、CPU自身の故障、特にALUに代表される演算部
の故障を的確に診断することにあり、その診断結果を用
いてどのような対応策を採るかについては、必ずしも要
件とされるものではない。
As described above, the first aspect of the present invention accurately diagnoses a failure of a CPU itself, particularly a failure of an arithmetic unit represented by an ALU, without being affected by an external input circuit or an external output circuit. Therefore, what kind of countermeasures to take based on the diagnostic results is not necessarily required.

【0048】そこで、この請求項4に記載の発明では、
上述の出力データ照合処理において照合不一致が判定さ
れた場合、これを条件として所定の命令実行異常処理を
行うものである。ここで、『所定の命令実行異常処理』
としては、様々なケースが考えられる。例えば、CPU
自身に異常が生じていることを何らかの警報信号により
外部へ報知したり、或いは、CPUの動作を強制的に停
止させたり、更には所謂ダブルマイコンシステムを採用
するものであれば、制御権を他のマイコンに移管するな
どの適切な措置を採ることができる。
Therefore, in the invention according to claim 4,
If a mismatch is determined in the output data matching process described above, a predetermined instruction execution abnormality process is performed on the condition of the mismatch. Here, "predetermined instruction execution abnormal processing"
Various cases can be considered. For example, CPU
If an alarm is issued to the outside by an alarm signal, or the operation of the CPU is forcibly stopped, or if a so-called double microcomputer system is employed, the control right may be changed to another. Appropriate measures such as transfer to a microcomputer can be taken.

【0049】この出願の請求項5に記載の発明は、前記
マイクロコンピュータ装置は、車両用のアンチロックブ
レーキシステムの制御に用いられる制御用マイクロコン
ビュータであることを特徴とする請求項1に記載のマイ
クロコンピュータ装置にある。
The invention according to claim 5 of the present application is characterized in that the microcomputer device is a control microcomputer used for controlling an antilock brake system for a vehicle. It is in a microcomputer device.

【0050】請求項1に記載のマイクロコンピュータ装
置は、様々な制御システムに適用することが可能であ
る。ここでは、上述のマイクロコンピュータ装置を、車
両用のアンチロックブレーキシステムの制御に用いてい
る。従来、この制御のためには、要求される高度な制御
信頼性のために、複数のマイクロコンピュータを並列に
設けた所謂ダブルマイコンシステムが採用されていた
が、本発明のマイクロコンピュータ装置を適用すること
により、マイクロコンピュータのCPU自身の故障を、
他のマイクロコンピュータにより診断させることが必ず
しも必要とはなくなるであろう。
The microcomputer device according to claim 1 can be applied to various control systems. Here, the microcomputer device described above is used for controlling an antilock brake system for a vehicle. Conventionally, for this control, a so-called double microcomputer system in which a plurality of microcomputers are provided in parallel has been adopted for the required high control reliability, but the microcomputer device of the present invention is applied. As a result, the failure of the microcomputer CPU itself
Diagnosis by other microcomputers may not be necessary.

【0051】この出願の請求項6に記載の発明は、電源
投入直後の制御に移行する前であることを条件として、
並びに、少なくとも車両が停止して電子制御によるブレ
ーキ操作が行われていないことを条件として、診断モー
ドへの設定を許可することを特徴とする請求項5に記載
のマイクロコンピュータ装置にある。
The invention described in claim 6 of the present application is based on the condition that the control immediately after the power is turned on and before the transition to the control.
The microcomputer device according to claim 5, wherein the setting to the diagnosis mode is permitted at least on condition that the vehicle is stopped and the brake operation by the electronic control is not performed.

【0052】前述したように、請求項1に記載の発明に
あっては、診断モードに設定するための条件としては、
そのマイクロコンピュータが適用される制御システムの
特性に併せて、適宜に決定される。ここでは、請求項1
に記載のマイクロコンピュータ装置を車両用ABSシス
テムの制御に採用すると共に、特に電源投入直後の未だ
制御に移行する前の所謂初期状態、並びに、車両が停止
して電子制御によるブレーキ操作が行われていない所謂
制御空き時間に行うようにしている。ABSシステムの
場合、電子制御によるブレーキ操作は走行中頻繁に行わ
れるため、そのような走行中に本発明の故障診断を行う
わけにはいかない。一方、一旦制御が開始されたからと
いって、その後故障診断を一切行わないとすれば、走行
中にマイクロコンピュータ装置に何らかの異常が発生し
た場合、その後制御不具合が生ずる虞れも考えられる。
そこで、この請求項6に記載の発明では、そのような走
行に影響のない時期を選んで診断モードへの設定を行お
うとしているのである。
As described above, according to the first aspect of the present invention, the conditions for setting the diagnostic mode include:
It is appropriately determined according to the characteristics of the control system to which the microcomputer is applied. Here, claim 1
And the so-called initial state, particularly immediately after the power is turned on, before shifting to control, and the brake operation by electronic control is performed when the vehicle is stopped. There is no so-called control idle time. In the case of the ABS system, since the brake operation by the electronic control is frequently performed during traveling, the failure diagnosis of the present invention cannot be performed during such traveling. On the other hand, if the failure diagnosis is not performed at all after the control is started once, if any abnormality occurs in the microcomputer device during traveling, there is a possibility that a control failure may occur thereafter.
Therefore, according to the invention described in claim 6, it is attempted to set the diagnosis mode by selecting a time that does not affect such traveling.

【0053】なお、ここで『少なくとも』とあるのは、
それらの条件に加えて、他の条件(例えば、所定時間の
経過を確認するタイマ処理等)を追加することも考慮し
たものである。
Here, “at least” means that
In addition to these conditions, consideration is given to adding other conditions (for example, a timer process for confirming elapse of a predetermined time).

【0054】この出願の請求項7に記載の発明は、前記
診断用書込データ、並びに、前記出力期待データは複数
組だけ設けられ、それらの組の少なくとも一つは、アン
チロックブレーキシステムが作動する状態に対応するも
のであり、かつ他の少なくとも一つは、アンチロックブ
レーキシステムが作動しない状態に対応するものであ
る、ことを特徴とする請求項5に記載のマイクロコンピ
ュータ装置にある。
In the invention according to claim 7 of the present application, the diagnostic write data and the output expectation data are provided only in plural sets, and at least one of the sets is operated by the antilock brake system. The microcomputer device according to claim 5, wherein the microcomputer device corresponds to a state in which the anti-lock brake system does not operate.

【0055】前述のように、マイクロコンピュータのC
PU自身に生ずる異常、中でもALUに代表される演算
部の異常は、数値演算に拘る制御中に発生することが多
いであろう。これをABSシステムの制御に適用する
と、車速とブレーキ操作量とが一定の条件を満足する時
に、アンチロックブレーキシステムが作動するか、ある
いは作動しないかに基づき、そのようなALUなどの演
算部の異常を的確に診断することができると考えられ
る。
As described above, the microcomputer C
An abnormality that occurs in the PU itself, particularly an abnormality of the arithmetic unit represented by the ALU, often occurs during control related to numerical calculation. When this is applied to the control of the ABS system, when the vehicle speed and the amount of brake operation satisfy certain conditions, the operation of an arithmetic unit such as an ALU is determined based on whether the antilock brake system operates or does not operate. It is considered that abnormalities can be diagnosed accurately.

【0056】そこで、この発明では、そのような2つの
場合を代表的な制御状態として想定し、それぞれの制御
状態に対応して二組の診断用書込データ、並びに、出力
期待データをROMに格納し、それらを用いて該当する
制御状態におけるシミュレート並びにその結果照合を行
うものである。
Therefore, in the present invention, such two cases are assumed as representative control states, and two sets of diagnostic write data and output expected data are stored in the ROM corresponding to each control state. The stored data is used to simulate the corresponding control state and collate the result.

【0057】この出願の請求項8に記載の発明は、前記
診断モードは、前記制御プログラムの一巡実行ループの
間に限り設定状態に維持されることを特徴とする請求項
1〜7のいずれかに記載のマイクロコンピュータ装置に
ある。
The invention according to claim 8 of the present application is characterized in that the diagnostic mode is maintained in a set state only during a loop of execution of the control program. The microcomputer device described in the above.

【0058】この種の診断処理は、できるだけ短い時間
で行うことが好ましい。ここに、本発明の診断処理は、
診断用データをRAMの入力変数領域並びに演算作業変
数領域、さらに必要であれば、出力変数領域内の必要部
分に書き込むと共に、その書き込まれたデータに基づき
制御プログラムをシミュレートさせ、その結果で書き替
えられたRAMの演算作業変数領域並びに出力変数領域
の内容を、予め用意された出力期待データと照合するだ
けであるから、仮に論理演算のみならず過去の来歴を必
要とする順序演算が行われていたとしても、それら演算
途中結果の幾つかを予め診断用演算作業データとして用
意しておけば、これを制御プログラムの一巡実行時間の
間に完了することができるであろう。
This kind of diagnostic processing is preferably performed in a time as short as possible. Here, the diagnostic processing of the present invention
The diagnostic data is written in the input variable area and the operation work variable area of the RAM and, if necessary, in a necessary portion in the output variable area, and a control program is simulated based on the written data, and the result is written. Since only the contents of the replaced operation variable area and output variable area of the RAM are compared with the expected output data prepared in advance, not only the logical operation but also the order operation requiring the past history is performed. Even if this is done, if some of the results of these calculations are prepared in advance as diagnostic calculation work data, this will be completed during the round of execution of the control program.

【0059】[0059]

【発明の実施の形態】以下、この発明の好ましい実施の
形態につき、添付図面を参照して詳細に説明する。
Preferred embodiments of the present invention will be described below in detail with reference to the accompanying drawings.

【0060】先に説明したように、シミュレーション手
法を用いてCPUの異常を診断する場合、模擬信号を入
力回路を介して外部から取り込んだり、或いは照合され
るべき出力信号をモニタ回路を介して外部から取り込ん
だりすると、それらの回路要素が診断系に介在されるこ
とから、その分だけ診断の信頼性が低下し、CPU自身
の診断を的確に行うことが困難となる。
As described above, when diagnosing the abnormality of the CPU using the simulation technique, the simulation signal is taken in from the outside via the input circuit, or the output signal to be verified is output from the monitor circuit through the monitor circuit. If these are taken in from the system, these circuit elements are interposed in the diagnostic system, so that the reliability of the diagnostics is reduced by that much, making it difficult to accurately diagnose the CPU itself.

【0061】そこで、この発明では、それら診断に必要
な模擬入力信号に相当する入力データ並びに照合の対象
となる出力信号に相当する出力データをいずれもマイク
ロコンピュータ内部から取り込むという手法を採用する
ことにより、従来問題とされた入力回路並びに出力回路
の誤差や異常に起因する誤った診断結果の発生を未然に
防止している。加えて、診断に際しては、新たに演算作
業変数の照合も行うため、演算途中結果の確認を通して
ALUに代表される演算部の異常も的確に診断可能とし
ている。
Therefore, the present invention adopts a method of taking in both the input data corresponding to the simulated input signal necessary for the diagnosis and the output data corresponding to the output signal to be checked from inside the microcomputer. In addition, the occurrence of erroneous diagnosis results due to errors and abnormalities of the input circuit and the output circuit, which has been considered as a problem, is prevented. In addition, at the time of diagnosis, since a new operation work variable is also collated, it is possible to accurately diagnose an abnormality of the arithmetic unit represented by the ALU through checking the result of the arithmetic operation.

【0062】即ち、図1において、マイクロコンピュー
タ装置1は、この例にあっても、車両用ABSの制御に
用いられる8ビット構成の1チップマイクロコンピュー
タが示されている。このマイクロコンピュータ装置1の
内部には、ブレーキスイッチ(図示せず)からの信号を
取り込むためのブレーキスイッチ入力回路2と、ストロ
ークセンサ(図示せず)からの信号を取り込むためのブ
レーキストロークセンサ入力回路3と、前輪用の車輪速
センサから到来するパルス列の周期を検出し、これを取
り込むためのFr車輪速センサ入力回路4と、後輪用の
車輪速センサから到来するパルス列の周期を検出して取
り込むためのRr車輪速センサ入力回路5と、ブレーキ
用アクチュエータを操作するためのモータ(図示せず)
に対して出力信号を送出するためのモータ駆動回路6
と、同様にしてブレーキ用アクュエータを操作するため
のソレノイド(図示せず)に対して出力信号を送出する
ためのソレノイド駆動回路7と、制御プログラムの他、
後に詳述する診断用書き込みデータ並びに出力期待デー
タを格納させたROM8と、入力変数領域や出力変数領
域の他に、後に詳細に説明するように演算作業変数領域
並びに変数退避領域を設けたRAM9と、ROM8に格
納された制御プログラムを実行するためのCPU10と
から構成されている。ここで、ROM8並びにRAM9
は、CPU10の外部に配置されているが、これらのR
OM8並びにRAM9をCPU10に内蔵させることも
できる。
That is, FIG. 1 shows the microcomputer device 1 as an 8-bit one-chip microcomputer used for controlling the vehicle ABS in this example. A brake switch input circuit 2 for receiving a signal from a brake switch (not shown) and a brake stroke sensor input circuit for receiving a signal from a stroke sensor (not shown) are provided inside the microcomputer device 1. 3, a Fr wheel speed sensor input circuit 4 for detecting the cycle of the pulse train coming from the front wheel speed sensor, and taking in the pulse train, and detecting the cycle of the pulse train coming from the rear wheel speed sensor. Rr wheel speed sensor input circuit 5 for taking in and a motor (not shown) for operating a brake actuator
Drive circuit 6 for sending an output signal to
Similarly, a solenoid drive circuit 7 for sending an output signal to a solenoid (not shown) for operating a brake actuator, and a control program,
A ROM 8 storing diagnostic write data and output expected data, which will be described in detail later, and a RAM 9 having an operation work variable area and a variable save area, as will be described later, in addition to an input variable area and an output variable area. And a CPU 10 for executing a control program stored in the ROM 8. Here, the ROM 8 and the RAM 9
Are arranged outside the CPU 10, but these R
The OM 8 and the RAM 9 can be built in the CPU 10.

【0063】次に、ROM8に格納されたプログラム並
びにデータについて説明する。ROM8内には、ABS
用の制御プログラムが格納されている。この制御プログ
ラムは、後に詳細に説明するように、ブレーキスイッチ
入力回路2、ブレーキストロークセンサ入力回路3、F
r車輪速センサ入力回路4、Rr車輪速センサ入力回路
5から入力された入力信号をRAM9内の入力変数領域
A−1に入力変数データとして書き込む信号入力処理
と、RAM9の入力変数領域A−1、並びに、演算作業
変数領域A−2、及び/又は、出力変数領域A−3から
それぞれ読み出された入力変数データ、並びに、演算作
業変数データ、及び/又は、出力変数データを用いて所
定の制御演算(ABS用演算)を実行し、その結果とし
て得られた演算作業変数データ、及び/又は、出力変数
データをRAM9内の演算作業変数領域A−2、及び/
又は、出力変数領域A−3に書き込む制御演算処理と、
この制御演算処理にてRAM9内の出力変数領域A−3
に書き込まれた出力データをモータ駆動回路6並びにソ
レノイド駆動回路7から出力信号として図示しないモー
タ並びにソレノイドに出力する信号出力処理とから概略
構成されている。
Next, the program and data stored in the ROM 8 will be described. ABS in ROM8
Control program is stored. This control program includes a brake switch input circuit 2, a brake stroke sensor input circuit 3, and a F
a signal input process of writing input signals input from the r wheel speed sensor input circuit 4 and the Rr wheel speed sensor input circuit 5 as input variable data in an input variable area A-1 in the RAM 9, and an input variable area A-1 in the RAM 9 , And a predetermined value using the input variable data read from the operation variable area A-2 and / or the output variable area A-3 and the operation variable data and / or the output variable data, respectively. The control operation (ABS operation) is executed, and the obtained operation work variable data and / or output variable data are stored in the operation work variable area A-2 and / or in the RAM 9.
Or, a control calculation process for writing to the output variable area A-3;
In this control calculation processing, the output variable area A-3 in the RAM 9 is output.
And a signal output process for outputting the output data written to the motor drive circuit 6 and the solenoid drive circuit 7 as output signals to a motor and a solenoid (not shown).

【0064】そして、以上の基本的な構成により、制御
対象であるABS制御用のブレーキアクチュエータとの
間で入出力信号のやり取りを行いつつ、所望のABS制
御を実現するように構成されている。
With the above basic configuration, a desired ABS control is realized while exchanging input / output signals with a brake actuator for ABS control, which is a control object.

【0065】以上説明した制御プログラムの他に、RO
M8内には、本発明に関連して、互いに対を成す診断用
書き込みデータIDと出力期待データODとがN組格納
されている(Nは1若しくは2以上の整数)。即ち、こ
の例では、診断用書き込みデータID−1と出力期待デ
ータOD−1、診断用書き込みデータID−2と出力期
待データOD−2,…診断用書き込みデータID−Nと
出力期待データOD−Nとがそれぞれ対を成している。
また、各組のデータ対はそれぞれABSにおける代表的
な制御状態に対応している。例えば、診断用書き込みデ
ータID−1と出力期待データOD−1との組は、AB
Sが作動する状態における制御状態に対応しており、診
断用書き込みデータID−2と出力期待データOD−2
との組はABSが作動しない状態における制御状態に対
応している。また、各診断用書き込みデータID−1〜
ID−Nは、そのような制御状態において、ブレーキス
イッチ入力回路2、ブレーキストロークセンサ入力回路
3、Fr車輪速センサ入力回路4、Rr車輪速センサ入
力回路5から本来入力されるであろう信号の値、並び
に、そのときの演算作業変数の値に対応しており、また
出力期待データOD−1〜OD−Nのデータは、そのよ
うな制御状態において、RAM9内の演算作業変数領域
A−2並びに出力変数領域A−3に書き込まれるであろ
うデータの内容に対応している。このように、出力期待
データODには、先に説明した診断方法とは異なり、単
に最終的に外部へ出力されるべき出力変数データのみな
らず、演算途中結果等やそれまでの制御来歴に相当する
演算作業変数データについても格納されているのであ
る。
In addition to the control program described above, RO
In the M8, in association with the present invention, N sets of diagnostic write data ID and output expectation data OD forming a pair are stored (N is an integer of 1 or 2 or more). That is, in this example, the diagnostic write data ID-1 and the expected output data OD-1, the diagnostic write data ID-2 and the expected output data OD-2,..., The diagnostic write data ID-N and the expected output data OD- And N form a pair.
Each data pair corresponds to a typical control state in the ABS. For example, a set of the diagnostic write data ID-1 and the expected output data OD-1 is AB
S corresponds to the control state in the state in which S operates, and the diagnostic write data ID-2 and the expected output data OD-2
The set corresponds to the control state when the ABS does not operate. In addition, each diagnostic write data ID-1 to
In such a control state, ID-N is a signal of a signal that would normally be input from the brake switch input circuit 2, the brake stroke sensor input circuit 3, the Fr wheel speed sensor input circuit 4, and the Rr wheel speed sensor input circuit 5. The values of the output expected data OD-1 to OD-N correspond to the values of the operation work variables at that time, and the operation work variable area A-2 in the RAM 9 in such a control state. Also, it corresponds to the content of data to be written to the output variable area A-3. As described above, unlike the diagnosis method described above, the output expected data OD includes not only output variable data to be finally output to the outside, but also results such as a calculation intermediate result and a control history up to that time. The operation work variable data to be executed is also stored.

【0066】RAM9内には、上述したROM8内の診
断用各種データに対応して、入力変数領域A−1と、演
算作業変数領域A−2と、出力変数領域A−3と、後に
詳細に説明する変数退避処理で用いられる変数退避領域
A−4とが設けられている。入力変数領域A−1は、プ
ログラムが運用モード(実際に外部へ制御出力を送出し
ている状態)においては、実際にブレーキスイッチ入力
回路2、ブレーキストロークセンサ入力回路3、Fr車
輪速センサ入力回路4並びにRr車輪速センサ5から読
み込まれた信号を書き込むための領域として使用され、
本発明に係る診断モードにあっては、ROM8に格納さ
れた診断用書き込みデータID−1〜ID−Nのいずれ
かが書き込まれる領域として機能するものである。演算
作業変数領域A−2並びに出力変数領域A−3は、上述
の運用モードにあっては、CPU10における演算途中
結果等に相当する演算作業変数並びに外部へ出力するた
めの出力変数を書込むための領域として機能し、他方本
発明に係る診断モードにあっては、ROM8内の出力期
待データOD−1〜OD−Nのいずれかとの照合を行う
ための領域として機能するものである。尚、変数退避領
域A−4については、後に詳細に説明するが、例えば一
旦制御プログラムが実行開始されて、何らかの制御が行
われた後、その後例えば停車中でブレーキが操作されて
いない時に、診断モードが実行されるような場合に、そ
れまで入力変数領域A−1、演算作業変数領域A−2、
並びに、出力変数領域A−3に格納されていたデータの
中で診断処理において書き替えられては都合の悪いよう
なデータを、一時的に退避するための領域として機能す
るものである。
In the RAM 9, the input variable area A-1, the operation variable area A-2, and the output variable area A-3 are described in detail in accordance with the various diagnostic data in the ROM 8 described above. A variable save area A-4 used in a variable save process to be described is provided. The input variable area A-1 indicates that the brake switch input circuit 2, the brake stroke sensor input circuit 3, and the Fr wheel speed sensor input circuit when the program is in the operation mode (actually sending control output to the outside). 4 and used as an area for writing a signal read from the Rr wheel speed sensor 5,
In the diagnostic mode according to the present invention, it functions as an area in which any of the diagnostic write data ID-1 to ID-N stored in the ROM 8 is written. In the above-mentioned operation mode, the operation work variable area A-2 and the output variable area A-3 are used to write the operation work variables corresponding to the results of the operation in the CPU 10 and the like and the output variables to be output to the outside. On the other hand, in the diagnostic mode according to the present invention, it functions as a region for performing collation with any of the expected output data OD-1 to OD-N in the ROM 8. The variable evacuation area A-4 will be described in detail later. For example, when the control program is once executed and some control is performed, and thereafter, for example, when the vehicle is stopped and the brake is not operated, the diagnosis is performed. When the mode is executed, the input variable area A-1, the operation work variable area A-2,
In addition, it functions as an area for temporarily saving data that is inconvenient to be rewritten in the diagnostic processing in the data stored in the output variable area A-3.

【0067】次に、図2はROM8内に格納された制御
プログラム並びに診断用プログラムの構成を示すフロー
チャートであり、以下このフローチャートを参照しなが
ら、本発明に係るマイクロコンピュータ装置の動作を系
統的に説明する。
FIG. 2 is a flowchart showing the configuration of the control program and the diagnostic program stored in the ROM 8. The operation of the microcomputer according to the present invention will be described systematically with reference to this flowchart. explain.

【0068】このプログラムは、信号入力処理(ステッ
プ203)、ブレーキ制御処理(ステップ207)、出
力処理(ステップ210)からなるABS制御本来のた
めの処理と、CPU初期診断処理(ステップ202)、
初期命令故障診断実施済判定処理(ステップ204)、
命令故障診断判定処理(ステップ205)、命令故障診
断用データ書込み処理(ステップ206)、命令故障診
断中判定処理(ステップ208)、診断出力比較処理
(ステップ209)からなる故障診断のための処理とに
大別される。
This program includes a process for the ABS control, which includes a signal input process (step 203), a brake control process (step 207), and an output process (step 210), a CPU initial diagnosis process (step 202),
Initial command failure diagnosis execution completion determination processing (step 204),
A failure diagnosis process including an instruction failure diagnosis determination process (step 205), an instruction failure diagnosis data writing process (step 206), an instruction failure diagnosis determination process (step 208), and a diagnosis output comparison process (step 209). Are roughly divided into

【0069】即ち、電源投入によりプログラムの実行が
開始されると、まずシステムイニシャライズ処理を実行
して、RAM9内の各種レジスタやフラグ並びに各領域
A−1〜A−4の初期設定が行われ(ステップ20
1)、続いてCPU初期診断処理(ステップ202)が
実行されて、ROM8のサムチェック、ウォッチドッグ
タイマの周期監視などにより、CPU10が正常に動作
するかの確認が行われる(ステップ202)。
That is, when the execution of the program is started by turning on the power, a system initialization process is first executed to initialize various registers and flags in the RAM 9 and the areas A-1 to A-4 ( Step 20
1) Subsequently, a CPU initial diagnosis process (step 202) is executed, and it is confirmed whether the CPU 10 operates normally by a sum check of the ROM 8, a cycle monitoring of a watchdog timer, and the like (step 202).

【0070】このようにして、ROMに対するサムチェ
ック並びにウォッチドッグタイマの動作確認が完了する
と(ステップ202)、続いて本体プログラムへの移行
が行われ、先ず最初に入力信号処理が実行されて、ブレ
ーキスイッチ、ブレーキストロークセンサ、前輪用の車
輪速センサ、後輪用の車輪速センサからの信号は、それ
ぞれ該当する入力回路2〜5を経由して、CPU10へ
と取り込まれ、その後RAM9内の入力変数領域A−1
へと格納される。
When the sum check of the ROM and the confirmation of the operation of the watchdog timer are completed in this manner (step 202), a transition to the main body program is performed. First, the input signal processing is executed, and the brake is executed. Signals from the switch, the brake stroke sensor, the wheel speed sensor for the front wheels, and the wheel speed sensor for the rear wheels are taken into the CPU 10 via the corresponding input circuits 2 to 5, respectively. Area A-1
Is stored in.

【0071】続いて、初期命令故障診断実施済の判定が
行われ、ここでは所定のフラグを参照することにより、
初期命令故障診断(電源投入直後に行われる本発明の診
断処理)が実行済みであるかの判定が行われる(ステッ
プ204)。ここでは、初期命令故障診断は未だ行われ
ていないため(ステップ204NO)、続いて命令故障
診断用データ書込み処理(ステップ206)が実行され
る。
Subsequently, it is determined that the initial instruction failure diagnosis has been performed. Here, by referring to a predetermined flag,
It is determined whether the initial instruction failure diagnosis (diagnosis processing of the present invention performed immediately after power-on) has been executed (step 204). Here, since the initial instruction failure diagnosis has not been performed yet (step 204 NO), the instruction failure diagnosis data writing process (step 206) is subsequently executed.

【0072】この命令故障診断用データ書込み処理(ス
テップ206)では、まず変数退避処理が実行されて、
その時点でRAM9の各領域A−1〜A−3に格納され
たデータの中で、故障診断処理に際して書き替えられて
は都合の悪いデータが、変数退避領域A−4へと退避さ
れる(ステップ2061)。ここで、そのようなデータ
としては、例えば順序制御をおこなう関係から、過去の
来歴を必要とするデータや車両の運転再開にあたって、
初期状態に復帰されては都合の悪いようなデータなどが
挙げられる。続いて、診断用書込みデータ選択処理が実
行され、ROM8に格納された診断用書込みデータID
−1〜ID−Nの中から適当な1つが選択され(ステッ
プ2062)、その後診断用書込みデータ書込み処理が
実行されて、その選択された診断用書込みデータIDは
RAM9内の入力変数領域A−1並びに演算作業変数領
域A−2、さらに必要な場合には、出力変数領域A−3
の全部若しくは一部へと格納される(ステップ206
3)。
In the instruction failure diagnosis data writing processing (step 206), first, a variable saving processing is executed.
Of the data stored in the areas A-1 to A-3 of the RAM 9 at that time, data which is inconvenient to be rewritten during the failure diagnosis processing is saved to the variable save area A-4 ( Step 2061). Here, as such data, for example, from the relationship of performing sequence control, in the case of data that requires a past history or when restarting vehicle operation,
The data returned to the initial state may be inconvenient. Subsequently, a diagnostic write data selection process is executed, and the diagnostic write data ID stored in the ROM 8 is stored.
An appropriate one of -1 to ID-N is selected (step 2062), and then a diagnostic write data write process is executed. The selected diagnostic write data ID is stored in the input variable area A- in the RAM 9. 1 and operation variable area A-2, and if necessary, output variable area A-3
(Step 206).
3).

【0073】このようにして、命令故障診断用データ書
込み処理(ステップ206)が完了すると、続いて通常
の制御時と同様にして、ブレーキ制御処理が実行され、
CPU10内のALUを作動させることによって、車輪
速演算、スリップ率演算、ブレーキ制御判定、ブレーキ
制御量演算などが実行され、その実行により得られた演
算作業変数並びに出力変数はRAM9内の演算作業変数
領域A−2並びに出力変数領域A−3に格納される(ス
テップ207)。
When the command failure diagnosis data writing process (step 206) is completed in this way, a brake control process is subsequently executed in the same manner as in normal control.
By operating the ALU in the CPU 10, the wheel speed calculation, the slip ratio calculation, the brake control determination, the brake control amount calculation, and the like are executed, and the calculation work variables and output variables obtained by the execution are calculated by the calculation work variables in the RAM 9. It is stored in the area A-2 and the output variable area A-3 (step 207).

【0074】続いて、命令故障診断中判定処理が実行さ
れるが(ステップ208)、ここでは判定処理は肯定さ
れ(ステップ208YES)、続いて診断出力比較処理
(ステップ209)が実行される。この診断出力比較処
理では、まず先に選択されたROM8内の1組のデータ
対から、出力期待データODが選択され(ステップ20
91)、続いてこの出力期待データと先の演算により得
られた演算作業変数領域A−2並びに出力変数領域A−
3のデータの全部若しくは一部との照合が行われる(ス
テップ2092)。ここで照合対象の全てのデータにつ
いて照合一致が判定されれば(ステップ2092YE
S)、続いて通常の制御に復帰させるために、入力変数
領域A−1、演算作業変数領域A−2、出力変数領域A
−3の内容は初期状態に戻され(ステップ2093)、
更に先に変数退避領域A−4に退避されていたデータに
ついても元の格納位置に戻され(ステップ2094)、
その後通常の制御時と同様にして出力処理(ステップ2
10)が実行され、通常の制御状態への移行が行われ
る。これに対して、変数照合処理において、いずれかの
変数に照合不一致が判定されれば(ステップ2092N
O)、直ちに命令実行異常処理が実行されて、その旨が
外部に警報されたり、或いはCPUの動作の停止が行わ
れる(ステップ2095)。
Subsequently, an instruction failure diagnosis determination process is executed (step 208). Here, the determination process is affirmed (step 208 YES), and then a diagnosis output comparison process (step 209) is executed. In this diagnostic output comparison processing, expected output data OD is first selected from a set of data pairs in the ROM 8 previously selected (step 20).
91) Then, the output expected data and the operation work variable area A-2 and the output variable area A-
The data is compared with all or a part of the data No. 3 (step 2092). If it is determined that all the data to be verified match (step 2092YE).
S) Then, in order to return to normal control, the input variable area A-1, the operation work variable area A-2, and the output variable area A
-3 is returned to the initial state (step 2093),
Further, the data saved earlier in the variable save area A-4 is also returned to the original storage position (step 2094),
Thereafter, the output processing is performed in the same manner as in the normal control (step 2
10) is executed, and a transition to a normal control state is performed. On the other hand, in the variable matching process, if it is determined that any variable does not match (step 2092N).
O) Immediately, the command execution abnormal processing is executed, and the fact is notified to the outside, or the operation of the CPU is stopped (step 2095).

【0075】尚、出力変数照合処理(ステップ209
2)では、照合対象となる全ての変数についてビット単
位での精密な照合が行われ、しかも外部の入力回路2〜
5並びに外部の出力回路6並びに7の影響を全く受ける
ことなくそれらのデータが生成されていることから、こ
の照合の結果は、CPUそれ自身の異常、即ちALUを
中心とする演算部の異常を正確に反映したものとなり、
この結果、本発明の診断方法によれば、CPU自身の演
算部を中心とした故障を的確に診断することが可能とな
るのである。
The output variable collation processing (step 209)
In 2), all variables to be matched are subjected to precise matching in bit units, and furthermore, external input circuits 2 to 2 are used.
5 and the output data 6 and 7 are generated without any influence from the output circuits 6 and 7, the result of this collation indicates the abnormality of the CPU itself, that is, the abnormality of the arithmetic unit centering on the ALU. Will be accurately reflected,
As a result, according to the diagnostic method of the present invention, it is possible to accurately diagnose a failure centering on the arithmetic unit of the CPU itself.

【0076】以上の実施の形態によれば、故障診断に際
しては、外部入力回路2〜5からの信号を一切用いてい
ないことに加え、照合に際しても外部出力回路6並びに
7の出力をモニタするといった手法を用いていないた
め、それらの誤差や動作不良などの影響を一切排除し
て、極めて正確にCPU自身即ちCPU内に含まれるA
LUを中心とした演算部の動作異常を診断することがで
き、この診断結果を用いることによって、直ちにCPU
10の動作を停止すべき制御全体に波及する故障か、或
いは、他の診断処理を併用することによって、その他軽
微な故障であるかなどの識別を容易に行うことができ
る。
According to the above embodiment, not only are the signals from the external input circuits 2 to 5 not used at the time of failure diagnosis, but also the outputs of the external output circuits 6 and 7 are monitored at the time of verification. Since the method is not used, the effects of such errors and malfunctions are completely eliminated, and the CPU itself, that is, A
It is possible to diagnose the operation abnormality of the operation unit centering on the LU, and by using the diagnosis result, immediately
It is possible to easily determine whether the failure affects the entire control in which the operation of the operation 10 should be stopped or whether the failure is another minor failure by using another diagnostic process.

【0077】また、出力変数照合処理(ステップ209
2)においては、最終的な出力変数のみならず演算途中
結果に相当する演算作業変数についても照合されるた
め、制御プログラムとして、数値演算結果を2値化弁別
して最終出力データを得るようなプログラムが組まれて
いたり、或いは2以上の演算結果の論理和をとることに
より最終出力データを決定するようなプログラムが組ま
れているような場合でも、その数値演算結果や論理和を
とる前のデータを演算作業変数として設定することによ
り、最終的な出力変数については正しいにも拘らず、そ
の途中の演算結果に誤りを生ずるようなALUの異常で
あってもこれを的確に診断することが可能となる。
The output variable collation processing (step 209)
In 2), not only the final output variables but also the operation variables corresponding to the intermediate results are collated, so that the control program is a program that obtains the final output data by binarizing and discriminating the numerical operation results. Or a program that determines the final output data by taking the logical sum of two or more operation results, even if the numerical operation result or the data before the logical sum is taken Is set as a calculation work variable, it is possible to accurately diagnose even ALU abnormalities that may cause errors in the calculation results in the middle, even though the final output variables are correct. Becomes

【0078】加えて、故障診断を開始するにあたって
は、入力変数領域A−1、演算作業変数領域A−2並び
に出力変数領域A−3に格納されたデータの中で、診断
処理に際して書き替えられては都合の悪いデータについ
ては、変数退避領域A−4に退避させ、その後演算終了
後にこれを復帰させるという構成を採用しているため、
診断処理によりその後の制御に異常を来すといった虞れ
も未然に防止することができる。
In addition, when starting the fault diagnosis, the data stored in the input variable area A-1, the operation work variable area A-2, and the output variable area A-3 are rewritten during the diagnosis processing. In this case, data that is inconvenient is saved in the variable save area A-4, and is restored after the calculation is completed.
It is also possible to prevent the subsequent control from being abnormal due to the diagnostic processing.

【0079】尚、以上は電源投入直後の故障診断処理に
ついて説明したが、本発明に係る診断モードはその他車
両が停車していて、しかも電子制御によるブレーキが操
作が行われていないといった、制御に支障を来さない状
態においても実行される。この実行は、命令故障診断許
可判定処理(ステップ205)においてそのような状態
にあることを判定し、故障診断の許可を与えることによ
って行われる。特に、この種のABS制御においては、
車両の運転中頻繁に電子制御によるブレーキ操作が行わ
れていることから、一旦制御が開始された後、故障診断
を実行するのがなかなか困難であったが、このような車
両停車中であって且つブレーキ操作が行われない時期を
選択することによって、車両が運転開始された後にあっ
ても、頻繁にCPU自身の故障診断を行うことができ、
車両用ABSの信頼性を著しく向上させることができ
る。
Although the failure diagnosis processing immediately after the power is turned on has been described above, the diagnosis mode according to the present invention is applicable to other control such that the vehicle is stopped and the brake is not operated by the electronic control. It is executed even in a state where no trouble occurs. This execution is performed by determining that such a state exists in the instruction failure diagnosis permission determination processing (step 205) and giving permission for failure diagnosis. In particular, in this type of ABS control,
Since the brake operation by the electronic control is frequently performed during the driving of the vehicle, it is difficult to perform the fault diagnosis after the control is once started. In addition, by selecting the time when the brake operation is not performed, even after the vehicle starts driving, the failure diagnosis of the CPU itself can be performed frequently,
The reliability of the vehicle ABS can be significantly improved.

【0080】[0080]

【発明の効果】以上実施例の説明からも明らかなよう
に、この発明によれば、CPU自身の故障を的確に自己
診断する機能を備えたマイクロコンピュータ装置を提供
することができると言う効果がある。
As is clear from the above description of the embodiments, according to the present invention, there is provided an effect that a microcomputer device having a function of accurately performing self-diagnosis of a failure of a CPU itself can be provided. is there.

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

【図1】本発明が適用されたマイクロコンピュータ装置
の一例を示すブロック図である。
FIG. 1 is a block diagram illustrating an example of a microcomputer device to which the present invention has been applied.

【図2】本発明が適用されたマイクロコンピュータ装置
の制御プログラム並びに診断用プログラムの構成を示す
フローチャートである。
FIG. 2 is a flowchart showing a configuration of a control program and a diagnosis program of the microcomputer device to which the present invention is applied.

【図3】従来の故障診断方法が適用されたマイクロコン
ピュータの一例を示すブロック図である。
FIG. 3 is a block diagram illustrating an example of a microcomputer to which a conventional failure diagnosis method is applied.

【図4】従来の故障診断方法が採用されたマイクロコン
ピュータ装置における制御プログラム並びに診断用プロ
グラムの構成を示すフローチャートである。
FIG. 4 is a flowchart showing a configuration of a control program and a diagnosis program in a microcomputer device employing a conventional failure diagnosis method.

【符号の説明】[Explanation of symbols]

1 マイクロコンピュータ装置 2 ブレーキスイッチ入力回路 3 ブレーキストロークセンサ入力回路 4 Fr車輪速センサ入力回路 5 Rr車輪速センサ入力回路 6 モータ駆動回路 7 ソレノイド駆動回路 8 ROM 9 RAM 10 CPU ID−1〜ID−N 診断用書込みデータ OD−1〜OD−N 出力期待データ A−1 入力変数領域 A−2 演算作業変数領域 A−3 出力変数領域 A−4 変数退避領域 Reference Signs List 1 microcomputer device 2 brake switch input circuit 3 brake stroke sensor input circuit 4 Fr wheel speed sensor input circuit 5 Rr wheel speed sensor input circuit 6 motor drive circuit 7 solenoid drive circuit 8 ROM 9 RAM 10 CPU ID-1 to ID-N Diagnostic write data OD-1 to OD-N Output expected data A-1 Input variable area A-2 Operation work variable area A-3 Output variable area A-4 Variable save area

Claims (8)

【特許請求の範囲】[Claims] 【請求項1】 外部から信号を入力するための信号入力
回路と、外部へと信号を出力するための信号出力回路
と、制御プログラムを格納させたROMと、前記制御プ
ログラムで使用される入力変数データ、演算作業変数デ
ータ、出力変数データをそれぞれ格納するための入力変
数領域、演算作業変数領域、出力変数領域がそれぞれ設
けられたRAMと、前記ROMに格納された制御プログ
ラムを実行するためのCPUとを備えたマイクロコンピ
ュータ装置において、 前記ROM内には、特定の制御状態に対応する、少なく
とも一組の診断用書込データと出力期待データとを新た
に格納すると共に、 動作モードが診断モードに設定されているときは、前記
入力変数領域又は演算作業変数領域又は出力変数領域の
内容を、前記ROM内に格納された診断用書込データに
書き替えると共に出力期待データと照合することにより
前記照合結果に基づいて前記CPU自身の動作を診断し
得るように構成したことを特徴とするマイクロコンピュ
ータ装置。
1. A signal input circuit for externally inputting a signal, a signal output circuit for externally outputting a signal, a ROM storing a control program, and an input variable used in the control program A RAM provided with an input variable area, a calculation work variable area, and an output variable area for storing data, calculation work variable data, and output variable data, respectively, and a CPU for executing a control program stored in the ROM In the microcomputer device, at least one set of diagnostic write data and expected output data corresponding to a specific control state is newly stored in the ROM, and the operation mode is set to the diagnostic mode. When set, the contents of the input variable area, operation work variable area, or output variable area are stored in the ROM. Microcomputer apparatus characterized by being configured so as to diagnose the operation of the CPU itself, based on the comparison result by comparing the expected output data with rewrites the diagnostic write data.
【請求項2】 前記診断用書込データ、並びに、前記出
力期待データは、複数組だけ設けられ、かつ前記診断用
データ書き替え処理では、前記複数組から選択された一
組のデータを構成する診断用書込データにより、前記入
力変数領域の全部若しくは一部、並びに、演算作業変数
領域の全部若しくは一部、及び/又は、出力変数領域の
全部若しくは一部の内容を書き替えるものであり、 前記データ照合処理では、前記複数組から選択された一
組のデータを構成する出力期待データと、制御演算処理
の実行により書き替えられた前記演算作業変数領域の全
部若しくは一部、及び/又は、前記出力変数領域の全部
若しくは一部の内容とを照合するものである、 ことを特徴とする請求項1に記載のマイクロコンピュー
タ装置。
2. The diagnostic writing data and the output expectation data are provided only in a plurality of sets, and in the diagnostic data rewriting process, one set of data selected from the plurality of sets is configured. The diagnostic writing data is used to rewrite all or part of the input variable area, and all or part of the operation work variable area, and / or all or part of the output variable area. In the data collation processing, output expected data configuring one set of data selected from the plurality of sets, and all or a part of the operation work variable area rewritten by execution of the control operation processing, and / or 2. The microcomputer device according to claim 1, wherein the microcomputer compares the whole or a part of the output variable area.
【請求項3】 前記データ書き替え処理には、書き替え
に先立って、前記RAM内の特定の変数領域の内容を退
避させる変数退避処理が含まれており、かつ前記データ
照合処理には、照合一致を条件として、前記信号出力処
理に先立ち、前記退避されていた特定の変数領域の内容
を復帰させる変数復帰処理が含まれているこを特徴とす
る請求項1に記載のマイクロコンピュータ装置。
3. The data rewriting process includes a variable saving process for saving the contents of a specific variable area in the RAM prior to the rewriting. 2. The microcomputer device according to claim 1, further comprising a variable restoration process for restoring the contents of the saved specific variable region prior to the signal output process, on condition that they match.
【請求項4】 前記データ照合処理では、照合不一致を
条件として、所定の命令実行異常処理への移行を行うこ
とを特徴とする請求項1に記載のマイクロコンピュータ
装置。
4. The microcomputer device according to claim 1, wherein, in the data collation processing, a transition to predetermined instruction execution abnormality processing is performed on condition that the collation does not match.
【請求項5】 前記マイクロコンピュータ装置は、車両
用のアンチロックブレーキシステムの制御に用いられる
制御用マイクロコンビュータであることを特徴とする請
求項1に記載のマイクロコンピュータ装置
5. The microcomputer device according to claim 1, wherein the microcomputer device is a control microcomputer used for controlling an antilock brake system for a vehicle.
【請求項6】 電源投入直後の制御に移行する前である
ことを条件として、並びに、少なくとも車両が停止して
電子制御によるブレーキ操作が行われていないことを条
件として、診断モードへの設定を許可することを特徴と
する請求項5に記載のマイクロコンピュータ装置。
6. The setting of the diagnostic mode is performed on condition that the control is not shifted to the control immediately after the power is turned on, and that at least the vehicle is stopped and the brake operation by the electronic control is not performed. The microcomputer device according to claim 5, wherein permission is given.
【請求項7】 前記診断用書込データ、並びに、前記出
力期待データは複数組だけ設けられ、 それらの組の少なくとも一つは、アンチロックブレーキ
システムが作動する状態に対応するものであり、かつ他
の少なくとも一つは、アンチロックブレーキシステムが
作動していない状態に対応するものである、 ことを特徴とする請求項5に記載のマイクロコンピュー
タ装置。
7. A plurality of sets of the diagnostic writing data and the expected output data are provided, at least one of the sets corresponding to a state in which an anti-lock brake system operates, and The microcomputer device according to claim 5, wherein the at least one other corresponds to a state in which the antilock brake system is not operating.
【請求項8】 前記診断モードは、前記制御プログラム
の一巡実行ループの間に限り設定状態に維持されること
を特徴とする請求項1〜7のいずれかに記載のマイクロ
コンピュータ装置。
8. The microcomputer device according to claim 1, wherein the diagnosis mode is maintained in a set state only during a loop of the control program.
JP8186837A 1996-06-27 1996-06-27 Microcomputer system Pending JPH1021107A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8186837A JPH1021107A (en) 1996-06-27 1996-06-27 Microcomputer system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8186837A JPH1021107A (en) 1996-06-27 1996-06-27 Microcomputer system

Publications (1)

Publication Number Publication Date
JPH1021107A true JPH1021107A (en) 1998-01-23

Family

ID=16195504

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8186837A Pending JPH1021107A (en) 1996-06-27 1996-06-27 Microcomputer system

Country Status (1)

Country Link
JP (1) JPH1021107A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010043536A (en) * 2008-08-08 2010-02-25 Denso Corp Control apparatus for vehicle
WO2012111493A1 (en) * 2011-02-18 2012-08-23 三洋電機株式会社 Fault diagnosis device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010043536A (en) * 2008-08-08 2010-02-25 Denso Corp Control apparatus for vehicle
WO2012111493A1 (en) * 2011-02-18 2012-08-23 三洋電機株式会社 Fault diagnosis device

Similar Documents

Publication Publication Date Title
US6421790B1 (en) Method and circuit for analysis of the operation of a microcontroller using signature analysis of data and instructions
US6076172A (en) Monitoting system for electronic control unit
US7295903B2 (en) Device and method for on-board diagnosis based on a model
JP4124514B2 (en) Error diagnosis apparatus and error diagnosis method
US9207661B2 (en) Dual core architecture of a control module of an engine
EP0319188A2 (en) Method and apparatus for data integrity checking with fault tolerance
JP2001056701A (en) Method and device for mutually monitoring control units
CN101779193B (en) System for providing fault tolerance for at least one micro controller unit
US5713643A (en) Control circuit for automotive vehicle motion control systems
CN102782655A (en) Microcomputer cross-monitoring system and microcomputer cross-monitoring method
US6067586A (en) Method for checking a first processor performing functions by a data word received and stored, and modified after performing a given function, and monitored by a second processor
US20060150033A1 (en) Method for monitoring the execution of a program in a micro-computer
JP2005513356A (en) Method and apparatus for controlling a functional unit of an automobile
US7539564B2 (en) Device and method for central on-board diagnosis for motor vehicles
KR100836384B1 (en) Self-diagnosis/recovery ECU in vehicle and method for operating the same
JPH1021107A (en) Microcomputer system
CN113359657A (en) ECU diagnosis configuration code checking method and system and electronic control unit
JP2768693B2 (en) Apparatus for monitoring a computer system having two processors
JP3296043B2 (en) Vehicle electronic control unit
JP6663371B2 (en) Electronic control unit
US11726853B2 (en) Electronic control device
US6115832A (en) Process and circuitry for monitoring a data processing circuit
JP5575086B2 (en) Electronic control unit
JP2002047998A (en) Controller for vehicle
JP2000146765A (en) Electronic controller for vehicle

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20050419

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050531

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050720

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050906

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20051101

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20051129