JP4281222B2 - Nonvolatile memory writing device - Google Patents

Nonvolatile memory writing device Download PDF

Info

Publication number
JP4281222B2
JP4281222B2 JP2000205153A JP2000205153A JP4281222B2 JP 4281222 B2 JP4281222 B2 JP 4281222B2 JP 2000205153 A JP2000205153 A JP 2000205153A JP 2000205153 A JP2000205153 A JP 2000205153A JP 4281222 B2 JP4281222 B2 JP 4281222B2
Authority
JP
Japan
Prior art keywords
microcomputer
nonvolatile memory
voltage
writing
power supply
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
JP2000205153A
Other languages
Japanese (ja)
Other versions
JP2002024101A (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 JP2000205153A priority Critical patent/JP4281222B2/en
Publication of JP2002024101A publication Critical patent/JP2002024101A/en
Application granted granted Critical
Publication of JP4281222B2 publication Critical patent/JP4281222B2/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】
【従来の技術】
この種の従来装置として、例えば、車載エンジン等を制御する車載電子制御装置(ECU)が知られている。同ECUにおいて、不揮発性メモリとしてのEEPROMには、例えば、エンジン制御における学習値や各種センサの故障を判別するための故障コード(ダイアグコード)が記憶されるようになっている。
【0003】
また、車載ECUは、バッテリ電圧からマイクロコンピュータ(以下、マイコンという)等を作動させるための電源電圧(例えば、5V)を生成する電源ICを備える。同電源ICは、電源電圧を監視しており、その低下時においてマイコンに対してリセット信号を出力するようになっている。このリセット信号に基づいてマイコンによる初期化処理が実施されECUの誤作動が未然に防止されるようになっている。
【0004】
【発明が解決しようとする課題】
ところで、上記従来技術では、マイコンが誤作動する前にリセット信号を出力する必要があるため、電源ICのリセット電圧は、マイコンの最低作動電圧よりも高い電圧レベルで設定されている。
【0005】
一方、マイコンの最低作動電圧は、マイコンのクロック信号の周波数(クロック周波数)によって変動し、同クロック周波数が高くなるほど上昇する。このため、マイコンの処理負荷の増大に対応するためにマイコンのクロック周波数を高めると、そのマイコンの最低作動電圧が、電源ICのリセット電圧を上回ることが考えられる。
【0006】
この場合、電源電圧がマイコンの最低作動電圧まで低下してもリセットがかからず、ECUが誤作動してしまう。具体的には、例えばプログラムカウンタの値が、不適切な値となってマイコンにより誤ったプログラムが実行され、ひいてはEEPROMへ誤ったデータが書き込まれるおそれがある。EEPROMへ誤ったデータが書き込まれると、故障していないセンサの故障コードが出力されたり、誤った学習値でエンジン制御が実施されてしまうといった問題が生じる。
【0007】
本発明は、上記問題に着目してなされたものであって、その目的とするところは、不揮発性メモリの誤書き込みを防止することができる不揮発性メモリ書き込み装置を提供することである。
【0008】
【課題を解決するための手段】
本発明の不揮発性メモリ書き込み装置はその前提として、最低作動電圧がそれぞれ異なる第1のマイクロコンピュータ及び第2のマイクロコンピュータと、前記第2のマイクロコンピュータによりデータが書き込まれる不揮発性メモリと、電源電圧が所定のリセット電圧以下となったとき、第1のマイクロコンピュータに対してリセット信号を出力するリセット手段とを備え、前記第1のマイクロコンピュータの最低作動電圧が前記リセット電圧よりも低く、前記第2のマイクロコンピュータの最低作動電圧が前記リセット電圧よりも高くなっている。
【0009】
従って、電源電圧が低下して第2のマイクロコンピュータの最低作動電圧よりも低下したときには、第2のマイクロコンピュータが誤作動して第2のマイクロコンピュータにより不揮発性メモリに誤ったデータが書き込まれるおそれがある。しかしながら、本発明によれば、第2のマイクロコンピュータの最低作動電圧以下となる電圧域を含む領域まで電源電圧が低下すると、第1のマイクロコンピュータにて第2のマイクロコンピュータによる不揮発性メモリの書き込みが禁止される。この場合、電源電圧が第2のマイクロコンピュータの最低作動電圧以下となったとしても、この電源電圧で正常に作動する第1のマイクロコンピュータによって不揮発性メモリの書き込みが禁止され、第2のマイクロコンピュータによる不揮発性メモリの誤書き込みを防止できる。
【0010】
また、不揮発性メモリ書き込み装置において、電源スイッチのオフ時にも記憶データを保持し、電源電圧の低下時にデータの書き込みが制限されるバックアップメモリと、電源電圧を監視し、該電源電圧が、バックアップメモリの書き込みを制限するためのしきい値電圧まで低下したとき、電圧低下信号を出力する電圧監視手段を備えているものがある。このような装置では、請求項2に記載のように、電圧監視手段からの電圧低下信号に基づいて、不揮発性メモリの書き込みが禁止される。この場合、電源電圧の低下を検出するために新たな回路を設けることなく、不揮発性メモリの誤書き込みを防止することができ、コスト的にも有利なものとなる。
【0011】
請求項3に記載の発明によれば、電源電圧の低下に伴い不揮発性メモリの書き込みが禁止された場合、電源電圧が上昇し不揮発性メモリの書き込みが禁止される電圧域以上となった後所定時間の経過後に、不揮発性メモリの書き込みが許可される。この場合、電源電圧の低下により第2のマイクロコンピュータが誤作動したとしても、所定時間が経過するまでの間に第2のマイクロコンピュータが正常動作に復帰できる。そして、その状態で不揮発性メモリの書き込みが許可されるので、不揮発性メモリの誤書き込みを確実に防止できる。
【0012】
請求項4に記載の発明によれば、第1のマイクロコンピュータの出力端子から不揮発性メモリの書き込みを禁止または許可するための制御信号が出力され、第2のマイクロコンピュータの出力端子から不揮発性メモリにデータを書き込むための制御信号が出力される。これら出力端子がゲート回路を介して不揮発性メモリのチップセレクト端子に接続される。そして、第1のマイクロコンピュータの出力端子から書き込みを禁止するための制御信号が出力されるときに、不揮発性メモリのチップセレクト端子が非選択状態とされる。この場合、電圧低下時における誤作動により第2のマイクロコンピュータから不揮発性メモリにデータを書き込むための制御信号が出力されたとしても、その信号が無効となり不揮発性メモリの書き込みを禁止できる。
【0013】
また、請求項5に記載のように、第1のマイクロコンピュータにてエンジン制御が実施され、第2のマイクロコンピュータにてトランスミッション制御が実施される。こうした装置において、エンジンの始動性を確保するとともに、トランスミッション制御を高速に実施するためには、第2のマイクロコンピュータは、第1のマイクロコンピュータよりも高いクロック信号で動作させる必要がある。この場合、第2のマイクロコンピュータの最低作動電圧は第1のマイクロコンピュータよりも高くなるので、上記発明を適用すると、実用上好ましいものとなる。
【0014】
【発明の実施の形態】
以下、この発明を具体化した実施の形態を図面に従って説明する。
図1は、本実施の形態における電子制御装置(ECU)1の概略を示す構成図である。
【0015】
図1に示すように、ECU1は、電源IC2、メインマイコン3、サブマイコン4、メイン入出力回路5、サブ入出力回路6、EEPROM7、アンド回路8、メイン発振回路9、サブ発振回路10等を備えている。
【0016】
ECU1の電源IC2には、イグニッションスイッチ11を介してバッテリBが接続されており、イグニッションスイッチ11のオン操作によりバッテリ電圧が供給される。電源IC2は、バッテリ電圧から電源電圧Vcc(具体的には、5V)を生成し、その電圧Vccを電源ラインを介してメインマイコン3、サブマイコン4、メイン入出力回路5、サブ入出力回路6及びEEPROM7等に供給する。
【0017】
第1のマイクロコンピュータとしてのメインマイコン3は、噴射制御や点火制御等のエンジン制御を実施するためのマイコンであり、第2のマイクロコンピュータとしてのサブマイコン4は、トランスミッション制御やダイアグ制御(故障診断)を実施するためのマイコンである。メインマイコン3は、CPU3a、ROM3b、RAM3c、スタンバイRAM(SRAM)3d、I/O(入出力装置)3eを備えており、サブマイコン4も同様に、CPU4a、ROM4b、RAM4c、スタンバイRAM(SRAM)4d、I/O(入出力装置)4eを備えている。CPU3a,4aは、ROM3b,4b内に格納されている制御プログラムを実行し、制御データをRAM3c,4cに一時記憶する。SRAM3d,4dには、イグニッションスイッチ11のオフ時にもバックアップ用の電源電圧(図示せず)が印加され、それによりSRAM3d,4d内の記憶データが保持されるようになっている。なお、SRAM3d,4dがバックアップメモリに相当する。
【0018】
また、各マイコン3,4によるSRAM3d,4dへのデータの書き込みは、入力端子WIがLレベルとなる場合に禁止(制限)され、入力端子WIがHレベルとなる場合に許可されるようになっている。同入力端子WIは、前記電源IC2に接続されており、その電位レベルは、電源IC2によって制御される。具体的には、電源IC2は、電源電圧Vccを監視しており、電源電圧Vccが所定のしきい値電圧(書き込み禁止電圧)Vt以下にとなるとき、Lレベルの電圧低下信号S1をメインマイコン3及びサブマイコン4の入力端子WIに出力する。つまり、電源IC2は、Vcc≦Vtでは、入力端子WIをLレベルとし、Vcc>Vtでは、入力端子WIをHレベルとする。
【0019】
また、電源電圧Vccが前記しきい値電圧(書き込み禁止電圧)Vtよりもさらに低下して所定のリセット電圧Vr以下となると(Vcc≦Vr)、電源IC2は、Lレベルのリセット信号S2をメインマイコン3のリセット端子Rに対して出力する。これにより、メインマイコン3は、実行中の処理を停止するとともに初期化処理を実施してサブマイコン4をリセットするようになっている。なお、本実施の形態では、電源IC2が、リセット手段及び電圧監視手段に相当する。
【0020】
メイン入出力回路5には、回転センサ21、エアフロメータ22、水温センサ23、スロットルセンサ24、スタータスイッチ25、インジェクタ26、イグナイタ27等が接続されている。メインマイコン3は、これら各センサ・スイッチの検出信号をメイン入出力回路5を介して取り込み、その検出信号によりエンジン運転状態を判定する。そして、その運転状態に基づいて燃料噴射信号や点火信号等の駆動信号を算出し、それら駆動信号をメイン入出力回路5を介してインジェクタ26やイグナイタ27等に出力する。これにより、インジェクタ26による燃料噴射量やイグナイタ27による点火時期等が制御される。
【0021】
一方、サブ入出力回路6には、車速センサ28、シフトポジションセンサ29、油温センサ30、ブレーキランプスイッチ31、ダイアグテスタ32、ソレノイド33等が接続されている。サブマイコン4は、これら各センサ・スイッチの検出信号をサブ入出力回路6を介して取り込み、その検出信号によりトランスミッションの作動状態を判定する。そして、その作動状態に基づく駆動信号をサブ入出力回路6を介してソレノイド33に出力する。これにより、ソレノイド33が駆動されトランスミッション内の油圧経路が切り替えられ、トランスミッションの変速が制御される。
【0022】
メインマイコン3−サブマイコン4間では、ダイレクトメモリアクセス(DMA)方式にて前記センサ・スイッチの検出信号やその検出信号に基づく各種制御量等の授受が行われる。そして、サブマイコン4は、各センサ・スイッチの検出信号等に基づいて故障診断(ダイアグノーシス)を実施するとともに、その故障診断結果をサブ入出力回路6を介してダイアグテスタ32に出力する。
【0023】
サブマイコン4には、不揮発性メモリとしてのEEPROM7が接続されており、同EEPROM7には、故障診断に基づくダイアグ情報、ソレノイド33の個体差による制御バラツキを補正するためのソレノイド電流補正値等が記憶されている。また、EEPROM7のチップセレクト端子CSには、ゲート回路としてのアンド回路8の出力が接続されており、同アンド回路8の一方の入力はメインマイコン3の出力端子CS1に接続されるとともに、アンド回路8の他方の入力はサブマイコン4の出力端子CS2に接続されている。このEEPROM7のチップセレクト端子CSは、EEPROM7の書き込みを許可及び禁止するための端子であり、同端子CSがHレベル(選択状態)では書き込みが許可され、Lレベル(非選択状態)では書き込みが禁止される。つまり、メインマイコン3及びサブマイコン4の出力端子CS1,CS2からHレベルの制御信号SC1,SC2が出力されたとき、EEPROM7のチップセレクト端子CSがHレベル(選択状態)となる。そのとき、サブマイコン4とEEPROM7との間のデータ通信が有効となって、所望のデータがEEPROM7に書き込まれるようになっている。
【0024】
本実施の形態において、メインマイコン3には、メイン発振回路9が接続されており、メインマイコン3は、メイン発振回路9から出力される16MHzのクロック信号に基づいて作動する。一方、サブマイコン4には、サブ発振回路10が接続されており、サブマイコン4はサブ発振回路10から出力される20MHzのクロック信号に基づいて作動する。ここで、サブマイコン4が実施するトランスミッション制御において、過渡時の油圧制御でソレノイド33を高速に作動させる必要があるが、16MHzのクロック信号では、的確なタイミングでソレノイド33を制御できず、仕様通りの作動を得ることができない。このため、本実施の形態では、サブマイコン4のクロック信号を20MHzとし、要求仕様を満足させるようにしている。
【0025】
このように、メインマイコン3のクロック信号を16MHzとし、サブマイコン4のクロック信号を20MHzとした場合、図2に示すように、メインマイコン3の最低作動電圧Vmよりも、サブマイコン4の最低作動電圧Vsが高くなる。また、メインマイコン3に対してリセット信号を出力するためのリセット電圧Vrは、エンジンの始動性を確保するためにできる限り低くする必要があり、その電圧レベルは、メインマイコン3の最低作動電圧Vmとサブマイコン4の最低作動電圧Vsとの間に設定されている。つまり、リセット電圧Vrは、サブマイコン4の最低作動電圧Vsよりも低く設定されている。そのため、電源電圧Vccが低下して最低作動電圧Vsとリセット電圧Vrとの間の電圧値となる期間T1では、サブマイコン4が誤作動するおそれがあるが、メインマイコン3の出力端子CS1をLレベルとすることで、EEPROM7の書き込みを禁止するようにしている。
【0026】
また、本実施の形態において、SRAM3d,4dの書き込みを制限するためのしきい値電圧Vtは、サブマイコン4の最低作動電圧Vsより幾分高い電圧レベルで設定されている。よって、電源電圧Vccの低下時において、電源電圧Vccがサブマイコン最低作動電圧Vsに至る前に、電源IC2から電圧低下信号S1が出力されて入力端子WIがLレベルとなる。本実施の形態では、この入力端子WIの電位レベルに基づいて、メインマイコン3によるEEPROM7の書き込み禁止処理が実施されている。
【0027】
次に、上記のように構成されるECU1の作用を説明する。ここでは先ず、サブマイコン4により実施されるEEPROM7の書き込み処理の一例を、図3〜図6を用いて説明する。なお、図3の処理は、ダイアグ情報をEEPROM7に書き込むための処理であり、例えば64ミリ秒毎に実施される。また、図4の処理は、ソレノイド電流補正値をEEPROM7に書き込むための処理であり、例えば16ミリ秒毎に実施される。
【0028】
本実施の形態におけるEEPROM7は、図6に示すように、開始アドレス00〜終了アドレスfeまでの記憶領域を有している。その記憶領域うち00〜1eまでのアドレスがダイアグコードを記憶するための領域として確保され、fc〜feのアドレスがソレノイド電流補正値を記憶するための領域として確保されている。つまり、サブマイコン4にて各種センサ・スイッチ等の故障が判定されて、故障の有無を示す「1」または「0」のデータがアドレス00〜1eの各ビット(ビット0〜ビット15)に記憶される。また、工場出荷検査時にて、500mA又は1Aの基準電流がソレノイド33に流されその際に求められるソレノイド電流補正値がアドレスfc〜feに記憶される。
【0029】
図3において、ダイアグ前回値とは、前回処理時のダイアグ更新値を記憶したものである。また、イグニッションキーのオン時の初期化処理では、EEPROM7から読み出されたダイアグ情報が、ダイアグ前回値及びダイアグ更新値として記憶されている。よって、正常時にはダイアグ更新値とダイアグ前回値は一致しているが、図示しないダイアグ検出処理にて新たな故障が検出されたとき、ダイアグ更新値が更新され、その更新値がダイアグ前回値と一致しなくなる。
【0030】
そして、図3のステップ100にて、ダイアグ前回値がダイアグ更新値と一致するか否かが判定される。ここで、ダイアグ検出処理にて新たな故障が検出されていないときは、同ステップ100にて肯定判別され、書き込み処理(ステップ110,ステップ120の処理)を実施することなく本処理を終了する。一方、ダイアグ検出処理にて新たな故障が検出され、ステップ100にて否定判別された場合、ステップ110に移行する。そして、ダイアグ前回値とダイアグ更新値について、各ビット毎に論理和をとり、その結果をダイアグ前回値とする。なおここでは、新たに検出されたセンサ・スイッチの故障に対応したビットが、「0」から「1」に変更される。続くステップ120において、変更されたダイアグ前回値(データ)と、それを書き込むべきアドレスとを引数として、図5に示すEEPROM書込処理へ移行する。
【0031】
図5に示すように、ステップ310にてサブマイコン4は、入力端子WIがHレベルか否かを判定する。つまり、電源電圧Vccの低下時か否かを判定する。ここで、入力端子WIがLレベルであり、電源電圧Vccの低下時と判定したときには、ステップ320〜ステップ350の処理を実施することなく、ステップ360に移行する。一方、入力端子WIがHレベルであれば、電源電圧Vccの低下時ではないと判定し、ステップ320に移行する。そして、ステップ320にて、出力端子CS2からHレベルの制御信号SC2を出力するとともに、ステップ330にて、EEPROM7の動作モードを書き込みモードとすべく書き込み命令を送信する。続くステップ340にてアドレスを送信するとともにステップ350にてデータを送信した後、ステップ360に移行する。そして、同ステップ360にて、出力端子CS2からLレベルの制御信号SC2を出力した後本処理を終了する。
【0032】
次に、ソレノイド電流補正値の書き込み処理について説明する。
図4に示すように、サブマイコン4は、ステップ200にて、工場出荷検査モードか否かを判定する。なおここでは、ECU1に対して所定の検査モード信号が入力され、その信号に基づいて工場出荷検査モードが判定される。同ステップ200にて、否定判別された場合、書き込み処理(ステップ210〜230の処理)を実施することなく本処理を終了する。一方、ステップ200にて肯定判別された場合、ステップ210に移行して、ソレノイド33に流れる電流値を前記サブ入出力回路6に配設されるA/D変換器(図示せず)を用いてA/D変換する。そして、ステップ220において、ソレノイド電流A/D変換値からソレノイド電流基準値を減算することによって、ソレノイド電流補正値を求める。続くステップ230において、このソレノイド電流補正値(データ)と、それを書き込むべきアドレスとを引数として、既述した図5のEEPROM書込処理(ステップ310〜360の処理)を実施する。
【0033】
次いで、メインマイコン3にて実行されるEEPROM7の書き込み禁止処理を図7を用いて詳述する。なお、図7の処理は、例えば、4ミリ秒毎に実行される。
【0034】
メインマイコン3は、ステップ400にて、入力端子WIがLレベルか否かを判定する。そして、入力端子WIがLレベルである場合、ステップ410に移行してカウンタをクリアした後ステップ430に進む。一方、入力端子WIがHレベルである場合、ステップ420に移行してカウンタの値をカウントアップさせた後ステップ430に進む。なおこのカウンタは、入力端子WIがHレベルとなった後の時間を計測するカウンタであって、前記RAM3cの所定の記憶領域に確保されている。ステップ430において、カウンタの値に基づいて、入力端子WIがHレベルとなった後所定時間T2が経過しているか否かを判定する。ここで、所定時間T2が経過していなければ、ステップ440にて、EEPROM7の書き込みを禁止するために、出力端子CS1からLレベルの制御信号SC1を出力して本処理を終了する。一方、所定時間T2が経過している場合、ステップ450にて、EEPROM7の書き込みを許可するために、出力端子CS1からHレベルの制御信号SC1を出力した後本処理を終了する。
【0035】
ここで、本実施の形態におけるEEPROM7の書き込み許可及び禁止の動作を図2を用いて詳述する。図2において、例えば、t1のタイミング以前では電源電圧Vccがしきい値電圧Vtよりも高いため、出力端子CS1はHレベルに保持されている。そのとき、データの書き込み要求に伴い出力端子CS2がHレベルとなると、アンド回路8の出力はHレベルとなりEEPROM7の書き込みが許可されて、サブマイコン4から送信されるデータがEEPROM7に書き込まれる。
【0036】
これに対して、電源電圧Vccがしきい値電圧Vt以下となると、電源IC2により入力端子WIがLレベルとされ、それに従いカウンタがクリアされるとともに出力端子CS1がLレベルとされる。そして、出力端子CS1がLレベルになる期間(t1〜t3)では、出力端子CS2がHレベルになっても、アンド回路8の出力はLレベルとなりEEPROM7の書き込みが禁止される。特に、期間T1においては、電源電圧Vccがサブマイコン4の最低作動電圧Vsを下回るので、サブマイコン4が誤作動するおそれがある。このため、図3〜図5の処理が誤って実施され、サブマイコン4の出力端子CS2からHレベルの制御信号SC2が出力されるとともに、サブマイコン4からEEPROM7に通信データが送信されることがある。しかしながら、本実施の形態では、メインマイコン3により出力端子CS1がLレベルに制御され、EEPROM7のチップセレクト端子CSがLレベル(非選択状態)となる。これにより、サブマイコン4とEEPROM7間のデータ通信が無効となり、EEPROM7の書き込みが禁止される。
【0037】
また、電源電圧Vccがしきい値電圧Vt以上となると、カウンタがカウントアップされ、タイミングt2からの時間が計測される。そして、所定時間T2の経過後(t3のタイミング)に出力端子CS1がHレベルに制御される。このように、本実施の形態では、電源電圧Vccがしきい値電圧Vt以上に復帰してから出力端子CS1がHレベルとなるまでにディレー時間T2が設定されている。よって、期間T1にてサブマイコン4が誤作動したとしても、この時間T2が経過する間に、サブマイコン4が正常動作に確実に復帰する。その後、データの書き込み要求に伴い出力端子CS2がHレベルとなると、EEPROM7の書き込みが許可されて、サブマイコン4からEEPROM7に送信されるデータがEEPROM7に書き込まれる。
【0038】
以上詳述した本実施の形態によれば、以下に示す効果が得られる。
(1)電源電圧Vccがしきい値電圧Vtまで低下すると、電源IC2から電圧低下信号S1が出力され、入力端子WIがLレベルとなる。このとき、メインマイコン3によって電源電圧Vccの低下が判定され、出力端子CS1がLレベルに制御されてサブマイコン4によるEEPROM7の書き込みが禁止される。このようにすれば、電源電圧Vccがサブマイコン4の最低作動電圧Vs以下となったとしても、この電源電圧Vccで正常に作動するメインマイコン3によりEEPROM7の書き込みが禁止され、サブマイコン4の誤作動によるEEPROM7の誤書き込みを防止できる。
【0039】
(2)電源IC2からの電圧低下信号S1は、既述したようにSRAM3d,4dの書き込みを禁止(制限)するために従来から用いられているものある。つまり、本実施の形態では、電源電圧Vccの低下を検出するために新たな回路を設けることなく、EEPROM7の誤書き込みを防止することができ、コスト的にも有利なものとなる。
【0040】
(3)電源電圧Vccがサブマイコン4の最低作動電圧Vsまで低下し(図2の期間T1)サブマイコン4が誤作動したとしても、電源電圧Vccがしきい値電圧Vt以上に上昇し所定時間T2が経過するまでの間にサブマイコン4が正常動作に復帰する。そして、その状態でメインマイコン3の出力端子CS1がHレベルに制御されてEEPROM7の書き込みが許可される。このようにすれば、サブマイコン4によるEEPROM7の誤書き込みを確実に防止できる。
【0041】
(4)メインマイコン3は、EEPROM7の書き込みを禁止または許可するための制御信号SC1を出力する出力端子CS1を有し、サブマイコン4は、EEPROM7にデータを書き込むための制御信号SC2を出力する出力端子CS2を有し、各出力端子CS1,CS2をアンド回路8を介してEEPROM7のチップセレクト端子CSに接続するようにした。このようにすれば、メインマイコン3の出力端子CS1から書き込みを禁止するためのLレベルの制御信号SC1が出力されると、アンド回路8によりEEPROM7のチップセレクト端子CSが常にLレベル(非選択状態)とされる。この場合、電圧低下時における誤作動によりサブマイコン4の出力端子CS2からHレベルの制御信号SC2が出力されたとしても、該制御信号SC2が無効となりEEPROM7の書き込みを禁止できる。
【0042】
なお本発明は、上記以外に次の形態にて具体化できる。
上記実施の形態では、電圧監視手段として電源IC2を用い、SRAM3d,4dの書き込みを禁止するために電源IC2から出力される電圧低下信号S1を用いて、EEPROM7の書き込みを禁止する構成であったが、これに限定するものではない。例えば、電源IC2とは別に電源電圧Vccの低下を検出する電圧監視手段を新たに設けてもよい。なおこの場合、電源電圧Vccの低下を検出するためのしきい値電圧Vtをサブマイコン4の最低作動電圧Vsに近づけることが望ましい。つまり、図2に示すように、しきい値電圧Vtとサブマイコン最低作動電圧Vsとの電圧値が異なる場合、電源電圧Vccがしきい値電圧Vt以下に低下し、サブマイコン4の最低作動電圧Vsに至る前に上昇することが考えられる。この場合、サブマイコン4が誤作動しない範囲の電圧低下であるにも拘わらず、EEPROM7の書き込みが禁止されるが、しきい値電圧Vtをサブマイコン最低作動電圧Vsに近づけることによって、こうした不都合を回避できる。
【0043】
上記実施の形態では、ゲート回路としてアンド回路8を用いるものであったが、これに限定するものではない。例えば、EEPROM7のようにチップセレクト端子がHレベルのときに選択状態となるものではなく、Lレベルのときに選択状態となるEEPROMを使用する場合には、アンド回路8に代えてオア回路を用いる。そして、電源電圧Vccの低下時にて書き込み禁止する際には、メインマイコン3の出力端子からHレベルの制御信号をオア回路に出力する。このようにすれば、オア回路の出力は常にHレベルとなり、EEPROMのチップセレクト端子が非選択状態となる。よって、電源電圧Vccの低下時において、EEPROMの誤書き込みを防止できる。
【0044】
上記実施の形態では、不揮発性メモリとして、EEPROMを用いるものであったが、フラッシュメモリを用いることもできる。
上記実施の形態では、エンジン制御及びトランスミッション制御を実施するためのECU1に具体化したが、これに限ることなく、車両制御(例えば、ABS制御)やボディ制御(例えば、エアコン制御)等を実施するECUに具体化してもよい。要は、最低作動電圧の異なる2つのマイコンを用いて各種制御を実施し、最低作動電圧が高いマイコンにて不揮発性メモリの書き込みを行うECUに具体化するものであればよい。
【図面の簡単な説明】
【図1】発明の実施の形態におけるECUの概要を示す構成図。
【図2】電源電圧の低下時の動作を説明するための図。
【図3】ダイアグ情報の書込処理を示すフローチャート。
【図4】ソレノイド電流補正値の書込処理を示すフローチャート。
【図5】EEPROM書込処理を示すフローチャート。
【図6】EEPROMの格納データを説明するための図。
【図7】メインマイコンによる書込禁止処理を示すフローチャート。
【符号の説明】
1…不揮発性メモリ書き込み装置としてのECU、2…リセット手段及び電圧監視手段としての電源IC、3…第1のマイクロコンピュータとしてのメインマイコン、3d…バックアップメモリとしてのSRAM、4…第2のマイクロコンピュータとしてのサブマイコン、4d…バックアップメモリとしてのSRAM、7…不揮発性メモリとしてのEEPROM、8…ゲート回路としてのアンド回路、11…電源スイッチとしてのイグニッションスイッチ、CS…チップセレクト端子、CS1,CS2…出力端子、S1…電圧低下信号、S2…リセット信号、SC1,SC2…制御信号、Vcc…電源電圧、Vm…メインマイコン最低作動電圧、Vs…サブマイコン最低作動電圧、Vr…リセット電圧、Vt…しきい値電圧。
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a nonvolatile memory writing device.
[0002]
[Prior art]
As this type of conventional device, for example, an in-vehicle electronic control unit (ECU) that controls an in-vehicle engine or the like is known. In the ECU, an EEPROM as a non-volatile memory stores, for example, a learning value in engine control and a failure code (diagnostic code) for determining failure of various sensors.
[0003]
The in-vehicle ECU includes a power supply IC that generates a power supply voltage (for example, 5 V) for operating a microcomputer (hereinafter referred to as a microcomputer) from the battery voltage. The power supply IC monitors the power supply voltage and outputs a reset signal to the microcomputer when the power supply voltage drops. Based on this reset signal, initialization processing by the microcomputer is performed to prevent malfunction of the ECU.
[0004]
[Problems to be solved by the invention]
By the way, in the above prior art, since it is necessary to output a reset signal before the microcomputer malfunctions, the reset voltage of the power supply IC is set at a voltage level higher than the minimum operating voltage of the microcomputer.
[0005]
On the other hand, the minimum operating voltage of the microcomputer varies depending on the clock signal frequency (clock frequency) of the microcomputer, and increases as the clock frequency increases. For this reason, when the clock frequency of the microcomputer is increased in order to cope with an increase in the processing load of the microcomputer, it is considered that the minimum operating voltage of the microcomputer exceeds the reset voltage of the power supply IC.
[0006]
In this case, even if the power supply voltage decreases to the minimum operating voltage of the microcomputer, the reset is not performed and the ECU malfunctions. Specifically, for example, the value of the program counter becomes an inappropriate value, and an erroneous program is executed by the microcomputer, and thus erroneous data may be written to the EEPROM. If incorrect data is written to the EEPROM, a failure code of a sensor that has not failed is output, or engine control is performed with an incorrect learning value.
[0007]
The present invention has been made paying attention to the above problems, and an object of the present invention is to provide a nonvolatile memory writing device capable of preventing erroneous writing of the nonvolatile memory.
[0008]
[Means for Solving the Problems]
The nonvolatile memory writing device according to the present invention is premised on a first microcomputer and a second microcomputer having different minimum operating voltages, a nonvolatile memory in which data is written by the second microcomputer, and a power supply voltage. Reset means for outputting a reset signal to the first microcomputer when the voltage becomes equal to or lower than a predetermined reset voltage, and the minimum operating voltage of the first microcomputer is lower than the reset voltage, The minimum operating voltage of the microcomputer 2 is higher than the reset voltage.
[0009]
Therefore, when the power supply voltage is lowered to be lower than the minimum operating voltage of the second microcomputer, the second microcomputer may malfunction and erroneous data may be written to the nonvolatile memory by the second microcomputer. There is. However, according to the present invention, when the power supply voltage is reduced to a region including a voltage range that is lower than the minimum operating voltage of the second microcomputer, the first microcomputer writes the nonvolatile memory by the second microcomputer. Is prohibited. In this case, even if the power supply voltage becomes equal to or lower than the minimum operating voltage of the second microcomputer, the writing of the nonvolatile memory is prohibited by the first microcomputer that operates normally with this power supply voltage, and the second microcomputer Can prevent erroneous writing to the nonvolatile memory.
[0010]
In addition, in the nonvolatile memory writing device, the stored data is retained even when the power switch is turned off, the data writing is restricted when the power supply voltage is reduced, the power supply voltage is monitored, and the power supply voltage is Some have voltage monitoring means for outputting a voltage drop signal when the voltage drops to a threshold voltage for limiting the writing of. In such an apparatus, as described in claim 2, writing to the nonvolatile memory is prohibited based on the voltage drop signal from the voltage monitoring means. In this case, it is possible to prevent erroneous writing of the nonvolatile memory without providing a new circuit for detecting a decrease in power supply voltage, which is advantageous in terms of cost.
[0011]
According to the third aspect of the present invention, when writing to the nonvolatile memory is prohibited due to a decrease in the power supply voltage, the power supply voltage rises and exceeds a voltage range where writing to the nonvolatile memory is prohibited. After the elapse of time, writing to the nonvolatile memory is permitted. In this case, even if the second microcomputer malfunctions due to a decrease in the power supply voltage, the second microcomputer can return to normal operation until a predetermined time elapses. In this state, since writing to the nonvolatile memory is permitted, erroneous writing to the nonvolatile memory can be reliably prevented.
[0012]
According to the fourth aspect of the present invention, the control signal for prohibiting or permitting writing of the nonvolatile memory is output from the output terminal of the first microcomputer, and the nonvolatile memory is output from the output terminal of the second microcomputer. A control signal for writing data to is output. These output terminals are connected to the chip select terminal of the nonvolatile memory through the gate circuit. Then, when a control signal for prohibiting writing is output from the output terminal of the first microcomputer, the chip select terminal of the nonvolatile memory is brought into a non-selected state. In this case, even if a control signal for writing data to the nonvolatile memory is output from the second microcomputer due to a malfunction at the time of a voltage drop, the signal becomes invalid and writing to the nonvolatile memory can be prohibited.
[0013]
Further, as described in claim 5, engine control is performed by the first microcomputer, and transmission control is performed by the second microcomputer. In such an apparatus, in order to ensure engine startability and perform transmission control at high speed, the second microcomputer needs to be operated with a clock signal higher than that of the first microcomputer. In this case, since the minimum operating voltage of the second microcomputer is higher than that of the first microcomputer, it is practically preferable to apply the above invention.
[0014]
DETAILED DESCRIPTION OF THE INVENTION
Embodiments of the present invention will be described below with reference to the drawings.
FIG. 1 is a configuration diagram showing an outline of an electronic control unit (ECU) 1 in the present embodiment.
[0015]
As shown in FIG. 1, the ECU 1 includes a power supply IC 2, a main microcomputer 3, a sub microcomputer 4, a main input / output circuit 5, a sub input / output circuit 6, an EEPROM 7, an AND circuit 8, a main oscillation circuit 9, a sub oscillation circuit 10, and the like. I have.
[0016]
A battery B is connected to the power supply IC 2 of the ECU 1 via an ignition switch 11, and a battery voltage is supplied by turning on the ignition switch 11. The power supply IC 2 generates a power supply voltage Vcc (specifically, 5 V) from the battery voltage, and the voltage Vcc is supplied to the main microcomputer 3, the sub microcomputer 4, the main input / output circuit 5, and the sub input / output circuit 6 through the power supply line. And to the EEPROM 7 and the like.
[0017]
The main microcomputer 3 as a first microcomputer is a microcomputer for performing engine control such as injection control and ignition control, and the sub-microcomputer 4 as a second microcomputer is a transmission control and diagnostic control (fault diagnosis). ). The main microcomputer 3 includes a CPU 3a, a ROM 3b, a RAM 3c, a standby RAM (SRAM) 3d, and an I / O (input / output device) 3e. Similarly, the sub-microcomputer 4 has a CPU 4a, a ROM 4b, a RAM 4c, and a standby RAM (SRAM). 4d and an I / O (input / output device) 4e. The CPUs 3a and 4a execute control programs stored in the ROMs 3b and 4b, and temporarily store control data in the RAMs 3c and 4c. A backup power supply voltage (not shown) is applied to the SRAMs 3d and 4d even when the ignition switch 11 is turned off, so that data stored in the SRAMs 3d and 4d is held. Note that the SRAMs 3d and 4d correspond to a backup memory.
[0018]
Further, data writing to the SRAMs 3d and 4d by the microcomputers 3 and 4 is prohibited (restricted) when the input terminal WI becomes L level, and is permitted when the input terminal WI becomes H level. ing. The input terminal WI is connected to the power supply IC2, and its potential level is controlled by the power supply IC2. Specifically, the power supply IC2 monitors the power supply voltage Vcc, and when the power supply voltage Vcc falls below a predetermined threshold voltage (write inhibit voltage) Vt, the L level voltage drop signal S1 is sent to the main microcomputer. 3 and the input terminal WI of the sub-microcomputer 4. That is, the power supply IC2 sets the input terminal WI to the L level when Vcc ≦ Vt, and sets the input terminal WI to the H level when Vcc> Vt.
[0019]
When the power supply voltage Vcc further falls below the threshold voltage (write inhibit voltage) Vt and falls below a predetermined reset voltage Vr (Vcc ≦ Vr), the power supply IC2 sends an L level reset signal S2 to the main microcomputer. 3 to the reset terminal R. As a result, the main microcomputer 3 stops the process being executed and performs an initialization process to reset the sub-microcomputer 4. In the present embodiment, the power supply IC 2 corresponds to a reset unit and a voltage monitoring unit.
[0020]
The main input / output circuit 5 is connected with a rotation sensor 21, an air flow meter 22, a water temperature sensor 23, a throttle sensor 24, a starter switch 25, an injector 26, an igniter 27, and the like. The main microcomputer 3 takes in the detection signals of these sensors and switches via the main input / output circuit 5 and determines the engine operating state based on the detection signals. Then, drive signals such as a fuel injection signal and an ignition signal are calculated based on the operation state, and these drive signals are output to the injector 26, the igniter 27, etc. via the main input / output circuit 5. Thereby, the fuel injection amount by the injector 26, the ignition timing by the igniter 27, and the like are controlled.
[0021]
On the other hand, a vehicle speed sensor 28, a shift position sensor 29, an oil temperature sensor 30, a brake lamp switch 31, a diagnostic tester 32, a solenoid 33, and the like are connected to the sub input / output circuit 6. The sub-microcomputer 4 takes in the detection signals of these sensors and switches via the sub input / output circuit 6 and determines the operating state of the transmission based on the detection signals. Then, a drive signal based on the operating state is output to the solenoid 33 via the sub input / output circuit 6. As a result, the solenoid 33 is driven, the hydraulic path in the transmission is switched, and the transmission shift is controlled.
[0022]
Between the main microcomputer 3 and the sub-microcomputer 4, detection signals of the sensors and switches and various control amounts based on the detection signals are exchanged by the direct memory access (DMA) method. The sub-microcomputer 4 performs failure diagnosis (diagnosis) based on the detection signals of the sensors and switches, and outputs the failure diagnosis result to the diagnosis tester 32 via the sub input / output circuit 6.
[0023]
The sub-microcomputer 4 is connected to an EEPROM 7 as a non-volatile memory. The EEPROM 7 stores diagnostic information based on failure diagnosis, a solenoid current correction value for correcting a control variation due to individual differences of the solenoid 33, and the like. Has been. The output of the AND circuit 8 as a gate circuit is connected to the chip select terminal CS of the EEPROM 7, and one input of the AND circuit 8 is connected to the output terminal CS1 of the main microcomputer 3, and the AND circuit. The other input of 8 is connected to the output terminal CS <b> 2 of the sub-microcomputer 4. The chip select terminal CS of the EEPROM 7 is a terminal for permitting and prohibiting writing to the EEPROM 7, and writing is permitted when the terminal CS is at H level (selected state), and writing is prohibited at L level (non-selected state). Is done. That is, when the H level control signals SC1 and SC2 are output from the output terminals CS1 and CS2 of the main microcomputer 3 and the sub microcomputer 4, the chip select terminal CS of the EEPROM 7 becomes H level (selected state). At that time, data communication between the sub-microcomputer 4 and the EEPROM 7 is enabled, and desired data is written into the EEPROM 7.
[0024]
In the present embodiment, a main oscillation circuit 9 is connected to the main microcomputer 3, and the main microcomputer 3 operates based on a 16 MHz clock signal output from the main oscillation circuit 9. On the other hand, a sub oscillation circuit 10 is connected to the sub microcomputer 4, and the sub microcomputer 4 operates based on a 20 MHz clock signal output from the sub oscillation circuit 10. Here, in the transmission control performed by the sub-microcomputer 4, it is necessary to operate the solenoid 33 at high speed by hydraulic control during transition. However, with the 16 MHz clock signal, the solenoid 33 cannot be controlled at an accurate timing, and as specified. Can not get the operation. For this reason, in this embodiment, the clock signal of the sub-microcomputer 4 is set to 20 MHz so as to satisfy the required specifications.
[0025]
Thus, when the clock signal of the main microcomputer 3 is 16 MHz and the clock signal of the sub microcomputer 4 is 20 MHz, the minimum operation of the sub microcomputer 4 is lower than the minimum operation voltage Vm of the main microcomputer 3 as shown in FIG. The voltage Vs increases. Further, the reset voltage Vr for outputting a reset signal to the main microcomputer 3 needs to be as low as possible in order to ensure engine startability, and the voltage level is the minimum operating voltage Vm of the main microcomputer 3. And the minimum operating voltage Vs of the sub-microcomputer 4 is set. That is, the reset voltage Vr is set lower than the minimum operating voltage Vs of the sub-microcomputer 4. Therefore, in the period T1 in which the power supply voltage Vcc decreases and becomes a voltage value between the minimum operating voltage Vs and the reset voltage Vr, the sub-microcomputer 4 may malfunction, but the output terminal CS1 of the main microcomputer 3 is set to L By setting the level, writing to the EEPROM 7 is prohibited.
[0026]
In the present embodiment, the threshold voltage Vt for limiting the writing to the SRAMs 3d and 4d is set at a voltage level somewhat higher than the minimum operating voltage Vs of the sub-microcomputer 4. Therefore, when the power supply voltage Vcc is lowered, the voltage drop signal S1 is output from the power supply IC2 and the input terminal WI becomes L level before the power supply voltage Vcc reaches the sub microcomputer minimum operating voltage Vs. In the present embodiment, write prohibition processing of the EEPROM 7 by the main microcomputer 3 is performed based on the potential level of the input terminal WI.
[0027]
Next, the operation of the ECU 1 configured as described above will be described. Here, first, an example of the writing process of the EEPROM 7 executed by the sub-microcomputer 4 will be described with reference to FIGS. Note that the process of FIG. 3 is a process for writing diagnostic information into the EEPROM 7, and is performed, for example, every 64 milliseconds. Further, the process of FIG. 4 is a process for writing the solenoid current correction value in the EEPROM 7, and is performed, for example, every 16 milliseconds.
[0028]
As shown in FIG. 6, the EEPROM 7 in the present embodiment has a storage area from a start address 00 to an end address fe. Of the storage areas, addresses from 0 to 1e are secured as areas for storing diagnostic codes, and addresses from fc to fe are secured as areas for storing solenoid current correction values. That is, when the sub-microcomputer 4 determines failure of various sensors, switches, etc., “1” or “0” data indicating the presence or absence of the failure is stored in each bit (bit 0 to bit 15) of the address 00 to 1e. Is done. Further, at the time of factory shipment inspection, a reference current of 500 mA or 1 A is supplied to the solenoid 33, and solenoid current correction values obtained at that time are stored in the addresses fc to fe.
[0029]
In FIG. 3, the previous diagnostic value is a value stored in the updated diagnostic value at the previous processing. In the initialization process when the ignition key is turned on, the diagnosis information read from the EEPROM 7 is stored as the previous diagnosis value and the updated value of the diagnosis. Therefore, the diagnosis update value and the previous diagnosis value match when normal, but when a new failure is detected by a diagnosis detection process (not shown), the diagnosis update value is updated, and the updated value matches the previous diagnosis value. I will not do it.
[0030]
Then, in step 100 of FIG. 3, it is determined whether or not the previous diagnosis value matches the updated diagnosis value. Here, when a new failure is not detected in the diagnosis detection process, an affirmative determination is made in step 100, and this process is terminated without performing the write process (steps 110 and 120). On the other hand, if a new failure is detected in the diagnosis detection process and a negative determination is made in step 100, the process proceeds to step 110. Then, a logical sum is calculated for each bit for the previous value of the diagnosis and the updated value of the diagnosis, and the result is used as the previous value of the diagnosis. Here, the bit corresponding to the newly detected failure of the sensor switch is changed from “0” to “1”. In the following step 120, the process shifts to the EEPROM writing process shown in FIG. 5 with the changed previous value (data) of the diagnosis and the address to which it is written as arguments.
[0031]
As shown in FIG. 5, in step 310, the sub-microcomputer 4 determines whether or not the input terminal WI is at the H level. That is, it is determined whether or not the power supply voltage Vcc is decreasing. Here, when it is determined that the input terminal WI is at the L level and the power supply voltage Vcc is lowered, the process proceeds to step 360 without performing the processing of step 320 to step 350. On the other hand, if the input terminal WI is at the H level, it is determined that the power supply voltage Vcc is not lowered, and the process proceeds to step 320. Then, in step 320, the H level control signal SC2 is output from the output terminal CS2, and in step 330, a write command is transmitted to set the operation mode of the EEPROM 7 to the write mode. In step 340, the address is transmitted and the data is transmitted in step 350. Then, the process proceeds to step 360. In step 360, the L level control signal SC2 is output from the output terminal CS2, and then the present process is terminated.
[0032]
Next, the solenoid current correction value writing process will be described.
As shown in FIG. 4, the sub-microcomputer 4 determines in step 200 whether or not it is a factory shipment inspection mode. Here, a predetermined inspection mode signal is input to the ECU 1, and the factory shipment inspection mode is determined based on the signal. If a negative determination is made in step 200, the present process is terminated without performing the writing process (steps 210 to 230). On the other hand, if an affirmative determination is made in step 200, the process proceeds to step 210, and the current value flowing through the solenoid 33 is converted into an A / D converter (not shown) disposed in the sub input / output circuit 6. A / D conversion is performed. In step 220, the solenoid current correction value is obtained by subtracting the solenoid current reference value from the solenoid current A / D conversion value. In the following step 230, the above-described EEPROM writing process (processes in steps 310 to 360) of FIG. 5 is performed using the solenoid current correction value (data) and the address to which it is written as arguments.
[0033]
Next, the write prohibiting process of the EEPROM 7 executed by the main microcomputer 3 will be described in detail with reference to FIG. Note that the processing in FIG. 7 is executed, for example, every 4 milliseconds.
[0034]
In step 400, the main microcomputer 3 determines whether or not the input terminal WI is at the L level. If the input terminal WI is at the L level, the process proceeds to step 410 to clear the counter, and then proceeds to step 430. On the other hand, if the input terminal WI is at the H level, the process proceeds to step 420 to increment the counter value and then proceeds to step 430. This counter is a counter that measures the time after the input terminal WI becomes H level, and is secured in a predetermined storage area of the RAM 3c. In step 430, based on the value of the counter, it is determined whether or not a predetermined time T2 has elapsed after the input terminal WI becomes H level. Here, if the predetermined time T2 has not elapsed, in step 440, in order to prohibit writing to the EEPROM 7, an L-level control signal SC1 is output from the output terminal CS1, and this process is terminated. On the other hand, if the predetermined time T2 has elapsed, in step 450, in order to permit writing in the EEPROM 7, the H level control signal SC1 is output from the output terminal CS1, and then this process is terminated.
[0035]
Here, the write permission / prohibition operation of the EEPROM 7 in this embodiment will be described in detail with reference to FIG. In FIG. 2, for example, before the timing t1, the power supply voltage Vcc is higher than the threshold voltage Vt, so the output terminal CS1 is held at the H level. At this time, when the output terminal CS2 becomes H level in response to a data write request, the output of the AND circuit 8 becomes H level, writing to the EEPROM 7 is permitted, and data transmitted from the sub-microcomputer 4 is written to the EEPROM 7.
[0036]
On the other hand, when the power supply voltage Vcc is equal to or lower than the threshold voltage Vt, the input terminal WI is set to L level by the power supply IC2, the counter is cleared accordingly, and the output terminal CS1 is set to L level. In the period (t1 to t3) when the output terminal CS1 is at the L level, the output of the AND circuit 8 is at the L level and writing to the EEPROM 7 is prohibited even if the output terminal CS2 is at the H level. In particular, in the period T1, the power supply voltage Vcc is lower than the minimum operating voltage Vs of the sub-microcomputer 4, so that the sub-microcomputer 4 may malfunction. For this reason, the processes of FIGS. 3 to 5 are erroneously performed, and an H level control signal SC2 is output from the output terminal CS2 of the sub-microcomputer 4, and communication data is transmitted from the sub-microcomputer 4 to the EEPROM 7. is there. However, in the present embodiment, the main microcomputer 3 controls the output terminal CS1 to L level, and the chip select terminal CS of the EEPROM 7 becomes L level (non-selected state). As a result, data communication between the sub-microcomputer 4 and the EEPROM 7 becomes invalid, and writing to the EEPROM 7 is prohibited.
[0037]
When the power supply voltage Vcc becomes equal to or higher than the threshold voltage Vt, the counter is counted up and the time from the timing t2 is measured. Then, after the elapse of the predetermined time T2 (timing at t3), the output terminal CS1 is controlled to the H level. Thus, in the present embodiment, the delay time T2 is set from when the power supply voltage Vcc returns to the threshold voltage Vt or higher until the output terminal CS1 becomes H level. Therefore, even if the sub-microcomputer 4 malfunctions during the period T1, the sub-microcomputer 4 reliably returns to normal operation while the time T2 elapses. Thereafter, when the output terminal CS <b> 2 becomes H level in response to a data write request, writing to the EEPROM 7 is permitted and data transmitted from the sub-microcomputer 4 to the EEPROM 7 is written into the EEPROM 7.
[0038]
According to the embodiment described in detail above, the following effects can be obtained.
(1) When the power supply voltage Vcc is lowered to the threshold voltage Vt, the voltage drop signal S1 is output from the power supply IC2, and the input terminal WI becomes L level. At this time, the main microcomputer 3 determines that the power supply voltage Vcc has dropped, the output terminal CS1 is controlled to L level, and the writing of the EEPROM 7 by the sub-microcomputer 4 is prohibited. In this way, even if the power supply voltage Vcc is equal to or lower than the minimum operating voltage Vs of the sub-microcomputer 4, writing to the EEPROM 7 is prohibited by the main microcomputer 3 operating normally at this power-supply voltage Vcc, and the sub-microcomputer 4 is erroneously operated. The erroneous writing of the EEPROM 7 due to the operation can be prevented.
[0039]
(2) The voltage drop signal S1 from the power supply IC 2 is conventionally used to prohibit (limit) the writing of the SRAMs 3d and 4d as described above. That is, in the present embodiment, erroneous writing of the EEPROM 7 can be prevented without providing a new circuit for detecting a decrease in the power supply voltage Vcc, which is advantageous in terms of cost.
[0040]
(3) Even if the power supply voltage Vcc drops to the minimum operating voltage Vs of the sub-microcomputer 4 (period T1 in FIG. 2), even if the sub-microcomputer 4 malfunctions, the power supply voltage Vcc rises to the threshold voltage Vt or more and a predetermined time The sub-microcomputer 4 returns to normal operation until T2 elapses. In this state, the output terminal CS1 of the main microcomputer 3 is controlled to H level, and writing to the EEPROM 7 is permitted. In this way, erroneous writing of the EEPROM 7 by the sub-microcomputer 4 can be reliably prevented.
[0041]
(4) The main microcomputer 3 has an output terminal CS1 that outputs a control signal SC1 for prohibiting or permitting writing to the EEPROM 7, and the sub-microcomputer 4 is an output that outputs a control signal SC2 for writing data to the EEPROM 7. The terminal CS2 is provided, and the output terminals CS1 and CS2 are connected to the chip select terminal CS of the EEPROM 7 via the AND circuit 8. In this way, when the L level control signal SC1 for prohibiting writing is output from the output terminal CS1 of the main microcomputer 3, the AND circuit 8 always causes the chip select terminal CS of the EEPROM 7 to be at the L level (non-selected state). ). In this case, even if the H-level control signal SC2 is output from the output terminal CS2 of the sub-microcomputer 4 due to a malfunction at the time of a voltage drop, the control signal SC2 becomes invalid and the writing of the EEPROM 7 can be prohibited.
[0042]
In addition to the above, the present invention can be embodied in the following forms.
In the above embodiment, the power supply IC2 is used as the voltage monitoring means, and the writing of the EEPROM 7 is prohibited by using the voltage drop signal S1 output from the power supply IC2 in order to prohibit the writing of the SRAMs 3d and 4d. However, the present invention is not limited to this. For example, voltage monitoring means for detecting a decrease in the power supply voltage Vcc may be newly provided separately from the power supply IC2. In this case, it is desirable that the threshold voltage Vt for detecting the decrease in the power supply voltage Vcc be close to the minimum operating voltage Vs of the sub-microcomputer 4. That is, as shown in FIG. 2, when the threshold voltage Vt and the sub-microcomputer minimum operating voltage Vs are different from each other, the power supply voltage Vcc drops below the threshold voltage Vt and the sub-microcomputer 4 has the minimum operating voltage. It can be considered that the voltage rises before reaching Vs. In this case, the writing of the EEPROM 7 is prohibited in spite of the voltage drop in a range in which the sub-microcomputer 4 does not malfunction. Can be avoided.
[0043]
In the above embodiment, the AND circuit 8 is used as the gate circuit, but the present invention is not limited to this. For example, when an EEPROM that is not in the selected state when the chip select terminal is at the H level as in the EEPROM 7 but is in the selected state when at the L level is used, an OR circuit is used instead of the AND circuit 8. . When writing is prohibited when the power supply voltage Vcc is lowered, an H level control signal is output from the output terminal of the main microcomputer 3 to the OR circuit. In this way, the output of the OR circuit is always at the H level, and the chip select terminal of the EEPROM is not selected. Therefore, erroneous writing to the EEPROM can be prevented when the power supply voltage Vcc is lowered.
[0044]
In the above embodiment, an EEPROM is used as the nonvolatile memory, but a flash memory can also be used.
In the above embodiment, the present invention is embodied in the ECU 1 for performing engine control and transmission control. However, the present invention is not limited to this, and vehicle control (for example, ABS control), body control (for example, air conditioner control), and the like are performed. You may embody in ECU. In short, it is only necessary to implement various controls using two microcomputers having different minimum operating voltages and to embody the ECU in which the nonvolatile memory is written by a microcomputer having a high minimum operating voltage.
[Brief description of the drawings]
FIG. 1 is a configuration diagram showing an outline of an ECU in an embodiment of the invention.
FIG. 2 is a diagram for explaining an operation when a power supply voltage decreases.
FIG. 3 is a flowchart showing a process for writing diagnosis information.
FIG. 4 is a flowchart showing a solenoid current correction value writing process.
FIG. 5 is a flowchart showing EEPROM write processing.
FIG. 6 is a diagram for explaining data stored in an EEPROM;
FIG. 7 is a flowchart showing a write prohibition process by the main microcomputer.
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 1 ... ECU as non-volatile memory writing device, 2 ... Power supply IC as reset means and voltage monitoring means, 3 ... Main microcomputer as 1st microcomputer, 3d ... SRAM as backup memory, 4 ... 2nd micro Sub-microcomputer as computer, 4d ... SRAM as backup memory, 7 ... EEPROM as nonvolatile memory, 8 ... AND circuit as gate circuit, 11 ... Ignition switch as power switch, CS ... Chip select terminal, CS1, CS2 ... Output terminal, S1 ... Voltage drop signal, S2 ... Reset signal, SC1, SC2 ... Control signal, Vcc ... Power supply voltage, Vm ... Main microcomputer minimum operating voltage, Vs ... Sub microcomputer minimum operating voltage, Vr ... Reset voltage, Vt ... Threshold voltage.

Claims (5)

最低作動電圧がそれぞれ異なる第1のマイクロコンピュータ及び第2のマイクロコンピュータと、前記第2のマイクロコンピュータによりデータが書き込まれる不揮発性メモリと、電源電圧が所定のリセット電圧以下となったとき、第1のマイクロコンピュータに対してリセット信号を出力するリセット手段とを備え、前記第1のマイクロコンピュータの最低作動電圧が前記リセット電圧よりも低く、前記第2のマイクロコンピュータの最低作動電圧が前記リセット電圧よりも高い不揮発性メモリ書き込み装置において、
第2のマイクロコンピュータの最低作動電圧以下となる電圧域を含む領域まで前記電源電圧が低下すると、前記第1のマイクロコンピュータは、第2のマイクロコンピュータによる不揮発性メモリの書き込みを禁止することを特徴とする不揮発性メモリ書き込み装置。
A first microcomputer and a second microcomputer having different minimum operating voltages; a nonvolatile memory in which data is written by the second microcomputer; and a power supply voltage that is lower than or equal to a predetermined reset voltage. Reset means for outputting a reset signal to the microcomputer, wherein the minimum operating voltage of the first microcomputer is lower than the reset voltage, and the minimum operating voltage of the second microcomputer is lower than the reset voltage. In the high nonvolatile memory writing device,
When the power supply voltage decreases to a region including a voltage range that is equal to or lower than the minimum operating voltage of the second microcomputer, the first microcomputer prohibits writing of the nonvolatile memory by the second microcomputer. A nonvolatile memory writing device.
電源スイッチのオフ時にも記憶データを保持し、前記電源電圧の低下時にデータの書き込みが制限されるバックアップメモリと、
前記電源電圧を監視し、該電源電圧が、前記バックアップメモリの書き込みを制限するためのしきい値電圧以下となるとき、電圧低下信号を出力する電圧監視手段を備えた請求項1に記載の不揮発性メモリ書き込み装置において、
前記第1のマイクロコンピュータは、前記電圧監視手段からの電圧低下信号に基づいて、不揮発性メモリの書き込みを禁止することを特徴とする不揮発性メモリ書き込み装置。
A backup memory that retains stored data even when the power switch is turned off, and data writing is restricted when the power supply voltage drops,
2. The nonvolatile memory according to claim 1, further comprising a voltage monitoring unit that monitors the power supply voltage and outputs a voltage drop signal when the power supply voltage is equal to or lower than a threshold voltage for restricting writing to the backup memory. In the memory writing device,
The non-volatile memory writing device, wherein the first microcomputer prohibits non-volatile memory writing based on a voltage drop signal from the voltage monitoring means.
請求項1又は2に記載の不揮発性メモリ書き込み装置において、
前記第1のマイクロコンピュータは、前記電源電圧の低下に伴い不揮発性メモリの書き込みを禁止した際には、電源電圧が上昇し不揮発性メモリの書き込みが禁止される電圧域以上となった後所定時間の経過後に、不揮発性メモリの書き込みを許可することを特徴とする不揮発性メモリ書き込み装置。
The nonvolatile memory writing device according to claim 1 or 2,
When the first microcomputer prohibits the writing of the nonvolatile memory with the decrease of the power supply voltage, a predetermined time after the power supply voltage rises and exceeds the voltage range in which the writing of the nonvolatile memory is prohibited. A nonvolatile memory writing device, wherein writing to the nonvolatile memory is permitted after the elapse of time.
請求項1〜3のいずれか一項に記載の不揮発性メモリ書き込み装置において、
前記第1のマイクロコンピュータは、前記不揮発性メモリの書き込みを禁止または許可するための制御信号を出力する出力端子を有し、
前記第2のマイクロコンピュータは、前記不揮発性メモリにデータを書き込むための制御信号を出力する出力端子を有し、
前記各出力端子をゲート回路を介して不揮発性メモリのチップセレクト端子に接続し、
前記ゲート回路は、第1のマイクロコンピュータの出力端子から書き込みを禁止するための制御信号が出力されたとき、不揮発性メモリのチップセレクト端子を非選択状態とすることを特徴とする不揮発性メモリ書き込み装置。
The nonvolatile memory writing device according to any one of claims 1 to 3,
The first microcomputer has an output terminal that outputs a control signal for prohibiting or permitting writing to the nonvolatile memory;
The second microcomputer has an output terminal for outputting a control signal for writing data to the nonvolatile memory,
Each output terminal is connected to a chip select terminal of a nonvolatile memory through a gate circuit,
Nonvolatile memory write, wherein the gate circuit deselects the chip select terminal of the nonvolatile memory when a control signal for prohibiting writing is output from the output terminal of the first microcomputer. apparatus.
請求項1〜4のいずれか一項に記載の不揮発性メモリ書き込み装置において、
前記第1のマイクロコンピュータはエンジン制御用コンピュータであり、前記第2のマイクロコンピュータは、トランスミッション制御用コンピュータであることを特徴とする不揮発性メモリ書き込み装置。
In the nonvolatile memory writing device according to any one of claims 1 to 4,
The nonvolatile memory writing device according to claim 1, wherein the first microcomputer is an engine control computer, and the second microcomputer is a transmission control computer.
JP2000205153A 2000-07-06 2000-07-06 Nonvolatile memory writing device Expired - Fee Related JP4281222B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000205153A JP4281222B2 (en) 2000-07-06 2000-07-06 Nonvolatile memory writing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000205153A JP4281222B2 (en) 2000-07-06 2000-07-06 Nonvolatile memory writing device

Publications (2)

Publication Number Publication Date
JP2002024101A JP2002024101A (en) 2002-01-25
JP4281222B2 true JP4281222B2 (en) 2009-06-17

Family

ID=18702288

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000205153A Expired - Fee Related JP4281222B2 (en) 2000-07-06 2000-07-06 Nonvolatile memory writing device

Country Status (1)

Country Link
JP (1) JP4281222B2 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4014212B2 (en) 2003-11-19 2007-11-28 富士通テン株式会社 Electronic control unit
DE102006056593A1 (en) * 2006-11-29 2008-06-05 Endress + Hauser Gmbh + Co. Kg Method for operating a field device of process and automation technology and corresponding field device
JP4345845B2 (en) 2007-05-16 2009-10-14 株式会社デンソー Power supply
JP4978476B2 (en) * 2008-01-09 2012-07-18 株式会社デンソー Power supply status detection device
JP5051214B2 (en) 2009-12-25 2012-10-17 株式会社デンソー In-vehicle failure detection device
JP5974907B2 (en) 2013-01-17 2016-08-23 株式会社デンソー Vehicle equipment
JP6227945B2 (en) * 2013-09-17 2017-11-08 日立オートモティブシステムズ株式会社 Electronic control unit for automobile
JP2018031573A (en) * 2016-08-26 2018-03-01 株式会社ノーリツ Control device

Also Published As

Publication number Publication date
JP2002024101A (en) 2002-01-25

Similar Documents

Publication Publication Date Title
JP4692318B2 (en) Electronic control unit
JP3932654B2 (en) Vehicle control device and vehicle control system
JPH03500944A (en) Data processing systems that include electrically erasable and reprogrammable non-volatile memory
US20090271063A1 (en) Electronic control unit and vehicle control system
JP4281222B2 (en) Nonvolatile memory writing device
US6636989B1 (en) Electronic control apparatus and method for on-board rewriting of non-volatile memories
US6182004B1 (en) Apparatus and method for controlling electric power supply in nonvolatile memory rewriting operation
JP3137012B2 (en) Electronic control unit
JP3097580B2 (en) Electronic control unit
US6735513B2 (en) Method and device for running up a control unit for a motor vehicle
JP3491358B2 (en) Power cut-off detection device
US6168321B1 (en) Electronic control unit having user breakable function
US6853295B2 (en) Vehicular control unit with self shut-off function and abnormality detection function
JPH0822422A (en) Memory device
JP3331880B2 (en) Control device using microcomputer
JP3937598B2 (en) Electronic control unit
JPH1049205A (en) Operating method for control unit having control function equipped with programmable storage device
JP2003196256A (en) Electronic control unit
JP3662409B2 (en) Power supply monitoring circuit and power supply monitoring method thereof
US6269032B1 (en) Electronic control unit having voltage responsive data writing
JP6162011B2 (en) Electronic control unit for automobile
JPH09171459A (en) Electronic control equipment
JPH0236003B2 (en)
JP3924945B2 (en) Electronic control unit
JP2005226494A (en) Electronic control unit

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060913

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20090217

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: 20090224

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20090309

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20120327

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20120327

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20130327

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20140327

Year of fee payment: 5

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