JP3948345B2 - Communications system - Google Patents

Communications system Download PDF

Info

Publication number
JP3948345B2
JP3948345B2 JP2002144437A JP2002144437A JP3948345B2 JP 3948345 B2 JP3948345 B2 JP 3948345B2 JP 2002144437 A JP2002144437 A JP 2002144437A JP 2002144437 A JP2002144437 A JP 2002144437A JP 3948345 B2 JP3948345 B2 JP 3948345B2
Authority
JP
Japan
Prior art keywords
data
communication
transmission
communication system
received
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
JP2002144437A
Other languages
Japanese (ja)
Other versions
JP2003338807A (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 JP2002144437A priority Critical patent/JP3948345B2/en
Publication of JP2003338807A publication Critical patent/JP2003338807A/en
Application granted granted Critical
Publication of JP3948345B2 publication Critical patent/JP3948345B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Combined Controls Of Internal Combustion Engines (AREA)
  • Detection And Prevention Of Errors In Transmission (AREA)
  • Communication Control (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、送信側の装置と受信側の装置とがStop−and−Wait Automatic Repeat Request方式でシリアル通信を行う通信システムに関するものである。
【0002】
【従来の技術】
従来より、例えば自動車のエンジン等を制御する車両用電子制御装置として、マイコン(マイクロコンピュータ)を2つ備えると共に、その2つのマイコンがSPI(シリアル/パラレルインターフェース)を用いてシリアル通信を行うことにより互いの制御データを共有するようにしたものがある。
【0003】
そして、この種の電子制御装置において、送信側の装置と受信側の装置との双方となり得る両マイコンは、通信時に発生した受信誤りを訂正するために、「受信側は、ある1つの伝送単位分のデータを誤りなく正しく受信する毎に、送信側へ、そのことを知らせる伝達確認信号としてのACK(positive acknowledgement)を送り、逆に、データを正しく受信することができなかった場合(即ち、受信誤りを検出した場合)には、受信したデータを捨てると共に、送信側へ、再送信要求信号としてのNAK(negative acknowledgement)を送り、また、そのNAKを受け取った送信側は、送信バッファに蓄積してある前回のデータを、ACKを受け取るまで再送信する」といったStop−and−Wait Automatic Repeat Request方式(以下、SWARQ方式という)でシリアル通信を行っている。
【0004】
ここで、2つのマイコンがSWARQ方式でシリアル通信を行う電子制御装置の具体的構成例を、図8に示す。
図8に示すように、この例の電子制御装置100には、マイコン101とマイコン102とが設けられている。そして、各マイコン101,102は、送信データレジスタ11t及び受信データレジスタ11rを有したSPI13と、そのSPI13とパラレルのデータバスを介して接続された送信バッファ15t及び受信バッファ15rとを備えている。尚、この例において、送信バッファ15tと受信バッファ15rは、マイコン101,102のRAMにおける一部の記憶領域である。
【0005】
そして更に、マイコン101のSPI13と、マイコン102のSPI13は、シリアル通信線17によってシリアル通信可能に接続されている。尚、シリアル通信線17は、全二重の通信線であり、マイコン101からマイコン102への送信用の通信線と、マイコン102からマイコン101への送信用の通信線とからなっている。また、この例では、マイコン101からマイコン102へ、通信用のクロック(即ち、通信時に両マイコン101,102が同期をとるためのクロック)が、クロック線19を介して供給されるようになっている。
【0006】
このような電子制御装置100において、両マイコン101,102は、一定時間毎に双方向のシリアル通信を行う。
そして、各マイコン101,102において、データを送信する際には、送信処理により、送信すべき制御データが、RAMから送信バッファ15tに転送されると共に、そのデータに誤り検出用の検査符号が付加され、そのような検査符号が付加されたデータが、1つの伝送単位分の送信データとして、送信バッファ15tからSPI13の送信データレジスタ11tに転送される。すると、その送信データレジスタ11tに転送されたデータは、SPI13により、シリアル通信線17へ1ビットずつ出力され、これにより、受信側である相手のマイコン(詳しくは、相手のマイコンのSPI13)へとシリアル送信されることとなる。
【0007】
また、各マイコン101,102において、データを受信する際には、まず、送信側からシリアル通信線17を介して送られて来るシリアルデータがSPI13の受信データレジスタ11rに格納される。そして、受信データレジスタ11rに1つの伝送単位分のデータが格納されると、受信処理により、受信データレジスタ11r内のデータが受信バッファ15rに転送されると共に、その受信バッファ15rに転送された受信データの正当性が該受信データに付加されている検査符号に基づいて検証され、正常ならば(即ち、受信エラーがなければ)、その受信データが、受信バッファ15rから、RAMの記憶領域のうちで該受信データに該当する制御データの格納領域に転送される。これにより、RAM内の制御データが受信データで更新されることとなる。
【0008】
次に、データ再送信時の通信動作を、図9を用いて説明する。尚、図9における「通信開始要求」のタイミングは、通信を開始する一定時間毎のタイミングである。
図9に示すように、この電子制御装置100において、両マイコン101,102間の通信は2回で1通信となっており、1回目の通信で制御データを通信し、2回目の通信で受信結果(ACK又はNAK)を通信するようになっている。
【0009】
そして、制御データを送信する場合は、まず、前回の通信における相手からの受信結果を確認し、ACKが返って来ていたならば、前述したように、RAMから送信バッファ15tに制御データを転送して、その新たな制御データを送信するが、NAKが返って来ていた場合には、送信バッファ15tの更新をせずに、前回と同じ制御データを送信する。つまり、RAMから送信バッファ15tへの制御データの転送を行わずに、前回送信したのと同じ送信バッファ15t内の制御データを再度送信する。
【0010】
このため、図9の例において、左から3番目の「通信開始要求」の際の通信では、前回の通信における相手からの受信結果がNAKであるため、左から1番目の「通信開始要求」の際の通信で送信した制御データ(N)と同じ制御データ(N)を再送信することとなる。また、左から5番目の「通信開始要求」の際の通信では、前回の通信における相手からの受信結果がACKであるため、次の更新された制御データ(N+1)を送信することとなる。尚、図において、NAK(N)は、N回目の通信で送られた制御データ(N)に対応するNAKであり、ACK(N)は、N回目の通信で送られた制御データ(N)に対応するACKである。
【0011】
【発明が解決しようとする課題】
上記技術によれば、通信の誤り訂正は可能であるが、受信結果(ACK又はNAK)を通信で送るため、制御データの伝送効率が悪い上に、受信エラーがあった次の通信で直ぐに再送信データ(即ち、前回と同じデータ)が欲しくても、受信結果を通知するための通信を挟むため、データ再送信の応答性が悪いという問題がある。
【0012】
尚、図10に示すように、制御データの通信時に前回の通信の受信結果も通信する、といった方法も考えられる。そして、この図10の方法では、各通信タイミング毎に制御データを送ることとなるため、制御データの伝送効率は向上する。
【0013】
しかし、「N−1」回目の通信で送られた制御データ(N−1)の受信に失敗した場合、次の通信では、N回目の更新された制御データ(N)が一旦送信されることとなり、データ再送信は、その次の「N+1」回目の通信(図10にて左から3番目の「通信開始要求」の際の通信)で、再度「N−1」回目の通信で送った制御データ(N−1)を送信することにより実現されることとなる。
【0014】
このため、送信側では、送信バッファ15tとして、前回と前々回との2回分の送信データを蓄積可能なものが必要となり、メモリ消費量が増加するという新たな問題が生じてしまう。しかも、受信エラーがあった次の通信で直ぐに再送信データが欲しいと思っても、やはり、受信結果を通知するための通信を挟む必要があり、データ再送信の応答性が悪いという問題は解決されない。
【0015】
本発明は、こうした問題に鑑みなされたものであり、データ再送信の応答性に優れた通信システムを提供することを目的としている。
【0016】
【課題を解決するための手段及び発明の効果】
上記目的を達成するためになされた請求項1に記載の本発明は、データを送信する側の装置である送信側装置と、データを受信する側の装置である受信側装置とが、SWARQ方式(Stop−and−Wait Automatic Repeat Request方式)でシリアル通信を行う通信システムにおいて、データの通信が、一定時間毎の通信タイミングが到来する毎に行われると共に、受信側装置にて送信側装置からのデータを正常に受信することができなかった場合に該受信側装置から送信側装置へと通知される再送信要求が、前記データの通信に用いられる通信線とは別に設けられた専用線によって通知されるようになっており、更に、受信側装置は、その再送信要求を次の通信タイミングの前に通知する。
【0017】
発明の通信システムによれば、受信側装置から送信側装置への再送信要求の通知が、通信ではなく、通信線とは別の専用線を介して行われるため、受信エラー(受信誤り)があった次の通信タイミングで、直ぐにデータを再送信することが可能となる。つまり、受信側装置が、送信側装置からのデータを正常に受信することができなかった場合には、次の通信タイミングまでに、上記専用線によって送信側装置へ再送信要求を通知することで、送信側装置は、受信エラーがあった次の通信タイミングで、その受信エラーの発生を知ることができ、その回の通信タイミングで、前回送信したのと同じデータを再度送信することができるからである。
そこで、請求項1の通信システムにおいて、受信側装置は、送信側装置からのデータを正常に受信することができなかった場合に、前記専用線の電圧レベルを、ハイレベルとローレベルとのうち、データを正常に受信することができなかったことを示す一方のレベルに設定することで、再送信要求を通知するようになっており、送信側装置は、通信タイミングが到来してから、今回の通信タイミングで送信すべき送信データを選択する前に、前記専用線の電圧レベルをチェックし、その電圧レベルに基づき、前回と同じデータを再送信すべきか否かを判断する。
更に、受信側装置は、通信タイミングが到来すると、送信側装置が前記専用線の電圧レベルをチェックし終えた後のタイミングで、前記専用線の電圧レベルを、前記一方のレベルに一旦設定しておき、その後、送信側装置からのデータを正常に受信することができたならば、前記専用線の電圧レベルを、前記一方のレベルとは異なる方のレベルに設定し直すように構成されている。
このような本発明の通信システムによれば、各通信タイミング毎にデータの伝送を行うことができると共に、データ再送信の応答性を向上させることができる。また、送信バッファは、1回分の送信データを蓄積可能なもので良く、メモリ消費量を増加させることもない。
【0018】
次に、請求項に記載の通信システムでは、請求項の通信システムにおいて、送信側装置は、今回送信するデータが、再送信要求に応じて再送信する前回と同じデータ(以下、再送信データという)と、該再送信データではない新たなデータ(即ち、更新されたデータ)との何れであるかを示す識別情報を、送信データの一部として受信側装置へ送信するように構成されている。
【0019】
そして、このような請求項の通信システムによれば、受信側装置は、送信側装置から受信したデータに含まれている前記識別情報を参照することにより、「前回の通信時に送信側装置からのデータを正常に受信することができて送信側装置へ再送信要求を通知していないにも拘わらず、今回受信したデータが再送信データである」という異常〈1〉や、「前回の通信時に送信側装置からのデータを正常に受信することができず送信側装置へ再送信要求を通知したにも拘わらず、今回受信したデータが再送信データではない」という異常〈2〉を検出することができ、延いては、その各異常〈1〉,〈2〉に対応した適切なフェイルセーフ処理を実施することができるようになる。
【0020】
ここで、受信側装置が上記の異常〈1〉を検出する通信システムとしては、請求項や請求項に記載のものが考えられる。
まず、請求項に記載の通信システムでは、請求項の通信システムにおいて、受信側装置は、送信側装置からのデータを正常に受信することができた場合に、その受信したデータに含まれている前記識別情報を参照して、前回の通信時に送信側装置からのデータを正常に受信することができて送信側装置へ再送信要求を通知していないにも拘わらず、今回受信したデータが再送信データであるという矛盾(即ち、上記異常〈1〉)が生じているか否かを判定し、その矛盾が生じていると判定した場合には、今回受信したデータを無効とするように構成されている。
【0021】
そして、このような請求項の通信システムによれば、再送信要求の専用線にノイズがのる等の理由により、送信側装置が誤って前回と同じデータ(再送信データ)を送信したとしても、受信側装置は、そのような誤再送を検知して、その誤再送による再送信データを読み飛ばすこととなる。このため、例えば、1度しか実行してはいけない処理を要求するデータが、誤再送によって何度も送られてきたとしても、それを読み飛ばすことができ、システムの誤動作を防止することができる。
【0022】
次に、請求項に記載の通信システムでは、請求項の通信システムにおいて、受信側装置は、前記矛盾(上記異常〈1〉)が生じていると判定した連続回数を計数すると共に、その計数した回数が予め定められた判定値に達したならば、前記専用線が再送信要求を行う方の状態で故障していると判断して、所定のフェイルセーフ処理を実行するように構成されている。
【0023】
そして、このような請求項の通信システムによれば、専用線が再送信要求を行う方の状態で故障していることを検知して、その故障に対する適切なフェイルセーフ処理を行うことができるようになる。
特に、専用線が再送信要求を行う方の状態で故障すると、送信側装置が同じデータの誤再送を何度も繰り返すこととなり、また、受信側装置では、更新されたデータを受け取ることができず、受信データを用いる処理が古い同じデータを用いたままで継続されることとなるが、請求項の通信システムによれば、そのような異常を受信側装置で検知して、処理に使用するデータを所定のデフォルト値に設定する等のフェイルセーフ処理を実行することができ、システムの信頼性を一層向上させることができる。
【0024】
一方、受信側装置が上記の異常〈2〉を検出する通信システムとしては、請求項に記載のものが考えられる。
即ち、請求項に記載の通信システムでは、請求項2〜4の通信システムにおいて、受信側装置は、送信側装置からのデータを正常に受信することができた場合に、その受信したデータに含まれている前記識別情報を参照して、前回の通信時に送信側装置からのデータを正常に受信することができず送信側装置へ再送信要求を通知したにも拘わらず、今回受信したデータが再送信データではないという矛盾(即ち、上記異常〈2〉)が生じているか否かを判定すると共に、その矛盾が生じていると判定した場合に、所定のフェイルセーフ処理を実行するように構成されている。
【0025】
このような請求項の通信システムによれば、受信側装置にて、送信側装置がデータを再送信してくれないという異常を検知して、その異常に対する適切なフェイルセーフ処理を行うことができるようになる。
特に、受信側装置が再送信要求を通知する動作を行っても、送信側装置がデータの再送信を行わなければ、送信側装置から連続性が重要なデータが順次送信される場合に、受信側装置は、そのデータの一部を受信することができず支障が生じるが、請求項の通信システムによれば、そのような異常を受信側装置で検知して、連続性が重要なデータの全部や、そのうちの欠落したデータを、システムに支障がない所定のデフォルト値に設定する等のフェイルセーフ処理を実行することができ、システムの信頼性を向上させることができる。
【0026】
次に、請求項に記載の通信システムでは、請求項1〜の通信システムにおいて、送信側装置は、前回と同じデータを送信した連続回数(以下、再送信回数という)を計数し、その再送信回数が予め定められた規定値に達したならば、受信側装置からの再送信要求に拘わらず、前回と同じデータを送信するのを止めて、新たなデータを送信するように構成されている。
【0027】
このような請求項の通信システムによれば、データ再送信の連続回数(再送信回数)が規定値に制限されることとなるため、前記専用線が再送信要求を行う方の状態で故障した場合でも、新たなデータが送信される正常な通信状態へと復帰することができるようになる
【0028】
【発明の実施の形態】
以下、本発明が適用された実施形態の電子制御装置について、図面を用いて説明する。
まず、以下に述べる各実施形態に共通の内容について、図1を用い説明する。
【0029】
図1に示すように、本実施形態の電子制御装置10は、例えば自動車のエンジンを制御するものであり、図8に例示した電子制御装置100と同様に、制御データを通信によって共有しつつエンジンを制御するための処理を行う2つのマイコン1,2を備えている。
【0030】
ここで、図1において、図8と同様の構成要素については、同じ符号を付しているため、詳細な説明は省略するが、本実施形態の電子制御装置10においても、各マイコン1,2は、送信データレジスタ11t及び受信データレジスタ11rを有したSPI13と、RAMの一部の記憶領域からなる送信バッファ15t及び受信バッファ15rとを備えており、更に、両マイコン1,2のSPI13は、全二重のシリアル通信線17によってシリアル通信可能に接続されている。
【0031】
そして、両マイコン1,2は、一定時間毎にSWARQ方式でのシリアル通信を双方向に行うが、特に、本実施形態の電子制御装置10において、両マイコン1,2間には、シリアル通信線17及びクロック線19とは別に、マイコン1からマイコン2へ受信結果(ACK又はNAK)を通知するための再送信要求線L1と、マイコン2からマイコン1へ受信結果(ACK又はNAK)を通知するための再送信要求線L2とが配設されている。
【0032】
尚、再送信要求線L1は、マイコン1の出力ポートとマイコン2の入力ポートとを接続しており、マイコン1から見た場合には、自分自身の再送信要求線であり、マイコン2から見た場合には、通信相手の再送信要求線である。同様に、再送信要求線L2は、マイコン2の出力ポートとマイコン1の入力ポートとを接続しており、マイコン2から見た場合には、自分自身の再送信要求線であり、マイコン1から見た場合には、通信相手の再送信要求線である。
【0033】
[第1実施形態]
第1実施形態の電子制御装置10において、通信システムを成す2つのマイコン1,2の各々は、一定時間毎の通信タイミングが到来する毎に、図2(a)に示す送信処理を実行する。
【0034】
そして、図2(a)に示すように、マイコン1,2が送信処理の実行を開始すると、まずステップ(以下、単に「S」と記す)110にて、通信相手の再送信要求線(マイコン1ならばL2であり、マイコン2ならばL1である)の電圧レベルが、データの再送信要求としてのNAKに相当する要求有りのレベル(本実施形態ではローレベル)であるか否かを判定する。
【0035】
ここで、通信相手の再送信要求線の電圧レベルが、要求有りのレベルではないと判定した場合、即ち、通信相手の再送信要求線の電圧レベルがACKに相当する要求無しのレベル(本実施形態ではハイレベル)であった場合には(S110:NO)、S120に進んで、送信すべき制御データをRAMから送信バッファ15tに転送すると共に、その制御データに誤り検出用の検査符号を付加して、1伝送単位分(1フレーム分)の送信データを作成する。これにより、送信バッファ15tが更新される。つまり、送信バッファ15t内に、新たな制御データからなる1伝送単位分の送信データが格納される。
【0036】
そして、続くS130にて、送信バッファ15t内の送信データを自己のSPI13の送信データレジスタ11tに転送する。すると、その送信データレジスタ11tに転送された送信データは、SPI13によりシリアル通信線17へ1ビットずつ出力され、これにより、通信相手のマイコンへとシリアル送信されることとなる。
【0037】
そして更に、続くS140にて、自分自身の再送信要求線(マイコン1ならばL1であり、マイコン2ならばL2である)の電圧レベルを、要求有りのレベル(ローレベル)に設定し、その後、当該送信処理を終了する。
また、上記S110にて、通信相手の再送信要求線の電圧レベルが、要求有りのレベルであると判定した場合には、そのままS130に移行する。よって、この場合には、S120での送信バッファ15tの更新が行われず、前回送信したデータと全く同じデータが通信相手に再送信されることとなる。
【0038】
一方、上記送信処理によってデータが送信されると、それを受信する側のマイコンでは、シリアル通信線17を介して送られて来るシリアルデータがSPI13の受信データレジスタ11rに格納される。
そして、マイコン1,2の各々は、SPI13の受信データレジスタ11rに1伝送単位分のデータが格納されると、受信完了割り込み処理である図2(b)の受信処理を実行する。
【0039】
図2(b)に示すように、マイコン1,2が受信処理の実行を開始すると、まずS210にて、受信データレジスタ11r内のデータを受信バッファ15rに転送する。
次に、S220にて、その受信バッファ15rに転送した受信データの正当性(即ち、データを正しく受信できたか否か)を、その受信データに付加されている検査符号をチェックすることで判定し、正常ならば(即ち、受信エラーがなければ)、S230に進んで、受信バッファ15r内の受信データを、その受信データに該当する制御データのRAMにおける格納領域に転送する。これにより、RAM内の制御データが受信データで更新されることとなる。
【0040】
そして更に、続くS240にて、自分自身の再送信要求線(マイコン1ならばL1であり、マイコン2ならばL2である)の電圧レベルを、要求無しのレベル(ハイレベル)に設定し、その後、当該受信処理を終了する。
また、上記S220にて、受信エラーが発生していると判定した場合(即ち、通信相手からのデータを正常に受信することができなかった場合)には、S230及びS240の処理を行うことなく、そのまま当該受信処理を終了する。よって、この場合には、RAM内の制御データが受信データで更新されず(換言すれば、受信したデータは捨てられ)、しかも、自分自身の再送信要求線は、図2(a)の送信処理におけるS140で要求有りのレベル(ローレベル)に設定されたままになる。
【0041】
次に、以上のような2つのマイコン1,2からなる通信システムの作用について、図3を用い説明する。尚、図3における「通信開始要求」のタイミングは、両マイコン1,2が通信を開始する一定時間毎のタイミングである。また、ここでは、便宜上、データを送信する側のマイコン(送信側装置に相当)がマイコン1であり、データを受信する側のマイコン(受信側装置に相当)がマイコン2であるものとして説明する。
【0042】
まず、時刻t1の「通信開始要求」のタイミングで、マイコン2からマイコン1への再送信要求線L2が要求無しのレベル(ハイレベル)であったとすると、送信側としてのマイコン1は、そのタイミングで実行する図2(a)の送信処理にて、S110:NO→S120〜S140の処理を行い、新たな制御データをマイコン2に送信することとなる。尚、ここでは、この時にマイコン1から送信される制御データを、制御データ(N−1)とする。
【0043】
また、マイコン2も図2(a)の送信処理を実行し、その送信処理のS140により、マイコン1への再送信要求線L2を、一旦、要求有りのレベル(ローレベル)にセットすることとなる。
その後、マイコン2において、SPI13の受信データレジスタ11rにマイコン1からのデータが全て格納されると、図3の時刻taに示すように、受信完了割り込みが発生して、マイコン2は図2(b)の受信処理を実行することとなる。
【0044】
そして、マイコン2が、受信処理のS220にて受信エラーが発生していると判定したとすると(S220:YES)、その回の受信処理では、S230及びS240の処理がスキップされるため、受信データが捨てられると共に、マイコン1への再送信要求線L2が要求有りのレベル(ローレベル)に設定されたままとなる。
【0045】
このため、次の時刻t2の「通信開始要求」のタイミングで、マイコン1が送信処理の実行を開始すると、その時点ではマイコン2からの再送信要求線L2が要求有りのレベル(ローレベル)であるため、マイコン1は、その回の送信処理にて、S120の処理を行うことなくS130及びS140の処理を行うこととなり、その結果、前回送信した制御データ(N−1)と同じ制御データ(N−1)をマイコン2に再送信することとなる。
【0046】
尚、この時、マイコン2も送信処理を実行して、その送信処理のS140により、マイコン1への再送信要求線L2を、一旦、要求有りのレベルにセットするが、この場合には、再送信要求線L2が始めから要求有りのレベルになっているため、その再送信要求線L2の電圧レベルは変化しない。
【0047】
その後、マイコン2において、SPI13の受信データレジスタ11rにマイコン1からのデータ(この場合には、再送信データ)が全て格納されると、図3の時刻tbに示すように、再び受信完了割り込みが発生して、マイコン2は図2(b)の受信処理を実行することとなる。
【0048】
そして、マイコン2が、受信処理のS220にて受信エラーが発生していないと判定したとすると(S220:NO)、その回の受信処理では、S230及びS240の処理が行われて、RAM内の制御データが受信データで更新されると共に、マイコン1への再送信要求線L2が要求無しのレベル(ハイレベル)に設定されることとなる。
【0049】
すると、次の時刻t3の「通信開始要求」のタイミングで、マイコン1が送信処理の実行を開始した際には、マイコン1は、その回の送信処理にて、S110:NO→S120〜S140の処理を行うこととなり、その結果、新たな制御データ(N)をマイコン2に送信することとなる。
【0050】
そして、その制御データ(N)からなる送信データをマイコン2が正常に受信できたならば、マイコン2における時刻tcの受信処理(特にS240)でマイコン1への再送信要求線L2が要求無しのレベル(ハイレベル)に設定されることとなり、その結果、次の時刻t4の「通信開始要求」のタイミングで、マイコン1が送信処理の実行を開始した際には、マイコン1は、その回の送信処理にて、新たな制御データ(N+1)をマイコン2に送信することとなる。
【0051】
このように、本実施形態においては、受信側が、通信開始直後に送信側への再送信要求線のレベルを要求有りのレベルに一旦セットすると共に、送信側からのデータを正常に受信することができたならば、その送信側への再送信要求線のレベルを要求無しのレベルに戻すようにしており、これにより、受信側は、送信側からのデータを正常に受信することができたか否かの受信結果(ACK又はNAK)を、次の通信タイミングまでに送信側へ通知するようにしている。
【0052】
そして、送信側では、通信タイミングが到来した時に、受信側からの再送信要求線のレベルが要求無しのレベルであれば、受信側からACKが返ってきたと判断して、新たな制御データを送信するが、通信タイミングが到来した時に、受信側からの再送信要求線のレベルが要求有りのレベルであれば、受信側からNAKが返ってきた(即ち、受信エラーが発生した)と判断して、前回と同じデータを再送信するようにしている。
【0053】
以上のような本第1実施形態のマイコン1,2からなる通信システムによれば、受信側から送信側への再送信要求(広い意味ではACK又はNAKであり、狭い意味ではNAK)の通知が、シリアル通信線17とは別の専用線である再送信要求線L1,L2を介して行われるため、受信エラー(受信誤り)があった次の通信タイミングで、直ぐに前回と同じデータを再送信することができる。そして、各通信タイミング毎に制御データの伝送を行うことができると共に、データ再送信の応答性を向上させることができる。また、送信バッファ15tは、1回分の送信データを蓄積可能なもので良く、メモリ(上記の例ではRAM)の消費量を増加させることもない。
【0054】
[第2実施形態]
ところで、上記第1実施形態の電子制御装置10におけるマイコン1,2の通信システムでは、再送信要求線L1,L2にノイズがのる等の理由により、受信側が正常受信したにも拘わらず送信側が前回と同じデータを再送信してしまう可能性がある。
【0055】
そして、このような誤再送が発生すると、例えば、受信側のマイコンに何かの処理を実行して欲しいというイベント要求のデータが複数回送られて、本当は1度だけ実行すべき処理が受信側で何度も実行されてしまう、といった不具合が生じてしまう。
【0056】
そこで次に、このような不具合を防止可能な第2実施形態の電子制御装置10について説明する。
第2実施形態の電子制御装置10では、第1実施形態と比較すると、2つのマイコン1,2の各々が、図2(a)の送信処理に代えて、図4(a)の送信処理を実行すると共に、図2(b)の受信処理に代えて、図4()の受信処理を実行する点のみ異なっている。
【0057】
ここで、図4(a)の送信処理は、図2(a)の送信処理に対して、S110の前にS105の処理が追加されていると共に、S120とS130との間にS125の処理が追加されている点が異なっている。
そして、本第2実施形態において、各マイコン1,2が図4(a)の送信処理の実行を開始すると、まずS105にて、更新情報フラグをオフに初期化する。
【0058】
尚、更新情報フラグは、今回送信する制御データが、受信側からのNAKに応じて再送信する前回と同じデータ(再送信データ)と、再送信データではない新たな制御データ(更新されたデータ)との何れであるかを示す識別情報に相当するものである。そして、更新情報フラグがオフということは、そのフラグが0にセットされているということであると共に、今回送信するデータが再送信データであることを意味している。また逆に、更新情報フラグがオンということは、そのフラグが1にセットされているということであると共に、今回送信するデータが更新された新たな制御データであることを意味している。
【0059】
そして更に、図4(a)の送信処理では、S120で送信バッファ15tを更新すると、追加された次のS125で更新情報フラグをオンし、その後、S130に進む。
よって、S120で送信バッファ15tを更新した場合には、更新情報フラグがオン(=1)となり、送信バッファ15tが更新されずに前回と同じデータを送信する場合には、更新情報フラグがオフ(=0)となる。
【0060】
そして、本第2実施形態では、このようにオン又はオフに設定される更新情報フラグも、送信データの一部として、送信データレジスタ11tに転送され、通信相手のマイコンへと送信される。
一方、図4(b)の受信処理は、図2(b)の受信処理に対して、S225とS250の処理が追加されている点が異なっている。
【0061】
そして、図4(b)の受信処理では、S220にて受信エラーが発生していないと判定した場合に、S225に進んで、通信相手のマイコンから受信した前述の更新情報フラグ(即ち、受信したデータに含まれている更新情報フラグ)がオンであるか否かを判定して、オンであれば、S230に進む。
【0062】
また、上記S225にて、受信した更新情報フラグがオンではない(オフである)と判定した場合には、S250に移行して、前回の通信で受信エラーが発生しているか否かを判定し、前回の通信で受信エラーが発生していると判定した場合にも、S230に進む。
【0063】
これに対し、上記S250にて、前回の通信で受信エラーが発生していないと判定した場合には、前回の通信時に通信相手からのデータを正常に受信することができてNAKを返していないにも拘わらず、今回受信したデータが再送信データであるという矛盾(以下、異常〈1〉という)が生じていると判断し、S230の処理を行うことなくS240に移行する。よって、この場合には、今回受信したデータで制御データが更新されず、その今回の受信データは無効となる。
【0064】
このような第2実施形態のマイコン1,2からなる通信システムによれば、再送信要求線L1,L2にノイズがのる等の理由により、送信側が誤って前回と同じデータ(再送信データ)を送信したとしても、受信側は、そのような誤再送を検知して、その場合には、誤再送による再送信データを読み飛ばすこととなる(S225:NO且つS250:NO→S240)。このため、例えば、1度しか実行してはいけない処理を要求するデータが、誤再送によって何度も送られてきたとしても、それを読み飛ばすことができ、システムの誤動作を防止することができる。
【0065】
[第3実施形態]
次に、第3実施形態の電子制御装置10について説明する。
第3実施形態の電子制御装置10では、第2実施形態と比較すると、2つのマイコン1,2の各々が、図4(b)の受信処理に代えて、図5の受信処理を実行する点のみ異なっている。
【0066】
そして、図5の受信処理は、図4(b)の受信処理に対して、S235,S255,S260,及びS265の処理が追加されている点が異なっている。
ここで、図5の受信処理では、S230の処理を行った後、S235に進んで、誤再送の回数を計数するためのカウンタCNTaを0にクリアし、その後、S240に進む。また、S250にて前回の通信で受信エラーが発生していないと判定した場合には、S255に進んで、カウンタCNTaを1インクリメント(+1)し、その後、S240に進む。
【0067】
そして更に、図5の受信処理では、S240で自分自身の再送信要求線の電圧レベルを要求無しのレベルに設定した後、或いは、S220で受信エラーが発生していると判定した場合に、S260に進んで、カウンタCNTaの値が所定値Na(判定値に相当)以上であるか否かを判定する。
【0068】
そして、カウンタCNTaの値が所定値Na以上でなければ(S260:NO)、そのまま当該受信処理を終了するが、所定値Na以上であれば(S260:YES)、S265に進んで、所定のフェイルセーフ処理を行った後、当該受信処理を終了する。尚、S265で行うフェイルセーフ処理としては、例えば、制御データに対して適切なデフォルト値をセットするとか、制御データの値を前回値(即ち、受信データで最後に更新された値の1つ前の値)に戻す等の処理が考えられる。
【0069】
つまり、本第3実施形態では、受信側のマイコンにて、上記異常〈1〉が生じていると判定した連続回数をカウンタCNTaにより計数すると共に(S235,S255)、そのカウンタCNTaの値が予め定められた所定値Naに達したならば(S260:YES)、通信相手の再送信要求線が要求有りのレベルに固着してしまった故障が生じていると判断して、フェイルセーフ処理を実行するようにしている(S265)。
【0070】
そして、このような第3実施形態のマイコン1,2からなる通信システムによれば、再送信要求線が再送信要求を行う方の状態で故障していることを検知して、その故障に対する適切なフェイルセーフ処理を行うことができる。
特に、再送信要求線が要求有りのレベルのままになる故障が生じると、送信側のマイコンは同じデータの誤再送を何度も繰り返すこととなり、受信側のマイコンでは、更新されたデータを受け取ることができず、受信データを用いるエンジン制御用の処理が古い同じデータを用いたままで継続されることとなる。このため、例えば、通信される制御データの中には、電子スロットルの開度指令値があり、もし、一方のマイコンから他方のマイコンへ、電子スロットルの全開を指示する開度指令値のデータが何度も誤再送されたならば、エンジントルクが過大となってしまう。ところが、本第3実施形態によれば、そのような故障を受信側のマイコンで検知して、処理に使用する制御データを所定のデフォルト値に設定する等のフェイルセーフ処理を実施することができ、上記の如き過大なエンジントルクの発生等を防止できるため、制御システムの信頼性を一層向上させることができる。
【0071】
[第4実施形態]
次に、第4実施形態の電子制御装置10について説明する。
第4実施形態の電子制御装置10では、第3実施形態と比較すると、2つのマイコン1,2の各々が、図5の受信処理に代えて、図6の受信処理を実行する点のみ異なっている。
【0072】
そして、図6の受信処理は、図5の受信処理に対して、S227,S237,S270,S275,S280,及びS285の処理が追加されている点が異なっている。
ここで、図6の受信処理では、S225にて通信相手のマイコンから受信した更新情報フラグがオンであると判定した場合に、S227に進んで、前回の通信で受信エラーが発生しているか否かを判定する。そして、前回の通信で受信エラーが発生していないと判定した場合には(S227:NO)、前述したS230とS235の各処理を行った後、S237に進んで、非再送信フラグFbをオフに初期化し、その後、S240に進む。尚、非再送信フラグFbは、前回の通信時に通信相手からのデータを正常に受信することができずNAKを返したにも拘わらず、今回受信したデータが再送信データではない(データが再送信されなかった)という矛盾(以下、異常〈2〉という)が生じているか否かを示すフラグである。そして、非再送信フラグFbがオフということは、そのフラグが0にセットされているということであると共に、異常〈2〉が生じていないことを意味している。また逆に、非再送信フラグFbがオンということは、そのフラグが1にセットされているということであると共に、異常〈2〉が生じたことを意味している。
【0073】
一方、上記S227にて、前回の通信で受信エラーが発生していると判定した場合には(S227:YES)、上記異常〈2〉が生じていると判断して、S270に移行し、非再送信フラグFbをオンする。そして、続くS275にて、S230と同様に、受信バッファ15r内の受信データを、その受信データに該当する制御データのRAMにおける格納領域に転送し、その後、S240に移行する。
【0074】
そして更に、図6の受信処理では、S260にてカウンタCNTaの値が所定値Na以上でないと判定した場合、或いは、S265でのフェイルセーフ処理を行った後に、S280へ進んで、非再送信フラグFbがオンであるか否かを判定する。そして、非再送信フラグFbがオンでなければ(S280:NO)、そのまま当該受信処理を終了するが、非再送信フラグFbがオンであれば(SS280:YES)、S285に進んで、所定のフェイルセーフ処理を行った後、当該受信処理を終了する。尚、S285でのフェイルセーフ処理は、通信相手から再送信されなかった制御データ(詳しくは、その制御データのRAM内の値)をシステムに支障がない所定のデフォルト値に設定する、といった処理である。
【0075】
つまり、本第4実施形態では、受信側のマイコンが、通信相手からの更新情報フラグに基づいて、上記の異常〈2〉が生じているか否かを判定し(S225及びS227)、異常〈2〉が生じていると判定した場合には(S225:YES且つS227:YES)、所定のフェイルセーフ処理を実行するようにしている(S270,S280:YES,S285)。
【0076】
そして、このような第4実施形態のマイコン1,2からなる通信システムによれば、受信側のマイコンにて、送信側のマイコンがデータを再送信してくれないという異常〈2〉を検知して、その異常に対する適切なフェイルセーフ処理を行うことができる。
【0077】
特に、受信側がNAKを返しても送信側がデータの再送信を行わなければ、送信側から連続性が重要な制御データが順次送信される場合に、受信側は、その制御データの一部を受信することができず支障が生じるが、本第4実施形態によれば、そのような異常を受信側で検知して、欠落した制御データを所定のデフォルト値に設定する等のフェイルセーフ処理を実行することができ、システムの信頼性を向上させることができる。尚、図6のS285では、送信側から再送信されなかった制御データが、連続性が重要なデータである場合に、その連続性が重要なデータの全部を所定のデフォルト値に設定するようにしても良い。
【0078】
[第5実施形態]
次に、第5実施形態の電子制御装置10について説明する。
第5実施形態の電子制御装置10では、第1実施形態と比較すると、2つのマイコン1,2の各々が、図2(a)の送信処理に代えて、図7の送信処理を実行する点のみ異なっている。
【0079】
そして、図7の送信処理は、図2(a)の送信処理に対して、S115,S150,及びS155の処理が追加されている点が異なっている。
ここで、図7の送信処理では、S110にて、通信相手の再送信要求線の電圧レベルが要求有りのレベルでないと判定した場合に、S115に進んで、前回と同じデータを送信した連続回数(再送信回数)を計数するためのカウンタCNTcを0にクリアし、その後、S120に進む。
【0080】
また、上記S110にて、通信相手の再送信要求線の電圧レベルが要求有りのレベルであると判定した場合には、S150に移行して、カウンタCNTcの値が所定値Nc(規定値に相当)以上であるか否かを判定する。
そして、カウンタCNTcの値が所定値Nc以上でなければ(S150:NO)、S155に進んで、カウンタCNTcを1インクリメント(+1)した後、S130に移行するが、カウンタCNTcの値が所定値Nc以上であれば(S150:YES)、S120に移行し、このS120で送信バッファ15tを更新してから、S130に進む。
【0081】
つまり、本第5実施形態では、送信側のマイコンが、再送信回数をカウンタCNTcによって計数し(S115,S155)、その再送信回数が所定値Ncに達したならば、受信側からのNAKに拘わらず、送信バッファ15tを更新して新たな制御データを送信するようにしている(S150:YES→S120)。
【0082】
このような第5実施形態のマイコン1,2からなる通信システムによれば、データの再送信回数が所定値Ncに制限されることとなるため、通信相手の再送信要求線が要求有りのレベルに固着してしまった故障が生じた場合に、データの再送信が継続する状態から、更新された制御データが送信される正常な通信状態へと復帰することができる。
【0083】
尚、図7におけるS115,S150,及びS155の処理は、前述した第2実施形態及び第3実施形態で実行される図4(a)の送信処理に追加しても良い。
以上、本発明の一実施形態について説明したが、本発明は、種々の形態を採り得ることは言うまでもない。
【0084】
例えば、 上記各実施形態の電子制御装置10は、自動車のエンジンを制御するものであったが、本発明は、他の制御対象を制御する電子制御装置に対しても同様に適用することができる。
また、上記各実施形態は、電子制御装置に搭載される2つのマイコン間の通信に本発明を適用したものであったが、本発明は、そのようなマイコン間の通信システムに限らず、他の装置間の通信システムに対しても同様に適用することができる。
【図面の簡単な説明】
【図1】 実施形態の電子制御装置の構成図である。
【図2】 第1実施形態の電子制御装置における2つの各マイコンで実行される送信処理と受信処理とを表すフローチャートである。
【図3】 第1実施形態の作用を表す説明図である。
【図4】 第2実施形態の電子制御装置における2つの各マイコンで実行される送信処理と受信処理とを表すフローチャートである。
【図5】 第3実施形態の電子制御装置における2つの各マイコンで実行される受信処理を表すフローチャートである。
【図6】 第4実施形態の電子制御装置における2つの各マイコンで実行される受信処理を表すフローチャートである。
【図7】 第5実施形態の電子制御装置における2つの各マイコンで実行される送信処理を表すフローチャートである。
【図8】 搭載された2つのマイコンがSWARQ方式でシリアル通信を行う従来の電子制御装置の構成図である。
【図9】 図8の両マイコン間で実施される通信の手順を表す説明図である。
【図10】 他の通信手順を表す説明図である。
【符号の説明】
1,2…マイコン(マイクロコンピュータ)、10…電子制御装置、11r…受信データレジスタ、11t…送信データレジスタ、13…SPI(シリアル/パラレルインターフェース)、15r…受信バッファ、15t…送信バッファ、17…シリアル通信線、19…クロック線、L1,L2…再送信要求線
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a communication system in which a transmission-side device and a reception-side device perform serial communication using a stop-and-wait automatic repeat request method.
[0002]
[Prior art]
Conventionally, for example, as a vehicle electronic control device for controlling an automobile engine or the like, two microcomputers (microcomputers) are provided, and the two microcomputers perform serial communication using SPI (serial / parallel interface). Some of them share control data with each other.
[0003]
In this type of electronic control device, both microcomputers, which can be both a transmission-side device and a reception-side device, are able to correct reception errors that occur during communication. ACK (positive acknowledgement) as a transmission confirmation signal that informs the transmission side each time the correct amount of data is correctly received without error, and conversely, when the data cannot be correctly received (that is, When a reception error is detected), the received data is discarded, and a NAK (negative acknowledgement) as a retransmission request signal is sent to the transmission side, and the transmission side that has received the NAK accumulates in the transmission buffer. Stop-and-Wait Automatic Repeat Requests such as “Retransmit previous data until ACK is received” Method (hereinafter, referred SWARQ method) is performed serial communication.
[0004]
Here, FIG. 8 shows a specific configuration example of an electronic control device in which two microcomputers perform serial communication using the SWARQ method.
As shown in FIG. 8, the electronic control device 100 of this example is provided with a microcomputer 101 and a microcomputer 102. Each of the microcomputers 101 and 102 includes an SPI 13 having a transmission data register 11t and a reception data register 11r, and a transmission buffer 15t and a reception buffer 15r connected to the SPI 13 via a parallel data bus. In this example, the transmission buffer 15t and the reception buffer 15r are partial storage areas in the RAM of the microcomputers 101 and 102.
[0005]
Further, the SPI 13 of the microcomputer 101 and the SPI 13 of the microcomputer 102 are connected by a serial communication line 17 so that serial communication is possible. The serial communication line 17 is a full-duplex communication line, and includes a communication line for transmission from the microcomputer 101 to the microcomputer 102 and a communication line for transmission from the microcomputer 102 to the microcomputer 101. In this example, a communication clock (that is, a clock for synchronizing both microcomputers 101 and 102 during communication) is supplied from the microcomputer 101 to the microcomputer 102 via the clock line 19. Yes.
[0006]
In such an electronic control device 100, both the microcomputers 101 and 102 perform bidirectional serial communication at regular intervals.
When transmitting data in each of the microcomputers 101 and 102, control data to be transmitted is transferred from the RAM to the transmission buffer 15t by transmission processing, and a check code for error detection is added to the data. The data to which such a check code is added is transferred from the transmission buffer 15t to the transmission data register 11t of the SPI 13 as transmission data for one transmission unit. Then, the data transferred to the transmission data register 11t is output bit by bit to the serial communication line 17 by the SPI 13, and this causes the receiving microcomputer (specifically, the SPI 13 of the other microcomputer) to receive. It will be sent serially.
[0007]
Further, when receiving data in each of the microcomputers 101 and 102, first, serial data transmitted from the transmission side via the serial communication line 17 is stored in the reception data register 11r of the SPI 13. When data for one transmission unit is stored in the reception data register 11r, the data in the reception data register 11r is transferred to the reception buffer 15r by the reception process, and the reception data transferred to the reception buffer 15r is received. If the validity of the data is verified based on the check code added to the received data and is normal (that is, if there is no reception error), the received data is transferred from the reception buffer 15r to the RAM storage area. Then, the data is transferred to the control data storage area corresponding to the received data. As a result, the control data in the RAM is updated with the received data.
[0008]
Next, the communication operation at the time of data retransmission will be described with reference to FIG. Note that the timing of the “communication start request” in FIG. 9 is the timing at regular intervals at which communication is started.
As shown in FIG. 9, in this electronic control unit 100, communication between both microcomputers 101 and 102 is one communication in two times, and control data is communicated in the first communication and received in the second communication. The result (ACK or NAK) is communicated.
[0009]
When transmitting control data, first, the reception result from the other party in the previous communication is confirmed, and if ACK is returned, the control data is transferred from the RAM to the transmission buffer 15t as described above. Then, the new control data is transmitted. If NAK is returned, the same control data as the previous time is transmitted without updating the transmission buffer 15t. That is, the control data in the same transmission buffer 15t that was transmitted last time is transmitted again without transferring the control data from the RAM to the transmission buffer 15t.
[0010]
For this reason, in the example of FIG. 9, in the communication at the third “communication start request” from the left, the reception result from the other party in the previous communication is NAK, so the first “communication start request” from the left. The control data (N) that is the same as the control data (N) transmitted in the communication at the time of re-transmission is retransmitted. In the communication at the fifth “communication start request” from the left, since the reception result from the other party in the previous communication is ACK, the next updated control data (N + 1) is transmitted. In the figure, NAK (N) is the NAK corresponding to the control data (N) sent in the Nth communication, and ACK (N) is the control data (N) sent in the Nth communication. ACK corresponding to.
[0011]
[Problems to be solved by the invention]
According to the above technique, communication error correction is possible. However, since the reception result (ACK or NAK) is transmitted by communication, the transmission efficiency of control data is poor and the communication is immediately restarted by the next communication in which there is a reception error. Even if transmission data (that is, the same data as the previous time) is desired, there is a problem that the response for data retransmission is poor because communication for notifying the reception result is interposed.
[0012]
In addition, as shown in FIG. 10, a method of communicating the reception result of the previous communication at the time of control data communication is also conceivable. In the method of FIG. 10, since control data is sent at each communication timing, the transmission efficiency of control data is improved.
[0013]
However, if the control data (N-1) sent in the "N-1" th communication fails, the Nth updated control data (N) is once transmitted in the next communication. Then, the data re-transmission is sent again in the “N−1” th communication in the next “N + 1” communication (communication at the time of the third “communication start request” from the left in FIG. 10). This is realized by transmitting the control data (N-1).
[0014]
For this reason, on the transmission side, the transmission buffer 15t needs to be able to store transmission data for the previous and previous two times, which causes a new problem of increased memory consumption. Moreover, even if you want to retransmit data immediately in the next communication with a reception error, you still need to interpose communication to notify the reception result, which solves the problem of poor responsiveness of data retransmission Not.
[0015]
The present invention has been made in view of these problems, and an object of the present invention is to provide a communication system that is excellent in responsiveness to data retransmission.
[0016]
[Means for Solving the Problems and Effects of the Invention]
  The present invention according to claim 1, which is made to achieve the above object.soIs a communication in which a transmission side apparatus that is a data transmission side apparatus and a reception side apparatus that is a data reception side apparatus perform serial communication by a SWRQ method (Stop-and-Wait Automatic Repeat Request method). In the system, data communication is performed every time the communication timing for every fixed time arrives, and when the data from the transmitting device cannot be normally received by the receiving device, the receiving device The retransmission request notified from the communication device to the transmission side device is notified by a dedicated line provided separately from the communication line used for the data communication. Notify send request before next communication timingThe
[0017]
BookAccording to the communication system of the invention, since the notification of the retransmission request from the reception side apparatus to the transmission side apparatus is performed not via communication but through a dedicated line different from the communication line, a reception error (reception error) is generated. Data can be retransmitted immediately at the next communication timing. In other words, if the receiving side device cannot normally receive the data from the transmitting side device, it notifies the sending side device of the retransmission request by the dedicated line by the next communication timing. The sending side device can know the occurrence of the reception error at the next communication timing when there is a reception error, and can transmit the same data as the previous transmission again at that communication timing. It is.
  Therefore, ContractIn the communication system according to claim 1, when the receiving-side apparatus cannot normally receive data from the transmitting-side apparatus, the voltage level of the dedicated line is set to the data among the high level and the low level. Is set to one of the levels indicating that it could not be received normally, and a retransmission request is notified. Before selecting transmission data to be transmitted at the timing, the voltage level of the dedicated line is checked, and based on the voltage level, it is determined whether or not the same data as the previous time should be retransmitted.The
Furthermore,When the communication timing arrives, the receiving side device temporarily sets the voltage level of the dedicated line to the one level at a timing after the transmitting side device finishes checking the voltage level of the dedicated line, After that, if the data from the transmitting device can be received normally, the voltage level of the dedicated line is reset to a level different from the one level.The
like thisAccording to the communication system of the present invention, it is possible to transmit data at each communication timing and to improve the responsiveness of data retransmission. Further, the transmission buffer may be capable of storing one-time transmission data, and does not increase the memory consumption.
[0018]
  Next, the claim2In the communication system according to claim 1,1In this communication system, the transmitting side apparatus transmits data that is transmitted this time in response to a retransmission request (hereinafter referred to as retransmission data) and new data that is not the retransmission data (that is, retransmission data). , Updated data) is transmitted to the receiving apparatus as part of the transmission data.
[0019]
  And such a claim2According to the communication system of the above, the receiving side device refers to the identification information included in the data received from the transmitting side device, so that “the data from the transmitting side device is normally received during the previous communication”. Although the transmission side device has not been notified of the retransmission request, the error <1> indicating that the data received this time is retransmission data or the data from the transmission side device during the previous communication Although the data can not be normally received and the re-transmission request is notified to the transmitting side device, the error <2> that the data received this time is not re-transmitted data can be detected. Appropriate fail-safe processing corresponding to each of the abnormalities <1> and <2> can be performed.
[0020]
  Here, as a communication system in which the receiving-side apparatus detects the abnormality <1>, the claims3And claims4The thing of description is considered.
  First, claims3In the communication system according to claim 1,2In this communication system, when the receiving side apparatus can normally receive the data from the transmitting side apparatus, the receiving side apparatus refers to the identification information included in the received data and transmits the data during the previous communication. Although the data from the side apparatus can be normally received and the retransmission request is not notified to the transmission side apparatus, the contradiction that the data received this time is the retransmission data (that is, the abnormality <1 >) Is determined, and if it is determined that there is a contradiction, the currently received data is invalidated.
[0021]
  And such a claim3According to this communication system, even if the transmission side device mistakenly transmits the same data (retransmission data) as the previous time due to noise on the dedicated line for the retransmission request, the reception side device Such erroneous retransmission is detected, and retransmission data due to the erroneous retransmission is skipped. For this reason, for example, even if data requesting a process that should be executed only once is sent many times due to erroneous retransmission, it can be skipped, and malfunction of the system can be prevented. .
[0022]
  Next, the claim4In the communication system according to claim 1,3In the communication system, the receiving side device counts the continuous number of times that the contradiction (the above abnormality <1>) is determined to occur, and if the counted number reaches a predetermined determination value, It is determined that the dedicated line is broken in a state where a retransmission request is made, and a predetermined fail-safe process is executed.
[0023]
  And such a claim4According to this communication system, it is possible to detect that the dedicated line has failed in the state where the retransmission request is made and to perform appropriate fail-safe processing for the failure.
  In particular, if the dedicated line fails in the state where the re-transmission request is made, the transmitting side device repeats erroneous retransmission of the same data many times, and the receiving side device can receive updated data. However, the process using the received data will be continued using the same old data.4According to this communication system, such an abnormality can be detected by the receiving-side apparatus, and fail-safe processing such as setting data used for processing to a predetermined default value can be executed, thereby improving system reliability. This can be further improved.
[0024]
  On the other hand, as a communication system in which the receiving side device detects the abnormality <2>, a claim is provided.5The thing of description is considered.
  That is, the claim5In the communication system according to claim 1,2-4In this communication system, when the receiving side apparatus can normally receive the data from the transmitting side apparatus, the receiving side apparatus refers to the identification information included in the received data and transmits the data during the previous communication. Contradiction that the data received this time is not retransmission data even though the data from the side device cannot be normally received and the retransmission request is notified to the transmission side device (that is, the above abnormality <2>) Is determined, and when it is determined that the contradiction has occurred, a predetermined fail-safe process is executed.
[0025]
  Such claims5According to this communication system, the receiving side apparatus can detect an abnormality that the transmitting side apparatus does not retransmit data, and can perform an appropriate fail-safe process for the abnormality.
  In particular, even if the receiving side device performs the operation of notifying the retransmission request, if the transmitting side device does not retransmit the data, the receiving side device receives the data when continuity important data is sequentially transmitted from the transmitting side device. The side device cannot receive a part of the data, which causes a problem.5According to the communication system of the above, such an abnormality is detected by the receiving side device, and all of the data in which continuity is important and the missing data are set to predetermined default values that do not hinder the system. The fail-safe process can be executed, and the reliability of the system can be improved.
[0026]
  Next, the claim6In the communication system according to claim 1,4In this communication system, the transmitting side device counts the number of continuous transmissions of the same data as the previous time (hereinafter referred to as the number of retransmissions), and if the number of retransmissions reaches a predetermined specified value, the receiving side Regardless of the retransmission request from the apparatus, the transmission of the same data as the previous one is stopped and new data is transmitted.
[0027]
  Such claims6According to this communication system, since the continuous number of data retransmissions (the number of retransmissions) is limited to a specified value, even if the dedicated line fails in a state where a retransmission request is made, a new It will be possible to return to a normal communication state where data is transmitted..
[0028]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, an electronic control device according to an embodiment to which the present invention is applied will be described with reference to the drawings.
First, contents common to the embodiments described below will be described with reference to FIG.
[0029]
As shown in FIG. 1, the electronic control device 10 of the present embodiment controls, for example, an automobile engine, and controls the engine while sharing control data by communication, like the electronic control device 100 illustrated in FIG. 8. Are provided with two microcomputers 1 and 2 that perform processing for controlling the.
[0030]
Here, in FIG. 1, the same components as those in FIG. 8 are denoted by the same reference numerals, and detailed description thereof will be omitted. However, in the electronic control device 10 of this embodiment, each of the microcomputers 1 and 2 is also described. Includes an SPI 13 having a transmission data register 11t and a reception data register 11r, and a transmission buffer 15t and a reception buffer 15r formed of a partial storage area of the RAM. A full-duplex serial communication line 17 is connected to enable serial communication.
[0031]
The microcomputers 1 and 2 perform serial communication in the SWARQ method at regular intervals, and in particular, in the electronic control device 10 of the present embodiment, a serial communication line is provided between the microcomputers 1 and 2. In addition to 17 and the clock line 19, a retransmission request line L1 for notifying the microcomputer 1 to the microcomputer 2 the reception result (ACK or NAK) and the microcomputer 2 notifying the microcomputer 1 of the reception result (ACK or NAK). A retransmission request line L2 is provided.
[0032]
The retransmission request line L1 connects the output port of the microcomputer 1 and the input port of the microcomputer 2, and when viewed from the microcomputer 1, is the own retransmission request line. In this case, it is a retransmission request line of the communication partner. Similarly, the retransmission request line L2 connects the output port of the microcomputer 2 and the input port of the microcomputer 1, and when viewed from the microcomputer 2, the retransmission request line L2 is its own retransmission request line. When seen, it is a retransmission request line of the communication partner.
[0033]
[First Embodiment]
In the electronic control apparatus 10 according to the first embodiment, each of the two microcomputers 1 and 2 constituting the communication system executes the transmission process shown in FIG.
[0034]
Then, as shown in FIG. 2A, when the microcomputers 1 and 2 start executing the transmission process, first, in step (hereinafter, simply referred to as “S”) 110, the retransmission request line (microcomputer) of the communication partner. It is determined whether or not the voltage level of L2 if 1 is L1 if it is microcomputer 2 is a requested level (low level in this embodiment) corresponding to NAK as a data retransmission request. To do.
[0035]
Here, when it is determined that the voltage level of the communication partner's retransmission request line is not a requested level, that is, the voltage level of the communication partner's retransmission request line is a request-free level corresponding to ACK (this implementation If it is (high level in the embodiment) (S110: NO), the process proceeds to S120 to transfer the control data to be transmitted from the RAM to the transmission buffer 15t, and add a check code for error detection to the control data Then, transmission data for one transmission unit (one frame) is created. Thereby, the transmission buffer 15t is updated. That is, transmission data for one transmission unit composed of new control data is stored in the transmission buffer 15t.
[0036]
In subsequent S130, the transmission data in the transmission buffer 15t is transferred to the transmission data register 11t of its own SPI 13. Then, the transmission data transferred to the transmission data register 11t is output bit by bit to the serial communication line 17 by the SPI 13, thereby being serially transmitted to the microcomputer of the communication partner.
[0037]
In S140, the voltage level of its own retransmission request line (L1 for the microcomputer 1 and L2 for the microcomputer 2) is set to the requested level (low level), and thereafter The transmission process ends.
If it is determined in S110 that the voltage level of the retransmission request line of the communication partner is a requested level, the process proceeds to S130 as it is. Therefore, in this case, the transmission buffer 15t is not updated in S120, and exactly the same data as the previously transmitted data is retransmitted to the communication partner.
[0038]
On the other hand, when data is transmitted by the above transmission processing, the serial data transmitted via the serial communication line 17 is stored in the reception data register 11r of the SPI 13 in the microcomputer that receives the data.
When the data for one transmission unit is stored in the reception data register 11r of the SPI 13, each of the microcomputers 1 and 2 executes the reception process of FIG.
[0039]
As shown in FIG. 2B, when the microcomputers 1 and 2 start executing the reception process, first, in S210, the data in the reception data register 11r is transferred to the reception buffer 15r.
Next, in S220, the validity of the received data transferred to the reception buffer 15r (that is, whether or not the data has been correctly received) is determined by checking the check code added to the received data. If normal (that is, if there is no reception error), the process proceeds to S230, and the reception data in the reception buffer 15r is transferred to the storage area in the RAM of the control data corresponding to the reception data. As a result, the control data in the RAM is updated with the received data.
[0040]
Further, in the subsequent S240, the voltage level of its own retransmission request line (L1 for the microcomputer 1 and L2 for the microcomputer 2) is set to a non-requested level (high level), and thereafter The reception process ends.
If it is determined in S220 that a reception error has occurred (that is, data from the communication partner cannot be normally received), the processes of S230 and S240 are not performed. Then, the reception process is finished as it is. Therefore, in this case, the control data in the RAM is not updated with the received data (in other words, the received data is discarded), and the retransmission request line of its own is the transmission shown in FIG. In step S140, the requested level (low level) remains set.
[0041]
Next, the operation of the communication system including the two microcomputers 1 and 2 will be described with reference to FIG. Note that the timing of the “communication start request” in FIG. In addition, here, for convenience, it is assumed that the microcomputer that transmits data (corresponding to the transmitting apparatus) is the microcomputer 1 and the microcomputer that receives data (corresponding to the receiving apparatus) is the microcomputer 2. .
[0042]
First, assuming that the retransmission request line L2 from the microcomputer 2 to the microcomputer 1 is at a no-request level (high level) at the timing of the “communication start request” at time t1, the microcomputer 1 serving as the transmission side In the transmission process of FIG. 2A executed in step S110, the process of S110: NO → S120 to S140 is performed, and new control data is transmitted to the microcomputer 2. Here, the control data transmitted from the microcomputer 1 at this time is referred to as control data (N-1).
[0043]
Further, the microcomputer 2 also executes the transmission process of FIG. 2A, and sets the re-transmission request line L2 to the microcomputer 1 to a requested level (low level) once by S140 of the transmission process. Become.
After that, when all the data from the microcomputer 1 is stored in the reception data register 11r of the SPI 13 in the microcomputer 2, a reception completion interrupt is generated as shown at time ta in FIG. ) Reception processing is executed.
[0044]
If the microcomputer 2 determines that a reception error has occurred in S220 of the reception process (S220: YES), since the processes of S230 and S240 are skipped in the reception process of that time, the received data And the retransmission request line L2 to the microcomputer 1 remains set at the requested level (low level).
[0045]
Therefore, when the microcomputer 1 starts executing the transmission process at the timing of the “communication start request” at the next time t2, the retransmission request line L2 from the microcomputer 2 is at the requested level (low level) at that time. Therefore, the microcomputer 1 performs the processing of S130 and S140 without performing the processing of S120 in the transmission processing of that time, and as a result, the same control data (N-1) as the control data (N-1) transmitted last time. N-1) is retransmitted to the microcomputer 2.
[0046]
At this time, the microcomputer 2 also executes the transmission process, and the retransmission request line L2 to the microcomputer 1 is temporarily set to the requested level by S140 of the transmission process. Since the transmission request line L2 is at the requested level from the beginning, the voltage level of the retransmission request line L2 does not change.
[0047]
After that, when all data from the microcomputer 1 (in this case, retransmission data) is stored in the reception data register 11r of the SPI 13, the microcomputer 2 again receives a reception completion interrupt as shown at time tb in FIG. When this occurs, the microcomputer 2 executes the reception process of FIG.
[0048]
If the microcomputer 2 determines that a reception error has not occurred in S220 of the reception process (S220: NO), the process of S230 and S240 is performed in the reception process at that time, and the contents in the RAM are stored. The control data is updated with the received data, and the re-transmission request line L2 to the microcomputer 1 is set to a level without request (high level).
[0049]
Then, when the microcomputer 1 starts executing the transmission process at the timing of the “communication start request” at the next time t3, the microcomputer 1 performs S110: NO → S120 to S140 in the transmission process at that time. As a result, new control data (N) is transmitted to the microcomputer 2.
[0050]
If the microcomputer 2 can normally receive the transmission data composed of the control data (N), the retransmission request line L2 to the microcomputer 1 is not requested in the reception process (particularly S240) at the time tc in the microcomputer 2. As a result, when the microcomputer 1 starts executing the transmission process at the timing of the “communication start request” at the next time t4, the microcomputer 1 In the transmission process, new control data (N + 1) is transmitted to the microcomputer 2.
[0051]
As described above, in this embodiment, the receiving side may temporarily set the level of the retransmission request line to the transmitting side to the requested level immediately after the start of communication, and normally receive data from the transmitting side. If possible, the level of the re-transmission request line to the transmitting side is returned to the level without request, so that the receiving side has successfully received the data from the transmitting side. The reception result (ACK or NAK) is notified to the transmission side by the next communication timing.
[0052]
When the transmission side arrives, if the level of the retransmission request line from the receiving side is a non-requested level when the communication timing arrives, it is determined that an ACK has been returned from the receiving side, and new control data is transmitted. However, if the level of the retransmission request line from the receiving side is a requested level when the communication timing arrives, it is determined that a NAK has been returned from the receiving side (that is, a reception error has occurred). The same data as the previous time is retransmitted.
[0053]
According to the communication system including the microcomputers 1 and 2 of the first embodiment as described above, a notification of a retransmission request (ACK or NAK in a broad sense, NAK in a narrow sense) is sent from the receiving side to the transmitting side. Since it is performed via retransmission request lines L1 and L2, which are dedicated lines different from the serial communication line 17, the same data as the previous one is immediately retransmitted at the next communication timing when there is a reception error (reception error). can do. In addition, control data can be transmitted at each communication timing, and responsiveness of data retransmission can be improved. Further, the transmission buffer 15t may be capable of storing transmission data for one time, and does not increase the consumption of memory (RAM in the above example).
[0054]
[Second Embodiment]
By the way, in the communication system of the microcomputers 1 and 2 in the electronic control device 10 of the first embodiment, the transmission side is connected to the transmission side even though the reception side normally receives due to the noise on the retransmission request lines L1 and L2. The same data as the previous time may be retransmitted.
[0055]
When such an erroneous retransmission occurs, for example, event request data indicating that some processing is to be executed is sent to the receiving-side microcomputer a plurality of times, and the processing that should be executed only once is actually performed on the receiving side. The problem that it will be executed many times will occur.
[0056]
  Then, next, the electronic control apparatus 10 of 2nd Embodiment which can prevent such a malfunction is demonstrated.
  In the electronic control device 10 of the second embodiment, as compared with the first embodiment, each of the two microcomputers 1 and 2 performs the transmission process of FIG. 4A instead of the transmission process of FIG. In place of the reception processing of FIG.bThe only difference is that the receiving process is executed.
[0057]
Here, in the transmission process of FIG. 4A, the process of S105 is added before S110 with respect to the transmission process of FIG. 2A, and the process of S125 is performed between S120 and S130. The added points are different.
In the second embodiment, when the microcomputers 1 and 2 start executing the transmission process of FIG. 4A, first, in S105, the update information flag is initialized to be off.
[0058]
The update information flag indicates that the control data to be transmitted this time is the same data (retransmission data) that is retransmitted according to the NAK from the receiving side, and new control data that is not retransmission data (updated data). ) Corresponding to the identification information indicating whether or not. The fact that the update information flag is off means that the flag is set to 0 and that the data to be transmitted this time is retransmission data. On the other hand, when the update information flag is on, it means that the flag is set to 1 and that the data to be transmitted this time is new control data that has been updated.
[0059]
Further, in the transmission process of FIG. 4A, when the transmission buffer 15t is updated in S120, the update information flag is turned on in the next added S125, and then the process proceeds to S130.
Therefore, when the transmission buffer 15t is updated in S120, the update information flag is turned on (= 1). When the transmission buffer 15t is not updated and the same data as before is transmitted, the update information flag is turned off ( = 0).
[0060]
In the second embodiment, the update information flag set to ON or OFF in this way is also transferred to the transmission data register 11t as a part of the transmission data, and transmitted to the communication partner microcomputer.
On the other hand, the reception process of FIG. 4B is different from the reception process of FIG. 2B in that the processes of S225 and S250 are added.
[0061]
In the reception process of FIG. 4B, if it is determined in S220 that no reception error has occurred, the process proceeds to S225, and the above-described update information flag received from the communication partner microcomputer (that is, received) It is determined whether or not the update information flag included in the data is on. If it is on, the process proceeds to S230.
[0062]
If it is determined in S225 that the received update information flag is not ON (OFF), the process proceeds to S250 to determine whether a reception error has occurred in the previous communication. Even when it is determined that a reception error has occurred in the previous communication, the process proceeds to S230.
[0063]
  On the other hand, if it is determined in S250 that a reception error has not occurred in the previous communication, data from the communication partner can be normally received during the previous communication and NAK is not returned. Nevertheless, the contradiction that the data received this time is retransmission data (hereinafter referred to as abnormal<1>The process proceeds to S240 without performing the process of S230. Therefore, in this case, the control data is not updated with the data received this time, and the current reception data becomes invalid.
[0064]
According to the communication system including the microcomputers 1 and 2 according to the second embodiment, the same data as the previous time (retransmission data) is mistakenly transmitted by the transmission side due to noise on the retransmission request lines L1 and L2. Even if transmitted, the receiving side detects such an erroneous retransmission, and in that case, skips retransmission data due to the erroneous retransmission (S225: NO and S250: NO → S240). For this reason, for example, even if data requesting a process that should be executed only once is sent many times due to erroneous retransmission, it can be skipped, and malfunction of the system can be prevented. .
[0065]
[Third Embodiment]
Next, the electronic control apparatus 10 of 3rd Embodiment is demonstrated.
In the electronic control device 10 of the third embodiment, compared to the second embodiment, each of the two microcomputers 1 and 2 executes the reception process of FIG. 5 instead of the reception process of FIG. Only different.
[0066]
The reception process of FIG. 5 is different from the reception process of FIG. 4B in that the processes of S235, S255, S260, and S265 are added.
Here, in the reception process of FIG. 5, after performing the process of S230, the process proceeds to S235, the counter CNTa for counting the number of erroneous retransmissions is cleared to 0, and then the process proceeds to S240. If it is determined in S250 that no reception error has occurred in the previous communication, the process proceeds to S255, the counter CNTa is incremented by 1 (+1), and then the process proceeds to S240.
[0067]
  Further, in the reception process of FIG. 5, after setting the voltage level of its own retransmission request line to a no-request level in S240, or when it is determined in S220 that a reception error has occurred, S260. And the value of the counter CNTa is a predetermined value Na(SizeIt is determined whether it is equal to or greater than a fixed value.
[0068]
If the value of the counter CNTa is not equal to or greater than the predetermined value Na (S260: NO), the reception process is terminated as it is. If it is equal to or greater than the predetermined value Na (S260: YES), the process proceeds to S265, and a predetermined failure is detected. After performing the safe process, the reception process is terminated. As the fail-safe process performed in S265, for example, an appropriate default value is set for the control data, or the value of the control data is set to the previous value (that is, the value last updated with the received data). It is conceivable to return the value to
[0069]
  That is, in the third embodiment, the above-described abnormality is detected by the receiving microcomputer.<1>When the counter CNTa counts the number of consecutive times determined to have occurred (S235, S255) and the value of the counter CNTa reaches a predetermined value Na (S260: YES), the communication partner is reset. It is determined that a failure has occurred in which the transmission request line is fixed to the requested level, and fail-safe processing is executed (S265).
[0070]
Then, according to the communication system including the microcomputers 1 and 2 according to the third embodiment, it is detected that the retransmission request line is broken in a state where the retransmission request is made, and appropriate for the failure is detected. Fail-safe processing can be performed.
In particular, if a failure occurs where the re-transmission request line remains at the requested level, the sending microcomputer repeats the same data many times, and the receiving microcomputer receives the updated data. Therefore, the engine control process using the received data is continued using the same old data. For this reason, for example, the control data to be communicated includes an electronic throttle opening command value, and if there is opening command value data for instructing the full opening of the electronic throttle from one microcomputer to the other microcomputer. If erroneous retransmissions are made many times, the engine torque will be excessive. However, according to the third embodiment, fail-safe processing such as detecting such a failure with the receiving microcomputer and setting control data used for processing to a predetermined default value can be performed. Since the generation of excessive engine torque as described above can be prevented, the reliability of the control system can be further improved.
[0071]
[Fourth Embodiment]
Next, the electronic control apparatus 10 of 4th Embodiment is demonstrated.
The electronic control apparatus 10 of the fourth embodiment differs from the third embodiment only in that each of the two microcomputers 1 and 2 executes the reception process of FIG. 6 instead of the reception process of FIG. Yes.
[0072]
  The reception process of FIG. 6 differs from the reception process of FIG. 5 in that the processes of S227, S237, S270, S275, S280, and S285 are added.
  Here, in the reception process of FIG. 6, when it is determined in S225 that the update information flag received from the communication partner microcomputer is ON, the process proceeds to S227, and whether or not a reception error has occurred in the previous communication. Determine whether. If it is determined that no reception error has occurred in the previous communication (S227: NO), the processing of S230 and S235 described above is performed and then the process proceeds to S237 to turn off the non-re-transmission flag Fb. And then the process proceeds to S240. The non-re-transmission flag Fb indicates that the data received this time is not retransmission data even though the data from the communication partner cannot be normally received during the previous communication and NAK is returned. Contradiction (below, abnormal)<2>Is a flag indicating whether or not When the non-re-transmission flag Fb is off, it means that the flag is set to 0,<2>Means that it has not occurred. Conversely, when the non-re-transmission flag Fb is on, it means that the flag is set to 1 and an abnormal<2>Means that has occurred.
[0073]
  On the other hand, if it is determined in S227 that a reception error has occurred in the previous communication (S227: YES), the abnormality<2>In step S270, the non-re-transmission flag Fb is turned on. In subsequent S275, as in S230, the received data in the reception buffer 15r is transferred to the storage area of the control data corresponding to the received data in the RAM, and then the process proceeds to S240.
[0074]
Further, in the reception process of FIG. 6, when it is determined in S260 that the value of the counter CNTa is not greater than or equal to the predetermined value Na, or after performing the failsafe process in S265, the process proceeds to S280, where the non-retransmission flag is set. It is determined whether or not Fb is on. If the non-re-transmission flag Fb is not on (S280: NO), the reception process is terminated as it is. If the non-re-transmission flag Fb is on (SS280: YES), the process proceeds to S285, and a predetermined process is performed. After performing the fail-safe process, the reception process is terminated. The fail-safe process in S285 is a process in which control data that is not retransmitted from the communication partner (specifically, the value in the RAM of the control data) is set to a predetermined default value that does not hinder the system. is there.
[0075]
  That is, in the fourth embodiment, the receiving-side microcomputer performs the above abnormality based on the update information flag from the communication partner.<2>Whether or not has occurred (S225 and S227), abnormal<2>Is determined (S225: YES and S227: YES), a predetermined fail-safe process is executed (S270, S280: YES, S285).
[0076]
  According to the communication system including the microcomputers 1 and 2 according to the fourth embodiment, an abnormality that the transmission-side microcomputer does not retransmit data in the reception-side microcomputer.<2>And an appropriate fail-safe process for the abnormality can be performed.
[0077]
In particular, if the transmitting side does not retransmit data even if the receiving side returns NAK, when the control data of which continuity is important is sequentially transmitted from the transmitting side, the receiving side receives a part of the control data. However, according to the fourth embodiment, such an abnormality is detected on the receiving side, and fail-safe processing such as setting the missing control data to a predetermined default value is executed. System reliability can be improved. In S285 of FIG. 6, when the control data that has not been retransmitted from the transmission side is data in which continuity is important, all of the data in which continuity is important is set to a predetermined default value. May be.
[0078]
[Fifth Embodiment]
Next, the electronic control apparatus 10 of 5th Embodiment is demonstrated.
In the electronic control device 10 of the fifth embodiment, as compared with the first embodiment, each of the two microcomputers 1 and 2 executes the transmission process of FIG. 7 instead of the transmission process of FIG. Only different.
[0079]
The transmission process of FIG. 7 is different from the transmission process of FIG. 2A in that the processes of S115, S150, and S155 are added.
Here, in the transmission process of FIG. 7, when it is determined in S110 that the voltage level of the retransmission request line of the communication partner is not a requested level, the process proceeds to S115 and the number of consecutive transmissions of the same data as the previous time. The counter CNTc for counting (the number of retransmissions) is cleared to 0, and then the process proceeds to S120.
[0080]
  If it is determined in S110 that the voltage level of the retransmission request line of the communication partner is a requested level, the process proceeds to S150, and the value of the counter CNTc is set to the predetermined value Nc.(RegulationIt is determined whether it is equal to or greater than a fixed value.
  If the value of the counter CNTc is not equal to or greater than the predetermined value Nc (S150: NO), the process proceeds to S155, the counter CNTc is incremented by 1 (+1), and the process proceeds to S130. If it is above (S150: YES), it will transfer to S120, will update the transmission buffer 15t by this S120, and will progress to S130.
[0081]
That is, in the fifth embodiment, the transmission-side microcomputer counts the number of retransmissions by the counter CNTc (S115, S155), and if the number of retransmissions reaches a predetermined value Nc, the NAK from the reception side is set. Regardless, the transmission buffer 15t is updated to transmit new control data (S150: YES → S120).
[0082]
According to the communication system including the microcomputers 1 and 2 according to the fifth embodiment, since the number of data retransmissions is limited to the predetermined value Nc, the communication partner retransmission request line is at the requested level. In the case where a failure that has been stuck to the terminal occurs, it is possible to return from a state in which data retransmission continues to a normal communication state in which updated control data is transmitted.
[0083]
Note that the processing of S115, S150, and S155 in FIG. 7 may be added to the transmission processing of FIG. 4A executed in the second embodiment and the third embodiment described above.
As mentioned above, although one Embodiment of this invention was described, it cannot be overemphasized that this invention can take a various form.
[0084]
For example, although the electronic control device 10 of each of the above embodiments controls an automobile engine, the present invention can be similarly applied to an electronic control device that controls other control objects. .
Moreover, although each said embodiment applied this invention to the communication between two microcomputers mounted in an electronic control apparatus, this invention is not restricted to the communication system between such microcomputers, others The present invention can be similarly applied to the communication system between these devices.
[Brief description of the drawings]
FIG. 1 is a configuration diagram of an electronic control device according to an embodiment.
FIG. 2 is a flowchart showing a transmission process and a reception process executed by two microcomputers in the electronic control apparatus of the first embodiment.
FIG. 3 is an explanatory diagram showing the operation of the first embodiment.
FIG. 4 is a flowchart showing a transmission process and a reception process executed by two microcomputers in the electronic control device of the second embodiment.
FIG. 5 is a flowchart illustrating a reception process executed by two microcomputers in the electronic control device of the third embodiment.
FIG. 6 is a flowchart showing a reception process executed by two microcomputers in the electronic control device of the fourth embodiment.
FIG. 7 is a flowchart showing a transmission process executed by two microcomputers in the electronic control device of the fifth embodiment.
FIG. 8 is a configuration diagram of a conventional electronic control device in which two mounted microcomputers perform serial communication using the SWARQ method.
9 is an explanatory diagram illustrating a communication procedure performed between both microcomputers of FIG. 8;
FIG. 10 is an explanatory diagram showing another communication procedure.
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 1, 2 ... Microcomputer (microcomputer), 10 ... Electronic control unit, 11r ... Reception data register, 11t ... Transmission data register, 13 ... SPI (serial / parallel interface), 15r ... Reception buffer, 15t ... Transmission buffer, 17 ... Serial communication line, 19 ... clock line, L1, L2 ... retransmission request line

Claims (6)

データを送信する側の装置(以下、送信側装置という)と、前記データを受信する側の装置(以下、受信側装置という)とが、Stop−and−Wait Automatic Repeat Request方式でシリアル通信を行う通信システムにおいて、
前記データの通信が、一定時間毎の通信タイミングが到来する毎に行われると共に、
前記受信側装置にて前記送信側装置からのデータを正常に受信することができなかった場合に該受信側装置から前記送信側装置へと通知される再送信要求が、前記データの通信に用いられる通信線とは別に設けられた専用線によって通知されるようになっており、
記受信側装置は、前記再送信要求を次の通信タイミングの前に通知し、
しかも、前記受信側装置は、前記送信側装置からのデータを正常に受信することができなかった場合に、前記専用線の電圧レベルを、ハイレベルとローレベルとのうち、前記データを正常に受信することができなかったことを示す一方のレベルに設定することで、前記再送信要求を通知するようになっており、
前記送信側装置は、通信タイミングが到来してから、今回の通信タイミングで送信すべき送信データを選択する前に、前記専用線の電圧レベルをチェックし、その電圧レベルに基づき、前回と同じデータを再送信すべきか否かを判断するようになっており、
更に、前記受信側装置は、通信タイミングが到来すると、前記送信側装置が前記専用線の電圧レベルをチェックし終えた後のタイミングで、前記専用線の電圧レベルを、前記一方のレベルに一旦設定しておき、その後、前記送信側装置からのデータを正常に受信することができたならば、前記専用線の電圧レベルを、前記一方のレベルとは異なる方のレベルに設定し直すように構成されていること、
を特徴とする通信システム。
A device that transmits data (hereinafter, referred to as a transmitting device) and a device that receives the data (hereinafter, referred to as a receiving device) perform serial communication in accordance with a Stop-and-Wait Automatic Repeat Request method. In a communication system,
The communication of the data is performed every time the communication timing at regular intervals arrives,
A retransmission request notified from the receiving side device to the transmitting side device when the receiving side device cannot normally receive data from the transmitting side device is used for communication of the data It is to be notified by a dedicated line provided separately from the communication line,
Before Symbol receiving device notifies the retransmission request before the next communication timing,
In addition, when the receiving side apparatus cannot normally receive the data from the transmitting side apparatus, the voltage level of the dedicated line is set to the normal level between the high level and the low level. By setting to one level indicating that it could not be received, the retransmission request is notified,
The transmission side device checks the voltage level of the dedicated line before selecting transmission data to be transmitted at the current communication timing after the communication timing arrives, and based on the voltage level, the same data as the previous time is checked. To determine whether to re-send,
Further, when the communication timing arrives, the receiving side device temporarily sets the voltage level of the dedicated line to the one level at a timing after the transmitting side device finishes checking the voltage level of the dedicated line. After that, if the data from the transmission side apparatus can be normally received, the voltage level of the dedicated line is reset to a level different from the one level. is being done,
A communication system characterized by the above.
請求項1に記載の通信システムにおいて、
前記送信側装置は、
今回送信するデータが、前記再送信要求に応じて再送信する前回と同じデータ(以下、再送信データという)と、該再送信データではない新たなデータとの何れであるかを示す識別情報を、前記データの一部として前記受信側装置へ送信するように構成されていること、
を特徴とする通信システム。
The communication system according to claim 1,
The transmitting device is:
Identification information indicating whether the data to be transmitted this time is the same as the previous data to be retransmitted in response to the retransmission request (hereinafter referred to as retransmission data) or new data that is not the retransmission data. , Configured to transmit to the receiving device as part of the data,
A communication system characterized by the above.
請求項2に記載の通信システムにおいて、
前記受信側装置は、
前記送信側装置からのデータを正常に受信することができた場合に、その受信したデータに含まれている前記識別情報を参照して、前回の通信時に前記送信側装置からのデータを正常に受信することができて前記送信側装置へ再送信要求を通知していないにも拘わらず、今回受信したデータが前記再送信データであるという矛盾が生じているか否かを判定し、その矛盾が生じていると判定した場合には、今回受信したデータを無効とするように構成されていること、
を特徴とする通信システム。
The communication system according to claim 2,
The receiving side device
When the data from the transmission side apparatus can be normally received, the data from the transmission side apparatus is normally restored during the previous communication with reference to the identification information included in the received data. It is possible to determine whether or not there is a contradiction that the data received this time is the retransmission data even though the retransmission request is not notified to the transmission side device. If it is determined that it has occurred, it is configured to invalidate the data received this time,
A communication system characterized by the above.
請求項に記載の通信システムにおいて、
前記受信側装置は、
前記矛盾が生じていると判定した連続回数を計数すると共に、その計数した回数が予め定められた判定値に達したならば、前記専用線が前記再送信要求を行う方の状態で故障していると判断して、所定のフェイルセーフ処理を実行するように構成されていること、
を特徴とする通信システム。
The communication system according to claim 3 ,
The receiving side device
While counting the number of consecutive times determined that the contradiction has occurred, and if the counted number reaches a predetermined determination value, the dedicated line has failed in the state where the retransmission request is made. Configured to perform predetermined fail-safe processing,
A communication system characterized by the above.
請求項2ないし請求項4の何れか1項に記載の通信システムにおいて、
前記受信側装置は、
前記送信側装置からのデータを正常に受信することができた場合に、その受信したデータに含まれている前記識別情報を参照して、前回の通信時に前記送信側装置からのデータを正常に受信することができず前記送信側装置へ再送信要求を通知したにも拘わらず、今 回受信したデータが前記再送信データではないという矛盾が生じているか否かを判定すると共に、その矛盾が生じていると判定した場合に、所定のフェイルセーフ処理を実行するように構成されていること、
を特徴とする通信システム。
The communication system according to any one of claims 2 to 4 ,
The receiving side device
When the data from the transmission side apparatus can be normally received, the data from the transmission side apparatus is normally restored during the previous communication with reference to the identification information included in the received data. despite notified retransmission request to not be able to receive the transmission side apparatus, the received data is now time to determine whether contradiction that the non-retransmitted data has occurred, is contradiction Configured to perform predetermined fail-safe processing when it is determined that it has occurred,
A communication system characterized by the above.
請求項1ないし請求項4の何れか1項に記載の通信システムにおいて、
前記送信側装置は、
前回と同じデータを送信した連続回数(以下、再送信回数という)を計数し、その再送信回数が予め定められた規定値に達したならば、前記受信側装置からの再送信要求に拘わらず、前回と同じデータを送信するのを止めて、新たなデータを送信するように構成されていること、
を特徴とする通信システム
In the communication system according to any one of claims 1 to 4 ,
The transmitting device is:
Count the number of consecutive transmissions of the same data as before (hereinafter referred to as the number of retransmissions), and if the number of retransmissions reaches a predetermined value, regardless of the retransmission request from the receiving side device , Configured to stop sending the same data as before and send new data,
A communication system characterized by the above .
JP2002144437A 2002-05-20 2002-05-20 Communications system Expired - Fee Related JP3948345B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002144437A JP3948345B2 (en) 2002-05-20 2002-05-20 Communications system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002144437A JP3948345B2 (en) 2002-05-20 2002-05-20 Communications system

Publications (2)

Publication Number Publication Date
JP2003338807A JP2003338807A (en) 2003-11-28
JP3948345B2 true JP3948345B2 (en) 2007-07-25

Family

ID=29704110

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002144437A Expired - Fee Related JP3948345B2 (en) 2002-05-20 2002-05-20 Communications system

Country Status (1)

Country Link
JP (1) JP3948345B2 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4827535B2 (en) * 2006-01-20 2011-11-30 日立オートモティブシステムズ株式会社 Electronic control unit for automobile
JP5409025B2 (en) * 2009-01-27 2014-02-05 京楽産業.株式会社 Game machine
JP5783143B2 (en) * 2012-07-26 2015-09-24 株式会社デンソー Engine control device
CN102787932A (en) * 2012-08-28 2012-11-21 江西直方数控动力有限公司 Apparatus and method for matching and calibrating electric control diesel engine based on serial communication
JP6519453B2 (en) * 2015-11-18 2019-05-29 株式会社デンソー Communications system
JP7029965B2 (en) * 2018-01-16 2022-03-04 東京エレクトロン株式会社 Communication method of board processing device and board processing device

Also Published As

Publication number Publication date
JP2003338807A (en) 2003-11-28

Similar Documents

Publication Publication Date Title
EP0145318B1 (en) Communications method
US5696904A (en) Data transmission method and system therefor
US8780772B2 (en) Communication protocol for wireless enhanced controller area networks
JP4080980B2 (en) Electronic control unit
JP2002064518A (en) Error correcting communication method to transmit data packet in network communication system
JP3948345B2 (en) Communications system
JP4508732B2 (en) Electronic control unit
US7133947B2 (en) Data communication system, data communication method, and communication unit
JP2010050742A (en) Transmitting system, apparatus, and method
US8880972B2 (en) Serial transmission apparatus, information processing apparatus, and serial transmission method
JP2995348B2 (en) Multiplex transmission method
US7975064B2 (en) Envelope packet architecture for broadband engine
US10320528B2 (en) Fault tolerant communication channel
JP2015149541A (en) communication system
JP3106827B2 (en) Multiplex communication device
JP2002358177A (en) Image forming apparatus, serial communication method for the apparatus, program for allowing computer to perform the method and recording medium with the program recorded thereon
JP2759574B2 (en) Data transmission processing method and data transmission processing device
JP2021164040A (en) Relay device
JP2002202920A (en) Input/output unit and its internal data communication method
JPS63246055A (en) Packet transmitter-receiver
JP4239482B2 (en) Data transfer system, LSI and data transfer method
JP2022177652A (en) Communication device, communication system, and communication method
JP4087070B2 (en) Broadcast / ACK transmission method
JP3219070B2 (en) Line restoration method
JP2947437B2 (en) Data transmission method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20041108

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20060502

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060509

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060705

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20061003

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20061113

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070409

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

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20110427

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20120427

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20120427

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20130427

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20130427

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20140427

Year of fee payment: 7

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees