JP3433824B2 - Failure detection device for pulse input / output circuit - Google Patents

Failure detection device for pulse input / output circuit

Info

Publication number
JP3433824B2
JP3433824B2 JP20904693A JP20904693A JP3433824B2 JP 3433824 B2 JP3433824 B2 JP 3433824B2 JP 20904693 A JP20904693 A JP 20904693A JP 20904693 A JP20904693 A JP 20904693A JP 3433824 B2 JP3433824 B2 JP 3433824B2
Authority
JP
Japan
Prior art keywords
register
port
value
predetermined
circuit
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
JP20904693A
Other languages
Japanese (ja)
Other versions
JPH0744472A (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.)
Mazda Motor Corp
Original Assignee
Mazda Motor 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 Mazda Motor Corp filed Critical Mazda Motor Corp
Priority to JP20904693A priority Critical patent/JP3433824B2/en
Publication of JPH0744472A publication Critical patent/JPH0744472A/en
Application granted granted Critical
Publication of JP3433824B2 publication Critical patent/JP3433824B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】 【0001】 【産業上の利用分野】本発明はパルス入出力回路の故障
検出装置、特に、車両用の種々のシステムを制御するた
めに用いるパルス入出力回路の故障を検出する装置に関
する。 【0002】 【従来の技術】自動車に搭載される種々の機器を電子制
御するための回路として、パルス入出力回路が一般に利
用されている。たとえば、特公昭62−43070号公
報には、エンジンにおける燃料噴射量および点火時期を
パルス制御するためのパルス入出力回路が開示されてい
る。このようなパルス入出力回路は、論理パルス信号を
入出力するための複数のポートと、所定のデータを保持
する複数のレジスタを備えており、ポートおよびレジス
タに対して、データの読出し/書込み/論理演算などの
処理が行われる。いわゆる順次処理実行型のパルス入出
力回路では、実行すべき処理内容を示すプログラムが記
憶装置内に順番に格納されており、このプログラムを順
番に読出しながら順次実行してゆくことになる。たとえ
ば、あるポートには、自動車の特定の走行状態を検出す
るセンサからの論理パルス信号が入力され、別なポート
からは、自動車の特定のアクチュエータに与える指示が
論理パルス信号として出力される。パルス入出力回路
は、読出したプログラムに基づいて、あるポートに入力
された論理値をあるレジスタに転送したり、あるレジス
タの保持値をあるポートから出力したり、あるレジスタ
の内容に対して所定の演算を行ったり、といった種々の
処理を実行し、自動車に搭載されている種々の機器に対
する制御を行う。 【0003】 【発明が解決しようとする課題】このようなパルス入出
力回路を用いる場合、何らかの故障検出手段を設けてお
く必要がある。特に、車載用のパルス入出力回路は、自
動車に搭載される種々の機器を電子制御する重要な役割
を担うため、安全な走行を確保する上で、故障検出手段
は不可欠なものである。ところが、このパルス入出力回
路の機能は、上述したように、ポートに対するデータの
読出し/書込み、レジスタに対するデータの読出し/書
込み、読出したデータに対する論理演算(主として1を
加える演算)、と多岐にわたり、これら各機能全般につ
いて正常に動作しているか否かを診断する必要がある。
ところが、このパルス入出力回路は、CPUを内蔵して
いるわけではないため、上述のような診断を行うため
に、従来は、診断用のハードウエアを追加することによ
り故障診断機能を付加していた。ところが、このような
診断用ハードウエアを追加すると、回路規模が大きくな
り、回路の小型化、低コスト化を阻む原因となり好まし
くない。 【0004】そこで本発明は、ハードウエア構成をでき
るだけ単純化することのできるパルス入出力回路の故障
検出装置を提供することを目的とする。 【0005】 【課題を解決するための手段】本発明は、論理パルス信
号を入出力するための複数のポートを有する入出力ポー
ト群と、所定のデータを保持する複数のレジスタを有す
るレジスタ群と、各ポートおよび各レジスタ対して、デ
ータの読出し・データの書込み・データに対する論理演
算、の各処理を実行するポート・レジスタ制御装置と、
このポート・レジスタ制御装置に対して実行させるべき
処理内容を、所定の順序で格納した記憶手段と、この記
憶手段内に格納されている処理内容を順番に取り出し、
これをポート・レジスタ制御装置に与えて実行させる命
令解読回路と、を備えたパルス入出力回路、の故障を検
出する装置において、所定のクロック信号を計数しなが
らその計数値を第1のレジスタに格納してゆき、第1の
レジスタの保持値が第2のレジスタの保持値に一致した
ときに、所定のポートの論理状態を反転させるとともに
第1のレジスタの保持値を初期値に戻す第1の処理と、
所定のクロック信号を計数しながらその計数値を第3の
レジスタに格納してゆき、上述した所定のポートの論理
状態が反転したときに、第2のレジスタの保持値を第3
のレジスタの保持値に書き替えるとともに第3のレジス
タの保持値を初期値に戻す第2の処理と、を記憶手段に
格納し、第1の処理および第2の処理をポート・レジス
タ制御装置によって実行させたときに、上述した所定の
ポートの論理状態の反転周期が予め設定された所定周期
に一致するか否かを判定することにより故障検出を行う
ようにしたものである。 【0006】 【作 用】本発明に係るパルス入出力回路の故障検出装
置では、故障検出のために2つの処理が実行される。第
1の処理は、クロック信号の計数値を第1のレジスタに
格納してゆき、この第1のレジスタの保持値が第2のレ
ジスタの保持値に一致したときに、所定のポートの論理
状態を反転させ、第1のレジスタの保持値を初期値に戻
す処理である。また、第2の処理は、クロック信号の計
数値を第3のレジスタに格納してゆき、上述した所定の
ポートの論理状態が反転したときに、第2のレジスタの
保持値を第3のレジスタの保持値に書き替え、第3のレ
ジスタの保持値を初期値に戻す処理である。この2つの
処理は、互いに依存し合っている。別言すれば、一方の
処理結果が他方の処理に影響を与える構成となってい
る。具体的には、第1の処理において一致検出の対象と
して用いられる第2のレジスタの保持値は、第2の処理
の結果として得られる値である。同様に、第2の処理に
おいて利用される所定のポートの反転状態は、第1の処
理の結果として作られるものである。このように、2つ
の処理が相互に依存し合っているため、両方の処理がと
もに正常に実行されていれば、所定のポートには、常に
所定の周期で所定の論理状態が得られることになる。逆
に言えば、このポートに所定の周期で所定の論理状態が
得られなければ、いずれかの処理に異常が発生したと考
えることができる。上述した2つの処理には、ポートに
対するデータの読出し/書込み、レジスタに対するデー
タの読出し/書込み、読出したデータに対する論理演算
(1を加えて計数を実行する演算)、のすべての処理が
含まれており、これらすべての処理についての診断が可
能になる。しかも、上述の2つの処理を実行するための
プログラムを記憶装置内に用意するだけでよいので、診
断をソフトウエア的に実行することが可能になり、必要
なハードウエア構成は必要最小限ですむ。 【0007】 【実施例】以下、本発明を図示する実施例に基づいて説
明する。図1は、本発明に係る故障検出装置の適用対象
となるパルス入出力回路を含む自動車用システム制御装
置の基本構成を示すブロック図である。はじめに、この
自動車用システム制御装置全体の構成および動作につい
ての説明を行う。パルス入出力回路100は、この制御
装置における従たる制御を行うユニットである。この制
御装置における主たる制御は、CPUを内蔵したホスト
ユニット200によって実行されるが、このホストユニ
ット200の動作自身については本発明の本質ではない
ので詳しい説明は省略する。パルス入出力回路100は
ホストユニット200内のCPUとバス150によって
接続されている。パルス入出力回路100内には、CP
Uは内蔵されていないが、次のような回路が組み込まれ
ている。 【0008】メモリ10は、この実施例の装置ではRA
Mによって構成されており、所定の順番でプログラムが
書込まれる。ホストユニット200は、バス150を介
して、このメモリ10内に任意のプログラムを書込むこ
とができる。起動レジスタ11は、わずか1ビットの情
報を格納するためのレジスタであり、ホストユニット2
00は、バス150を介して、この起動レジスタ11内
に、「0」または「1」のいずれかのデータを書込むこ
とができる。このパルス入出力回路100は、起動レジ
スタ11内にデータ「0」が書込まれているときは機能
を停止しているが、データ「1」が書込まれたときはメ
モリ10内のプログラムを順次実行する。AND回路1
2は、起動レジスタ11内にデータ「1」が書込まれて
いるときにだけ、外部から与えられるクロックをプログ
ラムカウンタ13に与える機能を果たす。プログラムカ
ウンタ13は、このクロックに基づいて、カウント値P
Cをカウントアップしてゆく。メモリ10内に格納され
ているプログラムは、このカウント値PCによるアドレ
ス指定を受け、プログラム1,2,3,…と順番に命令
解読回路14に読み出されてゆく。プログラムカウンタ
13は、カウント値PCがメモリ10内の最後のアドレ
ス値に到達すると、カウント値を初期値に戻しカウント
を継続してゆく。こうして、メモリ10内の各プログラ
ムは循環して読み出される。 【0009】命令解読回路14は、メモリ10から読み
出されたプログラムをデコードし、ポート・レジスタ制
御装置15に対して、デコードした内容を伝達する。ポ
ート・レジスタ制御装置15は、このデコードされたプ
ログラムに基づいて、所定の処理を実行する。すなわ
ち、レジスタ群16内の特定のレジスタに対して、デー
タの読出し/書込み処理を実行したり、入出力ポート群
17内の特定のポートに対して、データの読出し/書込
み処理を実行したり、読出したデータに対する所定の論
理演算(この実施例では、1を加える演算)を実行した
りする。どのような処理を実行するかは、すべて与えら
れたプログラム次第である。 【0010】レジスタ群16は、この実施例では、8つ
のレジスタreg1〜reg8によって構成されてお
り、所定のデータを格納することができる。入出力ポー
ト群17は、この実施例では、外部ポートOP1,OP
2,…と、内部ポートIP1,IP2,…とによって構
成されている。外部ポートOPnは、外部の機器に接続
された端子であり、外部の機器(各種センサ)からの論
理パルス信号を入力したり、外部の機器(各種アクチュ
エータ)に対して論理パルス信号を出力したりする機能
を有する。一方、内部ポートIPnは、所定の電位状態
を保持することができる内部端子である。 【0011】このような構成をもったパルス入出力回路
100は、メモリ10内に書込まれたプログラム群に基
づいて、この自動車についての従たるシステム制御を行
う。すなわち、特定の外部ポートに入力された論理状態
を、特定のレジスタや特定の内部ポートに格納したり、
特定のレジスタの保持値に1を加算し、その結果を特定
のレジスタや特定のポートに出力したりする処理を実行
する。こうして、各種センサから入力した検出値に応じ
て、各種アクチュエータに所定の制御値を出力し、シス
テムの制御を行う。 【0012】本発明は、このようなパルス入出力回路1
00についての故障検出装置を提供するものである。従
来は、このような故障検出装置を、パルス入出力回路1
00に専用のハードウエアを追加することにより実現し
ていたが、本発明では、この故障検出をソフトウエアを
利用して実行するようにし、専用のハードウエアの追加
を必要最小限に抑えている。 【0013】本発明による故障検出を行うために、2つ
の故障検出用プログラムが用意される。ここでは、この
2つのプログラムをfunction1,function2と呼ぶこと
にする。この2つのプログラムは、いずれも同一のクロ
ック信号 clock1を計数する処理を含んでいる。このク
ロック信号 clock1としては、たとえば、AND回路1
2の一方の入力信号となっているクロックを分周した信
号を利用すればよい。 【0014】function1は、図2の流れ図に示すような
処理を実行するためのプログラムである。すなわち、ス
テップS11において、 clock1が反転したか否かを判
断し、 clock1の論理値が前回と同じだった場合(すな
わち、まだ反転していない場合)は、何も実行せずに終
了する。 clock1が反転した場合は、ステップS12に
おいて、レジスタ群16内の第1のレジスタreg1の
保持値を1だけ増加させる(レジスタの保持値を読み出
してから、1を加算する演算を行い、その結果を再びレ
ジスタに書込む)。そして、ステップS13において、
第1のレジスタreg1の保持値と、第2のレジスタr
eg2の保持値とが等しいか否かを判断する。等しくな
ければ、そこで処理を終了する。等しい場合には、ステ
ップS14において、入出力ポート群17内の第1の内
部ポートIP1の論理状態を反転させ、第1のレジスタ
reg1の保持値を初期値「0」に戻す(0を書込
む)。図3は、以上の処理を示すダイヤグラムである。
第1のレジスタreg1の内容は、 clock1の立上がり
エッジあるいは立ち下がりエッジを検出するごとに、1
ずつ増加してゆく(ステップS12)。したがって、第
1のレジスタreg1の保持値は、0から次第に増加し
てゆく。そして、この値が第2のレジスタreg2の保
持値に到達するごとに(ステップS13)、内部ポート
IP1の論理値は反転させられ、第1のレジスタreg
1は「0」に戻される(ステップS14)。したがっ
て、仮に第2のレジスタreg2の値が図3に示すよう
に一定であったとすると、第1のレジスタreg1は、
0〜reg2の値までを繰り返しカウントアップする動
作を行い、内部ポートIP1の論理状態は、この繰り返
し動作に同期して反転を繰り返すことになる。この反転
周期は、 clock1の周期およびreg2の保持値が一定
であれば、常に一定になる。 【0015】一方、function2は、図4の流れ図に示す
ような処理を実行するためのプログラムである。すなわ
ち、ステップS21において、 clock1が反転したか否
かを判断し、 clock1の論理値が前回と同じだった場合
(すなわち、まだ反転していない場合)は、何も実行せ
ずに終了する。 clock1が反転した場合は、ステップS
22において、レジスタ群16内の第3のレジスタre
g3の保持値を1だけ増加させる(レジスタの保持値を
読み出してから、1を加算する演算を行い、その結果を
再びレジスタに書込む)。そして、ステップS23にお
いて、内部ポートIP1の論理状態が反転したか否かを
判断し、前回と同じ論理状態だった場合(すなわち、ま
だ反転していない場合)は、そこで処理を終了する。反
転していた場合には、ステップS24において、第2の
レジスタreg2の保持値を、第3のレジスタreg3
の保持値に書き替え、第3のレジスタreg3の保持値
を初期値「0」に戻す(0を書込む)。図5は、以上の
処理を示すダイヤグラムである。第3のレジスタreg
3の内容は、 clock1の立上がりエッジあるいは立ち下
がりエッジを検出するごとに、1ずつ増加してゆく(ス
テップS22)。したがって、第3のレジスタreg3
の保持値は、0から次第に増加してゆく。このカウント
アップ動作は、内部ポートIP1の論理値が反転するま
で継続する。内部ポートIP1の論理反転が生じると
(ステップS23)、その時点における第3のレジスタ
reg3の値が第2のレジスタreg2に移された後、
第3のレジスタreg3は「0」に戻される(ステップ
S24)。したがって、仮に内部ポートIP1の反転周
期が図5に示すように一定であったとすると、第3のレ
ジスタreg3は、この反転周期の間だけ clock1のタ
イミングで増加することになり、第2のレジスタreg
2には、この反転周期に応じた値が毎回書込まれること
になる。結局、 clock1の周期および内部ポートIP1
の反転周期が一定であれば、第2のレジスタreg2の
保持値は常に一定になる。 【0016】故障検出を行うには、上述したような、fu
nction1およびfunction2を、ホストユニット200か
らバス150を介してメモリ10内にプログラムとして
書込み、これらを繰り返し実行すればよい。 clock1
は、このパルス入出力回路100に供給されている駆動
用クロックを分周して得たクロック信号であり、故障が
起こらない限り、その周期は常に一定である。ところ
で、function1は、第2のレジスタreg2の値に応じ
た周期で内部ポートIP1を反転させる処理であり、fu
nction2は、内部ポートIP1の反転周期に応じた値を
第2のレジスタreg2に書込む処理である。別言すれ
ば、一方の処理結果が他方の処理に影響を与える構成と
なっている。図6は、このような両処理の関係を示すダ
イヤグラムである。したがって、いずれの処理にも異常
がない限り、第2のレジスタreg2の値は一定とな
り、内部ポートIP1の反転周期も一定となる。そこ
で、この内部ポートIP1が一定周期で反転しているか
否かを判断すれば、故障の有無を認識することができ
る。function1およびfunction2の処理には、ポートに
対するデータの読出し/書込み、レジスタに対するデー
タの読出し/書込み、読出したデータに対する論理演算
(1を加えて計数を実行する演算)、のすべての処理が
含まれており、これらすべての処理のいずれか1つにで
も異常があると、図6に示すダイヤグラムの関係が満足
されなくなり、内部ポートIP1の反転周期に乱れが生
じる。したがって、パルス入出力回路100の処理全般
にわたっての故障診断が可能になる。しかも、上述の診
断処理は、メモリ10内に2つの診断用プログラムfunc
tion1,function2を書込んで実行するだけですむの
で、特別なハードウエアを追加する必要はない。 【0017】ただし、内部ポートIP1が一定周期で反
転しているか否かを判断するためには、何らかのハード
ウエアが必要である。このような判断を行うための回路
の一例を図7に示す。この判断回路は、AND回路2
1、フリップフロップ22、カウンタ回路23、排他的
OR回路24、によって構成されている。AND回路2
1の一方の入力端子は、内部ポートIP1に接続され、
他方の入力端子には、起動レジスタ11のビットが入力
される。すなわち、起動レジスタ11に起動状態を示す
ビット「1」が格納されている場合には、AND回路2
1からは内部ポートIP1の論理状態を示す信号が出力
されることになる。この信号は、フリップフロップ22
のD入力端子に与えられる。一方、カウンタ回路23
(この実施例では、ウォッチドッグタイマを用いてい
る)のクロック入力端子clkには、 clock1とは別な
系統のクロック信号から得た clock2が与えられる。一
般に、車載用のシステム制御装置には、通常の制御ユニ
ットが故障した場合に、これに代わって応急的な制御を
行う待機系ユニットが備えられており、この待機系ユニ
ットは、通常の制御ユニットが用いるクロックとは別系
統のクロックで動作するように設計されている。このよ
うな場合、 clock2としては、この待機系ユニット用の
別系統のクロックを利用するようにするとよい。このよ
うに、 clock1とは別系統の clock2を用いるのは、 c
lock1自体に故障が生じた場合にも、異常の検出が可能
になるようにする配慮からである(同じ clock1を用い
た場合は、この clock1の周期が2倍に伸びてしまった
ような故障が発生した場合に、これを検出することはで
きなくなる)。 【0018】カウンタ回路23からは、MSB(最上位
ビット)およびMSB−1(第2の上位ビット)の出力
信号が取り出され、後者はフリップフロップ22のクロ
ック入力端子clkに与えられ、前者は排他的OR回路
24の一方の入力端子に与えられる。また、排他的OR
回路24の他方の入力端子には、フリップフロップ22
のQ出力信号が与えられる。 【0019】このような判断回路の動作を、図8のタイ
ミングチャートを用いて説明する。いま、カウンタ回路
23の(MSB−1)出力信号およびMSB出力信号
が、図のような周期信号であったとする。前者の反転周
期がL/2であるとすると、後者は1桁上のカウント値
を示すものであるから、その2倍の反転周期Lをもつこ
とになる。一方、内部ポートIP1からの出力信号は、
前述したように、パルス入出力回路100が正常に動作
をしている限り、一定の反転周期をもつ。そこで、MS
B出力信号の反転周期と内部ポートIP1の正常時の反
転周期とが、同じLとなるように予め設定をしておく
(これは、用いるカウンタ回路23の設定を調節しても
よいし、第2のレジスタreg2の定常値を初期設定す
るときに調節してもよい)。とにかく、MSB出力信号
の反転周期も内部ポートIP1の反転周期(正常時)も
同じLになるように設定をしておくのである。ただ、前
述したように、内部ポートIP1の出力信号は clock1
に基づいて得られたものであり、MSB出力信号は別系
統の clock2に基づいて得られたものであるから、両者
の位相は図8に示すように一致はしていない。フリップ
フロップ22は、この位相差を調節する働きをする。す
なわち、D入力端子に与えられた内部ポートIP1から
の出力信号は、Q出力端子から出力した時点で、(MS
B−1)出力信号と同位相の信号Qになっている。パル
ス入出力回路100が正常動作していれば、内部ポート
IP1は反転周期Lで論理反転を繰り返すので、この信
号QはMSB出力信号と完全に一致するはずである。排
他的OR回路24は、この一致を検出する回路である。
すなわち、両者が一致していれば論理「0」を出力し
(パルス入出力回路100は正常)、不一致の場合には
論理「1」を出力する(パルス入出力回路100は故
障)。こうして、排他的OR回路24の出力信号を故障
検出信号として用いることができる。図7に示すハード
ウエアは、比較的単純な回路であり、このような回路を
パルス入出力回路100内に追加しても、それほど大き
な負担にはならない。 【0020】以上、本発明を図示する実施例に基づいて
説明したが、本発明はこの実施例のみに限定されるもの
ではなく、この他にも種々の態様で実施可能である。た
とえば、図7に示す回路においては、別系統の clock2
を用いているが、この clock2の代わりに同系統の clo
ck1を用いることも可能である。ただ、上述したよう
に、クロック自身の異常を検出するためには、別系統の
clock2を用いるのが好ましい。また、図7に示す回路
は、一例として示したものであり、要するに、内部ポー
トIP1の論理反転周期が所定周期Lになっていること
を確認することができる回路であれば、この他どのよう
な回路を用いてもかまわない。 【0021】 【発明の効果】以上のとおり本発明によれば、パルス入
出力回路の故障を検出するために、ポートおよびレジス
タをアクセスする2つの処理プログラムを用意し、両プ
ログラムが互いに相手のプログラムの実行結果を利用す
る形態とし、常に一定の実行結果が得られることを確認
することにより故障検出を行うようにしたため、ハード
ウエア構成をできるだけ単純化することができるように
なる。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a fault detecting apparatus for a pulse input / output circuit, and more particularly to a fault detecting apparatus for a pulse input / output circuit used for controlling various systems for vehicles. It relates to a device for detecting. [0002] A pulse input / output circuit is generally used as a circuit for electronically controlling various devices mounted on an automobile. For example, Japanese Patent Publication No. Sho 62-43070 discloses a pulse input / output circuit for performing pulse control of a fuel injection amount and an ignition timing in an engine. Such a pulse input / output circuit includes a plurality of ports for inputting / outputting a logical pulse signal, and a plurality of registers for holding predetermined data, and reads / writes / writes data to / from the ports and the registers. Processing such as a logical operation is performed. In a pulse input / output circuit of a so-called sequential processing execution type, programs indicating processing contents to be executed are sequentially stored in a storage device, and the programs are sequentially executed while being read out in order. For example, a certain port receives a logical pulse signal from a sensor that detects a specific running state of the vehicle, and another port outputs an instruction given to a specific actuator of the vehicle as a logical pulse signal. The pulse input / output circuit transfers a logical value input to a certain port to a certain register, outputs a held value of a certain register from a certain port, or outputs a predetermined value to the contents of a certain register based on a read program. And performs various processes, such as performing calculations, to control various devices mounted on the vehicle. When such a pulse input / output circuit is used, it is necessary to provide some kind of failure detection means. In particular, since the on-vehicle pulse input / output circuit plays an important role of electronically controlling various devices mounted on the automobile, the failure detection means is indispensable for ensuring safe traveling. However, as described above, the functions of the pulse input / output circuit are as diverse as reading / writing data to / from a port, reading / writing data to / from a register, and performing a logical operation (mainly adding 1) on the read data. It is necessary to diagnose whether or not each of these functions is operating normally.
However, since this pulse input / output circuit does not have a built-in CPU, a failure diagnosis function is conventionally added by adding diagnosis hardware to perform the above-described diagnosis. Was. However, when such diagnostic hardware is added, the circuit scale becomes large, which is a factor that hinders downsizing and cost reduction of the circuit. SUMMARY OF THE INVENTION It is an object of the present invention to provide a pulse input / output circuit failure detecting device which can make the hardware configuration as simple as possible. According to the present invention, there is provided an input / output port group having a plurality of ports for inputting / outputting a logical pulse signal, and a register group having a plurality of registers for holding predetermined data. A port / register control device that executes each process of reading data, writing data, and performing logical operation on data for each port and each register;
A storage unit storing the processing contents to be executed by the port / register control device in a predetermined order, and the processing contents stored in the storage unit are sequentially taken out.
A pulse decoding circuit provided with a command decoding circuit for giving this to a port / register control device and executing the command decoding circuit. When the stored value of the first register matches the stored value of the second register, the logic state of a predetermined port is inverted, and the stored value of the first register is returned to the initial value. Processing and
While counting the predetermined clock signal, the count value is stored in the third register, and when the logic state of the predetermined port is inverted, the value held in the second register is changed to the third register.
And the second process of rewriting the held value of the third register to the initial value and storing the first process and the second process by the port / register control device. Upon execution, failure detection is performed by determining whether or not the inversion cycle of the above-described predetermined port logical state matches a predetermined cycle that is set in advance. [0008] In the fault detecting apparatus for a pulse input / output circuit according to the present invention, two processes are executed for fault detection. In the first process, the count value of the clock signal is stored in a first register, and when the value held in the first register matches the value held in the second register, the logic state of a predetermined port is set. Is performed, and the value held in the first register is returned to the initial value. In the second process, the count value of the clock signal is stored in the third register, and when the logic state of the predetermined port is inverted, the value held in the second register is changed to the third register. This is a process of rewriting the stored value of the third register to the initial value. These two processes depend on each other. In other words, the configuration is such that one processing result affects the other processing. Specifically, the value held in the second register used as the target of match detection in the first processing is a value obtained as a result of the second processing. Similarly, the inverted state of the predetermined port used in the second processing is created as a result of the first processing. As described above, since the two processes depend on each other, if both processes are executed normally, a predetermined logic state is always obtained at a predetermined cycle at a predetermined port. Become. Conversely, if a predetermined logical state cannot be obtained in this port at a predetermined cycle, it can be considered that an abnormality has occurred in any of the processes. The two processes described above include all processes of reading / writing data to / from a port, reading / writing data to / from a register, and performing a logical operation (an operation of adding 1 to perform counting) on the read data. Therefore, diagnosis of all these processes becomes possible. Moreover, since it is only necessary to prepare a program for executing the above two processes in the storage device, the diagnosis can be executed by software, and the necessary hardware configuration can be minimized. . BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a block diagram showing an embodiment of the present invention. FIG. 1 is a block diagram showing a basic configuration of an automobile system control device including a pulse input / output circuit to which a failure detection device according to the present invention is applied. First, the configuration and operation of the entire vehicle system control device will be described. The pulse input / output circuit 100 is a unit that performs subordinate control in the control device. The main control in this control device is executed by a host unit 200 having a built-in CPU. However, the operation of the host unit 200 itself is not the essence of the present invention, and a detailed description thereof will be omitted. The pulse input / output circuit 100 is connected to a CPU in the host unit 200 by a bus 150. In the pulse input / output circuit 100, CP
Although U is not built-in, the following circuit is built-in. [0008] In the device of this embodiment, the memory 10
M, and the programs are written in a predetermined order. The host unit 200 can write an arbitrary program into the memory 10 via the bus 150. The activation register 11 is a register for storing information of only one bit, and the host unit 2
00 can write either “0” or “1” data into the activation register 11 via the bus 150. The function of the pulse input / output circuit 100 is stopped when data "0" is written in the activation register 11, but the program in the memory 10 is stopped when data "1" is written. Execute sequentially. AND circuit 1
2 functions to supply an externally applied clock to the program counter 13 only when data "1" is written in the activation register 11. The program counter 13 counts the count value P based on this clock.
Count up C. The program stored in the memory 10 receives an address specified by the count value PC and is read out to the instruction decoding circuit 14 in the order of the programs 1, 2, 3,.... When the count value PC reaches the last address value in the memory 10, the program counter 13 returns the count value to the initial value and continues counting. Thus, each program in the memory 10 is read cyclically. The instruction decoding circuit 14 decodes the program read from the memory 10 and transmits the decoded contents to the port / register control device 15. The port / register control device 15 executes a predetermined process based on the decoded program. That is, data read / write processing is executed for a specific register in the register group 16, data read / write processing is executed for a specific port in the input / output port group 17, A predetermined logical operation (an operation of adding 1 in this embodiment) is performed on the read data. The kind of processing to be performed depends entirely on the given program. In this embodiment, the register group 16 is composed of eight registers reg1 to reg8, and can store predetermined data. In this embodiment, the input / output port group 17 includes external ports OP1 and OP
, And internal ports IP1, IP2,. The external port OPn is a terminal connected to an external device, and inputs a logical pulse signal from an external device (various sensors) or outputs a logical pulse signal to an external device (various actuators). It has a function to do. On the other hand, the internal port IPn is an internal terminal that can maintain a predetermined potential state. The pulse input / output circuit 100 having such a configuration performs a subordinate system control on the vehicle based on a group of programs written in the memory 10. That is, the logic state input to a specific external port is stored in a specific register or a specific internal port,
A process of adding 1 to a value held in a specific register and outputting the result to a specific register or a specific port is executed. In this way, a predetermined control value is output to various actuators according to the detection values input from various sensors, and the system is controlled. The present invention relates to such a pulse input / output circuit 1
00 is provided. Conventionally, such a failure detection device is connected to a pulse input / output circuit 1
The present invention is realized by adding dedicated hardware to 00, but in the present invention, this failure detection is executed using software, and the addition of dedicated hardware is minimized. . In order to perform the failure detection according to the present invention, two failure detection programs are prepared. Here, these two programs are called function1 and function2. These two programs each include a process of counting the same clock signal clock1. As the clock signal clock1, for example, an AND circuit 1
A signal obtained by dividing the frequency of one of the two input signals may be used. The function 1 is a program for executing a process as shown in the flowchart of FIG. That is, in step S11, it is determined whether or not clock1 is inverted. If the logical value of clock1 is the same as the previous time (that is, if it has not been inverted yet), the process ends without executing anything. If clock1 is inverted, in step S12, the value held in the first register reg1 in the register group 16 is increased by 1 (the value held in the register is read out, and an operation of adding 1 is performed. Write to the register again). Then, in step S13,
The value held in the first register reg1 and the second register r
It is determined whether or not the stored value of eg2 is equal. If they are not equal, the process ends there. If they are equal, in step S14, the logic state of the first internal port IP1 in the input / output port group 17 is inverted, and the value held in the first register reg1 is returned to the initial value “0” (0 is written). ). FIG. 3 is a diagram showing the above processing.
Each time the rising edge or falling edge of clock1 is detected, the content of the first register reg1 becomes 1
Each time it increases (step S12). Therefore, the value held in the first register reg1 gradually increases from 0. Then, every time this value reaches the value held in the second register reg2 (step S13), the logical value of the internal port IP1 is inverted, and the first register reg2 is inverted.
1 is returned to "0" (step S14). Therefore, if the value of the second register reg2 is constant as shown in FIG. 3, the first register reg1 becomes
The operation of repeatedly counting up to the value of 0 to reg2 is performed, and the logic state of the internal port IP1 repeats inversion in synchronization with this repetition operation. This inversion cycle is always constant if the cycle of clock1 and the held value of reg2 are constant. On the other hand, function2 is a program for executing the processing as shown in the flowchart of FIG. That is, in step S21, it is determined whether or not clock1 is inverted. If the logical value of clock1 is the same as the previous time (that is, if it has not been inverted yet), the process ends without executing anything. If clock1 is inverted, step S
22, the third register re in the register group 16
The held value of g3 is increased by 1 (the held value of the register is read out, an operation of adding 1 is performed, and the result is written into the register again). Then, in step S23, it is determined whether or not the logical state of the internal port IP1 has been inverted. If the logical state is the same as that of the previous time (that is, if the logical state has not been inverted yet), the process ends there. If it has been inverted, in step S24, the value held in the second register reg2 is changed to the third register reg3.
And the value held in the third register reg3 is returned to the initial value “0” (0 is written). FIG. 5 is a diagram showing the above processing. Third register reg
The content of 3 is incremented by 1 each time a rising edge or a falling edge of clock1 is detected (step S22). Therefore, the third register reg3
Is gradually increased from 0. This count-up operation continues until the logical value of the internal port IP1 is inverted. When the logical inversion of the internal port IP1 occurs (step S23), after the value of the third register reg3 at that time is moved to the second register reg2,
The third register reg3 is returned to "0" (step S24). Therefore, if the inversion cycle of the internal port IP1 is constant as shown in FIG. 5, the third register reg3 increases at the timing of clock1 only during this inversion cycle, and the second register reg
2, a value corresponding to this inversion cycle is written every time. After all, clock1 period and internal port IP1
Is constant, the value held in the second register reg2 is always constant. In order to perform failure detection, as described above, fu
The nction1 and the function2 may be written as programs from the host unit 200 into the memory 10 via the bus 150, and these may be repeatedly executed. clock1
Is a clock signal obtained by dividing the driving clock supplied to the pulse input / output circuit 100, and its cycle is always constant unless a failure occurs. By the way, function1 is a process of inverting the internal port IP1 at a cycle corresponding to the value of the second register reg2.
nction2 is a process of writing a value corresponding to the inversion cycle of the internal port IP1 to the second register reg2. In other words, the configuration is such that one processing result affects the other processing. FIG. 6 is a diagram showing the relationship between the two processes. Therefore, as long as there is no abnormality in any of the processes, the value of the second register reg2 is constant, and the inversion cycle of the internal port IP1 is also constant. Therefore, if it is determined whether or not the internal port IP1 is inverted at regular intervals, it is possible to recognize the presence or absence of a failure. The processing of function1 and function2 includes all processing of reading / writing data to / from a port, reading / writing data to / from a register, and performing a logical operation (an operation of adding 1 to perform counting) on the read data. If any one of these processes has an abnormality, the relationship in the diagram shown in FIG. 6 is not satisfied, and the inversion cycle of the internal port IP1 is disturbed. Therefore, failure diagnosis can be performed for the entire process of the pulse input / output circuit 100. In addition, the above-described diagnostic processing is performed by storing two diagnostic programs func in the memory 10.
It is only necessary to write and execute tion1 and function2, so there is no need to add special hardware. However, in order to determine whether or not the internal port IP1 is inverted at regular intervals, some hardware is required. FIG. 7 shows an example of a circuit for making such a determination. This determination circuit is based on the AND circuit 2
1, a flip-flop 22, a counter circuit 23, and an exclusive OR circuit 24. AND circuit 2
1 has one input terminal connected to the internal port IP1;
The bit of the activation register 11 is input to the other input terminal. That is, when the activation register 11 stores the bit “1” indicating the activation state, the AND circuit 2
1 outputs a signal indicating the logical state of the internal port IP1. This signal is supplied to the flip-flop 22
To the D input terminal. On the other hand, the counter circuit 23
The clock input terminal clk of this embodiment (using a watchdog timer) is supplied with clock2 obtained from a clock signal of a different system from clock1. Generally, an in-vehicle system control device includes a standby system unit that performs emergency control in place of a normal control unit in the event of a failure. Is designed to operate with a clock of a different system from the clock used. In such a case, it is preferable to use another system clock for the standby system unit as clock2. Thus, the use of clock2 of a different system from clock1 is c
This is because even if a failure occurs in lock1 itself, it is possible to detect an abnormality. (When the same clock1 is used, a failure such as the clock1 cycle having been extended twice has been considered. If it occurs, it cannot be detected). From the counter circuit 23, output signals of MSB (most significant bit) and MSB-1 (second high order bit) are taken out, and the latter is supplied to the clock input terminal clk of the flip-flop 22, while the former is exclusive. It is provided to one input terminal of the logical OR circuit 24. Also, exclusive OR
The other input terminal of the circuit 24 has a flip-flop 22
Are provided. The operation of such a decision circuit will be described with reference to the timing chart of FIG. Now, it is assumed that the (MSB-1) output signal and the MSB output signal of the counter circuit 23 are periodic signals as shown in the figure. Assuming that the former inversion cycle is L / 2, the latter indicates a count value one digit higher, so that the latter has an inversion cycle L twice as large. On the other hand, the output signal from the internal port IP1 is
As described above, as long as the pulse input / output circuit 100 operates normally, it has a constant inversion cycle. So MS
The inversion cycle of the B output signal and the inversion cycle of the internal port IP1 when the internal port IP1 is normal are set in advance so as to be the same L (this may be done by adjusting the setting of the counter circuit 23 used, 2 may be adjusted when the steady value of the register reg2 is initialized.) Anyway, the inversion cycle of the MSB output signal and the inversion cycle of the internal port IP1 (when normal) are set to the same L. However, as described above, the output signal of the internal port IP1 is clock1
Since the MSB output signal is obtained based on clock 2 of another system, the phases of the two do not match as shown in FIG. The flip-flop 22 functions to adjust the phase difference. That is, when the output signal from the internal port IP1 given to the D input terminal is output from the Q output terminal, (MS
B-1) The signal Q has the same phase as the output signal. If the pulse input / output circuit 100 operates normally, the internal port IP1 repeats logical inversion at the inversion cycle L, so that this signal Q should completely match the MSB output signal. The exclusive OR circuit 24 is a circuit that detects this coincidence.
That is, if they match, a logic “0” is output (the pulse input / output circuit 100 is normal), and if they do not match, a logic “1” is output (the pulse input / output circuit 100 fails). Thus, the output signal of the exclusive OR circuit 24 can be used as a failure detection signal. The hardware shown in FIG. 7 is a relatively simple circuit, and adding such a circuit to the pulse input / output circuit 100 does not impose a significant load. Although the present invention has been described based on the illustrated embodiment, the present invention is not limited to this embodiment, but can be implemented in various other modes. For example, in the circuit shown in FIG.
However, instead of this clock2, the same clo
It is also possible to use ck1. However, as described above, in order to detect the abnormality of the clock itself,
It is preferable to use clock2. Further, the circuit shown in FIG. 7 is shown as an example. In short, any other circuit that can confirm that the logical inversion cycle of the internal port IP1 is the predetermined cycle L is used. A simple circuit may be used. As described above, according to the present invention, in order to detect a failure of the pulse input / output circuit, two processing programs for accessing a port and a register are prepared, and both programs are mutually connected programs. In this embodiment, the failure detection is performed by confirming that a constant execution result is always obtained, so that the hardware configuration can be simplified as much as possible.

【図面の簡単な説明】 【図1】本発明に係る故障検出装置の適用対象となるパ
ルス入出力回路の基本構成を示すブロック図である。 【図2】本発明に係る故障検出において用いられるプロ
グラムfunction1の処理内容を示す流れ図である。 【図3】図2に示す処理内容に対応したダイヤグラムで
ある。 【図4】本発明に係る故障検出において用いられるプロ
グラムfunction2の処理内容を示す流れ図である。 【図5】図4に示す処理内容に対応したダイヤグラムで
ある。 【図6】2つのプログラムfunction1,function2の相
互関係を示すダイヤグラムである。 【図7】図6に示すダイヤグラムにおける内部ポートI
P1の論理状態が一定周期か否かを判断する回路の一例
を示す回路図である。 【図8】図7の回路の動作を示すタイミングチャートで
ある。 【符号の説明】 0…メモリ 11…起動レジスタ 12…AND回路 13…プログラムカウンタ 14…命令解読回路 15…ポート・レジスタ制御装置 16…レジスタ群 17…入出力ポート群 21…AND回路 22…フリップフロップ 23…カウンタ回路 24…排他的OR回路 100…パルス入出力回路 150…バス 200…ホストユニット reg1〜reg8…レジスタ OP1,OP2,…外部ポート IP1,IP2,…内部ポート clock1, clock2…クロック信号
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a block diagram showing a basic configuration of a pulse input / output circuit to which a failure detection device according to the present invention is applied. FIG. 2 is a flowchart showing processing contents of a program function1 used in failure detection according to the present invention. FIG. 3 is a diagram corresponding to the processing contents shown in FIG. 2; FIG. 4 is a flowchart showing processing contents of a program function2 used in failure detection according to the present invention. FIG. 5 is a diagram corresponding to the processing content shown in FIG. 4; FIG. 6 is a diagram showing a mutual relationship between two programs function1 and function2. FIG. 7 is an internal port I in the diagram shown in FIG. 6;
FIG. 4 is a circuit diagram illustrating an example of a circuit that determines whether a logical state of P1 is a fixed cycle. FIG. 8 is a timing chart showing the operation of the circuit of FIG. 7; [Description of Signs] 0 memory 11 start register 12 AND circuit 13 program counter 14 instruction decoding circuit 15 port register controller 16 register group 17 input / output port group 21 AND circuit 22 flip-flop 23 counter circuit 24 exclusive OR circuit 100 pulse input / output circuit 150 bus 200 host units reg1 to reg8 registers OP1, OP2, external ports IP1, IP2, internal ports clock1, clock2 clock signals

───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 平2−297226(JP,A) 特開 昭63−307541(JP,A) 特開 平1−185741(JP,A) 特開 昭61−260336(JP,A) 実開 平4−90252(JP,U) (58)調査した分野(Int.Cl.7,DB名) G06F 13/00 G06F 11/30 G06F 1/04 ──────────────────────────────────────────────────続 き Continuation of the front page (56) References JP-A-2-297226 (JP, A) JP-A-63-307541 (JP, A) JP-A-1-1855741 (JP, A) JP-A 61-307 260336 (JP, A) Japanese Utility Model Hei 4-90252 (JP, U) (58) Fields investigated (Int. Cl. 7 , DB name) G06F 13/00 G06F 11/30 G06F 1/04

Claims (1)

(57)【特許請求の範囲】 【請求項1】 論理パルス信号を入出力するための複数
のポートを有する入出力ポート群と、 所定のデータを保持する複数のレジスタを有するレジス
タ群と、 前記ポートおよび前記レジスタ対して、データの読出し
・データの書込み・データに対する論理演算、の各処理
を実行するポート・レジスタ制御装置と、 前記ポート・レジスタ制御装置に対して実行させるべき
処理内容を、所定の順序で格納した記憶手段と、 前記記憶手段内に格納されている処理内容を順番に取り
出し、これを前記ポート・レジスタ制御装置に与えて実
行させる命令解読回路と、 を備えたパルス入出力回路、の故障を検出する装置であ
って、 所定のクロック信号を計数しながらその計数値を第1の
レジスタに格納してゆき、前記第1のレジスタの保持値
が第2のレジスタの保持値に一致したときに、所定のポ
ートの論理状態を反転させるとともに前記第1のレジス
タの保持値を初期値に戻す第1の処理と、 所定のクロック信号を計数しながらその計数値を第3の
レジスタに格納してゆき、前記所定のポートの論理状態
が反転したときに、前記第2のレジスタの保持値を前記
第3のレジスタの保持値に書き替えるとともに前記第3
のレジスタの保持値を初期値に戻す第2の処理と、 を前記記憶手段に格納し、 前記第1の処理および前記第2の処理を前記ポート・レ
ジスタ制御装置によって実行させたときに、前記所定の
ポートの論理状態の反転周期が予め設定された所定周期
に一致するか否かを判定することにより故障検出を行う
ことを特徴とするパルス入出力回路の故障検出装置。
(57) Claims: 1. An input / output port group having a plurality of ports for inputting / outputting a logical pulse signal, a register group having a plurality of registers for holding predetermined data, A port / register control device that executes each process of reading data, writing data, and performing logical operation on data with respect to a port and the register, and a process content to be executed by the port / register control device, A pulse input / output circuit comprising: a storage unit that stores the processing contents stored in the storage unit in the order described above; and an instruction decoding circuit that sequentially retrieves the processing content stored in the storage unit and supplies the processing content to the port / register control device for execution. , Detecting a failure in the first register while counting a predetermined clock signal and storing the counted value in a first register. A first process for inverting the logic state of a predetermined port and returning the held value of the first register to an initial value when the held value of the data matches the held value of the second register; While counting the signals, the count value is stored in a third register, and when the logic state of the predetermined port is inverted, the value held in the second register is changed to the value held in the third register. Rewrite and the third
A second process for returning the held value of the register to an initial value; and storing the second process in the storage unit, and when the first process and the second process are executed by the port / register control device, A failure detection device for a pulse input / output circuit, wherein failure detection is performed by determining whether the inversion cycle of the logic state of a predetermined port matches a predetermined cycle set in advance.
JP20904693A 1993-07-30 1993-07-30 Failure detection device for pulse input / output circuit Expired - Fee Related JP3433824B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP20904693A JP3433824B2 (en) 1993-07-30 1993-07-30 Failure detection device for pulse input / output circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP20904693A JP3433824B2 (en) 1993-07-30 1993-07-30 Failure detection device for pulse input / output circuit

Publications (2)

Publication Number Publication Date
JPH0744472A JPH0744472A (en) 1995-02-14
JP3433824B2 true JP3433824B2 (en) 2003-08-04

Family

ID=16566363

Family Applications (1)

Application Number Title Priority Date Filing Date
JP20904693A Expired - Fee Related JP3433824B2 (en) 1993-07-30 1993-07-30 Failure detection device for pulse input / output circuit

Country Status (1)

Country Link
JP (1) JP3433824B2 (en)

Also Published As

Publication number Publication date
JPH0744472A (en) 1995-02-14

Similar Documents

Publication Publication Date Title
US5157780A (en) Master-slave checking system
JPH07271403A (en) Inactive system memory updating system
JPS63133238A (en) Digital data processing system
JP3988636B2 (en) Microcomputer and vehicle ECU
JP3433824B2 (en) Failure detection device for pulse input / output circuit
JP2687476B2 (en) Vector data processing device
JP3951371B2 (en) Watchdog timer and microcomputer
JPH08235073A (en) Microcomputer
KR101570031B1 (en) Arrangement for checking a program memory in a computation unit
JP2607319B2 (en) Programmable controller
JPH0652013A (en) Tracing circuit
JPH10143448A (en) Memory system
JP3366235B2 (en) Data read control device
JPH0744407A (en) Backup device for microcomputer
JP2678112B2 (en) Real-time output port
JP2006172331A (en) Microcontroller
JPH04180111A (en) Information processor
SU1456996A1 (en) Device for monitoring memory units
JP2850377B2 (en) Microcomputer
JPH06250868A (en) Computer
JP3405513B2 (en) Redundant controller for programmable controller
JP2021060758A (en) Vehicle control device
JP2003058522A (en) Method and device for monitoring internal ram
JPH0612292A (en) Microcomputer
JPH05334099A (en) Write circuit for state setting register

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees