JP3960212B2 - Electronic control unit - Google Patents

Electronic control unit Download PDF

Info

Publication number
JP3960212B2
JP3960212B2 JP2002340878A JP2002340878A JP3960212B2 JP 3960212 B2 JP3960212 B2 JP 3960212B2 JP 2002340878 A JP2002340878 A JP 2002340878A JP 2002340878 A JP2002340878 A JP 2002340878A JP 3960212 B2 JP3960212 B2 JP 3960212B2
Authority
JP
Japan
Prior art keywords
data
value
stored
electronic control
continuously
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2002340878A
Other languages
Japanese (ja)
Other versions
JP2004178067A (en
Inventor
和憲 岡田
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)

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]
BACKGROUND OF THE INVENTION
The present invention relates to an electronic control unit that continuously saves and updates the value of specific data updated during operation using a nonvolatile memory capable of electrically rewriting stored contents. It is.
[0002]
[Prior art]
Conventionally, in an electronic control device for automobiles, specific data such as failure diagnosis information and control learning values that should be continuously stored even when the supply of operating power is stopped, and used for data processing Data whose value is updated in the memory (hereinafter referred to as data to be continuously saved) is written in a non-volatile memory (hereinafter also referred to as rewritable non-volatile memory) such as an EEPROM that can be electrically rewritten. The data value can be held and updated continuously.
[0003]
For example, a battery-backed RAM (hereinafter also referred to as a backup RAM) is used to perform processing at all times, and data in a predetermined area in the RAM is copied and stored in an EEPROM. There is known an apparatus that copies data in an EEPROM to a backup RAM and restores the data if the data in the backup RAM is abnormal at the start of operation (see, for example, Patent Document 1).
[0004]
Further, a rewritable nonvolatile memory such as an EEPROM has a limit on the number of data writing. Therefore, in this type of electronic control unit, in order to reduce the number of times of data writing to the rewritable nonvolatile memory, the value of the data to be continuously saved is rewritten only when a predetermined write execution condition is satisfied. The data is stored in a non-volatile memory.
[0005]
For example, when the backup RAM is a processing work memory as in the above example device, even if the operation is stopped (that is, the operation power supply is cut off), if there is no battery exhaustion or battery disconnection, for the time being, Since the data to be continuously saved is continuously saved in the backup RAM, the value of the data to be continuously saved is stored in the rewritable nonvolatile memory at a frequency of once every time the electronic control unit operates a plurality of times. It is possible.
[0006]
Further, for example, in an automotive electronic control device, when an ignition switch is turned on or when an external power supply main relay is turned on, operation power is supplied, and the electronic control device is When the ignition switch is turned on, the main relay may be turned on by itself so that the operation can be continued even after the ignition switch is turned off. When such a main relay is present, the electronic control unit reads from the RAM when detecting that the ignition switch is turned off even if the normal RAM that is not backed up by the battery is a processing work memory. Each time the electronic control unit operates, the data write to the rewritable nonvolatile memory is performed by 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. Can be suppressed to the frequency of the operation (specifically, only immediately before the operation of the electronic control device is stopped). In this case, the data in the rewritable non-volatile memory may be copied and restored to the RAM as the processing work memory when the operation is started when the operation power is turned on.
[0007]
On the other hand, in the electronic control device for automobiles, there is a RateBase monitoring method in the regulation of OBD (Onboard Diagnostics) 2 by CARB (California Air Resources Protection Bureau), and the RateBase monitoring method is expressed by the following formula. It is necessary to continuously store and update the monitoring frequency.
[0008]
Monitoring frequency = number of monitoring operations / number of operations
Note that the monitoring frequency is a frequency at which 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 driving times (hereinafter referred to as the denominator) is data in which a value is incremented when a predetermined traveling condition defined by the law for the item is satisfied, and the number of times of monitoring (hereinafter referred to as numerator) is The data is incremented when a failure diagnosis execution condition determined by the automobile manufacturer is satisfied for the item and the determination of normality or abnormality is completed (that is, when the failure diagnosis is performed). Both the denominator and the numerator are between the time when the ignition switch of the automobile is turned on and the time it is turned off (that is, the operating power is turned on to shut down the operating power to the electronic control unit that performs the fault diagnosis). During one operation period), or is incremented only once, or is maintained as it is without being incremented. Furthermore, these monitoring frequency data (denominator and numerator data) must be able to be read out by a diagnostic device (also called a diagnostic tool or diagnostic checker) externally 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, when the data to be continuously saved is one that must be readable by an external device, such as the monitoring frequency defined by the RateBase monitoring method, the electronic control device receives an output request from the external device. In this case, the value of the data to be continuously stored (that is, the latest value of the data) stored in the processing work memory is output to an external device. There's a problem.
[0011]
That is, first, after the latest value of the data to be continuously saved stored in the processing work memory is read to the external device, before the latest value is stored in the rewritable nonvolatile memory, Suppose that the data to be continuously saved in the processing work memory has been lost. Thereafter, 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 is transferred to the external device. A data value older than the latest read value is copied from the rewritable nonvolatile memory. Therefore, after that, if data is read again by the external device, the data value read at that time is a value that is considered to be older than the data value read last time (a value that has passed in the past). Such a reversal phenomenon of the read data value greatly impairs the apparent reliability of the electronic control device.
[0012]
In addition, if a configuration in which an alarm such as a check lamp provided outside the electronic control device notifies that the data has been restored from the rewritable nonvolatile memory to the processing work memory, the 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 device even if it is not a failure, and the above-described inversion phenomenon of the read data value itself occurs. It is important not to.
[0013]
Therefore, the present invention continuously saves and updates specific data using a rewritable non-volatile memory such as an EEPROM, and at the same time, an electronic device that can read the data value by an external device. The purpose is to prevent the occurrence of a phenomenon in which the read data value becomes a value that is considered to be older than the previously read data value.
[0014]
[Means for Solving the Problems and Effects of the Invention]
The electronic control device according to claim 1, which has been made to achieve the above object, continuously saves data to be continuously saved whose value is updated in the processing work memory even if the supply of the operating power is stopped. For this purpose, a rewritable nonvolatile memory capable of electrically rewriting stored contents is provided.
[0015]
In the electronic control device according to the first aspect, when the data storage means satisfies a predetermined write execution condition, the value of the data to be continuously stored (that is, the time point) Continuation stored in the rewritable non-volatile memory when the predetermined data restoration execution condition is satisfied, and the data restoration means is stored in the rewritable non-volatile memory. By copying the value of the storage target data to the processing work memory, the value of the continuous storage target data can be continuously updated even if the continuous storage target data in the processing work memory is lost. Further, when the output unit receives an output request for data to be continuously saved from an external device, it outputs the value of the data to be continuously saved 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 receives the output request from an external device. When the data is received, the value of the data to be continuously saved stored in the processing work memory is stored in the rewritable nonvolatile memory.
[0017]
In such an electronic control device according to claim 1, assuming that the second data storage means that is a characteristic part of the present device is not provided, the continuation stored in the processing work memory as described above. After the latest value of the data to be saved is read to the external device and before the latest value is stored in the rewritable nonvolatile memory by the data saving means (that is, before a predetermined write execution condition is satisfied) ), The data to be continuously saved in the processing work memory is lost for some reason, and then the data restoration execution condition is satisfied, and the data value in the rewritable non-volatile memory is changed to the processing work by the data restoring means. If the data to be continuously saved is read again by the external device after that, the data value read at that time is read in the previous time. Which may become a value that is regarded as older than the data value.
[0018]
However, according to the electronic control device of the first aspect of the invention, the second data storage unit is provided, and when the output request from the external device is received, the latest value of the data to be continuously stored is output to the external device. Since the latest value of the data to be continuously saved stored in the processing work memory is stored in the non-volatile memory, the latest value of the data to be continuously saved stored in the processing work memory is read to the external device. Then, 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 data writes to the rewritable non-volatile memory, even if the write execution condition that triggers the operation of the original data storage means is set to a low establishment frequency, the data is read by the external device Occurrence of a phenomenon that the data value becomes a value that is considered to be older than the previously read data value can be prevented.
[0020]
By the way, when an output request is received from an external device, the output unit may be operated first, and then the second data storage unit may be operated. However, in this case, to the external device There is a slight possibility that the latest value will be lost due to a power interruption or the like before the latest value of the data to be continuously saved is output and stored in the rewritable nonvolatile memory.
[0021]
Therefore, in order to completely eliminate the possibility, as described in claim 2, the output means finishes storing the value of the data to be continuously saved in the rewritable nonvolatile memory by the second data saving means. After that, the value of the data to be continuously stored stored in the processing work memory may be output to the external device. That is, when an output request is received from an external device, the second data storage unit operates first, and the storage of the value of the data to be continuously stored in the rewritable nonvolatile memory by the second data storage unit is completed. Then, the output means may be configured to operate.
[0022]
In the case of the electronic control device 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 stored in the rewritable nonvolatile memory are provided. 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 uses the read value as the data to be continuously saved stored in the processing work memory. The value may be output to an external device.
[0023]
On the other hand, in the case of the electronic control device according to the second aspect, the second data storage means stores the rewritable nonvolatile memory between the time when the output request is received from the external device and the time when the output means starts operating. Since the value of the data to be continuously saved is stored, the response time from when the output request is received until the value of the data to be continuously saved is returned to the external device tends to be long. Further, an external device connected to this type of electronic control device may be configured to make a timeout determination if a response is not returned within a specified time after a request is issued.
[0024]
For this reason, in the electronic control device according to claim 2, 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 actually normal. There is a risk that a timeout determination may be made on the external device side.
[0025]
Therefore, in the electronic control device according to claim 3, when the electronic control device according to claim 2 is provided with a preceding response means, and the advance response means receives an output request from the external device, It operates before the data storage means operates or while the second data storage means is operating, and outputs a response signal for preventing the time-out determination from being made on the external device side to the external device. I am doing so. According to such an electronic control device of claim 3, the data amount of the data to be continuously stored is large, and the second data storage means stores the value of the data to be continuously stored in the rewritable nonvolatile memory. Even if the time required for this becomes long, it is possible to prevent the timeout determination on the external device side.
[0026]
Next, in the electronic control device according to a fourth aspect, in the electronic control device according to the first to third aspects, the second data storage means includes a value of the data to be continuously stored stored in the processing work memory, Comparing the value of the continuous storage target data stored in the rewritable non-volatile memory, the value of the continuous storage target data stored in the processing work memory can be rewritten only when both values are different Store in non-volatile memory.
[0027]
According to such an electronic control device, the number of times of data writing to the rewritable nonvolatile memory can be saved. In other words, whenever an output request from an 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. If this happens, the number of times of data writing to the rewritable non-volatile memory will be increased unnecessarily, but according to the electronic control device of claim 4, such waste can be eliminated.
[0028]
On the other hand, as a processing work memory, a standby RAM (corresponding to the above-mentioned backup RAM) to which data holding power is constantly supplied, and the electronic control device operates in accordance with the supply of operating power to the electronic control device. Any normal RAM (that is, a normal RAM that is not backed up by a battery) to which power for holding data is supplied only when it is in use may be used.
[0029]
Here, if the normal RAM is used as a processing work memory, for example, as described in the section of “Prior Art”, a main relay for power supply is provided, and a switch for supplying operating power (hereinafter referred to as a power supply switch). Is turned on and the main relay is turned on 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. By assuming that the execution condition is satisfied, the value of the data to be continuously stored stored in the normal RAM is stored in the rewritable nonvolatile memory, and then the main relay is turned off, so that the original data storage means The frequency of writing data into the rewritable non-volatile memory can be set to a rate of once every time the electronic control unit operates once. In this case, assuming that the data restoration condition is satisfied at the start of operation, 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 (the operation power supply is cut off), the data to be continuously stored in the standby RAM is for the time being. Is continuously stored, the frequency at which the original data storage means operates (that is, the frequency at which the write execution condition is established) can be set to a ratio of once every time the electronic control unit operates a plurality of times. This is advantageous in reducing the number of data writes to the rewritable nonvolatile memory. In this case, it is determined whether or not the data stored in the standby RAM is normal at the start of operation associated with turning on the operation power. If it is determined that the data is not normal, the data restoration condition is satisfied. The data value stored in the rewritable nonvolatile memory may be copied to the standby RAM and restored.
[0031]
However, in order to keep the storage capacity of the standby RAM small, it is 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 the data to be continuously stored.
Therefore, in the electronic control device according to claim 5, in the electronic control device according to claims 1 to 4, the standby RAM, the normal RAM as the processing work memory, and the normal storage target data from the normal RAM to the standby RAM are stored. Copy means for copying the latest value, and the data storage means, the second data storage means, and the output means read the value of the data to be continuously saved from the normal RAM or the standby RAM, and use the read value. The data is continuously processed as the value of the data to be continuously stored (that is, the latest value of the data to be continuously stored) stored in the processing work memory. Further, the data restoring means determines whether or not the stored data in the standby RAM is normal when the electronic control unit is activated with the supply of operating power, and the stored data in the standby RAM is normal. If it is determined that the data to be continuously saved is copied from the standby RAM to the normal RAM, and if it is determined that the stored data in the standby RAM is not normal, the data rewrite execution condition is satisfied and the rewrite is performed. The continuous storage target data value stored in the possible non-volatile memory is copied to the standby RAM and the normal RAM.
[0032]
According to such an electronic control device according to claim 5, as in the case where the standby RAM is used as the processing work memory, even when the operation is stopped (when the operation power supply is cut off), the battery is discharged or the battery is disconnected. Otherwise, for the time being, the data to be continuously stored is continuously stored in the standby RAM. Therefore, the frequency at which the original data storage unit operates can be set to a ratio of once every time the electronic control unit operates a plurality of times. In addition, the storage capacity of the standby RAM may be small.
[0033]
Next, an electronic control device according to a sixth aspect is obtained by applying the electronic control device according to the first to fifth aspects to a vehicle electronic control device that controls an in-vehicle device mounted on the vehicle. Detection means for detecting that the operation state of the vehicle has been established, failure diagnosis means for performing failure diagnosis of a diagnosis target in the in-vehicle device when a predetermined failure diagnosis execution condition is satisfied, and from start to stop of the device In the meantime, when the predetermined operating state is detected by the detecting means, the value of the number of times of operation stored in the processing work memory is rewritten with a value updated by one time, and the failure to be diagnosed by the failure diagnosing means Data updating means for rewriting the value of the number of times of failure diagnosis stored in the processing work memory when the diagnosis is performed to a value updated only once. In this electronic control device, the number of operations and the number of times of failure diagnosis whose values are updated on the processing work memory by the data updating means are the data to be continuously saved.
[0034]
According to such an electronic control device of claim 6, in order to reduce the number of times of data writing to the rewritable nonvolatile memory, the writing execution condition that triggers the operation of the original data storage means is less frequently established. Even if it is set to something, it prevents the occurrence of the phenomenon that the values of the operation count and fault diagnosis count read by the external device become values that are considered to be older than the previous read value (specifically, a small value). can do.
[0035]
In the electronic control device according to claim 6, the external device may be a vehicle diagnostic device that can be connected to the electronic control device as described in claim 7.
[0036]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, an embodiment of the present invention will be described with reference to the drawings.
First, FIG. 1 is a block diagram showing a configuration of an electronic control unit (hereinafter referred to as ECU) 1 of a first embodiment for controlling 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 that processes signals by inputting signals from various sensors 3 for detecting the operating state of the engine and the state of peripheral devices of the engine, and the input processing circuit 5. Is connected to a microcomputer 7 (hereinafter referred to as a microcomputer) 7 for performing various processes relating to engine control, failure diagnosis, and the like based on sensor signals from the microcomputer 7 and a communication line 9, and is calculated by the microcomputer 7. EEPROM 11 serving as a rewritable non-volatile memory in which data to be continuously stored (data to be continuously stored) is stored even after the supply of operating power to the ECU 1 is stopped, and from the microcomputer 7 In response to the control signal, the actuator 13 such as a fuel injection device (injector) or an ignition device (igniter) attached to the engine is driven. In response to the voltage VD as the operating power supplied from the output circuit 15 and the battery 19 supplied when the ignition switch 17 of the automobile is turned on, the power supply voltage for operation is applied to each part in the ECU 1 including the microcomputer 7 ( For example, a sub power supply voltage Vs (a power supply for holding data in the standby RAM) is supplied from a voltage VB constantly supplied from the battery 19 and a standby RAM 29 (to be described later) in the microcomputer 7 to always hold data. And a power supply circuit 21 for generating and outputting.
[0038]
The power supply circuit 21 outputs a reset signal to the microcomputer 7 for a predetermined time when the power supply voltage Vm is considered to be stable after the ignition switch 17 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, instruction codes constituting the program and fixed codes referred to when the program is executed). 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) that can always hold data by receiving the sub power supply voltage Vs from the power supply circuit 21 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 the battery, and the power supply voltage Vm from the power supply circuit 21 is supplied as a data holding power supply. In the following description, the RAM 27 is referred to as an NRAM (normal RAM) 27 in order to clarify the distinction from the SRAM 29.
[0040]
The ECU 1 configured as described above operates by receiving the voltage VD from the battery 19 while the ignition switch 17 is 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 its operation from the initial state and performs an initial process described later. A control process for controlling the engine is performed. The operation of the microcomputer 7 is due to the CPU 23 executing a program in the ROM 25.
[0041]
In addition, the microcomputer 7 uses a numerator (failure) indicating the monitoring frequency for each of the failure diagnosis target items (catalytic converter, fuel evaporation system, oxygen sensor, etc.) defined by the CARB / OBD2 RateBase monitoring method described above. The values of the number of times of monitoring as the number of diagnoses) and the denominator (number of operations) are continuously stored and updated using the EEPROM 11 and the SRAM 29.
[0042]
Furthermore, 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 relating to failure diagnosis from the diagnostic tool 33, the ECU 1 outputs data having contents corresponding to the request to the diagnostic tool 33, and outputs an output request for information related to the monitoring frequency. (That is, a monitor frequency numerator and denominator output request, hereinafter referred to as monitor frequency information output request), the monitor frequency numerator and denominator for each failure diagnosis target item stored in the NRAM 27 is received. 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]
Therefore, next, the contents of processing executed by the microcomputer 7 of the ECU 1 to continuously store and update the values of the data to be continuously stored, which are the numerator and denominator of the monitoring frequency for each failure diagnosis target item, respectively. Will be described with reference to FIGS.
First, as shown in FIG. 2, in the present embodiment, a total number of n pieces of data to be continuously saved is numbered sequentially from the 0th. For example, the 0th data is the numerator of the monitoring frequency for the fuel evaporation system (hereinafter simply referred to as “evaporation”), the first data is the denominator of the monitoring frequency for the evaporation, and the second data is The numerator of the monitoring frequency for the catalytic converter (hereinafter simply referred to as the catalyst), the third data is the denominator of the monitoring frequency for the catalyst, and the fourth data is the 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 is provided with a region for storing a numerator and a denominator for each failure diagnosis target item. Each of the numerator and denominator data is stored in each of the EEPROM 11 and the SRAM 29 in an area for the corresponding failure diagnosis target item.
[0045]
Then, as shown in FIG. 3 (a), the microcomputer 7 determines whether or not each failure diagnosis target item satisfies a predetermined traveling condition defined by the law for the item (in other words, the vehicle However, for example, whether or not the failure diagnosis target item is in a predetermined operating state defined by the law is periodically determined (S110), and when it is determined that the traveling condition is satisfied (S110: YES), The value of the denominator (number of operations) of the corresponding item is incremented on the NRAM 27 (S120).
[0046]
Further, as shown in FIG. 3B, the microcomputer 7 periodically determines, for example, whether or not the failure diagnosis execution condition for the item is satisfied for each failure diagnosis target item (S130), and performs the failure diagnosis. If it is determined that the condition is satisfied (S130: YES), failure diagnosis processing is performed on the corresponding item to determine normality or abnormality (S140), and then the numerator of the item (the number of times of monitoring is performed) The value is incremented on the NRAM 27 (S150).
[0047]
Note that when the microcomputer 7 increments the numerator or denominator of any failure diagnosis target item, the incremented data is not incremented any further during the current operation period (that is, during the current driving period of the car). It has become.
3 (a) and 3 (b), the value of each continuation save target data (numerator and denominator for each failure diagnosis target item) stored in the NRAM 27 is incremented for that data. When the condition is satisfied, it is rewritten to a value updated only once.
[0048]
Next, FIGS. 4A and 4B are flowcharts showing processing executed by the microcomputer 7 to store the values of the data to be continuously saved updated on the NRAM 27 in each of the SRAM 29 and the EEPROM 11. . Then, the process of FIG. 4A is repeatedly executed at regular time intervals (every 16 ms in the present embodiment), and the process of FIG. 4B is executed only once during a period in which the ECU 1 is operating. Is done.
[0049]
First, when the microcomputer 7 starts to execute the process shown in FIG. 4A, it is determined in the first S210 whether or not the current timing is the SRAM update timing. In the present embodiment, it is determined that the SRAM update timing is reached every 32 ms, which is a ratio of once every two processes.
[0050]
If it is determined in S210 that it is the SRAM update timing, the process proceeds to S220, where all the data to be continuously saved from the 0th to the “n−1” th in the NRAM 27 are read and copied to the SRAM 29, Thereafter, this process is terminated.
[0051]
If it is determined in S210 that the SRAM update timing is not reached, the process is terminated.
On the other hand, when the microcomputer 7 starts executing the process 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, where all the data to be continuously saved from the 0th to the “n−1” th in the SRAM 29 are read and copied to the EEPROM 11, and then this 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. In other words, this is because the latest value of each data to be continuously saved in the NRAM 27 is always copied to the SRAM 29 by the processing of FIG.
[0053]
If it is determined in S230 that it is not the EEPROM update timing, this process is terminated.
In the present embodiment, in S230, the number of times that the ECU 1 has operated as the ignition switch 17 is turned on is set to 3 using the counter in the SRAM 29, such as the first day → second time → third time → first time. Counting is repeated at a 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 at a rate of once every time the ECU 1 operates three times.
[0054]
Next, FIG. 5 is a flowchart showing an initial process that is executed when the microcomputer 7 starts an operation when the ignition switch 17 is turned on.
As shown in FIG. 5, when the microcomputer 7 starts executing the initial process, first, in S310, the data in the NRAM 27 is initialized, and in the subsequent S320, it is determined whether or not the stored data in the SRAM 29 is normal. To do. In S320, it is determined whether or not there is a history of battery removal (battery 19 has been removed), and the data in the SRAM 29 is inspected by a method such as parity check or checksum to remove the battery. If the data itself is normal 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, and all (that is, n) continuous storage target data 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, and all (n) pieces of data to be continuously stored in the EEPROM 11 are read out. After copying to the SRAM 29, 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 final value of the data to be continuously saved until the previous operation is stored in the SRAM 29 by S220 in FIG. Therefore, by the process of S330, all the data to be continuously saved in the SRAM 29 are copied to the NRAM 27 that is the working memory for the increment process, and each of the data to be continuously saved inherits the value until the previous operation. However, it can be updated.
[0058]
Also, since the EEPROM 11 stores the value of the data to be continuously saved at the time of the previous operation at least three times by the process of S240 in FIG. 4B, the data in the SRAM 29 is not normal (S320: NO), after all the data to be continuously saved in the EEPROM 11 are copied to the SRAM 29 (S340), the process of S330 is performed. For this reason, even if the data in the SRAM 29 becomes abnormal due to battery exhaustion, battery disconnection, etc., the value of the data to be continuously saved stored in the EEPROM 11 is copied to the SRAM 29 and the NRAM 27. Will continue to be updated.
[0059]
In the present embodiment, since the data to be continuously stored in the EEPROM 11 is written once every time the ECU 1 operates three times, 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 necessarily the true final value. However, in the present embodiment, with this fact in mind, priority is given to reducing the number of times of data writing to the EEPROM 11.
[0060]
Next, FIG. 6 is a flowchart showing 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 executing the communication response process, first, in S410, all the data to be continuously stored (the denominator and the numerator data of the monitoring frequency for each failure diagnosis target item) are stored from the SRAM 29. The read data is transmitted to the diagnostic tool 33. That is, in the ECU 1, the continuous storage target data is read by the diagnostic tool 33 by executing the process of S410.
[0061]
Then, in the next S420, similar to S240 in FIG. 4B, all the data to be continuously stored is read from the SRAM 29, and the read data (that is, the same data that has been transmitted to the diagnostic tool 33). Is copied to the EEPROM 11, and then the communication response process is terminated.
[0062]
As described above, since the data of the same value as the data to be continuously saved in the NRAM 27 is always copied to the SRAM 29 by the processing of FIG. 4A, the process of S420 of FIG. In S240 of b), the data to be continuously saved is read from the NRAM 27, not from the SRAM 29, and the data is copied to the EEPROM 11, and the data to be continuously saved is read from the NRAM 27 instead of from the SRAM 29 in S410 of FIG. Then, the data may be transmitted to the diagnostic tool 33.
[0063]
Next, the operation of the ECU 1 of 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 continuous storage target data is read out by the diagnostic tool 33, the voltage as the operating power supply is stored before the storage of the continuous storage target data in the EEPROM 11 by the process of S240 in FIG. It is assumed that the supply of VD is stopped and the ECU 1 stops its operation, and further, while the operation is stopped, the stored data in the SRAM 29 is no longer normal due to battery exhaustion or the like.
[0064]
Then, when the ECU 1 starts the next operation, the processes of S340 and S330 in FIG. 5 are executed in that order, so that 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, any of the data values copied from the EEPROM 11 to the RAMs 27 and 29 is a data value (smaller) that is considered to be older than the data value read to the diagnostic tool 33. Value).
[0065]
Therefore, if the data to be continuously saved is read again by the diagnostic tool 33 after that, the data value read at that time is smaller than the data value read in the previous time (value that has been given in the past). There is a possibility of becoming.
When such a read data value reversal phenomenon occurs, the reliability of the ECU 1 is questioned even though the operation of the ECU 1 is normal.
[0066]
Therefore, in the ECU 1 of the first embodiment, the process of S420 similar to S240 of FIG. 4B is provided in the communication response process of FIG. 6, and the monitoring frequency information output request from the diagnostic tool 33 is received. 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 data to be continuously saved updated on the NRAM 27 is read out to the diagnostic tool 33 and before the latest value is stored in the EEPROM 11, the latest value of the data to be continuously saved is stored in the NRAM 27. And the possibility of being lost from the SRAM 29 can be made extremely low. 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 processing to the EEPROM 11, is set to a rate of once 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 reverse phenomenon in which the data value read by the diagnostic tool 33 becomes a value considered to be older than the previously read data value.
[0068]
In this embodiment, S240 in FIG. 4B corresponds to processing as a data storage unit, S320 to S340 in FIG. 5 correspond to processing as a data restoration unit, and S410 in FIG. This corresponds to the processing as the output means, and S420 in FIG. 6 corresponds to the processing as the second data storage means. Further, the process of FIG. 4A corresponds to a process as a copy unit. 3A corresponds to the processing as the detecting means, and S130 and S140 in FIG. 3B correspond to the processing as the failure diagnosing means, and FIG. Step S150 in 3 (b) corresponds to processing as data updating means.
[0069]
By the way, in the ECU 1 of the first embodiment, which is considered to be extremely rare, in the unlikely event that S410 in FIG. 6 is executed and S420 in FIG. When a momentary interruption occurs, there is a possibility that the latest value of the data to be continuously saved is lost (that is, the storage to the EEPROM 11 fails).
[0070]
Then, next, 2nd Embodiment which can eliminate such a possibility is described.
The ECU of the second embodiment differs 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]
As shown in FIG. 7, in the communication response processing in the second embodiment, first, the same processing as S420 in FIG. 6 is performed in the first S510, and the same processing as S410 in FIG. 6 is performed in the next S520. I do.
That is, in the ECU of the second embodiment, when receiving the monitor frequency information output request from the diagnostic tool 33, first, all the data to be continuously saved is read from the SRAM 29 and copied to the EEPROM 11 (S510), and then The data to be continuously saved copied from the SRAM 29 to the EEPROM 11 is transmitted to the diagnostic tool 33 (S520).
[0072]
Then, according to the ECU of the second embodiment, the latest value of the data to be continuously saved is output to the diagnostic tool 33 before the latest value is stored in the EEPROM 11, and the latest value is removed from the battery. The possibility of being lost due to a momentary power interruption or the like can be completely eliminated.
[0073]
Also in the second embodiment, in S510 of FIG. 7, the data to be continuously saved is read from the NRAM 27, not from the SRAM 29, and the data is copied to the EEPROM 11, and even in S520 of FIG. The data to be continuously saved may be read from the NRAM 27 and the data may be transmitted to the diagnostic tool 33. This also applies to a third embodiment described later.
[0074]
Next, a third embodiment will be described.
The ECU of the third embodiment differs from the ECU of the second embodiment only in that the microcomputer 7 executes the communication response process of FIG. 8 instead of the communication response process of FIG.
[0075]
As shown in FIG. 8, in the communication response process in the third embodiment, the process of S505 is added before S510 with respect to the communication response process of FIG. 33, a response signal indicating that the storage process to the EEPROM 11 is being performed, and a response signal for preventing the diagnosis tool 33 from making a time-out determination is transmitted.
[0076]
That is, the diagnostic tool 33 is configured to make a timeout determination if no response is returned within a specified time after the output request is issued.
In the ECU according to the second embodiment described above, the data write process to the EEPROM 11 (S510) is performed after the monitoring frequency information output request from the diagnostic tool 33 is received and before the requested data is transmitted to the diagnostic tool 33 in S520. ) Is executed, the response time from when the monitor frequency information output request is received until the data is returned to the diagnostic tool 33 becomes longer than the specified time when the data to be continuously saved increases in the writing process. In spite of the fact that it is normal, there is a possibility that the time-out determination is made on the diagnostic tool 33 side.
[0077]
Therefore, in the communication response process of the third embodiment, S505 is added before S510 with respect to the communication response process (FIG. 7) of the second embodiment, and in S505, the diagnostic tool 33 determines the timeout. A response signal for preventing the occurrence of the error is output.
[0078]
Therefore, according to the ECU of the third embodiment, the total amount of data to be continuously saved is large, and the time required for writing the data to be continuously saved in the EEPROM 11 in S510 of the communication response process becomes long. However, it is possible to prevent the timeout determination from being made on the external device side.
[0079]
In the third embodiment, S505 in FIG. 8 corresponds to the processing as the preceding response means. Further, when the time required for writing the data to be continuously saved to the EEPROM 11 becomes longer, for example, during the data writing to the EEPROM 11 in S510, for example, the above-mentioned S505 is periodically sent to the diagnostic tool 33. You may make it transmit the response signal similar to.
[0080]
Next, a fourth embodiment will be described.
The ECU of the fourth embodiment differs 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]
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 with respect to the communication response process of FIG. In FIG. 9, the same processes as those in FIG. 8 are given the same step numbers.
[0082]
That is, as shown in FIG. 9, when the microcomputer 7 starts executing the communication response process and transmits a response signal for preventing timeout determination to the diagnostic tool 33 in S505, the process proceeds to S610, and the target for continuous storage A variable i indicating a data number is set to 0.
In subsequent S620, it is determined whether or not the value of the variable i is smaller than the total number (data number) n of the data to be continuously saved, and if it is determined that the value of the variable i is smaller than the data number n. (S620: YES), go 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 Also, the EEPROM value of the i-th continuous storage target data (that is, the value of the i-th continuous storage target data stored in the EEPROM 11) E [i] is read and “E [i] ≠ S [i]” is read. It is determined whether or not there is (that is, whether E [i] and S [i] are different).
[0084]
If “E [i] ≠ S [i]” is not satisfied (S630: NO), the process proceeds to S640, the value of the variable i is incremented by 1, and the process returns to S620.
If it is determined in S630 that “E [i] ≠ S [i]” (S630: YES), the process proceeds to S650, and S [i] is written in the EEPROM 11 as E [i]. . Thereafter, the process proceeds to S640, and after the value of the variable i is incremented by 1, the process returns to S620.
[0085]
On the other hand, if it is determined in S620 that the value of the variable i is not smaller than the number of data n (i.e., i ≧ n) (S620: NO), the process proceeds to S520, and all of the SRAM 29 starts from the SRAM 29. The data to be continuously saved is read out, the read data is transmitted to the diagnostic tool 33, and then the communication response process is terminated.
[0086]
That is, in this communication response process, data writing to the EEPROM 11 is not necessarily performed, but the data to be continuously saved whose EEPROM value and SRAM value do not match are searched for by the processes of S610 to S650, and both values are equal. Only when there is data that is not correct, it is determined that the EEPROM value of the data is not the latest value stored in the NRAM 27 and the SRAM value handled as the latest value is stored in the EEPROM 11. .
[0087]
According to the ECU of the fourth embodiment, when the monitoring frequency information output request from the diagnostic tool 33 is received, the latest value of the data to be continuously saved is already stored in the EEPROM 11 ( In other words, since the write to the EEPROM 11 is not performed (even though the value of the data to be continuously saved is not updated on the NRAM 27), the number of times of data writing to the EEPROM 11 is effectively saved. be able to.
[0088]
In the fourth embodiment, the SRAM value is handled as the latest value in the NRAM 27. However, in S630 of FIG. 9, S [i] read from the SRAM 29 is not used, but the i-th continuation from the NRAM 27 is used. The value N [i] of the storage target data is read to determine whether “E [i] ≠ N [i]”. In S650 of FIG. 9, the value N [i] read from the NRAM 27 is set. You may make it write in EEPROM11 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 showing the configuration of the ECU 41 of the fifth embodiment. Note that the ECU 41 of the fifth embodiment also controls the engine of the automobile, like the ECUs of the above-described embodiments. In FIG. 10, the same components as those in FIG. 1 are denoted by the same reference numerals, and detailed description thereof is omitted.
[0090]
As shown in FIG. 10, the ECU 41 of the fifth embodiment differs from the ECU of any of the first to fourth embodiments described above in the following points (1) to (5). Yes.
(1) The voltage VD from the battery 19 is supplied not via the ignition switch 17 but via the main relay 43 as power feeding switching means provided outside the ECU 41. 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, and power is supplied to each part in the ECU 41 including the microcomputer 7. A 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 drive 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 is turned on from the coil L of the main relay 43. As a result, the main relay 43 is turned on.
[0093]
Therefore, the ECU 41 is supplied with the voltage VD as the operating power source 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 with the ignition switch 17 turned on, the ECU 41 can continue the operation even after the ignition switch 17 is turned off by turning on the main relay 43 by itself.
[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 main relay 43 are input. The voltage VD from the battery 19 may be wired-ORed, and the wired-OR voltage may be used as an operation power source of the ECU 41.
[0095]
(3) In the fifth embodiment, the SRAM 29 is not used in order to continuously update the data to be continuously saved, and the microcomputer 7 performs the processes shown in FIGS. 4 (a) and 4 (b). Do not implement. For this reason, the SRAM 29 is shown in the microcomputer 7 in FIG. 10, but the SRAM 29 and the function of the power supply circuit 21 outputting the sub power supply voltage Vs may be deleted.
[0096]
(4) The microcomputer 7 executes the initial process shown in FIG. 11 instead of the initial process shown in FIG. As shown in FIG. 11, when the microcomputer 7 starts executing the initial process, first, in S710, the drive signal Sd is output to the main relay control circuit 45 to turn on the main relay 43. However, at this time, the main relay 43 is already turned on by turning on the ignition switch 17. And since the drive signal Sd is output from the microcomputer 7 in this way, even if the ignition switch 17 is subsequently turned off, the main relay 43 remains on.
[0097]
Next, in S720, data in the NRAM 27 is initialized.
In subsequent S730, all the data to be continuously saved in the EEPROM 11 are read out and copied to the NRAM 27 so that each data to be continuously saved 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 turned on / off at regular intervals, and when the determination process detects that the ignition switch 17 has been turned off, the operation ends as shown in FIG. Execute time processing. The ignition switch 17 is turned on / off based on the voltage VG.
[0099]
Then, when the microcomputer 7 starts executing the process at the end of the operation in FIG. 12, first, in S810, all the data to be continuously saved in the NRAM 27 are read and copied to the EEPROM 11, and then the process proceeds to S820 to perform the main relay control. The output of the drive signal Sd to the circuit 45 is stopped, and the main relay 43 is turned off. Then, the operating power supply VD from the main relay 43 is cut off, and the operation of the ECU 41 is stopped.
[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 operation can be continued even after the ignition switch 17 is turned off by outputting the drive signal Sd to the main relay 43 (S710). Thus, when it is detected that the ignition switch 17 is turned off, the value of the data to be continuously stored stored in the NRAM 17 is stored in the EEPROM 11 assuming that the write execution condition is satisfied (S810), and then the main The relay 43 is turned off to stop the operation (S820), and the data value stored in the EEPROM 11 is copied to the NRAM 27 on the assumption that the data restoration condition is satisfied at the start of the operation accompanying the turning on of the ignition switch 17. (S730) In the fifth embodiment, S810 in FIG. 12 corresponds to processing as a data storage unit, and S730 in FIG. 11 corresponds to processing as a data restoration unit.
[0101]
And according to ECU41 of such 5th Embodiment, in order to reduce the frequency | count of data writing to EEPROM11, S810 of FIG. 12 which is the original data writing process to EEPROM11 is implemented only just before operation stop. However, when the monitor frequency information output request from the diagnostic tool 33 is received, the microcomputer 7 executes any one of the communication response processes in FIGS. As in any 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 a various form.
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 saved is performed on the SRAM 29 (that is, the SRAM 29 is used as a processing work memory). If it exists, the process of FIG. 4A and S310 and S330 of FIG. 5 become unnecessary. However, if the NRAM 27 is used as the processing work memory and the SRAM 29 is used only for saving the data to be continuously saved as in the first to fourth embodiments, the storage capacity of the SRAM 29 can be kept small. It 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 one, such as the numerator and denominator of the monitoring frequency defined by the RateBase monitoring method, but increases or decreases by a certain unit change amount, for example. The unit change amount need not always be the same value.
[0104]
Furthermore, the rewritable nonvolatile memory is not limited to the EEPROM, and for example, a flash ROM may be used.
[Brief description of the drawings]
FIG. 1 is a block diagram illustrating a configuration of an ECU (electronic control unit) according to a first embodiment.
FIG. 2 is an explanatory diagram for explaining data to be continuously saved.
FIG. 3 is a flowchart showing a process when the microcomputer of the ECU according to the first embodiment increments the data to be continuously saved on the NRAM.
FIG. 4 is a flowchart showing a process executed by the microcomputer of the ECU according to the first embodiment to store the value of the data to be continuously saved updated on the NRAM in each of the SRAM and the EEPROM.
FIG. 5 is a flowchart showing an initial process executed by the microcomputer of the ECU according to the first embodiment.
FIG. 6 is a flowchart showing a communication response process executed by the microcomputer of the ECU according to the first embodiment.
FIG. 7 is a flowchart showing a communication response process executed by the microcomputer of the ECU according to the second embodiment.
FIG. 8 is a flowchart showing a communication response process executed by the microcomputer of the ECU according to the third embodiment.
FIG. 9 is a flowchart showing a communication response process executed by the microcomputer of the ECU according to the fourth embodiment.
FIG. 10 is a block diagram illustrating a configuration of an ECU (electronic control unit) according to a fifth embodiment.
FIG. 11 is a flowchart showing an initial process executed by the microcomputer of the ECU according to the fifth embodiment.
FIG. 12 is a flowchart showing an operation end time process executed by a microcomputer of an ECU according to a fifth embodiment.
[Explanation of symbols]
DESCRIPTION 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 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のデータ保存手段が設けられていること、
を特徴とする電子制御装置。
Processing work memory used for data processing;
Specific data that should be continuously stored even after the supply of operating power is stopped, and data whose value is updated in the processing work memory (hereinafter referred to as data to be continuously stored) is continuously stored. A non-volatile memory that is electrically provided and capable of electrically rewriting stored contents;
Data storage means for storing the value of the continuous storage target data stored in the processing work memory in the nonvolatile memory when a predetermined writing execution condition is satisfied;
When a predetermined data restoration execution condition is satisfied, the value of the data to be continuously stored stored in the nonvolatile memory is copied to the processing work memory, thereby the processing work memory in the processing work memory is copied. Data restoration means for enabling continuous update of the value of the data to be continuously saved even if the data to be continuously saved is lost;
An output means for outputting, to the external device, the 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 an electronic control device comprising:
Separately from the data storage means, when receiving the output request from the external device, the non-volatile memory stores the value of the data to be continuously stored stored in the processing work memory. Data storage means are provided,
An electronic control device.
請求項1に記載の電子制御装置において、
前記出力手段は、前記第2のデータ保存手段による前記不揮発性メモリへの前記継続保存対象データの値の記憶が終了してから、前記処理作業用メモリに記憶されている前記継続保存対象データの値を前記外部装置に出力すること、
を特徴とする電子制御装置。
The electronic control device according to claim 1.
The output unit stores the value of the continuous storage target data stored in the processing work memory after the second data storage unit finishes storing the value of the continuous storage target data in the nonvolatile memory. Outputting a value to the external device;
An electronic control device.
請求項2に記載の電子制御装置において、
前記外部装置からの前記出力要求を受けた場合に、前記第2のデータ保存手段が動作する前又は該第2のデータ保存手段が動作している最中に動作して、前記外部装置側でタイムアウト判定がなされるのを防ぐための応答信号を前記外部装置に出力する先行応答手段を備えていること、
を特徴とする電子制御装置。
The electronic control device according to claim 2,
When the output request is received from the external device, the external device is operated before the second data storage unit is operating or while the second data storage unit is operating. Comprising a preceding response means for outputting a response signal for preventing a time-out determination from being made to the external device;
An electronic control device.
請求項1ないし請求項3の何れか1項に記載の電子制御装置において、
前記第2のデータ保存手段は、前記処理作業用メモリに記憶されている前記継続保存対象データの値と、前記不揮発性メモリに記憶されている前記継続保存対象データの値とを比較して、両値が異なっている場合にのみ、前記処理作業用メモリに記憶されている前記継続保存対象データの値を前記不揮発性メモリに記憶させるように構成されていること、
を特徴とする電子制御装置。
The electronic control device according to any one of claims 1 to 3,
The second data storage means compares the value of the data to be continuously stored stored in the processing work memory with the value of the data to be continuously stored stored in the nonvolatile memory, Only when both values are different, the value of the data to be continuously stored stored in the processing work memory is configured to be stored in the nonvolatile memory,
An electronic control device.
請求項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 (hereinafter referred to as a standby RAM) to which data holding power is constantly supplied, and a RAM (to which data holding power is supplied only when the electronic control unit is operating in accordance with the supply of the operation power) ( Hereinafter referred to as normal RAM), and the processing work memory is the normal RAM,
Furthermore, a copy means for copying the latest value of the data to be continuously saved from the normal RAM to the standby RAM,
The data storage means, the second data storage means, and the output means read the value of the data to be continuously saved from the normal RAM or the standby RAM, and store the read value in the processing work memory. It is configured to process as a value of the stored data to be continuously saved,
The data restoring means determines whether or not the stored data in the standby RAM is normal when the electronic control unit is activated with the supply of the operating power, and the stored data in the standby RAM is If it is determined to be 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 stored data in the standby RAM is not normal, the data restoration execution condition is It is configured that the value of the data to be continuously stored stored in the nonvolatile memory is copied to the standby RAM and the normal RAM as being established.
An electronic control device.
請求項1ないし請求項5の何れか1項に記載の電子制御装置において、
当該装置は、車両に搭載された車載機器を制御する車両用電子制御装置であると共に、
車両が所定の運転状態となったことを検出する検出手段と、
所定の故障診断実施条件が成立した場合に前記車載機器における診断対象の故障診断を実施する故障診断手段と、
当該装置の起動から停止までの間に、前記検出手段により前記所定の運転状態が検出されたときに前記処理作業用メモリに記憶されている運転回数の値を1回分だけ更新した値に書き換えると共に、前記故障診断手段にて前記故障診断が実施されたときに前記処理作業用メモリに記憶されている故障診断回数の値を1回分だけ更新した値に書き換えるデータ更新手段とを備え、
更に、前記継続保存対象データが、前記運転回数と前記故障診断回数であること、
を特徴とする電子制御装置。
The electronic control device according to any one of claims 1 to 5,
The device is an electronic control device for a vehicle that controls an in-vehicle device mounted on the vehicle,
Detecting means for detecting that the vehicle is in a predetermined driving state;
A failure diagnosis means for performing failure diagnosis of a diagnosis target in the in-vehicle device when a predetermined failure diagnosis execution condition is satisfied;
When the predetermined operating state is detected by the detecting means between the start and stop of the apparatus, the value of the number of operations stored in the processing work memory is rewritten to a value updated by one time. Data updating means for rewriting the value of the number of times of failure diagnosis stored in the processing work memory when the failure diagnosis is performed by the failure diagnosis means to a value updated only once,
Furthermore, the data to be continuously stored is the number of operations and the number of failure diagnosis,
An electronic control device.
請求項6に記載の電子制御装置において、
前記外部装置は、当該電子制御装置に接続可能な車両用の診断装置であることを特徴とする電子制御装置。
The electronic control device according to claim 6.
The external control device is a vehicle diagnostic device connectable 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 JP2004178067A (en) 2004-06-24
JP3960212B2 true 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 (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010013004A (en) * 2008-07-04 2010-01-21 Denso Corp Electronic control device for vehicle

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPWO2008038741A1 (en) * 2006-09-28 2010-01-28 富士通テン株式会社 In-vehicle device, frequency collection device, and frequency collection method
JP4345860B2 (en) 2007-09-14 2009-10-14 株式会社デンソー Vehicle memory management device
JP4978476B2 (en) * 2008-01-09 2012-07-18 株式会社デンソー Power supply status detection device
JP6851110B2 (en) 2016-10-31 2021-03-31 日立Astemo株式会社 Electronic control device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010013004A (en) * 2008-07-04 2010-01-21 Denso Corp Electronic control device for vehicle
US8306688B2 (en) 2008-07-04 2012-11-06 Denso Corporation Electronic control device

Also Published As

Publication number Publication date
JP2004178067A (en) 2004-06-24

Similar Documents

Publication Publication Date Title
JP5176728B2 (en) Electronic control device for vehicle
US10964135B2 (en) In-vehicle electronic control unit and method for abnormality response processing thereof
JP4345860B2 (en) Vehicle memory management device
US7203581B2 (en) Electronic control unit for controlling updating of data in non-volatile memory
US9110842B2 (en) Control device for vehicle and error processing method in control device for vehicle
JP4539757B2 (en) Electronic control unit
US6401163B1 (en) Apparatus and method for rewriting data from volatile memory to nonvolatile memory
US7831678B2 (en) Electronic control apparatus
US9080530B2 (en) Electronic control apparatus and vehicle control system
JPH11272498A (en) Electronic controller
JP2009276820A (en) Electronic apparatus and program
JP6011162B2 (en) Electronic control unit
JP4552982B2 (en) Electronic control unit
JPH11238005A (en) Electronic controller and control system
JP4001088B2 (en) Electronic control unit
JP3960212B2 (en) Electronic control unit
US11314634B2 (en) Electronic control unit and data protection method therefor
WO2015076012A1 (en) Electronic control device and software rewriting system
JP2004151944A (en) Method for writing data in non-volatile storage device, its program and device, and onboard electronic controller
JP7029366B2 (en) Electronic control device for automobiles
JP2004021520A (en) Electronic controller for vehicle
JP3211708B2 (en) Vehicle control device
JPH09171459A (en) Electronic control equipment
JP7482245B2 (en) Electronic control device and wake-up circuit diagnostic method
JP2001182607A (en) Vehicle controlling device

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