JPH07175736A - Inter-cpu data transfer device - Google Patents

Inter-cpu data transfer device

Info

Publication number
JPH07175736A
JPH07175736A JP5320323A JP32032393A JPH07175736A JP H07175736 A JPH07175736 A JP H07175736A JP 5320323 A JP5320323 A JP 5320323A JP 32032393 A JP32032393 A JP 32032393A JP H07175736 A JPH07175736 A JP H07175736A
Authority
JP
Japan
Prior art keywords
data
input
communication
cpu
edge
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.)
Pending
Application number
JP5320323A
Other languages
Japanese (ja)
Inventor
Yoichi Nishiyori
洋一 西依
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Denso Corp
Original Assignee
NipponDenso Co 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 NipponDenso Co Ltd filed Critical NipponDenso Co Ltd
Priority to JP5320323A priority Critical patent/JPH07175736A/en
Publication of JPH07175736A publication Critical patent/JPH07175736A/en
Pending legal-status Critical Current

Links

Landscapes

  • Computer And Data Communications (AREA)
  • Multi Processors (AREA)

Abstract

PURPOSE:To decrease the number of communication ports used between CPUs in regard of a data transfer device which can perform the parallel communication at a high speed between the CPUs. CONSTITUTION:An inter-CPU data transfer device transfers data between a master CPU 16 and a slave CPU 26 by the parallel communication and via the data lines D7-D0. The CPU 16 is provided with a data transfer processing means and an edge pulse generation processing means. Then the CPU 26 is provided with a terminal function means which can be used in common by a general-purpose input port 35 and an edge input mechanism 41 and a reception processing means which can discriminate an edge input factor. The mechanism 41 includes a system that can perform the interruption processing.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、複数のCPU間でデー
タを転送する装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a device for transferring data between a plurality of CPUs.

【0002】[0002]

【従来の技術】複数のCPU間でデータを転送する場
合、パラレル通信又はシリアル通信によりデータの転送
が行われる。そして、通信タイミングの異なる複数のデ
ータの転送又は使用目的の異なる複数のデータの転送の
際、受信側はそのデータの識別が必要となる。シリアル
通信においては、転送データ群に識別コードを含める方
式が多く用いられている。また、パラレル通信によるデ
ータ転送においては、データ送出の際、データ信号と別
にデータ送出信号を送出する必要がある。
2. Description of the Related Art When data is transferred between a plurality of CPUs, the data is transferred by parallel communication or serial communication. Then, when transferring a plurality of data having different communication timings or transferring a plurality of data having different purposes of use, the receiving side needs to identify the data. In serial communication, a method of including an identification code in a transfer data group is often used. Further, in data transfer by parallel communication, it is necessary to send a data sending signal separately from the data signal when sending the data.

【0003】[0003]

【発明が解決しようとする課題】パラレル通信は、例え
ば、パソコンからプリンタへデータを送出する場合に使
用され、シリアル通信よりも高速で通信を行うことがで
きるという利点を有する。しかしながら、パラレル通信
においては、データ送出の際、データ信号と別にデータ
送出信号を送出する必要があるために、データ送出信号
用の信号線を余分に必要としていた。
Parallel communication is used, for example, when sending data from a personal computer to a printer, and has an advantage that communication can be performed at higher speed than serial communication. However, in parallel communication, since it is necessary to send the data sending signal separately from the data signal when sending the data, an extra signal line for the data sending signal is required.

【0004】本発明は、複数のCPU間を高速で通信す
ることができるパラレル通信を行うデータ転送装置にお
いて、CPU間の通信用ポートの使用数を削減すること
を目的とする。さらに本発明は、上記データ転送装置に
おいて、マスタCPUから送られてくるデータの種類
を、1つの割込みと他の端子のエッジ入力状況をチェッ
クするだけで識別できるようにして、通信量を減らすこ
とを目的とするものである。
SUMMARY OF THE INVENTION It is an object of the present invention to reduce the number of communication ports used between CPUs in a data transfer device which performs parallel communication capable of high-speed communication between a plurality of CPUs. Further, according to the present invention, in the above data transfer device, the type of data sent from the master CPU can be identified only by checking one interrupt and the edge input status of another terminal, thereby reducing the communication amount. The purpose is.

【0005】[0005]

【課題を解決するための手段】上記目的を達成するた
め、本発明は、マスタCPUとスレーブCPU間で複数
のデータラインを用いてパラレル通信によりデータ転送
を行う複数CPU間データ転送装置において、前記マス
タCPUは、データの送信処理手段及びエッジパルス発
生処理手段を具備し、前記スレーブCPUは、汎用入力
ポートとエッジ入力機構が兼用できる端子機能手段及び
エッジ入力要因を識別できる受信処理手段を具備し、前
記エッジ入力機構は、割込み処理が可能なシステムを具
備するようにする。
In order to achieve the above object, the present invention provides a data transfer device between a plurality of CPUs which transfers data by parallel communication between a master CPU and a slave CPU using a plurality of data lines. The master CPU includes a data transmission processing unit and an edge pulse generation processing unit, and the slave CPU includes a terminal function unit that can be used by a general-purpose input port and an edge input mechanism and a reception processing unit that can identify an edge input factor. The edge input mechanism has a system capable of interrupt processing.

【0006】[0006]

【作用】データ転送時、マスタCPUは所定のタイミン
グで転送するデータを決定する。そしてスレーブCPU
へ受信要求信号と転送データの属性をコード化し、エッ
ジ信号を発生させる。スレーブCPU側は、エッジ入力
による割込み発生後、まず、転送されるデータの属性を
抽出する。そしてデータの属性と関係のない不必要なフ
ラグビットをクリヤして得た値をオフセット値として、
機能別処理ルーチンアドレスの演算を行い、処理ルーチ
ンを実行する。
When the data is transferred, the master CPU determines the data to be transferred at a predetermined timing. And slave CPU
Generates an edge signal by encoding the attributes of the reception request signal and transfer data. The slave CPU side first extracts the attribute of the data to be transferred after the occurrence of the interrupt due to the edge input. Then, the value obtained by clearing unnecessary flag bits unrelated to the data attribute is used as the offset value,
The processing routine address for each function is calculated, and the processing routine is executed.

【0007】[0007]

【実施例】始めに、本発明のCPU間データ転送装置を
適用するエンジン制御装置について説明する。図2は、
エンジン制御装置の全体構成図を示す。ここでは、各種
入力情報(スイッチ信号、パルス信号、アナログ信号)
をもとに燃料噴射量計算、点火時期計算、過給圧制御用
演算、バルブ制御用演算等を行うECU10と、そのE
CU10で演算された結果を用いてインジェクタ、イグ
ナイタ、バルブ等へ駆動信号を出力するECU20とが
示されている。
DESCRIPTION OF THE PREFERRED EMBODIMENTS First, an engine control device to which the inter-CPU data transfer device of the present invention is applied will be described. Figure 2
The whole engine control block diagram is shown. Here, various input information (switch signal, pulse signal, analog signal)
ECU 10 which performs fuel injection amount calculation, ignition timing calculation, boost pressure control calculation, valve control calculation, etc. based on
The ECU 20 that outputs a drive signal to an injector, an igniter, a valve, and the like using the result calculated by the CU 10 is shown.

【0008】ECU10は、スタートスイッチ、シフト
信号等の各種スイッチ信号を入力するための入力バッフ
ァ11、回転数センサ、気筒判別センサ等からのパルス
信号を波形整形して入力する波形整形回路12、吸気管
圧力センサ、水温センサ等からのアナログ信号をディジ
タル信号に変換して入力するA/D変換回路13、これ
ら各部に接続されたI/Oポート15、I/Oポート1
5を介して上記スイッチ信号及びセンサ信号を取り込ん
でエンジン制御のための演算処理を行い、ECU20へ
演算結果を通信出力するCPU16、CPU16が演算
処理を行うためのプログラム及び各種データが格納され
たROM17、演算処理を行う際、ワーキングエリアと
して使用するRAM18により構成されている。
The ECU 10 includes a start switch, an input buffer 11 for inputting various switch signals such as a shift signal, a waveform shaping circuit 12 for shaping and inputting pulse signals from a rotation speed sensor, a cylinder discrimination sensor, etc. An A / D conversion circuit 13 for converting an analog signal from a pipe pressure sensor, a water temperature sensor, etc. into a digital signal and inputting it, an I / O port 15 and an I / O port 1 connected to these respective parts.
The CPU 16 that takes in the switch signal and the sensor signal via 5 to perform arithmetic processing for engine control and outputs the arithmetic result to the ECU 20 by communication, and the ROM 17 in which programs and various data for the CPU 16 to perform arithmetic processing are stored. The RAM 18 is used as a working area when performing arithmetic processing.

【0009】ECU20は、ECU10と同様に、CP
U26、ROM27、RAM28、波形整形回路22、
I/Oポート25の他、CPU26からの駆動信号を出
力する出力ドライバ24で構成されている。CPU16
とCPU26の間は、通信線であるデータラインD7
0 で接続されている。
The ECU 20, like the ECU 10, has a CP
U26, ROM27, RAM28, waveform shaping circuit 22,
In addition to the I / O port 25, the output driver 24 outputs a drive signal from the CPU 26. CPU16
Between the CPU 26 and the CPU 26, the data line D 7 to be a communication line.
Connected at D 0 .

【0010】図1に本発明の実施例の構成図を示す。こ
こでは、前述の図2のECU10のCPU16がマスタ
CPU、ECU20のCPU26がスレーブCPUとな
る。マスタCPU16は、出力設定可能な8ビット長の
汎用ポート30を備え、更にこの汎用ポート30用の入
出力設定レジスタ31(図3)、出力用データレジスタ
32(図4)を備えている。汎用ポート30の各端子O
7〜O0は、スレーブCPU26の汎用ポート35の各
端子I7〜I0とデータラインD7 〜D0 により接続さ
れる。
FIG. 1 shows a block diagram of an embodiment of the present invention. Here, the CPU 16 of the ECU 10 of FIG. 2 described above is the master CPU, and the CPU 26 of the ECU 20 is the slave CPU. The master CPU 16 is provided with an 8-bit length general-purpose port 30 whose output can be set, and further, an input / output setting register 31 (FIG. 3) and an output data register 32 (FIG. 4) for the general-purpose port 30. Each terminal O of general-purpose port 30
7~O0 are connected by the terminals I7~I0 and the data lines D 7 to D 0 of the general-purpose port 35 of the slave CPU 26.

【0011】スレーブCPU26は、入力設定可能な8
ビット長の汎用ポート35を備え、さらにこの汎用ポー
ト35用の入出力設定レジスタ36(図3)、入力用デ
ータレジスタ37(図5)を備えている。また、汎用ポ
ート35の全ビットについてエッジ入力を受けるエッジ
入力機構41を備えている。エッジ入力機構41につい
ては、立上り又は立下りを選択するエッジ入力設定レジ
スタ38(図6)と、エッジ入力があった時、その状態
を示すステータスレジスタ39(図7)が用意され、さ
らにエッジ入力時、割込み処理実行を可能にする割込み
マスクレジスタ40(図8)も用意されている。
The slave CPU 26 has an input configurable 8
A general port 35 having a bit length is provided, and further an input / output setting register 36 (FIG. 3) and an input data register 37 (FIG. 5) for the general port 35 are provided. Further, it has an edge input mechanism 41 for receiving edge inputs for all bits of the general-purpose port 35. Regarding the edge input mechanism 41, an edge input setting register 38 (FIG. 6) for selecting rising or falling and a status register 39 (FIG. 7) indicating the state when an edge is input are prepared. At this time, an interrupt mask register 40 (FIG. 8) that enables execution of interrupt processing is also prepared.

【0012】図3に、マスタCPU16の汎用ポート3
0の入出力設定用レジスタ31と、スレーブCPU26
の汎用ポート35の入出力設定用レジスタ36の構成を
示す。実施例では、各端子毎に入出力の設定を可能なポ
ートを使用しているが、8ビット単位で入出力設定する
ポートでも使用することができる。このレジスタを出力
設定するときには、該当するビットを1にする。また、
入力設定するときには、該当するビットを0にする。本
実施例では、全ビットを出力設定又は入力設定してい
る。
FIG. 3 shows a general-purpose port 3 of the master CPU 16.
0 input / output setting register 31 and slave CPU 26
The structure of the input / output setting register 36 of the general-purpose port 35 is shown. In the embodiment, a port in which input / output can be set for each terminal is used, but a port for input / output setting in 8-bit units can also be used. When setting the output of this register, the corresponding bit is set to 1. Also,
When input is set, the corresponding bit is set to 0. In this embodiment, all bits are set to be output or input.

【0013】図4に、汎用ポート30の出力用データレ
ジスタ32の構成を示す。このレジスタ32は出力設定
された端子にデータを出力するもので、各端子毎にレベ
ルの設定が可能である。例えば、第2ビットに0を書き
込むとO2端子がLレベルとなり、第6ビットに1を書
き込むとO6端子がHレベルとなる。図5に、スレーブ
CPU26の入力用データレジスタ37の構成を示す。
このレジスタ37は入力設定された端子のデータを入力
するもので、該当するデータラインがHレベルの時1と
なり、Lレベルの時0となる。
FIG. 4 shows the structure of the output data register 32 of the general-purpose port 30. The register 32 outputs data to the output-set terminals, and the level can be set for each terminal. For example, when 0 is written in the second bit, the O2 terminal becomes L level, and when 1 is written in the sixth bit, the O6 terminal becomes H level. FIG. 5 shows the configuration of the input data register 37 of the slave CPU 26.
The register 37 inputs the data of the terminal set as input, and becomes 1 when the corresponding data line is at H level and 0 when the corresponding data line is at L level.

【0014】図6に、スレーブCPU26のエッジ入力
機構41のエッジ入力設定レジスタ38の構成を示す。
このレジスタの2つのビットのペア(第7と第6ビッ
ト、第5と第4ビット、第3と第2ビット、第1と第0
ビット)が2つの端子のペア(I7とI6、I5とI
4、I3とI2、I1とI0)に対してエッジ入力設定
するビットとなる。2つのビットを0,0とするとエッ
ジ入力機能を使用しないことが設定され、0,1とする
と立上りエッジ入力を受け付けることが設定され、1,
0とすると立下りエッジ入力を受け付けることが設定さ
れ、1,1とすると両方向のエッジ入力を受け付けるこ
とが設定される。
FIG. 6 shows the configuration of the edge input setting register 38 of the edge input mechanism 41 of the slave CPU 26.
Two bit pairs in this register (7th and 6th bits, 5th and 4th bits, 3rd and 2nd bits, 1st and 0th bits)
Bit is a pair of two terminals (I7 and I6, I5 and I)
4, I3 and I2, I1 and I0) are bits for edge input setting. If two bits are set to 0, 0, it is set that the edge input function is not used, and if 0, 1, it is set that the rising edge input is accepted.
A value of 0 is set to accept a falling edge input, and a value of 1 is set to accept an edge input in both directions.

【0015】図7に、エッジ入力機構41のステータス
レジスタ39の構成を示す。このレジスタの全ビットの
それぞれが各端子I7〜I0にエッジ入力があったこと
を示すビットとして使用され、エッジ入力(立上り又は
立下り)が有る時は1とされ、エッジ入力が無い時は0
とされる。このステータスレジスタ39は、エッジ入力
設定レジスタ38で設定した方向のエッジパルスが入力
されると、その入力した端子に対応したビットが1にセ
ットされる。例えば、端子I7のみならば第7ビット
が、端子I7,I5,I1に入力があれば、第7,第
5,第1ビットが1にセットされる。
FIG. 7 shows the configuration of the status register 39 of the edge input mechanism 41. Each of all bits of this register is used as a bit indicating that there is an edge input to each of the terminals I7 to I0, and is set to 1 when there is an edge input (rising or falling), and to 0 when there is no edge input.
It is said that When an edge pulse in the direction set by the edge input setting register 38 is input to the status register 39, the bit corresponding to the input terminal is set to 1. For example, if the terminal I7 alone is set, the seventh bit is set, and if the terminals I7, I5 and I1 are input, the seventh, fifth and first bits are set to 1.

【0016】図8に、エッジ入力機構41の割込みマス
クレジスタ40の構成を示す。このレジスタの第7ビッ
トが端子I7のエッジ入力割込み許可ビットとして使用
され、割込みを許可するときは1とされ、割込みを禁止
するときは0にする。エッジ入力による割込みは、図9
に示したメカニズムにより実行され、上記マスクレジス
タ40で割込み許可に設定した状態で、上記ステータス
レジスタ39中のエッジ入力を示すフラグがセットされ
た時発生し、あらかじめ設定されたアドレスより処理を
開始する。
FIG. 8 shows the configuration of the interrupt mask register 40 of the edge input mechanism 41. The 7th bit of this register is used as an edge input interrupt enable bit of the terminal I7, and is set to 1 to enable the interrupt and to 0 to disable the interrupt. Figure 9 shows the interrupt by edge input.
When the flag indicating the edge input in the status register 39 is set under the condition that the mask register 40 is set to enable the interrupt, the processing is started from the preset address. .

【0017】なお、ステータスレジスタ39でセットさ
れたフラグは、図10に示すように、第7ビットのに0
を書き込むとフラグがリセットされ、次のエッジ入力を
認識できる構造になっている。スレーブCPU26は、
入力用データレジスタ37の内容を読み出すことで、入
力設定された汎用ポート35の入力情報を入手できる。
The flag set in the status register 39 is 0 in the 7th bit as shown in FIG.
When is written, the flag is reset and the structure is such that the next edge input can be recognized. The slave CPU 26
By reading the contents of the input data register 37, it is possible to obtain the input information of the general-purpose port 35 to which the input is set.

【0018】次に、マスタCPU16側のデータ転送
(送信)手順について、図11,図12のフローチャー
トを用いて説明する。マスタCPU16は、プログラム
が実行し始める(S300)と、汎用ポート30の初期
設定処理を行う。データラインD7 〜D0 をアイドル・
レベル‘H”に設定するため、出力用データレジスタ3
2の全ビットを1にする(S301)。次に、汎用ポー
ト30の各端子を出力側に設定するため、入出力設定用
レジスタ31の全ビットを1にする(S302)。
Next, the data transfer (transmission) procedure on the master CPU 16 side will be described with reference to the flowcharts of FIGS. When the program starts to be executed (S300), the master CPU 16 performs an initialization process for the general-purpose port 30. Idle data lines D 7 -D 0
Output data register 3 to set level “H”
All bits of 2 are set to 1 (S301). Next, in order to set each terminal of the general-purpose port 30 to the output side, all bits of the input / output setting register 31 are set to 1 (S302).

【0019】以上の初期設定終了後、データ転送(送
信)するタイミングかどうかをチェック(S303)す
る。通信タイミングの例を図示すると、図13は時間同
期の通信タイミングの例であり、32ms毎に通信タイ
ミングが生成される。また、図14はパルス入力同期の
例であり、回転センサ等のパルス入力の立下りと同期し
て通信タイミングが生成される。S303のチェックの
結果、通信タイミングでなければ、燃料噴射量演算、点
火時期計算等の通信以外の処理を実行する(S30
4)。
After the above initial setting is completed, it is checked whether or not it is the timing for data transfer (transmission) (S303). FIG. 13 shows an example of the communication timing in time synchronization, and the communication timing is generated every 32 ms. Further, FIG. 14 is an example of pulse input synchronization, and the communication timing is generated in synchronization with the fall of the pulse input of the rotation sensor or the like. If it is not the communication timing as a result of the check in S303, processing other than communication such as fuel injection amount calculation and ignition timing calculation is executed (S30).
4).

【0020】本実施例では、使用目的が異なったり、通
信同期の異なるデータを取り扱えるようにするため、エ
ッジパルスをのせるデータラインを切り替えて、スレー
ブCPU26側にデータの種類、通信周期を識別させて
いる。図20に、各データラインにエッジパルスを発生
させた時に通信されるデータの内容を示す。通信タイミ
ングは複数の要因(所定の時刻になった時、又は回転数
センサ等のパルス入力があった時)から生成される。図
20には、通信データ別にそのタイミングを示してあ
る。
In this embodiment, in order to handle data for different purposes or different communication synchronization, the data line on which the edge pulse is placed is switched so that the slave CPU 26 can identify the type of data and the communication cycle. ing. FIG. 20 shows the contents of data communicated when an edge pulse is generated in each data line. The communication timing is generated from a plurality of factors (when a predetermined time comes or when there is a pulse input from a rotation speed sensor or the like). FIG. 20 shows the timing for each communication data.

【0021】S303で上記通信タイミングであると判
断した時、通信禁止タイマが作動中かどうかをチェック
する(S305)。これは、複数の通信タイミングがほ
ぼ同時に成立してしまってデータ転送が行われるとスレ
ーブCPU26が一つ一つのデータの受信に失敗する恐
れがあるからである。スレーブCPU26が確実にデー
タを受信処理するのに必要な時間を通信禁止タイマとし
て使用している。
When it is determined in S303 that the communication timing has come, it is checked whether the communication prohibition timer is operating (S305). This is because the slave CPU 26 may fail to receive each piece of data if a plurality of communication timings are established almost simultaneously and data is transferred. The time required for the slave CPU 26 to reliably receive and process data is used as a communication prohibition timer.

【0022】通信禁止タイマと通信処理の関係を図16
に示す。通信タイミング発生により燃料系通信処理が開
始されそして終了すると、通信禁止タイマがセットさ
れ、次の同期割込みのタイミングまで、1msの間、3
2ms通信の通信処理は禁止される。そして1ms経過
後の同期割込みのタイミングで通信禁止タイマのタイマ
値が更新され、他の通信処理が許可される。
FIG. 16 shows the relationship between the communication prohibition timer and communication processing.
Shown in. When the fuel system communication process is started and ended by the generation of communication timing, the communication prohibit timer is set, and until the timing of the next synchronous interrupt, 1 ms, 3
Communication processing of 2 ms communication is prohibited. Then, the timer value of the communication prohibition timer is updated at the timing of the synchronous interrupt after 1 ms has elapsed, and other communication processing is permitted.

【0023】もし、S305でタイマが作動中であれ
ば、通信処理を終了し、S304の通信以外の処理を実
行させる。S305で通信禁止タイマが0の時は、図2
0に示されるデータの種類を判別し、例えば燃料噴射量
データの送信であれば、スレーブCPU26の端子I7
に立下りエッジパルスを出力するため端子O7のレベル
を“H”から“L”に(S306)、点火時期データで
あれば、スレーブCPU26の端子I7とI0に立下り
エッジパルスを出力するため端子O7,O0のレベルを
“H”から“L”に(S307)、また、32ms毎の
通信であれば、同様にして端子O4,O2のレベルを
“H”から“L”に(S308)して、スレーブCPU
26へ立下りエッジパルスを出力する。
If the timer is operating in S305, the communication process is terminated and the process other than the communication in S304 is executed. If the communication prohibit timer is 0 in S305,
If the type of data indicated by 0 is determined and, for example, if the fuel injection amount data is to be transmitted, the terminal I7 of the slave CPU 26
In order to output the falling edge pulse to the terminal O7, the level of the terminal O7 is changed from "H" to "L" (S306), and if it is ignition timing data, the terminal for outputting the falling edge pulse to the terminals I7 and I0 of the slave CPU 26 is output. The levels of O7 and O0 are changed from "H" to "L" (S307), and in the case of communication every 32 ms, the levels of the terminals O4 and O2 are similarly changed from "H" to "L" (S308). A slave CPU
A falling edge pulse is output to 26.

【0024】次に、出力用データレジスタ32に通信す
るデータを書き込み、データラインD7 〜D0 を介して
スレーブCPU26へデータを送出する(S309〜S
311)。最後に、通信禁止タイマ(1ms)をセット
し、作動させ通信処理を終了する(S312)。以後、
S303〜S312の処理を繰り返していく。禁止タイ
マの更新処理を図15のフローチャートを用いて説明す
る。
Next, the data to be communicated is written in the output data register 32, and the data is sent to the slave CPU 26 via the data lines D 7 to D 0 (S309 to S309).
311). Finally, the communication prohibition timer (1 ms) is set and activated to end the communication processing (S312). After that,
The processes of S303 to S312 are repeated. The prohibition timer updating process will be described with reference to the flowchart of FIG.

【0025】1msの時間同期割込みルーチンを利用し
て(S350)、通信禁止タイマの値が0であるか否か
を判断し(S351)、0でなければデクリメントして
通信禁止タイマを更新(S352)し、割込みを終了す
る(S353)。以上説明した図11,図12の通信処
理において、実際にデータが転送される様子が図19の
タイミングチャートに示されている。
Using the 1 ms time synchronous interrupt routine (S350), it is judged whether the value of the communication prohibition timer is 0 (S351). If it is not 0, it is decremented and the communication prohibition timer is updated (S352). ) And terminates the interrupt (S353). A timing chart of FIG. 19 shows how data is actually transferred in the communication processing of FIGS. 11 and 12 described above.

【0026】図19は、点火時期用データを転送する際
に、最初に16進数データ$32が転送され、次いで1
6進数データ$87が転送される例を示す。エッジ割込
み発生後、スレーブCPU26が待っている2μs以内
に、マスタCPU16は通信データをデータラインD7
〜D0 上に用意し、また、スレーブCPU26は、受信
データの2度読みによって確実な通信を保証している。
In FIG. 19, when the ignition timing data is transferred, the hexadecimal data $ 32 is transferred first, and then 1 is transferred.
An example of transferring hexadecimal data $ 87 is shown. After the edge interrupt occurs, the master CPU 16 sends the communication data to the data line D 7 within 2 μs which the slave CPU 26 waits.
~ D 0 , and the slave CPU 26 guarantees reliable communication by reading the received data twice.

【0027】次に、スレーブCPU26側のデータ受信
処理の手順について図17、図18のフローチャートに
より説明する。図17は、スレーブCPU26の汎用ポ
ート35の初期設定処理を示す。スレーブCPU26が
プログラムを実行し始める(S400)と、スレーブC
PU26の汎用ポート35を入力側に設定するため、入
出力設定用レジスタ36の全ビットを0にする(S40
1)。
Next, the procedure of data reception processing on the slave CPU 26 side will be described with reference to the flowcharts of FIGS. FIG. 17 shows an initialization process of the general-purpose port 35 of the slave CPU 26. When the slave CPU 26 starts executing the program (S400), the slave C
Since the general-purpose port 35 of the PU 26 is set to the input side, all bits of the input / output setting register 36 are set to 0 (S40
1).

【0028】次に、汎用ポート35の全端子(I7〜I
0)を立下りエッジパルスの入力を受け付けるように設
定するため、エッジ入力レジスタ38の第7、第5、第
3、第1ビットを“1”にその他のビットを“0”にセ
ットする。次に、ステータスレジスタ39のエッジフラ
グのビットを一度リセットするため、全ビットに0を書
き込む(S402)。
Next, all the terminals (I7 to I) of the general-purpose port 35 are
0) is set to accept the input of the falling edge pulse, the seventh, fifth, third, and first bits of the edge input register 38 are set to "1", and the other bits are set to "0". Next, in order to reset the bit of the edge flag of the status register 39 once, 0 is written in all the bits (S402).

【0029】次に、端子I7に立下りエッジパルス入力
時、割込みが発生するようにするため、割込みマスクレ
ジスタ40の第7ビットを1にする(S403)。以上
で、通信関係の初期設定処理を終了し、受信処理以外の
処理を実行する(S404)。図18は、スレーブCP
U26の受信処理手順を示す。
Next, when the falling edge pulse is input to the terminal I7, the 7th bit of the interrupt mask register 40 is set to 1 in order to generate an interrupt (S403). With the above, the communication-related initial setting process is ended, and processes other than the receiving process are executed (S404). Figure 18 shows slave CP
The reception processing procedure of U26 is shown.

【0030】受信エッジ割込みは、図9に示すように、
ステータスレジスタ39の端子I7のエッジ入力状況を
示す第7ビットが1で、かつ、エッジ入力による割込み
を許可する割込みマスクレジスタ40上の第7ビットが
1の時発生する。マスタCPU16から立下りエッジパ
ルスが端子I7に入力された時のみ、ステータスレジス
タ39の第7ビットが1にセットされる。
The reception edge interrupt is, as shown in FIG.
This occurs when the 7th bit indicating the edge input status of the terminal I7 of the status register 39 is 1 and the 7th bit on the interrupt mask register 40 which permits the interrupt by the edge input is 1. The seventh bit of the status register 39 is set to 1 only when the falling edge pulse is input to the terminal I7 from the master CPU 16.

【0031】受信エッジ割込み発生(S410)後、ス
レーブCPU26はステータスレジスタ39の情報を読
み出す。図21に、データ種別ごとのステータス39の
情報を示す。第7ビットは、エッジ入力割込み要因とし
て、どのデータの受信においても1にセットされるの
で、このビット情報をマスクし、図22に示すように、
端子I6〜I0のエッジ入力情報のみを抽出する(S4
11)。抽出処理後の第7ビットは0とされて、その後
の処理に使われる。S412で抽出したエッジ入力フラ
グ情報を分析し、転送されるデータを判別する。
After the reception edge interrupt is generated (S410), the slave CPU 26 reads the information in the status register 39. FIG. 21 shows information on the status 39 for each data type. Since the 7th bit is set to 1 as an edge input interrupt factor in receiving any data, this bit information is masked, and as shown in FIG.
Only the edge input information of the terminals I6 to I0 is extracted (S4).
11). The 7th bit after the extraction processing is set to 0 and used for the subsequent processing. The edge input flag information extracted in S412 is analyzed to determine the data to be transferred.

【0032】本例では、図22に示すような抽出処理後
の情報がそのまま更新するRAM値アドレスのオフセッ
ト演算に用いられている。このため、エッジ入力が入る
と自動的に更新するRAM値のアドレスが計算できる。
このアドレス計算の仕組みを図23に示す。受信データ
をストアするRAMは予め、図23のように配置されて
おり、その先頭アドレスと抽出したフラグ情報からアド
レスを求めるようになっている。
In this example, the information after the extraction processing as shown in FIG. 22 is used for the offset calculation of the RAM value address which is updated as it is. Therefore, the address of the RAM value that is automatically updated when the edge input is input can be calculated.
The mechanism of this address calculation is shown in FIG. The RAM for storing the received data is arranged in advance as shown in FIG. 23, and the address is obtained from the head address and the extracted flag information.

【0033】図18に戻ると、S413で所定時間待
つ。本例では2μsに設定している。これは、エッジパ
ルス入力後に送られてくる通信データを確実に取り込ま
せるために必要な操作である。入力用データレジスタ3
7より、受信データを2回読み出す(S414,S41
5)。これも、通信データの信頼性を高めるために必要
な操作である。
Returning to FIG. 18, a predetermined time is waited in S413. In this example, it is set to 2 μs. This is an operation necessary for surely capturing the communication data sent after the input of the edge pulse. Input data register 3
7, the received data is read twice (S414, S41
5). This is also an operation required to increase the reliability of communication data.

【0034】S416で1回目と2回目に読み出したデ
ータをチェックする。チェック方法は、2つのデータを
比較し、一致しているかどうかで行われる。一致してい
れば、受信データには異常がないものと判断して、S4
12で求めたアドレスのRAM上にストアする(S41
7)。もし、一致していなければ、受信データに異常が
あったものとして読み捨てる。その場合の駆動用の信号
演算のデータは、過去に受信されたデータを使うように
するため、過去のデータをS412で求めたアドレスの
RAM上より取り出す(S418)。S419では、S
417の最新の受信データ又はS418の過去の受信デ
ータを用いて演算処理し、駆動信号を生成し、出力ドラ
イバ24から出力する。
In S416, the first and second read data is checked. The check method is performed by comparing two data and checking whether they match. If they match, it is determined that there is no abnormality in the received data, and S4
It is stored in the RAM of the address obtained in 12 (S41
7). If they do not match, the received data is regarded as abnormal and is discarded. In order to use the data received in the past as the data of the signal calculation for driving in that case, the past data is fetched from the RAM of the address obtained in S412 (S418). In S419, S
The latest received data of 417 or the past received data of S418 is used for arithmetic processing to generate a drive signal, which is output from the output driver 24.

【0035】最後に、ステータスレジスタ39のエッジ
入力フラグをリセットする終了処理を実行し(S42
0)、割込み処理を終了する(S421)。
Finally, a termination process for resetting the edge input flag of the status register 39 is executed (S42).
0), the interrupt processing is ended (S421).

【0036】[0036]

【発明の効果】本発明によれば、データラインと通信要
求線を共用したことで、CPU間の通信用ポートの使用
数を削減でき、余ったポートを他の目的のために使用で
きる。また、本発明によれば、シリアル通信より高速通
信ができ、受信データの2度読みによって信頼性が向上
する。
According to the present invention, since the data line and the communication request line are shared, the number of communication ports used between CPUs can be reduced, and the surplus ports can be used for other purposes. Further, according to the present invention, higher speed communication can be performed than serial communication, and reliability is improved by reading the received data twice.

【0037】さらに、本発明によれば、1つの割込みと
他の端子のエッジ入力状況をチェックするだけで、マス
タCPUから送られてくるデータの種類を識別できる。
転送データ群に識別用データを加える方式に比べて、通
信量を減らすことが可能なため(転送データ群から識別
データを抽出して解析する必要がない)、CPUの通信
処理の負荷を軽減できる。
Further, according to the present invention, the type of data sent from the master CPU can be identified only by checking one interrupt and the edge input status of other terminals.
Compared with the method of adding identification data to the transfer data group, the communication amount can be reduced (the identification data need not be extracted and analyzed from the transfer data group), and thus the communication processing load of the CPU can be reduced. .

【0038】また、本発明によれば、エッジ入力情報を
使って更新するRAMのアドレスが簡単に演算でき、受
信データのRAM値更新処理が容易になる。
Further, according to the present invention, the RAM address to be updated can be easily calculated by using the edge input information, and the RAM value updating process of the received data becomes easy.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の実施例の構成図。FIG. 1 is a configuration diagram of an embodiment of the present invention.

【図2】図1の装置を適用するエンジン制御装置の全体
構成図。
FIG. 2 is an overall configuration diagram of an engine control device to which the device of FIG. 1 is applied.

【図3】本発明の実施例における入出力設定用レジスタ
の構成図。
FIG. 3 is a configuration diagram of an input / output setting register according to an embodiment of the present invention.

【図4】本発明の実施例における出力用データレジスタ
の構成図。
FIG. 4 is a configuration diagram of an output data register in the embodiment of the invention.

【図5】本発明の実施例における入力用データレジスタ
の構成図。
FIG. 5 is a configuration diagram of an input data register in the embodiment of the invention.

【図6】本発明の実施例におけるエッジ入力設定レジス
タの構成図。
FIG. 6 is a configuration diagram of an edge input setting register according to the embodiment of the present invention.

【図7】本発明の実施例におけるステータスレジスタの
構成図。
FIG. 7 is a configuration diagram of a status register in the embodiment of the invention.

【図8】本発明の実施例における割込みマスクレジスタ
の構成図。
FIG. 8 is a configuration diagram of an interrupt mask register according to an embodiment of the present invention.

【図9】本発明の実施例における割込み処理へのメカニ
ズムを示す図。
FIG. 9 is a diagram showing a mechanism for interrupt processing in the embodiment of the present invention.

【図10】本発明の実施例におけるステータスレジスタ
のフラグをリセットするメカニズムを示す図。
FIG. 10 is a diagram showing a mechanism for resetting the flag of the status register in the embodiment of the present invention.

【図11】図1のマスタCPUのデータ転送手順を示す
フローチャート(その1)。
11 is a flowchart (part 1) showing a data transfer procedure of the master CPU of FIG. 1. FIG.

【図12】図1のマスタCPUのデータ転送手順を示す
フローチャート(その2)。
12 is a flowchart (part 2) showing the data transfer procedure of the master CPU of FIG. 1. FIG.

【図13】本発明の実施例における通信タイミングを時
間同期で得る例を説明する図。
FIG. 13 is a diagram illustrating an example of obtaining communication timing in time synchronization according to the embodiment of the present invention.

【図14】本発明の実施例における通信タイミングをパ
ルス入力同期で得る例を説明する図。
FIG. 14 is a diagram illustrating an example of obtaining communication timing by pulse input synchronization in the embodiment of the present invention.

【図15】図1のマスタCPU側の通信禁止タイマ更新
処理を示すフローチャート。
15 is a flowchart showing a communication prohibition timer updating process on the master CPU side of FIG.

【図16】図15の通信禁止タイマの更新と通信処理の
関係を示すタイムチャート。
16 is a time chart showing the relationship between the update of the communication prohibition timer shown in FIG. 15 and communication processing.

【図17】図1のスレーブCPUの汎用ポートの初期設
定処理手順を示すフローチャート。
17 is a flowchart showing the procedure for initializing the general-purpose port of the slave CPU of FIG.

【図18】図1のスレーブCPUの受信処理手順を示す
フローチャート。
FIG. 18 is a flowchart showing a reception processing procedure of the slave CPU of FIG.

【図19】本発明の実施例の通信処理におけるデータ転
送を示すタイミングチャート。
FIG. 19 is a timing chart showing data transfer in communication processing according to the embodiment of the present invention.

【図20】本発明の実施例により通信するデータの識別
を示す図。
FIG. 20 is a diagram showing identification of data to be communicated according to the embodiment of the present invention.

【図21】本発明の実施例のステータスレジスタの情報
を示す図。
FIG. 21 is a diagram showing information in a status register according to the embodiment of this invention.

【図22】図21の情報を抽出処理した後の情報を示す
図。
FIG. 22 is a diagram showing information after the information of FIG. 21 is extracted.

【図23】本発明の実施例の受信データのRAM値更新
のメカニズムを示す図。
FIG. 23 is a diagram showing a mechanism of updating a RAM value of received data according to the embodiment of the present invention.

【符号の説明】[Explanation of symbols]

10,20…ECU 11…入力バッファ 12…波形整形回路 13…A/D変換回路 15,25…I/Oポート 16…マスタCPU 17,27…ROM 18,28…RAM 22…波形整形回路 24…出力ドライバ 26…スレーブCPU 30,35…汎用ポート 31,36…入出力設定レジスタ 32…出力用データレジスタ 37…入力用データレジスタ 38…エッジ入力設定レジスタ 39…ステータスレジスタ 40…割込みマスクレジスタ 41…エッジ入力機構 O7〜O0,I7〜I0…汎用ポートの端子 D7 〜D0 …データライン10, 20 ... ECU 11 ... Input buffer 12 ... Waveform shaping circuit 13 ... A / D conversion circuit 15, 25 ... I / O port 16 ... Master CPU 17, 27 ... ROM 18, 28 ... RAM 22 ... Waveform shaping circuit 24 ... Output driver 26 ... Slave CPU 30, 35 ... General-purpose port 31, 36 ... Input / output setting register 32 ... Output data register 37 ... Input data register 38 ... Edge input setting register 39 ... Status register 40 ... Interrupt mask register 41 ... Edge input mechanism O7~O0, I7~I0 ... terminal D 7 to D General port 0 ... data line

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 マスタCPUとスレーブCPU間で複数
のデータラインを用いてパラレル通信によりデータ転送
を行う複数CPU間データ転送装置において、前記マス
タCPUは、データの送信処理手段及びエッジパルス発
生処理手段を具備し、前記スレーブCPUは、汎用入力
ポートとエッジ入力機構が兼用できる端子機能手段及び
エッジ入力要因を識別できる受信処理手段を具備し、前
記エッジ入力機構は、割込み処理が可能なシステムを具
備することを特徴とする複数CPU間データ転送装置。
1. A data transfer apparatus between a plurality of CPUs which transfers data by parallel communication between a master CPU and a slave CPU using a plurality of data lines, wherein the master CPU is a data transmission processing means and an edge pulse generation processing means. The slave CPU includes a terminal function unit that can be used by a general-purpose input port and an edge input mechanism and a reception processing unit that can identify an edge input factor, and the edge input mechanism includes a system capable of interrupt processing. A data transfer device between a plurality of CPUs.
JP5320323A 1993-12-20 1993-12-20 Inter-cpu data transfer device Pending JPH07175736A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5320323A JPH07175736A (en) 1993-12-20 1993-12-20 Inter-cpu data transfer device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5320323A JPH07175736A (en) 1993-12-20 1993-12-20 Inter-cpu data transfer device

Publications (1)

Publication Number Publication Date
JPH07175736A true JPH07175736A (en) 1995-07-14

Family

ID=18120209

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5320323A Pending JPH07175736A (en) 1993-12-20 1993-12-20 Inter-cpu data transfer device

Country Status (1)

Country Link
JP (1) JPH07175736A (en)

Similar Documents

Publication Publication Date Title
JPH11282713A (en) Microcomputer, electronic equipment and debug system
JP3676882B2 (en) Microprocessor and its peripheral devices
US4845667A (en) Method and apparatus for data exchange between microprocessors
JPH02224140A (en) Interruption testing device
US6996704B2 (en) Trace control circuit adapted for high-speed microcomputer operation
JPH07175736A (en) Inter-cpu data transfer device
US5430853A (en) Update of control parameters of a direct memory access system without use of associated processor
JP4032947B2 (en) Clock synchronous serial communication device and semiconductor integrated circuit device
JP4006871B2 (en) Serial communication device
JPH07175767A (en) Data transfer devices between plural cpus
JP3267646B2 (en) Data communication device
JP2003167756A5 (en)
JP4282390B2 (en) Microcomputer logic development equipment
US6760854B2 (en) Method and apparatus for handling a framing error at a serial interface by forcing invalid commands to be read upon determine the command is invalid
JP3271270B2 (en) Data communication device
JPH0719104A (en) Input/output processing ic and input/output processing method
JPH0764886A (en) Processor provided with serial interface device
JPH07312627A (en) Data transfer method for serial communication between two cpus
KR920004361B1 (en) Paging printers engine and controller interface circuit
JP3027062B2 (en) Monitoring device for controller unit
JPH0822442A (en) Data transfer system by parallel communication between two cpus
JP2021111194A (en) On-vehicle electronic control device
JP2634919B2 (en) Multiprocessor device
JP3161174B2 (en) Key telephone equipment
JP3947223B2 (en) Method and apparatus for reducing waiting time on an interface by overlapping transmission packets