JPH04170829A - Data communication method between on-vehicle computers - Google Patents

Data communication method between on-vehicle computers

Info

Publication number
JPH04170829A
JPH04170829A JP2298449A JP29844990A JPH04170829A JP H04170829 A JPH04170829 A JP H04170829A JP 2298449 A JP2298449 A JP 2298449A JP 29844990 A JP29844990 A JP 29844990A JP H04170829 A JPH04170829 A JP H04170829A
Authority
JP
Japan
Prior art keywords
data
byte
communication
received
bits
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.)
Granted
Application number
JP2298449A
Other languages
Japanese (ja)
Other versions
JPH0722281B2 (en
Inventor
Takayuki Sogawa
能之 十川
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 Heavy Industries Ltd
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 Heavy Industries Ltd filed Critical Fuji Heavy Industries Ltd
Priority to JP2298449A priority Critical patent/JPH0722281B2/en
Publication of JPH04170829A publication Critical patent/JPH04170829A/en
Publication of JPH0722281B2 publication Critical patent/JPH0722281B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To recognize data due to abnormality caused in the computer of a communicating destination, and to correctly discriminate the effectiveness of the data so as to improve reliability by discriminating whether the received value of first data is effective or not by comparing the inverted value of all the bits of the received value of second data with the received value of the first data. CONSTITUTION:A main computer 1a transmits the same data including a command by bytes from a first byte to a second byte, and on the other hand, a sub computer 1b returns read-out data (first data) by a second byte, and further, it returns the inverted value (second data) of all the bits of this read-out data by the third byte. The main computer 1a compares the received value of the second byte from the sub computer 1b with the inverted value of all the bits of the received value of the third byte, and discriminates whether the received read-out data is normal or not by checking the coincidence of these data. Thus, the data due to the abnormality caused in the computer of the communicating destination can be recognized, and the effectiveness of the data can be correctly discriminated, and the reliability of communication can be improved.

Description

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

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

さらに、複数のコンピュータによる分散処理では、各コ
ンピュータをシリアルチャンネルで結合し、互いに必要
とするデータを直列伝送しており、このデータの直列伝
送には、クロック同期式を採用し、双方向通信を行なう
ものが多い。
Furthermore, in distributed processing using multiple computers, each computer is connected by a serial channel and the data required by each other is serially transmitted. For this serial data transmission, a clock synchronization method is adopted and bidirectional communication is possible. There are many things to do.

この場合、各コンピュータ間のデータ通信においては、
データを2回受信し、各受信データを比較して一致した
場合、有効データとする方法が採用され、通信データの
信頼性を確保するようにしている。
In this case, in data communication between each computer,
A method is adopted in which data is received twice, each received data is compared, and if they match, the data is considered valid, thereby ensuring the reliability of the communication data.

[発明が解決しようとする課題] しかしながら、クロック同期式の双方向通信においては
送信と受信とが同時に行われるため、各コンピュータの
通信インターフェースは、送信と受信とを兼用する送受
信バッファを備えるものが多く、上述した方法では、例
えばコンピュータAからデータを送信した場合、万一、
相手側コンピュータBに野営が生じると、このコンピュ
ータBでは返信値を送受信バッファにセットできず、こ
の送受信バッファに蓄えられたデータが、次の送受信サ
イクルで、そのままエコーバックされてコンピュータA
に返信されてしまう。
[Problems to be Solved by the Invention] However, in clock-synchronous bidirectional communication, transmission and reception are performed simultaneously, so the communication interface of each computer is not equipped with a transmission/reception buffer that serves both transmission and reception. In many cases, in the method described above, if data is sent from computer A, for example,
When a camp occurs on the other party's computer B, this computer B cannot set the reply value in the sending/receiving buffer, and the data stored in this sending/receiving buffer is echoed back to computer A in the next sending/receiving cycle.
will be replied to.

従って、当然ながらコンピュータAでは2回の受信値が
同一データとなり、上述した方法ではコンピュータBの
異常を検出できず、返信値が有効データとみなされるお
それがある。
Therefore, as a matter of course, the received value twice becomes the same data in computer A, and the above-described method cannot detect an abnormality in computer B, and there is a possibility that the returned value will be regarded as valid data.

[発明の目的] 本発明は上記事情に鑑みてなされたもので、通信先のコ
ンピュータに生じた異常によるデータを認識し、データ
の有効性を正確に判別して通信の信頼性を向上すること
のできる車載コンピュータ間のデータ通信方法を提供す
ることを目的としている。
[Object of the Invention] The present invention has been made in view of the above circumstances, and it is an object of the present invention to recognize data due to an abnormality occurring in a communication destination computer, accurately determine the validity of the data, and improve the reliability of communication. The purpose of this research is to provide a data communication method between in-vehicle computers that enables the following.

[課題を解決するための手段及び作用]上記目的を達成
するため本発明による車載コンピュータ間のデータ通信
方法は、シリアルチャンネルで結合した車載コンピュー
タ間のデータ通信方法において、所定のビット数からな
る第1のデータと、この第1のデータの全ビットを反転
した第2のデータとを受信し、この第2のデータの受信
値を全ビット反転した値と前記第1のデータの受信値と
を比較することにより、前記第1のデータの受信値が有
効か否かを判別する。
[Means and operations for solving the problem] To achieve the above object, the present invention provides a data communication method between on-vehicle computers connected via a serial channel. 1 data and second data obtained by inverting all bits of the first data, and combining the received value of the second data with all bits inverted and the received value of the first data. By comparing, it is determined whether the received value of the first data is valid.

し発明の実施例] 以下、図面を参照して本発明の詳細な説明する。Examples of the invention] Hereinafter, the present invention will be described in detail with reference to the drawings.

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

第3図において、符号1は自動車などの車輌に搭載され
る制御装置(ECTJ)であり、このECUlには、メ
インコンピュータ1a及びサブコンピュータ1bの2つ
のマイクロコンピュータが内蔵され、さらに、駆動回路
1cなどの周辺回路が内蔵されている。
In FIG. 3, reference numeral 1 is a control device (ECTJ) mounted on a vehicle such as an automobile, and this ECU1 has two built-in microcomputers, a main computer 1a and a subcomputer 1b, and a drive circuit 1c. It has built-in peripheral circuits such as

上記メインコンピュータ1aは、例えば8ビツトのメイ
ンCPUIO1ROMI 1.RAMI 2、I10イ
ンターフェイス13、シリアルインターフェイス(SC
■)14、及び、タイマ15がパスライン16を介して
接続され、また、上記サブコンピュータ1bは、例えば
8ビツトのサブCPU20、ROM21、RAM22、
I10インターフェイス23、シリアルインターフェイ
ス(SCI ’) 24、及び、タイマ25がパスライ
ン26を介して接続されている。
The main computer 1a has, for example, an 8-bit main CPUIO 1ROMI 1. RAMI 2, I10 interface 13, serial interface (SC
(2) 14 and a timer 15 are connected via a pass line 16, and the subcomputer 1b includes, for example, an 8-bit sub CPU 20, ROM 21, RAM 22,
An I10 interface 23, a serial interface (SCI') 24, and a timer 25 are connected via a pass line 26.

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

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

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

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

上記5C114,24は、クロック信号CLK、送信信
号TX、及び、受信信号RXの各ラインで互いに接続さ
れ、第4図に示すように、シフトレジスタからなる送受
信バッファ40に受信データが蓄えられて所定のタイミ
ングで各CPUl0,20に取込まれ、また、各CPU
l0,20から書込まれたデータが所定のタイミングで
送信される。
The 5Cs 114 and 24 are connected to each other through the lines of the clock signal CLK, the transmission signal TX, and the reception signal RX, and as shown in FIG. It is loaded into each CPU10, 20 at the timing of
The data written from l0, 20 is transmitted at a predetermined timing.

すなわち、上記送受信バッファ40に受信されるデータ
は、クロック信号CLKに同期して1パルスに1ビツト
のシリアルデータとして順に記憶され、8ビツトのデー
タが蓄積されると、各CPU10.20に1バイト分の
パラレルデータとして取込まれる0次いで、各CPUl
0.20から上記送受信バッファ40に1バイトの返信
データが書込すれ、次の送受信タイミングでシリアルデ
ータとして送信される。
That is, the data received by the transmitting/receiving buffer 40 is sequentially stored as serial data of 1 bit per pulse in synchronization with the clock signal CLK, and when 8 bits of data is accumulated, 1 byte is stored in each CPU 10.20. 0 is taken in as parallel data for each CPU1
From 0.20 onwards, 1 byte of reply data is written into the transmission/reception buffer 40, and is transmitted as serial data at the next transmission/reception timing.

この際、上記メインコンピュータ1aのタイマ15から
上記クロック信号CLKが供給されて上記メインCPU
l0と上記サブCPU20との間でクロック同期式の全
二重双方向通信が行われ、第5図に示すように、通信デ
ータDATAのLSB(ビットO)からMSB(ビット
7)までの各ビットが、上記クロック信号CLKの立上
がりのタイミングでストローブされる。
At this time, the clock signal CLK is supplied from the timer 15 of the main computer 1a, and the main CPU
Clock synchronous full-duplex bidirectional communication is performed between l0 and the sub CPU 20, and as shown in FIG. 5, each bit from LSB (bit O) to MSB (bit 7) of communication data DATA is is strobed at the rising timing of the clock signal CLK.

次に、ECUIにおける各コンピュータla。Next, each computer la in the ECUI.

1b間の通信手順について説明する。The communication procedure between 1b will be explained.

メインコンピュータ1aとサブコンピュータ1bとの間
のデータ通信においては、第6図に示すように、DAT
AI 、 DATA2. DATA3からなる3バイト
のデータを1ブロツクとして、周期T(例えば、T=4
ms)のバイトサイクルの通信が行われ、この1ブロツ
クの通信ブロックTXBに続けて非通信状態であるブラ
ンク区間T BLANにをおき、このブランク区間T 
BLANKにより先頭データである第1バイトデータD
ATAIを検出する。
In data communication between the main computer 1a and the subcomputer 1b, as shown in FIG.
AI, DATA2. One block is 3 bytes of data consisting of DATA3, and the cycle is T (for example, T=4
ms) byte cycle communication is performed, and this one block of communication block TXB is followed by a blank section T BLAN in a non-communication state.
The first byte data D, which is the first data, is set by BLANK.
Detect ATAI.

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

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

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

一方、サブコンピュータ1bでは、第2バイト受信値と
第3バイト受信値との一致をとることにより、第1バイ
トから第3バイトまでの受信値が正常か否かを判別でき
、異常の場合には受信データの書込みを中止する。
On the other hand, the subcomputer 1b can determine whether the received values from the first byte to the third byte are normal or not by matching the second byte received value and the third byte received value, and in the case of an abnormality, stops writing the received data.

(リードモード) メインコンピュータ1aがらは、第1バイトから第3バ
イトまでコマンドCONを含む同一データを送信し、一
方、サブコンピュータ1bは、第2バイトで読出しデー
タ(第1のデータ)を返信し、さらに、この読出しデー
タの全ビットを反転した値(第2のデータ)を第3バイ
トで返信する。
(Read mode) The main computer 1a transmits the same data including the command CON from the first byte to the third byte, while the subcomputer 1b returns read data (first data) in the second byte. , Furthermore, a value (second data) obtained by inverting all bits of this read data is returned in the third byte.

メインコンピュータ1aでは、サブコンピュータ1bか
らの第2バイト受信値(第1のデータの受信値)と、サ
ブコンピュータ1bからの第3バイト受信値(第2のデ
ータの受信値)を全ビット反転した値とを比較し、これ
らのデータの一致をとることによりサブコンピュータ1
bから受信した読出しデータが正常か否かを判別できる
In the main computer 1a, all bits of the second byte received value (first data received value) from the subcomputer 1b and the third byte received value (second data received value) from the subcomputer 1b are inverted. By comparing the values and matching these data, the subcomputer 1
It can be determined whether the read data received from b is normal or not.

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

(メインコンピュータ1aの通信手順)第1図のフロー
チャートは、バイトサイクルの周期T毎に起動されるメ
インコンピュータ1aの通信ルーチンであり、最初のス
テップ5101は、送信カウンタのカウント値MCNT
によって条件分岐する多岐選択のステップである。すな
わち、1バイト毎の通信に対応してOから1.2.3へ
とカウントアツプされる送信カウンタのカウント値MC
M丁に応じ、ステ・ンプ5101からステップ3102
.3104.5113.5124へと、それぞれ分岐す
る。
(Communication procedure of main computer 1a) The flowchart in FIG.
This is a multi-selection step that branches conditionally. In other words, the count value MC of the transmission counter increases from O to 1.2.3 in response to communication for each byte.
Step 5101 to step 3102 according to M
.. 3104.5113.5124, respectively.

まず、上記ステップ5IO1で送信カウンタのカウント
値MCNTが”0°′であるときには、通信のブランク
区間T BLANKであり、上記ステップ5101から
ステップ5102へ分岐して通信のモードを設定し、次
いで、ステップ5703へ進んで送信カウンタを力ウン
トア・ツブしくrv’1cNT 4−MCN丁+1〉、
ル−チンを抜ける。
First, when the count value MCNT of the transmission counter is "0°" in the above step 5IO1, it is a communication blank interval T BLANK, and the above step 5101 branches to step 5102 to set the communication mode, and then step Proceed to 5703 and set the transmission counter to rv'1cNT4-MCN+1>,
Get out of the routine.

そして、次回のルーチンが起動され、ステップ5101
で送信カウンタのカウント値MCNTが1″で先頭デー
タの送信の場合には、ステップ5101からステップ5
104へ分岐して前回謹定したモードを判定し、ベース
アドレス設定モードのときステップ5104からステッ
プ5105へ、ライトモードのときステップ5104か
らステップ8106へ、リードモードのときステップ5
104からステップ5107へと分岐する。
Then, the next routine is started and step 5101
If the count value MCNT of the transmission counter is 1'' and the first data is being transmitted, steps 5101 to 5 are executed.
Branching to step 104, the previously established mode is determined, and if the base address setting mode is the step 5104 to step 5105, if the write mode is the step 5104 to step 8106, if the read mode is the step 5.
The process branches from step 104 to step 5107.

まず、ベースアドレス設定モードについて説明すると、
このベースアドレス設定モードにおいては、ステップ5
105で、コマンドC叶の2ビツトを上位として、この
上位2ビツトにベースアドレスADBへ旺の下位6ビツ
トA D BASE/Lを加えた1バイトのデータを送
信データT XDATAにセットしくTXD^■^←c
 OH+ A D BASE/L) 、ステップ810
8へ進む。
First, let me explain the base address setting mode.
In this base address setting mode, step 5
In step 105, set the 2 bits of the command C as the upper one, and set 1 byte of data, which is the sum of the upper 2 bits, the base address ADB, and the lower 6 bits of the command AD BASE/L, to the transmission data TXDATA. ^←c
OH+AD BASE/L), step 810
Proceed to step 8.

上記ベースアドレスA D BASEは、サブCPU2
0のメモリ空間に対するアドレス指定の際に予め基準と
なるアドレスであり、ベースアドレスADBASEの設
定以降、1バイト未満のオフセットアドレスA D 0
FFSETのみを指定し、実際の物理アドレスをベース
アドレスA D BASEとオフセットアドレスA ’
D 0FFSETとの論理和で指定することにより、通
信バイト数の低減を図るものである。
The above base address A D BASE is the sub CPU2
This is the reference address in advance when specifying the address for the 0 memory space, and after the setting of the base address ADBASE, an offset address of less than 1 byte A D 0
Specify only FFSET and set the actual physical address to base address A D BASE and offset address A'
By specifying the logical sum with D0FFSET, the number of communication bytes can be reduced.

すなわち、上記サブコンピュータ1bが8ビツトである
場合、そのアドレス空m!64 Kバイト(16進数で
0000〜FFFF)の指定は、通常2バイトのデータ
を要するが、−旦、上述のベースアドレスA D BA
SEを設定すれば、以降は1バイト未満のオフセットア
ドレス値A D 0FFSETによる論理アドレスで物
理アドレスを指定することができ、通信バイト数を少な
くしてデータ転送の際の効率を向上することができるの
である。
That is, if the subcomputer 1b has 8 bits, its address is empty m! Specifying 64 Kbytes (0000 to FFFF in hexadecimal) usually requires 2 bytes of data, but the above base address AD BA
Once SE is set, a physical address can be specified with a logical address using an offset address value of less than 1 byte A D 0FFSET, which reduces the number of communication bytes and improves the efficiency of data transfer. It is.

一方、上記ステップ5104でライトモードのときには
、ステップ3106でコマンドC叶の2ビツトにオフセ
ットアドレスA D 0FFSET (6ビツト)を加
えた1バイトのデータを送信データT XDATAにセ
ットしテ(TXDATA =COH+ADOFFSET
) ステップ8108へ進み、リードモードのときには
、ステップ5107で、同様にコマンドCOHの2ビツ
トにオフセットアドレスA D 0FFSET (6ビ
ツト)を加えた1バイトのデータを送信データT XD
ATAにセットしく TXDATA 4−COH+ A
 D 0FFSET) −ステラ73108へ進む。
On the other hand, when the write mode is selected in step 5104, in step 3106, 1 byte of data obtained by adding the offset address ADOFFSET (6 bits) to the 2 bits of the command C is set as the transmission data TXDATA (TXDATA = COH + ADOFFSET).
) Proceeding to step 8108, when in read mode, similarly, in step 5107, 1 byte of data obtained by adding the offset address AD0FFSET (6 bits) to the 2 bits of the command COH is sent as the transmission data TXD.
Please set it to ATA TXDATA 4-COH+ A
D 0FFSET) - Proceed to Stella 73108.

そして、上記各ステップ3105.5106.5107
からステップ5ioaへ進むと、送信データT XDA
TAを第1バイトデータDATA1として(DATA1
←T XDATA)RAM12のワークエリアにストア
し、ステップ5109で5C114を介してサブコンピ
ュータ1bに送信するとともに、サブコンピュータ1b
から1バイトの返信データを受信してステップ5110
へ進む。
And each step 3105.5106.5107 above
Proceeding to step 5ioa, the transmission data T
TA as the first byte data DATA1 (DATA1
←T
Step 5110
Proceed to.

ステップ5110では、上記ステップ5109で受信し
たサブコンピュータ1bからのデータを調べ、このデー
タの上位2ビツトが“00”のとき、サブコンピュータ
1bは通信可能の状態と判別してステップ5111へ進
み、送信カウンタをカウントアツプして(MCN丁←M
CNT+1)7レーチンを抜ける。
In step 5110, the data received from the subcomputer 1b in step 5109 is checked, and when the upper two bits of this data are "00", the subcomputer 1b determines that it is in a communicable state and proceeds to step 5111 to transmit. Count up the counter (MCN ding ← M
CNT+1) Pass through 7 retin.

一方、上記ステップ5110でサブコンピュータ1bか
らのデータの上位2ビツトが“11”のときには、サブ
コンピュータ1bは通信不可と判別してステップ511
2へ分岐し、送信カウンタをクリアして(MCNT−0
)ルーチンを抜け、次のサイクルをブランクとして、再
び第1バイトからのデータ通信を行なう。
On the other hand, when the upper two bits of the data from the subcomputer 1b are "11" in step 5110, the subcomputer 1b determines that communication is not possible and performs step 511.
Branch to 2, clear the transmission counter (MCNT-0
) The routine is exited, the next cycle is left blank, and data communication starts again from the first byte.

次に、再びルーチンが起動され、ステップ5101で送
信カウンタのカウント値M CNTが“2”、すなわち
第2バイトデータDATA2の通信のときには、ステッ
プ5113でモード判定を行ない、ベースアドレス設定
モードのとき、ステップ5113からステップ5114
へ進んでベースアドレスA D BASEの上位バイト
A D BASE/Uを送信データTxDATAニセッ
トしく TXDATA =A D BASE/U) 、
ステラフS116A、進む。
Next, the routine is started again, and when the count value M CNT of the transmission counter is "2" in step 5101, that is, when the second byte data DATA2 is being communicated, a mode determination is performed in step 5113, and when the base address setting mode is set, Step 5113 to step 5114
Go to and reset the upper byte of the base address AD BASE/U to the transmission data TxDATA (TXDATA = AD BASE/U),
Stellaf S116A, proceed.

また、上記ステップ5113でライトモードのときには
、上記ステップ5113からステップ5115へ進み、
既にアドレス指定しであるサブコンピュータ1bのメモ
リに書込むべきライトデータW DATAを送信データ
T XDATAにセットしくTXDATA 4−WDA
TA)、ステップ8116へ進む。
Further, when the light mode is selected in step 5113, the process proceeds from step 5113 to step 5115,
TXDATA 4-WDA Set the write data W DATA to be written to the memory of the subcomputer 1b whose address has already been specified to the transmission data T XDATA.
TA), proceed to step 8116.

そして、上記ステップ5114あるいはステップ511
5からステップ8116へ進むと、送信データT XD
ATAを第2バイトデータDATA2 として(DAT
A2←TXDATA ) RAMI 2(7)ワークf
f−!J74ニス)7L、ステップ5117でサブコン
ピュータ1bに送信するとともに、サブコンピュータ1
bから1バイトの返信データを受信してステップ311
8へ進む。
Then, step 5114 or step 511
5 to step 8116, the transmission data T
ATA as second byte data DATA2 (DAT
A2←TXDATA) RAMI 2 (7) Work f
f-! J74 varnish) 7L, in step 5117 it is sent to the subcomputer 1b, and the subcomputer 1
Receive 1 byte of reply data from b and step 311
Proceed to step 8.

ステップ8118では、上記ステップ5117でサブコ
ンピュータ1bから受信したデータRXDATAが、既
にサブコンピュータ1bへ送信した第1バイトデータD
ATAIと一致するか否かを調べ、RXDATA= O
AT^1のとき、通信が正常に実行されたと判定してス
テップ8118からステップ5123ヘジヤンプし、上
記ステップ5118でRXDATA≠DATAIのとき
には、通信が正常に行われず、正しいデータがサブコン
ピュータ1bにて受信されなかったと判定して上記ステ
ップ3118からステップ5119へ進んでエラーフラ
グFLAGIをセットしく FLAG1←1)、ステッ
プ5123へ進んで送信カウンタをカウントアツプしく
MCN丁←MCNT+1>、ル−チンを抜ける。
In step 8118, the data RXDATA received from the subcomputer 1b in step 5117 is changed to the first byte data D that has already been sent to the subcomputer 1b.
Check whether it matches ATAI or not, RXDATA=O
When AT^1, it is determined that the communication was executed normally and jumps from step 8118 to step 5123, and when RXDATA≠DATAI in step 5118, the communication is not carried out normally and the correct data is received by the subcomputer 1b. If it is determined that the error flag has not been received, the program proceeds from step 3118 to step 5119 to set the error flag FLAG1 (FLAG1←1), proceeds to step 5123 to increment the transmission counter (MCNT+1), and exits the routine.

すなわち、通信ブロックTXBの先頭データである第1
バイトデータDATAIがメインコンピュータ1aから
送信されると、同時にサブコンピュータ1bからメイン
コンピュータ1aに対して受信可能か否かを示すコード
が返信され、通信可能の場合、第2バイトデータDAT
A2がメインコンピュータ1aから通信モードに応じて
送信される。サブコンピュータ1bは、メインコンピュ
ータ1aから受信した第1バイトデータDATA1を、
メインコンピュータ1aからの第2バイトデータDAT
A2の送信タイミングで返信するため、メインコンピュ
ータ1aでは、RAM12のワークエリアにストアした
第1バイトデータDATA1とサブコンピュータ1bか
らの受信データRXDATAとが一致するか否かにより
、通信が正常に実行されたか否かを判別することができ
るのである。
That is, the first data, which is the first data of the communication block TXB,
When the byte data DATAI is transmitted from the main computer 1a, at the same time, the subcomputer 1b replies to the main computer 1a with a code indicating whether or not it is receivable, and if communication is possible, the second byte data DAT
A2 is transmitted from the main computer 1a according to the communication mode. The subcomputer 1b receives the first byte data DATA1 from the main computer 1a,
2nd byte data DAT from main computer 1a
Since the reply is sent at the transmission timing of A2, the main computer 1a determines whether the communication is executed normally depending on whether the first byte data DATA1 stored in the work area of the RAM 12 matches the received data RXDATA from the subcomputer 1b. It is possible to determine whether or not the

一方、上記ステップ、5113でリードモードのときに
は、上記ステップ5113からステップ5120へ進み
、コマンドCOHの2ビツトにオフセットアドレスAD
 0FFSET (6ビツト)を加えた1バイトのデー
タを送信データT XDATA ニーt= ッl−しく
 T XDATA ←COH+ A D 0FFSET
)−ステップ5121でサブコンピュータ1bとの送受
信を実行する。
On the other hand, if the read mode is selected in the above step 5113, the process proceeds from the above step 5113 to step 5120, and the offset address AD is set to 2 bits of the command COH.
0FFSET (6 bits) plus 1 byte of data is sent as data T
)--In step 5121, transmission and reception with the subcomputer 1b is executed.

このリードモードにおいては、第2バイトの送信データ
T XDATAは、第1バイトデータDATAIと同じ
データを送信し、先にアドレス指定したメモリの内容を
サブコンピュータ1bから受信すると、ステップ512
2で、この受信データRXDATAを第2バイトデータ
DATA2としてRAM12のワークエJ7Gニス)7
L (DATA2 ←RXDATA ) 、xテップ5
123で送信カウンタをカウントアツプして(MCNT
 4−MCNT + 1 )ルーチンを抜ける。
In this read mode, the second byte of transmission data T
2, the received data RXDATA is used as the second byte data DATA2 and the RAM 12 work area J7G varnish)7
L (DATA2 ←RXDATA), x step 5
123 to count up the transmission counter (MCNT
4-MCNT+1) Exit the routine.

さらに、次の通信ルーチンにおいて、ステップ3101
で送信カウンタのカウント値MCNTが“3″、すなわ
ち第3バイトデータDATA3の送信のときには、ステ
ップ5124でモード判定を行ない、ベースアドレス設
定モードのとき、ステップ5124からステップ512
5へ進んでベースアドレスA D BASEの上位バイ
トA D BASE/Uを送信データTXD^■^に再
びセットしテ(TXDATA 4−A D BASE/
U) ステラ7S127へ進み、ライI・モードのとき
には、ステップ5124からステップ8126へ進んで
ライl−データW DATAヲ送信データT XDAT
A 4m再びセットしく T XDATA←WDATA
) 、ステ・ンプ5127へ進む。
Furthermore, in the next communication routine, step 3101
When the count value MCNT of the transmission counter is "3", that is, when the third byte data DATA3 is being transmitted, the mode is determined at step 5124, and when the base address setting mode is set, the steps from step 5124 to step 512 are performed.
Proceed to step 5 and set the upper byte A D BASE/U of the base address A D BASE to the transmission data TXD^■^ again (TXDATA 4-A D BASE/
U) Proceed to STELLA 7S127, and when in the Lye I mode, proceed from Step 5124 to Step 8126 and send the Lye data W DATA to the transmission data T XDAT.
A Set 4m again T XDATA←WDATA
), proceed to Step 5127.

ステップ5127では、エラーフラグFLAG1の値に
より、前回、通信が正常に行われたか否かを判別し、F
LAG1=Oすなわち通信が正常に実行されたときには
ステップ5129ヘジヤンブしてサブコンピュータ1b
に対する送受信を実行し、FLAGl = 1すなわち
通信に異常があったときにはステラ7S127からステ
ップ3128へ進んで、送信データT XDATAの全
ビットを反転し、ステップ5129でサブコンピュータ
1bに対する送受信を実行する。つまり、第2バイトま
でのデータ通信が正常に実行された場合、第3バイトデ
ータDATA3は第2バイトデータDATA2と同一の
データを送信し、通信が異常の場合、第3バイトデータ
DATA3は第2バイトデータDATA2を全ビット反
転したデータを送信するのである。
In step 5127, it is determined based on the value of the error flag FLAG1 whether communication was performed normally last time, and F
When LAG1=O, that is, communication has been executed normally, step 5129 is performed and the subcomputer 1b
When FLAGl = 1, that is, there is an abnormality in communication, the process proceeds from STELLA 7S127 to step 3128, inverts all bits of the transmission data TXDATA, and in step 5129 executes transmission and reception to the subcomputer 1b. In other words, 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 transmits the same data as the second byte data DATA2. Data obtained by inverting all bits of the byte data DATA2 is transmitted.

次いで、上記ステップ5129からステップ3130へ
進むと、サブコンピュータ1bから受信したデータRX
DATAとサブコンピュータ1bに送信した第2バイト
データDATA2とが一致するか否かにより通信が正常
に行われたか否かを判別する。
Next, when the process proceeds from step 5129 to step 3130, the data RX received from the subcomputer 1b is
It is determined whether the communication was performed normally or not based on whether or not DATA matches the second byte data DATA2 sent to the subcomputer 1b.

通信が正常に行われた場合、サブコンピュータ1bから
は、既に送信した第2バイトデータDATA2と同一の
データが返信されるため、上記ステラフS130テRX
DATA =DATA2 ノときには3バイトのデータ
の通信が正常に実行されたと判別でき、上記ステップ5
130からステップ5137ヘジヤンプして送信カウン
タをクリアして(M CNT←0)ルーチンを抜ける。
If the communication is performed normally, the subcomputer 1b returns the same data as the already transmitted second byte data DATA2.
When DATA = DATA2, it can be determined that communication of 3 bytes of data has been executed normally, and step 5 above is performed.
The program jumps from step 130 to step 5137, clears the transmission counter (MCNT←0), and exits the routine.

また、上記ステップ5130でRXDA丁A≠DA丁A
2のときには、通信に異常があるため上記ステップ51
30からステップ5131へ進んでエラーフラグFLA
G2をセットしく FLAG2←1)、ステップ513
7で送信カウンタをクリアして(M CNT←0)ルー
チンを抜ける。
Also, in step 5130 above, RXDA Ding A≠DA Ding A
At step 2, there is an abnormality in communication, so step 51 is performed.
30, proceed to step 5131 and set the error flag FLA.
Set G2 FLAG2←1), step 513
At step 7, clear the transmission counter (MCNT←0) and exit the routine.

一方、上記ステップ5124でリードモードのときには
、上記ステップ5124からステップ5132へ進んで
コマンドCOHの2ビツトにオフセットアドレスA D
 0FFSET (6ビツト)を加えた1バイトのデー
タを送信データT XDATAにセットしく T X[
1ATA←CO)!+ A D 0FFSET) 、こ
の送信データT XDATAをステップ5133でサブ
コンピュータ1bに送信するとともに、サブコンピュー
タ1bから1バイトの返信データを受信する。
On the other hand, if the read mode is selected in step 5124, the process proceeds from step 5124 to step 5132, where the offset address AD is set to 2 bits of the command COH.
Set 0FFSET (6 bits) plus 1 byte of data to the transmit data T
1ATA←CO)! + A D 0FFSET), this transmission data T XDATA is transmitted to the subcomputer 1b in step 5133, and 1 byte of return data is received from the subcomputer 1b.

次いで、上記ステップ5133からステップ5134へ
進むと、サブコンピュータ1bから受信したデータRX
DATAの全ビットを反転した値RXl)ATAが、既
にサブコンピュータ1bから受信した第2バイトデータ
DATA2と一致するか否かを判別する。
Next, when the process proceeds from step 5133 to step 5134, the data RX received from the subcomputer 1b is
It is determined whether the value RXl)ATA obtained by inverting all bits of DATA matches the second byte data DATA2 already received from the subcomputer 1b.

すなわち、サブコンピュータ1bからの第3バイト目の
返信データは、第2バイト目の返信データの全ビットを
反転した値であるため、この第3バイト目の返信データ
を受信した値RX0ATAの全ビットを反転して元に戻
し、第2バイトデータ1)ATA2と比較することによ
りデータの有効性を判別できる。
In other words, since the third byte of return data from the subcomputer 1b is a value obtained by inverting all the bits of the second byte of return data, all bits of the value RX0ATA received from this third byte of return data The validity of the data can be determined by inverting it and comparing it with the second byte data 1) ATA2.

従って、サブコンピュータ1bに異常が発生し、SCI
 24の送受信バッファ40に正規の返信データがセッ
トされない場合、従来のように単に連続した2つの受信
データの一致によりデータの有効性を判別すると、メイ
ンコンピュータ1aから送信したデータ(コマンドCO
Hの2ビツトにオフセットアドレスA D 0FFSE
Tの6ビツトを加えたデータ)が上記ステップ5121
およびステップ5133でエコーバックされ、データが
有効と誤判定されてしまうが、本発明によれば、サブコ
ンピュータ1bの異常を正しく認識してデータの有効性
を正確に判別でき、信頼性を大幅に向上することができ
るのである。
Therefore, an abnormality occurs in the subcomputer 1b, and the SCI
If regular reply data is not set in the sending/receiving buffer 40 of the main computer 1a, if the validity of the data is determined by simply matching two consecutive received data as in the past, the data sent from the main computer 1a (command CO
Offset address A D 0FFSE in 2 bits of H
The data obtained by adding 6 bits of T) is obtained in step 5121 above.
However, according to the present invention, it is possible to correctly recognize an abnormality in the subcomputer 1b and accurately determine the validity of the data, greatly improving reliability. It is possible to improve.

そして、上記ステラ75134テRXDATA = D
ArA2の場合には、通信が正常に行われているため、
上記ステップ5134からステップ5135へ進んでサ
ブコンピュータ1bから受信したデータRXDATAの
全ビットを反転した値RXDATA (あるいはすでに
RAM22のワークエリアにストアしである第2バイト
データDATA2 )を確定データとしてRAM 12
のデータエリアにストアし、ステップ5137へ進んで
送信カウンタをクリアして(MCNT−0)ルーチンを
抜ける。
And the above Stella 75134 RXDATA = D
In the case of ArA2, communication is occurring normally, so
Proceeding from step 5134 to step 5135, the value RXDATA obtained by inverting all bits of the data RXDATA received from the subcomputer 1b (or the second byte data DATA2 already stored in the work area of the RAM 22) is stored in the RAM 12 as final data.
The process proceeds to step 5137, clears the transmission counter (MCNT-0), and exits the routine.

一方、上記ステラ75134テRXDATA −# D
ATA2 (7)場合には、通信に異常があるため、上
記ステップ5134からステップ8136へ進んでエラ
ーフラグFLAG2をセットしく FLAG2 = 1
 ) −ステラ75137テ送信カウンタをクリアして
(MCNT←0)ルーチンを抜ける。
On the other hand, the above Stella 75134 RXDATA-#D
If ATA2 (7), there is an abnormality in communication, so proceed from step 5134 to step 8136 and set the error flag FLAG2. FLAG2 = 1
) - Clear the Stellar 75137 transmission counter (MCNT←0) and exit the routine.

なお、各エラーフラグFLAGI 、 FLAG2のク
リアは、別ルーチンでエラーチエツクを行い、クリアす
る。
Note that the error flags FLAGI and FLAG2 are cleared by performing an error check in a separate routine.

(サブコンピュータ1bの通信手順) 一方、サブコンピュータ1bにおいては、メインコンピ
ュータ1aからのデータ受信毎に第2図に示す通信ルー
チンが起動され、まず、ステップ5201で受信間隔を
時間変数THにセットしくTR←受信間隔)、次いで、
この時間変数TRと設定値T SETとをステップ52
02で比較する。
(Communication Procedure of Subcomputer 1b) On the other hand, in the subcomputer 1b, the communication routine shown in FIG. TR←reception interval), then
This time variable TR and set value T SET are set in step 52.
Compare with 02.

この設定値TSETは、1ブロツクのデータの通信にお
けるバイトサイクルの周期T(例えば、T−4113)
よりも長く、通信ブロックTXB間のブランク区間T 
BLANKを識別可能な値(例えば、TSET=61S
)に設定されており、上記ステップ5202で、TR>
TSETのときには、受信間隔が通常のバイトサイクル
の周期Tよりも長く、ブランク区間T BLANにを経
て初めてのデータ受信すなわち先頭の第1バイトのデー
タ受信であると判別でき、ステップ5203で受信カウ
ンタのカウント値5CNTをクリアする( S CNT
←0)。
This setting value TSET is the byte cycle period T (for example, T-4113) in communication of one block of data.
The blank interval T between communication blocks TXB is longer than
A value that can identify BLANK (for example, TSET=61S
), and in step 5202 above, TR>
When TSET, the reception interval is longer than the period T of the normal byte cycle, and it can be determined that the first data reception is the first data reception after passing through the blank interval T BLAN, and in step 5203, the reception counter is set. Clear the count value 5CNT ( S CNT
←0).

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

そして、上記ステップ5203からステップ5204へ
進むと、受信データRXDATAの上位2ビツト(RX
DATA)87B6、すなわちコマンドCOHを解釈し
、(RXDATA)87B6= 11 、すなわちベー
スアドレスモードを指示するコマンドCOHのときには
、上記ステップ5204からステップ3205へ進んで
ベースアドレスモードに設定してステップ5207へ進
み、< RXDATA)87B6= 01 、すなわち
ライトモードを指示するコマンドCOHのときには、上
記ステップ5204からステップ8206へ進んでライ
トモードに設定してステップ5207へ進む。
Then, when the process proceeds from step 5203 to step 5204, the upper 2 bits (RX
DATA)87B6, that is, the command COH is interpreted, and when (RXDATA)87B6=11, that is, the command COH instructing the base address mode, the process proceeds from step 5204 to step 3205, sets the base address mode, and proceeds to step 5207. , <RXDATA)87B6=01, that is, when the command COH instructs the write mode, the process proceeds from step 5204 to step 8206, sets the write mode, and proceeds to step 5207.

そして、上記ステップ5205あるいはステップ820
6からステップ5207へ進むと、受信データRXD^
■^を第1バイト目のデータDATAIとしてRAM2
2の’7−りL’JTにストアしくDATAl ←RX
DATA)、ステップ8208で受信データRXDAT
Aをメインコンピュータ1aへの返信データ(サブコン
ピュータ1bからの送信データ) TXDATAにセッ
トしくTXDATA 4−RXDATA)、ステップ5
222へ進ンテ受信カウンタのカウント値S CNTを
カウントアツプしく5CNT←5CNT+1)、ルーチ
ンを抜ける。
Then, step 5205 or step 820
6 to step 5207, the received data RXD^
■ ^ as the first byte data DATAI in RAM2
Store DATA in 2'7-ri L'JT ←RX
DATA), and the received data RXDAT in step 8208
Set A to TXDATA as the return data to the main computer 1a (transmission data from the subcomputer 1b) (TXDATA 4-RXDATA), Step 5
The process advances to step 222 and the count value S CNT of the reception counter is counted up (5CNT←5CNT+1), and the routine exits.

また、上記ステップ5204で(RXDATA)87B
6= 10、すなわちリードモードを指示するコマンド
COHのときには、上記ステップ5204からステップ
5209へ進んでリードモードに設定し、ステップ52
10でベースアドレスA D BASEとオフセットア
ドレスA D 0FFSETにより定まるRAM22の
物理アドレスからメモリの内容(A D BASE十A
 D 0FFSET)を読出し、このメモリの内容(A
DB^旺+A D 0FFSET)をメインコンピュー
タ1aへの返信データTxDATAニセットしくTXD
ATA ←(ADBASE+ADOFFSET) ) 
、同様に、ステップ5222で受信カウンタ5CNTを
カウントアツプして(S CNT←5CNT+1)ル−
チンを抜ける。
Also, in step 5204 above, (RXDATA) 87B
When 6=10, that is, the command COH instructs the read mode, the process proceeds from step 5204 to step 5209 to set the read mode, and then proceeds to step 52.
10, the contents of the memory (A D BASE
D 0FFSET) and the contents of this memory (A
DB^O+A D 0FFSET) to the main computer 1a as reply data TxDATA falsely TXD
ATA ← (ADBASE+ADOFFSET) )
Similarly, in step 5222, the reception counter 5CNT is counted up (SCNT←5CNT+1) and the rule is
Exit Chin.

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

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

上記ステップ5211で5CNT=1すなわち第2バイ
トのデータ受信のときには、上記ステップ5211から
ステップ5212へ進んでモード判定を行ない、ベース
アドレスモード及びライトモードのときには、ステップ
5213で受信データRXDATAを第2バイトのデー
タDATA2としてRAM22のワークアリアニスドア
すル(0^TA2−RXDATA)。
When 5CNT=1, that is, the second byte of data is received in the above step 5211, the process proceeds from the above step 5211 to step 5212 to determine the mode, and when the mode is base address mode and write mode, the received data RXDATA is transferred to the second byte in step 5213. The data DATA2 of the RAM 22 is processed by the RAM 22 (0^TA2-RXDATA).

そして、上記ステップ5213からステップ5214へ
進み、前回受信した第1バイトのデータDATA+をメ
インコンピュータ1aへの返信データT XDATAニ
セットしく T XDATA = DATAI) 、 
ステ・y 7” 5222で受信カウンタをカウントア
ツプして(S CNT←5CNT+1)ル−チンを抜け
る。
Then, the process proceeds from step 5213 to step 5214, where the previously received first byte data DATA+ is returned to the main computer 1a as return data T XDATA (T XDATA = DATAI),
The reception counter is counted up (S CNT←5CNT+1) at step y7'' 5222 and the routine is exited.

また、上記ステップ5212でリードモードのときには
、上記ステップ5212からステップ5215へ進み、
ベースアドレスA D BASEとオフセットアドレス
AD 0FFSETにより定まるRAM22の物理アド
レスのメモリの内容(A D BASE+ A D 0
FFSET)を全ビット反転し、この全ビットを反転し
た値(A D BASE+ A D 0FFSET)を
メインコンピュータ1aへの返信データT XDATA
にセットしくTXDATA←(AD BASE+ A 
D 0FFSET) ) 、同様に、ステップ5222
で受信カウンタ5CNTをカウントアツプして(SCN
T←5CNT+1)ルーチンを抜ける。
Further, when the read mode is selected in step 5212, the process proceeds from step 5212 to step 5215,
The memory contents of the physical address of RAM22 determined by the base address AD BASE and offset address AD 0FFSET (AD BASE + AD 0
FFSET), all bits are inverted, and the value (A D BASE + A D 0FFSET) with all bits inverted is sent as return data T XDATA to the main computer 1a.
Please set TXDATA←(AD BASE+ A
D0FFSET) ), similarly, step 5222
to count up the reception counter 5CNT (SCN
T←5CNT+1) Exit the routine.

一方、上記ステップ5211で5CNT=#1のときに
は、第3バイトのデータ通信であり、上記ステップ52
11からステップ8216へ進んでモード判定を行ない
、リードモードのとき、上記ステップ8216からステ
ップ5221ヘジヤンプし、ベースアドレスモードのと
き、ステップ5217でメインコンピュータ1aからの
受信データRXDATAとRAM22にストアした第2
バイトのデータDATA2とを比較する。
On the other hand, when 5CNT=#1 in the above step 5211, it is the third byte data communication, and the above step 52
11, the process proceeds to step 8216 to determine the mode. If the read mode is selected, the process jumps from step 8216 to step 5221, and if the base address mode is selected, the received data RXDATA from the main computer 1a and the second data stored in the RAM 22 are transferred in step 5217.
Compare with byte data DATA2.

上述したように、メインコンピュータ1aから送信され
るデータは、通信が正常に行われている場合、第2バイ
トと第3バイトのデータは同じデータであり、通信に異
常がある場合、第3バイトのデータは第2バイトのデー
タを全ビット反転したデータであるため、上記ステップ
5217でRXDAT^≠DATA2のときには、通信
に際して異常があるため上記ステップ5217からステ
ップ5221ヘジヤンプし、RXDATA =DATA
2のときには通信は正常であるため、上記ステップ52
17からステップ8218へ進んで第2バイトデータD
ATA2を上位バイトにセットするとともに、第1バイ
トのデータ0^TA1の下位6ビツトを上位にシフトし
て下位2ビツトを“OO′とするバイトデータ(DAT
Al)00を下位バイトにセットし、ベースアドレスA
 D BASEを設定して(A D BASE 4−D
ATA2 + (DATAl)00 )ステップ522
1へ進む。
As mentioned above, in the data sent from the main computer 1a, when communication is performed normally, the second and third bytes are the same data, and when there is an abnormality in communication, the third byte is the same data. Since the data is the data obtained by inverting all bits of the data of the second byte, when RXDAT^≠DATA2 in the above step 5217, there is an abnormality in communication, so the step 5221 jumps from the above step 5217, and RXDATA = DATA.
2, the communication is normal, so step 52 is performed.
Proceeding from step 17 to step 8218, the second byte data D
Byte data (DAT
Al) Set 00 in the lower byte and set the base address A
Set D BASE (AD BASE 4-D
ATA2 + (DATA1)00) Step 522
Go to 1.

また、上記ステップ5216でライトモードの場合には
、上記ステップ8216からステップ5219へ進み、
同様に、メインコンピュータ1aからの受信データRX
DATAとRAM22にストアした第2パイ1〜のデー
タDATA2 トを比較して、RXDATA# DAT
A2のとき、上記ステップ5219からステップ522
1ヘジヤンプし、RXDATA =DATA2 ノ、!
:き、上記ステップ5219からステップ5220へ進
んで、メインコンピュータ1aからの受信データRXD
ATAを確定データとして、ベースアドレスA D B
ASEとオフセットアドレスA D 0FFSETによ
り定まるRAM22の物理アドレスに書込み((A D
 BASE+ A D 0FFSET)←Rx0A[A
)、ステップ5221へ進む。
Further, if the light mode is selected in step 5216, the process proceeds from step 8216 to step 5219;
Similarly, received data RX from the main computer 1a
Compare DATA and data DATA2 of the second pie 1 to 1 stored in RAM22, and write RXDATA# DAT.
When A2, step 5219 to step 522
1 jump, RXDATA = DATA2 ノ,!
: Then, the process proceeds from step 5219 to step 5220, and the received data RXD from the main computer 1a is
Using ATA as final data, base address A D B
Write to the physical address of RAM22 determined by ASE and offset address A D 0FFSET ((A D
BASE+ A D 0FFSET)←Rx0A[A
), proceed to step 5221.

そして、各モードに応じて上記ステップ5216,52
18.5220の各ステップからステップ5221へ進
むと、通信可能の場合上位2ビツトを“00“、通信不
可の場合上位2ビツトを“11”とする受信許可コード
SCをメインコンピュータ1aへの返信デ−タTXDへ
TAにセットし、ステップ5222で受信カウンタS 
CNTをカウントアツプして(S CNT←SCM丁+
1)!レ丁子1を抜ける。
Then, steps 5216 and 52 are performed according to each mode.
18. Proceeding from each step of 5220 to step 5221, the reception permission code SC is returned to the main computer 1a, with the upper two bits set to "00" if communication is possible, and the upper two bits set to "11" if communication is not possible. - Set the reception counter S to TA in step 5222.
Count up CNT (S CNT←SCM ding+
1)! Pass through Lechoco 1.

この受信許可コードSCは、メインコンピュータ1aに
よって起動される次の通信ブロックTXBにおいて、先
頭バイトのデータ送信タイミングでメインコンピュータ
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 TXB activated by the main computer 1a.

[発明の効果] 以上説明したように本発明によれば、第1のデータと、
この第1のデータの全ビットを反転した第2のデータと
を受信し、この第2のデータの受信値を全ビット反転し
た値と前記第1のデータの受信値とを比較することによ
り、前記第1のデータの受信値が有効か否かを判別する
ため、通信先のコンピュータに生じた異常によるデータ
を認識でき、データの有効性を正確に判別して通信の信
頼性を向上することができるなど優れた効果が奏される
[Effects of the Invention] As explained above, according to the present invention, the first data and
By receiving second data obtained by inverting all bits of this first data, and comparing the value obtained by inverting all bits of the received value of this second data with the received value of the first data, In order to determine whether or not the received value of the first data is valid, it is possible to recognize data due to an abnormality occurring in a communication destination computer, and to accurately determine the validity of the data to improve communication reliability. Excellent effects can be achieved.

【図面の簡単な説明】[Brief explanation of the drawing]

図面は本発明の一実施例を示し、第1図はメインコンピ
ュータの通信手順を示すフローチャート、第2図はサブ
コンピュータの通信手順を示すフローチャート、第3図
は制御装置の回路ブロック図、第4図は送受信バッファ
を示す説明図、第5図はクロック同期通信のタイムチャ
ート、第6図は通信ブロックの構成を示す説明図である
。 1a・・・メインコンピュータ 1b・・・サブコンピュータ T XDATA・・・送信データ RXDATA・・・受信データ
The drawings show one embodiment of the present invention; FIG. 1 is a flowchart showing the communication procedure of the main computer, FIG. 2 is a flowchart showing the communication procedure of the subcomputer, FIG. 3 is a circuit block diagram of the control device, and FIG. FIG. 5 is an explanatory diagram showing a transmission/reception buffer, FIG. 5 is a time chart of clock synchronous communication, and FIG. 6 is an explanatory diagram showing the configuration of a communication block. 1a...Main computer 1b...Sub computer T XDATA...Transmission data RXDATA...Reception data

Claims (1)

【特許請求の範囲】  シリアルチャンネルで結合した車載コンピュータ間の
データ通信方法において、 所定のビット数からなる第1のデータと、この第1のデ
ータの全ビットを反転した第2のデータとを受信し、こ
の第2のデータの受信値を全ビット反転した値と前記第
1のデータの受信値とを比較することにより、前記第1
のデータの受信値が有効か否かを判別することを特徴と
する車載コンピュータ間のデータ通信方法。
[Claims] In a data communication method between in-vehicle computers connected via a serial channel, first data consisting of a predetermined number of bits and second data obtained by inverting all bits of the first data are received. By comparing the received value of the second data with all bits inverted and the received value of the first data, the first
1. A data communication method between in-vehicle computers, characterized in that it is determined whether a received value of data is valid or not.
JP2298449A 1990-11-02 1990-11-02 Data communication method between in-vehicle computers Expired - Lifetime JPH0722281B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2298449A JPH0722281B2 (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
JP2298449A JPH0722281B2 (en) 1990-11-02 1990-11-02 Data communication method between in-vehicle computers

Publications (2)

Publication Number Publication Date
JPH04170829A true JPH04170829A (en) 1992-06-18
JPH0722281B2 JPH0722281B2 (en) 1995-03-08

Family

ID=17859856

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2298449A Expired - Lifetime JPH0722281B2 (en) 1990-11-02 1990-11-02 Data communication method between in-vehicle computers

Country Status (1)

Country Link
JP (1) JPH0722281B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007285745A (en) * 2006-04-13 2007-11-01 Matsushita Electric Ind Co Ltd Angular velocity sensor
WO2014132740A1 (en) 2013-02-27 2014-09-04 日立オートモティブシステムズ株式会社 Vehicle control device

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006261948A (en) * 2005-03-16 2006-09-28 Toyota Motor Corp Communication system, transmission device, and receiving device

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63290033A (en) * 1987-05-21 1988-11-28 Nec Corp Data transmission reception circuit

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63290033A (en) * 1987-05-21 1988-11-28 Nec Corp Data transmission reception circuit

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007285745A (en) * 2006-04-13 2007-11-01 Matsushita Electric Ind Co Ltd Angular velocity sensor
WO2014132740A1 (en) 2013-02-27 2014-09-04 日立オートモティブシステムズ株式会社 Vehicle control device
US9783138B2 (en) 2013-02-27 2017-10-10 Hitachi Automotive Systems, Ltd. Vehicle control device

Also Published As

Publication number Publication date
JPH0722281B2 (en) 1995-03-08

Similar Documents

Publication Publication Date Title
EP0258872B1 (en) Serial data transfer system
US4750176A (en) Single-channel communication bus system and station for use in such system
US8555144B2 (en) Memory system, memory system controller, and a data processing method in a host apparatus
US5951666A (en) Bus system having both serial and parallel busses
EP0709803A2 (en) Contactless IC card system and communication method thereof
EP0419112A2 (en) Serial data transmission
US20030171853A1 (en) Device for data transmission between vehicle sensors and a processor in a controller
US6690733B1 (en) Method for data transmission
US5367644A (en) Communication system
CN109154925A (en) Communication equipment, communication means, program and communication system
JPH04170829A (en) Data communication method between on-vehicle computers
US5696776A (en) Data transmission method in a real-time data processing system
EP0085973A2 (en) Information transmission system
EP1926023A2 (en) Communication system and electronic control unit including communication system for vehicle control
JPH04170828A (en) Data communication method between on-vehicle computers
KR20080013973A (en) Method for communication between at least two subscribers of a communication system
EP1764700A1 (en) System for elevator electronic safety device
US20040107378A1 (en) Method and device for the serial transmission of data from a processor module to at least one peripheral element
JP2731878B2 (en) Communication device
KR100295683B1 (en) General call acknowledge apparatus and method for inter-integrated circuit
JP3057539B2 (en) Communication emulator device
JP2022085574A (en) In-vehicle communication device, in-vehicle communication system, and in-vehicle communication method
JPH0561988A (en) Identification system
JPH09223203A (en) Non-contact ic card
JPH0991100A (en) Data transmission controller

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

Year of fee payment: 13

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

Free format text: PAYMENT UNTIL: 20090308

Year of fee payment: 14

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

Free format text: PAYMENT UNTIL: 20090308

Year of fee payment: 14

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

Free format text: PAYMENT UNTIL: 20100308

Year of fee payment: 15

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

Free format text: PAYMENT UNTIL: 20100308

Year of fee payment: 15

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

Free format text: PAYMENT UNTIL: 20110308

Year of fee payment: 16

EXPY Cancellation because of completion of term
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110308

Year of fee payment: 16