[go: up one dir, main page]

JP2004178067A - Electronic control device - Google Patents

Electronic control device Download PDF

Info

Publication number
JP2004178067A
JP2004178067A JP2002340878A JP2002340878A JP2004178067A JP 2004178067 A JP2004178067 A JP 2004178067A JP 2002340878 A JP2002340878 A JP 2002340878A JP 2002340878 A JP2002340878 A JP 2002340878A JP 2004178067 A JP2004178067 A JP 2004178067A
Authority
JP
Japan
Prior art keywords
data
value
stored
electronic control
control device
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
JP2002340878A
Other languages
Japanese (ja)
Other versions
JP3960212B2 (en
Inventor
Kazunori Okada
和憲 岡田
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 JP2002340878A priority Critical patent/JP3960212B2/en
Publication of JP2004178067A publication Critical patent/JP2004178067A/en
Application granted granted Critical
Publication of JP3960212B2 publication Critical patent/JP3960212B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To prevent the phenomenon that a data value read by an external device is a value regarded older than the data value read the last time in an electronic control device capable of continuously storing and updating specified data by use of a rewritable nonvolatile memory such as EEPROM and reading the data value by the external device. <P>SOLUTION: In this engine control device, data to be stored the value of which is updated on a RAM, which are denominator and numerator data for the monitor frequency (diagnosis execution frequency) to a subject of diagnosis are regularly stored in a SRAM backed up with a battery, and also stored in the EEPROM once every three operations of the device. When the data in the SRAM are determined abnormal at the start of operation, the data are restored from the EEPROM, and the storage of the data to be stored to the EEPROM is executed also just before transmission of the data to be storage to a diagnostic tool in response to an output request from the tool. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
本発明は、動作中に更新される特定のデータの値を、電気的に記憶内容の書き換えが可能な不揮発性メモリを用いて継続的に保存及び更新していくようにした電子制御装置に関するものである。
【0002】
【従来の技術】
従来より、自動車用の電子制御装置においては、動作電源の供給が停止されても継続して保存すべき故障診断情報や制御学習値などの特定のデータであって、データ処理に用いられる処理作業用メモリ上で値が更新されるデータ(以下、継続保存対象データという)を、電気的に記憶内容の書き換えが可能なEEPROMなどの不揮発性メモリ(以下、書換可能不揮発性メモリともいう)に書き込んでおくことにより、そのデータ値を継続して保持及び更新することができるようにしている。
【0003】
例えば、バッテリバックアップされたRAM(以下、バックアップRAMともいう)を用いて常時処理を行うと共に、そのRAM内の所定領域のデータを、EEPROMにコピーして保存しておき、動作電源の投入に伴う動作開始時に、バックアップRAM内のデータが異常であれば、EEPROM内のデータをバックアップRAMへコピーして復元する装置が知られている(例えば、特許文献1参照)。
【0004】
また、EEPROMなどの書換可能不揮発性メモリには、データ書込回数に制限がある。よって、この種の電子制御装置では、その書換可能不揮発性メモリへのデータ書込回数を減らすために、予め定められた書込実施条件が成立した際にだけ、継続保存対象データの値を書換可能不揮発性メモリに記憶させるようにしている。
【0005】
例えば、上記例の装置のように、バックアップRAMが処理作業用メモリである場合には、動作停止中(即ち、動作電源の供給遮断中)でも、バッテリ上がりやバッテリ外れがなければ、とりあえずはそのバックアップRAM内に継続保存対象データが継続保存されるため、電子制御装置が複数回動作する毎に1回の頻度で、継続保存対象データの値を書換可能不揮発性メモリに記憶させるように構成することが考えられる。
【0006】
また例えば、自動車用電子制御装置では、イグニッションスイッチがオンされている時か、外部に設けられた給電用のメインリレーがオンされている時に、動作電源が供給されると共に、電子制御装置は、イグニッションスイッチのオンに伴い動作すると、メインリレーを自らオンさせることで、イグニッションスイッチのオフ後も動作を継続できるように構成されることがある。そして、このようなメインリレーが存在する場合、電子制御装置は、バッテリバックアップされていない通常のRAMが処理作業用メモリであっても、イグニッションスイッチがオフされたことを検知した際に、RAMから書換可能不揮発性メモリへ継続保存対象データの値をコピーし、その後メインリレーをオフさせるという手順により、書換可能不揮発性メモリへのデータ書き込みの実施を、電子制御装置が1回動作する毎に1回の頻度に(詳しくは、電子制御装置の動作停止直前時のみに)抑えることができる。尚、この場合には、動作電源の投入に伴う動作開始時に、書換可能不揮発性メモリ内のデータを処理作業用メモリとしてのRAMへコピーして復元すれば良い。
【0007】
一方、自動車用電子制御装置においては、CARB(カリフォルニア大気資源保護局)によるOBD(オンボードダイアグノスティック)2の法規に、RateBaseモニタ法があり、そのRateBaseモニタ法では、下記の式で示されるモニタ頻度を継続的に記憶し且つ更新していく必要がある。
【0008】
モニタ頻度=モニタリング実施回数/運転回数
尚、モニタ頻度は、故障診断を実施した頻度であり、触媒コンバータ,フューエルエバポレーションシステム,酸素センサ等といった複数の項目(即ち、診断対象)について各々存在する。そして、運転回数(以下、分母という)は、その項目について法規で定められた所定の走行条件が満たされたときに値がインクリメントされるデータであり、モニタリング実施回数(以下、分子という)は、その項目について自動車メーカで定めた故障診断実施条件が満たされて、正常又は異常の判定が終了した時点(即ち、故障診断が実施された時点)で値がインクリメントされるデータである。また、これら分母と分子は、両方共に、自動車のイグニッションスイッチがオンされてオフされるまでの間(即ち、故障診断を実施する電子制御装置に動作電源が投入されて該動作電源が遮断されるまでの1回の動作期間中)に、1回だけインクリメントされるか、或いは、インクリメントされずにそのままの値を維持するかの何れかである。そして更に、これらモニタ頻度のデータ(分母と分子のデータ)は、電子制御装置と通信可能に接続される車両外部の診断装置(診断ツールやダイアグチェッカーとも呼ばれる)によって読み出すことができなければならない。
【0009】
【特許文献1】
特開平4−336351号公報
【0010】
【発明が解決しようとする課題】
ところで、継続保存対象デーが、上記RateBaseモニタ法で規定されているモニタ頻度のように、外部装置による読み出しができなければならないものである場合、電子制御装置は、外部装置からの出力要求を受けると、処理作業用メモリに記憶されている継続保存対象データの値(即ち、そのデータの最新値)を外部装置に出力する、といった具合に構成されることとなるが、この場合に、以下の問題がある。
【0011】
即ち、まず、処理作業用メモリに記憶されている継続保存対象データの最新値が外部装置へ読み出された後、その最新値の書換可能不揮発性メモリへの記憶が実施される前に、何らかの原因で処理作業用メモリ内の継続保存対象データを失ったとする。すると、その後、前述したようなデータの復元機能により、書換可能不揮発性メモリ内のデータ値が処理作業用メモリへコピーされることとなるが、この場合、処理作業用メモリには、外部装置へ読み出された最新値よりも古いデータ値が書換可能不揮発性メモリからコピーされることとなる。よって、その後、再度、外部装置によりデータの読み出しが行われたとすると、その際に読み出されるデータ値が、前回に読み出されたデータ値よりも古いと見なされる値(過去に溯った値)になってしまう可能性があり、そのような読み出しデータ値の逆転現象は、電子制御装置の見た目の信頼性を大きく損ねるものとなる。
【0012】
尚、書換可能不揮発性メモリから処理作業用メモリへのデータの復元が行われたことを、電子制御装置の外部に設けられたチェックランプ等の報知器によって報知する、といった構成を採れば、電子制御装置の機能自体には異常が無いことを確認させることはできるが、故障でもないのに報知器を作動させるのは無駄なことであり、上記のような読み出しデータ値の逆転現象自体が起こらないようにすることが重要である。
【0013】
そこで、本発明は、特定のデータをEEPROM等の書換可能不揮発性メモリを用いて継続的に保存及び更新していくと共に、そのデータ値を外部装置によって読み出し可能な電子制御装置において、外部装置により読み出したデータ値が前回読み出したデータ値よりも古いと見なされる値になってしまう現象の発生を防止することを目的としている。
【0014】
【課題を解決するための手段及び発明の効果】
上記目的を達成するためになされた請求項1に記載の電子制御装置は、処理作業用メモリ上で値が更新される継続保存対象データを動作電源の供給が停止されても継続して保存するために、電気的に記憶内容の書き換えが可能な書換可能不揮発性メモリを備えている。
【0015】
そして、請求項1の電子制御装置では、データ保存手段が、予め定められた書込実施条件が成立した際に、処理作業用メモリに記憶されている継続保存対象データの値(即ち、その時点での継続保存対象データの最新値)を書換可能不揮発性メモリに記憶させ、データ復元手段が、予め定められたデータ復元実施条件が成立した際に、書換可能不揮発性メモリに記憶されている継続保存対象データの値を処理作業用メモリにコピーすることにより、処理作業用メモリ内の継続保存対象データが消失しても該継続保存対象データの値の継続的な更新ができるようにする。また、出力手段が、外部装置からの継続保存対象データの出力要求を受けた場合に、処理作業用メモリに記憶されている継続保存対象データの値を、その外部装置に出力する。
【0016】
そして特に、この請求項1の電子制御装置には、上記データ保存手段とは別に、第2のデータ保存手段が設けられており、その第2のデータ保存手段は、外部装置からの前記出力要求を受けた際にも、処理作業用メモリに記憶されている継続保存対象データの値を書換可能不揮発性メモリに記憶させる。
【0017】
このような請求項1の電子制御装置において、仮に、本装置の特徴部分である第2のデータ保存手段を有していないとすると、前述したように、処理作業用メモリに記憶されている継続保存対象データの最新値が外部装置へ読み出されてから、その最新値がデータ保存手段によって書換可能不揮発性メモリに記憶される前に(つまり、予め定められた書込実施条件が成立する前に)、何らかの原因で処理作業用メモリ内の継続保存対象データを失ってしまい、その後、データ復元実施条件が成立して、データ復元手段により、書換可能不揮発性メモリ内のデータ値が処理作業用メモリへコピーされ、更にその後、外部装置によって、再度、継続保存対象データの読み出しが行われたとすると、その際に読み出されるデータ値が、前回に読み出されたデータ値よりも古いと見なされる値になってしまう可能性がある。
【0018】
しかし、本請求項1の電子制御装置によれば、第2のデータ保存手段を備えており、外部装置からの出力要求を受けて継続保存対象データの最新値を外部装置に出力する際にも、処理作業用メモリに記憶されている継続保存対象データの最新値が不揮発性メモリに記憶されるため、処理作業用メモリに記憶されている継続保存対象データの最新値が外部装置へ読み出されてから、その最新値が書換可能不揮発性メモリに記憶される前に、処理作業用メモリ内の継続保存対象データが失われてしまう、という可能性を極めて低くすることができる。
【0019】
よって、書換可能不揮発性メモリへのデータ書込回数を減らすために、本来のデータ保存手段が動作する契機となる書込実施条件を成立頻度が小さいものに設定しても、外部装置によって読み出したデータ値が前回読み出したデータ値よりも古いと見なされる値になってしまう現象の発生を防止することができる。
【0020】
ところで、外部装置からの出力要求を受けた際に、まず出力手段が動作し、次いで第2のデータ保存手段が動作する、というように構成しても良いが、この場合には、外部装置へ継続保存対象データの最新値を出力してから該最新値が書換可能不揮発性メモリに記憶される前にその最新値を電源瞬断等によって失ってしまう、という可能性が少しは残る。
【0021】
そこで、その可能性を完全に無くすためには、請求項2に記載の如く、出力手段は、第2のデータ保存手段による書換可能不揮発性メモリへの継続保存対象データの値の記憶が終了してから、処理作業用メモリに記憶されている継続保存対象データの値を外部装置に出力するように構成すれば良い。つまり、外部装置からの出力要求を受けた際に、まず第2のデータ保存手段が動作し、その第2のデータ保存手段による書換可能不揮発性メモリへの継続保存対象データの値の記憶が終了してから、出力手段が動作するように構成すれば良い。
【0022】
尚、この請求項2の電子制御装置の場合、出力手段が動作する時点では、処理作業用メモリに記憶されている継続保存対象データの値と書換可能不揮発性メモリに記憶されている継続保存対象データの値とが必ず一致しているため、出力手段は、書換可能不揮発性メモリから継続保存対象データの値を読み出し、その読み出した値を、処理作業用メモリに記憶されている継続保存対象データの値として、外部装置に出力するように構成しても良い。
【0023】
一方、この請求項2の電子制御装置の場合、外部装置からの出力要求を受けてから、出力手段が動作を開始するまでの間に、第2のデータ保存手段による書換可能不揮発性メモリへの継続保存対象データの値の記憶が実施されるため、出力要求を受けてから外部装置に継続保存対象データの値を返すまでの応答時間が長くなる傾向となる。また、この種の電子制御装置に接続される外部装置は、要求を出してから規定時間以内に応答が返ってこないと、タイムアウト判定を行うように構成される場合がある。
【0024】
このため、請求項2の電子制御装置において、第2のデータ保存手段が書換可能不揮発性メモリへ継続保存対象データの値を記憶させるのに要する時間が長くなると、本当は正常であるにも拘わらず、外部装置側でタイムアウト判定がなされてしまう虞がある。
【0025】
そこで、請求項3に記載の電子制御装置では、請求項2の電子制御装置に対して先行応答手段を設け、その先行応答手段が、外部装置からの出力要求を受けた場合に、第2のデータ保存手段が動作する前又は該第2のデータ保存手段が動作している最中に動作して、外部装置側でタイムアウト判定がなされるのを防ぐための応答信号をその外部装置に出力するようにしている。そして、このような請求項3の電子制御装置によれば、継続保存対象データのデータ量が大きくて、第2のデータ保存手段が書換可能不揮発性メモリへ継続保存対象データの値を記憶させるのに要する時間が長くなっても、外部装置側でタイムアウト判定がなされてしまうことを防ぐことができる。
【0026】
次に、請求項4に記載の電子制御装置では、請求項1〜3の電子制御装置において、第2のデータ保存手段は、処理作業用メモリに記憶されている継続保存対象データの値と、書換可能不揮発性メモリに記憶されている継続保存対象データの値とを比較して、両値が異なっている場合にのみ、処理作業用メモリに記憶されている継続保存対象データの値を書換可能不揮発性メモリに記憶させる。
【0027】
そして、このような電子制御装置によれば、書換可能不揮発性メモリへのデータ書込回数を節約することができる。つまり、外部装置からの出力要求が頻繁に繰り返された場合に、その都度、継続保存対象データの最新値が更新されていないにも拘わらず書換可能不揮発性メモリへのデータ値の記憶を実施していると、その書換可能不揮発性メモリへのデータ書込回数を無駄に増加させてしまうこととなるが、請求項4の電子制御装置によれば、そのような無駄を無くすことができる。
【0028】
一方、処理作業用メモリとしては、データ保持用の電源が常時供給されたスタンバイRAM(前述のバックアップRAMに相当)と、電子制御装置への動作電源の供給に伴い当該電子制御装置が動作しているときにのみデータ保持用の電源が供給されるノーマルRAM(即ち、バッテリバックアップされていない通常のRAM)との何れを用いても良い。
【0029】
ここで、ノーマルRAMを処理作業用メモリとして用いるならば、例えば、「従来の技術」の欄で述べたように、給電用のメインリレーを設け、動作電源供給用のスイッチ(以下、給電用スイッチという)がオンされて動作を開始すると、メインリレーを自らオンさせて給電用スイッチのオフ後も動作を継続できるようにし、更に、給電用スイッチがオフされたことを検知した際に、書込実施条件が成立したとして、ノーマルRAMに記憶されている継続保存対象データの値を書換可能不揮発性メモリに記憶させ、その後メインリレーをオフさせる、というように構成することで、本来のデータ保存手段による書換可能不揮発性メモリへのデータ書込頻度を、電子制御装置が1回動作する毎に1回の割合にすることができる。そして、この場合には、動作開始時に、データ復元条件が成立したとして、書換可能不揮発性メモリに記憶されているデータ値を処理作業用メモリとしてのノーマルRAMへコピーして復元すれば良い。
【0030】
また、スタンバイRAMを処理作業用メモリとして用いれば、「従来の技術」の欄で述べたように、動作停止中(動作電源の供給遮断中)でも、とりあえずはそのスタンバイRAM内に継続保存対象データが継続保存されるため、本来のデータ保存手段が動作する頻度(即ち、書込実施条件の成立頻度)を、電子制御装置が複数回動作する毎に1回の割合に設定することができ、書換可能不揮発性メモリへのデータ書込回数を減らす上で有利である。そして、この場合には、動作電源の投入に伴う動作開始時に、スタンバイRAM内の記憶データが正常であるか否かを判定し、正常でないと判定したならば、データ復元条件が成立したとして、書換可能不揮発性メモリに記憶されているデータ値をスタンバイRAMへコピーして復元すれば良い。
【0031】
但し、スタンバイRAMの記憶容量を小さく抑えるためには、ノーマルRAMを処理作業用メモリとして用い、スタンバイRAMは継続保存対象データの保存のためだけに用いる、という構成を採ることもできる。
そこで、請求項5に記載の電子制御装置では、請求項1〜4の電子制御装置において、スタンバイRAMと、処理作業用メモリとしてのノーマルRAMと、そのノーマルRAMからスタンバイRAMへ継続保存対象データの最新値をコピーするコピー手段とを備えており、データ保存手段、第2のデータ保存手段、及び出力手段は、ノーマルRAM又はスタンバイRAMから継続保存対象データの値を読み出して、その読み出した値を、処理作業用メモリに記憶されている継続保存対象データの値(つまり、継続保存対象データの最新値)として処理するように構成されている。そして更に、データ復元手段は、当該電子制御装置が動作電源の供給に伴い起動した際に、スタンバイRAM内の記憶データが正常であるか否かを判定して、スタンバイRAM内の記憶データが正常であると判定したならば、そのスタンバイRAMからノーマルRAMへ継続保存対象データの値をコピーし、スタンバイRAM内の記憶データが正常でないと判定したならば、データ復元実施条件が成立したとして、書換可能不揮発性メモリに記憶されている継続保存対象データの値をスタンバイRAMとノーマルRAMとにコピーするように構成されている。
【0032】
このような請求項5に記載の電子制御装置によれば、スタンバイRAMを処理作業用メモリとして用いた場合と同様に、動作停止中(動作電源の供給遮断中)でも、バッテリ上がりやバッテリ外れがなければ、とりあえずはスタンバイRAM内に継続保存対象データが継続保存されるため、本来のデータ保存手段が動作する頻度を、電子制御装置が複数回動作する毎に1回の割合に設定することができ、しかも、スタンバイRAMの記憶容量が小さいもので済む。
【0033】
次に、請求項6に記載の電子制御装置は、請求項1〜5の電子制御装置を、車両に搭載された車載機器を制御する車両用電子制御装置に適用したものであり、車両が所定の運転状態となったことを検出する検出手段と、所定の故障診断実施条件が成立した場合に前記車載機器における診断対象の故障診断を実施する故障診断手段と、当該装置の起動から停止までの間に、検出手段により前記所定の運転状態が検出されたときに処理作業用メモリに記憶されている運転回数の値を1回分だけ更新した値に書き換えると共に、故障診断手段にて診断対象の故障診断が実施されたときに処理作業用メモリに記憶されている故障診断回数の値を1回分だけ更新した値に書き換えるデータ更新手段とを備えている。そして、この電子制御装置では、前記データ更新手段により処理作業用メモリ上で値が更新される運転回数と故障診断回数とが、継続保存対象データとなっている。
【0034】
このような請求項6の電子制御装置によれば、書換可能不揮発性メモリへのデータ書込回数を減らすために、本来のデータ保存手段が動作する契機となる書込実施条件を成立頻度が小さいものに設定しても、外部装置によって読み出した運転回数と故障診断回数の値が前回読み出した値よりも古いと見なされる値(具体的には、小さい値)になってしまう現象の発生を防止することができる。
【0035】
尚、この請求項6の電子制御装置において、外部装置としては、請求項7に記載のように、当該電子制御装置に接続可能な車両用の診断装置であることが考えられる。
【0036】
【発明の実施の形態】
以下、本発明の一実施形態について、図面を用いて説明する。
まず図1は、自動車に搭載された車載機器としての内燃機関型エンジンの制御を行う、第1実施形態の電子制御装置(以下、ECUという)1の構成を表すブロック図である。
【0037】
図1に示すように、ECU1は、エンジンの運転状態やエンジンの周辺機器の状態を検出するための様々なセンサ3からの信号を入力して波形処理する入力処理回路5と、入力処理回路5からのセンサ信号等に基づき、エンジン制御や故障診断等に関する様々な処理を行うマイクロコンピュータ(以下、マイコンという)7と、マイコン7と通信ライン9を介して接続され、そのマイコン7にて算出されるデータのうちで、当該ECU1への動作電源の供給が停止されても継続して保存すべきデータ(継続保存対象データ)が記憶される書換可能不揮発性メモリとしてのEEPROM11と、マイコン7からの制御信号に応じて、エンジンに取付けられた燃料噴射装置(インジェクタ)や点火装置(イグナイタ)等のアクチュエータ13を駆動する出力回路15と、自動車のイグニッションスイッチ17のオンに伴い供給されるバッテリ19からの動作電源としての電圧VDを受けて、マイコン7を始めとする当該ECU1内の各部に動作用の電源電圧(例えば5V)Vmを供給すると共に、バッテリ19から常時供給される電圧VBから、マイコン7内の後述するスタンバイRAM29が常時データを保持するための副電源電圧Vs(スタンバイRAMへのデータ保持用の電源に相当)を生成して出力する電源回路21とを備えている。
【0038】
尚、電源回路21は、給電用スイッチとしてのイグニッションスイッチ17がオンされて上記電源電圧Vmの供給を開始してから、その電源電圧Vmが安定すると見なされる所定時間だけマイコン7へリセット信号を出力する、所謂パワーオンリセット機能も有している。
【0039】
そして、マイコン7は、プログラムを実行する周知のCPU(中央演算処理装置)23と、CPU23によって実行されるプログラム(詳しくは、そのプログラムを構成する命令コードやそのプログラムの実行時に参照される固定のデータ)を記憶する不揮発性のROM25と、CPU23がデータ処理に用いる処理作業用メモリとしての揮発性RAM27と、電源回路21からの副電源電圧Vsを受けて常時データを保持可能なスタンバイRAM(バッテリバックアップされたRAMであり、以下、SRAMと記す)29と、入力処理回路5,EEPROM11,及び出力回路15等との間で信号やデータをやり取りするためのI/O31とを備えている。尚、RAM27には、バッテリバックアップがされておらず、電源回路21からの電源電圧Vmがデータ保持用の電源として供給される。そして、以下の説明において、このRAM27は、SRAM29との区別を明確にするために、NRAM(ノーマルRAM)27と呼ぶ。
【0040】
以上のような構成のECU1は、イグニッションスイッチ17がオンされている間、バッテリ19からの電圧VDを受けて動作する。
そして、ECU1では、イグニッションスイッチ17がオンされて、電源回路21からマイコン7へのリセット信号が解除されると、マイコン7が初期状態から動作を開始して、後述するイニシャル処理を行った後、エンジンを制御するための制御処理を行う。尚、マイコン7の動作は、CPU23がROM25内のプログラムを実行することによるものである。
【0041】
また、マイコン7は、前述したCARB・OBD2のRateBaseモニタ法で定められている故障診断対象項目の各々(触媒コンバータ,フューエルエバポレーションシステム,酸素センサ等)について、前述したモニタ頻度を表す分子(故障診断回数としてのモニタリング実施回数)と分母(運転回数)の値を、EEPROM11とSRAM29とを使用して継続的に保存及び更新していくようにしている。
【0042】
また更に、ECU1には、車両外部の診断ツール33(外部装置としての診断装置に相当)がダイアグコネクタ35を介して接続可能となっている。そして、ECU1は、診断ツール33からの故障診断に関する出力要求に応じて、その要求に応じた内容のデータを該診断ツール33に出力するようになっており、上記モニタ頻度に関わる情報の出力要求(即ち、モニタ頻度の分子及び分母の出力要求であり、以下、モニタ頻度情報出力要求という)を受けた場合には、NRAM27に記憶されている各故障診断対象項目についてのモニタ頻度の分子及び分母の最新値を診断ツール33に出力する。尚、図1において、符号37は、マイコン7が診断ツール33と通信を行うための通信回路である。
【0043】
そこで次に、ECU1のマイコン7が、各故障診断対象項目についてのモニタ頻度の分子と分母の各々である継続保存対象データの値を継続して保存及び更新していくために実行する処理の内容について、図2〜図5を用いて説明する。
まず、図2に示すように、本実施形態では、総数n個の各継続保存対象データに対して、0番から順に番号を付けている。例えば、0番目のデータは、フューエルエバポレーションシステム(以下単に、エバポという)についてのモニタ頻度の分子であり、1番目のデータは、エバポについてのモニタ頻度の分母であり、2番目のデータは、触媒コンバータ(以下単に、触媒という)についてのモニタ頻度の分子であり、3番目のデータは、触媒についてのモニタ頻度の分母であり、4番目のデータは、酸素センサについてのモニタ頻度の分子であり、5番目のデータは、酸素センサについてのモニタ頻度の分母である。
【0044】
また、特に図示はしていないが、EEPROM11とSRAM29との各々には、各故障診断対象項目毎に分子と分母とを記憶するための領域が夫々設定されており、上記各故障診断対象項目についての分子と分母の各データは、EEPROM11とSRAM29との各々において、そのデータが該当する故障診断対象項目用の領域に夫々記憶される。
【0045】
そして、マイコン7は、図3(a)に示すように、各故障診断対象項目について、その項目に対して法規で定められている所定の走行条件が満たされたか否か(換言すれば、車両が、その故障診断対象項目について法規で定められている所定の運転状態となったか否か)を例えば定期的に判定し(S110)、その走行条件が満たされたと判定すると(S110:YES)、該当する項目の分母(運転回数)の値をNRAM27上でインクリメントする(S120)。
【0046】
また、マイコン7は、図3(b)に示すように、各故障診断対象項目について、その項目の故障診断実施条件が成立したか否かを例えば定期的に判定し(S130)、故障診断実施条件が成立したと判定したならば(S130:YES)、該当する項目についての故障診断処理を実施して正常又は異常の判定を行い(S140)、次いで、その項目の分子(モニタリング実施回数)の値をNRAM27上でインクリメントする(S150)。
【0047】
尚、マイコン7は、何れかの故障診断対象項目の分子又は分母をインクリメントすると、そのインクリメントしたデータは、今回の動作期間中(即ち、今回の自動車の運転期間中)では、それ以上インクリメントしないようになっている。そして、このような図3(a),(b)の処理により、NRAM27に記憶されている各継続保存対象データ(各故障診断対象項目についての分子,分母)の値が、そのデータについてのインクリメント条件が成立したときに、1回分だけ更新した値に書き換えられることとなる。
【0048】
次に、図4(a),(b)は、マイコン7が、NRAM27上で更新される継続保存対象データの値をSRAM29とEEPROM11との各々に記憶させるために実行する処理を表すフローチャートである。そして、図4(a)の処理は、一定時間毎(本実施形態では16ms毎)に繰り返し実行され、図4(b)の処理は、本ECU1が動作している期間中に1回だけ実行される。
【0049】
まず、マイコン7が図4(a)に示す処理の実行を開始すると、最初のS210にて、今回のタイミングが、SRAM更新タイミングであるか否かを判定する。尚、本実施形態では、当該処理の2回に1回の割合である32ms毎に、SRAM更新タイミングであると判定される。
【0050】
そして、上記S210でSRAM更新タイミングであると判定した場合には、S220に進んで、NRAM27内の0番目から「n−1」番目までの全ての継続保存対象データを読み出してSRAM29にコピーし、その後、本処理を終了する。
【0051】
また、上記S210でSRAM更新タイミングではないと判定した場合には、そのまま本処理を終了する。
一方、マイコン7が図4(b)に示す処理の実行を開始すると、まずS230にて、今回のタイミングが、EEPROM更新タイミングであるか否かを判定する。
【0052】
そして、EEPROM更新タイミングであると判定した場合には、S240に進んで、SRAM29内の0番目から「n−1」番目までの全ての継続保存対象データを読み出してEEPROM11にコピーし、その後、本処理を終了する。よって、S240の処理が実行されたならば、その時点でNRAM27に記憶されている各継続保存対象データの値がEEPROM11にも記憶されることとなる。つまり、SRAM29には、図4(a)の処理により、常にNRAM27内の各継続保存対象データの最新値がコピーされているからである。
【0053】
また、上記S230でEEPROM更新タイミングではないと判定した場合には、そのまま本処理を終了する。
尚、本実施形態において、S230では、本ECU1がイグニッションスイッチ17のオンに伴い動作した回数を、SRAM29内のカウンタを用いて1日目→2回目→3回目→1回目…、といった具合に3回周期で繰り返し計数しており、その計数回数が3回目の時に、EEPROM更新タイミングであると判定するようになっている。よって、上記S240の処理は、本ECU1が3回動作する毎に1回の割合で実行されることとなる。
【0054】
次に、図5は、マイコン7がイグニッションスイッチ17のオンに伴い動作を開始した際に実行するイニシャル処理を表すフローチャートである。
図5に示すように、マイコン7がイニシャル処理の実行を開始すると、まずS310にて、NRAM27内のデータを初期化し、続くS320にて、SRAM29内の記憶データが正常であるか否かを判定する。尚、このS320では、バッテリ外れ(バッテリ19が外されたこと)の履歴があるか否かを判定すると共に、SRAM29内のデータ自体をパリティチェックやチェックサム等の方法で検査して、バッテリ外れの履歴が無く且つデータ自体も正常であったならば、SRAM29内の記憶データは正常であると判定する。
【0055】
そして、SRAM29内のデータが正常であると判定した場合には(S320:YES)、S330に進んで、SRAM29内の全ての(即ちn個の)継続保存対象データを読み出してNRAM27にコピーし、その後、エンジン制御処理や図3,図4の処理といった各種処理の実行へ移る。
【0056】
一方、上記S320にて、SRAM29内のデータが正常ではないと判定した場合には(S320:NO)、S340に移行して、EEPROM11内の全ての(n個の)継続保存対象データを読み出してSRAM29にコピーし、その後、上記S330の処理を行う。
【0057】
つまり、このイニシャル処理では、SRAM29内のデータが正常であれば(S320:YES)、そのSRAM29には、図4(a)のS220により、前回動作までの継続保存対象データの最終値が記憶されているため、S330の処理により、そのSRAM29内の全ての継続保存対象データを、インクリメント処理の作業用メモリであるNRAM27にコピーして、その各継続保存対象データが前回動作時までの値を継承しつつ更新され得るようにしている。
【0058】
また、EEPROM11にも、図4(b)のS240の処理により、少なくとも3回前の動作時における継続保存対象データの値が記憶されているため、SRAM29内のデータが正常でなければ(S320:NO)、そのEEPROM11内の全ての継続保存対象データをSRAM29にコピーしてから(S340)、S330の処理を行っている。このため、バッテリ上がりやバッテリ外れ等によってSRAM29内のデータが異常になっても、EEPROM11に記憶されていた継続保存対象データの値がSRAM29とNRAM27とにコピーされ、これにより、各継続保存対象データが継続して更新されていくこととなる。
【0059】
尚、本実施形態では、EEPROM11への継続保存対象データの書き込みを、当該ECU1が3回動作する毎に1回の割合で実施しているため、上記S340でEEPROM11からSRAM29とNRAM27とにデータを復元する際に、そのデータ値が必ずしも本当の最終値であるとは限らない。しかし、本実施形態では、そのことを承知の上で、EEPROM11へのデータ書込回数を減らすことを優先している。
【0060】
次に、図6は、マイコン7が、診断ツール33からのモニタ頻度情報出力要求を受信した際に実行する通信応答処理を表すフローチャートである。
図6に示すように、マイコン7が通信応答処理の実行を開始すると、まずS410にて、SRAM29から全ての継続保存対象データ(各故障診断対象項目についてのモニタ頻度の分母と分子のデータ)を読み出して、その読み出したデータを診断ツール33に送信する。つまり、本ECU1では、このS410の処理が実行されることで、診断ツール33による継続保存対象データの読み出しが実現される。
【0061】
そして、次のS420にて、図4(b)のS240と同様に、SRAM29から全ての継続保存対象データを読み出して、その読み出したデータ(つまり、診断ツール33に送信したのと同じデータを)をEEPROM11にコピーし、その後、本通信応答処理を終了する。
【0062】
尚、前述したように、SRAM29には、図4(a)の処理により、常にNRAM27内の各継続保存対象データと同じ値のデータがコピーされているため、上記図6のS420と図4(b)のS240では、SRAM29からでなく、NRAM27から継続保存対象データを読み出して、そのデータをEEPROM11にコピーし、上記図6のS410においても、SRAM29からでなく、NRAM27から継続保存対象データを読み出して、そのデータを診断ツール33に送信するようにしても良い。
【0063】
次に、以上のような本第1実施形態のECU1の作用について説明する。
まず、図6の通信応答処理にS420の処理が設けられていないものと仮定する。
この場合、診断ツール33によって継続保存対象データの読み出しが行われた後、図4(b)のS240の処理による継続保存対象データのEEPROM11への記憶が実施される前に、動作電源としての電圧VDの供給が停止されてECU1が動作を停止し、更に、その動作停止中に、バッテリ上がり等によってSRAM29内の記憶データが正常ではなくなったとする。
【0064】
すると、ECU1の次の動作開始時に、図5のS340とS330との処理がその順に実行されることにより、EEPROM11に記憶されていた継続保存対象データがSRAM29とNRAM27とにコピーされて、その後のデータ処理に用いられることとなるが、この場合、EEPROM11から両RAM27,29にコピーされるデータ値の何れかは、診断ツール33へ読み出されたデータ値よりも古いと見なされるデータ値(小さい値)である可能性がある。
【0065】
よって、その後、再度、診断ツール33によって継続保存対象データの読み出しが行われたとすると、その際に読み出されるデータ値が、前回に読み出されたデータ値よりも小さい値(過去に溯った値)になってしまう可能性がある。
そして、このような読み出しデータ値の逆転現象が生じると、ECU1の動作自体は正常であるにも拘わらず信頼性に疑問を持たれてしまう。
【0066】
そこで、本第1実施形態のECU1では、図6の通信応答処理内に、図4(b)のS240と同様のS420の処理を設け、診断ツール33からのモニタ頻度情報出力要求を受けて、NRAM27に記憶されている継続保存対象データの最新値を診断ツール33に出力する際にも、その継続保存対象データの最新値をEEPROM11に記憶させるようにしている。
【0067】
このため、NRAM27上で更新されている継続保存対象データの最新値が診断ツール33へ読み出されてから、その最新値がEEPROM11に記憶される前に、その継続保存対象データの最新値がNRAM27及びSRAM29から失われてしまう、という可能性を極めて低くすることができる。よって、EEPROM11へのデータ書込回数を減らすために、EEPROM11への本来のデータ書込処理である図4(b)のS240の実行頻度を、ECU1が3回動作する毎に1回の割合といった具合に小さく設定しても、診断ツール33によって読み出したデータ値が前回読み出したデータ値よりも古いと見なされる値になってしまう逆転現象の発生を防止することができる。
【0068】
尚、本実施形態では、図4(b)のS240が、データ保存手段としての処理に相当し、図5のS320〜S340が、データ復元手段としての処理に相当し、図6のS410が、出力手段としての処理に相当し、図6のS420が、第2のデータ保存手段としての処理に相当している。また、図4(a)の処理が、コピー手段としての処理に相当している。そして、図3(a)のS110が、検出手段としての処理に相当し、図3(b)のS130及びS140が、故障診断手段としての処理に相当し、図3(a)のS120と図3(b)のS150とが、データ更新手段としての処理に相当している。
【0069】
ところで、上記第1実施形態のECU1では、極めて希であると考えられるが、図6のS410が実行されてから図6のS420が終了するまでの僅かな期間に、万一、バッテリ外れや電源瞬断が起こると、継続保存対象データの最新値を失ってしまう(つまり、EEPROM11への記憶に失敗してしまう)可能性がある。
【0070】
そこで次に、そのような可能性を無くすことが可能な第2実施形態について説明する。
第2実施形態のECUは、第1実施形態のECU1と比較すると、マイコン7が、図6の通信応答処理に代えて、図7の通信応答処理を実行する点のみが異なっている。
【0071】
そして、図7に示すように、本第2実施形態における通信応答処理では、まず最初のS510にて、図6のS420と同じ処理を行い、次のS520にて、図6のS410と同じ処理を行う。
つまり、本第2実施形態のECUでは、診断ツール33からのモニタ頻度情報出力要求を受けた際に、まず、SRAM29から全ての継続保存対象データを読み出してEEPROM11にコピーし(S510)、次いで、SRAM29からEEPROM11にコピーした継続保存対象データを診断ツール33へ送信するようにしている(S520)。
【0072】
そして、このような本第2実施形態のECUによれば、診断ツール33へ継続保存対象データの最新値を出力してから該最新値がEEPROM11に記憶される前にその最新値をバッテリ外れや電源瞬断等によって失ってしまう、という可能性を完全に無くすことができる。
【0073】
尚、本第2実施形態においても、図7のS510では、SRAM29からではなく、NRAM27から継続保存対象データを読み出して、そのデータをEEPROM11にコピーし、図7のS520でも、SRAM29からではなく、NRAM27から継続保存対象データを読み出して、そのデータを診断ツール33に送信するようにしても良い。そして、このことは、後述する第3実施形態についても同様である。
【0074】
次に、第3実施形態について説明する。
第3実施形態のECUは、第2実施形態のECUと比較すると、マイコン7が、図7の通信応答処理に代えて、図8の通信応答処理を実行する点のみが異なっている。
【0075】
そして、図8に示すように、本第3実施形態における通信応答処理では、図7の通信応答処理に対して、S510の前にS505の処理が追加されており、そのS505にて、診断ツール33へ、EEPROM11への記憶処理中であることを示す応答信号であって、診断ツール33側でタイムアウト判定がなされるのを防ぐための応答信号を送信する。
【0076】
つまり、診断ツール33は、出力要求を出してから規定時間以内に応答が返ってこないと、タイムアウト判定を行うように構成されている。
そして、前述した第2実施形態のECUでは、診断ツール33からのモニタ頻度情報出力要求を受けてからS520で診断ツール33へ要求されたデータを送信する前に、EEPROM11へのデータ書き込み処理(S510)が実施されるため、その書き込み処理で書き込むべき継続保存対象データが多くなると、モニタ頻度情報出力要求を受けてから診断ツール33にデータを返すまでの応答時間が上記規定時間よりも長くなって、本当は正常であるにも拘わらず、診断ツール33側でタイムアウト判定がなされてしまう虞がある。
【0077】
そこで、本第3実施形態の通信応答処理では、第2実施形態の通信応答処理(図7)に対して、S510の前にS505を追加し、そのS505にて、診断ツール33へ、タイムアウト判定がなされるのを防ぐための応答信号を出力するようにしている。
【0078】
よって、このような第3実施形態のECUによれば、継続保存対象データの全データ量が大きくて、その継続保存対象データを通信応答処理のS510でEEPROM11に書き込むのに要する時間が長くなっても、外部装置側でタイムアウト判定がなされてしまうことを防ぐことができる。
【0079】
尚、本第3実施形態では、図8のS505が、先行応答手段としての処理に相当している。また、継続保存対象データのEEPROM11への書き込みに要する時間が更に長くなる場合には、例えば、S510でEEPROM11へのデータ書き込みを実施している最中に、診断ツール33へ例えば定期的に上記S505と同様の応答信号を送信するようにしても良い。
【0080】
次に、第4実施形態について説明する。
第4実施形態のECUは、上記第3実施形態のECUと比較すると、マイコン7が、図8の通信応答処理に代えて、図9の通信応答処理を実行する点のみが異なっている。
【0081】
そして、図9に示すように、本第4実施形態における通信応答処理では、図8の通信応答処理に対して、S510の代わりに、S610〜S650の処理を実施するようになっている。尚、図9において、図8と同じ処理については、同一のステップ番号を付している。
【0082】
即ち、図9に示すように、マイコン7は、通信応答処理の実行を開始して、S505で診断ツール33にタイムアウト判定防止用の応答信号を送信すると、次にS610へ進んで、継続保存対象データの番号を示す変数iを0に設定する。そして、続くS620にて、変数iの値が継続保存対象データの総数(データ数)nよりも小さいか否かを判定し、変数iの値がデータ数nよりも小さいと判定した場合には(S620:YES)、S630に進む。
【0083】
S630では、SRAM29から変数iの値に該当するi番目の継続保存対象データのSRAM値(即ち、SRAM29に記憶されているi番目の継続保存対象データの値)S[i]を読み出すと共に、EEPROM11からもi番目の継続保存対象データのEEPROM値(即ち、EEPROM11に記憶されているi番目の継続保存対象データの値)E[i]を読み出し、「E[i]≠S[i]」であるか否か(即ち、E[i]とS[i]とが異なっているか否か)を判定する。
【0084】
そして、「E[i]≠S[i]」でなければ(S630:NO)、S640に移行して、変数iの値を1インクリメントした後、S620に戻る。
また、上記S630にて、「E[i]≠S[i]」であると判定した場合には(S630:YES)、S650に進んで、S[i]をEEPROM11にE[i]として書き込む。そして、その後、上記S640に移行して、変数iの値を1インクリメントした後、S620に戻る。
【0085】
一方、上記S620にて、変数iの値がデータ数nよりも小さくない(即ち、i≧nである)と判定した場合には(S620:NO)、S520に移行して、SRAM29から全ての継続保存対象データを読み出して、その読み出したデータを診断ツール33に送信し、その後、本通信応答処理を終了する。
【0086】
つまり、この通信応答処理では、EEPROM11へのデータ書き込みを必ず実施するのではなく、S610〜S650の処理により、EEPROM値とSRAM値とが一致していない継続保存対象データを探し出し、両値が一致していないデータがあった場合にのみ、そのデータのEEPROM値はNRAM27に記憶されている最新値ではないと判断して、その最新値として扱っているSRAM値をEEPROM11に記憶させるようにしている。
【0087】
そして、このような本第4実施形態のECUによれば、診断ツール33からのモニタ頻度情報出力要求を受けた際に、EEPROM11に既に継続保存対象データの最新値が記憶されているのに(換言すれば、継続保存対象データの値がNRAM27上で更新されていないのに)EEPROM11への書き込みが実施される、ということがないため、そのEEPROM11へのデータ書込回数を効果的に節約することができる。
【0088】
尚、本第4実施形態においても、SRAM値をNRAM27内の最新値として扱っているが、図9のS630では、SRAM29から読み出したS[i]を用いるのではなく、NRAM27からi番目の継続保存対象データの値N[i]を読み出して、「E[i]≠N[i]」であるか否かを判定し、図9のS650では、そのNRAM27から読み出した値N[i]をEEPROM11にE[i]として書き込むようにしても良い。そして同様に、図9のS520でも、NRAM27から継続保存対象データを読み出して診断ツール33に送信するようにしても良い。
【0089】
次に、第5実施形態のECUについて説明する。
まず図10は、第5実施形態のECU41の構成を表すブロック図である。尚、本第5実施形態のECU41も、前述した各実施形態のECUと同様に、自動車のエンジンを制御するものである。また、図10において、図1と同じ構成要素については、同一の符号を付しているため、詳細な説明を省略する。
【0090】
図10に示すように、本第5実施形態のECU41は、前述した第1〜第4実施形態のうちの何れかのECUに対して、下記の(1)〜(5)の点が異なっている。
(1)バッテリ19からの電圧VDが、イグニッションスイッチ17を介してではなく、本ECU41の外部に設けられた給電用スイッチング手段としてのメインリレー43を介して供給されるようになっている。つまり、メインリレー43がオンする(詳しくは、メインリレー43の接点が短絡する)と、バッテリ19から電源回路21へ電圧VDが供給されて、マイコン7を始めとする当該ECU41内の各部に電源電圧Vmが供給される。
【0091】
(2)ECU41には、上記メインリレー43をオン/オフさせるためのメインリレー制御回路45が設けられている。
このメインリレー制御回路45は、イグニッションスイッチ17を介してECU41に入力されるバッテリ19からの電圧VGと、マイコン7からの駆動信号Sdとが、ダイオード等によりワイヤードオアされてベースに供給されるNPNトランジスタ47を主要部として構成されている。そして、一端がバッテリ19のプラス端子に接続されたメインリレー43のコイルLの他端に、上記NPNトランジスタ47のコレクタが接続されている。
【0092】
このため、メインリレー制御回路45では、イグニッションスイッチ17がオンされるか、マイコン7から駆動信号Sdが出力されると、トランジスタ47がオンして、そのトランジスタ47がメインリレー43のコイルLから電流を引き込むこととなり、それに伴いメインリレー43がオンすることとなる。
【0093】
よって、ECU41には、イグニッションスイッチ17がオンされている時、又は、マイコン7からの駆動信号Sdによってメインリレー43がオンされている時に、動作電源としての電圧VDが供給されることとなる。このため、本ECU41は、イグニッションスイッチ17のオンに伴い動作すると、メインリレー43を自らオンさせることで、イグニッションスイッチ17のオフ後も動作を継続することができる。
【0094】
尚、メインリレー制御回路45のトランジスタ47がマイコン7からの駆動信号Sdだけで駆動されると共に、イグニッションスイッチ17を介して入力されるバッテリ19からの電圧VGと、メインリレー43を介して入力されるバッテリ19からの電圧VDとがワイヤードオアされて、そのワイヤードオアされた電圧が、ECU41の動作電源となるように構成しても良い。
【0095】
(3)本第5実施形態では、継続保存対象データを継続的に更新していくために、SRAM29を用いておらず、マイコン7は、図4(a)及び図4(b)の各処理を実施しない。尚、このため、図10ではマイコン7内にSRAM29を記載しているが、そのSRAM29と、電源回路21が副電源電圧Vsを出力する機能とは削除しても良い。
【0096】
(4)マイコン7は、イグニッションスイッチ17のオンに伴い動作を開始した際に、図5のイニシャル処理に代えて、図11のイニシャル処理を実行する。そして、図11に示すように、マイコン7がイニシャル処理の実行を開始すると、まずS710にて、メインリレー制御回路45へ駆動信号Sdを出力して、メインリレー43をオンさせる。但し、この時点で、メインリレー43は、イグニッションスイッチ17のオンによって既にオンしている。そして、このようにマイコン7から駆動信号Sdが出力されることで、その後にイグニッションスイッチ17がオフされても、メインリレー43はオンしたままとなる。
【0097】
次に、S720にて、NRAM27内のデータを初期化する。
そして、続くS730にて、EEPROM11内の全ての継続保存対象データを読み出してNRAM27にコピーすることで、その各継続保存対象データが前回動作時までの値を継承しつつ更新され得るようにし、その後、エンジン制御処理等の各種処理の実行へ移る。
【0098】
(5)マイコン7は、一定時間毎にイグニッションスイッチ17のオン/オフを判定しており、その判定処理にて、イグニッションスイッチ17がオンからオフされたことを検知すると、図12に示す動作終了時処理を実行する。尚、イグニッションスイッチ17のオン/オフは、上記電圧VGから判定する。
【0099】
そして、マイコン7が図12の動作終了時処理の実行を開始すると、まずS810にて、NRAM27内の全ての継続保存対象データを読み出してEEPROM11にコピーし、その後、S820に進んで、メインリレー制御回路45への駆動信号Sdの出力を停止して、メインリレー43をオフさせる。すると、メインリレー43からの動作電源VDが遮断され、本ECU41の動作が停止することとなる。
【0100】
つまり、本第5実施形態のECU41では、イグニッションスイッチ17がオンされて動作を開始すると、メインリレー43に対する駆動信号Sdを出力することで(S710)、イグニッションスイッチ17のオフ後も動作を継続できるようにし、イグニッションスイッチ17がオフされたことを検知した際に、書込実施条件が成立したとして、NRAM17に記憶されている継続保存対象データの値をEEPROM11に記憶させ(S810)、その後、メインリレー43をオフさせて動作を停止するようにし(S820)、また、イグニッションスイッチ17のオンに伴う動作開始時に、データ復元条件が成立したとして、EEPROM11に記憶されているデータ値をNRAM27にコピーして復元するようにしている(S730)。尚、本第5実施形態では、図12のS810が、データ保存手段としての処理に相当し、図11のS730が、データ復元手段としての処理に相当している。
【0101】
そして、このような第5実施形態のECU41によれば、EEPROM11へのデータ書込回数を減らすために、EEPROM11への本来のデータ書込処理である図12のS810を動作停止直前時のみに実施するようにしているが、診断ツール33からのモニタ頻度情報出力要求を受信した際には、マイコン7が図6〜図9のうちの何れかの通信応答処理を実行するため、前述した第1〜第4実施形態のうちの何れかと同様に、診断ツール33によって読み出したデータ値が前回読み出したデータ値よりも古いと見なされる値になってしまう現象の発生を防止することができる。
【0102】
以上、本発明の一実施形態について説明したが、本発明は、種々の形態を採り得ることは言うまでもない。
例えば、第1〜第4実施形態において、NRAM27を設けずに、継続保存対象データのインクリメント処理を含む各種データ処理をSRAM29上で実施するのであれば(つまり、SRAM29を処理作業用メモリとして用いるのであれば)、図4(a)の処理と図5のS310及びS330とが不要になる。但し、上記第1〜第4実施形態のように、NRAM27を処理作業用メモリとして用い、SRAM29は継続保存対象データの保存のためだけに用いるという構成を採れば、SRAM29の記憶容量を小さく抑えることができるという点で有利である。
【0103】
一方、継続保存対象データは、RateBaseモニタ法で定められているモニタ頻度の分子及び分母のように値が1ずつ増加されるものに限らず、例えば、ある単位変化量ずつ増加又は減少されていくものであっても良く、また、その単位変化量も常に同じ値である必要はない。
【0104】
また更に、書換可能不揮発性メモリとしては、EEPROMに限らず、例えばフラッシュROMを用いても良い。
【図面の簡単な説明】
【図1】第1実施形態のECU(電子制御装置)の構成を表すブロック図である。
【図2】継続保存対象データを説明する説明図である。
【図3】第1実施形態のECUのマイコンが継続保存対象データをNRAM上でインクリメントする際の処理を表すフローチャートである。
【図4】第1実施形態のECUのマイコンがNRAM上で更新される継続保存対象データの値をSRAMとEEPROMとの各々に記憶させるために実行する処理を表すフローチャートである。
【図5】第1実施形態のECUのマイコンで実行されるイニシャル処理を表すフローチャートである。
【図6】第1実施形態のECUのマイコンで実行される通信応答処理を表すフローチャートである。
【図7】第2実施形態のECUのマイコンで実行される通信応答処理を表すフローチャートである。
【図8】第3実施形態のECUのマイコンで実行される通信応答処理を表すフローチャートである。
【図9】第4実施形態のECUのマイコンで実行される通信応答処理を表すフローチャートである。
【図10】第5実施形態のECU(電子制御装置)の構成を表すブロック図である。
【図11】第5実施形態のECUのマイコンで実行されるイニシャル処理を表すフローチャートである。
【図12】第5実施形態のECUのマイコンで実行される動作終了時処理を表すフローチャートである。
【符号の説明】
1,41…電子制御装置(ECU)、3…センサ、5…入力処理回路、7…マイコン、9…通信ライン、11…EEPROM、13…アクチュエータ、15…出力回路、17…イグニッションスイッチ、19…バッテリ、21…電源回路、23…CPU、25…ROM、27…ノーマルRAM(NRAM)、29…スタンバイRAM(SRAM)、31…I/O、33…診断ツール、43…メインリレー、45…メインリレー制御回路、47…NPNトランジスタ、L…コイル
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an electronic control device that continuously saves and updates specific data values that are updated during operation by using a nonvolatile memory that can electrically rewrite stored contents. It is.
[0002]
[Prior art]
2. Description of the Related Art Conventionally, in an electronic control unit for a vehicle, specific data such as fault diagnosis information and control learning values to be continuously stored even when the supply of operating power is stopped, and the processing work used for data processing. The data whose value is updated on the memory (hereinafter referred to as “continuous storage target data”) is written in a nonvolatile memory (hereinafter also referred to as a rewritable nonvolatile memory) such as an electrically rewritable EEPROM. By doing so, the data value can be continuously held and updated.
[0003]
For example, while processing is always performed using a battery-backed RAM (hereinafter also referred to as a backup RAM), data in a predetermined area in the RAM is copied and stored in an EEPROM, and the data is stored when the operating power is turned on. A device that copies data in an EEPROM to a backup RAM and restores the data in the backup RAM if the data in the backup RAM is abnormal at the start of the operation is known (for example, see Patent Document 1).
[0004]
Also, a rewritable nonvolatile memory such as an EEPROM has a limit on the number of times data can be written. Therefore, in order to reduce the number of times data is written to the rewritable nonvolatile memory, this type of electronic control device rewrites the value of the data to be continuously saved only when a predetermined write execution condition is satisfied. It is stored in a possible non-volatile memory.
[0005]
For example, when the backup RAM is a processing work memory as in the above-described apparatus, even if the operation is stopped (that is, the operation power supply is cut off), if there is no battery exhaustion or battery disconnection, the backup RAM is initially used. Since the data to be continuously stored is continuously stored in the backup RAM, the value of the data to be continuously stored is stored in the rewritable nonvolatile memory once every time the electronic control device operates a plurality of times. It is possible.
[0006]
Further, for example, in an electronic control unit for a vehicle, when the ignition switch is turned on or when a main relay for power supply provided outside is turned on, the operation power is supplied, and the electronic control unit is When the operation is performed in response to the turning on of the ignition switch, the main relay may be turned on by itself, so that the operation may be continued even after the ignition switch is turned off. When such a main relay is present, the electronic control unit determines that the ignition switch has been turned off even if the normal RAM that is not backed up by the battery is the processing work memory. By performing the procedure of copying the value of the data to be continuously saved to the rewritable nonvolatile memory and then turning off the main relay, the data writing to the rewritable nonvolatile memory is performed once every time the electronic control device operates once. Frequency (specifically, only immediately before the operation of the electronic control unit is stopped). In this case, the data in the rewritable nonvolatile memory may be copied to the RAM as the processing work memory and restored at the start of the operation when the operation power is turned on.
[0007]
On the other hand, in an electronic control unit for a car, a RateBase monitor method is one of the regulations of the OBD (On-Board Diagnostics) 2 by the CARB (California Atmosphere Resource Conservation Bureau), and the RateBase monitor method is represented by the following equation. It is necessary to continuously store and update the monitoring frequency.
[0008]
Monitoring frequency = number of times of monitoring / number of operations
The monitoring frequency is a frequency at which the failure diagnosis is performed, and exists for each of a plurality of items (that is, a diagnosis target) such as a catalytic converter, a fuel evaporation system, and an oxygen sensor. The number of times of operation (hereinafter, referred to as a denominator) is data whose value is incremented when predetermined traveling conditions defined by laws and regulations are satisfied for the item, and the number of times of monitoring (hereinafter, referred to as a numerator) is The value is incremented when the failure diagnosis execution condition defined by the vehicle maker is satisfied for the item and the normal or abnormal determination is completed (that is, when the failure diagnosis is performed). In addition, both the denominator and the numerator are operated until the ignition switch of the vehicle is turned on and turned off (that is, the operation power is turned on and the operation power is turned off to the electronic control unit for performing the failure diagnosis). In this case, the value is incremented only once, or the value is maintained without being incremented. Furthermore, these monitor frequency data (denominator and numerator data) must be readable by a diagnostic device (also called a diagnostic tool or a diagnostic checker) outside the vehicle that is communicably connected to the electronic control unit.
[0009]
[Patent Document 1]
JP-A-4-336351
[0010]
[Problems to be solved by the invention]
By the way, if the data to be continuously stored is data that must be readable by an external device, such as the monitoring frequency specified by the RateBase monitoring method, the electronic control device receives an output request from the external device. And outputs the value of the data to be continuously stored stored in the processing work memory (that is, the latest value of the data) to an external device. In this case, There's a problem.
[0011]
That is, first, after the latest value of the continuous storage target data stored in the processing work memory is read out to the external device, before the latest value is stored in the rewritable nonvolatile memory, some sort of It is assumed that the data to be continuously saved in the processing work memory is lost due to the cause. Then, the data value in the rewritable nonvolatile memory is copied to the processing work memory by the data restoration function as described above. In this case, the processing work memory includes the external device. A data value older than the read latest value is copied from the rewritable nonvolatile memory. Therefore, if the data is read again by the external device, the data value read at that time is changed to a value that is considered to be older than the previously read data value (a value that goes back in the past). Such an inversion phenomenon of the read data value greatly impairs the apparent reliability of the electronic control device.
[0012]
Note that, by adopting a configuration in which the restoration of data from the rewritable nonvolatile memory to the processing work memory is performed by a notifying device such as a check lamp provided outside the electronic control device, an electronic Although it is possible to confirm that there is no abnormality in the function of the control device itself, it is useless to operate the alarm even though it is not a failure, and the reversal phenomenon of the read data value as described above may occur. It is important not to.
[0013]
Accordingly, the present invention provides an electronic control unit that continuously saves and updates specific data using a rewritable nonvolatile memory such as an EEPROM, and that can read the data value by an external device. It is an object of the present invention to prevent a phenomenon in which a read data value becomes a value regarded as being older than a previously read data value.
[0014]
Means for Solving the Problems and Effects of the Invention
In order to achieve the above object, the electronic control device according to claim 1 continuously stores data to be continuously stored whose value is updated on the processing work memory even when the supply of the operation power is stopped. For this purpose, a rewritable nonvolatile memory capable of electrically rewriting the stored contents is provided.
[0015]
In the electronic control device according to the first aspect, the data storage means may store the value of the data to be continuously stored in the processing work memory when the predetermined write execution condition is satisfied (that is, at that time, Is stored in the rewritable nonvolatile memory, and when the predetermined data restoration execution condition is satisfied, the data stored in the rewritable nonvolatile memory is stored in the rewritable nonvolatile memory. By copying the value of the data to be saved to the memory for processing work, even if the data to be continuously saved in the memory for processing work disappears, the value of the data to be continuously saved can be continuously updated. Further, when the output unit receives an output request for the data to be continuously stored from the external device, the output unit outputs the value of the data to be continuously stored stored in the processing work memory to the external device.
[0016]
In particular, the electronic control device according to claim 1 is provided with a second data storage unit separately from the data storage unit, and the second data storage unit is provided with the output request from an external device. When receiving the data, the value of the data to be continuously stored stored in the processing work memory is stored in the rewritable nonvolatile memory.
[0017]
Assuming that the electronic control device according to the first aspect does not include the second data storage unit which is a characteristic part of the present device, as described above, the continuation data stored in the processing work memory is used. After the latest value of the storage target data is read out to the external device and before the latest value is stored in the rewritable nonvolatile memory by the data storage means (that is, before the predetermined write execution condition is satisfied). 2), the data to be continuously saved in the processing work memory is lost for some reason, and thereafter, the data restoration execution condition is satisfied, and the data value in the rewritable nonvolatile memory is changed by the data restoration means to the processing work memory. If the data to be continuously saved is read again by the external device after being copied to the memory, then the data value read at that time is read last time. Which may become a value that is regarded as older than the data value.
[0018]
However, according to the electronic control unit of the first aspect, the electronic control unit is provided with the second data storage unit, and also when receiving the output request from the external device and outputting the latest value of the data to be continuously stored to the external device. Since the latest value of the continuous storage target data stored in the processing work memory is stored in the nonvolatile memory, the latest value of the continuous storage target data stored in the processing work memory is read out to the external device. Thereafter, before the latest value is stored in the rewritable nonvolatile memory, the possibility that the data to be continuously saved in the processing work memory is lost can be extremely reduced.
[0019]
Therefore, in order to reduce the number of times of writing data to the rewritable nonvolatile memory, even if the writing execution condition that triggers the operation of the original data storage unit is set to a low frequency, the data is read out by the external device. It is possible to prevent a phenomenon that the data value becomes a value regarded as being older than the data value read last time.
[0020]
By the way, when an output request is received from an external device, the output means may be operated first, and then the second data storage means may be operated. There is a small possibility that after the latest value of the data to be continuously saved is output and before the latest value is stored in the rewritable nonvolatile memory, the latest value is lost due to a momentary power interruption or the like.
[0021]
Therefore, in order to completely eliminate the possibility, the output unit terminates the storage of the value of the data to be continuously stored in the rewritable nonvolatile memory by the second data storage unit. Then, the value of the data to be continuously stored stored in the processing work memory may be output to the external device. That is, upon receiving an output request from the external device, first, the second data storage means operates, and the storage of the value of the data to be continuously stored in the rewritable nonvolatile memory by the second data storage means ends. Then, the output means may be configured to operate.
[0022]
In the case of the electronic control unit according to the second aspect, at the time when the output means operates, the value of the continuous storage target data stored in the processing work memory and the continuous storage target data stored in the rewritable nonvolatile memory are stored. Since the data value always matches, the output means reads the value of the data to be continuously saved from the rewritable nonvolatile memory and stores the read value in the data to be continuously saved stored in the processing work memory. May be configured to be output to an external device as the value of.
[0023]
On the other hand, in the case of the electronic control device according to the second aspect, between the time when the output request is received from the external device and the time when the output means starts operating, the data is written to the rewritable nonvolatile memory by the second data storage means. Since the value of the data to be continuously stored is stored, the response time from receiving the output request to returning the value of the data to be continuously stored to the external device tends to be long. An external device connected to this type of electronic control device may be configured to make a timeout determination if no response is returned within a specified time after issuing a request.
[0024]
For this reason, in the electronic control device according to the second aspect, if the time required for the second data storage means to store the value of the data to be continuously stored in the rewritable nonvolatile memory becomes long, it is possible that the data is normally normal. Therefore, there is a possibility that the timeout determination is performed on the external device side.
[0025]
Therefore, in the electronic control device according to the third aspect, a preceding response means is provided for the electronic control device according to the second aspect, and when the preceding response means receives an output request from an external device, the second response means is provided. It operates before the data storage means operates or during the operation of the second data storage means, and outputs a response signal to the external device to prevent timeout determination on the external device side. Like that. According to the electronic control device of the third aspect, the data amount of the continuous storage target data is large, and the second data storage unit stores the value of the continuous storage target data in the rewritable nonvolatile memory. It is possible to prevent the external device from making a timeout determination even if the time required for the operation becomes long.
[0026]
Next, in the electronic control device according to the fourth aspect, in the electronic control device according to the first to third aspects, the second data storage unit includes a value of the data to be continuously stored stored in the processing work memory; Compares the value of the data to be saved continuously in the rewritable non-volatile memory, and can rewrite the value of the data to be saved continuously in the processing work memory only when both values are different. It is stored in a non-volatile memory.
[0027]
According to such an electronic control device, the number of times of writing data to the rewritable nonvolatile memory can be reduced. In other words, when the output request from the external device is frequently repeated, the data value is stored in the rewritable nonvolatile memory each time the latest value of the data to be continuously saved is not updated. In such a case, the number of times of writing data to the rewritable nonvolatile memory is unnecessarily increased. However, according to the electronic control device of the fourth aspect, such waste can be eliminated.
[0028]
On the other hand, as a processing work memory, a standby RAM (equivalent to the above-described backup RAM) to which power for data retention is constantly supplied, and an operation of the electronic control device associated with supply of operation power to the electronic control device are performed. Any of a normal RAM (that is, a normal RAM not backed up by a battery) to which power for data retention is supplied only when the power is on may be used.
[0029]
Here, if the normal RAM is used as the processing work memory, for example, as described in the section of “Prior Art”, a power supply main relay is provided and an operation power supply switch (hereinafter referred to as a power supply switch). ) Is turned on and the operation is started, the main relay is turned on by itself, so that the operation can be continued even after the power supply switch is turned off. Further, when it is detected that the power supply switch is turned off, writing is performed. Assuming that the execution condition is satisfied, the value of the data to be continuously saved stored in the normal RAM is stored in the rewritable nonvolatile memory, and then the main relay is turned off. , The frequency of writing data to the rewritable nonvolatile memory can be set to one time each time the electronic control device operates once. In this case, at the start of the operation, assuming that the data restoration condition is satisfied, the data value stored in the rewritable nonvolatile memory may be copied and restored to the normal RAM as the processing work memory.
[0030]
Further, if the standby RAM is used as a processing work memory, as described in the section of “Prior Art”, even if the operation is stopped (while the operation power supply is cut off), the data to be continuously stored is temporarily stored in the standby RAM. Is continuously stored, the frequency at which the original data storage means operates (that is, the frequency at which the writing execution condition is satisfied) can be set to one time every time the electronic control device operates a plurality of times. This is advantageous in reducing the number of times of writing data to the rewritable nonvolatile memory. Then, in this case, at the start of the operation when the operation power is turned on, it is determined whether or not the data stored in the standby RAM is normal. If it is determined that the data is not normal, it is determined that the data restoration condition is satisfied. What is necessary is just to copy the data value stored in the rewritable nonvolatile memory to the standby RAM and restore it.
[0031]
However, in order to keep the storage capacity of the standby RAM small, it is also possible to adopt a configuration in which the normal RAM is used as a processing work memory, and the standby RAM is used only for storing data to be continuously stored.
Therefore, in the electronic control device according to the fifth aspect, in the electronic control device according to the first to fourth aspects, the standby RAM, the normal RAM as a processing work memory, and the data to be continuously saved from the normal RAM to the standby RAM. Copy means for copying the latest value, wherein the data storage means, the second data storage means, and the output means read the value of the data to be continuously stored from the normal RAM or the standby RAM, and store the read value. The processing is performed as the value of the data to be continuously stored stored in the processing work memory (that is, the latest value of the data to be continuously stored). Further, the data restoring means determines whether or not the storage data in the standby RAM is normal when the electronic control device is started in response to the supply of the operation power, and determines whether the storage data in the standby RAM is normal. Is determined, the value of the data to be continuously saved is copied from the standby RAM to the normal RAM, and if it is determined that the data stored in the standby RAM is not normal, it is determined that the data restoration execution condition is satisfied and the rewrite is performed. The configuration is such that the value of the data to be continuously stored stored in the possible nonvolatile memory is copied to the standby RAM and the normal RAM.
[0032]
According to the electronic control device of the fifth aspect, as in the case where the standby RAM is used as the processing work memory, even when the operation is stopped (while the supply of the operation power is cut off), the dead battery or the battery is disconnected. Otherwise, since the data to be continuously stored is continuously stored in the standby RAM for the time being, it is possible to set the frequency of operation of the original data storage means to a rate of one time every time the electronic control device operates a plurality of times. And the storage capacity of the standby RAM can be small.
[0033]
Next, an electronic control device according to a sixth aspect is an electronic control device in which the electronic control device according to the first to fifth aspects is applied to a vehicle electronic control device that controls on-vehicle equipment mounted on a vehicle. Detecting means for detecting that the vehicle is in the operating state; failure diagnosis means for performing a failure diagnosis of a diagnosis target in the in-vehicle device when a predetermined failure diagnosis execution condition is satisfied; and In the meantime, when the predetermined operation state is detected by the detection means, the value of the number of operations stored in the processing work memory is rewritten to a value updated by one time, and the failure diagnostic means And a data updating means for rewriting the value of the number of times of failure diagnosis stored in the processing work memory to a value updated by one time when the diagnosis is performed. In this electronic control unit, the number of times of operation and the number of times of failure diagnosis whose values are updated on the processing work memory by the data updating means are data to be continuously saved.
[0034]
According to the electronic control device of the sixth aspect, in order to reduce the number of times data is written to the rewritable nonvolatile memory, the frequency of establishing the write execution condition that triggers the operation of the original data storage unit is low. Even if it is set to the value, the occurrence of the phenomenon that the values of the number of operations and the number of failure diagnoses read by the external device are considered to be older than the previously read value (specifically, a small value) is prevented. can do.
[0035]
In the electronic control device according to the sixth aspect, the external device may be a diagnostic device for a vehicle connectable to the electronic control device as described in the seventh aspect.
[0036]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, an embodiment of the present invention will be described with reference to the drawings.
First, FIG. 1 is a block diagram illustrating a configuration of an electronic control unit (hereinafter, referred to as an ECU) 1 according to a first embodiment that controls an internal combustion engine as an in-vehicle device mounted on an automobile.
[0037]
As shown in FIG. 1, the ECU 1 includes an input processing circuit 5 for inputting signals from various sensors 3 for detecting the operating state of the engine and the state of peripheral devices of the engine and performing waveform processing, and an input processing circuit 5. (Hereinafter, referred to as a microcomputer) 7 that performs various processes related to engine control, failure diagnosis, and the like based on sensor signals from the microcomputer 7, and is connected to the microcomputer 7 via a communication line 9 and is calculated by the microcomputer 7. EEPROM 11 as a rewritable nonvolatile memory for storing data (data to be continuously stored) that should be continuously stored even when the supply of operating power to the ECU 1 is stopped, and data from the microcomputer 7. In response to the control signal, an actuator 13 such as a fuel injection device (injector) or an ignition device (igniter) attached to the engine is driven. The power supply voltage (VD) is supplied from the battery 19 when the ignition switch 17 of the vehicle is turned on. For example, 5 V) Vm is supplied, and from a voltage VB constantly supplied from the battery 19, a sub power supply voltage Vs (a power supply for holding data to the standby RAM) for the standby RAM 29 in the microcomputer 7 to always hold data. And a power supply circuit 21 for generating and outputting the same.
[0038]
The power supply circuit 21 outputs a reset signal to the microcomputer 7 only for a predetermined period of time when the power supply voltage Vm is considered to be stable after the ignition switch 17 serving as a power supply switch is turned on to start supplying the power supply voltage Vm. It also has a so-called power-on reset function.
[0039]
The microcomputer 7 includes a well-known CPU (Central Processing Unit) 23 for executing the program, and a program executed by the CPU 23 (specifically, an instruction code constituting the program and a fixed code referred to when the program is executed). (A non-volatile ROM 25 for storing data), a volatile RAM 27 as a processing work memory used by the CPU 23 for data processing, and a standby RAM (battery) capable of receiving the sub power supply voltage Vs from the power supply circuit 21 and constantly storing data. This is a backed-up RAM, hereinafter referred to as SRAM) 29, and an I / O 31 for exchanging signals and data between the input processing circuit 5, the EEPROM 11, the output circuit 15, and the like. Note that the RAM 27 is not backed up by a battery, and the power supply voltage Vm from the power supply circuit 21 is supplied as power for data retention. In the following description, this RAM 27 is referred to as an NRAM (normal RAM) 27 in order to clearly distinguish it from the SRAM 29.
[0040]
The ECU 1 configured as described above operates while receiving the voltage VD from the battery 19 while the ignition switch 17 is turned on.
In the ECU 1, when the ignition switch 17 is turned on and the reset signal from the power supply circuit 21 to the microcomputer 7 is released, the microcomputer 7 starts operating from an initial state, and performs an initial process described later. Control processing for controlling the engine is performed. The operation of the microcomputer 7 is based on the fact that the CPU 23 executes a program in the ROM 25.
[0041]
In addition, the microcomputer 7 performs a numerator (failure) representing the above-described monitoring frequency for each of the failure diagnosis target items (catalytic converter, fuel evaporation system, oxygen sensor, etc.) defined by the RateBase monitoring method of the CARB / OBD2. The values of the number of times of monitoring as the number of times of diagnosis) and the denominator (the number of times of operation) are continuously stored and updated using the EEPROM 11 and the SRAM 29.
[0042]
Further, a diagnostic tool 33 (corresponding to a diagnostic device as an external device) outside the vehicle can be connected to the ECU 1 via a diagnostic connector 35. In response to an output request related to the failure diagnosis from the diagnostic tool 33, the ECU 1 outputs data having contents corresponding to the request to the diagnostic tool 33. (Ie, a request for output of the numerator and denominator of the monitor frequency, hereinafter referred to as a monitor frequency information output request), the numerator and denominator of the monitor frequency for each failure diagnosis target item stored in the NRAM 27. Is output to the diagnostic tool 33. In FIG. 1, reference numeral 37 denotes a communication circuit for the microcomputer 7 to communicate with the diagnostic tool 33.
[0043]
Then, next, the contents of the processing executed by the microcomputer 7 of the ECU 1 to continuously save and update the value of the data to be continuously saved, which is each of the numerator and denominator of the monitoring frequency for each failure diagnosis target item. Will be described with reference to FIGS.
First, as shown in FIG. 2, in the present embodiment, a total of n pieces of continuous storage target data are numbered in order from 0. For example, the 0th data is the numerator of the monitoring frequency for the fuel evaporation system (hereinafter simply referred to as “evaporation”), the 1st data is the denominator of the monitoring frequency for the evaporation, and the 2nd data is The third data is a denominator of the monitoring frequency for the catalyst, and the fourth data is a numerator of the monitoring frequency for the oxygen sensor. The fifth data is the denominator of the monitoring frequency for the oxygen sensor.
[0044]
Although not specifically shown, each of the EEPROM 11 and the SRAM 29 has an area for storing a numerator and a denominator for each failure diagnosis target item. The data of the numerator and the denominator are stored in the corresponding areas for the failure diagnosis items in the EEPROM 11 and the SRAM 29, respectively.
[0045]
Then, as shown in FIG. 3A, the microcomputer 7 determines whether or not each failure diagnosis target item satisfies a predetermined traveling condition defined by laws and regulations for the item (in other words, the vehicle Determines, for example, whether or not the failure diagnosis target item has reached a predetermined operating state defined by laws and regulations), for example, periodically (S110), and when it is determined that the traveling condition is satisfied (S110: YES), The value of the denominator (the number of operations) of the corresponding item is incremented on the NRAM 27 (S120).
[0046]
As shown in FIG. 3B, the microcomputer 7 periodically determines, for example, whether or not the failure diagnosis execution condition of each failure diagnosis target item is satisfied (S130). If it is determined that the condition is satisfied (S130: YES), a failure diagnosis process is performed for the corresponding item to determine whether the item is normal or abnormal (S140). The value is incremented on the NRAM 27 (S150).
[0047]
When the microcomputer 7 increments the numerator or denominator of any of the failure diagnosis target items, the incremented data does not increment any more during the current operation period (that is, during the current vehicle driving period). It has become. 3 (a) and 3 (b), the value of each continuation storage target data (numerator and denominator for each failure diagnosis target item) stored in the NRAM 27 is incremented with respect to the data. When the condition is satisfied, the value is updated to the value updated only once.
[0048]
Next, FIGS. 4A and 4B are flowcharts showing a process executed by the microcomputer 7 to store the value of the data to be continuously saved updated on the NRAM 27 in each of the SRAM 29 and the EEPROM 11. . The process of FIG. 4A is repeatedly executed at regular intervals (every 16 ms in the present embodiment), and the process of FIG. 4B is executed only once while the ECU 1 is operating. Is done.
[0049]
First, when the microcomputer 7 starts executing the processing shown in FIG. 4A, in the first S210, it is determined whether or not the current timing is the SRAM update timing. In the present embodiment, it is determined that it is the SRAM update timing every 32 ms, which is a ratio of one in two of the processes.
[0050]
If it is determined in S210 that it is the time to update the SRAM, the process proceeds to S220, in which all the continuously stored data from the 0th to the “n−1” th in the NRAM 27 is read and copied to the SRAM 29, After that, the process ends.
[0051]
If it is determined in S210 that it is not the time to update the SRAM, the process ends.
On the other hand, when the microcomputer 7 starts executing the processing shown in FIG. 4B, first, in S230, it is determined whether or not the current timing is the EEPROM update timing.
[0052]
If it is determined that it is the EEPROM update timing, the process proceeds to S240, in which all the continuously stored data from the 0th to the “n−1” th in the SRAM 29 is read and copied to the EEPROM 11, and thereafter, The process ends. Therefore, if the process of S240 is executed, the value of each continuous storage target data stored in the NRAM 27 at that time is also stored in the EEPROM 11. That is, the latest value of each continuous storage target data in the NRAM 27 is always copied to the SRAM 29 by the processing of FIG.
[0053]
If it is determined in step S230 that it is not the EEPROM update timing, the process ends.
In the present embodiment, in S230, the number of times that the ECU 1 operates in response to the turning-on of the ignition switch 17 is determined by using a counter in the SRAM 29, such as the first day, the second time, the third time, the first time, and so on. The count is repeated in the cycle, and when the count is the third time, it is determined that it is the EEPROM update timing. Therefore, the process of S240 is executed once every time the ECU 1 operates three times.
[0054]
Next, FIG. 5 is a flowchart showing an initial process executed when the microcomputer 7 starts operation when the ignition switch 17 is turned on.
As shown in FIG. 5, when the microcomputer 7 starts the execution of the initial processing, first in S310, the data in the NRAM 27 is initialized, and in S320, it is determined whether or not the data stored in the SRAM 29 is normal. I do. In S320, it is determined whether or not there is a history of battery disconnection (battery 19 has been removed), and the data itself in the SRAM 29 is checked by a method such as parity check or checksum. If there is no history and the data itself is normal, it is determined that the data stored in the SRAM 29 is normal.
[0055]
If it is determined that the data in the SRAM 29 is normal (S320: YES), the process proceeds to S330, where all (ie, n) data to be continuously stored in the SRAM 29 are read and copied to the NRAM 27, Thereafter, the process proceeds to execution of various processes such as the engine control process and the processes of FIGS.
[0056]
On the other hand, if it is determined in S320 that the data in the SRAM 29 is not normal (S320: NO), the process proceeds to S340, in which all (n pieces of) data to be continuously stored in the EEPROM 11 are read out. The data is copied to the SRAM 29, and then the process of S330 is performed.
[0057]
That is, in this initial process, if the data in the SRAM 29 is normal (S320: YES), the SRAM 29 stores the last value of the data to be continuously saved until the previous operation in S220 of FIG. Therefore, in the process of S330, all the continuous storage target data in the SRAM 29 is copied to the NRAM 27 which is a working memory of the increment process, and each of the continuous storage target data inherits the value up to the previous operation. While being updated.
[0058]
In addition, since the value of the data to be continuously saved at least three times before the operation is stored in the EEPROM 11 by the process of S240 in FIG. 4B, if the data in the SRAM 29 is not normal (S320: (NO), all the data to be continuously stored in the EEPROM 11 are copied to the SRAM 29 (S340), and the process of S330 is performed. For this reason, even if the data in the SRAM 29 becomes abnormal due to a dead battery or a dead battery, the value of the continuous storage target data stored in the EEPROM 11 is copied to the SRAM 29 and the NRAM 27. Will be continuously updated.
[0059]
In the present embodiment, the writing of the data to be continuously saved to the EEPROM 11 is performed once every three times of operation of the ECU 1. Therefore, the data is transferred from the EEPROM 11 to the SRAM 29 and the NRAM 27 in S340. When restoring, the data value is not always the true final value. However, in the present embodiment, knowing that, priority is given to reducing the number of times of writing data to the EEPROM 11.
[0060]
Next, FIG. 6 is a flowchart illustrating a communication response process executed when the microcomputer 7 receives a monitor frequency information output request from the diagnostic tool 33.
As shown in FIG. 6, when the microcomputer 7 starts the execution of the communication response processing, first, in S410, all the data to be continuously stored (the denominator and the numerator data of the monitor frequency for each failure diagnosis target item) are stored in the SRAM 29. It reads the data and transmits the read data to the diagnostic tool 33. That is, in the ECU 1, by executing the process of S410, the reading of the data to be continuously stored by the diagnostic tool 33 is realized.
[0061]
Then, in the next S420, as in S240 of FIG. 4B, all the continuous storage target data is read from the SRAM 29, and the read data (that is, the same data transmitted to the diagnostic tool 33) is read. Is copied to the EEPROM 11, and thereafter, the communication response process ends.
[0062]
As described above, since the data having the same value as the data to be continuously stored in the NRAM 27 is always copied to the SRAM 29 by the processing of FIG. In S240 of b), the data to be continuously stored is read from the NRAM 27, not from the SRAM 29, and the data is copied to the EEPROM 11, and also in S410 of FIG. Then, the data may be transmitted to the diagnostic tool 33.
[0063]
Next, the operation of the ECU 1 according to the first embodiment as described above will be described.
First, it is assumed that the process of S420 is not provided in the communication response process of FIG.
In this case, after the continuation storage target data is read out by the diagnostic tool 33, before the storage of the continuation storage target data in the EEPROM 11 by the process of S240 in FIG. It is assumed that the supply of VD is stopped, the ECU 1 stops operating, and furthermore, while the operation is stopped, the data stored in the SRAM 29 becomes abnormal due to a dead battery or the like.
[0064]
Then, when the next operation of the ECU 1 is started, the processing of S340 and S330 of FIG. 5 is executed in that order, whereby the data to be continuously stored stored in the EEPROM 11 is copied to the SRAM 29 and the NRAM 27, and thereafter, In this case, one of the data values copied from the EEPROM 11 to the RAMs 27 and 29 is considered to be older than the data value read to the diagnostic tool 33 (small data value). Value).
[0065]
Therefore, if the continuous storage target data is read again by the diagnostic tool 33, the data value read at that time is smaller than the data value read last time (a value that goes back in the past). There is a possibility of becoming.
When such a reversal phenomenon of the read data value occurs, the reliability of the ECU 1 is questioned even though the operation itself of the ECU 1 is normal.
[0066]
Therefore, in the ECU 1 of the first embodiment, the processing of S420 similar to S240 of FIG. 4B is provided in the communication response processing of FIG. Even when the latest value of the data to be continuously stored stored in the NRAM 27 is output to the diagnostic tool 33, the latest value of the data to be continuously stored is stored in the EEPROM 11.
[0067]
For this reason, after the latest value of the continuous storage target data updated on the NRAM 27 is read out to the diagnostic tool 33, before the latest value is stored in the EEPROM 11, the latest value of the continuous storage target data is stored in the NRAM 27. And the possibility of being lost from the SRAM 29 can be extremely reduced. Therefore, in order to reduce the number of times of data writing to the EEPROM 11, the execution frequency of S240 in FIG. 4B, which is the original data writing process to the EEPROM 11, is set to a rate of one time every time the ECU 1 operates three times. Even if it is set to a small value, it is possible to prevent the occurrence of a reversal phenomenon in which the data value read by the diagnostic tool 33 becomes a value considered to be older than the data value read last time.
[0068]
In this embodiment, S240 in FIG. 4B corresponds to a process as a data storage unit, S320 to S340 in FIG. 5 correspond to a process as a data restoration unit, and S410 in FIG. S420 in FIG. 6 corresponds to processing as output means, and S420 in FIG. 6 corresponds to processing as second data storage means. Further, the processing in FIG. 4A corresponds to the processing as a copy unit. Then, S110 in FIG. 3A corresponds to the processing as the detecting means, S130 and S140 in FIG. 3B correspond to the processing as the failure diagnosing means, and S120 and FIG. Step S150 in FIG. 3B corresponds to the processing as data updating means.
[0069]
By the way, in the ECU 1 according to the first embodiment, although it is considered extremely rare, during a short period from the execution of S410 in FIG. 6 to the end of S420 in FIG. When an instantaneous interruption occurs, there is a possibility that the latest value of the data to be continuously saved is lost (that is, storage in the EEPROM 11 fails).
[0070]
Therefore, a second embodiment capable of eliminating such a possibility will be described next.
The ECU of the second embodiment is different from the ECU 1 of the first embodiment only in that the microcomputer 7 executes the communication response process of FIG. 7 instead of the communication response process of FIG.
[0071]
Then, as shown in FIG. 7, in the communication response process according to the second embodiment, first, in S510, the same process as S420 in FIG. 6 is performed, and in the next S520, the same process as S410 in FIG. I do.
That is, when the ECU of the second embodiment receives a monitor frequency information output request from the diagnostic tool 33, first, it reads out all the data to be continuously stored from the SRAM 29 and copies it to the EEPROM 11 (S510). The continuous storage target data copied from the SRAM 29 to the EEPROM 11 is transmitted to the diagnostic tool 33 (S520).
[0072]
According to the ECU of the second embodiment, the latest value of the data to be continuously stored is output to the diagnostic tool 33, and the latest value is stored in the EEPROM 11 before the latest value is stored in the EEPROM 11. It is possible to completely eliminate the possibility that the power is lost due to a momentary power interruption or the like.
[0073]
Also in the second embodiment, in S510 in FIG. 7, the data to be continuously stored is read from the NRAM 27, not from the SRAM 29, and the data is copied to the EEPROM 11. In S520 in FIG. The data to be continuously saved may be read from the NRAM 27 and transmitted to the diagnostic tool 33. And this is the same also about 3rd Embodiment mentioned later.
[0074]
Next, a third embodiment will be described.
The ECU of the third embodiment is different from the ECU of the second embodiment only in that the microcomputer 7 executes the communication response processing of FIG. 8 instead of the communication response processing of FIG.
[0075]
As shown in FIG. 8, in the communication response process according to the third embodiment, the process of S505 is added before S510 in the communication response process of FIG. 33, a response signal indicating that the storage process in the EEPROM 11 is being performed, which is a response signal for preventing a timeout determination on the diagnostic tool 33 side.
[0076]
That is, the diagnostic tool 33 is configured to make a timeout determination if no response is returned within a specified time after issuing the output request.
Then, in the above-described ECU according to the second embodiment, after receiving the monitor frequency information output request from the diagnostic tool 33, before transmitting the requested data to the diagnostic tool 33 in S520, the data writing process to the EEPROM 11 (S510 ), The response time from receiving the monitor frequency information output request to returning the data to the diagnostic tool 33 becomes longer than the specified time when the number of data to be continuously stored to be written in the writing process increases. However, the timeout may be determined on the diagnostic tool 33 side in spite of the fact that it is normal.
[0077]
Therefore, in the communication response process of the third embodiment, S505 is added before S510 to the communication response process (FIG. 7) of the second embodiment, and the time-out determination is made to the diagnostic tool 33 in S505. A response signal is output to prevent this from being performed.
[0078]
Therefore, according to the ECU of the third embodiment, the total data amount of the data to be continuously saved is large, and the time required to write the data to be continuously saved to the EEPROM 11 in S510 of the communication response process increases. Also, it is possible to prevent the external device from making a timeout determination.
[0079]
Note that, in the third embodiment, S505 in FIG. 8 corresponds to a process as a preceding response unit. If the time required to write the data to be continuously saved to the EEPROM 11 becomes longer, for example, the data is written to the EEPROM 11 in S510. A response signal similar to the above may be transmitted.
[0080]
Next, a fourth embodiment will be described.
The ECU of the fourth embodiment is different from the ECU of the third embodiment only in that the microcomputer 7 executes the communication response process of FIG. 9 instead of the communication response process of FIG.
[0081]
Then, as shown in FIG. 9, in the communication response process according to the fourth embodiment, the processes of S610 to S650 are performed instead of S510 in the communication response process of FIG. In FIG. 9, the same processes as those in FIG. 8 are denoted by the same step numbers.
[0082]
That is, as shown in FIG. 9, the microcomputer 7 starts execution of the communication response process, transmits a response signal for preventing timeout determination to the diagnostic tool 33 in S505, and then proceeds to S610 to continue to save The variable i indicating the data number is set to 0. Then, in subsequent S620, it is determined whether or not the value of the variable i is smaller than the total number (number of data) n of the data to be continuously stored. If it is determined that the value of the variable i is smaller than the number n of data, (S620: YES), and proceeds to S630.
[0083]
In S630, the SRAM value of the i-th continuous storage target data corresponding to the value of the variable i (that is, the value of the i-th continuous storage target data stored in the SRAM 29) S [i] is read from the SRAM 29 and the EEPROM 11 , The EEPROM value of the i-th continuous storage target data (ie, the value of the i-th continuous storage target data stored in the EEPROM 11) E [i] is read out, and “E [i] ≠ S [i]” is obtained. It is determined whether or not there is (that is, whether or not E [i] and S [i] are different).
[0084]
If “E [i] ≠ S [i]” is not satisfied (S630: NO), the process proceeds to S640, in which the value of the variable i is incremented by 1, and then returns to S620.
If it is determined in S630 that “E [i] ≠ S [i]” (S630: YES), the process proceeds to S650, where S [i] is written to the EEPROM 11 as E [i]. . Then, the process proceeds to S640, in which the value of the variable i is incremented by 1, and then returns to S620.
[0085]
On the other hand, if it is determined in step S620 that the value of the variable i is not smaller than the number n of data (i.e., i ≧ n) (S620: NO), the process proceeds to step S520, and The data to be continuously stored is read, and the read data is transmitted to the diagnostic tool 33. Thereafter, the communication response process ends.
[0086]
In other words, in this communication response process, data writing to the EEPROM 11 is not necessarily performed, but the process of S610 to S650 searches for the data to be continuously saved in which the EEPROM value and the SRAM value do not match, and the two values are equal. Only when there is data that does not match, it is determined that the EEPROM value of the data is not the latest value stored in the NRAM 27, and the SRAM value treated as the latest value is stored in the EEPROM 11. .
[0087]
According to the ECU of the fourth embodiment, when the monitor frequency information output request is received from the diagnostic tool 33, the latest value of the continuous storage target data is already stored in the EEPROM 11 ( In other words, since writing to the EEPROM 11 is not performed (even though the value of the data to be continuously saved is not updated in the NRAM 27), the number of times of writing data to the EEPROM 11 is effectively saved. be able to.
[0088]
In the fourth embodiment, the SRAM value is treated as the latest value in the NRAM 27. However, in S630 of FIG. 9, instead of using S [i] read from the SRAM 29, the i-th continuation is performed from the NRAM 27. The value N [i] of the storage target data is read, and it is determined whether or not “E [i] ≠ N [i]”. In S650 of FIG. 9, the value N [i] read from the NRAM 27 is The data may be written in the EEPROM 11 as E [i]. Similarly, in S520 of FIG. 9, the data to be continuously stored may be read from the NRAM 27 and transmitted to the diagnostic tool 33.
[0089]
Next, an ECU according to a fifth embodiment will be described.
First, FIG. 10 is a block diagram illustrating a configuration of the ECU 41 according to the fifth embodiment. The ECU 41 of the fifth embodiment also controls the engine of the automobile, similarly to the ECUs of the above-described embodiments. Further, in FIG. 10, the same components as those in FIG. 1 are denoted by the same reference numerals, and detailed description thereof will be omitted.
[0090]
As shown in FIG. 10, the ECU 41 of the fifth embodiment is different from any one of the first to fourth embodiments in the following points (1) to (5). I have.
(1) The voltage VD from the battery 19 is supplied not via the ignition switch 17 but via a main relay 43 provided outside the ECU 41 as power supply switching means. That is, when the main relay 43 is turned on (specifically, the contact of the main relay 43 is short-circuited), the voltage VD is supplied from the battery 19 to the power supply circuit 21 to supply power to the microcomputer 7 and other parts in the ECU 41. The voltage Vm is supplied.
[0091]
(2) The ECU 41 is provided with a main relay control circuit 45 for turning on / off the main relay 43.
The main relay control circuit 45 is configured such that the voltage VG from the battery 19 input to the ECU 41 via the ignition switch 17 and the driving signal Sd from the microcomputer 7 are wired-ORed by a diode or the like and supplied to the base. The transistor 47 is configured as a main part. The collector of the NPN transistor 47 is connected to the other end of the coil L of the main relay 43 whose one end is connected to the plus terminal of the battery 19.
[0092]
For this reason, in the main relay control circuit 45, when the ignition switch 17 is turned on or the drive signal Sd is output from the microcomputer 7, the transistor 47 is turned on, and the transistor 47 turns on the current from the coil L of the main relay 43. And the main relay 43 is turned on accordingly.
[0093]
Therefore, the voltage VD as the operating power supply is supplied to the ECU 41 when the ignition switch 17 is turned on or when the main relay 43 is turned on by the drive signal Sd from the microcomputer 7. Therefore, when the ECU 41 operates in response to the turning on of the ignition switch 17, the ECU 41 turns on the main relay 43 by itself, so that the operation can be continued even after the ignition switch 17 is turned off.
[0094]
The transistor 47 of the main relay control circuit 45 is driven only by the drive signal Sd from the microcomputer 7, and the voltage VG from the battery 19 input via the ignition switch 17 and the voltage VG input from the battery 19 via the main relay 43. The voltage VD from the battery 19 may be wired-ORed, and the wired-ORed voltage may be used as an operating power source of the ECU 41.
[0095]
(3) In the fifth embodiment, in order to continuously update the data to be continuously saved, the SRAM 29 is not used, and the microcomputer 7 performs the processing shown in FIGS. 4A and 4B. Is not implemented. For this reason, although the SRAM 29 is shown in the microcomputer 7 in FIG. 10, the SRAM 29 and the function of the power supply circuit 21 outputting the sub power supply voltage Vs may be deleted.
[0096]
(4) When the microcomputer 7 starts operating in response to the turning on of the ignition switch 17, the microcomputer 7 executes the initial processing of FIG. 11 instead of the initial processing of FIG. Then, as shown in FIG. 11, when the microcomputer 7 starts executing the initial processing, first, in S710, the microcomputer 7 outputs a drive signal Sd to the main relay control circuit 45 to turn on the main relay 43. However, at this point, the main relay 43 has already been turned on by turning on the ignition switch 17. The output of the drive signal Sd from the microcomputer 7 allows the main relay 43 to remain on even if the ignition switch 17 is subsequently turned off.
[0097]
Next, in S720, the data in the NRAM 27 is initialized.
In S730, by reading out all the data to be continuously stored in the EEPROM 11 and copying the data to the NRAM 27, the data to be continuously stored can be updated while inheriting the values up to the previous operation. Then, the process proceeds to execution of various processes such as an engine control process.
[0098]
(5) The microcomputer 7 determines whether the ignition switch 17 is on or off at regular intervals, and upon detecting that the ignition switch 17 has been turned off from on in the determination process, terminates the operation shown in FIG. Perform time processing. The ON / OFF of the ignition switch 17 is determined from the voltage VG.
[0099]
When the microcomputer 7 starts executing the processing at the end of the operation shown in FIG. 12, first, in S810, all the data to be continuously stored in the NRAM 27 is read and copied to the EEPROM 11, and thereafter, the process proceeds to S820, where the main relay control is executed. The output of the drive signal Sd to the circuit 45 is stopped, and the main relay 43 is turned off. Then, the operation power supply VD from the main relay 43 is shut off, and the operation of the ECU 41 stops.
[0100]
That is, in the ECU 41 of the fifth embodiment, when the ignition switch 17 is turned on and the operation is started, the drive signal Sd for the main relay 43 is output (S710), so that the operation can be continued even after the ignition switch 17 is turned off. In this way, when it is detected that the ignition switch 17 is turned off, it is determined that the writing execution condition is satisfied, and the value of the data to be continuously stored stored in the NRAM 17 is stored in the EEPROM 11 (S810). The relay 43 is turned off to stop the operation (S820). At the start of the operation when the ignition switch 17 is turned on, the data value stored in the EEPROM 11 is copied to the NRAM 27 assuming that the data restoration condition is satisfied. To restore (S730) In the fifth embodiment, S810 in FIG. 12 corresponds to processing as data storage means, and S730 in FIG. 11 corresponds to processing as data restoration means.
[0101]
According to the ECU 41 of the fifth embodiment, in order to reduce the number of times of writing data to the EEPROM 11, S810 of FIG. However, when the microcomputer 7 receives the monitor frequency information output request from the diagnostic tool 33, the microcomputer 7 executes any one of the communication response processes shown in FIGS. As in any one of the fourth to fourth embodiments, it is possible to prevent the occurrence of a phenomenon in which the data value read by the diagnostic tool 33 becomes a value considered to be older than the data value read last time.
[0102]
As mentioned above, although one Embodiment of this invention was described, it cannot be overemphasized that this invention can take various forms.
For example, in the first to fourth embodiments, if the NRAM 27 is not provided and various data processing including the increment processing of the data to be continuously stored is performed on the SRAM 29 (that is, since the SRAM 29 is used as a processing work memory). If there is), the processing of FIG. 4A and S310 and S330 of FIG. 5 become unnecessary. However, if a configuration is adopted in which the NRAM 27 is used as a processing work memory and the SRAM 29 is used only for storing data to be continuously stored as in the first to fourth embodiments, the storage capacity of the SRAM 29 can be reduced. This is advantageous in that it can be performed.
[0103]
On the other hand, the data to be continuously stored is not limited to data whose value is incremented by 1 like the numerator and denominator of the monitoring frequency defined by the RateBase monitoring method, but is increased or decreased by a certain unit change amount, for example. The unit change amount need not always be the same value.
[0104]
Further, the rewritable nonvolatile memory is not limited to the EEPROM, but may be, for example, a flash ROM.
[Brief description of the drawings]
FIG. 1 is a block diagram illustrating a configuration of an ECU (electronic control device) according to a first embodiment.
FIG. 2 is an explanatory diagram illustrating continuous storage target data.
FIG. 3 is a flowchart illustrating a process when the microcomputer of the ECU according to the first embodiment increments the data to be continuously stored in the NRAM.
FIG. 4 is a flowchart showing a process executed by the microcomputer of the ECU of the first embodiment to store the value of the data to be continuously saved updated in the NRAM in each of the SRAM and the EEPROM.
FIG. 5 is a flowchart illustrating an initial process executed by a microcomputer of the ECU according to the first embodiment.
FIG. 6 is a flowchart illustrating a communication response process executed by a microcomputer of the ECU according to the first embodiment.
FIG. 7 is a flowchart illustrating a communication response process executed by a microcomputer of an ECU according to the second embodiment.
FIG. 8 is a flowchart illustrating a communication response process executed by a microcomputer of an ECU according to a third embodiment.
FIG. 9 is a flowchart illustrating a communication response process executed by a microcomputer of an ECU according to a fourth embodiment.
FIG. 10 is a block diagram illustrating a configuration of an electronic control unit (ECU) according to a fifth embodiment.
FIG. 11 is a flowchart illustrating an initial process executed by a microcomputer of an ECU according to a fifth embodiment.
FIG. 12 is a flowchart illustrating a process at the end of an operation executed by a microcomputer of an ECU according to a fifth embodiment.
[Explanation of symbols]
1, 41: electronic control unit (ECU), 3: sensor, 5: input processing circuit, 7: microcomputer, 9: communication line, 11: EEPROM, 13: actuator, 15: output circuit, 17: ignition switch, 19 ... Battery, 21 power supply circuit, 23 CPU, 25 ROM, 27 normal RAM (NRAM), 29 standby RAM (SRAM), 31 I / O, 33 diagnostic tool, 43 main relay, 45 main Relay control circuit, 47 NPN transistor, L coil

Claims (7)

データ処理に用いられる処理作業用メモリと、
動作電源の供給が停止されても継続して保存すべき特定のデータであって、前記処理作業用メモリ上で値が更新されるデータ(以下、継続保存対象データという)を継続的に保存するために設けられ、電気的に記憶内容の書き換えが可能な不揮発性メモリと、
予め定められた書込実施条件が成立した際に、前記処理作業用メモリに記憶されている前記継続保存対象データの値を前記不揮発性メモリに記憶させるデータ保存手段と、
予め定められたデータ復元実施条件が成立した際に、前記不揮発性メモリに記憶されている前記継続保存対象データの値を前記処理作業用メモリにコピーすることにより、前記処理作業用メモリ内の前記継続保存対象データが消失しても該継続保存対象データの値の継続的な更新を可能にするデータ復元手段と、
外部装置からの前記継続保存対象データの出力要求を受けた場合に、前記処理作業用メモリに記憶されている前記継続保存対象データの値を前記外部装置に出力する出力手段と、
を備えた電子制御装置において、
前記データ保存手段とは別に、前記外部装置からの前記出力要求を受けた際にも、前記処理作業用メモリに記憶されている前記継続保存対象データの値を前記不揮発性メモリに記憶させる第2のデータ保存手段が設けられていること、
を特徴とする電子制御装置。
A processing work memory used for data processing;
Specific data to be continuously stored even when the supply of the operation power is stopped, and data whose value is updated on the processing work memory (hereinafter referred to as “continuous storage target data”) is continuously stored. A non-volatile memory electrically rewritable,
When a predetermined write execution condition is satisfied, a data storage unit that stores the value of the continuous storage target data stored in the processing work memory in the nonvolatile memory,
When a predetermined data restoration execution condition is satisfied, by copying the value of the data to be continuously stored stored in the nonvolatile memory to the processing work memory, the value in the processing work memory is copied. Data restoration means for enabling continuous updating of the value of the continuous storage target data even if the continuous storage target data is lost;
Output means for outputting, to the external device, a value of the continuous storage target data stored in the processing work memory, when receiving an output request for the continuous storage target data from an external device;
In the electronic control device provided with
Separately from the data storage means, when the output request is received from the external device, a value of the data to be continuously stored stored in the processing work memory is stored in the nonvolatile memory. Data storage means is provided,
Electronic control device characterized by the above-mentioned.
請求項1に記載の電子制御装置において、
前記出力手段は、前記第2のデータ保存手段による前記不揮発性メモリへの前記継続保存対象データの値の記憶が終了してから、前記処理作業用メモリに記憶されている前記継続保存対象データの値を前記外部装置に出力すること、
を特徴とする電子制御装置。
The electronic control device according to claim 1,
The output unit is configured to store the value of the continuous storage target data stored in the processing work memory after the second data storage unit stores the value of the continuous storage target data in the nonvolatile memory. Outputting a value to the external device;
Electronic control device characterized by the above-mentioned.
請求項2に記載の電子制御装置において、
前記外部装置からの前記出力要求を受けた場合に、前記第2のデータ保存手段が動作する前又は該第2のデータ保存手段が動作している最中に動作して、前記外部装置側でタイムアウト判定がなされるのを防ぐための応答信号を前記外部装置に出力する先行応答手段を備えていること、
を特徴とする電子制御装置。
The electronic control device according to claim 2,
When the output request is received from the external device, the external device operates before the second data storage unit operates or during the operation of the second data storage unit. Having a preceding response means for outputting a response signal to the external device for preventing a timeout determination from being made;
Electronic control device characterized by the above-mentioned.
請求項1ないし請求項3の何れか1項に記載の電子制御装置において、
前記第2のデータ保存手段は、前記処理作業用メモリに記憶されている前記継続保存対象データの値と、前記不揮発性メモリに記憶されている前記継続保存対象データの値とを比較して、両値が異なっている場合にのみ、前記処理作業用メモリに記憶されている前記継続保存対象データの値を前記不揮発性メモリに記憶させるように構成されていること、
を特徴とする電子制御装置。
The electronic control device according to any one of claims 1 to 3,
The second data storage unit compares the value of the continuous storage target data stored in the processing work memory with the value of the continuous storage target data stored in the nonvolatile memory, Only when the two values are different, it is configured to store the value of the continuous storage target data stored in the processing work memory in the non-volatile memory,
Electronic control device characterized by the above-mentioned.
請求項1ないし請求項4の何れか1項に記載の電子制御装置において、
データ保持用の電源が常時供給されたRAM(以下、スタンバイRAMという)と、前記動作電源の供給に伴い当該電子制御装置が動作しているときにのみデータ保持用の電源が供給されるRAM(以下、ノーマルRAMという)とを備えると共に、前記処理作業用メモリは前記ノーマルRAMであり、
更に、前記ノーマルRAMから前記スタンバイRAMへ前記継続保存対象データの最新値をコピーするコピー手段を備え、
前記データ保存手段、前記第2のデータ保存手段、及び前記出力手段は、前記ノーマルRAM又は前記スタンバイRAMから前記継続保存対象データの値を読み出して、その読み出した値を、前記処理作業用メモリに記憶されている前記継続保存対象データの値として処理するように構成されており、
前記データ復元手段は、当該電子制御装置が前記動作電源の供給に伴い起動した際に、前記スタンバイRAM内の記憶データが正常であるか否かを判定して、前記スタンバイRAM内の記憶データが正常であると判定したならば、前記スタンバイRAMから前記ノーマルRAMへ前記継続保存対象データの値をコピーし、前記スタンバイRAM内の記憶データが正常でないと判定したならば、前記データ復元実施条件が成立したとして、前記不揮発性メモリに記憶されている前記継続保存対象データの値を前記スタンバイRAMと前記ノーマルRAMとにコピーするように構成されていること、
を特徴とする電子制御装置。
The electronic control device according to any one of claims 1 to 4,
A RAM to which power for data retention is constantly supplied (hereinafter referred to as a standby RAM) and a RAM to which power for data retention is supplied only when the electronic control unit is operating in accordance with the supply of the operation power ( Hereinafter, referred to as a normal RAM), and the processing work memory is the normal RAM;
Further, a copy unit that copies the latest value of the data to be continuously stored from the normal RAM to the standby RAM,
The data storage unit, the second data storage unit, and the output unit read a value of the data to be continuously stored from the normal RAM or the standby RAM, and store the read value in the processing work memory. It is configured to be processed as a value of the stored continuous storage target data,
The data restoration means determines whether or not the storage data in the standby RAM is normal when the electronic control device is started in response to the supply of the operation power, and determines whether the storage data in the standby RAM is normal. If it is determined that the data is normal, the value of the data to be continuously saved is copied from the standby RAM to the normal RAM, and if it is determined that the storage data in the standby RAM is not normal, the data restoration execution condition is Assuming that it has been established, it is configured to copy the value of the continuous storage target data stored in the nonvolatile memory to the standby RAM and the normal RAM,
Electronic control device characterized by the above-mentioned.
請求項1ないし請求項5の何れか1項に記載の電子制御装置において、
当該装置は、車両に搭載された車載機器を制御する車両用電子制御装置であると共に、
車両が所定の運転状態となったことを検出する検出手段と、
所定の故障診断実施条件が成立した場合に前記車載機器における診断対象の故障診断を実施する故障診断手段と、
当該装置の起動から停止までの間に、前記検出手段により前記所定の運転状態が検出されたときに前記処理作業用メモリに記憶されている運転回数の値を1回分だけ更新した値に書き換えると共に、前記故障診断手段にて前記故障診断が実施されたときに前記処理作業用メモリに記憶されている故障診断回数の値を1回分だけ更新した値に書き換えるデータ更新手段とを備え、
更に、前記継続保存対象データが、前記運転回数と前記故障診断回数であること、
を特徴とする電子制御装置。
The electronic control device according to any one of claims 1 to 5,
The device is a vehicular electronic control device that controls in-vehicle devices mounted on the vehicle,
Detecting means for detecting that the vehicle has entered a predetermined driving state;
Failure diagnosis means for performing a failure diagnosis of a diagnosis target in the in-vehicle device when a predetermined failure diagnosis execution condition is satisfied,
During the period from the start to the stop of the device, when the predetermined operation state is detected by the detection unit, the value of the number of operations stored in the processing work memory is rewritten to a value updated by one time and Data updating means for rewriting the value of the number of times of failure diagnosis stored in the processing work memory to a value updated by one time when the failure diagnosis is performed by the failure diagnosing means,
Further, the continuous storage target data is the number of operations and the number of failure diagnosis,
Electronic control device characterized by the above-mentioned.
請求項6に記載の電子制御装置において、
前記外部装置は、当該電子制御装置に接続可能な車両用の診断装置であることを特徴とする電子制御装置。
The electronic control device according to claim 6,
The electronic control device, wherein the external device is a diagnostic device for a vehicle that can be connected to the electronic control device.
JP2002340878A 2002-11-25 2002-11-25 Electronic control unit Expired - Fee Related JP3960212B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002340878A JP3960212B2 (en) 2002-11-25 2002-11-25 Electronic control unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002340878A JP3960212B2 (en) 2002-11-25 2002-11-25 Electronic control unit

Publications (2)

Publication Number Publication Date
JP2004178067A true JP2004178067A (en) 2004-06-24
JP3960212B2 JP3960212B2 (en) 2007-08-15

Family

ID=32703391

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002340878A Expired - Fee Related JP3960212B2 (en) 2002-11-25 2002-11-25 Electronic control unit

Country Status (1)

Country Link
JP (1) JP3960212B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008038741A1 (en) * 2006-09-28 2008-04-03 Fujitsu Ten Limited Vehicle-mounted device, frequency collection device, and frequency collection method
JP2009163597A (en) * 2008-01-09 2009-07-23 Denso Corp Power supply status detection device
US8280579B2 (en) 2007-09-14 2012-10-02 Denso Corporation Memory management apparatus
DE112017005483T5 (en) 2016-10-31 2019-07-18 Hitachi Automotive Systems, Ltd. Electronic control unit and privacy procedures for this

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5176728B2 (en) 2008-07-04 2013-04-03 株式会社デンソー Electronic control device for vehicle

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008038741A1 (en) * 2006-09-28 2008-04-03 Fujitsu Ten Limited Vehicle-mounted device, frequency collection device, and frequency collection method
JPWO2008038741A1 (en) * 2006-09-28 2010-01-28 富士通テン株式会社 In-vehicle device, frequency collection device, and frequency collection method
US8280579B2 (en) 2007-09-14 2012-10-02 Denso Corporation Memory management apparatus
JP2009163597A (en) * 2008-01-09 2009-07-23 Denso Corp Power supply status detection device
DE112017005483T5 (en) 2016-10-31 2019-07-18 Hitachi Automotive Systems, Ltd. Electronic control unit and privacy procedures for this
US11314634B2 (en) 2016-10-31 2022-04-26 Hitachi Astemo, Ltd. Electronic control unit and data protection method therefor

Also Published As

Publication number Publication date
JP3960212B2 (en) 2007-08-15

Similar Documents

Publication Publication Date Title
JP5176728B2 (en) Electronic control device for vehicle
US8406951B2 (en) Electronic control system for vehicles
KR100545131B1 (en) Control system
US7788005B2 (en) Electronic control system and method for vehicle diagnosis
US10964135B2 (en) In-vehicle electronic control unit and method for abnormality response processing thereof
JP4506868B2 (en) Electronic control unit
EP2040166B1 (en) Memory management apparatus
US7203581B2 (en) Electronic control unit for controlling updating of data in non-volatile memory
JP4636118B2 (en) Electronic device and program
JP4539757B2 (en) Electronic control unit
US9080530B2 (en) Electronic control apparatus and vehicle control system
US6401163B1 (en) Apparatus and method for rewriting data from volatile memory to nonvolatile memory
US7831678B2 (en) Electronic control apparatus
JP4061694B2 (en) Electronic control device and control system
JPH11272498A (en) Electronic controller
JPH11259375A (en) Device and system for control for vehicle
US8135533B2 (en) Electronic engine control apparatus having improved configuration for ensuring excellent engine startability
JP4001088B2 (en) Electronic control unit
JP4475345B2 (en) Electronic control unit
JP3960212B2 (en) Electronic control unit
US11314634B2 (en) Electronic control unit and data protection method therefor
JP2002323902A (en) Electronic controller
JP2004151944A (en) Method for writing data in non-volatile storage device, its program and device, and onboard electronic controller
JP2011100416A (en) In-vehicle electronic controller and memory control method
JP7482245B2 (en) Electronic control device and wake-up circuit diagnostic method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050324

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070417

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20070424

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070507

R150 Certificate of patent or registration of utility model

Ref document number: 3960212

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110525

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120525

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120525

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130525

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140525

Year of fee payment: 7

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees