JPH0744516B2 - Data communication method between in-vehicle computers - Google Patents

Data communication method between in-vehicle computers

Info

Publication number
JPH0744516B2
JPH0744516B2 JP2298448A JP29844890A JPH0744516B2 JP H0744516 B2 JPH0744516 B2 JP H0744516B2 JP 2298448 A JP2298448 A JP 2298448A JP 29844890 A JP29844890 A JP 29844890A JP H0744516 B2 JPH0744516 B2 JP H0744516B2
Authority
JP
Japan
Prior art keywords
data
computer
communication
received
byte
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
JP2298448A
Other languages
Japanese (ja)
Other versions
JPH04170828A (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.)
Subaru Corp
Original Assignee
Fuji Jukogyo KK
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 Fuji Jukogyo KK filed Critical Fuji Jukogyo KK
Priority to JP2298448A priority Critical patent/JPH0744516B2/en
Publication of JPH04170828A publication Critical patent/JPH04170828A/en
Publication of JPH0744516B2 publication Critical patent/JPH0744516B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Information Transfer Systems (AREA)
  • Detection And Prevention Of Errors In Transmission (AREA)

Description

【発明の詳細な説明】 [産業上の利用分野] 本発明は、シリアルチャンネルによって結合された車載
コンピュータ間のデータ通信方法に関する。
The present invention relates to a data communication method between vehicle-mounted computers connected by a serial channel.

[従来の技術] 近年、自動車などの車輌においては、複数のコンピュー
タを搭載するものが多くなり、例えば、特開昭61−4915
4号公報には、第1,第2のマイクロコンピュータを備
え、複数種類の制御項目を分担処理させる技術が開示さ
れている。
[Prior Art] In recent years, many vehicles such as automobiles are equipped with a plurality of computers.
Japanese Patent Laid-Open No. 4 discloses a technique that includes first and second microcomputers and divides and processes a plurality of types of control items.

さらに、複数のコンピュータによる分散処理では、各コ
ンピュータをシリアルチャンネルで結合し、互いに必要
とするデータを直列伝送するものが多く、通常、各コン
ピュータ間では、コマンド、アドレス、メモリへの書込
みデータあるいはメモリからの読込みデータなどが上記
シリアルチャンネルを介して通信される。
Further, in distributed processing by a plurality of computers, there are many cases in which each computer is connected by a serial channel and data required for each other is transmitted serially. Usually, between each computer, a command, an address, write data to a memory or a memory. The read data from the device is communicated via the serial channel.

この場合、コマンドは、読込み、書込み、特殊情報など
の識別のために必要であり、また、情報伝達の信頼性を
確保するため、各コンピュータで通信したデータが正常
か否かをチェックする必要がある。
In this case, the command is necessary for reading, writing, identifying special information, etc., and it is necessary to check whether or not the data transmitted by each computer is normal in order to ensure the reliability of information transmission. is there.

なお、特開昭55−1766号公報(第1の先行例)には、送
信側から受信側にデータを送信するに際し、複数のデー
タにより1つの通信ブロックを構成し、各通信ブロック
間に、送受すべきデータの区切りを表す区切り信号を設
け、受信側で区切り信号により送信側から送信されてき
たデータの区切りを認識する技術が開示されている。
In addition, in Japanese Patent Laid-Open No. 55-1766 (first prior art example), when transmitting data from a transmitting side to a receiving side, one communication block is composed of a plurality of data, and between each communication block, A technique has been disclosed in which a delimiter signal indicating a delimiter of data to be transmitted / received is provided, and the delimiter signal is used at the receiving side to recognize the delimiter of the data transmitted from the transmitting side.

また、特開昭63−138826号公報(第2の先行例)には、
送信側装置から複数の機器を有する受信側装置へデータ
を送信するデータ伝送方式に関し、送信側装置から、複
数の機器宛のデータを含む通信ブロックを周期的に受信
側装置に送信し、受信側装置では、今回受信した通信ブ
ロック中の各機器宛のデータを前回受信した通信ブロッ
ク中の同一機器宛のデータと比較し、両データが一致し
たときには該データの宛先の機器で有効なデータとして
扱い、不一致のデータについては廃棄することで、デー
タの比較という簡単な処理で誤りの検出を可能とし、あ
る機器宛のデータに誤りがあっても他の機器宛のデータ
を有効として扱うことができるようにした技術が開示さ
れている。
Further, Japanese Patent Application Laid-Open No. 63-138826 (second prior art example) discloses that
Regarding a data transmission method for transmitting data from a transmission side device to a reception side device having a plurality of devices, a transmission side device periodically transmits a communication block including data addressed to a plurality of devices to a reception side device, and a reception side device. The device compares the data addressed to each device in the communication block received this time with the data addressed to the same device in the communication block received last time, and when both data match, treats as valid data in the device of the destination of the data. By discarding mismatched data, it is possible to detect errors with a simple process of comparing data, and even if there is an error in data addressed to one device, data addressed to another device can be treated as valid. Such a technique is disclosed.

[発明が解決しようとする課題] しかしながら、各コンピュータ間の通信をソフトウエア
で制御する場合、コンピュータの能力如何によっては通
信密度を高くすることは困難であり、例えば、1バイト
のデータ送信毎にチェックデータをエコーバックするよ
うな方法を採用すると実質上の情報転送速度が低下して
しまい、リアルタイム性に欠けるという問題がある。
[Problems to be Solved by the Invention] However, when controlling communication between computers by software, it is difficult to increase the communication density depending on the capabilities of the computers. For example, for each 1-byte data transmission If a method such as echoing back the check data is adopted, the information transfer rate is substantially reduced, and there is a problem that the real-time property is lacking.

また、上記第1の先行例では、データの区切りを認識さ
せるための区切り信号を、同期信号およびデータ信号よ
りも長い期間のHレベル信号とし、これを受信側で認識
するようにしており、受信側で通信ブロックにおける最
初のデータを認識させるために特別な区切り信号を付加
する必要がある。さらに、その目的を達成するための手
段として、同期信号およびデータ信号よりも長い特別な
Hレベル信号を区切り信号として用いており、そのた
め、データ送信側では、発振回路からの信号を分周する
ためのバイナリカウンタ、ワンショットマルチバイブレ
ータ、複数のゲート回路等の付加回路を必要とし、ま
た、データ受信側では区切り信号を認識するために、リ
トリガワンショットマルチバイブレータ、ワンショット
マルチバイブレータ、分周出力を得るためのビットカウ
ンタ等の付加回路を必要とし、これらの付加回路を必要
とする分、制御系のハードウェア構成が複雑化し、且つ
コスストアップを招く不都合がある。
Further, in the first prior art example described above, the delimiter signal for recognizing the delimiter of the data is the H level signal having a longer period than the synchronizing signal and the data signal, and the receiving side recognizes this. It is necessary for the side to add a special delimiter signal in order to recognize the first data in the communication block. Further, as a means for achieving the purpose, a special H-level signal longer than the synchronization signal and the data signal is used as a delimiter signal. Therefore, the data transmission side divides the frequency of the signal from the oscillation circuit. Need additional circuits such as binary counter, one-shot multi-vibrator, multiple gate circuits, etc. Also, in order to recognize the delimiter signal on the data receiving side, re-trigger one-shot multi-vibrator, one-shot multi-vibrator, frequency division output Since additional circuits such as a bit counter for obtaining the above are required, and these additional circuits are required, the hardware configuration of the control system becomes complicated and the cost is increased.

また、第2の先行例では、各通信ブロック間の特定デー
タの比較によりデータの有効性を判断するようにしてお
り、車輌搭載のコンピュータ間のデータ通信に用いるこ
とは困難である。
Further, in the second prior art example, the validity of the data is judged by comparing the specific data between the respective communication blocks, and it is difficult to use it for the data communication between the computers mounted on the vehicle.

すなわち、車輌に搭載されるコンピュータにおいては、
時々刻々と変化するエンジン運転状態をセンサにより検
出し、センサからの信号をコンピュータに入力して演算
処理することでエンジン運転状態等のデータを得、この
データに基づきアクチュエータに対する制御量を演算し
た後、この制御量に対応する信号をアクチュエータに出
力してエンジン制御等を行っている。従って、車載の第
1のコンピュータと第2のコンピュータとをシリアルチ
ャネルで結合して双方向通信を行うものにおいては、第
1のコンピュータからの読出し要求のデータを第2のコ
ンピュータへ送信すると、第2のコンピュータで読出し
要求に応じたデータを読出して第1のコンピュータへ返
信されるデータは、上述の時々刻々と変化するエンジン
運転状態等のデータ、あるいは、これに対応して時々刻
々と変化する制御量データとなり、各通信ブロック間の
データが常時変化するため、各通信ブロック間の特定デ
ータの比較によりデータの有効性を判断するようにした
場合には、データが一致する頻度が極めて低く、通信が
正常に行われているにも拘らず、データが棄却されてし
まい、制御性が著しく悪化してしまう。
That is, in the computer mounted on the vehicle,
After detecting the engine operating state that changes from moment to moment with a sensor, inputting the signal from the sensor to the computer and processing it to obtain data such as the engine operating state, and after calculating the control amount for the actuator based on this data A signal corresponding to this control amount is output to the actuator to control the engine. Therefore, in the case where the first computer and the second computer mounted on the vehicle are connected through the serial channel to perform the bidirectional communication, when the data of the read request from the first computer is transmitted to the second computer, The data read out by the second computer in response to the read request and returned to the first computer is the above-mentioned data such as the engine operating state which changes momentarily, or the data which changes momentarily correspondingly. Since it becomes control amount data and the data between each communication block constantly changes, if the validity of the data is judged by comparing the specific data between each communication block, the frequency of matching the data is extremely low, Despite the normal communication, the data is rejected and the controllability deteriorates significantly.

本発明は上記事情に鑑み、シリアルチャンネルで結合し
た複数のコンピュータ間でデータ通信を行う際に、デー
タ伝達効率の向上を図り、且つ、データの信頼性を確保
することのできる車載コンピュータ間のデータ通信方法
を提供することを目的とする。
In view of the above circumstances, the present invention aims to improve the data transmission efficiency when performing data communication between a plurality of computers connected by serial channels, and to ensure the reliability of data. It is intended to provide a communication method.

[課題を解決するための手段] 上記目的を達成するため、本発明による第1の車載コン
ピュータ間のデータ通信方法は、車輌に搭載された第1
のコンピュータと第2のコンピュータとをシリアルチャ
ンネルで結合し、双方向通信を行う車載コンピュータ間
のデータ通信方法において、上記第1のコンピュータか
ら上記第2のコンピュータへデータを送信するに際し、
上記第1のコンピュータでは、バイトサイクルが同一周
期の複数のデータにより1つの通信ブロックを構成する
とともに、各通信ブロックの間に上記周期よりも長い非
通信状態のブランク区間を設けて、上記第2のコンピュ
ータへ送信し、上記第2のコンピュータにおいて上記第
1のコンピュータからのデータ受信毎に、上記第1のコ
ンピュータからの送信データの受信間隔と、1つのデー
タのバイトサイクルよりも長く上記ブランク区間を識別
可能な予め設定された設定値とを比較し、この設定値よ
りも上記受信間隔が長いとき、今回受信したデータを先
頭の第1バイトのデータ受信であると識別することを特
徴とする。
[Means for Solving the Problems] In order to achieve the above-mentioned object, a first data communication method between on-vehicle computers according to the present invention is a first data communication method mounted on a vehicle.
In a data communication method between an in-vehicle computer for connecting a computer and a second computer via a serial channel to perform bidirectional communication, when transmitting data from the first computer to the second computer,
In the first computer, a single communication block is configured by a plurality of data whose byte cycle is the same cycle, and a blank section in a non-communication state longer than the cycle is provided between the communication blocks, and the second computer is used. Every time data is received from the first computer in the second computer, the blank interval is longer than the reception interval of the transmission data from the first computer and a byte cycle of one data. Is compared with a preset set value that can be identified, and when the reception interval is longer than this set value, the data received this time is identified as data reception of the first byte at the beginning. .

また、本発明による第2の車載コンピュータ間のデータ
通信方法は、上記第1の車載コンピュータ間のデータ通
信方法において、上記第1のコンピュータから読出し要
求のデータを上記第2のコンピュータへ送信し、上記第
2のコンピュータで上記読出し要求に応じてデータを読
出し該データを上記第1のコンピュータへ送信するに際
し、上記第1のコンピュータでは、1つの通信ブロック
を3つの同一データとして上記第2のコンピュータへデ
ータ読出しのコマンドを含む同一のデータを3回送信
し、上記第2のコンピュータでは、上記第1のコンピュ
ータからデータ読出しのコマンドを含むデータを最初に
受信したとき、このデータの内容に応じてメモリから第
1のデータを読出し、次に、同じデータを2回目に受信
したとき、上記第1のデータを上記第1のコンピュータ
へ送信するとともに、2回目に受信したデータの内容に
応じてメモリから第2のデータを読出し、さらに同じデ
ータを3回目に受信したとき、上記第2のデータを上記
第1のコンピュータへ送信し、上記第1のコンピュータ
において、2回目のデータ送信後に上記第2のコンピュ
ータから送信された上記第1のデータを保持し、3回目
のデータ送信後、上記第1のデータと上記第2のコンピ
ュータから送信された上記第2のデータとを比較し、両
データが一致するときのみ、上記第2のコンピュータか
ら読出されたデータを有効と判断して、このデータをメ
モリのデータエリアにストアし、両データが相違すると
き、通信異常と判断して異常を生じたことを記録するこ
とを特徴とする。
A second data communication method between vehicle-mounted computers according to the present invention is the data communication method between the first vehicle-mounted computers, wherein data of a read request is transmitted from the first computer to the second computer. When the second computer reads the data in response to the read request and transmits the data to the first computer, the first computer treats one communication block as three identical data and the second computer. To the second computer, the same data including the data read command is transmitted three times, and when the second computer first receives the data including the data read command from the first computer, the second computer responds to the contents of the data. When the first data is read from the memory and then the same data is received a second time, the first data When the data is transmitted to the first computer, the second data is read from the memory according to the content of the data received the second time, and the same data is received the third time, the second data is transferred to the first computer. The first computer transmits the data, the first computer holds the first data transmitted from the second computer after the second data transmission, and holds the first data after the third data transmission. The data is compared with the second data transmitted from the second computer, and only when the two data match, the data read from the second computer is judged to be valid, and this data is stored in the memory. The data is stored in the data area, and when the two data are different from each other, it is determined that the communication is abnormal and the occurrence of the abnormality is recorded.

また、本発明による第3の車載コンピュータ間のデータ
通信方法は、車輌に搭載された第1のコンピュータと第
2のコンピュータとをシリアルチャンネルで結合して双
方向通信を行い、上記第1のコンピュータから上記第2
のコンピュータへ、書込むべきデータあるいはベースア
ドレスを設定するデータを送信し、上記第2のコンピュ
ータにデータの書込みを行わせ、あるいはベースアドレ
スを設定させる車載コンピュータ間のデータ通信方法に
おいて、上記第1のコンピュータでは、上記第2のコン
ピュータへ同一のデータを2回送信し、最初のデータ送
信時、該データを保持するとともに上記第2のコンピュ
ータへ該データを送信し、2回目のデータ送信後に上記
第2のコンピュータから返信される第1のデータと保持
したデータとを比較し、両データが一致するとき通信正
常と判断して再度同じデータを3回目のデータとして上
記第2のコンピュータへ送信し、両データが相違すると
き通信異常と判断して、送信値の全ビットを反転したチ
ェックデータを3回目のデータとして上記第2のコンピ
ュータへ送信するとともに、異常が生じたことを記録
し、上記第2のコンピュータでは、上記第1のコンピュ
ータから最初のデータを受信したとき、該受信データを
第1のデータとし、次に同じデータを2回目に受信した
とき、上記第1のデータを上記第1のコンピュータへ送
信するとともに、2回目に受信したデータを第2のデー
タとし、3回目のデータを受信したときには、該受信デ
ータと上記第2のデータとを比較し、両データが一致す
るとき通信正常と判断して該受信データをメモリに書込
み、あるいは該受信データに基づきベースアドレスを設
定し、両データが相違するときには通信異常と判断し
て、データを棄却することを特徴とする。
According to a third data communication method between vehicle-mounted computers according to the present invention, the first computer and the second computer mounted on the vehicle are connected by a serial channel to perform two-way communication, and the first computer is used. From above second
The data to be written or the data for setting the base address to cause the second computer to write the data, or to set the base address. The computer transmits the same data twice to the second computer, holds the data at the time of the first data transmission, transmits the data to the second computer, and transmits the data after the second data transmission. The first data sent back from the second computer is compared with the held data, and when both data match, it is determined that the communication is normal and the same data is sent again as the third data to the second computer. , If both data are different, it is judged that there is a communication error and the check data obtained by inverting all bits of the transmission value is 3 When the first computer receives the first data from the first computer, the second computer records the occurrence of an abnormality while transmitting it as eye data to the second computer. Then, when the same data is received the second time, the first data is transmitted to the first computer and the second data is used as the second data. When received, the received data is compared with the second data, and when the two data match, it is determined that the communication is normal and the received data is written in the memory, or the base address is set based on the received data. When the two data are different, it is judged that the communication is abnormal and the data is discarded.

[作用] 上記第1の車載コンピュータ間のデータ通信方法では、
第1のコンピュータで、バイトサイクルが同一周期の複
数のデータにより1つの通信ブロックを構成し、各通信
ブロック間に各データの周期よりも長い非通信状態のブ
ランク区間を設けて第2のコンピュータへデータを送信
し、第2のコンピュータでデータ受信毎に、受信間隔と
非通信状態の上記ブランク区間を識別可能な予め設定さ
れた設定値との比較を行い、受信間隔が設定値よりも長
いとき、今回受信したデータを先頭の第1バイトのデー
タ受信と識別する。
[Operation] In the data communication method between the first vehicle-mounted computers,
In the first computer, one communication block is configured by a plurality of data whose byte cycle is the same cycle, and a blank section in a non-communication state longer than the cycle of each data is provided between each communication block When data is transmitted and the second computer receives the data every time the data is received, the reception interval is compared with a preset value capable of identifying the blank section in the non-communication state, and the reception interval is longer than the set value. , The data received this time is identified as the first byte of data received.

また、第2の車載コンピュータ間のデータ通信方法で
は、第1のコンピュータから読出し要求のデータを第2
のコンピュータへ送信し、第2のコンピュータで読出し
要求に応じたデータを読出して第1のコンピュータへ送
信し、第1のコンピュータで第2のコンピュータからの
データを読込むに際し、第1のコンピュータから読出し
要求のコマンドを含む同一の3つのデータを1つの通信
ブロックとして第2のコンピュータへ送信すると、第2
のコンピュータでは、最初のデータ受信時に、および2
回目のデータ受信時に、対応するデータをそれぞれメモ
リから読出して第1のデータ、第2のデータとして次の
データ受信時に第1のコンピュータへ送信する。そし
て、第1のコンピュータにおいては、受信された第2の
コンピュータからの第1のデータと第2のデータとを比
較し、1つの通信ブロック中において両データが一致る
ときのみ、第2のコンピュータら読出されたデータを有
効と判断して、このデータをメモリのデータエリアにス
トアする。また、第1のコンピュータでは、1つの通信
ブロック中において、第2のコンピュータから送信され
てきた第1のデータと第2のデータが相違するとき、通
信異常と判断して異常が生じたことを記録する。
Further, in the second data communication method between the in-vehicle computers, the read request data is transmitted from the first computer to the second computer.
To the computer, the second computer reads the data in response to the read request, transmits the data to the first computer, and the first computer reads the data from the second computer. When the same three pieces of data including the read request command are transmitted to the second computer as one communication block, the second
Computer, at the first data reception, and 2
At the time of the first data reception, the corresponding data is read from the memory and transmitted as the first data and the second data to the first computer at the next data reception. Then, the first computer compares the received first data from the second computer with the second data, and only when the two data match in one communication block, the second computer The data read from the memory is judged to be valid, and this data is stored in the data area of the memory. In the first computer, when the first data and the second data transmitted from the second computer are different from each other in one communication block, it is determined that the communication is abnormal and the abnormality is generated. Record.

また、第3の車載コンピュータ間のデータ通信方法で
は、第1のコンピュータから第2のコンピュータへ書込
むべきデータ、あるいはベースアドレスを設定するデー
タを送信し、第2のコンピュータにデータの書込み、あ
るいはベースアドレスの設定を行わせるに際し、第1の
コンピュータから同一のデータを第2のコンピュータへ
連続して2回送信し、第2のコンピュータでは、最初の
データ受信時、および2回目のデータ受信時に、受信し
たデータをそれぞれ第1のデータ、第2のデータとす
る。そして、第1のコンピュータにおいて、1回目に送
信したデータの保持値と、2回目のデータ送信後に第2
のコンピュータから返信された第1のデータとの比較を
行い、両データが一致するとき通信正常と判断して再度
同じデータを3回目のデータとして第2のコンピュータ
へ送信し、両データが相違するときには通信異常と判断
して、通信異常が生じたことを記録すると共に、送信値
へ全ビットを反転したチェックデータを第2のコンピュ
ータへ送信する。第2のコンピュータでは、第1のコン
ピュータからの3回目のデータを受信したとき、該受信
データと第2のデータとの比較を行い、第1のコンピュ
ータで通信正常と判断されているときには、3回目のデ
ータが同じデータとして送信されてくることから両デー
タが一致して通信正常と判断し、該受信データをメモリ
に書込み、あるいは該受信データに基づきベースアドレ
スを設定し、また、第1のコンピュータにおいて通信異
常と判断されているときには、3回目のデータとして全
ビットを反転したチェックデータが送信されてくること
から、両データが不一致となり、通信異常と判断してデ
ータの書込み、あるいはベースアドレスの設定を行うこ
となくデータを棄却する。
In the third data communication method between in-vehicle computers, data to be written to the second computer or data for setting a base address is transmitted from the first computer to write data to the second computer, or When setting the base address, the same data is continuously transmitted from the first computer to the second computer twice, and the second computer receives the first data and the second data at the second computer. , The received data is referred to as first data and second data, respectively. Then, in the first computer, the holding value of the data transmitted the first time and the second value after the data transmission of the second time are performed.
The first data returned from the computer is compared, and when the two data match, it is determined that the communication is normal, and the same data is again transmitted to the second computer as the third data, and the two data are different. Occasionally, it is determined that the communication is abnormal, the occurrence of the communication abnormality is recorded, and the check data in which all bits are inverted to the transmission value is transmitted to the second computer. When the second computer receives the third data from the first computer, the second computer compares the received data with the second data, and when the first computer determines that the communication is normal, the third computer compares the received data with the second data. Since the second data is transmitted as the same data, both data match and it is determined that the communication is normal, and the received data is written to the memory, or the base address is set based on the received data. When the computer determines that there is a communication error, the check data with all bits inverted is sent as the third data, so both data do not match, and it is determined that there is a communication error and the data is written or the base address is determined. Data is rejected without setting.

[発明の実施例] 以下、図面を参照して本発明の実施例を説明する。Embodiments of the Invention Embodiments of the present invention will be described below with reference to the drawings.

図面は本発明の一実施例を示し、第1図はメインコンピ
ュータの通信手順を示すフローチャート、第2図はサブ
コンピュータの通信手順を示すフローチャート、第3図
は制御装置の回路ブロック図、第4図はクロック同期通
信のタイムチャート、第5図は通信ブロックの構成を示
す説明図である。
The drawings show an embodiment of the present invention, FIG. 1 is a flowchart showing a communication procedure of a main computer, FIG. 2 is a flowchart showing a communication procedure of a sub computer, FIG. 3 is a circuit block diagram of a control device, and FIG. FIG. 5 is a time chart of clock synchronous communication, and FIG. 5 is an explanatory diagram showing the structure of a communication block.

第3図において、符号1は自動車などの車輌に搭載され
る制御装置(ECU)であり、このECU1には、第1のコン
ピュータとしてのメインコンピュータ1a及び第2のコン
ピュータとしてのサブコンピュータ1bの2つのマイクロ
コンピュータが内蔵され、さらに、駆動回路1cなどの周
辺回路が内蔵されている。
In FIG. 3, reference numeral 1 is a control unit (ECU) mounted in a vehicle such as an automobile. The ECU 1 includes a main computer 1a as a first computer and a sub computer 1b as a second computer. Two microcomputers are built in, and further peripheral circuits such as the drive circuit 1c are built in.

上記メインコンピュータ1aは、例えば8ビットのメイン
CPU10、ROM11、RAM12、I/Oインターフェイス13、シリア
ルインターフェイス(SCI)14、及び、タイマ15がバス
ライン16を介して接続され、また、上記サブコンピュー
タ1bは、例えば8ビットのサブCPU20、ROM21、RAM22、I
/Oインターフェイス23、シリアルインターフェイス(SC
I)24、及び、タイマ25がバスライン26を介して接続さ
れている。
The main computer 1a is, for example, an 8-bit main computer.
A CPU 10, a ROM 11, a RAM 12, an I / O interface 13, a serial interface (SCI) 14, and a timer 15 are connected via a bus line 16, and the sub computer 1b has, for example, an 8-bit sub CPU 20, ROM 21, RAM22, I
/ O interface 23, serial interface (SC
I) 24 and the timer 25 are connected via a bus line 26.

そして、上記メインコンピュータ1aのI/Oインターフェ
イス13では、入力ポートに運転状態を検出するセンサ・
スイッチ類30が接続されるとともに、出力ポートに駆動
回路1cを介してインジェクタ、点火コイルなどのアクチ
ュエータ類31が接続され、一方、上記サブコンピュータ
1bのI/Oインターフェイス23では、入力ポートにノック
センサ32が接続されている。
Then, in the I / O interface 13 of the main computer 1a, a sensor for detecting an operating state is input to the input port.
The switches 30 are connected, and the actuators 31 such as injectors and ignition coils are connected to the output port via the drive circuit 1c.
In the I / O interface 23 of 1b, the knock sensor 32 is connected to the input port.

上記ROM11には、燃料噴射制御、点火時期制御などのエ
ンジン制御プログラム、サブコンピュータ1bとのデータ
通信のための通信プログラム、および、制御用固定デー
タ類が記憶されており、一方、上記ROM21には、ノック
検出処理プログラム及びメインコンピュータ1aとのデー
タ通信のための通信プログラムが記憶されている。
The ROM 11 stores an engine control program such as fuel injection control, ignition timing control, a communication program for data communication with the sub computer 1b, and fixed control data, while the ROM 21 stores the ROM 21. A knock detection processing program and a communication program for data communication with the main computer 1a are stored.

上記メインCPU10では、システム起動時、点火時期マッ
プなどの固定データをSCI14を介してサブコンピュータ1
bに転送し、次いで、上記センサ・スイッチ類30からの
エンジン運転状態パラメータに基づいて点火時期、燃料
噴射パルス幅などを演算してアクチュエータ類31に出力
するとともに、上記サブコンピュータ4bへ点火時期など
のエンジンコントロール情報を送信する。
At the time of system startup, the main CPU 10 sends fixed data such as an ignition timing map to the sub computer 1 via the SCI 14.
Then, the ignition timing, the fuel injection pulse width and the like are calculated based on the engine operating state parameters from the sensors and switches 30 and output to the actuators 31, and the ignition timing and the like to the sub computer 4b. Send engine control information of.

上記サブCPU20では、上記メインコンピュータ1aからの
エンジンコントロール情報をSCI24を介して受信し、ノ
ックセンサ32からの信号を処理してメインコンピュータ
1aに送信する。その結果、ノック発生の場合には、メイ
ンコンピュータ1aは点火時期を遅角補正してノックを解
消させ、常に適切な状態にエンジンを制御する。
The sub CPU 20 receives the engine control information from the main computer 1a via the SCI 24 and processes the signal from the knock sensor 32 to process the main computer.
Send to 1a. As a result, if a knock occurs, the main computer 1a retards the ignition timing to eliminate the knock, and always controls the engine to an appropriate state.

上記SCI14,24は、クロック信号CLK、送信信号TX、及
び、受信信号RXの各ラインで互いに接続され、上記メイ
ンコンピュータ1aのタイマ15から供給される上記クロッ
ク信号CLKに同期して上記メインコンピュータ1aとサブ
コンピュータ1bとの間でクロック同期式の全二重双方向
通信が行われる。
The SCIs 14 and 24 are connected to each other by respective lines of a clock signal CLK, a transmission signal TX, and a reception signal RX, and the main computer 1a is synchronized with the clock signal CLK supplied from the timer 15 of the main computer 1a. And the sub-computer 1b perform clock-synchronized full-duplex bidirectional communication.

このクロック同期式通信においては、第4図に示すよう
に、送信されたデータDATAのLSB(ビット0)からMSB
(ビット7)までの各ビットが、上記クロック信号CLK
の立上がりのタイミングでストローブされる。
In this clock synchronous communication, as shown in FIG. 4, the LSB (bit 0) of the transmitted data DATA is changed to the MSB.
Each bit up to (bit 7) is the clock signal CLK
Strobe at the rising edge of.

次に、ECU1における各コンピュータ1a,1b間の通信手順
について説明する。
Next, a communication procedure between the computers 1a and 1b in the ECU 1 will be described.

メインコンピュータ1aとサブコンピュータ1bとの間のデ
ータ通信においては、第5図に示すように、DATA1,DATA
2,DATA3からなる3バイトのデータを1ブロックとし
て、周期T(例えば、T=4ms)のバイトサイクルの通
信が行われ、この1ブロックの通信ブロックT XBに続け
て非通信状態であるブランク区間T BLANKをおき、この
ブランク区間T BLANKにより先頭データである第1バイ
トデータDATA1を検出する。
In data communication between the main computer 1a and the sub computer 1b, as shown in FIG. 5, DATA1, DATA
A 3-byte data composed of 2, DATA3 is used as one block, and communication of a byte cycle with a cycle T (for example, T = 4 ms) is performed. Following this one block of communication block T XB, a blank section in a non-communication state T BLANK is set, and the first byte data DATA1 which is the head data is detected by this blank section T BLANK.

この先頭データにおいては、通信モードを指示するコマ
ンドC OMが上位2ビットによって示され、このコマンド
C OMは、例えば、以下の示すような体系となっている。
In this head data, the command C OM that indicates the communication mode is indicated by the upper 2 bits.
The C OM has the following system, for example.

01……ライトモード (メインコンピュータ1aからサブコンピュータ1bへのデ
ータ書込み) 10……リードモード (サブコンピュータ1bからメインコンピュータ1aへのデ
ータ読出し) 11……ベースアドレスモード (後述するベースアドレスの設定) 第2バイト以降のデータ通信は、第1バイトのデータ通
信のタイミングでサブコンピュータ1bから通信可能のコ
ードが返信されたとき開始され、各モードに応じ、以下
のように動作する。
01 …… Write mode (writing data from main computer 1a to sub computer 1b) 10 …… Read mode (reading data from sub computer 1b to main computer 1a) 11 …… Base address mode (setting of base address described later) The data communication from the second byte onward is started when the communicable code is returned from the sub computer 1b at the timing of the data communication of the first byte, and operates as follows according to each mode.

(ライトモード及びベースアドレスモード) メインコンピュータ1aから第2バイト目の書込みデータ
を送信すると、サブコンピュータ1bから第1バイト目で
受信した値が第1のデータとして返信される。メインコ
ンピュータ1aでは、第1バイト送信値と第2バイト目で
のサブコンピュータ1bからの返信値(第1のデータ)と
の一致をとることにより、第1バイト送信値がサブコン
ピュータ1bで正常に受信されたか否かを確認でき、通信
が正常のとき第3バイト送信値を第2バイト送信値と同
一のデータとし、通信が異常のとき第3バイト送信値を
第2バイト送信値の全ビットを反転したチェックデータ
として送信する。
(Write Mode and Base Address Mode) When the write data of the second byte is transmitted from the main computer 1a, the value received in the first byte of the sub computer 1b is returned as the first data. In the main computer 1a, by matching the first byte transmission value and the reply value (first data) from the sub computer 1b at the second byte, the first byte transmission value is normally stored in the sub computer 1b. It is possible to confirm whether or not it has been received. When the communication is normal, the third byte transmission value is the same data as the second byte transmission value, and when the communication is abnormal, the third byte transmission value is all the bits of the second byte transmission value. Is transmitted as inverted check data.

一方、サブコンピュータ1bでは、第2のデータとしての
第2バイト受信値と第3バイト受信値との一致をとるこ
とにより、第1バイトから第3バイトまでの受信値が正
常か否かを判別でき、異常の場合には受信データの書込
みを中止する。
On the other hand, the sub-computer 1b determines whether the received value from the first byte to the third byte is normal by matching the second byte received value and the third byte received value as the second data. If it is possible and abnormal, writing of the received data is stopped.

(リードモード) メインコンピュータ1aからは、第1バイトから第3バイ
トまでコマンドC OM含む同一データを送信し、一方、サ
ブコンピュータ1bは、第2バイトで読出しデータを第1
のデータとして返信し、さらに、同一の読出しデータを
第2のデータとして第3バイトで返信する。
(Read mode) The main computer 1a sends the same data including the command C OM from the first byte to the third byte, while the sub computer 1b sends the read data with the first byte in the first byte.
No., and the same read data is returned as second data in the third byte.

メインコンピュータ1aでは、サブコンピュータ1bからの
第2バイト受信値(第1のデータ)と第3バイト受信値
(第2のデータ)との一致により、読出しデータが正常
か否かを判別できる。
In the main computer 1a, it is possible to determine whether the read data is normal or not based on the match between the second byte reception value (first data) and the third byte reception value (second data) from the sub computer 1b.

以下、第1図及び第2図のフローチャートに従って各コ
ンピュータ1a、1bの通信手順を具体的に説明する。
The communication procedure of each computer 1a, 1b will be specifically described below with reference to the flowcharts of FIGS.

(メインコンピュータ1aの通信手順) 第1図のフローチャートは、バイトサイクルの周期T毎
に起動されるメインコンピュータ1aの通信ルーチンであ
り、最初のステップS101は、送信カウンタのカウント値
M CNTによって条件分岐する多岐選択のステップであ
る。すなわち、1バイト毎の通信に対応して0から1,2,
3へとカウントアップされる送信カウンタのカウント値M
CNTに応じ、ステップS101からステップS102,S104,S11
3,S124へと、それぞれ分岐する。
(Communication Procedure of Main Computer 1a) The flowchart of FIG. 1 is a communication routine of the main computer 1a activated at every cycle T of the byte cycle, and the first step S101 is the count value of the transmission counter.
This is a multi-selection step in which conditional branching is performed by M CNT. That is, 0 to 1,2,
Count value M of the transmission counter that counts up to 3
Depending on CNT, steps S101 to S102, S104, S11
Branch to 3, S124.

まず、上記ステップS101で送信カウンタのカウント値M
CNTが“0"であるときには、通信のブランク区間T BLANK
であり、上記ステップS101からステップS102へ分岐して
通信モードを設定し、次いで、ステップS103へ進んで送
信カウンタをカウントアップし(M CNT←M CNT+1)、
ルーチンを抜ける。
First, in step S101 described above, the count value M of the transmission counter is
When CNT is “0”, the communication blank section T BLANK
Then, the process branches from step S101 to step S102 to set the communication mode, and then proceeds to step S103 to count up the transmission counter (M CNT ← M CNT + 1),
Exit the routine.

そして、次回のルーチンが起動され、ステップS104で送
信カウンタのカウント値M CNTが“1"で先頭データの送
信の場合には、ステップS101からステップS104へ分岐し
て前回設定したモードを判定し、ベースアドレス設定モ
ードのときステップS104からステップS105へ、ライトモ
ードのときステップS104からステップS106へ、リードモ
ードのときステップS104からステップS107へと分岐す
る。
Then, when the next routine is started, and the count value M CNT of the transmission counter is “1” in step S104 and the first data is transmitted, the process branches from step S101 to step S104 to determine the previously set mode, In the base address setting mode, the process branches from step S104 to step S105, in the write mode, from step S104 to step S106, and in the read mode, branches from step S104 to step S107.

まず、ベースアドレス設定モードについて説明すると、
このベースアドレス設定モードにおいては、ステップS1
05で、コマンドC OMの2ビットを上位として、。この上
位2ビットにベースアドレスAD BASEの下位6ビットAD
BASE/Lを加えた1バイトのデータを送信データT XDATA
にセットし(T XDATA←C OM+AD BASE/L)、ステップS1
08へ進む。
First, the base address setting mode will be explained.
In this base address setting mode, step S1
In 05, with 2 bits of command C OM as the high order ,. The upper 2 bits are the lower 6 bits AD of the base address AD BASE
1 byte data including BASE / L is transmitted data T XDATA
Set to (T XDATA ← C OM + AD BASE / L), step S1
Go to 08.

上記ベースアドレスAD BASE、サブCPU20のメモリ空間に
対するアドレス指定の際に予め基準となるアドレスであ
り、ベースアドレスAD BASEの設定以降、1バイト未満
のオフセットアドレスAD OFFSETのみを指定し、実際の
物理アドレスをベースアドレスAD BASEとオフセットア
ドレスAD OFFSETとの論理和で指定することにより、通
信バイト数の低減を図るものである。
The above base address AD BASE is an address that becomes a reference in advance when addressing the memory space of the sub CPU 20. After setting the base address AD BASE, only the offset address AD OFFSET of less than 1 byte is specified, and the actual physical address is specified. Is specified by the logical sum of the base address AD BASE and the offset address AD OFFSET to reduce the number of communication bytes.

すなわち、上記サブコンピュータ1bが8ビットである場
合、そのアドレス空間64Kバイト(16進級で0000〜FFF
F)の指定は、通常バイトのデータを要するが、一旦、
上述のベースアドレスAD BASEを設定すれば、以降は1
バイト未満のオフセットアドレス値AD OFFSETによる論
理アドレスで物理アドレスを指定することができ、通信
バイト数を少なくしてデータ転送の際の効率を向上する
ことができるのである。
That is, when the sub computer 1b has 8 bits, its address space is 64 Kbytes (0000 to FFF in hexadecimal class).
The specification of F) usually requires byte data, but
If the above-mentioned base address AD BASE is set, then 1
The physical address can be specified by the logical address by the offset address value AD OFFSET less than byte, and the number of communication bytes can be reduced to improve the efficiency in data transfer.

一方、上記ステップS104でライトモードのときには、ス
テップS106でコマンドC OMの2ビットにオフセットアド
レスAD OFFSET(6ビット)を加えた1バイトのデータ
を送信データT XDATAにセットして(T XDATA←C OM+AD
OFFSET)ステップS108へ進み、リードモードのときに
は、ステップS107で、同様にコマンドC OMの2ビットに
オフセットアドレスAD OFFSET(6ビット)を加えた1
バイトのデータを送信データT DATAにセットし(T XDAT
A←C OM+AD OFFSET)、ステップS108へ進む。
On the other hand, when the write mode is set in step S104, 1 byte of data obtained by adding the offset address AD OFFSET (6 bits) to 2 bits of the command C OM is set in the transmission data T XDATA in step S106 (T XDATA ← C OM + AD
OFFSET) Proceeds to step S108, and in the read mode, at step S107, similarly, add offset address AD OFFSET (6 bits) to 2 bits of command C OM.
Set byte data to send data T DATA (T XDAT
A ← C OM + AD OFFSET), proceed to step S108.

そして、上記各ステップS105,S106,S107からステップS1
08へ進むと、送信データT XDATAを第11バイトデータDAT
A1として(DATA1←T XDATA)RAM12のワークエリアにス
トアし、ステップS109でSCI14を介してサブコンピュー
タ1bに送信するとともに、サブコンピュータ1bから1バ
イトのデータを受信してステップS109へ進む。
Then, from the above steps S105, S106, S107 to step S1.
When it proceeds to 08, the transmission data T XDATA is changed to the 11th byte data DAT.
The data is stored in the work area of (DATA1 ← T XDATA) RAM12 as A1 and transmitted to the sub computer 1b via SCI14 in step S109, and 1 byte of data is received from the sub computer 1b and the process proceeds to step S109.

ステップS110では、上記ステップS109で受信したサブコ
ンピュータ1bからのデータを調べ、このデータの上位2
ビットが“00"のとき、サブコンピュータ1bは通信可能
の状態と判別してステップS111へ進み、送信カウンタを
カウントアップして(M CNT←M CNT+1)ルーチンを抜
ける。
In step S110, the data from the sub-computer 1b received in step S109 is checked and the upper 2
When the bit is "00", the sub-computer 1b determines that communication is possible, advances to step S111, counts up the transmission counter (MCNT ← MCNT + 1), and exits the routine.

一方、上記ステップS110でサブコンピュータ1bからのデ
ータの上位2ビットが“11"のときには、サブコンピュ
ータ1bは通信不可と判別してステップS112へ分岐し、送
信カウンタをクリアして(M CNT←0)のルーチンを抜
け、次のサイクルをブランクとして、再び第1バイトか
らのデータ通信を行なう。
On the other hand, when the upper 2 bits of the data from the sub computer 1b are "11" in step S110, the sub computer 1b determines that the communication is impossible and branches to step S112 to clear the transmission counter (M CNT ← 0 ), The next cycle is set to blank, and data communication from the first byte is performed again.

次に、再びルーチンが起動され、ステップS101で送信カ
ウンタのカウント値M CNTが“2"、すなわち第2バイト
データDATA2の通信のときには、ステップS113でモード
判定を行ない、ベースアドレス設定モードのとき、ステ
ップS113からステップS114へ進んでベースアドレスAD B
ASEの上位バイトAD BASE/Uを送信データT XDATAにセッ
トし(T XDATA←AD BASE/U)、ステップS116へ進む。
Next, the routine is started again, and when the count value M CNT of the transmission counter is “2” in step S101, that is, when the second byte data DATA2 is communicated, a mode determination is performed in step S113, and in the base address setting mode, The process proceeds from step S113 to step S114 and the base address AD B
The upper byte AD BASE / U of ASE is set to the transmission data T XDATA (T XDATA ← AD BASE / U), and the process proceeds to step S116.

また、上記ステップS113でライトモードのときには、上
記ステップS113からステップS115へ進み、既にアドレス
指定してあるサブコンピュータ1bのメモリに書込むべき
ライトデータW DATAを送信データT XDATAにセットし(T
XDATA←W DATA)、ステップS116へ進む。
When the write mode is set in step S113, the process proceeds from step S113 to step S115, and the write data W DATA to be written in the memory of the already-addressed subcomputer 1b is set in the transmission data T XDATA (T
XDATA ← W DATA), the process proceeds to step S116.

そして、上記ステップS114あるいはステップS15からス
テップS116へ進むと、送信データT XDATAを第2バイト
データDATA2として(DATA←T DATA)RAM12のワークエリ
アにストアし、ステップS117でサブコンピュータ1bに送
信するとともに、サブコンピュータ1bから1バイトのデ
ータを受信してステップS118へ進む。
Then, when the process proceeds from step S114 or step S15 to step S116, the transmission data T XDATA is stored as the second byte data DATA2 in the work area of the RAM 12 (DATA ← T DATA) and is transmitted to the sub computer 1b at step S117. , 1-byte data is received from the sub computer 1b, and the process proceeds to step S118.

ステップS118では、上記ステップS117でサブコンピュー
タ1bから受信したデータR XDATAが、既にサブコンピュ
ータ1bへ送信した第1バイトデータDATA1と一致するか
否かを調べ、R XDATA=DATA1のとき、通信が正常に実行
されたと判定してステップS118からステップS123へジャ
ンプし、上記ステップS118でR XDATA≠DATA1のときに
は、通信が正常に行われず、正しいデータがサブコンピ
ュータ1bにて受信されなかったと判定して上記ステップ
S118からステップS119へ進んでエラーフラグFLAG1をセ
ットし(FLAG1←1)、ステップS123へ進んで送信カウ
ンタをカウントアップし(M CNT←M CNT+1)、ルーチ
ンを抜ける。
In step S118, it is checked whether or not the data R XDATA received from the sub computer 1b in step S117 matches the first byte data DATA1 already transmitted to the sub computer 1b. When R XDATA = DATA1, communication is normal. And jumps from step S118 to step S123, and when R XDATA ≠ DATA1 in step S118, communication is not normally performed, and it is determined that correct data was not received by the sub computer 1b. Step
The process proceeds from step S118 to step S119 to set the error flag FLAG1 (FLAG1 ← 1), then proceeds to step S123 to count up the transmission counter (MCNT ← MCNT + 1) and exit the routine.

すなわち、通信ブロックT XBの先頭データである第1バ
イトデータDATA1がメインコンピュータ1aから送信され
ると、同時にサブコンピュータ1bからメインコンピュー
タ1aに対して受信可能か否かを示すコードが返信され、
通信可能の場合、第2バイトデータDATA2がメインコン
ピュータ1aから通信モードに応じて送信される。サブコ
ンピュータ1bは、メインコンピュータ1aから受信した第
1バイトデータDATA1を、メインコンピュータ1aからの
第2バイトデータDATA2の送信タイミングで返信するた
め、メインコンピュータ1aでは、RAM12のワークエリア
にストアした第1バイトデータDATA1とサブコンピュー
タ1bからの受信データR XDATAとが一致するか否かによ
り、通信が正常に実行されたか否かを判別することがで
きるのである。
That is, when the first byte data DATA1 which is the head data of the communication block T XB is transmitted from the main computer 1a, at the same time, the sub computer 1b returns to the main computer 1a a code indicating whether the data can be received,
When the communication is possible, the second byte data DATA2 is transmitted from the main computer 1a according to the communication mode. The sub computer 1b returns the first byte data DATA1 received from the main computer 1a at the transmission timing of the second byte data DATA2 from the main computer 1a. Therefore, in the main computer 1a, the first byte data stored in the work area of the RAM 12 is stored. Whether or not the communication is normally executed can be determined by whether or not the byte data DATA1 and the received data R XDATA from the sub computer 1b match.

一方、上記ステップS113でリードモードのときには、上
記ステップS113からステップS120へ進み、コマンドC OM
の2ビットにオフセットアドレスAD OFFSET(6ビッ
ト)を加えた1バイトのデータを送信データT XDATAに
セットし(T XDATA←C OM+AD OFFSET)、ステップS121
でサブコンピュータ1bとの送受信を実行する。
On the other hand, in the read mode in step S113, the process proceeds from step S113 to step S120, and the command C OM
1 byte of data, which is the offset address AD OFFSET (6 bits) added to the 2 bits of, is set to the transmission data T XDATA (T XDATA ← C OM + AD OFFSET), and step S121
Send and receive with the sub computer 1b.

このリードモードにおいては、第2バイトの送信データ
T XDATAは、第1バイトデータDATA1と同じデータを送信
し、先にアドレス指定したメモリの内容をサブコンピュ
ータ1bから受信すると、ステップS122で、この受信デー
タR XDATAを第2バイトデータDATA2としてRAM12のワー
クエリアにストアし(DATA2←R XDATA)、ステップS123
で送信カウンタをカウントアップして(M CNT←M CNT+
1)ルーチンを抜ける。
In this read mode, the second byte of transmission data
When T XDATA transmits the same data as the first byte data DATA1 and receives the contents of the previously addressed memory from the sub computer 1b, the received data R XDATA is stored in the RAM 12 as the second byte data DATA2 in step S122. Store in work area (DATA2 ← R XDATA), step S123
Count up the transmission counter with (M CNT ← M CNT +
1) Exit the routine.

さらに、次に通信ルーチンにおいて、ステップS101で送
信カウンタのカウント値M CNTが“3"、すなわち第3バ
イトデータDATA3の送信ときには、ステップS124でモー
ド判定を行ない、ベースアドレス設定モードとき、ステ
ップS124からステップS125へ進んでベースアドレスAD B
ASEの上位バイトAD BASE/Uを送信データT XDATAに再び
セットして(T XDATA←AD BASE/U)ステップS127へ進
み、ライトモードのときには、ステップS124からステッ
プS126へ進んでライトデータW DATAを送信データT XDAT
Aに再びセットし(T XDATA←W DATA)、ステップS127へ
進む。
Further, next, in the communication routine, when the count value M CNT of the transmission counter is “3” in step S101, that is, when the third byte data DATA3 is transmitted, mode determination is performed in step S124, and in the base address setting mode, from step S124. Proceed to step S125, and base address AD B
Set the upper byte AD BASE / U of ASE to the transmission data T XDATA again (T XDATA ← AD BASE / U) and proceed to step S127. In the write mode, proceed from step S124 to step S126 to write data W DATA. Transmission data T XDAT
Set it to A again (TXDATA ← WDATA), and proceed to step S127.

ステップS127では、エラーフラグFLAG1の値により、前
回、通信が正常に行われたか否かを判別し、FLAG1=0
すなわち通信が正常に実行されたときにはステップS129
へジャンプしてサブコンピュータ1bに対する送受信を実
行し、FLAG1=1すなわち通信に異常があったときには
ステップS127からステップS128へ進んで、送信データT
XDATAの全ビットを反転し、ステップS129でサブコンピ
ュータ1bに対する送受信を実行する。つまり、第2バイ
トまでのデータ通信が正常に実行された場合、第3バイ
トデータDATA3は第2バイトデータDATA2と同一のデータ
を送信し、通信が異常の場合、第3バイトデータDATA3
は第2バイトデータDATA2を全ビット反転したデータを
送信するのである。
In step S127, it is determined from the value of the error flag FLAG1 whether communication was normally performed last time, and FLAG1 = 0.
That is, when the communication is executed normally, step S129
Jump to and execute transmission / reception to / from the sub computer 1b, and if FLAG1 = 1, that is, if communication is abnormal, the process proceeds from step S127 to step S128, and the transmission data T
All bits of XDATA are inverted, and transmission / reception to / from the sub computer 1b is executed in step S129. That is, if the data communication up to the second byte is executed normally, the third byte data DATA3 transmits the same data as the second byte data DATA2, and if the communication is abnormal, the third byte data DATA3.
Sends data in which all bits of the second byte data DATA2 are inverted.

次いで、上記ステップS129からステップS130へ進むと、
サブコンピュータ1bから受信したデータR XDATAとサブ
コンピュータ1bに送信した第2バイトデータDATA2とが
一致するか否かにより通信が正常に行われたか否かを判
別する。
Next, when proceeding from step S129 to step S130,
Whether or not the communication is normally performed is determined by whether or not the data R XDATA received from the sub computer 1b and the second byte data DATA2 transmitted to the sub computer 1b match.

通信が正常に行われた場合、サブコンピュータ1bから
は、既に送信した第2バイトデータDATA2と同一のデー
タが返信されるため、上記ステップS130でR XDATA=DAT
A2のときには3バイトのデータの通信が正常に実行され
たと判別でき、上記ステップS130からステップS137へジ
ャンプして送信カウンタをクリアして(M CNT←0)ル
ーチンを抜ける。
If the communication is normally performed, the same data as the already transmitted second byte data DATA2 is returned from the sub computer 1b, so that R XDATA = DAT in the above step S130.
When it is A2, it can be determined that the communication of the 3-byte data has been normally executed, the process jumps from step S130 to step S137 to clear the transmission counter (MCNT ← 0) and exits the routine.

また、上記ステップS130でR XDATA≠DATA2のときには、
通信に異常があるため上記ステップS130からステップS1
31へ進んでエラーフラグFLAG2をセットし(FLAG2←
1)、ステップS137で送信カウンタをクリアして(M CN
T←0)ルーチンを抜ける。
If R XDATA ≠ DATA2 in step S130,
Since there is a communication error, the above steps S130 to S1
Go to step 31 and set the error flag FLAG2 (FLAG2 ←
1) Clear the transmission counter in step S137 (M CN
T ← 0) Exit the routine.

一方、上記ステップS124でリードモードのときには、上
記ステップS124からステップS132へ進んでコマンドC OM
の2ビットにオフセットアドレスAD OFFSET(6ビッ
ト)を加えた1バイトのデータを送信データT XDATAに
セットし(T XDATA←C OM+AD OFFSET)、この送信デー
タT XDATAをステップS133でサブコンピュータ1bに送信
するとともに、サブコンピュータ1bから1バイトのデー
タを受信する。
On the other hand, if the read mode is selected in step S124, the flow advances from step S124 to step S132 to execute the command C OM.
2 bytes of offset address AD OFFSET (6 bits) is added to 1 byte data to transmit data T XDATA (T XDATA ← COM + AD OFFSET), and this transmit data T XDATA is transmitted to sub computer 1b in step S133. At the same time, it receives 1-byte data from the sub computer 1b.

次いで、上記ステップS133からステップS134へ進み、サ
ブコンピュータ1bから受信したデータR XDATAが、既に
サブコンピュータ1bから受信した第2バイトデータDATA
2と一致するか否かを判別する。
Then, the process proceeds from step S133 to step S134, and the data R XDATA received from the sub computer 1b is the second byte data DATA already received from the sub computer 1b.
It is determined whether or not it matches 2.

上記ステップS134でR XDATA=DATA2の場合には、通信が
正常に行われているため、上記ステップS134からステッ
プS135へ進んでサブコンピュータ1bから受信したデータ
R XDATAを確定データとしてRAM12のデータエリアにスト
アし、ステップS137へ進んで送信カウンタをクリアして
(M CNT←0)ルーチンを抜け、R XDATA≠DATA2の場合
には、通信に異常があるため、上記ステップS134からス
テップS136へ進んでエラーフラグFLAG2をセットし(FLA
G2←1)、ステップS137で送信カウンタをクリアして
(M CNT←0)ルーチンを抜ける。
If R XDATA = DATA2 in step S134 above, it means that the communication is normally performed. Therefore, the process proceeds from step S134 to step S135 and the data received from the sub computer 1b is received.
Store R XDATA in the data area of RAM12 as fixed data, go to step S137, clear the transmission counter (M CNT ← 0), and exit the routine. If R XDATA ≠ DATA2, there is a communication error. Then, the process proceeds from step S134 to step S136 to set the error flag FLAG2 (FLA
G2 ← 1), the transmission counter is cleared in step S137 (MCNT ← 0), and the routine exits.

なお、各エラーフラグFLAG1,FLAG2のクリアは、別ルー
チンでエラーチェックを行いクリアする。
The error flags FLAG1 and FLAG2 are cleared by performing an error check in another routine.

(サブコンピュータ1bの通信手順) 一方、サブコンピュータ1bにおいては、メインコンピュ
ータ1aからのデータ受信毎に第2図に示す通信ルーチン
が起動され、まず、ステップS201で受信間隔を時間変数
TRにセットし(TR←受信間隔)、次いで、この時間変動
TRと設定値T SETとをステップS202で比較する。
(Communication procedure of the sub computer 1b) On the other hand, in the sub computer 1b, the communication routine shown in FIG. 2 is started each time data is received from the main computer 1a.
Set to TR (TR ← reception interval), then this time fluctuation
In step S202, TR is compared with the set value T SET.

この設定値T SETは、1ロックのデータの通信における
バイトサイクルの周期T(例えば、T=4ms)よりも長
く、通信ブロックT XB間のブランク区間T BLANKを識別
可能な値(例えば、T SET=6ms)に設定されており、上
記ステップS202で、TR>T SETのときには、受信間隔が
通常のバイトサイクルの周期Tよりも長く、ブランク区
間T BLANKを経て初めてのデータ受信すなわち先頭の第
1バイトのデータ受信であると判別でき、ステップS203
で受信カウンタのカウント値S CNTをクリアする(S CNT
←0)。
This set value T SET is longer than the cycle T (for example, T = 4 ms) of the byte cycle in the communication of one lock data, and is a value that can identify the blank section T BLANK between the communication blocks T XB (for example, T SET = 6 ms), and when TR> T SET in the above step S202, the reception interval is longer than the cycle T of the normal byte cycle, and the first data reception after the blank section T BLANK, that is, the first It can be determined that the byte data has been received, and step S203
To clear the count value S CNT of the reception counter (S CNT
← 0).

すなわち、通信開始に際しての先頭データを識別するた
めに、特別なデータを要することなく、通信に要するバ
イト数を必要最小限として、データ転送効率を向上する
ことができるのである。
In other words, the number of bytes required for communication can be minimized to improve the data transfer efficiency without requiring special data in order to identify the leading data at the start of communication.

尚、このときのメインコンピュータ1aからの先頭データ
の送信タイミングでは、後述する受信許可コードSCを返
信してサブコンピュータ1bが通信可能状態か否かをメイ
ンコンピュータ1aに知らせ、通信可能のときメインコン
ピュータ1aとの2バイト目以降のデータ通信が開始され
る。
At the transmission timing of the head data from the main computer 1a at this time, a reception permission code SC described later is sent back to inform the main computer 1a whether or not the sub computer 1b is in the communicable state. The data communication of the second byte onward with 1a is started.

そして、上記ステップS203からステップS204へ進むと、
受信データR XDATAの上位2ビット(R XDATA)B7B6、す
なわちコマンドC OMを解釈し、(R XDATA)B7B6=11、
すなわちベースアドレスモードを指示するコマンドC OM
のときには、上記ステップS204からステップS205へ進ん
でベースアドレスモードに設定してステップS207へ進
み、(R XDATA)B7B6=01、すなわちライトモードを指
示するコマンドC OMのときには、上記ステップS204から
ステップS206へ進んでライトモードに設定してステップ
S27へ進む。
Then, when proceeding from step S203 to step S204,
Interpret the upper 2 bits (R XDATA) B7B6 of the received data R XDATA, that is, the command C OM, and (R XDATA) B7B6 = 11,
That is, the command C OM for instructing the base address mode
In the case of, the process proceeds from step S204 to step S205 to set the base address mode and proceeds to step S207, and when (R XDATA) B7B6 = 01, that is, the command C OM for instructing the write mode, the process proceeds from step S204 to step S206. Go to and set to light mode and step
Proceed to S27.

そして、上記ステップS205あるいはステップS206からス
テップS207へ進むと、受信データR XATAを第1バイト目
のデータDATA1としてRAM22のワークエリアにストアし
(DATA1←R XDATA)、ステップS208で受信データR XDAT
Aをメインコンピュータ1aへの返信データ(サブコンピ
ュータ1bからの送信データ)T XDATAにセットし(T XDA
TA←R XDATA)、ステップS222へ進んで受信カウンタの
カウント値S CNTをカウントアップし(S CNT←S CNT+
1)、ルーチンを抜ける。
When the process proceeds from step S205 or step S206 to step S207, the received data R XATA is stored in the work area of the RAM 22 as the first byte data DATA1 (DATA1 ← R XDATA), and the received data R XDAT is received in step S208.
Set A to the reply data to the main computer 1a (transmission data from the sub computer 1b) T XDATA (T XDA
TA ← R XDATA), go to step S222 and count up the count value S CNT of the reception counter (S CNT ← S CNT +
1) Exit the routine.

また、上記ステップS204で(R XDATA)B7B6=10、すな
わちリードモードを指示するコマンドC OMのときには、
上記ステップS204からステップS209へ進んでリードモー
ドに設定し、ステップS210でベースアドレスAD BASEと
オフセットアドレスAD OFFSETにより定まるRAM22の物理
アドレスからメモリの内容(AD BASE+AD OFFSET)を読
出し、このメモリの内容(AD BASE+AD OFFSET)をメイ
ンコンピュータ1aへの返信データT XDATAにセットし(T
XDATA←(AD BASE+AD OFFSET))、同様に、ステップ
S222で受信カウンタS CNTをカウントアップして(S CNT
←S CNT+1)ルーチンを抜ける。
When (R XDATA) B7B6 = 10 in step S204, that is, the command C OM for instructing the read mode,
The procedure proceeds from step S204 to step S209 to set the read mode. In step S210, the memory contents (AD BASE + AD OFFSET) are read from the physical address of the RAM22 determined by the base address AD BASE and the offset address AD OFFSET, and the contents of this memory ( Set AD BASE + AD OFFSET) to the reply data T XDATA to the main computer 1a (T
XDATA ← (AD BASE + AD OFFSET)), similarly step
The receive counter S CNT is incremented in S222 (S CNT
← S CNT + 1) Exit the routine.

上記ステップS208あるいはステップS210でセットされた
返信データT XDATAは、次のメインコンピュータ1aから
の第2バイトのデータ送信のタイミングで返信され、ベ
ースアドレスモード及びライトモードのときには、メイ
ンコンピュータ1aからの第1バイトのデータDATA1と同
じチェックデータが返信され、また、リードモードのと
きには、ベースアドレスAD BASEとオフセットアドレスA
D OFFSETによって指定されたRAM22の内容(AD BASE+AD
OFFSET)が返信される。
The reply data T XDATA set in step S208 or step S210 is returned at the timing of the next second byte data transmission from the main computer 1a. In the base address mode and the write mode, the reply data TXDATA from the main computer 1a is returned. The same check data as 1-byte data DATA1 is returned, and in read mode, the base address AD BASE and offset address A
Contents of RAM22 specified by D OFFSET (AD BASE + AD
OFFSET) is returned.

一方、上記ステップS202でTR≦T SET、すなわち、第2
バイト目以降のデータ受信であるときには、上記ステッ
プS202からステップS211へ分岐し、受信カウンタのカウ
ント値S CNTから第2バイトのデータ受信か第3バイト
のデータ受信かを判別する。
On the other hand, in step S202, TR ≦ T SET, that is, the second
When it is the data reception of the byte and subsequent bytes, the process branches from step S202 to step S211 and it is determined from the count value S CNT of the reception counter whether the second byte data is received or the third byte data is received.

上記ステップS211でS CNT=1すなわち第2バイトのデ
ータ受信のときには、上記ステップS211からステップS2
12へ進んでモード判定を行ない、ベースアドレスモード
及びライトモードのときには、ステップS213で受信デー
タR XDATAを第2バイトのデータDATA2としてRAM22のワ
ークアリアにストアする(DATA2←R XDATA)。
When S CNT = 1 in the above step S211, that is, when the second byte data is received, the above steps S211 to S2 are performed.
In step S213, the received data R XDATA is stored in the work area of the RAM 22 as the second byte data DATA2 (DATA2 ← R XDATA).

そして、上記ステップS213からステップS214へ進み、前
回受信した第1バイトのデータDATA1をメインコンピュ
ータ1aへの返信データT XDATAにセットし(T XDATA←DA
TA1)、ステップS222で受信カウンタをカウントアップ
して(S CNT←S CNT+1)ルーチンを抜ける。
Then, the process proceeds from step S213 to step S214, and the previously received first byte data DATA1 is set as the reply data T XDATA to the main computer 1a (T XDATA ← DA
TA1), in step S222, the reception counter is incremented (SCNT ← SCNT + 1) and the routine exits.

また、上記ステップS212でリードモードのときには、上
記ステップS212からステップS215へ進んでベースアドレ
スAD BASEとオフセットアドレスAD OFFSETにより定まる
RAM22の物理アドレスからメモリの内容(AD BASE+AD O
FFSET)を読出し、このメモリの内容(AD BASE+AD OFF
SET)をメインコンピュータ1aへの返信データT XDATAに
セットし(T XDATA←(AD BASE+AD OFFSET)、同様
に、ステップS222で受信カウンタS CNTをカウントアッ
プして(S CNT←S CNT+1)ルーチンを抜ける。
In the read mode in step S212, the process proceeds from step S212 to step S215, and is determined by the base address AD BASE and the offset address AD OFFSET.
From the physical address of RAM22 to the memory contents (AD BASE + AD O
FFSET) is read and the contents of this memory (AD BASE + AD OFF
SET) to the reply data T XDATA to the main computer 1a (T XDATA ← (AD BASE + AD OFFSET), and similarly, in step S222, the reception counter S CNT is incremented (S CNT ← S CNT + 1) and the routine exits. .

一方、上記ステップS211でS CNT≠1のときには、第3
バイトのデータ通信であり、上記ステップS211からステ
ップS216へ進んでモード判定を行ない、リードモードの
とき、上記ステップS216からステップS221へジャンプ
し、ベースアドレスモードのとき、ステップS217でメイ
ンコンピュータ1aからの受信データR XDATAとRAM22にス
トアした第2バイトのデータDATA2とを比較する。
On the other hand, if S CNT ≠ 1 in step S211, the third
It is byte data communication, and proceeds from step S211 to step S216 to perform mode determination.When in read mode, jumps from step S216 to step S221.When in base address mode, from the main computer 1a in step S217. The received data R XDATA is compared with the second byte data DATA2 stored in RAM22.

上述したように、メインコンピュータ1aから送信される
データは、通信が正常に行われている場合、第2バイト
と第3バイトのデータは同じデータであり、通信に異常
がある場合、第3バイトのデータは第2バイトのデータ
を全ビット反転したデータであるため、上記ステップS2
17でR XDATA≠DATA2のときには、通信に際して異常があ
るため上記ステップS217からステップS221へジャンプ
し、R XDATA=DATA2のときには通信は正常であるため、
上記ステップS217からステップS218へ進んで第2バイト
データDATA2を上位バイトにセットするとともに、第1
バイトのデータDATA1の下位6ビットを上位にシフトし
て下位2ビットを“00"とするバイトデータ(DATA1)00
を下位バイトにセットし、ベースアドレスAD BASEを設
定して(AD BASE←DATA2+(DATA1)00)ステップS221
へ進む。
As described above, the data transmitted from the main computer 1a is the same data in the second byte and the third byte when the communication is normally performed, and is the third byte when the communication is abnormal. Since the data of is the data in which all the bits of the data of the second byte is inverted, the above step S2
When R XDATA ≠ DATA2 in 17, there is an abnormality in communication, and therefore the process jumps from step S217 to step S221. When R XDATA = DATA2, communication is normal.
From step S217 to step S218, the second byte data DATA2 is set in the upper byte and the first byte
Byte data (DATA1) 00 that shifts the lower 6 bits of byte data DATA1 to the upper and sets the lower 2 bits to "00"
To the lower byte and set the base address AD BASE (AD BASE ← DATA2 + (DATA1) 00) Step S221
Go to.

また、上記ステップS216でライトモードの場合には、上
記ステップS216からステップS219へ進み、同様に、メイ
ンコンピュータ1aからの受信データR XDATAとRAM22にス
トアした第2バイトのデータDATA2とを比較して、R XDA
TA≠DATA2のとき、上記ステップS219からステップS221
へジャンプし、R XDATA=DATA2のとき、上記ステップS2
19からステップS220へ進んで、メインコンピュータ1aか
らの受信データR XDATAを確定データとして、ベースア
ドレスAD BASEとオフセットアドレスAD OFFSETにより定
まるRAM22の物理アドレスに書込み((AD BASE+AD OFF
SET)←R XDATA)、ステップS221へ進む。
If the write mode is selected in step S216, the process proceeds from step S216 to step S219, and similarly, the received data R XDATA from the main computer 1a is compared with the second byte data DATA2 stored in the RAM 22. , R XDA
When TA ≠ DATA2, the above steps S219 to S221
Jump to, and when R XDATA = DATA2, go to step S2 above
The process proceeds from step 19 to step S220, and the received data R XDATA from the main computer 1a is written as the final data in the physical address of the RAM 22 determined by the base address AD BASE and the offset address AD OFFSET ((AD BASE + AD OFF
SET) ← R XDATA) and proceed to step S221.

そして、各モードに応じて上記ステップS216,S218,S220
の各ステップからステップS221へ進むと、通信可能の場
合上位2ビットを“00"、通信不可の場合上位2ビット
を“11"とする受信許可コードSCをメインコンピュータ1
aへの返信データT XDATAにセットし、ステップS222で受
信カウンタS CNTをカウントアップして(S CNT←S CNT
+1)ルーチンを抜ける。
Then, according to each mode, the above steps S216, S218, S220
From each step of step S221, if the communication is possible, the upper two bits are "00", and if the communication is not possible, the upper two bits are "11".
The reply data to a is set to T XDATA, and the reception counter S CNT is incremented in step S222 (S CNT ← S CNT
+1) Exit the routine.

この受信許可コードSCは、メインコンピュータ1aによっ
て起動される次の通信ブロックT XBにおいて、先頭バイ
トのデータ送信タイミングでメインコンピュータ1aに返
信される。
This reception permission code SC is returned to the main computer 1a at the data transmission timing of the first byte in the next communication block T XB activated by the main computer 1a.

[発明の効果] 以上説明したように、請求項1記載の第1発明によれ
ば、第1のコンピュータで、バイトサイクルが同一周期
の複数のデータにより1つの通信ブロックを構成し、各
通信ブロック間に各データの周期よりも長い非通信状態
のブランク区間を設けて第2のコンピュータへデータを
送信し、第2のコンピュータでデータ受信毎に、受信間
隔と非通信状態の上記ブランク区間を識別可能な予め設
定された設定値との比較を行い、受信間隔が設定値より
も長いとき、今回受信したデータを先頭の第1バイトの
データ受信と識別するので、第2のコンピュータで通信
ブロックの先頭データを認識させるために特別な信号を
付加することなく、単に、通信ブロックにおける各デー
タのバイトサイクル周期よりも長い非通信状態のブラン
ク区間を置くだけですみ、簡便な方法でもって、正確か
つ確実に通信ブロックにおける先頭データを認識して、
通信によるデータ数を必要最小限としつつ、通信の信頼
性を確保することができ、データの伝達効率を向上し
て、処理時間が短縮され、制御性の向上を図ることがで
きる。また、付加回路を必要とせず、ハードウェア構成
を変更することなく、従ってコストアップを招くことな
く、容易に対処することができる。
As described above, according to the first aspect of the present invention, in the first computer, one communication block is configured by a plurality of data having the same byte cycle, and each communication block A blank section in a non-communication state that is longer than each data cycle is provided between them, and data is transmitted to the second computer, and the reception interval and the blank section in the non-communication state are identified every time the second computer receives data. When the reception interval is longer than the set value, the data received this time is identified as the data reception of the first byte at the beginning. Without adding a special signal to recognize the top data, it is simply a blank section in a non-communication state that is longer than the byte cycle period of each data in the communication block. You only have to wait, and by a simple method, accurately and reliably recognize the top data in the communication block,
It is possible to secure the reliability of communication while minimizing the number of data by communication, improve the data transmission efficiency, shorten the processing time, and improve the controllability. Further, it is possible to easily cope with the situation without requiring an additional circuit, without changing the hardware configuration, and thus without increasing the cost.

請求項2記載の第2発明によれば、上記効果に加え、第
1のコンピュータから読出し要求のデータを第2のコン
ピュータへ送信し、第2のコンピュータで読出し要求に
応じたデータを読出して第1のコンピュータへ送信し、
第1のコンピュータで第2のコンピュータからのデータ
を読込むに際し、第1のコンピュータから読出し要求の
コマンドを含む同一の3つのデータを1つの通信ブロッ
クとして第2のコンピュータへ送信し、第2のコンピュ
ータでは最初のデータ受信時、および2回目のデータ受
信時に、対応するデータをそれぞれメモリから読出して
第1のデータ、第2のデータとして次のデータ受信時に
第1のコンピュータへ送信し、第1のコンピュータにお
いて受信された第2のコンピュータからの第1のデータ
と第2のデータとを比較し、1つの通信ブロック中にお
いて両データが一致するときのみ、第2のコンピュータ
から読出されたデータを有効と判断してこのデータをメ
モリのデータエリアにストアするので、車輌に搭載され
たコンピュータ間のデータ通信において、第1のコンピ
ュータからの要求により第2のコンピュータにおけるデ
ータを第1のコンピュータへ送信し第1のコンピュータ
でこのデータを読込むに際し、データが時々刻々と変化
する場合であっても、適正にデータの有効性を判断する
ことができて、データの信頼性を確保することができる
という効果が得られる。また、第1のコンピュータで
は、1つの通信ブロック中において第2のコンピュータ
から送信されてきた第1のデータと第2のデータとが相
違するとき、通信異常と判断して異常が生じたことを記
録するので、点検、修理作業時など、外部装置を接続し
て記録内容を読出す等により通信異常が生じたことを容
易に確認あるいは特定することができ、点検、修理の際
の作業性を向上することができる。
According to the second aspect of the present invention, in addition to the above effects, the first computer transmits the read request data to the second computer, and the second computer reads the data in response to the read request. Send it to computer 1,
When the first computer reads the data from the second computer, the first computer transmits the same three pieces of data including the read request command to the second computer as one communication block, The computer reads the corresponding data from the memory at the first data reception and the second data reception, and transmits the corresponding data as the first data and the second data to the first computer at the next data reception. The first data and the second data received from the second computer are compared with each other, and the data read from the second computer is read only when the two data match in one communication block. Since this data is judged to be valid and stored in the data area of the memory, it can be stored between the computers installed in the vehicle. In the data communication, even when the data in the second computer is transmitted to the first computer in response to a request from the first computer and the data is read by the first computer, the data may change moment by moment. Therefore, it is possible to appropriately judge the validity of the data and obtain the effect that the reliability of the data can be secured. Further, in the first computer, when the first data and the second data transmitted from the second computer are different from each other in one communication block, it is determined that the communication is abnormal and the abnormality is generated. Since the data is recorded, it is possible to easily confirm or specify that a communication error has occurred by connecting an external device and reading the recorded contents during inspection or repair work. Can be improved.

請求項3記載の第3発明によれば、第1のコンピュータ
から第2のコンピュータへ書込むべきデータ、あるいは
ベースアドレスを設定するデータを送信し、第2のコン
ピュータにデータの書込み、あるいはベースアドレスの
設定を行わせるに際し、第1のコンピュータから同一の
データを第2のコンピュータへ連続して2回送信し、第
2のコンピュータでは、最初のデータ受信時、および2
回目のデータ受信時に、受信したデータをそれぞれ第1
のデータ、第2のデータとし、第1のコンピュータにお
いて、1回目に送信したデータの保持値と、2回目のデ
ータ送信後に第2のコンピュータから返信された第1の
データとの比較を行い、両データが一致するとき通信正
常と判断して再度同じデータを3回目のデータとして第
2のコンピュータへ送信し、両データが相違するときに
は通信異常と判断して、送信値の全ビットを反転したチ
ェックデータを第2のコンピュータへ送信する。そし
て、第2のコンピュータでは、第1のコンピュータから
の3回目のデータを受信したとき、該データと第2のデ
ータとの比較を行い、第1のコンピュータで通信正常と
判断されているときには、3回目のデータが同じデータ
として送信されてくることから両データが一致して通信
正常と判断し、該受信データをメモリに書込み、あるい
は該受信データに基づきベースアドレスを設定し、ま
た、第1のコンピュータにおいて通信異常と判断されて
いるときには、3回目のデータとして全ビットを反転し
たチェックデータが送信されてくることから両データが
不一致となり、通信異常と判断してデータの書込み、あ
るいはベースアドレスの設定を行うことなくデータが棄
却されるので、第1のコンピュータによって検知した通
信異常を、第2のコンピュータに知らせることができ
て、第2のコンピュータへのデータ書込み、あるいはベ
ースアドレス設定の際のデータの信頼性を向上すること
ができ、第1のコンピュータと第2のコンピュータとの
ダブルチェックが可能となり、誤ったデータが第2のコ
ンピュータに書込まれることがなく、あるいは誤ったデ
ータによりベースアドレスが設定されることが防止さ
れ、制御性が向上する。また、第1のコンピュータにお
いて第1のデータと第2のデータとの比較の結果、両デ
ータが相違するときには、通信異常が生じたと判断して
異常が生じたことを記録するので、上記第2発明の同様
に、点検、修理作業時など、外部装置を接続して記録内
容を読出す等により通信異常が生じたことを容易に確認
あるいは特定することができて、点検、修理の際の作業
性を向上することができる。
According to the third aspect of the present invention, the first computer transmits the data to be written to the second computer or the data for setting the base address to write the data to the second computer, or the base address. When the setting of 1 is performed, the same data is continuously transmitted from the first computer to the second computer twice, and the second computer receives the first data and
When receiving the data for the first time, the received data are
And the second data, the first computer compares the held value of the first transmitted data with the first data returned from the second computer after the second data transmission, When both data match, it is determined that the communication is normal and the same data is transmitted again as the third data to the second computer. When both data are different, it is determined that the communication is abnormal and all bits of the transmission value are inverted. Send the check data to the second computer. Then, when the second computer receives the third data from the first computer, the second computer compares the data with the second data, and when the first computer determines that the communication is normal, Since the third data is transmitted as the same data, it is determined that both data match and the communication is normal, and the received data is written in the memory, or the base address is set based on the received data. When it is determined that there is a communication error in the computer, the check data with all bits inverted is sent as the third data, so both data do not match. Since the data is rejected without performing the setting of, the communication abnormality detected by the first computer It is possible to inform the computer, and it is possible to improve data reliability when writing data to the second computer or setting the base address, and it is possible to double check the first computer and the second computer. Therefore, erroneous data is not written in the second computer, or the base address is prevented from being set by erroneous data, and the controllability is improved. Further, when the first computer compares the first data and the second data with each other as a result of the comparison, when the two data are different from each other, it is determined that a communication abnormality has occurred and the abnormality is recorded. Similarly to the invention, during inspection or repair work, it is possible to easily confirm or specify that a communication error has occurred by connecting an external device and reading the recorded contents. It is possible to improve the property.

【図面の簡単な説明】 図面は本発明の一実施例を示し、第1図はメインコンピ
ュータの通信手順を示すフローチャート、第2図はサブ
コンピュータの通信手順を示すフローチャート、第3図
は制御装置の回路ブロック図、第4図はクロック同期通
信のタイムチャート、第5図は通信ブロックの構成を示
す説明図である。 1a…メインコンピュータ 1b……サブコンピュータ T XB……通信ブロック T BLANK……ブランク区間 DATA1……第1バイトデータ DATA2……第2バイトデータ DATA3……第3バイトデータ T XDATA……送信データ R XDATA……受信データ
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 shows an embodiment of the present invention, FIG. 1 is a flow chart showing a communication procedure of a main computer, FIG. 2 is a flow chart showing a communication procedure of a sub computer, and FIG. 3 is a control device. FIG. 4 is a circuit block diagram of FIG. 4, FIG. 4 is a time chart of clock synchronous communication, and FIG. 5 is an explanatory diagram showing a configuration of a communication block. 1a… Main computer 1b …… Sub computer T XB …… Communication block T BLANK …… Blank area DATA1 …… First byte data DATA2 …… Second byte data DATA3 …… Third byte data T XDATA …… Send data R XDATA ……received data

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】車輌に搭載された第1のコンピュータと第
2のコンピュータとをシリアルチャンネルで結合し、双
方向通信を行う車載コンピュータ間のデータ通信方法に
おいて、 上記第1のコンピュータから上記第2のコンピュータへ
データを送信するに際し、上記第1のコンピュータで
は、バイトサイクルが同一周期の複数のデータにより1
つの通信ブロックを構成するとともに、各通信ブロック
の間に上記周期よりも長い非通信状態のブランク区間を
設けて、上記第2のコンピュータへ送信し、 上記第2のコンピュータにおいて上記第1のコンピュー
タからのデータ受信毎に、上記第1のコンピュータから
の送信データの受信間隔と、1つのデータのバイトサイ
クルよりも長く上記ブランク区間を識別可能な予め設定
された設定値とを比較し、この設定値よりも上記受信間
隔が長いとき、今回受信したデータを先頭の第1バイト
のデータ受信であると識別することを特徴とする車載コ
ンピュータ間のデータ通信方法。
1. A data communication method between vehicle-mounted computers, wherein a first computer and a second computer mounted on a vehicle are connected to each other via a serial channel to perform bidirectional communication, wherein the first computer to the second computer. When transmitting data to another computer, the first computer uses one of a plurality of data whose byte cycle is the same period.
In addition to configuring one communication block, a blank section in a non-communication state longer than the above cycle is provided between the communication blocks, and the blank section is transmitted to the second computer. In the second computer, the blank section is transmitted from the first computer. Every time the data is received, the reception interval of the transmission data from the first computer is compared with a preset setting value capable of identifying the blank section longer than the byte cycle of one data. When the reception interval is longer than the above, the data communication method between the vehicle-mounted computers is characterized in that the data received this time is identified as data reception of the first byte at the beginning.
【請求項2】上記第1のコンピュータから読出し要求の
データを上記第2のコンピュータへ送信し、上記第2の
コンピュータで上記読出し要求に応じたデータを読出し
該データを上記第1のコンピュータへ送信するに際し、
上記第1のコンピュータでは、1つの通信ブロックを3
つの同一データとして上記第2のコンピュータへデータ
読出しのコマンドを含む同一のデータを3回送信し、 上記第2のコンピュータでは、上記第1のコンピュータ
からデータ読出しのコマンドを含むデータを最初に受信
したとき、このデータの内容に応じてメモリから第1の
データを読出し、次に、同じデータを2回目に受信した
とき、上記第1のデータを上記第1のコンピュータへ送
信するとともに、2回目に受信したデータの内容に応じ
てメモリから第2のデータを読出し、さらに同じデータ
を3回目に受信したとき、上記第2のデータを上記第1
のコンピュータへ送信し、 上記第1のコンピュータにおいて、2回目のデータ送信
後に上記第2のコンピュータから送信された上記第1の
データを保持し、3回目のデータ送信後、上記第1のデ
ータと上記第2のコンピュータから送信された上記第2
のデータとを比較し、両データが一致するときのみ、上
記第2のコンピュータから読出されたデータを有効と判
断して、このデータをメモリのデータエリアにストア
し、両データが相違するとき、通信異常と判断して異常
を生じたことを記録することを特徴とする請求項1記載
の車載コンピュータ間のデータ通信方法。
2. A read request data is transmitted from the first computer to the second computer, the second computer reads data according to the read request, and the data is transmitted to the first computer. When doing
In the first computer, one communication block is 3
The same data including a data read command is transmitted three times as the same data to the second computer, and the second computer first receives the data including the data read command from the first computer. At this time, the first data is read from the memory according to the content of this data, and when the same data is received the second time, the first data is transmitted to the first computer and the second data is received. When the second data is read from the memory according to the content of the received data and the same data is received for the third time, the second data is transferred to the first data.
To the computer, the first computer retains the first data transmitted from the second computer after the second data transmission, and retains the first data after the third data transmission. The second transmitted from the second computer
The data read from the second computer is judged to be valid only when both data match, and this data is stored in the data area of the memory. 2. The data communication method between vehicle-mounted computers according to claim 1, wherein the occurrence of the abnormality is recorded as a communication abnormality.
【請求項3】車輌に搭載された第1のコンピュータと第
2のコンピュータとをシリアルチャンネルで結合して双
方向通信を行い、上記第1のコンピュータから上記第2
のコンピュータへ、書込むべきデータあるいはベースア
ドレスを設定するデータを送信し、上記第2のコンピュ
ータにデータの書込みを行わせ、あるいはベースアドレ
スを設定させる車載コンピュータ間のデータ通信方法に
おいて、 上記第1のコンピュータでは、上記第2のコンピュータ
へ同一のデータを2回送信し、最初のデータ送信時、該
データを保持するとともに上記第2のコンピュータへ該
データを送信し、2回目のデータ送信後に上記第2のコ
ンピュータから返信される第1のデータと保持したデー
タとを比較し、両データが一致するとき通信正常と判断
して再度同じデータを3回目のデータとして上記第2の
コンピュータへ送信し、両データが相違するとき通信異
常と判断して、送信値の全ビットを反転したチェックデ
ータを3回目のデータとして上記第2のコンピュータへ
送信するとともに、異常が生じたことを記録し、 上記第2のコンピュータでは、上記第1のコンピュータ
から最初のデータを受信したとき、該受信データを第1
のデータとし、次に同じデータを2回目に受信したと
き、上記第1のデータを上記第1のコンピュータへ送信
するとともに、2回目に受信したデータを第2のデータ
とし、3回目のデータを受信したときには、該受信デー
タと上記第2のデータとを比較し、両データが一致する
とき通信正常と判断して該受信データをメモリに書込
み、あるいは該受信データに基づきベースアドレスを設
定し、両データが相違するときには通信異常と判断し
て、データを棄却することを特徴とする車載コンピュー
タ間のデータ通信方法。
3. A first computer and a second computer mounted on a vehicle are connected by a serial channel to perform bidirectional communication, and the first computer to the second computer.
Data to be written or data for setting a base address to cause the second computer to write the data or set the base address to the computer, the data communication method between vehicle-mounted computers according to the first aspect, The computer transmits the same data twice to the second computer, holds the data at the time of the first data transmission, transmits the data to the second computer, and transmits the data after the second data transmission. The first data sent back from the second computer is compared with the held data, and when both data match, it is determined that the communication is normal and the same data is sent again as the third data to the second computer. , If both data are different, it is judged that there is a communication error and the check data obtained by inverting all bits of the transmission value is 3 When the first computer receives the first data from the first computer, the second computer records the occurrence of an abnormality while transmitting the first data to the second computer.
Then, when the same data is received the second time, the first data is transmitted to the first computer and the second data is used as the second data. When received, the received data is compared with the second data, and when the two data match, it is determined that the communication is normal and the received data is written in the memory, or the base address is set based on the received data. A data communication method between vehicle-mounted computers, characterized in that when the two data are different, it is determined that communication is abnormal and the data is rejected.
JP2298448A 1990-11-02 1990-11-02 Data communication method between in-vehicle computers Expired - Fee Related JPH0744516B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2298448A JPH0744516B2 (en) 1990-11-02 1990-11-02 Data communication method between in-vehicle computers

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2298448A JPH0744516B2 (en) 1990-11-02 1990-11-02 Data communication method between in-vehicle computers

Publications (2)

Publication Number Publication Date
JPH04170828A JPH04170828A (en) 1992-06-18
JPH0744516B2 true JPH0744516B2 (en) 1995-05-15

Family

ID=17859844

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2298448A Expired - Fee Related JPH0744516B2 (en) 1990-11-02 1990-11-02 Data communication method between in-vehicle computers

Country Status (1)

Country Link
JP (1) JPH0744516B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210200203A1 (en) * 2019-12-30 2021-07-01 Hanwha Defense Co., Ltd. Method of operating remote controller, computer program, and remote controller

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS551766A (en) * 1978-06-20 1980-01-08 Sharp Corp Multiplex transmission system
JPS63138826A (en) * 1986-11-29 1988-06-10 Nec Corp Data transmission system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210200203A1 (en) * 2019-12-30 2021-07-01 Hanwha Defense Co., Ltd. Method of operating remote controller, computer program, and remote controller
US11774957B2 (en) * 2019-12-30 2023-10-03 Hanwha Aerospace Co., Ltd. Method of operating remote controller, computer program, and remote controller

Also Published As

Publication number Publication date
JPH04170828A (en) 1992-06-18

Similar Documents

Publication Publication Date Title
KR101205744B1 (en) Serial-peripheral interface with reduced number of connection lines
EP0217571B2 (en) Data transfer communication system
US20010031026A1 (en) Data synchronisation process, and transmission and reception interfaces
JPH11161510A (en) Initialization method for controller connected to diagnostic bus
JPH0898284A (en) Data receiver, data transmitter and data communication equipment
US20030171853A1 (en) Device for data transmission between vehicle sensors and a processor in a controller
US5367644A (en) Communication system
KR100362236B1 (en) Multiple data communication system
CN109154925A (en) Communication equipment, communication means, program and communication system
US5398238A (en) Data communication system
US7283488B2 (en) J1850 application specific integrated circuit (ASIC) and messaging technique
EP0085973B1 (en) Information transmission system
JPH0744516B2 (en) Data communication method between in-vehicle computers
KR100365987B1 (en) How to Transfer Data from Real-Time Data Processing Systems
JPH0722281B2 (en) Data communication method between in-vehicle computers
WO1996037984A1 (en) A digital data bus system including arbitration
US20040162956A1 (en) System and method for implementing a hidden address in a communication module
JP3442633B2 (en) Vehicle multiplex transmission equipment
US11036664B2 (en) Method for determining the transmission speed of a communication module in adapting a connected communication module to a bus and a device for said method
US6499067B1 (en) Serial communication apparatus and serial communication system
US6026094A (en) Digital data bus system including arbitration
CN1107956C (en) Method and apparatus for reducing latency time on an interface by overlapping transmitted packets
JPH01143537A (en) Multiplex transmission system
JP2781397B2 (en) Multiplex transmission equipment
US11386035B2 (en) Electronic system

Legal Events

Date Code Title Description
R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

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

Free format text: PAYMENT UNTIL: 20090515

Year of fee payment: 14

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

Free format text: PAYMENT UNTIL: 20090515

Year of fee payment: 14

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

Free format text: PAYMENT UNTIL: 20100515

Year of fee payment: 15

LAPS Cancellation because of no payment of annual fees