【発明の詳細な説明】[Detailed description of the invention]
【産業上の利用分野】[Industrial application field]
本発明は、自動車用コンピュータの誤動作防止方式に関
するものである。The present invention relates to a system for preventing malfunctions of automobile computers.
【従来の技術】[Conventional technology]
自動車に搭載された制御用マイクロコンピュータを含む
電子回路は、温度、湿度、振動、11気的ノイズなどの
悪環境下に置かれるので、高度の電子技術が要求される
。電子機器の破壊に対しては、技術進歩により対応技術
が著しく進歩してきているので、現段階ではこれらを利
用して、はぼ満足すべき状態になっているが、プログラ
ム制御における誤動作の問題は、充分に解決されている
とはいえない。
とくに、長大なステップをシーケンシャルに実行するマ
イクロコンピュータでは、僅か1ノイズが入り込むこと
で暴走し、例えばエンジン制御についてのコンピュータ
の誤動作で、走行中にエンジンストップを起こすなどの
重大な事態を発生することになる。そこで、このような
最悪の事態を回避するために、電子制御部分にノイズ混
入を防止するフィルタを多用したり、ワツチドツク回路
を外付けして、コンピュータのソフトウェア処理の過程
で、定期的に特定の出力ボートに“HII状態および“
L II状態のパルスを交互にプログラムラン信号とし
て出力し、上記ワツチドツク回路でモニタし、これが停
止したのを検出して“CPU暴走”を判定し、cput
5よびその他の部分をリセットするなどして、正常状態
に復帰させるなどの提案がなされている。
最近では上記゛ワッチドック回路7の専用ICなどもあ
り、オンチップワッチドック回路のマイクロコンピュー
タも発表されたが、回路が追加される分、コストアップ
となり、また、この回路自体の誤動作の問題が新たに生
じることになる。
とくにこの方式の決定的な欠陥は、CPLJの誤動作が
外部に影響を及ぼしてからでないと(ワッチドック回路
が働くまで)、正規状態への復帰が得られないことであ
る。
そしてこれが割込み処理を行なえるマルチタスク処理の
場合には、誤動作が原因で、本来、割込みが禁止されて
いるソースからの信号で、対応レジスタの割込みフラグ
が立ってしまうと、異常な割込みが起こり、処理プログ
ラムの暴走を惹起する。その結果、運転制御不能となる
ような重大な問題を起こしてしまう。Electronic circuits, including control microcomputers, installed in automobiles are exposed to adverse environments such as temperature, humidity, vibration, and atmospheric noise, so advanced electronic technology is required. Technological advances have made significant progress in dealing with the destruction of electronic equipment, and at this stage we are in a fairly satisfactory state using these techniques. However, the problem of malfunctions in program control is , it cannot be said that it has been fully resolved. In particular, in a microcomputer that sequentially executes long steps, the introduction of just one noise can cause it to go out of control, causing a serious situation such as a computer malfunction related to engine control, causing the engine to stop while driving. become. Therefore, in order to avoid such a worst-case scenario, we often use filters to prevent noise from entering electronic control parts, and we install external watchdog circuits to periodically check specific signals during the computer's software processing process. “HII status and “
Pulses in the L II state are alternately output as program run signals, monitored by the watchdog circuit described above, and when the stoppage is detected, a "CPU runaway" is determined, and the cput
Proposals have been made to restore the normal state by resetting 5 and other parts. Recently, there have been dedicated ICs for the above-mentioned watchdog circuit 7, and microcomputers with on-chip watchdog circuits have been announced, but the cost increases due to the addition of circuits, and new problems arise in the malfunction of this circuit itself. will occur. Particularly, the decisive defect of this method is that the normal state cannot be restored until after the malfunction of the CPLJ has an effect on the outside (until the watchdog circuit is activated). In the case of multitasking processing that can handle interrupts, if a malfunction causes the interrupt flag in the corresponding register to go up due to a signal from a source for which interrupts are normally prohibited, an abnormal interrupt may occur. , causing the processing program to run out of control. As a result, serious problems such as loss of operational control occur.
【発明が解決しようとする問題点】
自動車のv制御コンピュータの誤動作は、極めて稀れな
現象であり、例えば致方台に1台の割合で発生し、かつ
、致方km走行につき1度位しか発生しないという状況
であるが、各種試験を行なった結果、得られた情報によ
って、コンピュータの誤動作の直前には、点火ノイズや
電源サージなどにより、CPU内部のレジスタの保持内
容が変化することに起因すると判明した。すなわちcP
Uは、正常なプログラムを実行しているにも拘わらず、
レジスタ内容の変化に伴って誤動作が惹き起こされるの
である。
と(に主ルーチンの他に、割込み処理を行なうマルチタ
スク処理において、この現象が多く認められる。
そこで本発明は、プログラム実行過程で点火ノイズや、
電源サージなどによる不正信号が入力されてレジスタに
影響を与え、本来、割込みが禁止されているソースから
の割込みを可能にしてしまい、処理ルーチンが暴走する
のを防止するようにした自動車用コンピュータの誤動作
防止方式を提供しようとするものである。
【問題点を解決するための手段1
この目的のため、本発明は、割込み処理が可能な処理ル
ーチンを持ったコンピュータにおいて、通常の処理ルー
チンの実行中に割込みが発生したならば、割込み処理に
分岐し、ここで割込みが発生したソースをチェックし、
所定ソースにおける割込みの場合には、そのソースに対
し割込み禁止状態をセットすることを特徴とするもので
ある。
【実 施 例]
以下、本発明の一実施例を第1図および第2図を参照し
て説明する。
第1図は本発明を実施する自動車搭載のコンピュータの
一例であり、例えば燃料噛射1点火制御などのエンジン
刺部、あるいは車速制御に用いられる。第1図において
、符号1はCPU6に必要な制御パラメータを供給する
各種センサであり、これらセンサ1は、入力インターフ
ェース3を介して入出カニニット5に接続されている。
また符号2は各種制御アクチュエータで、入出カニニッ
ト5より出力インターフェース4を介して出力される駆
動信号により駆動される。入出カニニット5は、パスラ
イン9を介してcpueに接続されており、センサ1の
出力をCPLJ6で処理し、各種アクチュエータ2を駆
動するコマンドを出力するのである。またCPU6には
、入出カニニット5より割込み線10が接続されていて
、入出力信号に対して入出カニニット5より、CPLJ
6に対する割込み処理要求が可能となっている。
なお、符号8はCPLJ6の処理手順を内蔵したROM
であり、符号7はデータの一時退避などに用いるRAM
で、それぞれパスライン9を介してcpueと接続され
ている。
そして上記入出カニニット5は、通常、汎用LSIで構
成され、複数の機能をソフトウェアで選択するプログラ
マブルオプションを採用しており、このプログラマブル
オプションでは、所定のレジスタにCPLJ6から定数
を書込む形で、機能が一義的に決定される。
次に第2図を用いて、本発明による誤動作防止方式につ
き具体的に説明する。先ず主ルーチンにおいて、CPU
6への入出力信号で割込み処理の必要が生じた時、割込
み線10を介してcpueに割込み要求がなされると、
割込み処理ルーチンに分岐される。ここではステップS
1で、割込み要求フラグを検索し、どのソースが要因で
割込みが発生したかを調べる。次にステップS2で、割
込み要求が通常のものからあったのか、本来禁止してい
るものからあったかを、先の検索内容から判断する。そ
して通常、割込みの場合にはステップS3で割込み要求
フラグをクリアし、次いでステップS4で通常処理(割
込み処理)を行ない、ステップS5でメインプログラム
に復帰する。一方、ステップS2で異常割込みと判断さ
れた場合(本来、割込み禁止状態にあるソースの対応レ
ジスタにおいて、点火ノイズや電源サージによる不正信
号が入り、割込み禁止フラグを解除して、割込み可能と
してしまった場合に起こる)、ステップS11に進み、
割込み要求フラグをクリアし、ステップ812で当該レ
ジスタについて割込み禁止フラグを再セットする。また
要すれば、ステップ813で異常割込みの発生をRAM
7などに記録し、メインプログラムに復帰する。このよ
うにして、上記記録により誤動作対策プログラムを起動
したり、後日、異常チェックを行なった時に、異常割込
みが生じたことの確認がとれる(故障診断)。
なお、禁止フラグの再セットは、メインプログラム中で
も行なえるが、異常発生がない時でも、定期的に再セッ
トするという点で、割込み処理ルーチンで実施する方が
よい。
【発明の効果1
本発明は、以上詳述したようになり、処理ルーチンの中
で、割込み要求があると、その要求元祖のソースについ
て検索をなし、本来、割込みが禁止されているものにつ
いては、割込み禁止を再セットすることで、割込みがな
されるのを未然に防止でき、CPUの暴走を防ぎ、運転
上に重大な支障が起こらないようにできる。しかも従来
のような外付けの回路を必要としないので、コストアッ
プすることもない。[Problems to be Solved by the Invention] Malfunction of the V-control computer of a car is an extremely rare phenomenon.For example, it occurs in one car per car, and it occurs about once per km driven. However, as a result of various tests, we have found that information obtained shows that immediately before a computer malfunctions, the contents held in the registers inside the CPU change due to ignition noise, power surge, etc. It turned out to be the cause. That is, cP
Although U is running a normal program,
Malfunctions occur as register contents change. This phenomenon is often observed in multitasking processing that performs interrupt processing in addition to the main routine.
This is an automotive computer designed to prevent processing routines from going out of control when incorrect signals such as power surges are input and affect the registers, allowing interrupts from sources where interrupts are normally prohibited. This is intended to provide a method for preventing malfunctions. [Means for solving the problem 1] For this purpose, the present invention provides that, in a computer having a processing routine capable of processing interrupts, if an interrupt occurs during the execution of a normal processing routine, the interrupt processing is performed. Branch and check here the source where the interrupt occurred,
In the case of an interrupt in a predetermined source, the interrupt disabling state is set for that source. [Embodiment] An embodiment of the present invention will be described below with reference to FIGS. 1 and 2. FIG. 1 shows an example of an automobile-mounted computer that implements the present invention, and is used, for example, for engine control such as fuel injection and ignition control, or for vehicle speed control. In FIG. 1, reference numeral 1 indicates various sensors that supply necessary control parameters to the CPU 6, and these sensors 1 are connected to the input/output crab unit 5 via the input interface 3. Reference numeral 2 denotes various control actuators, which are driven by drive signals output from the input/output crab unit 5 via the output interface 4. The input/output crab unit 5 is connected to the CPU via a pass line 9, processes the output of the sensor 1 with the CPLJ 6, and outputs commands to drive various actuators 2. Further, an interrupt line 10 is connected to the CPU 6 from the input/output crab unit 5.
Interrupt processing requests for 6 are possible. In addition, code 8 is a ROM containing the processing procedure of CPLJ6.
7 is a RAM used for temporarily saving data, etc.
and are each connected to the CPU via a path line 9. The input/output crab unit 5 is usually configured with a general-purpose LSI and employs a programmable option in which multiple functions are selected by software. In this programmable option, constants are written from the CPLJ6 to a predetermined register. Function is uniquely determined. Next, the malfunction prevention method according to the present invention will be specifically explained using FIG. 2. First, in the main routine, the CPU
When the need for interrupt processing arises with input/output signals to the CPU 6, an interrupt request is made to the CPU via the interrupt line 10.
Branches to the interrupt handling routine. Here step S
1, the interrupt request flag is searched to find out which source caused the interrupt. Next, in step S2, it is determined from the previous search content whether the interrupt request is from a normal interrupt request or from an originally prohibited interrupt request. Normally, in the case of an interrupt, the interrupt request flag is cleared in step S3, then normal processing (interrupt processing) is performed in step S4, and the process returns to the main program in step S5. On the other hand, if an abnormal interrupt is determined in step S2 (an illegal signal due to ignition noise or power surge has entered the corresponding register of the source, which was originally in an interrupt-disabled state, the interrupt-disable flag has been cleared and interrupts have been enabled). ), proceed to step S11,
The interrupt request flag is cleared, and in step 812, the interrupt disable flag is reset for the register. If necessary, in step 813, the occurrence of an abnormal interrupt is stored in the RAM.
7 etc. and return to the main program. In this way, based on the above record, it can be confirmed that an abnormal interrupt has occurred when a malfunction countermeasure program is started or an abnormality check is performed at a later date (fault diagnosis). Note that although the prohibition flag can be reset during the main program, it is better to reset it in the interrupt processing routine in that it is reset periodically even when no abnormality occurs. Effects of the Invention 1 The present invention has been described in detail above, and when an interrupt request is received in the processing routine, the source of the original request is searched, and interrupts for which interrupts are originally prohibited are searched for. By resetting the interrupt prohibition, it is possible to prevent interrupts from occurring, prevent the CPU from running out of control, and prevent serious problems in operation. Moreover, since it does not require an external circuit like the conventional one, there is no increase in cost.
【図面の簡単な説明】[Brief explanation of drawings]
第1図は本発明方式を実施する上でのコンピュータの構
成ブロック図、第2図は同方式を実現するためのフロー
チャートの一例を示す図である。
1・・・センサ、2・・・アクチュエータ、3・・・入
力インターフェース、4・・・出力インターフェース、
5・・・入出カニニット、6・・−CPU17・−RA
M、8・・・ROM、9・・・パスライン、 1G・・
・割込み線。
特許出願人 富士重工業株式会社代理人 弁理士
小 橋 信 浮
量 弁理士 村 井 進
第1図FIG. 1 is a block diagram of the configuration of a computer for implementing the method of the present invention, and FIG. 2 is a diagram showing an example of a flowchart for implementing the method. 1... Sensor, 2... Actuator, 3... Input interface, 4... Output interface,
5... Input/output crab knit, 6...-CPU17--RA
M, 8...ROM, 9...Pass line, 1G...
・Interrupt line. Patent applicant: Fuji Heavy Industries Co., Ltd. Agent: Patent attorney: Makoto Kobashi Ukiyo Patent attorney: Susumu Murai Figure 1