JPH10177504A - Electronic controller - Google Patents

Electronic controller

Info

Publication number
JPH10177504A
JPH10177504A JP8338655A JP33865596A JPH10177504A JP H10177504 A JPH10177504 A JP H10177504A JP 8338655 A JP8338655 A JP 8338655A JP 33865596 A JP33865596 A JP 33865596A JP H10177504 A JPH10177504 A JP H10177504A
Authority
JP
Japan
Prior art keywords
microcomputer
control program
microcomputers
reset
data
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.)
Granted
Application number
JP8338655A
Other languages
Japanese (ja)
Other versions
JP3097580B2 (en
Inventor
Takehiro Abeta
健浩 阿部田
Takamichi Kamiya
隆通 神谷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Denso Corp
Original Assignee
Denso Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Denso Corp filed Critical Denso Corp
Priority to JP08338655A priority Critical patent/JP3097580B2/en
Priority to US08/987,062 priority patent/US6144887A/en
Publication of JPH10177504A publication Critical patent/JPH10177504A/en
Priority to US09/536,720 priority patent/US6493593B1/en
Application granted granted Critical
Publication of JP3097580B2 publication Critical patent/JP3097580B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Combined Controls Of Internal Combustion Engines (AREA)
  • Debugging And Monitoring (AREA)

Abstract

PROBLEM TO BE SOLVED: To enable an electronic controller which is constituted in such a way that one microcomputer monitors another microcomputer to write a control program in the monitored microcomputer even after a control program is written in the monitoring microcomputer. SOLUTION: In an ECU 82 which is provided with such two microcomputers 18 and 26 that usually execute control programs stored in their own flash memories and, when a prescribed writing voltage VPP is supplied and an external code is matched with their own codes, write writing data supplied from the outside in their own flash memories after updating the data and is constituted so that one microcomputer 18 can monitor the control program executing state of the other microcomputer 26 and, when the occurrence of abnormality is discriminated, can output a reset signal R2a to the microcomputer 26, a circuit 78a which inhibits the input the reset signal R2a to the microcomputer 26 when the writing voltages VPP are supplied to the microcomputers 18 and 26 is provided.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、マイクロコンピュ
ータを複数備えた電子制御装置に関し、特に、その各マ
イクロコンピュータに制御プログラムや制御データをオ
ンボード書き込み可能な電子制御装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an electronic control device having a plurality of microcomputers, and more particularly to an electronic control device capable of writing a control program and control data to each microcomputer on board.

【0002】[0002]

【従来の技術】従来より、例えば特開平2−99746
号公報に開示されているように、自動車用の電子制御装
置として、電気的にデータの書き換えが可能なEEPR
OMやフラッシュEEPROM(以下、フラッシュメモ
リという)などの不揮発性メモリを有するマイクロコン
ピュータを備え、その不揮発性メモリに格納された制御
プログラムや制御データを、市場への供給後でも書き換
えることができるようにしたものが提案されている。
2. Description of the Related Art Conventionally, for example, Japanese Patent Laid-Open No. 2-99746
As disclosed in Japanese Patent Application Laid-Open Publication No. H10-175, as an electronic control device for a vehicle, an electrically rewritable EEPR is used.
A microcomputer having a non-volatile memory such as an OM or a flash EEPROM (hereinafter referred to as a flash memory) is provided so that control programs and control data stored in the non-volatile memory can be rewritten even after being supplied to the market. What has been proposed.

【0003】即ち、この種の電子制御装置において、マ
イクロコンピュータは、通常時には、不揮発性メモリに
格納されたデータにより構成される制御プログラムを実
行することでエンジン等の制御対象を制御する。これに
対して、不揮発性メモリ内のデータ(制御プログラムや
その実行時に参照される制御データ)を書き換える場合
には、電子制御装置に、別途用意されたメモリ書込装置
が接続され、これにより、上記メモリ書込装置とマイク
ロコンピュータとが、通信ラインを介して接続されるよ
うになっている。そして、マイクロコンピュータは、予
め定められた書き換え条件が成立すると、メモリ書込装
置から送信されて来る書込データ(つまり、新たな制御
プログラムや制御データを構成するデータ)を受信し
て、その書込データを不揮発性メモリに更新して書き込
む、といった書込処理を行う。
That is, in this type of electronic control device, a microcomputer normally controls a control target such as an engine by executing a control program constituted by data stored in a nonvolatile memory. On the other hand, when rewriting data in the nonvolatile memory (the control program and the control data referred to when the program is executed), a separately prepared memory writing device is connected to the electronic control device. The memory writing device and the microcomputer are connected via a communication line. Then, when a predetermined rewriting condition is satisfied, the microcomputer receives write data (that is, data constituting a new control program or control data) transmitted from the memory writing device and writes the received write data. Write data, for example, updating the embedded data to the nonvolatile memory and writing the updated data.

【0004】よって、このような電子制御装置によれ
ば、マイクロコンピュータを当該装置に実装した状態
で、その不揮発性メモリに制御プログラムや制御データ
を更新して書き込む、所謂オンボード書き込みが可能と
なるため、市場への供給後に、何等かの原因で動作内容
(制御内容)を変更しなければならない事態が起こった
としても、容易に対応することができる。
Therefore, according to such an electronic control device, it is possible to perform a so-called on-board write, in which a control program and control data are updated and written in a nonvolatile memory of the microcomputer mounted on the device. Therefore, even if a situation in which the operation content (control content) needs to be changed for some reason occurs after the supply to the market, it can be easily dealt with.

【0005】また、このようなオンボード書き込みが可
能な電子制御装置によれば、その製造工程において、マ
イクロコンピュータを装置に実装してから、その不揮発
性メモリに制御プログラムや制御データを新規に書き込
むことができる。
According to such an on-board writable electronic control device, a microcomputer is mounted on the device in the manufacturing process, and then a control program and control data are newly written in the nonvolatile memory. be able to.

【0006】[0006]

【発明が解決しようとする課題】ところで、近年、この
種の電子制御装置では、制御内容の複雑化に伴って、複
数のマイクロコンピュータを搭載したものが主流となっ
ており、このような電子制御装置においては、複数のマ
イクロコンピュータの各々について、オンボード書き込
みが可能となるように構成することが考えられる。
In recent years, electronic control devices of this type have been mainly equipped with a plurality of microcomputers in accordance with complicated control contents. It is conceivable that the apparatus is configured to enable on-board writing for each of the plurality of microcomputers.

【0007】また、一般的に、マイクロコンピュータを
搭載する電子制御装置においては、制御の安全性を確保
するために、マイクロコンピュータにて制御プログラム
が正常に実行されているか否かを監視して、異常の発生
時には、マイクロコンピュータをリセット(初期化)し
てやる必要がある。
In general, in an electronic control device equipped with a microcomputer, in order to ensure control safety, the microcomputer monitors whether or not the control program is normally executed. When an abnormality occurs, it is necessary to reset (initialize) the microcomputer.

【0008】そして、複数のマイクロコンピュータを搭
載した電子制御装置の場合には、特定のマイクロコンピ
ュータが、他のマイクロコンピュータの動作(即ち、そ
のマイクロコンピュータにて制御プログラムが正常に実
行されているか否か)を監視して、異常検出時に上記他
のマイクロコンピュータをリセットするための動作を行
う、といった構成を採る場合がある。つまり、このよう
な構成を採れば、各マイクロコンピュータ毎に、その動
作を監視するための所謂ウォッチドックタイマ回路とい
ったハードウェア回路を設ける必要がなく、簡単な装置
構成で制御の安全性を確保できるからである。
[0008] In the case of an electronic control unit equipped with a plurality of microcomputers, a specific microcomputer operates according to the operation of another microcomputer (that is, whether or not the control program is normally executed by that microcomputer. ) May be monitored to perform an operation for resetting the other microcomputer when an abnormality is detected. In other words, with such a configuration, it is not necessary to provide a hardware circuit such as a so-called watchdog timer circuit for monitoring the operation of each microcomputer, and it is possible to secure control safety with a simple device configuration. Because.

【0009】しかしながら、電子制御装置において、前
述したように複数のマイクロコンピュータの各々につい
てオンボード書き込みが可能で、且つ、特定のマイクロ
コンピュータが他のマイクロコンピュータの動作を監視
する、という構成を採った場合には、以下のような問題
が生じる。
However, in the electronic control unit, as described above, each of the plurality of microcomputers can perform on-board writing, and a specific microcomputer monitors the operation of another microcomputer. In such a case, the following problem occurs.

【0010】即ち、電子制御装置の製造工程において、
各マイクロコンピュータを実装してから、まず、他のマ
イクロコンピュータを監視する側のマイクロコンピュー
タ(以下、監視マイコンともいう)に制御プログラムな
どを新規に書き込み、その後、監視される側のマイクロ
コンピュータ(以下、被監視マイコンともいう)に制御
プログラムなどを新規に書き込もうとした時には、監視
マイコンが既に書き込まれた制御プログラムを実行して
通常動作を行うのに対し、被監視マイコンは通常の制御
プログラムを実行せずに書込処理を行うため、監視マイ
コンにより被監視マイコンが異常であると判断されてし
まう。この結果、書込処理を行っている(換言すれば、
制御プログラムなどの書き込み中である)被監視マイコ
ンが、監視マイコンの動作によってリセットされてしま
い、制御プログラムなどの書き込みを確実に行うことが
できなくなってしまうのである。
That is, in the manufacturing process of the electronic control device,
After mounting each microcomputer, first, a new control program is written in a microcomputer that monitors another microcomputer (hereinafter, also referred to as a monitoring microcomputer), and then the microcomputer that is monitored (hereinafter, referred to as a monitoring microcomputer). When a new control program is to be written to the monitored microcomputer, the monitored microcomputer executes the already written control program and performs the normal operation, whereas the monitored microcomputer executes the normal control program. Since the writing process is performed without performing the process, the monitoring microcomputer determines that the monitored microcomputer is abnormal. As a result, the writing process is performed (in other words,
The microcomputer to be monitored (while the control program or the like is being written) is reset by the operation of the monitoring microcomputer, and it becomes impossible to reliably write the control program or the like.

【0011】本発明は、このような問題に着目したもの
であり、1つのマイクロコンピュータが他のマイクロコ
ンピュータの動作を監視するように構成された電子制御
装置において、監視される側のマイクロコンピュータよ
りも先に、監視する側のマイクロコンピュータに制御プ
ログラムを書き込むようにしても、監視される側のマイ
クロコンピュータに制御プログラムを確実に書き込むこ
とができるようにすることで、1つのマイクロコンピュ
ータが他のマイクロコンピュータを監視することと、各
マイクロコンピュータの各々について制御プログラムの
オンボード書き込みを可能にすることとを、確実に両立
させることを目的としている。
The present invention focuses on such a problem. In an electronic control device in which one microcomputer monitors the operation of another microcomputer, the electronic control unit is controlled by a microcomputer to be monitored. First, even if the control program is written in the monitoring microcomputer, the control program can be surely written in the monitored microcomputer so that one microcomputer can be connected to the other microcomputer. It is an object of the present invention to reliably balance the monitoring of the microcomputer with the on-board writing of the control program for each microcomputer.

【0012】[0012]

【課題を解決するための手段、及び発明の効果】上記目
的を達成するためになされた請求項1に記載の本発明の
電子制御装置は、電気的にデータの書き換えが可能な不
揮発性メモリを有する第1及び第2の2つのマイクロコ
ンピュータを備えている。
Means for Solving the Problems and Effects of the Invention The electronic control unit according to the present invention according to the first aspect of the present invention, which has been made to achieve the above object, uses an electrically rewritable nonvolatile memory. And a first and a second microcomputer.

【0013】そして、通常時において、第1のマイクロ
コンピュータは、自己の不揮発性メモリに格納されたデ
ータにより構成される第1の制御プログラムを実行する
ことで制御対象を制御し、第2のマイクロコンピュータ
は、自己の不揮発性メモリに格納されたデータにより構
成される第2の制御プログラムを実行することで制御対
象を制御する。そして更に、第1のマイクロコンピュー
タは、前記第1の制御プログラムの実行に伴い、第2の
マイクロコンピュータにて前記第2の制御プログラムが
正常に実行されているか否かを監視して、該第2の制御
プログラムの実行に異常が発生したと判断すると第2の
マイクロコンピュータをリセットするための動作を行
う。このため、第2のマイクロコンピュータの動作を監
視するための専用のハードウェア回路を設けることな
く、第2のマイクロコンピュータにおけるプログラム暴
走を回避して、制御の安全性を確保することができる。
In a normal state, the first microcomputer controls a control target by executing a first control program constituted by data stored in its own nonvolatile memory, and controls the second microcomputer. The computer controls the control target by executing the second control program including the data stored in the nonvolatile memory of the computer. Further, the first microcomputer monitors whether or not the second control program is normally executed by the second microcomputer in accordance with the execution of the first control program. When it is determined that an abnormality has occurred in the execution of the second control program, an operation for resetting the second microcomputer is performed. Therefore, without providing a dedicated hardware circuit for monitoring the operation of the second microcomputer, it is possible to avoid program runaway in the second microcomputer and to ensure control safety.

【0014】一方、両マイクロコンピュータの各々は、
予め定められた書き換え条件が成立すると、外部から送
信されて来る書込データを各自の不揮発性メモリに更新
して書き込むための書込処理を行うが、特に請求項1に
記載の電子制御装置は、監視動作阻止手段を備えてい
る。そして、この監視動作阻止手段が、第2のマイクロ
コンピュータが前記書込処理を行っている間は、第1の
マイクロコンピュータの動作によって第2のマイクロコ
ンピュータがリセットされるのを阻止する。
On the other hand, each of the two microcomputers
When a predetermined rewriting condition is satisfied, a write process for updating and writing the write data transmitted from the outside to its own non-volatile memory is performed. , Monitoring operation inhibiting means. The monitoring operation preventing means prevents the second microcomputer from being reset by the operation of the first microcomputer while the second microcomputer is performing the writing process.

【0015】このため、当該電子制御装置の製造工程に
おいて、各マイクロコンピュータを実装してから、最初
に、第1のマイクロコンピュータ(詳しくは、その不揮
発性メモリ)に第1の制御プログラムの構成データを新
規に書き込み、その後に、監視される側の第2のマイク
ロコンピュータ(詳しくは、その不揮発性メモリ)に第
2の制御プログラムの構成データを新規に書き込む、と
いった書き込み順序を採った場合にも、書込処理を行っ
ている最中の第2のマイクロコンピュータが、監視する
側の第1のマイクロコンピュータの動作によってリセッ
トされてしまうことが防止される。
For this reason, in the manufacturing process of the electronic control device, after each microcomputer is mounted, first, the configuration data of the first control program is stored in the first microcomputer (specifically, its non-volatile memory). Is newly written, and subsequently, the configuration data of the second control program is newly written in the second microcomputer (specifically, the nonvolatile memory thereof) to be monitored. This prevents the second microcomputer during the writing process from being reset by the operation of the first microcomputer on the monitoring side.

【0016】従って、本発明の電子制御装置によれば、
請求項4に記載のように、監視される側の第2のマイク
ロコンピュータよりも先に、監視する側の第1のマイク
ロコンピュータに制御プログラム(第1の制御プログラ
ム)を書き込むようにしても、監視される側の第2のマ
イクロコンピュータに制御プログラム(第2の制御プロ
グラム)を確実に書き込むことができ、延いては、両マ
イクロコンピュータの各々について、如何なる順序で制
御プログラムを書き込むようにしても、その書き込みを
確実に行うことができるようになる。この結果、1つの
マイクロコンピュータが他のマイクロコンピュータを監
視することと、各マイクロコンピュータの各々について
制御プログラムのオンボード書き込みを可能にすること
とを、確実に両立させることができる。
Therefore, according to the electronic control device of the present invention,
As described in claim 4, even if the control program (first control program) is written in the first microcomputer on the monitoring side before the second microcomputer on the monitoring side, The control program (second control program) can be reliably written in the second microcomputer to be monitored, and the control program can be written in any order in each of the two microcomputers. , Writing can be performed reliably. As a result, it is possible to ensure that one microcomputer monitors another microcomputer and that the control program can be written on-board for each microcomputer.

【0017】ところで、データの書き換えが可能な不揮
発性メモリが、例えばEEPROMやフラッシュメモリ
である場合には、データの新規書き込み時或いは書き換
え時に、マイクロコンピュータへ通常の動作電圧よりも
高い所定の書込電圧を供給してやる必要がある。
In the case where the rewritable nonvolatile memory is, for example, an EEPROM or a flash memory, a predetermined write higher than the normal operating voltage is applied to the microcomputer at the time of new writing or rewriting of data. It is necessary to supply voltage.

【0018】そこで、本発明の電子制御装置において、
前記第2のマイクロコンピュータが、少なくとも所定の
書込電圧が供給されることを条件として前記書込処理を
行うように構成されている場合には、請求項2に記載の
ように、前記監視動作阻止手段は、第2のマイクロコン
ピュータに前記書込電圧が供給されているか否かを検出
して、その書込電圧が供給されている時に、第1のマイ
クロコンピュータの動作によって第2のマイクロコンピ
ュータがリセットされるのを阻止するように構成するこ
とができる。
Therefore, in the electronic control device of the present invention,
3. The monitoring operation according to claim 2, wherein the second microcomputer is configured to perform the write processing on condition that at least a predetermined write voltage is supplied. The blocking means detects whether or not the write voltage is supplied to the second microcomputer, and when the write voltage is supplied, the second microcomputer operates by the first microcomputer. Can be prevented from being reset.

【0019】そして、このような請求項2に記載の電子
制御装置によれば、第2のマイクロコンピュータが書込
処理を行っているか否かを、特別な処理や回路を設ける
ことなく簡単に検出することができる。また、請求項3
に記載のように、第1のマイクロコンピュータが、前記
第2の制御プログラムの実行に異常が発生したと判断す
ると第2のマイクロコンピュータへリセット信号を出力
するのであれば、前記監視動作阻止手段は、第1のマイ
クロコンピュータから出力されたリセット信号が第2の
マイクロコンピュータに入力されるのを阻止すること
で、第2のマイクロコンピュータがリセットされるのを
阻止するように構成することができる。
According to the electronic control device of the second aspect, whether the second microcomputer is performing the writing process can be easily detected without providing any special processing or circuit. can do. Claim 3
If the first microcomputer outputs a reset signal to the second microcomputer when the first microcomputer determines that an abnormality has occurred in the execution of the second control program, the monitoring operation inhibiting means By preventing a reset signal output from the first microcomputer from being input to the second microcomputer, the second microcomputer can be prevented from being reset.

【0020】そして、このようにすれば、第2のマイク
ロコンピュータが、前記書込処理を行っている時に第1
のマイクロコンピュータの動作によってリセットされて
しまうことを確実に防止できる。尚、この場合の監視動
作阻止手段としては、第1のマイクロコンピュータから
第2のマイクロコンピュータへ至るリセット信号の信号
ラインを連通及び遮断する、スイッチング素子や論理回
路素子を用いることができ、簡単な構成で確実な効果を
得ることができる。
With this configuration, when the second microcomputer performs the writing process, the first microcomputer performs the first writing.
Reset by the operation of the microcomputer can be reliably prevented. In this case, as the monitoring operation preventing means, a switching element or a logic circuit element for communicating and cutting off a signal line of a reset signal from the first microcomputer to the second microcomputer can be used. A certain effect can be obtained with the configuration.

【0021】一方、前述した目的を達成するための一層
好適な電子制御装置としては、請求項5に記載の電子制
御装置を挙げることができる。即ち、請求項5に記載の
電子制御装置は、請求項1に記載の電子制御装置と同様
の第1及び第2のマイクロコンピュータに加えて、シス
テム監視手段と阻止手段とを備えており、第1のマイク
ロコンピュータは、自己の不揮発性メモリに格納された
第1の制御プログラムの実行に伴い、所定時間以内毎に
自己が正常であることを示すモニタ信号を出力すると共
に、第2のマイクロコンピューにてその不揮発性メモリ
内の第2の制御プログラムが正常に実行されているか否
かを監視して、該第2の制御プログラムの実行に異常が
発生したと判断すると前記モニタ信号の出力を停止す
る。
On the other hand, as a more preferable electronic control device for achieving the above-mentioned object, an electronic control device according to claim 5 can be mentioned. That is, an electronic control unit according to a fifth aspect includes a system monitoring unit and a blocking unit in addition to the first and second microcomputers similar to the electronic control unit according to the first embodiment. In accordance with execution of the first control program stored in its own nonvolatile memory, the first microcomputer outputs a monitor signal indicating that it is normal within a predetermined period of time, and outputs the second microcomputer. The computer monitors whether or not the second control program in the nonvolatile memory is normally executed, and when it is determined that an abnormality has occurred in the execution of the second control program, the monitor signal is output. Stop.

【0022】そして、システム監視手段が、第1のマイ
クロコンピュータから出力される前記モニタ信号を監視
して、そのモニタ信号が前記所定時間よりも長く設定さ
れた時間以内に出力されない場合に、第1及び第2の両
マイクロコンピュータへリセット信号を出力する。
The system monitoring means monitors the monitor signal output from the first microcomputer, and if the monitor signal is not output within a set time longer than the predetermined time, the first monitor is used. And a reset signal to both the second microcomputer.

【0023】また更に、阻止手段が、前記両マイクロコ
ンピュータの少なくとも何れか一方が前記書込処理を行
っている間は、前記システム監視手段により前記両マイ
クロコンピュータがリセットされるのを阻止する。この
ような請求項5に記載の電子制御装置によれば、両マイ
クロコンピュータが書込処理を行っていない通常時にお
いて、第1のマイクロコンピュータ自身に異常が生じた
場合はもとより、第2のマイクロコンピュータに異常が
生じて、その異常を第1のマイクロコンピュータが検出
した場合にも、第1のマイクロコンピュータによる上記
モニタ信号の出力が停止し、これに伴い、システム監視
手段から両マイクロコンピュータへリセット信号が出力
される。よって、両マイクロコンピュータの通常時にお
ける異常を、1つのシステム監視手段だけで検出及び回
避することができる。
Still further, the blocking means prevents the microcomputers from being reset by the system monitoring means while at least one of the microcomputers is performing the writing process. According to the electronic control device of the fifth aspect, at the normal time when the two microcomputers are not performing the writing process, not only when the first microcomputer itself has an abnormality, but also when the second microcomputer is in an abnormal state. Even when an abnormality occurs in the computer and the first microcomputer detects the abnormality, the output of the monitor signal by the first microcomputer is stopped, and accordingly, the system monitoring means resets both microcomputers. A signal is output. Therefore, abnormalities in both microcomputers during normal times can be detected and avoided by only one system monitoring means.

【0024】しかも、両マイクロコンピュータの少なく
とも何れか一方が書込処理を行っている時には、上記阻
止手段の作用により、両マイクロコンピュータがシステ
ム監視手段によりリセットされることが防止される。従
って、この請求項5に記載の電子制御装置によれば、両
マイクロコンピュータの各々について、如何なる順序で
制御プログラムを書き込むようにしても、その書き込み
を確実に行うことができるようになり、しかも、極めて
簡単な構成で、両マイクロコンピュータを監視すること
と、両マイクロコンピュータの各々について制御プログ
ラムのオンボード書き込みを可能にすることとを、両立
させることができる。
Further, when at least one of the two microcomputers is performing the writing process, the operation of the blocking means prevents the two microcomputers from being reset by the system monitoring means. Therefore, according to the electronic control device of the fifth aspect, even if the control program is written to each of the two microcomputers in any order, the writing can be performed reliably, and With an extremely simple configuration, it is possible to simultaneously monitor both microcomputers and enable on-board writing of a control program for each of both microcomputers.

【0025】尚、請求項5に記載の電子制御装置におい
て、請求項6に記載の如く、両マイクロコンピュータ
が、少なくとも所定の書込電圧が供給されることを条件
として前記書込処理を行うように構成されている場合に
は、阻止手段は、両マイクロコンピュータの少なくとも
何れか一方に前記書込電圧が供給されているか否かを検
出して、該書込電圧が供給されている時に、前記システ
ム監視手段により両マイクロコンピュータがリセットさ
れるのを阻止するように構成することができる。
In the electronic control device according to the fifth aspect, as described in the sixth aspect, both microcomputers perform the writing process on condition that at least a predetermined writing voltage is supplied. In the case where the write voltage is supplied, the blocking unit detects whether or not the write voltage is supplied to at least one of the two microcomputers. The microcomputer may be configured to prevent resetting of both microcomputers by the system monitoring means.

【0026】このようにすれば、請求項2に記載の電子
制御装置と同様の効果、即ち、両マイクロコンピュータ
の何れかが書込処理を行っているか否かを特別な処理や
回路を設けることなく簡単に検出できる、という効果を
得ることができる。また、請求項5又は請求項6に記載
の電子制御装置において、阻止手段を、請求項7に記載
の如く、システム監視手段から出力されたリセット信号
が両マイクロコンピュータに入力されるのを阻止するこ
とで、両マイクロコンピュータがリセットされるのを阻
止するように構成すれば、前述した請求項3に記載の電
子制御装置と同様に、両マイクロコンピュータの何れか
が書込処理を行っている時にリセットされてしまうこと
を確実に防止できる。
With this configuration, the same effect as that of the electronic control device according to the second aspect, that is, a special process or a circuit is provided to determine whether one of the two microcomputers is performing the writing process. And the effect of easy detection can be obtained. In the electronic control device according to the fifth or sixth aspect, the blocking means prevents the reset signal output from the system monitoring means from being input to both microcomputers. Thus, if both microcomputers are configured to be prevented from being reset, similar to the above-described electronic control device according to claim 3, when either of the microcomputers performs the writing process, Reset can be reliably prevented.

【0027】一方、請求項5又は請求項6に記載の電子
制御装置において、請求項8に記載のように、システム
監視手段が、一定周期毎にカウント動作を行うと共に第
1のマイクロコンピュータから出力される前記モニタ信
号によりカウント値が初期化されるカウンタと、このカ
ウンタのカウント値が所定値に達すると、前記両マイク
ロコンピュータへリセット信号を出力するリセット信号
出力手段とからなり、更に、第1のマイクロコンピュー
タが、自己の不揮発性メモリ内の第1の制御プログラム
の実行に伴い、前記カウンタへ、該カウンタのカウント
値が初期化されてから前記所定値に達するまでの時間よ
りも短い周期で前記モニタ信号を出力する、という構成
であれば、前記阻止手段は、前記カウンタのカウント動
作を強制的に停止させることで、両マイクロコンピュー
タがリセットされるのを阻止するように構成することが
できる。
On the other hand, in the electronic control device according to the fifth or sixth aspect, as set forth in the eighth aspect, the system monitoring means performs a counting operation at regular intervals and outputs from the first microcomputer. And a reset signal output means for outputting a reset signal to both microcomputers when the count value of the counter reaches a predetermined value. Microcomputer executes the first control program in its own non-volatile memory, and instructs the counter to have a period shorter than the time from when the count value of the counter is initialized to when it reaches the predetermined value. With the configuration of outputting the monitor signal, the blocking means forcibly stops the counting operation of the counter. By causing, it can be both the microcomputer is configured to prevent the reset.

【0028】つまり、請求項8に記載の電子制御装置で
は、システム監視手段が、所謂ウォッチドックタイマ回
路であり、そのウォッチドックタイマ用のカウンタのカ
ウント動作を停止させることで、両マイクロコンピュー
タへリセット信号が出力されるのを禁止するようにして
いる。そして、この電子制御装置によれば、両マイクロ
コンピュータがリセットされてしまうことを、簡単な構
成で防止することができる。
That is, in the electronic control device according to the eighth aspect, the system monitoring means is a so-called watchdog timer circuit, and the microcomputer is reset by stopping the counting operation of the watchdog timer counter. The output of the signal is prohibited. According to this electronic control device, resetting of both microcomputers can be prevented with a simple configuration.

【0029】[0029]

【発明の実施の形態】以下、本発明の実施の形態につい
て図面を用いて説明する。尚、本発明の実施の形態は、
下記のものに何ら限定されることなく、本発明の技術的
範囲に属する限り、種々の形態を採り得ることは言うま
でもない。
Embodiments of the present invention will be described below with reference to the drawings. Note that the embodiment of the present invention
It goes without saying that the present invention is not limited to the following ones, but can take various forms as long as it belongs to the technical scope of the present invention.

【0030】[第1実施形態]まず図1は、自動車に搭
載されて内燃機関型エンジン及び自動変速機の制御を行
う電子制御装置(以下、ECUという)2と、ECU2
に内蔵されたエンジン制御用及び自動変速機制御用の制
御プログラムや制御データを書き換える際、或いは新規
に書き込む際にECU2に接続されるメモリ書込装置4
とからなる、第1実施形態の電子制御装置のメモリ書換
システムの全体構成を表すブロック図である。
[First Embodiment] First, FIG. 1 shows an electronic control unit (hereinafter referred to as an ECU) 2 mounted on a vehicle and controlling an internal combustion engine and an automatic transmission, and an ECU 2.
A memory writing device 4 connected to the ECU 2 when rewriting or newly writing control programs and control data for engine control and automatic transmission control built in
It is a block diagram showing the whole structure of the memory rewriting system of the electronic control unit of 1st Embodiment which consists of these.

【0031】図1に示すように、ECU2は、エンジン
の回転状態に応じたパルス信号やオン/オフ信号を出力
する種々のセンサ8からの信号を入力して波形整形する
波形整形回路10と、エンジンの吸入空気量やスロット
ル開度などに応じたアナログ信号を出力する種々のアナ
ログセンサ12からの信号を入力してノイズ除去を行う
入力回路14と、入力回路14からのアナログ信号をデ
ジタル信号に変換して出力するA/D変換器(ADC)
16と、波形整形回路10及びA/D変換器16からの
信号に基づきエンジンに対する燃料噴射量や点火時期な
どの制御量を演算し、その演算結果に基づき制御信号を
出力するエンジン制御用のシングルチップマイクロコン
ピュータ(以下、メインマイコン或いは単にマイコンと
いう)18と、メインマイコン18からの制御信号を受
けて、エンジンに取付けられたインジェクタやイグナイ
タなどのアクチュエータ22aを駆動する出力回路20
aとを備えている。
As shown in FIG. 1, the ECU 2 includes a waveform shaping circuit 10 for inputting signals from various sensors 8 for outputting pulse signals and on / off signals according to the rotation state of the engine and shaping the waveform. An input circuit 14 for inputting signals from various analog sensors 12 that output analog signals according to the intake air amount of the engine, the throttle opening, and the like to remove noise, and convert the analog signals from the input circuit 14 into digital signals. A / D converter (ADC) that converts and outputs
And an engine control unit for calculating a control amount such as a fuel injection amount or an ignition timing for the engine based on signals from the waveform shaping circuit and the A / D converter and outputting a control signal based on the calculation result. A chip microcomputer (hereinafter referred to as a main microcomputer or simply a microcomputer) 18 and an output circuit 20 which receives a control signal from the main microcomputer 18 and drives an actuator 22a such as an injector or an igniter attached to the engine.
a.

【0032】そして更に、ECU2は、メインマイコン
18との間でDMA(Direct Memory Access)通信ライ
ン24を介してスロットル開度やトルク制御信号といっ
た制御情報の授受を行うと共に、自動変速機の変速タイ
ミングなどを演算して制御信号を出力する自動変速機制
御用のシングルチップマイクロコンピュータ(以下、サ
ブマイコン或いは単にマイコンという)26と、サブマ
イコン26からの制御信号を受けて、自動変速機に取付
けられた変速用リニアソレノイドなどのアクチュエータ
22bを駆動する出力回路20bとを備えている。
Further, the ECU 2 transmits and receives control information such as a throttle opening and a torque control signal to and from the main microcomputer 18 via a DMA (Direct Memory Access) communication line 24, and controls the shift timing of the automatic transmission. A single-chip microcomputer (hereinafter, referred to as a sub-microcomputer or simply a microcomputer) 26 for controlling the automatic transmission which outputs a control signal by calculating the operation of the microcomputer, etc. An output circuit 20b for driving an actuator 22b such as a gearshift linear solenoid.

【0033】また、ECU2は、メインマイコン18と
サブマイコン26の夫々が外部装置としてのメモリ書込
装置4との間でシリアルデータ通信を行うための通信回
路28を備えており、この通信回路28は、メモリ書込
装置4に図示しないコネクタを介して接続されるシリア
ル通信ライン30と、当該ECU2内にて両マイコン1
8,26に共通して接続されたシリアル通信ライン32
との間に設けられている。尚、シリアル通信ライン32
は、通信回路28から両マイコン18,26に至る経路
の途中で、通信回路28とメインマイコン18を結ぶシ
リアル通信ライン32aと、通信回路28とサブマイコ
ン26を結ぶシリアル通信ライン32bとに分岐してい
る。
The ECU 2 has a communication circuit 28 for each of the main microcomputer 18 and the sub-microcomputer 26 to perform serial data communication with the memory writing device 4 as an external device. Is a serial communication line 30 connected to the memory writing device 4 via a connector (not shown);
Serial communication line 32 commonly connected to
And is provided between them. The serial communication line 32
Is divided into a serial communication line 32a connecting the communication circuit 28 and the main microcomputer 18 and a serial communication line 32b connecting the communication circuit 28 and the sub-microcomputer 26 in the middle of the path from the communication circuit 28 to the microcomputers 18 and 26. ing.

【0034】そして、通信回路28は、メモリ書込装置
4からシリアル通信ライン30を介して送信されて来る
データを、シリアル通信ライン32を介して両マイコン
18,26に送り、両マイコン18,26からシリアル
通信ライン32を介して受けたデータを、シリアル通信
ライン30を介してメモリ書込装置4に送信するように
構成されている。
The communication circuit 28 sends the data transmitted from the memory writing device 4 via the serial communication line 30 to the microcomputers 18 and 26 via the serial communication line 32. Is transmitted to the memory writing device 4 via the serial communication line 30.

【0035】また更に、ECU2は、車両に搭載された
バッテリBTから直接供給される電圧(以下、バッテリ
電圧という)VB と、バッテリBTから車両のイグニッ
ションスイッチIGSを介して供給される電圧(以下、
IG電圧という)VIGとを受けて、後述するように、上
記両マイコン18,26とその周辺回路(A/D変換器
16や出力回路20a,20bなど)に様々な種類の電
圧を供給する電源回路34も備えている。
The ECU 2 further includes a voltage (hereinafter referred to as a battery voltage) VB directly supplied from a battery BT mounted on the vehicle and a voltage (hereinafter, referred to as a battery voltage) supplied from the battery BT via an ignition switch IGS of the vehicle.
A power source that receives VIG (referred to as an IG voltage) and supplies various types of voltages to the microcomputers 18 and 26 and their peripheral circuits (such as the A / D converter 16 and the output circuits 20a and 20b) as described later. A circuit 34 is also provided.

【0036】尚、電源回路34には、メインマイコン1
8から後述するように出力される、モニタ信号としての
ウォッチドックタイマクリア信号(以下、WDC信号と
いう)W1が入力されている。そして、電源回路34
は、メインマイコン18からのWDC信号W1が予め設
定された時間以内にレベル反転しない場合に、メインマ
イコン18又はサブマイコン26の何れかに異常が発生
したと判断して、両マイコン18,26へ、それらをリ
セットするためのリセット信号R1を出力するウォッチ
ドックタイマ機能を有している。
The power supply circuit 34 includes a main microcomputer 1
8, a watchdog timer clear signal (hereinafter, referred to as a WDC signal) W1 as a monitor signal, which is output as described later, is input. Then, the power supply circuit 34
When the level of the WDC signal W1 from the main microcomputer 18 does not reverse within a preset time, it is determined that an abnormality has occurred in either the main microcomputer 18 or the sub-microcomputer 26 and the microcomputers 18 and 26 And a watchdog timer function for outputting a reset signal R1 for resetting them.

【0037】次に、ECU2に搭載されたメインマイコ
ン18とサブマイコン26の内部構成について、図2を
用いて説明する。図2に示すように、両マイコン18,
26の各々は、プログラムに従い動作する周知のCPU
40と、CPU40を動作させるのに必要なプログラム
及びデータを格納する不揮発性のフラッシュメモリ42
及びマスクROM44と、CPU40の演算結果などを
一時記憶するためのRAM46と、信号の入出力を行う
ためのI/O(図示省略)とを備えている。
Next, the internal configuration of the main microcomputer 18 and the sub-microcomputer 26 mounted on the ECU 2 will be described with reference to FIG. As shown in FIG.
Each of the known CPUs operates according to a program.
And a non-volatile flash memory 42 for storing programs and data necessary for operating the CPU 40
A mask ROM 44; a RAM 46 for temporarily storing the calculation results of the CPU 40; and an I / O (not shown) for inputting and outputting signals.

【0038】ここで、フラッシュメモリ42は、所定の
書込電圧(本実施形態では7.5V)VPPが印加された
状態でデータの書き換え(詳しくは、データの消去及び
書き込み)が可能な不揮発性ROMである。そして、両
マイコン18,26のフラッシュメモリ42には、EC
U2の製造工程において両マイコン18,26がECU
2へ実装された後に、CPU40により実行されるエン
ジン制御用または自動変速機制御用の制御プログラム及
びその実行時に参照される制御データが新規に書き込ま
れる。詳しくは、メインマイコン18のフラッシュメモ
リ42には、エンジン制御用の制御プログラム及び制御
データを構成するデータが新規に書き込まれ、サブマイ
コン26のフラッシュメモリ42には、自動変速機制御
用の制御プログラム及び制御データを構成するデータが
新規に書き込まれる。
Here, the flash memory 42 is a nonvolatile memory capable of rewriting data (specifically, erasing and writing data) while a predetermined write voltage (7.5 V in this embodiment) VPP is applied. ROM. The flash memory 42 of each of the microcomputers 18 and 26 has an EC
In the manufacturing process of U2, both microcomputers 18 and 26 are ECU
2, the control program for engine control or automatic transmission control executed by the CPU 40 and the control data referred to at the time of execution are newly written. More specifically, a control program for engine control and data constituting control data are newly written in the flash memory 42 of the main microcomputer 18, and a control program and a control program for automatic transmission control are stored in the flash memory 42 of the sub-microcomputer 26. Data constituting the control data is newly written.

【0039】また、メインマイコン18のフラッシュメ
モリ42に書き込まれるエンジン制御用の制御プログラ
ムには、所定時間TS1(本実施形態では4ms)毎に信
号レベルが反転するWDC信号W1を電源回路34へ出
力するための信号出力用プログラムと、サブマイコン2
6の動作を監視するための監視処理用プログラムとが含
まれており、サブマイコン26のフラッシュメモリ42
に書き込まれる自動変速機制御用の制御プログラムに
は、所定時間TS2(本実施形態では上記時間TS1と同じ
4ms)毎に信号レベルが反転するWDC信号W2を図
1の如くメインマイコン18へ出力するための信号出力
用プログラムが含まれている。
The control program for engine control written in the flash memory 42 of the main microcomputer 18 outputs to the power supply circuit 34 a WDC signal W1 whose signal level is inverted every predetermined time TS1 (4 ms in this embodiment). And a sub-microcomputer 2
And a monitoring processing program for monitoring the operation of the sub-microcomputer 26.
In order to output the WDC signal W2 whose signal level is inverted every predetermined time period TS2 (in this embodiment, 4 ms equal to the time period TS1) to the main microcomputer 18 as shown in FIG. A signal output program is included.

【0040】尚、以下の説明において、フラッシュメモ
リ42に制御プログラムなどを新規に書き込む旨の記載
が特に無い場合には、両マイコン18,26のフラッシ
ュメモリ42には、各マイコン18,26の役割に夫々
対応する上記制御プログラム及び制御データが既に書き
込まれているものとする。
In the following description, if there is no description that a control program or the like is to be newly written in the flash memory 42, the roles of the microcomputers 18 and 26 are stored in the flash memories 42 of the microcomputers 18 and 26. It is assumed that the above-described control program and control data respectively corresponding to have been already written.

【0041】一方、マスクROM44は、データの書き
換えが不能な不揮発性ROMであり、このマスクROM
44には、マイコン18,26のリセット(初期化)解
除の直後に実行されるブートプログラムが、両マイコン
18,26のECU2への実装前に予め格納されてい
る。
On the other hand, the mask ROM 44 is a nonvolatile ROM in which data cannot be rewritten.
In 44, a boot program to be executed immediately after reset (initialization) of the microcomputers 18 and 26 is released is stored in advance before the microcomputers 18 and 26 are mounted on the ECU 2.

【0042】また、両マイコン18,26のマスクRO
M44には、メインマイコン18とサブマイコン26と
を識別可能な識別コードが予め格納されており、本実施
形態において、メインマイコン18の識別コードは「0
001」であり、サブマイコン26の識別コードは「0
010」である。
The mask RO of both microcomputers 18 and 26 is used.
In M44, an identification code capable of identifying the main microcomputer 18 and the sub-microcomputer 26 is stored in advance, and in the present embodiment, the identification code of the main microcomputer 18 is “0”.
001 ”and the identification code of the sub-microcomputer 26 is“ 0 ”.
010 ".

【0043】尚、両マイコン18,26のマスクROM
44に夫々格納されているブートプログラムの処理内容
は同一である。また、マスクROM44に代えて、フラ
ッシュメモリ42と同様に電気的にデータの書き換えが
可能な不揮発性ROMを用いても、データの書き換えが
禁止されていれば良い。
The mask ROMs of the microcomputers 18 and 26
The processing contents of the boot programs stored in the respective 44 are the same. Further, instead of the mask ROM 44, a nonvolatile ROM in which data can be electrically rewritten similarly to the flash memory 42 may be used as long as the data rewriting is prohibited.

【0044】一方更に、両マイコン18,26の内部に
おいて、前述したシリアル通信ライン32(詳しくは、
メインマイコン18の場合にはシリアル通信ライン32
aであり、サブマイコン26の場合にはシリアル通信ラ
イン32bである)にシリアルデータを送信するための
電気的経路には、その経路をCPU40からの指令に応
じて連通又は遮断するスイッチ素子SW1が設けられて
おり、同様に、シリアル通信ライン32からシリアルデ
ータを受信するための電気的経路には、その経路をCP
U40からの指令に応じて連通又は遮断するスイッチ素
子SW2が設けられている。
On the other hand, inside the microcomputers 18 and 26, the serial communication line 32 (specifically,
In the case of the main microcomputer 18, the serial communication line 32
a, and in the case of the sub-microcomputer 26, it is a serial communication line 32b. Similarly, an electrical path for receiving serial data from the serial communication line 32 is
A switch element SW2 for communicating or shutting off in response to a command from U40 is provided.

【0045】また、図1に示すように、メインマイコン
18とサブマイコン26には、電源回路34から共通の
電源ライン38を介して、フラッシュメモリ42にデー
タを書き込む際に必要な上記書込電圧VPPが供給される
ようになっている。そして、図2に示すように、両マイ
コン18,26の内部において、上記電源ライン38か
ら書込電圧VPPを受けるための電気的経路にも、その経
路をCPU40からの指令に応じて連通又は遮断するス
イッチ素子SW3が設けられている。尚、上記スイッチ
素子SW1〜SW3の初期状態は全て連通状態である。
As shown in FIG. 1, the main microcomputer 18 and the sub-microcomputer 26 have the above-mentioned write voltage necessary for writing data to the flash memory 42 from the power supply circuit 34 via the common power supply line 38. VPP is supplied. Then, as shown in FIG. 2, inside the microcomputers 18 and 26, the electrical path for receiving the write voltage VPP from the power supply line 38 is also connected or cut off according to a command from the CPU 40. A switching element SW3 is provided. The initial states of the switch elements SW1 to SW3 are all communication states.

【0046】このような両マイコン18,26におい
て、CPU40は、リセット解除の直後に、マスクRO
M44内のブートプログラムの実行を開始し、当該EC
U2にメモリ書込装置4が接続されていない通常時に
は、そのブートプログラムにてフラッシュメモリ42内
の制御プログラム(メインマイコン18であれば、エン
ジン制御用の制御プログラムであり、サブマイコン26
であれば、自動変速機制御用の制御プログラム)をコー
ルして、その制御プログラムを実行することにより、エ
ンジン或いは自動変速機を制御するための制御処理を行
う。
In both the microcomputers 18 and 26, the CPU 40 sets the mask RO immediately after the reset is released.
Start execution of the boot program in M44, and
At the normal time when the memory writing device 4 is not connected to the U2, the control program in the flash memory 42 (in the case of the main microcomputer 18, the control program for engine control,
Then, a control program for controlling the engine or the automatic transmission is performed by calling the control program for controlling the automatic transmission) and executing the control program.

【0047】そして更に、サブマイコン26は、上記自
動変速機制御用の制御プログラム(詳しくは、その中に
含まれた前述の信号出力用プログラム)の実行に伴い、
メインマイコン18へ所定時間TS2毎に信号レベルが反
転するWDC信号W2を出力する。また、メインマイコ
ン18は、上記エンジン制御用の制御プログラム(詳し
くは、その中に含まれた前述の信号出力用プログラム及
び監視処理用プログラム)の実行に伴い、電源回路34
へ所定時間TS1毎に信号レベルが反転するWDC信号W
1を出力すると共に、サブマイコン26からのWDC信
号W2を監視し、そのWDC信号W2が上記所定時間T
S2よりも長く設定された判定時間TH2(>TS2)以内に
レベル反転しない場合には、サブマイコン26における
制御プログラムの実行に異常が発生したと判断して、電
源回路34への自己のWDC信号W1のレベル反転出力
を停止する。
Further, the sub-microcomputer 26 executes the control program for controlling the automatic transmission (more specifically, the above-described signal output program included therein),
A WDC signal W2 whose signal level is inverted every predetermined time TS2 is output to the main microcomputer 18. Further, the main microcomputer 18 executes the control program for controlling the engine (specifically, the above-described signal output program and monitoring processing program included therein), and executes the power supply circuit 34.
WDC signal W whose signal level is inverted every predetermined time TS1
1 and monitors the WDC signal W2 from the sub-microcomputer 26, and the WDC signal W2
If the level is not inverted within the determination time TH2 (> TS2) longer than S2, it is determined that an abnormality has occurred in the execution of the control program in the sub-microcomputer 26, and the own WDC signal to the power supply circuit 34 The level inversion output of W1 is stopped.

【0048】一方、両マイコン18,26のCPU40
は、ブートプログラムの実行を開始した際に、後述する
ように書込モードであると判定すると、フラッシュメモ
リ42内の制御プログラムを即座にコールすることなく
ブートプログラムの実行を続け、これにより、メモリ書
込装置4から送信されて来る書込データ(即ち、フラッ
シュメモリ42に書き込むべき新たな制御プログラム及
び制御データを構成するデータ)をフラッシュメモリ4
2に更新して書き込むための書込処理を行う。そして、
この書込処理を終了した後、フラッシュメモリ42に書
き込まれた新たな制御プログラムをコールして、前述の
通常時と同様の処理を行う。
On the other hand, the CPUs 40 of the microcomputers 18 and 26
When the execution of the boot program is started, if it is determined that the writing mode is set as described later, the execution of the boot program is continued without immediately calling the control program in the flash memory 42. The write data transmitted from the writing device 4 (that is, data forming a new control program and control data to be written in the flash memory 42) is stored in the flash memory 4
Then, a write process for updating and writing to 2 is performed. And
After this writing process is completed, a new control program written in the flash memory 42 is called, and the same process as in the above-described normal operation is performed.

【0049】次に、ECU2に設けられた電源回路34
の構成及び機能について、図3を用いて説明する。図3
に示すように、電源回路34は、定電圧出力用の2つの
PNP型トランジスタTr1,Tr2と、イグニッショ
ンスイッチIGSのオン時に供給されるIG電圧VIGを
受けて、トランジスタTr1から両マイコン18,26
やA/D変換器16などの各周辺回路へ、所定の動作電
圧(本実施形態では5V)VOMを供給させるメイン電源
作成部50と、バッテリBTから常時供給されるバッテ
リ電圧VB を受けて、トランジスタTr2から両マイコ
ン18,26へ、電源バックアップ用のバックアップ電
圧(本実施形態では上記動作電圧VOMと同じ5V)VOS
を常時供給させるサブ電源作成部52とを備えている。
Next, a power supply circuit 34 provided in the ECU 2
Will be described with reference to FIG. FIG.
As shown in (2), the power supply circuit 34 receives two PNP transistors Tr1 and Tr2 for outputting a constant voltage and an IG voltage VIG supplied when the ignition switch IGS is turned on, and receives the two microcomputers 18 and 26 from the transistor Tr1.
A main power supply generating unit 50 for supplying a predetermined operating voltage (5 V in this embodiment) VOM to each peripheral circuit such as the A / D converter 16 and the like, and a battery voltage VB constantly supplied from the battery BT. From the transistor Tr2 to the microcomputers 18 and 26, a backup voltage (5V which is the same as the operation voltage VOM in the present embodiment) VOS
And a sub-power supply creating unit 52 for constantly supplying the power.

【0050】尚、サブ電源作成部52を設けて両マイコ
ン18,26にバックアップ電圧VOSを常時供給するよ
うにしているのは、本実施形態においては、両マイコン
18,26に内蔵されたRAM46の一部の記憶領域
が、イグニッションスイッチIGSのオフ時にも継続し
てデータを保持するスタンバイRAMとして設定されて
いるためであり、このようなスタンバイRAMが不要な
場合には、サブ電源作成部52及びトランジスタTr2
は省略することができる。
It should be noted that the backup power supply VOS is always supplied to the microcomputers 18 and 26 by providing the sub power supply generator 52 in the present embodiment. This is because a part of the storage area is set as a standby RAM that retains data continuously even when the ignition switch IGS is turned off. Transistor Tr2
Can be omitted.

【0051】そして、電源回路34は、後述するように
メモリ書込装置4から択一的に出力される書込許可信号
K1,K2を2本の信号線36a,36bを介して入力
すると共に、その書込許可信号K1,K2のうちの何れ
か一方が入力され、且つ、イグニッションスイッチIG
Sのオンに伴い上記動作電圧VOMが出力されている間、
バッテリ電圧VB 或いはIG電圧VIGから前述した書込
電圧VPPを生成して、その書込電圧VPPを電源ライン3
8(延いては、両マイコン18,26)に出力する書込
電圧作成部54を備えている。
The power supply circuit 34 receives write enable signals K1 and K2, which are selectively output from the memory writing device 4, through two signal lines 36a and 36b, as described later. Either one of the write enable signals K1 and K2 is input, and the ignition switch IG
While the operating voltage VOM is being output with the turning on of S,
The above-described write voltage VPP is generated from the battery voltage VB or the IG voltage VIG, and the write voltage VPP is supplied to the power supply line 3.
8 (and, consequently, both microcomputers 18 and 26).

【0052】そして更に、電源回路34は、メインマイ
コン18からのWDC信号W1が前述した所定時間TS1
よりも長く設定された判定時間TH1(>TS1)以内にレ
ベル反転したか否かを検出するためのウォッチドック検
出部56と、このウォッチドック検出部56によりWD
C信号W1が上記判定時間TH1以内にレベル反転しなか
ったと検出された時、及び、イグニッションスイッチI
GSがオンされて上記動作電圧VOMが立ち上がった時
に、メインマイコン18とサブマイコン26とにハイア
クティブのリセット信号R1を出力して両マイコン1
8,26をリセットするリセット制御部58とを備えて
いる。
Further, the power supply circuit 34 outputs the WDC signal W1 from the main microcomputer 18 for the above-mentioned predetermined time period TS1.
A watchdog detecting section 56 for detecting whether or not the level has been inverted within a longer set determination time TH1 (>TS1);
When it is detected that the level of the C signal W1 has not been inverted within the determination time TH1, and when the ignition switch I
When GS is turned on and the operating voltage VOM rises, a high active reset signal R1 is output to the main microcomputer 18 and the sub-microcomputer 26, and both microcomputers 1 and 2 are activated.
And a reset control unit 58 for resetting the control signals 8 and 26.

【0053】ここで、ウォッチドック検出部56は、図
示されない発信回路からのクロック信号により一定周期
TC 毎にアップカウント動作を行うウォッチドックカウ
ンタ56aと、メインマイコン18からのWDC信号W
1がレベル変化する毎に、ウォッチドックカウンタ56
aをリセット(即ち、ウォッチドックカウンタ56aの
カウント値をゼロクリア)するためのパルス信号を出力
するエッジ検出回路56bと、このエッジ検出回路56
bからのパルス信号と上記書込電圧作成部54からの書
込電圧VPPとを入力し、書込電圧作成部54から書込電
圧VPPが出力されていない時にはエッジ検出回路56b
から上記パルス信号が出力される毎にウォッチドックカ
ウンタ56aをリセットし、書込電圧作成部54から書
込電圧VPPが出力されている時にはウォッチドックカウ
ンタ56aを継続してリセットし続けるオア回路56c
とから構成されている。
Here, the watchdog detector 56 includes a watchdog counter 56a that performs an up-count operation at regular intervals TC by a clock signal from a not-shown transmission circuit, and a WDC signal W from the main microcomputer 18.
Each time 1 changes the level, the watchdog counter 56
an edge detection circuit 56b that outputs a pulse signal for resetting the counter a (that is, clearing the count value of the watchdog counter 56a to zero);
b and the write voltage VPP from the write voltage generator 54. When the write voltage VPP is not output from the write voltage generator 54, the edge detection circuit 56b
Resets the watchdog counter 56a every time the pulse signal is output from the OR circuit 56c. When the write voltage VPP is output from the write voltage generator 54, the watchdog counter 56a is continuously reset.
It is composed of

【0054】そして、リセット制御部58は、ウォッチ
ドックカウンタ56aのカウント値がオーバーフロー値
Mに達すると、メインマイコン18からのWDC信号W
1が上記判定時間TH1以内にレベル反転しなかったと判
断して、両マイコン18,26にリセット信号R1を出
力する。尚、ウォッチドックカウンタ56aがアップカ
ウント動作を行う一定周期TC に、ウォッチドックカウ
ンタ56aのオーバーフロー値Mを乗じた時間(TC ×
M)が、上記判定時間TH1である。
When the count value of the watchdog counter 56a reaches the overflow value M, the reset control section 58 outputs the WDC signal W from the main microcomputer 18.
1 determines that the level has not been inverted within the determination time TH1, and outputs a reset signal R1 to both microcomputers 18 and 26. It should be noted that a time period (TC × X) obtained by multiplying the constant cycle TC at which the watchdog counter 56a performs the up-counting operation by the overflow value M of the watchdog counter 56a.
M) is the determination time TH1.

【0055】よって、書込電圧作成部54から書込電圧
VPPが出力されていない場合には、メインマイコン18
からのWDC信号W1が上記判定時間TH1以内にレベル
反転しなかった時に、両マイコン18,26がリセット
制御部58によりリセットされるが、書込電圧作成部5
4から書込電圧VPPが出力されている場合には、オア回
路56cによりウォッチドックカウンタ56aがリセッ
トされ続けて、そのアップカウント動作が強制的に停止
されるため、リセット制御部58による両マイコン1
8,26のリセットが阻止される。
Therefore, when the write voltage VPP is not output from the write voltage generator 54, the main microcomputer 18
When the level of the WDC signal W1 is not inverted within the determination time TH1, the microcomputers 18 and 26 are reset by the reset control unit 58.
4 outputs the write voltage VPP, the OR circuit 56c keeps resetting the watchdog counter 56a and forcibly stops its up-counting operation.
Reset of 8, 26 is prevented.

【0056】一方更に、電源回路34は、IG電圧VIG
に基づきバッテリBTの出力電圧が低下したことを検出
する低電圧検出部60も備えており、図1では示されて
いないが、バッテリBTの出力電圧が所定値以下になる
と、この低電圧検出部60からメインマイコン18及び
サブマイコン26の少なくとも何れか一方に、報知信号
DIが出力されるようになっている。次に、メモリ書込
装置4は、CPU,ROM,RAMなどを備えた周知の
マイクロコンピュータを主要部として構成されており、
図示しないコネクタを介してECU2に接続される。そ
して、この接続時において、メモリ書込装置4は、図1
に示すように、ECU2のシリアル通信ライン30と、
電源回路34(書込電圧作成部54)から伸びた2本の
信号線36a,36bとに接続される。
On the other hand, the power supply circuit 34 has an IG voltage VIG
A low-voltage detecting unit 60 for detecting that the output voltage of the battery BT has dropped based on the low-voltage detecting unit 60, which is not shown in FIG. A notification signal DI is output from 60 to at least one of the main microcomputer 18 and the sub-microcomputer 26. Next, the memory writing device 4 mainly includes a well-known microcomputer having a CPU, a ROM, a RAM, and the like.
It is connected to the ECU 2 via a connector (not shown). At the time of this connection, the memory writing device 4
, A serial communication line 30 of the ECU 2;
It is connected to two signal lines 36a and 36b extending from the power supply circuit 34 (write voltage generator 54).

【0057】また、特に図示はされていないが、メモリ
書込装置4は、当該装置を作動させるための起動スイッ
チや、メインマイコン18とサブマイコン26のうちの
何れのフラッシュメモリ42にデータを書き込むかを選
択するための選択スイッチに加えて、更に、その書き込
むデータであってECU2へ送信する書込データ(新た
な制御プログラム及び制御データを構成するデータ)を
格納したROMやフロッピーディスクなどの記憶媒体
と、様々なメッセージを表示するための表示部とを備え
ている。
Although not specifically shown, the memory writing device 4 writes data into a flash memory 42 of the main microcomputer 18 and the sub-microcomputer 26, such as a start switch for operating the device. In addition to a selection switch for selecting the data, a storage such as a ROM or a floppy disk storing data to be written and data to be transmitted to the ECU 2 (data constituting a new control program and control data). A medium and a display unit for displaying various messages are provided.

【0058】そして、上記記憶媒体には、ECU2へ送
信する書込データと共に、その書込データが書き込まれ
るべきマイコン(メインマイコン18とサブマイコン2
6のうちの何れか)の識別コードが格納されている。ま
た、当然ではあるが、メインマイコン18のフラッシュ
メモリ42に書き込むべき書込データには、メインマイ
コン18が電源回路34へWDC信号W1を出力するた
めの信号出力用プログラムと、サブマイコン26の動作
を監視するための監視処理用プログラムとが含まれてお
り、サブマイコン26のフラッシュメモリ42に書き込
むべき書込データには、サブマイコン26がメインマイ
コン18へWDC信号W2を出力するための信号出力用
プログラムが含まれている。
In the storage medium, the write data to be transmitted to the ECU 2 and the microcomputer (the main microcomputer 18 and the sub microcomputer 2) to which the write data is to be written are written.
6) is stored. Also, needless to say, the write data to be written to the flash memory 42 of the main microcomputer 18 includes a signal output program for the main microcomputer 18 to output the WDC signal W1 to the power supply circuit 34, and the operation of the sub-microcomputer 26. And a write processing to be written to the flash memory 42 of the sub-microcomputer 26 includes a signal output for the sub-microcomputer 26 to output the WDC signal W2 to the main microcomputer 18. Program is included.

【0059】次に、本第1実施形態のメモリ書換システ
ムにおいて、メモリ書込装置4で実行される処理と、E
CU2の両マイコン18,26で実行される処理につい
て、図4〜図6のフローチャートを用いて説明する。
尚、図4は、メモリ書込装置4で実行される処理を表す
フローチャートである。また、図5は、両マイコン1
8,26の各々で実行される処理を表すフローチャート
であり、そのステップ(以下、単に「S」と記す)20
0〜S260の処理が、マスクROM44内のブートプ
ログラムによって実行され、S270の処理が、フラッ
シュメモリ42内の制御プログラムによって実行され
る。そして、図6は、メインマイコン18にて、フラッ
シュメモリ42内の制御プログラムに含まれた監視処理
用プログラムにより、サブマイコン26の動作を監視す
るために実行されるサブマイコン監視処理を表すフロー
チャートである。
Next, in the memory rewriting system according to the first embodiment, processing executed by the memory writing device 4 and E
The processing executed by the microcomputers 18 and 26 of the CU 2 will be described with reference to the flowcharts of FIGS.
FIG. 4 is a flowchart showing the processing executed by the memory writing device 4. FIG. 5 shows both microcomputers 1.
8 is a flowchart showing processing executed in each of steps 8 and 26, and includes steps (hereinafter simply referred to as “S”) 20
The processes of 0 to S260 are executed by the boot program in the mask ROM 44, and the process of S270 is executed by the control program in the flash memory 42. FIG. 6 is a flowchart showing a sub-microcomputer monitoring process executed by the main microcomputer 18 to monitor the operation of the sub-microcomputer 26 by using a monitoring process program included in the control program in the flash memory 42. is there.

【0060】まず、メモリ書込装置4では、作業者によ
りECU2に接続された後に前述した起動スイッチがオ
ンされると、内部に備えたマイクロコンピュータが図4
に示す処理の実行を開始する。尚、メインマイコン18
のフラッシュメモリ42にデータを新規に書き込む場合
或いは既に格納されたデータを書き換える場合には、予
め、前記選択スイッチによりメインマイコン18がデー
タの書き込み対象として選択されていると共に、前記記
憶媒体には、メインマイコン18の識別コードとそのフ
ラッシュメモリ42に書き込むべき書込データとが格納
されているものとする。また同様に、サブマイコン26
のフラッシュメモリ42にデータを新規に書き込む場合
或いは既に格納されたデータを書き換える場合には、予
め、前記選択スイッチによりサブマイコン26がデータ
の書き込み対象として選択されていると共に、前記記憶
媒体には、サブマイコン26の識別コードとそのフラッ
シュメモリ42に書き込むべき書込データとが格納され
ているものとする。
First, in the memory writing device 4, when the above-mentioned start switch is turned on after being connected to the ECU 2 by an operator, the microcomputer provided therein becomes
The execution of the processing shown in FIG. The main microcomputer 18
When newly writing data to the flash memory 42 or rewriting already stored data, the main microcomputer 18 is previously selected as a data writing target by the selection switch, and the storage medium includes: It is assumed that the identification code of the main microcomputer 18 and the write data to be written to the flash memory 42 are stored. Similarly, the sub microcomputer 26
When newly writing data to the flash memory 42 or rewriting already stored data, the sub-microcomputer 26 is previously selected as a data writing target by the selection switch, and the storage medium includes It is assumed that the identification code of the sub-microcomputer 26 and the write data to be written to the flash memory 42 are stored.

【0061】図4に示すように、メモリ書込装置4側で
処理の実行が開始されると、最初のS100にて、前記
選択スイッチによりメインマイコン18がデータの書き
込み対象として選択されている場合には、信号線36a
にハイアクティブの書込許可信号K1を出力し、また、
サブマイコン26がデータの書き込み対象として選択さ
れている場合には、信号線36bにハイアクティブの書
込許可信号K2を出力する。尚、このようにメモリ書込
装置4からECU2へ書込許可信号K1,K2の何れか
一方が出力されることにより、ECU2側の電源回路3
4(書込電圧作成部54)は、両マイコン18,26へ
書込電圧VPPを供給可能な状態となる。
As shown in FIG. 4, when the execution of the processing is started on the memory writing device 4 side, in the first step S100, the main microcomputer 18 is selected as a data writing target by the selection switch. Has a signal line 36a
Outputs a high active write enable signal K1
When the sub-microcomputer 26 is selected as a data write target, it outputs a high active write enable signal K2 to the signal line 36b. When either of the write permission signals K1 and K2 is output from the memory writing device 4 to the ECU 2 as described above, the power supply circuit 3 on the ECU 2 side is output.
4 (write voltage generation unit 54) is in a state where the write voltage VPP can be supplied to both microcomputers 18 and 26.

【0062】そして、続くS110にて、前記記憶媒体
に格納されている識別コードと書込データを読み出し
て、その読み出した識別コードと書込データとをECU
2へシリアル通信ライン30を介して順次送信する。
尚、この送信動作により、ECU2へは、まず、識別コ
ードが送信され、次いで、書込データが送信される。
At S110, the identification code and the write data stored in the storage medium are read, and the read identification code and the write data are read by the ECU.
2 via the serial communication line 30.
In this transmission operation, first, the identification code is transmitted to the ECU 2, and then the write data is transmitted.

【0063】すると、後述するように、上記S110で
送信された書込データは、ECU2側の両マイコン1
8,26のうち、データの書き込み対象である方のフラ
ッシュメモリ42に更新して書き込まれ、その後、EC
U2側からその書き込まれたデータが読み出されて返送
されて来るため、続くS120にて、ECU2からのデ
ータを受信し、更に続くS130にて、前記記憶媒体に
格納されている書込データと、上記S120で受信した
ECU2からのデータとをベリファイ(比較)する。
Then, as described later, the write data transmitted in S110 is stored in both microcomputers 1 on the ECU 2 side.
8 and 26, the data is updated and written in the flash memory 42 to which the data is to be written.
Since the written data is read out from the U2 side and returned, the data from the ECU 2 is received in the subsequent S120, and the write data stored in the storage medium is further transmitted in the next S130. The data from the ECU 2 received in S120 is verified (compared).

【0064】そして、続くS140にて、上記S130
のベリファイ結果を判定し、前記記憶媒体に格納されて
いる書込データとECU2からのデータとが一致してい
たならば、データの書き込み対象であるマイコンのフラ
ッシュメモリ42に、上記S110で送信した書込デー
タが正しく書き込まれたと判断して、S150に進む。
そして、このS150にて、上記S110で信号線36
a,36bの何れかに出力していた書込許可信号K1,
K2をロウレベルに戻し、その後、当該処理を終了す
る。
Then, in subsequent S140, the above S130
Is determined, and if the write data stored in the storage medium and the data from the ECU 2 match, the data transmitted in S110 to the flash memory 42 of the microcomputer to which the data is to be written is transmitted. It is determined that the write data has been correctly written, and the process proceeds to S150.
Then, in S150, the signal line 36 is set in S110.
a, 36b output to the write enable signal K1,
K2 is returned to the low level, and the process is thereafter terminated.

【0065】一方、上記S140にて、前記記憶媒体に
格納されている書込データとECU2からのデータとが
一致していないと判定した場合には、S160に移行し
て、データの書き込みに失敗したことを示す警告メッセ
ージを前述の表示部に表示し、その後、当該処理を終了
する。
On the other hand, if it is determined in S140 that the write data stored in the storage medium and the data from the ECU 2 do not match, the flow shifts to S160, and the data write fails. Is displayed on the above-mentioned display unit, and then the process is terminated.

【0066】次に、ECU2側では、イグニッションス
イッチIGSがオンされると、両マイコン18,26の
各々が、前述した電源回路34のリセット制御部58の
働きによりリセット状態から動作を開始して、図5に示
す処理を実行する。即ち、両マイコン18,26の各C
PU40は、最初に、マスクROM44に格納されたブ
ートプログラムの実行を開始し、まずS200にて、電
源回路34から電源ライン38を介して書込電圧VPPが
供給されているか否かを判定する。
Next, on the ECU 2 side, when the ignition switch IGS is turned on, each of the two microcomputers 18 and 26 starts operating from the reset state by the operation of the reset control unit 58 of the power supply circuit 34 described above. The processing shown in FIG. 5 is executed. That is, each C of both microcomputers 18 and 26
The PU 40 first starts executing the boot program stored in the mask ROM 44, and first determines in S200 whether or not the write voltage VPP is supplied from the power supply circuit 34 via the power supply line 38.

【0067】ここで、イグニッションスイッチIGSが
オンされた時点で、当該ECU2にメモリ書込装置4が
接続されており、しかも、前述した図4におけるS10
0の処理によりメモリ書込装置4から書込許可信号K
1,K2の何れかが出力されていれば、電源回路34の
書込電圧作成部54から電源ライン38を介して両マイ
コン18,26に書込電圧VPPが供給されるため、上記
S200にて肯定判定される(書込電圧VPPが供給され
ていると判定される)。
At this point, when the ignition switch IGS is turned on, the memory writing device 4 is connected to the ECU 2 and, at the same time, S10 in FIG.
0, the write enable signal K from the memory writer 4
If either one of K1 and K2 is output, the write voltage VPP is supplied from the write voltage generator 54 of the power supply circuit 34 to the microcomputers 18 and 26 via the power supply line 38. An affirmative determination is made (it is determined that the write voltage VPP is being supplied).

【0068】そこで、S200で肯定判定された場合に
は、次のS210に進んで、前述した図4におけるS1
10の処理によりメモリ書込装置4からシリアル通信ラ
イン30を介して送信されて来る識別コードを受信し、
続くS220にて、その受信した識別コードと、マスク
ROM44に格納されている自分の識別コードとが一致
しているか否かを判定する。
Therefore, if an affirmative determination is made in S200, the process proceeds to the next S210, and the above-described S1 in FIG.
Receiving the identification code transmitted from the memory writing device 4 via the serial communication line 30 by the process of 10;
In subsequent S220, it is determined whether or not the received identification code and the own identification code stored in mask ROM 44 match.

【0069】そして、上記S220にて、両識別コード
が一致していると判定した場合には、通常動作モードで
はない書込モードであると判断して、次のS230に進
む。そして、このS230にて、前述したようにメモリ
書込装置4から上記識別コードに続いて送信されて来る
書込データ(制御プログラムや制御データを構成するデ
ータ)を受信し、その受信した書込データをフラッシュ
メモリ42内に更新して書き込む。そして更に、続くS
240にて、上記S230でフラッシュメモリ42に書
き込んだ全てのデータを読み出して、メモリ書込装置4
へ送信する。
If it is determined in S220 that the two identification codes match, it is determined that the writing mode is not the normal operation mode, and the flow advances to the next S230. Then, in S230, as described above, write data (data constituting a control program or control data) transmitted from the memory writing device 4 following the identification code is received, and the received write data is written. The data is updated and written in the flash memory 42. And further, S
At 240, all the data written to the flash memory 42 at S230 is read, and the
Send to

【0070】すると、このS240でメモリ書込装置4
へ送信されるデータは、前述したように、メモリ書込装
置4側にて、前記記憶媒体に格納されている書込データ
と比較され、両データが一致していれば、ECU2側で
のデータ書き込みが無事終了したと判断されて、当該E
CU2へ出力されていた書込許可信号K1,K2がロウ
レベルに戻る。そして、これに伴い、当該ECU2側で
は、電源回路34の書込電圧作成部54が書込電圧VPP
の供給を停止する。
Then, in S240, the memory writing device 4
As described above, the data transmitted to the ECU 2 is compared with the write data stored in the storage medium on the memory writing device 4 side. It is determined that the writing has been completed successfully,
The write enable signals K1 and K2 output to CU2 return to the low level. Accordingly, on the ECU 2 side, the write voltage generator 54 of the power supply circuit 34 sets the write voltage VPP
Stop supplying.

【0071】そこで、続くS250にて、電源回路34
からの書込電圧VPPの供給が停止されるまで待機し、書
込電圧VPPの供給が停止したと判定すると、フラッシュ
メモリ42にメモリ書込装置4からの書込データを正し
く書き込むことができたと判断して、次のS260に進
む。
Then, at S250, the power supply circuit 34
Waits until the supply of the write voltage VPP from the memory is stopped, and when it is determined that the supply of the write voltage VPP is stopped, it is determined that the write data from the memory writing device 4 has been correctly written in the flash memory 42. Judge, and proceed to the next S260.

【0072】そして、このS260にて、フラッシュメ
モリ42内の制御プログラムへジャンプし、上記S23
0の処理でフラッシュメモリ42に書き込まれた制御プ
ログラムの実行を開始する。これにより、通常時の動作
に移行して、図5のS270に示すように、メインマイ
コン18の場合であれば、エンジンを制御するための制
御処理を行い、また、サブマイコン26の場合であれ
ば、自動変速機を制御するための制御処理を行う。
Then, in S260, the process jumps to the control program in the flash memory 42, and in S23
The execution of the control program written in the flash memory 42 in the process of 0 is started. As a result, the operation shifts to a normal operation, and the control processing for controlling the engine is performed in the case of the main microcomputer 18 as shown in S270 of FIG. For example, a control process for controlling the automatic transmission is performed.

【0073】一方、上記S200にて、書込電圧VPPが
供給されていないと判定した場合には、通常動作モード
であると判断して、上記S210〜S250の処理を実
行することなくS260に進む。つまり、メモリ書込装
置4から当該ECU2へ書込許可信号K1,K2が出力
されていない通常時には、フラッシュメモリ42に既に
書き込まれている制御プログラムの実行を即座に開始す
るのである。
On the other hand, if it is determined in S200 that the write voltage VPP is not supplied, it is determined that the normal operation mode is set, and the process proceeds to S260 without executing the processes in S210 to S250. . That is, in a normal state where the write permission signals K1 and K2 are not output from the memory writing device 4 to the ECU 2, the execution of the control program already written in the flash memory 42 is immediately started.

【0074】また、上記S200にて書込電圧VPPが供
給されていると判定しても、上記S220にて、メモリ
書込装置4からの識別コードと、マスクROM44に格
納されている自分の識別コードとが一致してないと判定
した場合には、データの書き込み対象であるマイコンが
自分ではない(換言すれば、自分以外のマイコンがデー
タの書き込み対象である)と判断して、S280に移行
する。そして、このS280にて、図2に示した3つの
スイッチ素子SW1〜SW3を全て遮断状態(オフ状
態)にし、その後、S260に進む。
Even if it is determined in S200 that the write voltage VPP is supplied, in S220, the identification code from the memory writing device 4 and the identification code stored in the mask ROM 44 are stored. If it is determined that the codes do not match, it is determined that the microcomputer to which the data is to be written is not the user (in other words, the microcomputer other than the user is the data to be written), and the process proceeds to S280. I do. Then, in S280, all three switch elements SW1 to SW3 shown in FIG. 2 are turned off (OFF state), and then the process proceeds to S260.

【0075】つまり、本実施形態のECU2では、2つ
のマイコン18,26が、1つのシリアル通信ライン3
0,32を共用してメモリ書込装置4との間でシリアル
データ通信を行うように構成されているため、自分以外
のマイコンがデータの書き込み中であると判断した場合
には、スイッチ素子SW1,SW2によりシリアル通信
ライン32との電気的接続を自ら遮断して、自己のシリ
アル通信ライン32への通信を強制的に禁止し、その
後、フラッシュメモリ42に既に書き込まれている制御
プログラムの実行を開始するのである。そして、これに
より、データの書き込み中である方のマイコンの受信デ
ータが他方のマイコンの送信データによって破壊されて
しまうことを確実に防止するようにしている。また、ス
イッチ素子SW3により電源ライン38との接続も遮断
するようにしているのは、データの書き込み対象でない
マイコンのフラッシュメモリ42に、誤ってデータが書
き込まれてしまうことを確実に防止するためである。
That is, in the ECU 2 of this embodiment, the two microcomputers 18 and 26 are connected to one serial communication line 3.
0 and 32 are shared to perform serial data communication with the memory writing device 4, so that when a microcomputer other than itself determines that data is being written, the switching element SW1 , SW2 by itself interrupting the electrical connection with the serial communication line 32 to forcibly prohibit communication to its own serial communication line 32, and then execute the control program already written in the flash memory 42. It starts. Thus, it is possible to reliably prevent the reception data of the microcomputer on which data is being written from being destroyed by the transmission data of the other microcomputer. The connection with the power supply line 38 is also cut off by the switch element SW3 in order to reliably prevent data from being erroneously written to the flash memory 42 of the microcomputer to which data is not written. is there.

【0076】ここで、サブマイコン26にて、フラッシ
ュメモリ42に格納された制御プログラムの実行が開始
されると、その後は、前述した信号出力用プログラムが
所定時間TS2(4ms)毎に実行されて、当該サブマイ
コン26からメインマイコン18へ、その時間TS2毎に
信号レベルが反転するWDC信号W2が出力される。
Here, when the sub-microcomputer 26 starts executing the control program stored in the flash memory 42, thereafter, the above-described signal output program is executed at predetermined time intervals TS2 (4 ms). Then, a WDC signal W2 whose signal level is inverted every time TS2 is output from the sub microcomputer 26 to the main microcomputer 18.

【0077】また、メインマイコン18においても、フ
ラッシュメモリ42に格納された制御プログラムの実行
が開始されると、その後は、信号出力用プログラムが所
定時間TS1(4ms)毎に実行されて、当該メインマイ
コン18から電源回路34のウォッチドック検出部56
へ、その時間TS1毎に信号レベルが反転するWDC信号
W1が出力されるのであるが、更に、メインマイコン1
8では、上記信号出力用プログラムと交互に、サブマイ
コン26の動作を監視するための監視処理用プログラム
が実行され、これにより、図6に示すサブマイコン監視
処理が4ms毎に行われる。
When the execution of the control program stored in the flash memory 42 is started in the main microcomputer 18 as well, a signal output program is thereafter executed every predetermined time TS1 (4 ms), and the main From the microcomputer 18 to the watchdog detector 56 of the power supply circuit 34
, A WDC signal W1 whose signal level is inverted every time TS1 is output.
At 8, a monitoring process program for monitoring the operation of the sub-microcomputer 26 is executed alternately with the signal output program, whereby the sub-microcomputer monitoring process shown in FIG. 6 is performed every 4 ms.

【0078】即ち、図6に示すように、このサブマイコ
ン監視処理では、まずS310にて、サブマイコン26
からのWDC信号W2の信号レベルがハイレベル(5
V)とロウレベル(0V)の何れであるかを検出し、今
回検出した信号レベルと前回の当該処理で検出した信号
レベルとが一致しているか否かを判定する。
That is, as shown in FIG. 6, in this sub-microcomputer monitoring process, first in S310, the sub-microcomputer 26
Signal level of the WDC signal W2 from the
V) or low level (0 V), and determines whether the signal level detected this time matches the signal level detected in the previous process.

【0079】ここで、前述したように、サブマイコン2
6からのWDC信号W2は4ms毎にレベル反転するよ
うになっており、また、当該サブマイコン監視処理も4
ms毎に実行されるため、サブマイコン26にて制御プ
ログラムが正常に実行されていれば、今回検出される信
号レベルは前回検出した信号レベルと異なるはずであ
る。
Here, as described above, the sub microcomputer 2
The level of the WDC signal W2 from the node 6 is inverted every 4 ms.
Since the control program is executed every ms, if the control program is normally executed by the sub-microcomputer 26, the signal level detected this time should be different from the signal level detected last time.

【0080】このため、上記S310にて、今回検出し
た信号レベルと前回検出した信号レベルとが一致してい
ないと判定した場合には、サブマイコン26が正常に動
作していると判断して、S320に進み、RAM46の
所定領域に設定されたカウンタ用メモリ(以下、単にカ
ウンタという)の値をクリアする。
Therefore, if it is determined in S310 that the signal level detected this time does not match the signal level detected last time, it is determined that the sub-microcomputer 26 is operating normally. Proceeding to S320, the value of a counter memory (hereinafter simply referred to as a counter) set in a predetermined area of the RAM 46 is cleared.

【0081】これに対し、上記S310にて、今回検出
した信号レベルと前回検出した信号レベルとが一致して
いると判定した場合には、サブマイコン26に異常が発
生している可能性があると判断して、S330に移行
し、上記カウンタの値をインクリメントする。
On the other hand, if it is determined in S310 that the signal level detected this time matches the signal level detected last time, there is a possibility that an abnormality has occurred in the sub-microcomputer 26. The process proceeds to S330, and the value of the counter is incremented.

【0082】そして、S320でカウンタをクリアする
か、或いは、S330でカウンタをインクリメントした
後、S340に進んで、上記S310で今回検出したW
DC信号W2の信号レベルを、次回のS310で参照す
るためにRAM46に記憶し、続くS350にて、上記
カウンタの値が所定値N(本実施形態では22)以上で
あるか否かを判定する。尚、この所定値Nに当該サブマ
イコン監視処理の実行周期を乗じた時間(TS2×N=4
ms×22)が、前述の判定時間TH2である。
Then, after the counter is cleared in S320 or the counter is incremented in S330, the process proceeds to S340, and the W detected this time in S310 is detected.
The signal level of the DC signal W2 is stored in the RAM 46 for reference in the next S310, and in the subsequent S350, it is determined whether or not the value of the counter is equal to or more than a predetermined value N (22 in the present embodiment). . Note that the time obtained by multiplying the predetermined value N by the execution cycle of the sub-microcomputer monitoring process (TS2 × N = 4)
(ms × 22) is the above-described determination time TH2.

【0083】ここで、カウンタの値が所定値N以上でな
ければ(S350:NO)、そのまま当該サブマイコン
監視処理を終了するが、カウンタの値が所定値N以上で
あれば(S350:YES)、サブマイコン26に異常
が発生したと判断して、S360に進み、それ以後に信
号出力用プログラムが実行されるのを禁止して、電源回
路34へ自己のWDC信号W1がレベル反転して出力さ
れるのを停止する。そして、続くS370にて、カウン
タの値をクリアした後、当該サブマイコン監視処理を終
了する。
Here, if the counter value is not equal to or greater than the predetermined value N (S350: NO), the sub-microcomputer monitoring process is terminated as it is, but if the counter value is equal to or greater than the predetermined value N (S350: YES). Then, it is determined that an abnormality has occurred in the sub-microcomputer 26, and the process proceeds to S360, in which the execution of the signal output program is prohibited, and the level of the own WDC signal W1 is inverted and output to the power supply circuit 34. Stop being done. Then, in S370, after the value of the counter is cleared, the sub-microcomputer monitoring process is terminated.

【0084】このような本第1実施形態のECU2にお
いて、両マイコン18,26のフラッシュメモリ42に
格納された制御プログラムが正常に実行されている場合
には、図7(A)に示すように、サブマイコン26から
メインマイコン18へ所定時間TS2(4ms)毎にレベ
ル反転するWDC信号W2が出力され、また、このWD
C信号W2と同様に、メインマイコン18から電源回路
34へ所定時間TS1(4ms)毎にレベル反転するWD
C信号W1が出力される。
In the ECU 2 according to the first embodiment, when the control programs stored in the flash memories 42 of the microcomputers 18 and 26 are normally executed, as shown in FIG. A WDC signal W2 whose level is inverted every predetermined time TS2 (4 ms) is output from the sub-microcomputer 26 to the main microcomputer 18 and the WD
Similarly to the C signal W2, the WD inverts the level from the main microcomputer 18 to the power supply circuit 34 every predetermined time TS1 (4 ms).
C signal W1 is output.

【0085】そして、WDC信号W1がレベル反転する
毎に、電源回路34のウォッチドック検出部56にて、
ウォッチドックカウンタ56aがエッジ検出回路56b
からのパルス信号によりリセットされ、このような動作
が繰り返されることにより、電源回路34のリセット制
御部58から両マイコン18,26へリセット信号R1
が出力されない状態が継続する。
Each time the level of the WDC signal W1 is inverted, the watchdog detector 56 of the power supply circuit 34
The watchdog counter 56a is an edge detection circuit 56b
Is reset by a pulse signal from the power supply circuit and the above operation is repeated.
No output continues.

【0086】これに対し、サブマイコン26に異常が発
生して、図7(B)に示すように、サブマイコン26か
らメインマイコン18へのWDC信号W2のレベル反転
が停止した場合には、メインマイコン18で実行されて
いるサブマイコン監視処理のS350により、所定の判
定時間TH2(=TS2×N=4ms×22)の経過後に肯
定判定されて、同処理のS360により、メインマイコ
ン18から電源回路34へのWDC信号W1のレベル反
転が停止する。すると、電源回路34中のウォッチドッ
クカウンタ56aのカウント値がオーバーフローして、
リセット制御部58から両マイコン18,26へリセッ
ト信号R1が出力される。
On the other hand, when an abnormality occurs in the sub microcomputer 26 and the level inversion of the WDC signal W2 from the sub microcomputer 26 to the main microcomputer 18 is stopped as shown in FIG. In S350 of the sub-microcomputer monitoring process executed by the microcomputer 18, an affirmative determination is made after the lapse of a predetermined determination time TH2 (= TS2 × N = 4ms × 22). The level inversion of the WDC signal W1 to 34 stops. Then, the count value of the watchdog counter 56a in the power supply circuit 34 overflows,
A reset signal R1 is output from the reset control unit 58 to both the microcomputers 18 and 26.

【0087】また、メインマイコン18自体に異常が発
生して、メインマイコン18から電源回路34へのWD
C信号W1のレベル反転が停止した場合にも、上記ウォ
ッチドックカウンタ56aのカウント値がオーバーフロ
ーして、リセット制御部58から両マイコン18,26
へリセット信号R1が出力される。
When an abnormality occurs in the main microcomputer 18 itself, the WD from the main microcomputer 18 to the power supply circuit 34
Even when the level inversion of the C signal W1 is stopped, the count value of the watchdog counter 56a overflows, and the reset control unit 58 sends the two microcomputers 18 and 26.
Reset signal R1 is output.

【0088】このため、両マイコン18,26の何れか
でプログラム暴走が発生したとしても、両マイコン1
8,26は速やかにリセットされて初期状態から動作を
再開することとなり、制御の安全性が確保される。次
に、各マイコン18,26のフラッシュメモリ42に制
御プログラム及び制御データを新規に書き込んだり、或
いは、既に書き込まれている制御プログラム及び制御デ
ータを書き換える場合の動作について、メインマイコン
18のフラッシュメモリ42にエンジン制御用の制御プ
ログラム及び制御データが既に書き込まれている状況下
で、サブマイコン26のフラッシュメモリ42に自動変
速機制御用の制御プログラム及び制御データを新規に書
き込む場合を例に挙げて説明する。
Therefore, even if the program runaway occurs in either of the microcomputers 18 and 26, the microcomputer 1
8 and 26 are immediately reset and the operation is restarted from the initial state, and the safety of control is ensured. Next, the operation of newly writing a control program and control data in the flash memory 42 of each of the microcomputers 18 and 26 or rewriting the already written control program and control data will be described. The case where a control program and control data for automatic transmission control are newly written in the flash memory 42 of the sub-microcomputer 26 in a situation where a control program and control data for engine control have already been written in the sub-microcomputer 26 will be described. .

【0089】この場合、作業者は、まず、メモリ書込装
置4の記憶媒体に、サブマイコン26に対応する「00
10」の識別コードと、サブマイコン26のフラッシュ
メモリ42に書き込むべき書込データとを格納してお
く。そして、メモリ書込装置4をECU2に接続して、
メモリ書込装置4の選択スイッチにより、サブマイコン
26をデータの書き込み対象として選択し、その後、メ
モリ書込装置4の起動スイッチをオンし、更に車両のイ
グニッションスイッチIGSをオンしてECU2を初期
状態から作動させる。
In this case, the operator first stores “00” corresponding to the sub-microcomputer 26 in the storage medium of the memory writing device 4.
The identification code “10” and write data to be written to the flash memory 42 of the sub-microcomputer 26 are stored in advance. Then, the memory writing device 4 is connected to the ECU 2,
The sub-microcomputer 26 is selected as a data writing target by the selection switch of the memory writing device 4, then the start switch of the memory writing device 4 is turned on, and the ignition switch IGS of the vehicle is turned on to reset the ECU 2 to the initial state. Operate from

【0090】すると、メモリ書込装置4からECU2へ
信号線36bを介して書込許可信号K2が出力されるた
め(S100)、イグニッションスイッチIGSのオン
に伴い、ECU2側では、電源回路34の書込電圧作成
部54から両マイコン18,26へ電源ライン38を介
して書込電圧VPPが供給される。また、上記書込電圧作
成部54から書込電圧VPPが出力されている間は、電源
回路34のウォッチドック検出部56にて、ウォッチド
ックカウンタ56aがオア回路56cにより継続してリ
セットされるため、ウォッチドック検出部56及びリセ
ット制御部58の働きによる両マイコン18,26のリ
セットが阻止される。
Then, since write enable signal K2 is output from memory writing device 4 to ECU 2 via signal line 36b (S100), when the ignition switch IGS is turned on, the power supply circuit 34 The write voltage VPP is supplied from the input voltage generator 54 to the microcomputers 18 and 26 via the power supply line 38. While the write voltage VPP is being output from the write voltage generator 54, the watchdog counter 56a is continuously reset by the OR circuit 56c in the watchdog detector 56 of the power supply circuit 34. The resetting of the microcomputers 18 and 26 by the operations of the watchdog detection unit 56 and the reset control unit 58 is prevented.

【0091】そして、メモリ書込装置4からECU2
へ、上記記憶媒体に格納された識別コードと書込データ
とが順次送信され(S110)、ECU2側では、両マ
イコン18,26の各々が、マスクROM44に格納さ
れたブートプログラムの実行により、メモリ書込装置4
からの識別コードを、シリアル通信ライン30、通信回
路28、及びシリアル通信ライン32を介して受信して
(S200:YES,S210)、その受信した識別コ
ードと自分のマスクROM44に格納されている識別コ
ードとを比較する(S220)。
Then, from the memory writing device 4 to the ECU 2
The identification code and the write data stored in the storage medium are sequentially transmitted to the microcomputer (S110). On the ECU 2 side, each of the microcomputers 18 and 26 executes the boot program stored in the mask ROM 44 to execute the boot program. Writing device 4
Is received via the serial communication line 30, the communication circuit 28, and the serial communication line 32 (S200: YES, S210), and the received identification code and the identification stored in its own mask ROM 44 are received. The code is compared with the code (S220).

【0092】すると、メインマイコン18においては、
両識別コードが不一致となり(S220:NO)、スイ
ッチ素子SW1〜SW3が全て遮断状態となって、メイ
ンマイコン18とシリアル通信ライン32及び電源ライ
ン38との電気的接続が遮断され(S280)、その
後、フラッシュメモリ42内の制御プログラムが実行さ
れる(S260)。
Then, in the main microcomputer 18,
If the two identification codes do not match (S220: NO), all of the switch elements SW1 to SW3 are cut off, and the electrical connection between the main microcomputer 18 and the serial communication line 32 and the power supply line 38 is cut off (S280). Then, the control program in the flash memory 42 is executed (S260).

【0093】これに対して、サブマイコン26において
は、両識別コードが一致するため(S220:YE
S)、このサブマイコン26だけが、メモリ書込装置4
からの書込データを受信して、その受信した書込データ
をフラッシュメモリ42に更新して書き込むこととなる
(S230)。
On the other hand, in the sub-microcomputer 26, since both identification codes match (S220: YE
S), only this sub-microcomputer 26 is
Is received, and the received write data is updated and written in the flash memory 42 (S230).

【0094】その後は、サブマイコン26からメモリ書
込装置4へ、シリアル通信ライン32、通信回路28、
及びシリアル通信ライン30を介して、フラッシュメモ
リ42に書き込まれたデータが送信され(S240)、
メモリ書込装置4において、記憶媒体に格納されたマス
ターの書込データとサブマイコン26からのデータとが
ベリファイされる(S130)。そして、そのベリファ
イの結果が良好ならば(S140:YES)、メモリ書
込装置4から出力されていた書込許可信号K2がロウレ
ベルに戻り(S150)、これに伴い、ECU2側で
は、電源回路34から両マイコン18,26への書込電
圧VPPの供給が停止する。
Thereafter, the serial communication line 32, the communication circuit 28,
Then, the data written in the flash memory 42 is transmitted via the serial communication line 30 (S240),
In the memory writing device 4, the master write data stored in the storage medium and the data from the sub-microcomputer 26 are verified (S130). If the result of the verification is good (S140: YES), the write enable signal K2 output from the memory writing device 4 returns to a low level (S150), and accordingly, the power supply circuit 34 on the ECU 2 side. Then, the supply of the write voltage VPP to the microcomputers 18 and 26 is stopped.

【0095】すると、サブマイコン26においても、フ
ラッシュメモリ42に書き込まれた制御プログラムの実
行が開始され(S250:YES,S260)、また、
電源回路34のウォッチドック検出部56においては、
オア回路56cによるウォッチドックカウンタ56aの
継続リセットが解除されて、当該ECU2は、電源回路
34のウォッチドック検出部56及びリセット制御部5
8の働きにより両マイコン18,26をリセット可能な
状態、即ち各マイコン18,26の動作を監視可能な通
常状態に復帰する。
Then, the sub-microcomputer 26 also starts executing the control program written in the flash memory 42 (S250: YES, S260).
In the watchdog detector 56 of the power supply circuit 34,
The continuous reset of the watchdog counter 56a by the OR circuit 56c is released, and the ECU 2 operates the watchdog detector 56 and the reset controller 5 of the power supply circuit 34.
The operation of 8 returns the microcomputers 18 and 26 to a resettable state, that is, a normal state in which the operations of the microcomputers 18 and 26 can be monitored.

【0096】そして、この状態で、サブマイコン26に
対する制御プログラム及び制御データの新規書き込みが
終了する。尚、サブマイコン26のフラッシュメモリ4
2に既に書き込まれている制御プログラム及び制御デー
タを書き換える場合についても、前述した新規書き込み
の場合と全く同様である。また、メインマイコン18の
フラッシュメモリ42に制御プログラム及び制御データ
を新規に書き込んだり、或いは、既に書き込まれている
制御プログラム及び制御データを書き換える場合には、
メモリ書込装置4の記憶媒体に、メインマイコン18に
対応する「0001」の識別コードと、メインマイコン
18のフラッシュメモリ42に書き込むべき書込データ
とを格納しておくと共に、メモリ書込装置4の選択スイ
ッチにより、メインマイコン18をデータの書き込み対
象として選択すれば良い。
Then, in this state, the new writing of the control program and control data to the sub-microcomputer 26 is completed. The flash memory 4 of the sub-microcomputer 26
The case of rewriting the control program and the control data already written in 2 is exactly the same as the case of the new writing described above. When writing a new control program and control data into the flash memory 42 of the main microcomputer 18 or rewriting a previously written control program and control data,
The storage medium of the memory writing device 4 stores an identification code of “0001” corresponding to the main microcomputer 18 and write data to be written to the flash memory 42 of the main microcomputer 18, and , The main microcomputer 18 may be selected as a data write target.

【0097】一方、本第1実施形態では、メインマイコ
ン18が第1のマイクロコンピュータに相当しており、
サブマイコン26が第2のマイクロコンピュータに相当
している。そして、ウォッチドック検出部56のオア回
路56cが、監視動作阻止手段或いは阻止手段に相当し
ている。また、電源回路34のウォッチドック検出部5
6とリセット制御部58が、システム監視手段に相当し
ており、ウォッチドック検出部56のウォッチドックカ
ウンタ56aが、カウンタに相当し、リセット制御部5
8が、リセット信号出力手段に相当している。
On the other hand, in the first embodiment, the main microcomputer 18 corresponds to the first microcomputer,
The sub-microcomputer 26 corresponds to a second microcomputer. The OR circuit 56c of the watchdog detection unit 56 corresponds to a monitoring operation inhibiting unit or an inhibiting unit. The watchdog detection unit 5 of the power supply circuit 34
6 and the reset control unit 58 correspond to the system monitoring means, the watchdog counter 56a of the watchdog detection unit 56 corresponds to the counter, and the reset control unit 5
Reference numeral 8 corresponds to a reset signal output unit.

【0098】以上詳述したように本第1実施形態のEC
U2では、メインマイコン18がフラッシュメモリ42
内の制御プログラムを実行することで、サブマイコン2
6にてフラッシュメモリ42内の制御プログラムが正常
に実行されているか否かを監視し、サブマイコン26の
異常を検出すると、サブマイコン26をリセットさせる
ために、自らが電源回路34のウォッチドック検出部5
6へ出力しているWDC信号W1のレベル反転を停止さ
せるのであるが、特に、マイコン18,26に書込電圧
VPPが供給されている時には、ウォッチドック検出部5
6のオア回路56cがウォッチドックカウンタ56aの
アップカウント動作を強制的に停止させて、マイコン1
8,26にリセット信号R1が出力されないようにして
いる。
As described in detail above, the EC of the first embodiment is
In U2, the main microcomputer 18 is connected to the flash memory 42
By executing the control program in the sub microcomputer 2
In step 6, the control program monitors whether or not the control program in the flash memory 42 is normally executed. If an abnormality is detected in the sub-microcomputer 26, the sub-microcomputer 26 resets itself to detect the watchdog of the power supply circuit 34. Part 5
6, the level inversion of the WDC signal W1 output to the microcomputer 6 is stopped.
6, the OR circuit 56c forcibly stops the up-counting operation of the watchdog counter 56a.
The reset signal R1 is not output to the signal lines 8 and 26.

【0099】このため、サブマイコン26がフラッシュ
メモリ42にデータを書き込むための書込処理を(S2
10〜S250)を行っている間は、メインマイコン1
8の上記監視動作によってサブマイコン26がリセット
されてしまうことが阻止される。
For this reason, the sub-microcomputer 26 performs a writing process for writing data to the flash memory 42 (S2
10 to S250), the main microcomputer 1
The monitoring operation 8 prevents the sub-microcomputer 26 from being reset.

【0100】よって、当該ECU2の製造工程におい
て、各マイコン18,26を実装してから、最初に、メ
インマイコン18のフラッシュメモリ42に制御プログ
ラム及び制御データを新規に書き込み、その後に、監視
される側のサブマイコン26のフラッシュメモリ42に
制御プログラム及び制御データを新規に書き込む、とい
った書き込み順序を採った場合にも、書込処理を行って
いる最中のサブマイコン26が、監視する側のメインマ
イコン18の動作によってリセットされてしまうことが
防止される。
Therefore, in the manufacturing process of the ECU 2, after the microcomputers 18 and 26 are mounted, first, a control program and control data are newly written in the flash memory 42 of the main microcomputer 18 and thereafter monitored. In the case where the writing order such that the control program and the control data are newly written in the flash memory 42 of the sub-microcomputer 26 on the side is adopted, the sub-microcomputer 26 during the writing process is also Reset by the operation of the microcomputer 18 is prevented.

【0101】従って、本第1実施形態のECU2によれ
ば、両マイコン18,26の各々について、如何なる順
序で制御プログラムなどを書き込むようにしても、その
書き込みを確実に行うことができ、監視される側のサブ
マイコン26よりも先に、監視する側のメインマイコン
18に制御プログラムを書き込まなければならない制約
があっても、監視される側のサブマイコン26に制御プ
ログラム及び制御データを確実に書き込むことができ
る。この結果、メインマイコン18がサブマイコン26
の動作を監視することと、各マイコン18,26の各々
について制御プログラムのオンボード書き込みを可能に
することとを、確実に両立させることができる。
Therefore, according to the ECU 2 of the first embodiment, even if the control program and the like are written in each of the two microcomputers 18 and 26 in any order, the writing can be reliably performed and monitored. Even if there is a restriction that the control program must be written in the monitoring main microcomputer 18 before the monitoring sub microcomputer 26, the control program and the control data are surely written in the monitored sub microcomputer 26. be able to. As a result, the main microcomputer 18 becomes
Monitoring of the operation and enabling the on-board writing of the control program for each of the microcomputers 18 and 26 can be reliably achieved at the same time.

【0102】また、本第1実施形態のECU2では、メ
インマイコン18からのWDC信号W1のレベル反転が
停止すると、電源回路34内のウォッチドック検出部5
6及びリセット制御部58により、両マイコン18,2
6へリセット信号R1が出力されるようになっている。
Also, in the ECU 2 of the first embodiment, when the level inversion of the WDC signal W1 from the main microcomputer 18 is stopped, the watchdog detection unit 5 in the power supply circuit 34
6 and the reset controller 58, the microcomputers 18, 2
6, a reset signal R1 is output.

【0103】よって、両マイコン18,26の通常時に
おける異常を、ウォッチドック検出部56及びリセット
制御部58からなる1組のハードウェア回路によって検
出及び回避することができ、両マイコン18,26の動
作を監視することと、各マイコン18,26のフラッシ
ュメモリ42に格納された制御プログラムや制御データ
を書き換えることとを、簡単な構成で確実に両立させる
ことができる。
Therefore, an abnormality in the microcomputers 18 and 26 during normal operation can be detected and avoided by a set of hardware circuits including the watchdog detector 56 and the reset controller 58. Monitoring of the operation and rewriting of the control program and control data stored in the flash memory 42 of each of the microcomputers 18 and 26 can be reliably achieved with a simple configuration.

【0104】尚、上記第1実施形態では、ウォッチドッ
クカウンタ56aのアップカウント動作を強制的に停止
させて両マイコン18,26がリセットされるのを阻止
するようにしたが、リセット制御部58から両マイコン
18,26へ至るリセット信号R1の信号ラインに、ス
イッチング素子や論理回路素子を設け、その素子によっ
て、書込電圧作成部54から書込電圧VPPが出力されて
いる時にその信号ラインを遮断したりロウレベル(パッ
シブレベル)に保持させるように構成しても良い。
In the first embodiment, the up-counting operation of the watchdog counter 56a is forcibly stopped to prevent the microcomputers 18 and 26 from being reset. A switching element or a logic circuit element is provided on the signal line of the reset signal R1 reaching the microcomputers 18 and 26, and the signal line is cut off by the element when the write voltage VPP is output from the write voltage generator 54. Alternatively, it may be configured to hold the data at a low level (passive level).

【0105】[第2実施形態]次に、第2実施形態のメ
モリ書換システムでは、ECUが、前述した第1実施形
態のECU2に対して、下記の(1),(2)の点で異
なっている。尚、メモリ書込装置4は、第1実施形態の
ものと同じである。また、本第2実施形態において、第
1実施形態のものと同じ部材については、同一の符号を
付しているため、詳しい説明は省略する。
[Second Embodiment] Next, in the memory rewriting system of the second embodiment, the ECU differs from the ECU 2 of the first embodiment in the following points (1) and (2). ing. Note that the memory writing device 4 is the same as that of the first embodiment. Further, in the second embodiment, the same members as those of the first embodiment are denoted by the same reference numerals, and detailed description thereof will be omitted.

【0106】(1)まず、図8に示すように、第2実施
形態のECU62では、メインマイコン18が、サブマ
イコン26からのWDC信号W2が前述した判定時間T
H2以内にレベル反転しない場合に、自己のWDC信号W
1のレベル反転出力を停止するのではなく、サブマイコ
ン26をリセットするためのハイアクティブのリセット
信号R2aを出力する。
(1) First, as shown in FIG. 8, in the ECU 62 of the second embodiment, the main microcomputer 18 determines whether or not the WDC signal W2 from the sub-
When the level is not inverted within H2, the own WDC signal W
Instead of stopping the level inversion output of No. 1, it outputs a high active reset signal R2a for resetting the sub-microcomputer 26.

【0107】このため、メインマイコン18にて監視処
理用プログラムの実行により行われるサブマイコン監視
処理では、図10に示すように、図6に示した処理に対
して、S300とS375の処理が追加されていると共
に、図6のS360に代えてS365の処理が行われ
る。
For this reason, in the sub-microcomputer monitoring process performed by executing the monitoring program in the main microcomputer 18, as shown in FIG. 10, the processes of S300 and S375 are added to the process shown in FIG. In addition, the processing of S365 is performed instead of S360 of FIG.

【0108】即ち、第2実施形態のサブマイコン監視処
理では、まずS300にて、サブマイコン26をリセッ
トしている最中であるか否か、即ち上記リセット信号R
2aを現在出力しているか否かを判定する。そして、リ
セット信号R2aを出力していれば、S375に移行し
て、サブマイコン26のリセットを解除するべく、リセ
ット信号R2aの出力を停止して(ロウレベルに戻し
て)、その後、当該サブマイコン監視処理を終了する。
That is, in the sub-microcomputer monitoring process of the second embodiment, first, in S300, it is determined whether or not the sub-microcomputer 26 is being reset, that is, the reset signal R
It is determined whether or not 2a is currently output. If the reset signal R2a has been output, the flow shifts to S375, in which the output of the reset signal R2a is stopped (returned to a low level) in order to release the reset of the sub-microcomputer 26, and thereafter, the sub-microcomputer monitoring is performed. The process ends.

【0109】また、上記S300でリセット信号R2a
を出力していないと判定した場合には、第1実施形態の
場合と同様にS310〜S350の処理を実行する。そ
して、S350にてカウンタの値が所定値N以上である
と判定した場合には、サブマイコン26に異常が発生し
たと判断して、S365に進み、サブマイコン26をリ
セットするべく上記リセット信号R2aを出力し(ハイ
レベルにし)、続くS370でカウンタをクリアしてか
ら当該サブマイコン監視処理を終了する。
Further, the reset signal R2a is obtained in S300.
If it is determined that is not output, the processes of S310 to S350 are executed as in the case of the first embodiment. If it is determined in S350 that the value of the counter is equal to or more than the predetermined value N, it is determined that an abnormality has occurred in the sub-microcomputer 26, and the flow advances to S365 to reset the reset signal R2a to reset the sub-microcomputer 26. (To high level), the counter is cleared in the subsequent S370, and the sub-microcomputer monitoring process ends.

【0110】そして、メインマイコン18は、このよう
なサブマイコン監視処理により、サブマイコン26から
のWDC信号W2が判定時間TH2以内にレベル反転しな
かった場合に、当該処理の実行周期に相当する時間(4
ms)だけリセット信号R2aをハイレベルで出力する
ようにしている。
When the level of the WDC signal W2 from the sub-microcomputer 26 is not inverted within the determination time TH2 by the sub-microcomputer monitoring process, the main microcomputer 18 performs the time corresponding to the execution cycle of the process. (4
ms), the reset signal R2a is output at the high level.

【0111】(2)次に、図8に示すように、本第2実
施形態のECU62では、第1実施形態の電源回路34
に代わる電源回路74を備えており、メインマイコン1
8から出力される上記リセット信号R2aは、この電源
回路74を経由して、リセット信号R2bとしてサブマ
イコン26に入力されるようになっている。
(2) Next, as shown in FIG. 8, the ECU 62 according to the second embodiment includes a power supply circuit 34 according to the first embodiment.
Power supply circuit 74 in place of the main microcomputer 1
The reset signal R2a output from 8 is input to the sub-microcomputer 26 as the reset signal R2b via the power supply circuit 74.

【0112】そして、このことに伴い、電源回路74
は、図9に示すように、第1実施形態の電源回路34に
対して、サブマイコンリセット制御部78を追加して備
えている。この追加されたサブマイコンリセット制御部
78は、メインマイコン18からのリセット信号R2a
と書込電圧作成部54からの書込電圧VPPとを入力し
て、書込電圧作成部54から書込電圧VPPが出力されて
いない時には上記リセット信号R2aをそのままリセッ
ト信号R2bとしてサブマイコン26に出力し、書込電
圧作成部54から書込電圧VPPが出力されている時には
上記リセット信号R2aの信号レベルに拘らずサブマイ
コン26へのリセット信号R2bをロウレベル(パッシ
ブレベル)に保持するアンド回路78aによって構成さ
れている。
The power supply circuit 74
Has a sub-microcomputer reset control unit 78 added to the power supply circuit 34 of the first embodiment, as shown in FIG. The added sub-microcomputer reset control unit 78 outputs a reset signal R2a from the main microcomputer 18.
And the write voltage VPP from the write voltage generator 54, and when the write voltage VPP is not output from the write voltage generator 54, the reset signal R2a is directly used as the reset signal R2b by the sub-microcomputer 26. When the write voltage VPP is output from the write voltage generator 54, the AND circuit 78a holds the reset signal R2b to the sub-microcomputer 26 at a low level (passive level) irrespective of the signal level of the reset signal R2a. It is constituted by.

【0113】よって、書込電圧作成部54から書込電圧
VPPが出力されていない場合には、メインマイコン18
からハイレベルのリセット信号R2aが出力された時
に、サブマイコン26がリセット信号R2bによりリセ
ットされるが、書込電圧作成部54から書込電圧VPPが
出力されている場合には、アンド回路78aによりサブ
マイコン26へのリセット信号R2bがロウレベルに保
持されるため(換言すれば、メインマイコン18から出
力されたリセット信号R2aがサブマイコン26に入力
されることが阻止されるため)、メインマイコン18に
よるサブマイコン26のリセットが阻止される。
Therefore, when the write voltage VPP is not output from the write voltage generator 54, the main microcomputer 18
When the high-level reset signal R2a is output from the sub-microcomputer 26, the sub-microcomputer 26 is reset by the reset signal R2b. When the write voltage VPP is output from the write voltage generator 54, the AND circuit 78a Since the reset signal R2b to the sub-microcomputer 26 is held at low level (in other words, the reset signal R2a output from the main microcomputer 18 is prevented from being input to the sub-microcomputer 26), The reset of the sub-microcomputer 26 is prevented.

【0114】尚、上記アンド回路78aは、リセット制
御部58と同様に、イグニッションスイッチIGSがオ
ンされてマイコン18,26の動作電圧VOMが立ち上が
った時に、サブマイコン26へのリセット信号R2bを
ハイレベルにしてサブマイコン26を初期状態から動作
させる機能も備えている。
The AND circuit 78a, like the reset control unit 58, sets the reset signal R2b to the sub-microcomputer 26 to high level when the ignition switch IGS is turned on and the operating voltage VOM of the microcomputers 18 and 26 rises. A function to operate the sub-microcomputer 26 from the initial state is also provided.

【0115】つまり、本第2実施形態のECU62で
は、メインマイコン18に異常が発生した場合には、電
源回路74のウォッチドック検出部56及びリセット制
御部58によりメインマイコン18だけがリセットさ
れ、サブマイコン26に異常が発生した場合には、メイ
ンマイコン18によりサブマイコン26だけがリセット
されるようにしている。そして、サブマイコンリセット
制御部78を成すアンド回路78aが、書込電圧作成部
54から書込電圧VPPが出力されている時に、メインマ
イコン18から出力されたリセット信号R2aがサブマ
イコン26に入力されるのを阻止する、監視動作阻止手
段としての役割を果たしている。
That is, in the ECU 62 of the second embodiment, when an abnormality occurs in the main microcomputer 18, only the main microcomputer 18 is reset by the watchdog detection unit 56 and the reset control unit 58 of the power supply circuit 74, and When an abnormality occurs in the microcomputer 26, only the sub-microcomputer 26 is reset by the main microcomputer 18. Then, when the AND circuit 78a forming the sub-microcomputer reset control unit 78 outputs the write voltage VPP from the write voltage generation unit 54, the reset signal R2a output from the main microcomputer 18 is input to the sub-microcomputer 26. Function as a means for preventing monitoring operation.

【0116】よって、このような本第2実施形態のEC
U62によっても、サブマイコン26がフラッシュメモ
リ42にデータを書き込むための書込処理を行っている
間は、メインマイコン18の監視動作によってサブマイ
コン26がリセットされてしまうことが阻止される。
Therefore, the EC according to the second embodiment is used.
U62 also prevents the sub-microcomputer 26 from being reset by the monitoring operation of the main microcomputer 18 while the sub-microcomputer 26 is performing the writing process for writing data to the flash memory 42.

【0117】従って、この第2実施形態のECU62に
よっても、各マイコン18,26を実装してから、最初
に、メインマイコン18のフラッシュメモリ42に制御
プログラム及び制御データを新規に書き込み、その後
に、監視される側のサブマイコン26のフラッシュメモ
リ42に制御プログラム及び制御データを新規に書き込
む、といった書き込み順序を採った場合に、書込処理を
行っている最中のサブマイコン26が、監視する側のメ
インマイコン18の動作によってリセットされてしまう
ことが無く、メインマイコン18がサブマイコン26の
動作を監視することと、各マイコン18,26の各々に
ついて制御プログラムのオンボード書き込みを可能にす
ることとを、確実に両立させることができる。
Accordingly, also by the ECU 62 of the second embodiment, after the microcomputers 18 and 26 are mounted, first, a control program and control data are newly written in the flash memory 42 of the main microcomputer 18, and thereafter, When a write order such as newly writing a control program and control data to the flash memory 42 of the monitored sub-microcomputer 26 is adopted, the sub-microcomputer 26 during the writing process is The main microcomputer 18 monitors the operation of the sub-microcomputer 26 without being reset by the operation of the main microcomputer 18, and enables the on-board writing of the control program for each of the microcomputers 18 and 26. Can be reliably achieved.

【0118】[第3実施形態]次に、第3実施形態のメ
モリ書換システムでは、ECUが、前述した第2実施形
態のECU62に対して、下記の点で異なっている。
尚、本第3実施形態において、第1及び第2実施形態の
ものと同じ部材については、同一の符号を付しているた
め、詳しい説明は省略する。
[Third Embodiment] Next, in the memory rewriting system of the third embodiment, the ECU differs from the ECU 62 of the second embodiment in the following points.
Note that, in the third embodiment, the same members as those in the first and second embodiments are denoted by the same reference numerals, and a detailed description thereof will be omitted.

【0119】即ち、前述した第2実施形態のECU62
は、第1実施形態の電源回路34にアンド回路78aを
追加した電源回路74を備えていたが(換言すれば、ア
ンド回路78aが電源回路74の内部に設けられていた
が)、図11に示すように、本第3実施形態のECU8
2では、アンド回路78aが電源回路34の外部に設け
られている。
That is, the ECU 62 of the second embodiment described above.
Has a power supply circuit 74 in which an AND circuit 78a is added to the power supply circuit 34 of the first embodiment (in other words, although the AND circuit 78a is provided inside the power supply circuit 74), FIG. As shown, the ECU 8 of the third embodiment
In 2, the AND circuit 78a is provided outside the power supply circuit 34.

【0120】そして、この第3実施形態のECU82に
よっても、第2実施形態と全く同様の効果を得ることが
できる。また、このようなECU82によれば、仕様変
更や車種の違いなどによりマイクロコンピュータが3つ
以上になっても、アンド回路78aと同様の回路を追加
するだけで対応でき、電源回路34を変更する必要がな
いという点で有利な面もある。
The same effects as those of the second embodiment can be obtained by the ECU 82 of the third embodiment. Further, according to such an ECU 82, even if the number of microcomputers becomes three or more due to a change in specifications or a difference in vehicle type, it can be dealt with only by adding a circuit similar to the AND circuit 78a, and the power supply circuit 34 is changed. There is also an advantage in that it is not necessary.

【0121】[その他]ところで、第2及び第3実施形
態では、メインマイコン18から出力されたリセット信
号R2aがサブマイコン26に入力されるのを、アンド
回路78aによって阻止するようにしたが、メインマイ
コン18が、サブマイコン26にて書込処理が実行され
ていることを検出して、サブマイコン26に対するリセ
ット信号の出力を止めるようにしても良い。
[Others] In the second and third embodiments, the reset circuit R2a output from the main microcomputer 18 is prevented from being input to the sub-microcomputer 26 by the AND circuit 78a. The microcomputer 18 may detect that the writing process is being executed by the sub-microcomputer 26 and stop outputting the reset signal to the sub-microcomputer 26.

【0122】具体的には、図12に示すように、メイン
マイコン18は、ブートプログラムのS220で、メモ
リ書込装置4からの識別コードと自分の識別コードとが
一致してないと判定した場合には、S280でスイッチ
素子SW1〜SW3を遮断状態にした後、追加のS29
0にて、サブマイコン26がデータの書き込み中である
ことを示すフラグをセットし、そのフラグを図10のサ
ブマイコン監視処理で参照して、該フラグがセットされ
ていたならば、サブマイコン26に対するリセット信号
R2aの出力を禁止するようにすれば良い。
More specifically, as shown in FIG. 12, when the main microcomputer 18 determines in S220 of the boot program that the identification code from the memory writing device 4 does not match its own identification code. After turning off the switch elements SW1 to SW3 in S280, additional S29
At 0, a flag indicating that the sub-microcomputer 26 is writing data is set, and the flag is referred to in the sub-microcomputer monitoring process of FIG. 10, and if the flag is set, the sub-microcomputer 26 , The output of the reset signal R2a may be inhibited.

【0123】尚、この出力禁止状態は、イグニッション
スイッチIGSが再度オフからオンされて、当該メイン
マイコン18が初期状態から動作を開始した時に解除さ
れるようにすれば良い。つまり、このようにすれば、サ
ブマイコン26のデータ書き込みが完了した後にイグニ
ッションスイッチIGSを再度オンすることで、サブマ
イコン26の動作を監視可能な通常状態に復帰すること
ができる。
The output inhibition state may be released when the ignition switch IGS is turned on again from off and the main microcomputer 18 starts operating from the initial state. That is, in this way, by turning on the ignition switch IGS again after the data writing of the sub-microcomputer 26 is completed, it is possible to return to the normal state in which the operation of the sub-microcomputer 26 can be monitored.

【0124】一方、上記各実施形態において、各マイコ
ン18,26は、電気的にデータの書き換えが可能な不
揮発性メモリとして、フラッシュメモリ(フラッシュE
EPROM)42を有するものであったが、EEPRO
Mや他のメモリを有するものでも良い。
On the other hand, in each of the above embodiments, each of the microcomputers 18 and 26 has a flash memory (flash E) as an electrically rewritable nonvolatile memory.
EPROM) 42, but EEPROM
It may have M or another memory.

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

【図1】 第1実施形態の電子制御装置のメモリ書換シ
ステムの全体構成を表すブロック図である。
FIG. 1 is a block diagram illustrating an overall configuration of a memory rewriting system of an electronic control device according to a first embodiment.

【図2】 図1のメインマイコン及びサブマイコンの内
部構成を表す概略構成図である。
FIG. 2 is a schematic configuration diagram illustrating an internal configuration of a main microcomputer and a sub-microcomputer of FIG. 1;

【図3】 図1の電源回路の構成を表す概略構成図であ
る。
FIG. 3 is a schematic configuration diagram illustrating a configuration of a power supply circuit of FIG. 1;

【図4】 第1実施形態のメモリ書込装置で実行される
処理を表すフローチャートである。
FIG. 4 is a flowchart illustrating a process executed by the memory writing device according to the first embodiment.

【図5】 第1実施形態のメインマイコン及びサブマイ
コンで実行される処理を表すフローチャートである。
FIG. 5 is a flowchart illustrating processing executed by a main microcomputer and a sub microcomputer according to the first embodiment.

【図6】 第1実施形態のメインマイコンで実行される
サブマイコン監視処理を表すフローチャートである。
FIG. 6 is a flowchart illustrating a sub-microcomputer monitoring process executed by the main microcomputer of the first embodiment.

【図7】 図6のサブマイコン監視処理の作用を説明す
るタイムチャートである。
FIG. 7 is a time chart for explaining the operation of the sub-microcomputer monitoring process of FIG. 6;

【図8】 第2実施形態の電子制御装置のメモリ書換シ
ステムの全体構成を表すブロック図である。
FIG. 8 is a block diagram illustrating an overall configuration of a memory rewriting system of an electronic control device according to a second embodiment.

【図9】 図8の電源回路の構成を表す概略構成図であ
る。
9 is a schematic configuration diagram illustrating a configuration of a power supply circuit of FIG.

【図10】 第2実施形態のメインマイコンで実行され
るサブマイコン監視処理を表すフローチャートである。
FIG. 10 is a flowchart illustrating a sub-microcomputer monitoring process executed by the main microcomputer of the second embodiment.

【図11】 第3実施形態の電子制御装置のメモリ書換
システムの全体構成を表すブロック図である。
FIG. 11 is a block diagram illustrating an overall configuration of a memory rewriting system of an electronic control device according to a third embodiment.

【図12】 他の実施形態を説明するフローチャートで
ある。
FIG. 12 is a flowchart illustrating another embodiment.

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

2,62,82…電子制御装置(ECU) 4…メモ
リ書込装置 8…センサ 10…波形整形回路 12…アナログ
センサ 14…入力回路 16…A/D変換器 18…メイ
ンマイコン 20a,20b…出力回路 22a,22b…アクチ
ュエータ 24…DMA通信ライン 26…サブマイコン 2
8…通信回路 30,32,32a,32b…シリアル通信ライン 34,74…電源回路 36a,36b…信号線 38…電源ライン 40…CPU 42…フラッシ
ュメモリ 44…マスクROM 46…RAM SW1〜SW
3…スイッチ素子 50…メイン電源作成部 52…サブ電源作成部
54…書込電圧作成部 56…ウォッチドック検出部 56a…ウォッチドッ
クカウンタ 56b…エッジ検出回路 56c…オア回路 58
…リセット制御部 60…低電圧検出部 78…サブマイコンリセット制
御部 78a…アンド回路 BT…バッテリ IGS…イ
グニッションスイッチ
2, 62, 82 Electronic control unit (ECU) 4 Memory writing device 8 Sensor 10 Waveform shaping circuit 12 Analog sensor 14 Input circuit 16 A / D converter 18 Main microcomputer 20a, 20b Output Circuits 22a, 22b Actuator 24 DMA communication line 26 Sub-microcomputer 2
8 Communication circuit 30, 32, 32a, 32b Serial communication line 34, 74 Power supply circuit 36a, 36b Signal line 38 Power supply line 40 CPU 42 Flash memory 44 Mask ROM 46 RAM SW1 to SW
3 switch element 50 main power generator 52 sub power generator
54: writing voltage generating unit 56: watchdog detecting unit 56a: watchdog counter 56b: edge detecting circuit 56c: OR circuit 58
... Reset control unit 60 ... Low voltage detection unit 78 ... Sub-microcomputer reset control unit 78a ... AND circuit BT ... Battery IGS ... Ignition switch

Claims (8)

【特許請求の範囲】[Claims] 【請求項1】 電気的にデータの書き換えが可能な不揮
発性メモリを有すると共に、通常時には、前記不揮発性
メモリに格納されたデータにより構成される第1の制御
プログラムを実行することで制御対象を制御し、予め定
められた書き換え条件が成立した場合には、外部から送
信されて来る書込データを前記不揮発性メモリに更新し
て書き込むための書込処理を行う第1のマイクロコンピ
ュータと、 電気的にデータの書き換えが可能な不揮発性メモリを有
すると共に、通常時には、前記不揮発性メモリに格納さ
れたデータにより構成される第2の制御プログラムを実
行することで制御対象を制御し、予め定められた書き換
え条件が成立した場合には、外部から送信されて来る書
込データを前記不揮発性メモリに更新して書き込むため
の書込処理を行う第2のマイクロコンピュータとを備
え、 前記第1のマイクロコンピュータが、前記第1の制御プ
ログラムの実行に伴い、前記第2のマイクロコンピュー
タにて前記第2の制御プログラムが正常に実行されてい
るか否かを監視して、該第2の制御プログラムの実行に
異常が発生したと判断すると前記第2のマイクロコンピ
ュータをリセットするための動作を行うように構成され
た電子制御装置であって、 前記第2のマイクロコンピュータが前記書込処理を行っ
ている間は、前記第1のマイクロコンピュータの動作に
よって前記第2のマイクロコンピュータがリセットされ
るのを阻止する監視動作阻止手段を備えたこと、 を特徴とする電子制御装置。
1. A nonvolatile memory having electrically rewritable non-volatile memory, and in a normal state, a control target is executed by executing a first control program including data stored in the non-volatile memory. A first microcomputer that performs a write process for controlling and writing externally transmitted write data to the non-volatile memory when a predetermined rewrite condition is satisfied; In addition to a non-volatile memory in which data can be rewritten in a non-volatile manner, a control target is controlled by executing a second control program composed of data stored in the non-volatile memory in a normal state. If the rewriting condition is satisfied, a write operation for updating and writing the externally transmitted write data to the nonvolatile memory is performed. A first microcomputer that executes the first control program, and the second microcomputer executes the second control program normally in response to the execution of the first control program. An electronic control device configured to monitor whether or not the second microcomputer has been executed and to perform an operation for resetting the second microcomputer when it is determined that an abnormality has occurred in the execution of the second control program. Monitoring operation preventing means for preventing the second microcomputer from being reset by the operation of the first microcomputer while the second microcomputer is performing the writing process; An electronic control unit characterized by the following.
【請求項2】 請求項1に記載の電子制御装置におい
て、 前記第2のマイクロコンピュータは、少なくとも所定の
書込電圧が供給されることを条件として、前記書込処理
を行うように構成されており、 前記監視動作阻止手段は、前記第2のマイクロコンピュ
ータに前記書込電圧が供給されているか否かを検出し
て、該書込電圧が供給されている時に、前記第1のマイ
クロコンピュータの動作によって前記第2のマイクロコ
ンピュータがリセットされるのを阻止すること、 を特徴とする電子制御装置。
2. The electronic control device according to claim 1, wherein the second microcomputer is configured to perform the write processing on condition that at least a predetermined write voltage is supplied. The monitoring operation preventing means detects whether or not the write voltage is supplied to the second microcomputer, and when the write voltage is supplied, the monitoring operation inhibiting means detects the write voltage of the first microcomputer. Preventing the operation of the second microcomputer from being reset by an operation.
【請求項3】 請求項1又は請求項2に記載の電子制御
装置において、 前記第1のマイクロコンピュータは、前記第2の制御プ
ログラムの実行に異常が発生したと判断すると、前記第
2のマイクロコンピュータへ、該第2のマイクロコンピ
ュータをリセットするためのリセット信号を出力し、 前記監視動作阻止手段は、前記第1のマイクロコンピュ
ータから出力された前記リセット信号が前記第2のマイ
クロコンピュータに入力されるのを阻止することで、前
記第2のマイクロコンピュータがリセットされるのを阻
止するように構成されていること、 を特徴とする電子制御装置。
3. The electronic control device according to claim 1, wherein the first microcomputer determines that an abnormality has occurred in the execution of the second control program. A reset signal for resetting the second microcomputer is output to the computer. The monitoring operation preventing means is configured to input the reset signal output from the first microcomputer to the second microcomputer. An electronic control unit, wherein the electronic control unit is configured to prevent the second microcomputer from being reset by preventing the second microcomputer from being reset.
【請求項4】 請求項1ないし請求項3の何れかに記載
の電子制御装置において、 前記第2のマイクロコンピュータの不揮発性メモリに前
記第2の制御プログラムを構成するデータが新規に書き
込まれる前に、前記第1のマイクロコンピュータの不揮
発性メモリに前記第1の制御プログラムを構成するデー
タが書き込まれること、 を特徴とする電子制御装置。
4. The electronic control device according to claim 1, wherein data constituting the second control program is newly written in a nonvolatile memory of the second microcomputer. Wherein the data constituting the first control program is written in a nonvolatile memory of the first microcomputer.
【請求項5】 電気的にデータの書き換えが可能な不揮
発性メモリを有すると共に、通常時には、前記不揮発性
メモリに格納されたデータにより構成される第1の制御
プログラムを実行することで制御対象を制御し、予め定
められた書き換え条件が成立した場合には、外部から送
信されて来る書込データを前記不揮発性メモリに更新し
て書き込むための書込処理を行う第1のマイクロコンピ
ュータと、 電気的にデータの書き換えが可能な不揮発性メモリを有
すると共に、通常時には、前記不揮発性メモリに格納さ
れたデータにより構成される第2の制御プログラムを実
行することで制御対象を制御し、予め定められた書き換
え条件が成立した場合には、外部から送信されて来る書
込データを前記不揮発性メモリに更新して書き込むため
の書込処理を行う第2のマイクロコンピュータとを備
え、 前記第1のマイクロコンピュータは、前記第1の制御プ
ログラムの実行に伴い、所定時間以内毎に自己が正常で
あることを示すモニタ信号を出力すると共に、前記第2
のマイクロコンピュータにて前記第2の制御プログラム
が正常に実行されているか否かを監視して、該第2の制
御プログラムの実行に異常が発生したと判断すると前記
モニタ信号の出力を停止し、 更に、前記第1のマイクロコンピュータから出力される
前記モニタ信号を監視して、該モニタ信号が前記所定時
間よりも長く設定された時間以内に出力されない場合
に、前記両マイクロコンピュータへ、該両マイクロコン
ピュータをリセットするためのリセット信号を出力する
システム監視手段を備えた電子制御装置であって、 前記両マイクロコンピュータの少なくとも何れか一方が
前記書込処理を行っている間は、前記システム監視手段
により前記両マイクロコンピュータがリセットされるの
を阻止する阻止手段を備えたこと、 を特徴とする電子制御装置。
5. A non-volatile memory having electrically rewritable data, and a control target which is normally executed by executing a first control program including data stored in the non-volatile memory. A first microcomputer that performs a write process for controlling and writing externally transmitted write data to the non-volatile memory when a predetermined rewrite condition is satisfied; In addition to a non-volatile memory in which data can be rewritten in a non-volatile manner, a control target is controlled by executing a second control program composed of data stored in the non-volatile memory in a normal state. If the rewriting condition is satisfied, a write operation for updating and writing the externally transmitted write data to the nonvolatile memory is performed. A first microcomputer that outputs a monitor signal indicating that the first microcomputer is normal within a predetermined period of time in accordance with the execution of the first control program. , The second
Monitoring whether or not the second control program is normally executed by the microcomputer, and when it is determined that an abnormality has occurred in the execution of the second control program, the output of the monitor signal is stopped; Further, the monitor signal output from the first microcomputer is monitored, and if the monitor signal is not output within a set time longer than the predetermined time, the two microcomputers are notified of the monitor signal. An electronic control device including a system monitoring unit that outputs a reset signal for resetting a computer, wherein at least one of the two microcomputers performs the writing process by the system monitoring unit. Blocking means for preventing the microcomputers from being reset. Child control device.
【請求項6】 請求項5に記載の電子制御装置におい
て、 前記両マイクロコンピュータは、少なくとも所定の書込
電圧が供給されることを条件として、前記書込処理を行
うように構成されており、 前記阻止手段は、前記両マイクロコンピュータの少なく
とも何れか一方に前記書込電圧が供給されているか否か
を検出して、該書込電圧が供給されている時に、前記シ
ステム監視手段により前記両マイクロコンピュータがリ
セットされるのを阻止すること、 を特徴とする電子制御装置。
6. The electronic control device according to claim 5, wherein the two microcomputers are configured to perform the writing process on condition that at least a predetermined writing voltage is supplied, The blocking means detects whether or not the write voltage is supplied to at least one of the two microcomputers, and when the write voltage is supplied, the system monitoring means causes the two microcomputers to control the microcomputer. Preventing the computer from being reset.
【請求項7】 請求項5又は請求項6に記載の電子制御
装置において、 前記阻止手段は、前記システム監視手段から出力された
前記リセット信号が前記両マイクロコンピュータに入力
されるのを阻止することで、前記両マイクロコンピュー
タがリセットされるのを阻止するように構成されている
こと、 を特徴とする電子制御装置。
7. The electronic control device according to claim 5, wherein the blocking unit prevents the reset signal output from the system monitoring unit from being input to the microcomputers. And an electronic control unit configured to prevent the microcomputers from being reset.
【請求項8】 請求項5又は請求項6に記載の電子制御
装置において、 前記システム監視手段は、 一定周期毎にカウント動作を行うと共に、前記第1のマ
イクロコンピュータから出力される前記モニタ信号によ
りカウント値が初期化されるカウンタと、 該カウンタのカウント値が所定値に達すると、前記両マ
イクロコンピュータへ前記リセット信号を出力するリセ
ット信号出力手段とからなり、 前記第1のマイクロコンピュータは、前記第1の制御プ
ログラムの実行に伴い、前記カウンタへ、該カウンタの
カウント値が初期化されてから前記所定値に達するまで
の時間よりも短い周期で前記モニタ信号を出力し、 前記阻止手段は、前記カウンタのカウント動作を強制的
に停止させることで、前記両マイクロコンピュータがリ
セットされるのを阻止するように構成されていること、 を特徴とする電子制御装置。
8. The electronic control device according to claim 5, wherein the system monitoring means performs a counting operation at regular intervals and uses the monitor signal output from the first microcomputer. A counter for resetting the count value; and reset signal output means for outputting the reset signal to the microcomputers when the count value of the counter reaches a predetermined value. Along with the execution of the first control program, the monitor outputs the monitor signal to the counter in a cycle shorter than a time period from when the count value of the counter is initialized to when the count value reaches the predetermined value, By forcibly stopping the counting operation of the counter, both microcomputers are reset. That it is configured to prevent the electronic control device according to claim.
JP08338655A 1996-12-09 1996-12-18 Electronic control unit Expired - Fee Related JP3097580B2 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP08338655A JP3097580B2 (en) 1996-12-18 1996-12-18 Electronic control unit
US08/987,062 US6144887A (en) 1996-12-09 1997-12-08 Electronic control unit with reset blocking during loading
US09/536,720 US6493593B1 (en) 1996-12-09 2000-03-28 Electronic control unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP08338655A JP3097580B2 (en) 1996-12-18 1996-12-18 Electronic control unit

Publications (2)

Publication Number Publication Date
JPH10177504A true JPH10177504A (en) 1998-06-30
JP3097580B2 JP3097580B2 (en) 2000-10-10

Family

ID=18320229

Family Applications (1)

Application Number Title Priority Date Filing Date
JP08338655A Expired - Fee Related JP3097580B2 (en) 1996-12-09 1996-12-18 Electronic control unit

Country Status (1)

Country Link
JP (1) JP3097580B2 (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001075684A (en) * 1999-07-14 2001-03-23 Ford Motor Co Power abnormality managing method for multi-media system of automobile
JP2001109502A (en) * 1999-09-30 2001-04-20 Robert Bosch Gmbh Process control method for driving device and device thereof
JP2003222053A (en) * 2002-01-30 2003-08-08 Denso Corp Electronic control unit for vehicle
US6636989B1 (en) 1999-02-17 2003-10-21 Denso Corporation Electronic control apparatus and method for on-board rewriting of non-volatile memories
JP2005031993A (en) * 2003-07-14 2005-02-03 Mitsubishi Electric Corp Electronic controller
JP2008242995A (en) * 2007-03-28 2008-10-09 Denso Corp Electronic control device
WO2013145852A1 (en) * 2012-03-30 2013-10-03 日立オートモティブシステムズ株式会社 Electronic control device
WO2014045785A1 (en) 2012-09-24 2014-03-27 日産自動車株式会社 Electric vehicle control device
KR20140125621A (en) * 2013-04-19 2014-10-29 콘티넨탈 오토모티브 시스템 주식회사 Apparatus and method for monitoring tcu in pcu
JP2015058751A (en) * 2013-09-17 2015-03-30 日立オートモティブシステムズ株式会社 Vehicle electronic control device
JP2018090214A (en) * 2016-12-07 2018-06-14 日立オートモティブシステムズ株式会社 Electronic control device for automobile and method of resetting electronic control device for automobile
EP3321135A4 (en) * 2015-07-07 2019-03-13 Hitachi Automotive Systems, Ltd. Vehicle control device
JP2019109746A (en) * 2017-12-19 2019-07-04 日立オートモティブシステムズ株式会社 Automobile electronic controller

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6636989B1 (en) 1999-02-17 2003-10-21 Denso Corporation Electronic control apparatus and method for on-board rewriting of non-volatile memories
JP2001075684A (en) * 1999-07-14 2001-03-23 Ford Motor Co Power abnormality managing method for multi-media system of automobile
JP2001109502A (en) * 1999-09-30 2001-04-20 Robert Bosch Gmbh Process control method for driving device and device thereof
JP2003222053A (en) * 2002-01-30 2003-08-08 Denso Corp Electronic control unit for vehicle
JP2005031993A (en) * 2003-07-14 2005-02-03 Mitsubishi Electric Corp Electronic controller
JP2008242995A (en) * 2007-03-28 2008-10-09 Denso Corp Electronic control device
US7831678B2 (en) 2007-03-28 2010-11-09 Denso Corporation Electronic control apparatus
JP2013209890A (en) * 2012-03-30 2013-10-10 Hitachi Automotive Systems Ltd Electronic control device
WO2013145852A1 (en) * 2012-03-30 2013-10-03 日立オートモティブシステムズ株式会社 Electronic control device
US9160490B2 (en) 2012-03-30 2015-10-13 Hitachi Automotive Systems, Ltd. Electronic control device
WO2014045785A1 (en) 2012-09-24 2014-03-27 日産自動車株式会社 Electric vehicle control device
EP2899637A4 (en) * 2012-09-24 2015-12-16 Nissan Motor Electric vehicle control device
US9216651B2 (en) 2012-09-24 2015-12-22 Nissan Motor Co., Ltd. Electric vehicle control device
KR20140125621A (en) * 2013-04-19 2014-10-29 콘티넨탈 오토모티브 시스템 주식회사 Apparatus and method for monitoring tcu in pcu
JP2015058751A (en) * 2013-09-17 2015-03-30 日立オートモティブシステムズ株式会社 Vehicle electronic control device
EP3321135A4 (en) * 2015-07-07 2019-03-13 Hitachi Automotive Systems, Ltd. Vehicle control device
JP2018090214A (en) * 2016-12-07 2018-06-14 日立オートモティブシステムズ株式会社 Electronic control device for automobile and method of resetting electronic control device for automobile
JP2019109746A (en) * 2017-12-19 2019-07-04 日立オートモティブシステムズ株式会社 Automobile electronic controller

Also Published As

Publication number Publication date
JP3097580B2 (en) 2000-10-10

Similar Documents

Publication Publication Date Title
US6144887A (en) Electronic control unit with reset blocking during loading
JP3097580B2 (en) Electronic control unit
JPH08137763A (en) Flash memory controller
JPH11259375A (en) Device and system for control for vehicle
JPH11272498A (en) Electronic controller
US20040037156A1 (en) Semiconductor integrated circuit
US6636989B1 (en) Electronic control apparatus and method for on-board rewriting of non-volatile memories
JP3137012B2 (en) Electronic control unit
JP6011162B2 (en) Electronic control unit
JP2001123874A (en) Program rewrite system or memory rewriting system for electronic control device
JPH1173203A (en) Electronic control unit
JP3968876B2 (en) Electronic control unit
US20050038924A1 (en) Operation mode control circuit, microcomputer including the same, and control system using the microcomputer
JP3491358B2 (en) Power cut-off detection device
JP4281222B2 (en) Nonvolatile memory writing device
JP4692514B2 (en) Electronic control unit
US20050223301A1 (en) Circuit for detection of internal microprocessor watchdog device execution and method for resetting microprocessor system
JP2002041493A (en) Microcomputer
JP3915411B2 (en) Electronic control device for vehicle
US7426659B2 (en) Forced diagnostic entry upon power-up
JP2003196256A (en) Electronic control unit
JPH0236003B2 (en)
JPH09139094A (en) Electronic device, memory rewriting device and memory rewriting system for electronic device
JP2022053165A (en) Electronic control device
US20050210328A1 (en) Forced diagnostic entry upon power-up

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20000711

LAPS Cancellation because of no payment of annual fees