JPH0587851B2 - - Google Patents

Info

Publication number
JPH0587851B2
JPH0587851B2 JP56198382A JP19838281A JPH0587851B2 JP H0587851 B2 JPH0587851 B2 JP H0587851B2 JP 56198382 A JP56198382 A JP 56198382A JP 19838281 A JP19838281 A JP 19838281A JP H0587851 B2 JPH0587851 B2 JP H0587851B2
Authority
JP
Japan
Prior art keywords
data
microcomputer
bit
subroutine
steps
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 - Lifetime
Application number
JP56198382A
Other languages
Japanese (ja)
Other versions
JPS58100147A (en
Inventor
Yukio Sato
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP56198382A priority Critical patent/JPS58100147A/en
Priority to US06/444,984 priority patent/US4608689A/en
Priority to DE19823244848 priority patent/DE3244848A1/en
Priority to GB08234479A priority patent/GB2115654B/en
Publication of JPS58100147A publication Critical patent/JPS58100147A/en
Publication of JPH0587851B2 publication Critical patent/JPH0587851B2/ja
Granted legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/16Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
    • G06F15/163Interprocessor communication
    • G06F15/17Interprocessor communication using an input/output type connection, e.g. channel, I/O port
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4204Bus transfer protocol, e.g. handshake; Synchronisation on a parallel bus
    • G06F13/4221Bus transfer protocol, e.g. handshake; Synchronisation on a parallel bus being an input/output bus, e.g. ISA bus, EISA bus, PCI bus, SCSI bus
    • G06F13/4226Bus transfer protocol, e.g. handshake; Synchronisation on a parallel bus being an input/output bus, e.g. ISA bus, EISA bus, PCI bus, SCSI bus with asynchronous protocol

Description

【発明の詳細な説明】 本発明は第1のデータ処理装置と第2のデータ
処理装置との間でデータの送受信を行うデータ通
信方式に関し、特に所望の通信モードでの同期合
わせ終了後、第1、第2のデータ処理装置のそれ
ぞれが、互いの相手装置に対し同期のとれたモー
ドでデータを通信することができるデータ通信方
式に関する。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a data communication method for transmitting and receiving data between a first data processing device and a second data processing device. The present invention relates to a data communication system in which each of the first and second data processing devices can communicate data with each other in a synchronized mode.

一般に、操作性を向上させ、複写品質を精緻に
制御する複写機においては、複写機本体とソータ
や入力センサなどを備えた付加装置との間で相互
に各種のデータを授受するデータ通信装置が必要
である。この種の従来のデータ通信装置は、第1
図に示すように、複写機本体11に中央処理装置
(CPU)12、I/Oコントローラ13、出力ド
ライバー14、入力インターフエイス15、
CPU用電源回路16および付加装置用電源回路
17を有している。付加装置18には、シーケン
スコントローラ19、入力インターフエイス20
A、出力ドライバー21A、出力負荷22Aおよ
び入力センサ23Aを有しており、相互のデータ
転送用に各種信号に応じた本数の接続線からなる
例えばフラツトケーブルを使用している。
In general, copying machines that improve operability and precisely control copy quality include a data communication device that exchanges various data between the copying machine itself and additional devices equipped with a sorter, input sensor, etc. is necessary. This type of conventional data communication device has a first
As shown in the figure, the copying machine body 11 includes a central processing unit (CPU) 12, an I/O controller 13, an output driver 14, an input interface 15,
It has a CPU power supply circuit 16 and an additional device power supply circuit 17. The additional device 18 includes a sequence controller 19 and an input interface 20.
A, an output driver 21A, an output load 22A, and an input sensor 23A, and for example, a flat cable consisting of a number of connecting wires corresponding to various signals is used for mutual data transfer.

複写機本体11の入力インターフエイス15お
よび付加装置18の入力インターフエイス20A
は、雑音防止対策として、第2図に示すように、
フオトカプラーを用いて構成することもできる。
しかし、いずれにしても転送すべき信号の種類が
増すと、コネクターのピン数も増えることにな
り、コネクターおよびケーブルが高価になるばか
りでなく、装置の信頼性の劣化を招く原因となつ
ている。また、ユニバーサル アシンクロナス
レシーバ トランスミツタ(UART)と称し、
伝送速度が10K〜20K(ビツト/秒)程度のシリ
アル通信ができるデータ通信装置があるが、高価
であり、汎用性はもつているものの複写機本体と
その付加装置との間のデータ通信装置としては不
向な点も多い。
Input interface 15 of copying machine main body 11 and input interface 20A of additional device 18
As a noise prevention measure, as shown in Figure 2,
It can also be configured using a photocoupler.
However, in any case, as the number of types of signals to be transferred increases, the number of connector pins also increases, which not only increases the cost of connectors and cables, but also causes deterioration in device reliability. . Also, universal asynchronous
It is called receiver transmitter (UART).
There are data communication devices that can perform serial communication at transmission speeds of 10K to 20K (bits/second), but they are expensive and, although they are versatile, they are not suitable for use as data communication devices between the copying machine and its additional devices. There are many unsuitable points.

そこで、上述の欠点を除くために、複写機本体
とその付加装置に、それぞれデータのシリアル転
送用マイクロコンピユータを備え、単線の伝送路
を介して送受する転送クロツクパルスの周期の再
生により複写機本体と付加装置との間でデータの
シリアル転送を行なうようにした場合、送信側と
受信側の上述のマイクロコンピユータの動作時間
の不一致によりコミユニケーシヨンが不成立とな
るという不都合がある。またデータのシリアル転
送をプログラム的に行なう場合はそのプログラム
の構成上、転送クロツクパルスの周期の再生は伝
送路の伝送状態の変化に対して1つの伝送速度で
は対応しきれないという問題がある。
Therefore, in order to eliminate the above-mentioned drawbacks, the copying machine main body and its additional devices are each equipped with a microcomputer for serial data transfer, and the copying machine main body and its attached devices are connected to each other by regenerating the period of the transfer clock pulse sent and received via a single-wire transmission line. When data is serially transferred to and from an additional device, there is a problem in that communication cannot be established due to a discrepancy in the operating times of the microcomputers on the sending and receiving sides. Furthermore, when data is serially transferred programmatically, there is a problem that, due to the structure of the program, reproduction of the period of the transfer clock pulse cannot cope with changes in the transmission state of the transmission line at one transmission speed.

本発明は上述した従来技術の欠点を除去するも
のであり、第1、第2のデータ処理装置間でデー
タ通信を行う際、通信速度等の通信モードを選択
可能とし、さらに選択された通信モードでの同期
合わせ完了後は各装置が互いの相手装置に対する
データ送信を可能としたことにより、第1、第2
のデータ処理装置間の双方向のデータ通信を、両
装置間で同期のとれた通信モードで確実に行うこ
とができるデータ通信方式の提供を目的とする。
さらに、本発明は上述した双方向データ通信のた
めの通信モードの設定、および同期合わせのため
の処理の開始を、マスタ装置に限つて可能とした
ことにより、データの通信を行う各装置が勝手に
データ通信のモードを変更することによりデータ
通信モードの整合がとれなくなるといつた不都合
を防止し、確実に整合のとれたモードで双方向の
データ通信を行うことができるデータ通信方式の
提供を目的とする。
The present invention eliminates the drawbacks of the prior art described above, and makes it possible to select a communication mode such as a communication speed when performing data communication between a first and second data processing device, and further enables selection of a communication mode such as communication speed. After the synchronization is completed, each device is able to send data to the other device, so the first and second
An object of the present invention is to provide a data communication method that can reliably perform two-way data communication between two data processing devices in a synchronized communication mode between both devices.
Furthermore, the present invention allows only the master device to set the communication mode for the above-mentioned two-way data communication and start processing for synchronization, so that each device that performs data communication can do so automatically. To provide a data communication method that prevents inconveniences such as when the data communication mode becomes inconsistent due to changing the data communication mode, and that allows two-way data communication to be reliably performed in a consistent mode. purpose.

以下、図面を参照して、本発明について詳細に
説明する。
Hereinafter, the present invention will be described in detail with reference to the drawings.

第3図は本発明によるデータ通信装置の主要部
の一構成例を示すブロツク図である。このデータ
通信装置は、互換性のある送受信部20,30
を、それぞれ複写機本体と付加装置に備えてい
る。送受信部20,30は、1枚のプリント基板
に、それぞれマイクロコンピユータ21,31と
インターフエイス回路を組込んだものである。そ
して、送受信部20,30を結合する伝送ライン
は、相互のアンテナ端子間を接続する接続線と、
共通のアースとによつて構成する。従つて、実装
にあたつては、単線の接続線を用いて伝送ライン
とすることができる。
FIG. 3 is a block diagram showing an example of the configuration of the main parts of the data communication device according to the present invention. This data communication device has compatible transmitting/receiving units 20 and 30.
are provided in the main body of the copying machine and additional devices, respectively. The transmitting/receiving sections 20 and 30 each have a microcomputer 21 and 31 and an interface circuit built into a single printed circuit board. The transmission line connecting the transmitting and receiving units 20 and 30 includes a connecting line connecting the antenna terminals of each other, and
It consists of a common ground. Therefore, in implementation, a single connection line can be used as a transmission line.

マイクロコンピユータ21,31は、データの
直並列変換と並直列変換を行なう機能を有してお
り、R4にポートに接続したスイツチ22,32
でマスター/スレーブの設定の切替を行なう。図
示の場合には、複写機本体用送受信部20のマイ
クロコンピユータ21がマスター、付加装置用送
受信部30のマイクロコンピユータ31がスレー
ブとなつている。マイクロコンピユータ21,3
1には、電源端子VCC、アース端子VSSおよび制
御端子RT,EX,Xがあり、電源端子VCCに電源
が供給されると、制御端子RTにシステムのイニ
シアライズのためにリセツト信号が供給され、ま
た制御端子EX,Xに発振振動子が接続され例え
ば2MHzのクロツクパルスを発振する。ところで、
マイクロコンピユータ21,31としては、例え
ばROM(リード オンリー メモリ)とRAM
(ランダム アクセス メモリ)を1チツプに収
容したマイクロプロセツサを適用することができ
る。
The microcomputers 21 and 31 have the function of serial-parallel conversion and parallel-serial conversion of data, and the switches 22 and 32 connected to the port R4
Switch the master/slave setting with . In the illustrated case, the microcomputer 21 of the copying machine main body transmitting/receiving section 20 is the master, and the microcomputer 31 of the additional device transmitting/receiving section 30 is the slave. Microcomputer 21,3
1 has a power terminal V CC , a ground terminal V SS , and control terminals RT, EX, and X. When power is supplied to the power terminal V CC , a reset signal is sent to the control terminal RT to initialize the system. Furthermore, an oscillating oscillator is connected to the control terminals EX and X to oscillate a clock pulse of, for example, 2 MHz. by the way,
The microcomputers 21 and 31 include, for example, ROM (read only memory) and RAM.
A microprocessor containing random access memory (random access memory) on one chip can be used.

このデータ通信装置において、いま送受信部2
0の端子P113〜P124からなる入力端子
IN1に複写機本体からデータが供給されると、
そのデータを増幅器23,24が増幅し、R2ポ
ート、R3ポートおよびKポートの各端子を介し
て、マイクロコンピユータ21が読み込み、直列
データに変換して、ポートR1からアンテナ端子
ANTを介して送受信部30へ伝送する。この送
受信部30は、アンテナ端子ANTを介して、当
該直列データを受信し、マイクロコンピユータ3
1のR1ポートに入力する。マイクロコンピユー
タ31は、その直列データを再び並列データに変
換し、OポートおよびPポートの各端子を介して
増幅器33,34に供給する。そして、増幅器3
3,34は、並列データを増幅して、端子P20
1〜P212からなる出力端子OUT2に転送す
る。
In this data communication device, the transmitting/receiving section 2
Input terminal consisting of 0 terminals P113 to P124
When data is supplied to IN1 from the copying machine,
The data is amplified by amplifiers 23 and 24, and read by the microcomputer 21 through each terminal of the R2 port, R3 port, and K port, converted into serial data, and then sent from port R1 to the antenna terminal.
It is transmitted to the transmitting/receiving section 30 via ANT. The transmitter/receiver 30 receives the serial data via the antenna terminal ANT, and transmits the serial data to the microcomputer 3.
Input to R1 port of 1. The microcomputer 31 converts the serial data into parallel data again and supplies it to amplifiers 33 and 34 via the O port and P port terminals. And amplifier 3
3 and 34 amplify the parallel data and connect it to the terminal P20.
It is transferred to the output terminal OUT2 consisting of 1 to P212.

同様にして、スレーブ側の送受信部30が、マ
スター側の送受信号20へデータを伝送する場合
には、付加装置が端子P213〜P224からな
る入力端子IN2に入力するデータを、増幅器3
5,36、マイクロコンピユータ31、アンテナ
端子ANT、マイクロコンピユータ21、増幅器
25,26をそれぞれ介して、端子P101〜P
112からなる出力端子OUT1に転送すること
ができる。この場合、マイクロコンピユータ31
は、データの並直列変換を行ない、マイクロコン
ピユータ21は、データの直並列変換を行なう。
このように、送受信部20,30は、双方向のデ
ータ転送を行なうことができる。
Similarly, when the transmitting/receiving section 30 on the slave side transmits data to the transmitting/receiving signal 20 on the master side, the additional device transmits the data input to the input terminal IN2 consisting of terminals P213 to P224 to the amplifier 3.
5, 36, the microcomputer 31, the antenna terminal ANT, the microcomputer 21, and the terminals P101 to P via the amplifiers 25, 26, respectively.
112 to the output terminal OUT1. In this case, the microcomputer 31
performs parallel-to-serial conversion of data, and microcomputer 21 performs serial-to-parallel conversion of data.
In this way, the transmitting/receiving sections 20 and 30 can perform bidirectional data transfer.

40は一方のマイクロコンピユータ21のR4
ポートに接続したマスター側伝送速度選択用スイ
ツチである。このスイツチ40は図示のように
“開”の状態となつている場合は、転送クロツク
周期は“TM”が選択され、また“閉”の状態に
切替えることにより転送クロツク周期を“TM′”
に選択することができる。同様に、41は他方の
マイクロコンピユータ31のR4ポートに接続し
たスレーブ側伝送速度選択用スイツチであり、こ
のスイツチ41を“開”の状態にすることにより
転送クロツク周期を“TM”に選択でき、また
“閉”の状態にすることにより転送クロツク周期
を“TM′”に選択できる。
40 is R4 of one microcomputer 21
This is a master side transmission speed selection switch connected to the port. When this switch 40 is in the "open" state as shown in the figure, "TM" is selected as the transfer clock cycle, and when it is switched to the "closed" state, the transfer clock cycle is set to "TM'".
can be selected. Similarly, 41 is a slave-side transmission speed selection switch connected to the R4 port of the other microcomputer 31, and by opening this switch 41, the transfer clock cycle can be selected as "TM". Also, by setting it in the "closed" state, the transfer clock cycle can be selected as "TM'".

ただし、マスター/スレーブ切替スイツチ2
2,32の設定により、マイクロコンピユータ3
1がスレーブとなつている場合は、伝送速度の選
択はマスター側で行われるため、スレーブ側伝送
速度選択用スイツチ41はその機能を停止し、作
動しない。従つて、そのスイツチ41が作動する
ときは、マイクロコンピユータ31がマスターと
なつている場合のみである。
However, master/slave selector switch 2
By setting 2 and 32, microcomputer 3
1 is a slave, the transmission rate is selected on the master side, so the slave side transmission rate selection switch 41 stops its function and does not operate. Therefore, the switch 41 is activated only when the microcomputer 31 is the master.

第4図は第3図のデータ通信装置に適用するコ
ミユニケーシヨンフオーマツトの一例を示す信号
波形図である。マイクロコンピユータ21,31
は、図示のように、ステツプ〜の11ステツプ
を実行することによつて、1フレームのデータ転
送を行なうことができる。ステツプ、におい
ては、マスター側のマイクロコンピユータ21と
スレーブ側のマイクロコンピユータ31が転送ク
ロツクの同期制御を行なう。そこで、マイクロコ
ンピユータ21は、伝送ラインがオープンになつ
ている状態であるステツプから、1フレームの
ビツト0が“1”から“0”になることにより、
ステツプを開始し、TASK1として8ビツトか
らなる転送クロツクパルスを後述するように周期
TMに選択してマイクロコンピユータ31へ伝送
する。
FIG. 4 is a signal waveform diagram showing an example of a communication format applied to the data communication device of FIG. 3. Microcomputer 21, 31
As shown in the figure, one frame of data can be transferred by executing 11 steps. In step 1, the master side microcomputer 21 and the slave side microcomputer 31 perform synchronization control of the transfer clocks. Therefore, the microcomputer 21 starts from the step where the transmission line is open, by changing bit 0 of one frame from "1" to "0".
The step is started, and a transfer clock pulse consisting of 8 bits is set as TASK1 with a periodicity as described later.
TM and transmits it to the microcomputer 31.

この期間に、マイクロコンピユータ31は、0
ビツトの立ち上りよりTASK2を起動し、マスタ
ー側から送られてくる転送クロツクパルスの周期
TMをビツト0〜7の8回測定し、演算処理して
転送クロツク周期の平均値TSを求め、ステツプ
におけるビツト8〜15でマイクロコンピユータ
21へ返送する。そして、マイクロコンピユータ
21は、転送クロツク周期TMと平均値TSが等
しいかどうかをチエツクする。もし、TM≠TS
であれば、マイクロコンピユータ31とのコミユ
ニケーシヨンはできないので、ステツプのビツ
ト16で伝送ラインを“0”にしてマイクロコンピ
ユータ31に知らせ、お互いのコミユニケーシヨ
ンの不成立を認識し合い初期の状態からやり直
す。しかし、TM=TSであれば、マイクロコン
ピユータ21は、ステツプで真のデータの開始
点を決めるためビツト17を“0”にし、
TASK4の実行を開始する。マイクロコンピユー
タ21は、ステツプにおけるビツト17から転送
クロツクの計数を開始する。従つて、このビツト
17の立ち下がりから転送のビツトの周期が始ま
り、このビツト17からビツト49までの各ビツトの
周期はTM=TSとなる。
During this period, the microcomputer 31
TASK2 is activated from the rising edge of the bit, and the period of the transfer clock pulse sent from the master side
TM is measured 8 times for bits 0 to 7, and calculated to obtain the average value TS of the transfer clock period, which is returned to the microcomputer 21 at bits 8 to 15 in step. The microcomputer 21 then checks whether the transfer clock period TM and the average value TS are equal. If TM≠TS
If so, communication with the microcomputer 31 is not possible, so in step bit 16, the transmission line is set to "0" and is notified to the microcomputer 31, so that the microcomputer 31 recognizes the failure of mutual communication and returns from the initial state. Start over. However, if TM=TS, the microcomputer 21 sets bit 17 to "0" to determine the starting point of the true data in step,
Start running TASK4. The microcomputer 21 starts counting the transfer clocks from bit 17 in step. Therefore, this bit
The transfer bit cycle starts from the falling edge of bit 17, and the cycle of each bit from bit 17 to bit 49 is TM=TS.

次のステツプ,において、マイクロコンピ
ユータ21はTASK3を実行し、まずビツト18〜
29からなる12ビツトのシリアルデータをマイクロ
コンピユータ31に転送し、次いでステツプの
ビツト30〜32の3ビツトからなるチエツクビツト
を伝送する。このチエツクビツトのうち、ビツト
30は偶数パリテイビツトとしてもよいが、本実施
例においては、前のビツト29の補数をセツトする
ように“0”とし、ビツト29とビツト30の区別を
明確にしている。チエツクビツトにおけるビツト
31は、データの内容によつてセツトするものと
し、本実施例においては12ビツトのデータの第7
番目のビツトであるビツト25と同じ値である
“1”をセツトする。ビツト32のチエツクビツト
は、最終ビツトを表わすために“0”にし、この
ビツト32の終了時に“1”にセツトして、ビツト
33では伝送ラインを開放する。
In the next step, the microcomputer 21 executes TASK3 and first bits 18 to
The 12-bit serial data consisting of 29 bits is transferred to the microcomputer 31, and then the check bit consisting of 3 bits 30 to 32 of the step is transmitted. Of these check bits, bits
Although 30 may be an even parity bit, in this embodiment, it is set to "0" so as to set the complement of the previous bit 29, thereby clarifying the distinction between bit 29 and bit 30. bits in check bits
31 is set depending on the content of the data, and in this embodiment, the 7th bit of 12-bit data is set.
It is set to "1", which is the same value as bit 25, which is the second bit. The check bit of bit 32 is set to “0” to represent the final bit, and when this bit 32 ends, it is set to “1” and the check bit is
33 opens the transmission line.

マイクロコンピユータ21が、ステツプ〜
において、TASK3を実行している期間に、マイ
クロコンピユータ31は転送されたデータを読み
込むTASK4を実行する。このようにして、マイ
クロコンピユータ21は、送受信部20の端子P
113〜P124にそれぞれ供給された並列デー
タを直列データに変換して、アンテナ端子ANT
を介して伝送ラインに送出し、マイクロコンピユ
ータ31は、その直列データを受信し、再び並列
データに変換して、送受信部30の端子P201
〜P212にそれぞれ供給する。従つて、送受信
部20の入力端子IN1における端子P112〜
P124に供給されたデータは、送受信部30の
出力端子OUT2の対応する端子P201〜P2
12にそれぞれ分配されることになる。
The microcomputer 21 steps ~
During the period in which TASK3 is being executed, the microcomputer 31 executes TASK4 to read the transferred data. In this way, the microcomputer 21 operates at the terminal P of the transmitter/receiver 20.
The parallel data supplied to P113 to P124 are converted to serial data, and the antenna terminal ANT
The microcomputer 31 receives the serial data, converts it into parallel data again, and sends it to the transmission line via the terminal P201 of the transmitting/receiving section 30.
~P212 respectively. Therefore, the terminals P112 to IN1 of the transmitting/receiving section 20
The data supplied to P124 is sent to the corresponding terminals P201 to P2 of the output terminal OUT2 of the transmitter/receiver 30.
It will be distributed to 12 people.

ところで、ステツプにおいては、マイクロコ
ンピユータ21,31が、送受信モードを切換レ
データの伝送方向を変える準備を行なう。そし
て、ステツプでは、スレーブ側のマイクロコン
ピユータ31が、データの送信を開始するため、
ビツト34を“0”にセツトするとともに転送クロ
ツクの計数を始める。マイクロコンピユータ31
は、既にステツプ,において転送クロツクの
同期をとつているので、ステツプにおいて転送
クロツク周期TMでは12ビツトのシリアルデータ
(ビツト35〜46)をマイクロコンピユータ21に
順次伝送することができる。
By the way, in step, the microcomputers 21 and 31 prepare to switch the transmission/reception mode and change the transmission direction of the data. Then, in step, the slave side microcomputer 31 starts transmitting data.
Bit 34 is set to "0" and counting of transfer clocks begins. Microcomputer 31
Since the transfer clock has already been synchronized in step , 12-bit serial data (bits 35 to 46) can be sequentially transmitted to the microcomputer 21 in the transfer clock period TM in step.

また、ステツプにおいて、マイクロコンピユ
ータ31は、ステツプの要領で3ビツトのチエ
ツクビツト(ビツト37〜39)をマイクロコンピユ
ータ21に送出する。かくして、マイクロコンピ
ユータ31が、データを送信するTASK3を実行
している期間に、マイクロコンピユータ21は、
そのデータを受信するTASK4を実行する。従つ
て、送受信部30の入力端子IN2における端子
P213〜P224に供給されたデータを、送受
信部20の出力端子OUT1の対応する端子P1
01〜P112にそれぞれ供給することができ
る。ステツプにおいては、マイクロコンピユー
タ21,31とも、伝送ラインをオープン状態に
して、次のデータ転送を行なうフレームのステツ
プの開始を待つTASK0となる。
Also, in step, microcomputer 31 sends 3 check bits (bits 37 to 39) to microcomputer 21 in the same manner as in step. Thus, while the microcomputer 31 is executing TASK3 for transmitting data, the microcomputer 21
Execute TASK4 to receive the data. Therefore, the data supplied to the terminals P213 to P224 of the input terminal IN2 of the transmitter/receiver 30 is transferred to the corresponding terminal P1 of the output terminal OUT1 of the transmitter/receiver 20.
01 to P112, respectively. In the step, both microcomputers 21 and 31 open the transmission line and enter TASK0, waiting for the start of the step of the next frame for data transfer.

第5図はマイクロコンピユータ21,31にお
ける要部の構成を示すブロツク図でである。マイ
クロコンピユータ21,31は、それぞれ制御記
憶部51、RAM(ランダム アクセス メモリ)
部52、演算論理ユニツト53およびアキユーム
レータ54を有している。ここで、制御記憶部5
1のROM(リード オンリー メモリ)は、マ
イクロ命令とデータの転送クロツク周期などの制
御に必要な情報を記憶している。デコーダDCR
は、ROMから読み出されたデータの解読を行な
い、プログラムカウンタPCは、OOMのアドレス
を指定する。また、スタツクSTKは、例えば
LIFO(ラスト イン フアースト アウト)の形
式で使用される一連のレジスタである。
FIG. 5 is a block diagram showing the configuration of essential parts of the microcomputers 21 and 31. The microcomputers 21 and 31 each have a control storage unit 51 and a RAM (random access memory).
52, an arithmetic logic unit 53 and an accumulator 54. Here, the control storage unit 5
The ROM (read only memory) No. 1 stores information necessary for controlling microinstructions and data transfer clock cycles. Decoder DCR
decodes the data read from the ROM, and the program counter PC specifies the OOM address. Also, the stack STK is for example
A set of registers used in a LIFO (last in first out) format.

次に、RAM部52は複数のメモリ領域からな
り、そのアドレスはX,Yアドレスレジスタが指
定する。複数のメモリ領域のうち、RAM1は入
力端子IN1あるいは入力端子IN2に供給される
データを記憶し、RAM2は出力端子OUT1ある
いは出力端子OUT2に供給するデータを記憶す
る。そして、RAM3は、アンテナ端子ANTを
介して、相手側コンピユータからR1ポートに伝
送されてくるシリアル入力データの格納を行なう
メモリ領域である。この他に、RAM部51に
は、タイマ割り込みがあると+1だけインクレメ
ントする割込カウンタ、転送クロツク周期TMを
記憶するメモリ領域、測定した転送クロツク周期
TSを記憶するメモリ領域および入出力データの
管理番号を記憶するメモリ領域などがある。
Next, the RAM section 52 consists of a plurality of memory areas, the addresses of which are designated by X and Y address registers. Among the plurality of memory areas, RAM1 stores data supplied to the input terminal IN1 or IN2, and RAM2 stores data supplied to the output terminal OUT1 or OUT2. The RAM 3 is a memory area that stores serial input data transmitted from the other party's computer to the R1 port via the antenna terminal ANT. In addition, the RAM section 51 includes an interrupt counter that increments by +1 when there is a timer interrupt, a memory area that stores the transfer clock cycle TM, and a memory area that stores the measured transfer clock cycle.
There is a memory area for storing TS, a memory area for storing management numbers of input/output data, etc.

次に、第6図のメインプログラムのフローチヤ
ートと、第7図ないし第19図のサブルーチンの
フローチヤートを参照して、このデータ通信装置
の動作を説明する。
Next, the operation of this data communication device will be explained with reference to the main program flowchart in FIG. 6 and the subroutine flowcharts in FIGS. 7 to 19.

マイクロコンピユータ21,31において、電
源が供給され、リセツト信号によつてイニシアラ
イズが行なわれると、第6図に示すメインプログ
ラムが開始される。まず、ステツプ61でRAMの
クリアが行なわれ、次のステツプ62においてサブ
ルーチン“IO DATAが実行される。このサブル
ーチン“IO DATA”は、それぞれマイクロコン
ピユータ21,31が、入力端子IN1,IN2の
入力情報をRAM1に読み込み、出力端子OUT
1,OUT2にRAM2から読み出した出力情報を
供給するルーチンである。ステツプ63では、
RAMに転送クロツク周期TMがセツトされ、割
込カウンタが起動される。転送クロツク周期TM
は、前述したように、ROMに書き込まれてお
り、データのシリアル伝送速度をきめるものであ
る。割込カウンタは、タイマ割込みが発生するた
びに、その内容を+1でけインクレメントする。
When power is supplied to the microcomputers 21 and 31 and initialization is performed by a reset signal, the main program shown in FIG. 6 is started. First, the RAM is cleared in step 61, and the subroutine ``IO DATA'' is executed in the next step 62.This subroutine ``IO DATA'' is executed by the microcomputers 21 and 31, respectively, to input information to the input terminals IN1 and IN2. is read into RAM1 and output terminal OUT
1. This is a routine that supplies output information read from RAM2 to OUT2. In step 63,
The transfer clock period TM is set in the RAM and the interrupt counter is activated. Transfer clock period TM
As mentioned above, is written in the ROM and determines the serial data transmission speed. The interrupt counter increments its contents by +1 every time a timer interrupt occurs.

ステツプ64においては、マイクロコンピユー
タ21,31が、それぞれマスターかスレーブか
を判断する。そして、マイクロコンピユータ21
がマスター、マイクロコンピユータ31がスレー
ブであるから、次のステツプへ移り、それぞれス
テツプ64でサブルーチン“TASK1”、ステツ
プ66でサブルーチン“TASK2”を実行する。
従つて、マイクロコンピユータ21は、まず周期
TMでビツト0からビツト7までの8ビツトを使
用して転送クロツクパルスを伝送ラインに送出
し、マイクロコンピユータ31は、その転送クロ
ツク周期を測定する(第4図のステツプ参照)。
次いで、マイクロコンピユータ31が、測定した
転送クロツク周期TSにもとづいて、ビツト8か
らビツト15にわたつて転送クロツクパルスを返送
し、マイクロコンピユータ21がその転送クロツ
クを受信する(第4図のステツプ参照)。
In step 64, each microcomputer 21, 31 determines whether it is a master or a slave. And the microcomputer 21
Since the microcomputer 31 is the master and the microcomputer 31 is the slave, the process moves to the next step and executes the subroutine "TASK1" at step 64 and the subroutine "TASK2" at step 66, respectively.
Therefore, the microcomputer 21 first calculates the period.
A transfer clock pulse is sent to the transmission line using 8 bits from bit 0 to bit 7 in TM, and the microcomputer 31 measures the transfer clock period (see the steps in FIG. 4).
Next, microcomputer 31 returns a transfer clock pulse from bit 8 to bit 15 based on the measured transfer clock period TS, and microcomputer 21 receives the transfer clock pulse (see steps in FIG. 4).

このようにして、マイクロコンピユータ21,
31は、転送クロツク周期の同期制御を行ない、
その結果クロツク周期TM≒TSであれば、相互
のコミユニケーシヨンができる。その判定はステ
ツプ67のサブルーチン“ERROR”で行なわ
れ、クロツク周期≠TSとなると、エラーフラグ
レジスタに“1”が入力される。このエラーフラ
グが“1”かどうかは、ステツプ68においてマ
イクロコンピユータ21が判断し、もしエラーフ
ラグが“1”であれば、ステツプ69に移つてエ
ラーフラグレジスタをリセツトしてステツプ62
に戻るが、エラーフラグが“0”であれば次のス
テツプ70にコントロールを移す。
In this way, the microcomputer 21,
31 performs synchronization control of the transfer clock cycle;
As a result, if the clock period TM≒TS, mutual communication is possible. This determination is made in the subroutine "ERROR" at step 67, and when the clock period ≠ TS, "1" is input to the error flag register. The microcomputer 21 determines whether this error flag is "1" at step 68. If the error flag is "1", the process moves to step 69, resets the error flag register, and then returns to step 62.
However, if the error flag is "0", control is transferred to the next step 70.

ここで、エラーフラグが“1”になれば、第4
図のステツプで示したように、マイクロコンピ
ユータ21は、伝送ラインを“0”に落して、マ
イクロコンピユータ31に知らせる。ただし、マ
イクロコンピユータ31で異常が生じて、転送ク
ロツク周期の測定不能の場合にも、サブルーチン
“ERROR”で検出され、エラーフラグレジスタ
が“1”となり、やはり伝送ラインは“0”とな
る。
Here, if the error flag becomes “1”, the fourth
As indicated by the step in the figure, the microcomputer 21 drops the transmission line to "0" and informs the microcomputer 31. However, even if an abnormality occurs in the microcomputer 31 and the transfer clock period cannot be measured, it will be detected in the subroutine "ERROR", the error flag register will become "1", and the transmission line will also become "0".

さて、ステツプ70においては、マイクロコン
ピユータ21,31が再びマスターかスレーブか
を判断し、マスター側のマイクロコンピユータ2
1は、サブルーチン“TASK3”,“TASK4”を
ステツプ71,72で実行し、これと同時にスレ
ーブ側のマイクロコンピユータ31は、サブルー
チン“TASK4”,“TASK3”をステツプ73,
74で実行する。すなわち、マイクロコンピユー
タ21が、まず第4図のステツプにおいて伝送
ラインを“0”にし、次いで同図のステツプ
を行なつて、ビツト18〜29で12ビツトのシリアル
データを転送し、ビツト30〜32で3ビツトのチエ
ツクビツトを転送する。このとき、マイクロコン
ピユータ31は、ステツプでデータの受信動作
に入り、ステツプで12ビツトのシリアルデー
タと3ビツトのチエツクビツトを読み込む。
Now, in step 70, it is determined whether the microcomputers 21 and 31 are masters or slaves again, and the microcomputer 2 on the master side
1 executes subroutines "TASK3" and "TASK4" in steps 71 and 72, and at the same time, the microcomputer 31 on the slave side executes subroutines "TASK4" and "TASK3" in steps 73 and 72.
Execute on 74. That is, the microcomputer 21 first sets the transmission line to "0" in the steps shown in FIG. Transfers 3 check bits. At this time, the microcomputer 31 enters a data receiving operation in steps, and reads in 12-bit serial data and 3-bit check bits in steps.

このようにして、マイクロコンピユータ21が
サブルーチン“TASK3”を実行し、マイクロコ
ンピユータ31がサブルーチン“TASK4”を実
行する。そして、第4図のステツプで伝送ライ
ンがオープンにされたのち、今度はマイクロコン
ピユータ31がビツト34〜49にわたつてデータ伝
送を含むステツプ〜のサブルーチン
“TASK3”を実行し、同時にマイクロコンピユ
ータ21はサブルーチン“TASK4”を実行す
る。マイクロコンピユータ21,31が、ステツ
プ72,74においてそれぞれサブルーチン
“TASK4”,「TASK3”を終了すると、次のデー
タ転送のために、コントロールはステツプ62に
移される。
In this way, the microcomputer 21 executes the subroutine "TASK3", and the microcomputer 31 executes the subroutine "TASK4". Then, after the transmission line is opened in the step shown in FIG. Execute subroutine “TASK4”. When the microcomputers 21 and 31 complete the subroutines "TASK4" and "TASK3" at steps 72 and 74, respectively, control is transferred to step 62 for the next data transfer.

メイングラムのステツプは上述の通りである
が、次にその各サブルーチンについて順次説明す
る。
The steps of the main gram are as described above, and each of its subroutines will be sequentially explained next.

まず、サブルーチン“IO DATA”において
は、マイクロコンピユータ21,31が、データ
管理番号0〜11に従つて、入力データをRAM1
に取り込み、RAM2から出力データを読み出す
動作が行なわれる。そこで、第7図のフローチヤ
ートに示しているように、サブルーチン“IO
DATA”がコールされると、ステツプ81で管
理番号のクリアが行なわれ、ステツプ82〜86
でRAM1に入力データが取り込まれ、ステツプ
87で再び管理番号のクリアが行なわれたのち、
ステツプ88〜92でRAM2から出力データが
読み出される。すなわち、ステツプ82では、例
えば複写機本体用送受信部20(第3図)の入力
端子P113〜P124にそれぞれ割り付けられ
たデータ管理番号“0”〜“11”に応じて、入力
データのチエツクが実行される。そして、例えば
データ管理番号“0”の入力端子P113のデー
タが“1”が“0”かによつて、ステツプ83も
しくはステツプ84に分岐され、データ管理番号
“0”に相当するRAM1のロケーシヨンに当該
入力データが書き込まれる。
First, in the subroutine "IO DATA", the microcomputers 21 and 31 transfer input data to the RAM 1 according to data management numbers 0 to 11.
The output data is read out from RAM2. Therefore, as shown in the flowchart of Figure 7, the subroutine “IO
When "DATA" is called, the management number is cleared in step 81, and the management number is cleared in steps 82 to 86.
The input data is loaded into RAM1 at step 87, and the management number is cleared again at step 87.
Output data is read from RAM 2 in steps 88-92. That is, in step 82, input data is checked in accordance with the data management numbers "0" to "11" respectively assigned to the input terminals P113 to P124 of the copying machine main body transmitting/receiving section 20 (FIG. 3), for example. be done. For example, depending on whether the data at the input terminal P113 with the data management number "0" is "1" or "0", the process branches to step 83 or step 84, and the process goes to the location of RAM1 corresponding to the data management number "0". The input data is written.

次のステツプ85においては、データ管理番号
が+1だけ増加(インクレメント)され、データ
管理番号は“0”から“1”になるから、ステツ
プ86で管理番号が“12”かどうかのチエツクは
“NO”となり、ステツプ82にコントロールが
戻される。同様にして、データ管理番号に従つて
入力データがRAM1に取り込まれ、データ管理
番号が“12”になると、ステツプ86のチエツク
が“YES”となるから、コントロールがステツ
プ87に移される。ステツプ88〜92において
は、データ管理番号に応じてRAM2から読み出
された出力データが、例えば送受信部20の出力
端子P101〜P112に分配されるが、そのコ
ントロールはステツプ82〜86と実質的に同じ
であるから、その説明を省略する。
In the next step 85, the data management number is incremented by +1, and the data management number changes from "0" to "1". Therefore, in step 86, it is checked whether the management number is "12" or not. NO” and control is returned to step 82. Similarly, the input data is taken into the RAM 1 according to the data management number, and when the data management number becomes "12", the check at step 86 becomes "YES", so control is transferred to step 87. In steps 88 to 92, the output data read from the RAM 2 according to the data management number is distributed to, for example, the output terminals P101 to P112 of the transmitter/receiver 20, but the control thereof is substantially the same as in steps 82 to 86. Since they are the same, their explanation will be omitted.

次に、メインプログラムのステツプ63におい
て、第8図のサブルーチン“TM SET”がコー
ルされ、ステツプ93〜97が実行される。すな
わち、まずステツプ93で当該マイクロコンピユ
ータ21または31が対応するマスター/スレー
ブ切換スイツチ22または32によりマスターに
選択されているか否かを判定し、マスターに選択
されていなければステツプ94に進み、RAMに
ある周期TMのメモリ領域に“TM”の値をセツ
トし、ステツプ97へ進む。一方、マスターに選
択されている場合はステツプ95に進み、対応す
る伝送速度選択スイツチ40または41が“開”
の状態であるか否かを判断する。対応するスイツ
チ40または41が“開”の状態、すなわちスイ
ツチフラグが“1”の値であればステツプ94に
進み、RAMにある周期にTMに“TM”の値を
セツトし、ステツプ97へ進む。そのスイツチ4
0または41が“閉”の状態、すなわちスイツチ
フラグが“0”の値であれば、ステツプ96で
RAMにある周期TMに“TM′”の値をセツトし、
ステツプ97へ進む。続いてステツプ97におい
て、割込カウンタをスタートさせて、第6図のメ
インプログラムにリターンする。
Next, in step 63 of the main program, the subroutine "TM SET" of FIG. 8 is called, and steps 93 to 97 are executed. That is, first, in step 93, it is determined whether or not the microcomputer 21 or 31 has been selected as a master by the corresponding master/slave changeover switch 22 or 32. If it has not been selected as a master, the process proceeds to step 94, in which the microcomputer 21 or 31 is stored in the RAM. The value of "TM" is set in the memory area of a certain period TM, and the process advances to step 97. On the other hand, if the master is selected, the process advances to step 95, and the corresponding transmission speed selection switch 40 or 41 is set to "open".
It is determined whether the state is as follows. If the corresponding switch 40 or 41 is in the "open" state, that is, the switch flag has a value of "1", the process proceeds to step 94, where the value of "TM" is set in TM at a certain period in the RAM, and the process proceeds to step 97. . That switch 4
If 0 or 41 is in the "closed" state, that is, the switch flag has a value of "0", step 96
Set the value of “TM′” to the periodic TM in RAM,
Proceed to step 97. Subsequently, in step 97, an interrupt counter is started and the process returns to the main program shown in FIG.

上述の“TM SET”の手段により、マスター
側はスレーブ側の伝送速度に一致するように伝送
速度を切替えることができるから、マスター側と
スレーブ側の動作時間の相違によるコミユニケー
シヨンの不成立の問題を解消することができ、か
つ伝送路の伝送状態が変化しても容易に対応する
ことができる。
By using the above-mentioned "TM SET" method, the master side can switch the transmission speed to match the transmission speed of the slave side, so the problem of communication failure due to the difference in operating time between the master side and slave side is solved. It is possible to solve this problem, and it is also possible to easily cope with changes in the transmission state of the transmission path.

メインプログラムのステツプ63においては、
既述したように、RAMに転送クロツク周期TM
またはTM′がセツトされるとともに、割込カウ
ンタがイネーブルにされる。この割込カウンタ
は、タイマー割り込みがあると、第9図の割り込
みルーチンがコールされ、ステツプ101〜10
3が実行されることになる。すなわち、割り込み
があるたびに、割込カウンタの内容がインクレメ
ントされ、割込カウンタがオーバフローをする
と、エラーフラグレジスタがセツトされることに
なる。
In step 63 of the main program,
As mentioned above, the clock cycle TM transferred to RAM
Alternatively, TM' is set and the interrupt counter is enabled. When a timer interrupt occurs, this interrupt counter calls the interrupt routine shown in FIG.
3 will be executed. That is, each time an interrupt occurs, the contents of the interrupt counter are incremented, and when the interrupt counter overflows, the error flag register is set.

マイクロコンピユータ21は、メインプログラ
ムのステツプ65で、サブルーチン“TASK1”
を実行する。第10図ないし第13図はそのサブ
ルーチン“TASK1”のフローチヤートである。
サブルーチン“TASK1”を実行することによつ
て、マイクロコンピユータ21は、アンテナ端子
ANTを介して伝送ラインに“0”と“1”の繰
り返しからなる周期TMの転送クロツクパルスを
送出したのち、マイクロコンピユータ31から返
送されてくる転送クロツクパルスの周期TSを測
定する。ビツト0〜7からなる8ビツトの転送ク
ロツクパルスは、ステツプ104〜120におい
て、アンテナ端子ANTのセツトとサブルーチン
“CNT CLR”を交互に行なうことによつてなさ
れる。
The microcomputer 21 executes the subroutine "TASK1" at step 65 of the main program.
Execute. FIGS. 10 to 13 are flowcharts of the subroutine "TASK1".
By executing the subroutine "TASK1", the microcomputer 21 connects the antenna terminal
After sending a transfer clock pulse with a period TM consisting of repeating "0" and "1" to the transmission line via ANT, the period TS of the transfer clock pulse returned from the microcomputer 31 is measured. The 8-bit transfer clock pulse consisting of bits 0-7 is achieved by alternating the setting of the antenna terminal ANT and the subroutine "CNT CLR" in steps 104-120.

ここで、サブルーチン“CNT CLR”は、第1
0図に示しているように、ステツプ134,13
5からなり、割込カウンタのクリアと、割込カウ
ンタの内容と周期TM(RAMにセツトされてい
る)の一致をチエツクすることにより、転送クロ
ツク周期TMを一定にする制御をしている。
Here, the subroutine “CNT CLR” is the first
As shown in Figure 0, steps 134, 13
The transfer clock cycle TM is controlled to be constant by clearing the interrupt counter and checking whether the contents of the interrupt counter match the cycle TM (set in RAM).

サブルーチン“TASK1”のステツプ121〜
128においては、スレーブ側のマイクロコンピ
ユータ31が返送する8ビツトの転送クロツクパ
ルスの周期TSを測定するため、マスター側のマ
イクロコンピユータ21はサブルーチン
“MEASURE0”,“MEASURE1”を交互に実行
する。
Step 121 of subroutine “TASK1”
At step 128, the master microcomputer 21 alternately executes subroutines "MEASURE0" and "MEASURE1" in order to measure the period TS of the 8-bit transfer clock pulse sent back by the slave microcomputer 31.

第12図はサブルーチン“MEASURE0”のフ
ローチヤートであり、ステツプ136でエラーフ
ラグレジスタの内容のチエツクがなされ、“1”
であればリターンとなるが、“0”であればステ
ツプ137で割込カウンタのクリアが行なわれ
る。次に、ステツプ138でアンテナ端子ANT
が“1”か否かのチエツクがなされるが、アンテ
ナ端子ANTは初期値が“1”となつている様に
あらかじめフオーマツトができているので、ステ
ツプ139に進み割込カウンタの内容が転送クロ
ツク周期TMの2倍か否かのチエツクが行なわ
れ、割込カウンタの内容が2×TM以下であれば
コントロールは上述のステツプ138に戻され、
従つて、アンテナ端子ANTが“1”から“0”
に落ちるまでの周期TS内では、コントロールは
ステツプ138→ステツプ139→ステツプ13
8→ステツプ139……とループし、繰り返しを
行なつている。しかし、ある時点でアンテナ端子
ANTに“0”が伝送されて、アンテナ端子
ANTは“0”に落ちる。その時にはステツプ1
40に進み、割込カウンタの内容を測定クロツク
周期TSとしてRAMの該当領域にストアし、こ
れによりアンテナ端子ANTが“1”となつてい
る周期TSが測定できる。
FIG. 12 is a flowchart of the subroutine "MEASURE0". In step 136, the contents of the error flag register are checked and set to "1".
If it is "0", the interrupt counter is cleared in step 137. Next, in step 138, the antenna terminal ANT is
A check is made to see if the value of the interrupt counter is "1", but since the antenna terminal ANT has been formatted in advance so that the initial value is "1", the process advances to step 139 and the contents of the interrupt counter are set to the transfer clock. A check is made to see if the period is twice the period TM, and if the content of the interrupt counter is less than or equal to 2×TM, control is returned to step 138 described above.
Therefore, the antenna terminal ANT changes from “1” to “0”
Within the period TS until it falls to
Step 8→Step 139... is looped and repeated. However, at some point the antenna terminal
“0” is transmitted to ANT, and the antenna terminal
ANT falls to “0”. At that time, step 1
Proceeding to step 40, the contents of the interrupt counter are stored in the corresponding area of the RAM as the measurement clock period TS, thereby making it possible to measure the period TS during which the antenna terminal ANT is "1".

また、上述のようにステツプ138→ステツプ
139→ステツプ138→ステツプ139……と
ループしている最中にも割込ルーチンは非同期に
かかつており、その都度、割込カウンタがインク
メントされているが、いつまでもアンテナ端子
ANTが“0”に落ちない場合は、割込カウンタ
もいずれ2×TMというカウント値を計数してし
まう。これは、コミユニケーシヨンの失敗を示し
ているので、ステツプ141でエラーフラグレジ
スタにエラーフラグのセツトを行ない、コントロ
ールはメインプログラムにリターンされる。ただ
し、ビツト8の測定に限り、アンテナ端子ANT
の“1”から“0”への立ち下りだけを検出する
だけの動作となるので、測定結果は採用されな
い。
Also, as mentioned above, even during the loop of step 138 → step 139 → step 138 → step 139, etc., the interrupt routine continues asynchronously, and the interrupt counter is incremented each time. However, the antenna terminal remains
If ANT does not fall to "0", the interrupt counter will eventually count a count value of 2 x TM. Since this indicates a communication failure, an error flag is set in the error flag register at step 141, and control is returned to the main program. However, only when measuring bit 8, the antenna terminal ANT
The measurement result is not adopted because the operation is only to detect the fall from "1" to "0".

サブルーチン“MEASURE1”は、第13図に
示しているように、ステツプ142,143の分
岐条件が逆になつているほかは、サブルーチン
“MEASURE0”と同じである。
The subroutine "MEASURE1" is the same as the subroutine "MEASURE0" except that the branching conditions of steps 142 and 143 are reversed, as shown in FIG.

かくして、ビツト8〜14の8ビツトからなる返
送クロツク周期の測定が行なわれると、サブルー
チン“TASK1”のステツプ129で割込カウン
タのクリアが実行され、次のステツプ130で再
度エラーフラグレジスタのチエツクが行なわれ
る。その結果、エラーフラグレジスタの内容が
“1”であればコントロールはメインプログラム
へリターンされるが、その内容が“0”であれば
ステツプ131に移される。ステツプ131にお
いては、測定クロツク周期TSの平均値の演算が
実行されるが、ここでは多数決によつてその近似
値計算を行なつて測定クロツク周期TSの平均値
とし、ステツプ132で既にRAMに記憶されて
いる転送クロツクTMが書き換えられる。次のス
テツプ133では、割込カウンタの内容と転送ク
ロツクTMの比較が行なわれ、それらが一致する
まで割込カウンタは計数を続け、一致した時点で
コントロールはメインプログラムにリターンされ
る。
In this way, when the return clock cycle consisting of 8 bits 8 to 14 is measured, the interrupt counter is cleared in step 129 of the subroutine "TASK1", and the error flag register is checked again in the next step 130. It is done. As a result, if the content of the error flag register is "1", control is returned to the main program, but if the content is "0", control is moved to step 131. In step 131, the average value of the measurement clock period TS is calculated. Here, the approximate value is calculated by majority vote and is set as the average value of the measurement clock period TS. In step 132, it is already stored in the RAM. The current transfer clock TM is rewritten. In the next step 133, the contents of the interrupt counter and the transfer clock TM are compared, and the interrupt counter continues counting until they match, at which point control is returned to the main program.

上述したサブルーチン“TASK1”と並行し
て、スレーブ側のマイクロコンピユータ31は、
サブルーチン“TASK2”を実行する。第14図
はそのフローチヤートを示したものであり、ここ
でマスター側から送出された転送クロツクパルス
の周期TMの測定とその測定結果の処理を行なう
ステツプ145〜157は、サブルーチン
“TASK1”のステツプ121〜133とほぼ同
じであり、また測定転送クロツク周期にもとづい
て、クロツクパルスをマスター側に返送するステ
ツプ158〜173も、サブルーチン
“TASK1”のステツプ104〜120とほぼ同
じである。ただし、ビツト0の転送クロツク周期
TMについては、アンテナ端子ANTの立ち下り
を検出するだけなので、測定値そのものは意味が
ない。また、ビツト6の転送クロツクTMの測定
が終了した後、ビツト7は“1”であるから、ス
テツプ153ではその立ち上りで割込みカウンタ
がクリアされる。従つて、転送クロツク周期TM
の測定は、ビツト0〜6について行なわれ、ビツ
ト7の期間にステツプ153〜157が実行され
る。
In parallel with the above-mentioned subroutine "TASK1", the slave side microcomputer 31
Execute subroutine “TASK2”. FIG. 14 shows the flowchart, and steps 145 to 157 for measuring the period TM of the transfer clock pulse sent from the master side and processing the measurement results are steps 121 of the subroutine "TASK1". - 133, and steps 158-173 for returning clock pulses to the master side based on the measurement transfer clock cycle are also almost the same as steps 104-120 of subroutine "TASK1". However, the transfer clock cycle of bit 0
As for TM, the measured value itself is meaningless because it only detects the falling edge of the antenna terminal ANT. Further, after the measurement of the transfer clock TM of bit 6 is completed, since bit 7 is "1", the interrupt counter is cleared at the rising edge of bit 7 in step 153. Therefore, the transfer clock period TM
The measurements are made for bits 0-6, and steps 153-157 are executed during bit 7.

なお、ステツプ145〜152におけるサブル
ーチン“MEASURE0”,“MEASURE1”は、第
12図および第13図に示したフローチヤートの
ステツプからなり、ステツプ158〜173にお
けるサブルーチン“CTR CLR”は第11図に示
したフローチヤートのステツプからなる。
The subroutines "MEASURE0" and "MEASURE1" in steps 145-152 consist of the steps in the flowcharts shown in FIGS. 12 and 13, and the subroutine "CTR CLR" in steps 158-173 consists of the steps shown in FIG. It consists of the steps of a flowchart.

第15図はメインプログラムにおけるステツプ
67のサブルーチン“ERROR”のフローチヤー
トである。このサブルーチン“ERROR”は、マ
イクロコンピユータ21,31がそれぞれ
“TASK1”,“TASK2”を終了した後で実行され
るもので、コミユニケーシヨンのビツト16(第4
図のステツプ)の値をきめるルーチンである。
第15図のフローチヤートを参照すると、ステツ
プ174で割込カウンタのクリアが行なわれ、ス
テツプ175で割込カウンタの内容と転送クロツ
ク周期TMが一致しているかどうかの比較がなさ
れたあと、それらが一致していれば次のステツプ
176で転送クロツクの同期がとれたことを示す
ためにアンテナ端子ANTが“1”にされる。し
かし、それらが一致していなければ、エラーフラ
グレジスタが“1”にセツトされているかどうか
がステツプ177でチエツクされる。その結果、
エラーフラグが“1”であれば、ステツプ178
においてアンテナ端子ANTが“0”にされたの
ち、コントロールはステツプ175に戻される。
しかし、ラーフラグが“0”であれば、ステツプ
179でアンテナ端子ANTが“1”にセツトさ
れ、ステツプ180で再びアンテナ端子ANTが
“1”かどうかのチエツクが行なわれる。その理
由は、マスター側あるいはスレーブ側で、異常を
示すためにアンテナ端子ANTがいつでも“0”
にされる可能性があり、それをチエツクする必要
があるからである。
FIG. 15 is a flowchart of the subroutine "ERROR" at step 67 in the main program. This subroutine "ERROR" is executed after the microcomputers 21 and 31 finish "TASK1" and "TASK2", respectively, and is executed after the microcomputers 21 and 31 finish "TASK1" and "TASK2", respectively.
This routine determines the value of step (in the figure).
Referring to the flowchart of FIG. 15, the interrupt counter is cleared in step 174, and in step 175 the contents of the interrupt counter and the transfer clock period TM are compared to see if they match. If they match, the antenna terminal ANT is set to "1" in the next step 176 to indicate that the transfer clocks have been synchronized. However, if they do not match, it is checked in step 177 whether the error flag register is set to "1". the result,
If the error flag is “1”, step 178
After the antenna terminal ANT is set to "0" at step 175, control is returned to step 175.
However, if the error flag is "0", the antenna terminal ANT is set to "1" in step 179, and a check is made again in step 180 to see if the antenna terminal ANT is "1". The reason is that the antenna terminal ANT is always “0” on the master or slave side to indicate an abnormality.
This is because there is a possibility that the data will be used in the future, and it is necessary to check this.

ステツプ180においてアンテナ端子ANTが
“1”であれば、コントロールはステツプ175
に移されるが、そうでなければステツプ181で
エラーフラグレジスタを“1”にセツトしてステ
ツプ175にコントロールが戻される。このよう
にサブルーチン“ERROR”においては、サブル
ーチン“TASK1”,“TASK2”でエラーフラグ
レジスタがセツトされたかどうかがチエツクさ
れ、もしそのエラーフラグが“1”にセツトされ
ていれば、アンテナ端子ANTが“0”にセツト
される。また、エラーフラグが“1”にセツトさ
れていない場合には、相手方のエラー送出が検知
され、相手方がエラーのためアンテナ端子ANT
が“0”にセツトされていれば、エラーフラグレ
ジスタを“1”にセツトして、ビツト16が終了す
るまで待つて割込カウンタの内容と転送クロツク
周期TMが一致した時点でアンテナ端子を“1”
にセツトしてメインプログラムにリターンすると
いうステツプが実行される。
If the antenna terminal ANT is "1" in step 180, the control goes to step 175.
If not, the error flag register is set to "1" in step 181 and control is returned to step 175. In this way, in the subroutine "ERROR", it is checked whether the error flag register was set in the subroutines "TASK1" and "TASK2", and if the error flag is set to "1", the antenna terminal ANT is set. Set to “0”. In addition, if the error flag is not set to "1", an error transmission from the other party is detected, and the other party is connected to the antenna terminal ANT due to an error.
If it is set to "0", set the error flag register to "1", wait until bit 16 is completed, and when the contents of the interrupt counter and the transfer clock period TM match, turn the antenna terminal " 1”
A step is executed in which the program is set to 0 and returns to the main program.

第16図および第17図はメインプログラムの
ステツプ71のサブルーチン“TASK3”のフロ
ーチヤートである。マスター側のマイクロコンピ
ユータ21は、このサブルーチン“TASK3”に
おいて、スレーブ側のマイクロコンピユータ31
にデータを転送する。第16図のフローチヤート
を参照すると、ステツプ182,183でアンテ
ナ端子ANTの“0”セツトとサブルーチン
“CTN CLR”が行なわれて、ビツト17の“0”
が送出される。次のステツプ184においては、
ビツト18〜29からなる12ビツトのデータ転送が行
なわれるが、第17図はそのサブルーチン
“DATA CUT”のフローチヤートである。既に
メインプログラムのステツプ62において、
RAM1には転送すべきデータがストアされてい
るので、サブルーチン“DATA CUT”ではデ
ータ管理番号に従つてそのデータの読み出しとシ
リアル転送が行なわれる。第17図に示している
ように、ステツプ196でデータ管理番号がクリ
アされ、ステツプ197〜199で所定のデータ
管理番号に対応したRAM1のローケーシヨンに
ストアされているデータを読み出し、次いでその
データが“0”か“1”かによつてアンテナ端子
ANTが“0”か“1”かにセツトされる。
16 and 17 are flowcharts of the subroutine "TASK3" in step 71 of the main program. In this subroutine "TASK3", the master side microcomputer 21 executes the slave side microcomputer 31.
transfer data to. Referring to the flowchart of FIG. 16, in steps 182 and 183, the antenna terminal ANT is set to "0" and the subroutine "CTN CLR" is executed, and bit 17 is set to "0".
is sent. In the next step 184,
A 12-bit data transfer consisting of bits 18 to 29 is performed, and FIG. 17 is a flowchart of the subroutine "DATA CUT". Already in step 62 of the main program,
Since the data to be transferred is stored in the RAM 1, the subroutine "DATA CUT" reads out the data and serially transfers it according to the data management number. As shown in FIG. 17, the data management number is cleared in step 196, and the data stored in the location of RAM 1 corresponding to the predetermined data management number is read out in steps 197 to 199, and then the data is " Antenna terminal depending on whether it is “0” or “1”
ANT is set to either “0” or “1”.

そして、割り当てられた1ビツトの期間の制御
が、ステツプ200のサブルーチン“CNT
CLR”(第10図参照)によつて行なわれたの
ち、ステツプ201においてデータ管理番号がイ
ンクレメントされる。次いで、データ管理番号
“0”〜“11”に相当するデータの転送が終了す
ると、ステツプ202でそれが検出されるから、
サブルーチン“DATM OUT”の実行が完了し、
サブルーチン“TASK3”のステツプ185にコ
ントロールが移される。前述したように、チエツ
クビツトはビツト30〜32の3ビツトからなり、ス
テツプ185〜188はチエツクビツトの第1ビ
ツトであるビツト30の値をきめるためのものであ
る。ステツプ185でビツト29が“1”かどうか
がチエツクされ、“1”であればステツプ186
においてアンテナ端子ANTが“0”にセツトさ
れ、“0”であればステツプ187でアンテナ端
子ANTが“1”にセツトされる。ここで、ステ
ツプ188のサブルーチン“CNT CLR”は、ス
テツプ184と同様に、1ビツトの転送期間を制
御するサブルーチンである。
The period of the allocated 1 bit is controlled by the subroutine "CNT" in step 200.
CLR" (see Figure 10), the data management number is incremented in step 201. Next, when the transfer of data corresponding to data management numbers "0" to "11" is completed, Since it is detected in step 202,
The execution of the subroutine “DATM OUT” is completed,
Control is transferred to step 185 of subroutine "TASK3". As mentioned above, the check bit consists of three bits 30-32, and steps 185-188 are for determining the value of bit 30, which is the first bit of the check bit. In step 185, it is checked whether bit 29 is "1", and if it is "1", step 186 is performed.
At step 187, the antenna terminal ANT is set to "0", and if it is "0", the antenna terminal ANT is set to "1" at step 187. Here, the subroutine "CNT CLR" of step 188 is a subroutine for controlling the transfer period of 1 bit, similar to step 184.

チエツクビツトの第2ビツトに関するステツプ
189〜192は、ステツプ185〜188とほ
ぼ同じであるが、ビツト25の値をそのままビツト
31の値とするルーチンが実行される。ステツプ1
93でアンテナ端子ANTが“0”にセツトさ
れ、ステツプ194でサブルーチン“CNT
CLR”が実行されると、チエツクビツトの第3
のビツトであるビツト32が伝送ラインに送出され
る。サブルーチン“TASK3”の最終ステツプ1
95においては、アンテナ端子ANTが“1”に
セツトされる。
Steps 189 to 192 regarding the second bit of the check bit are almost the same as steps 185 to 188, but the value of bit 25 is used as is.
A routine with a value of 31 is executed. Step 1
The antenna terminal ANT is set to "0" at step 93, and the subroutine "CNT" is executed at step 194.
CLR” is executed, the third check bit
bit 32 is sent out onto the transmission line. Final step 1 of subroutine “TASK3”
At 95, the antenna terminal ANT is set to "1".

第18図および第19図はメインプログラムの
ステツプ72におけるサブルーチン“TASK4”
のフローチヤートである。このサブルーチン
“TASK4”では、スレーブ側から転送されたシ
リアルデータを受信してRAM3にストアしてお
き、当該データの転送ミスがないかどうかをチエ
ツクしたのち、転送ミスがなければRAM3にス
トアしたデータをRAM2に転送するステツプが
実行される。
Figures 18 and 19 show the subroutine "TASK4" in step 72 of the main program.
This is a flowchart. In this subroutine "TASK4", serial data transferred from the slave side is received and stored in RAM3, and after checking whether there is a transfer error in the data, if there is no transfer error, the data stored in RAM3 is A step is executed to transfer the data to RAM2.

第17図のフローチヤートを参照すると、まず
ステツプ203において割込カウンタのクリアが
行なわれ、ステツプ204,205でそれぞれ割
込カウンタの内容が転送クロツク周期TMの2倍
に一致するかどうかおよびアンテナ端子ANTが
“1”にセツトされているかどうかのチエツクが
なされる。転送クロツク周期TMの2倍になつて
も、スレーブ側がデータ転送を開始しない場合、
つまりアンテナ端子ANTが“0”に落ちない場
合には、マスター側のマイクロコンピユータ21
は何もせずにコントロールをメインプログラムに
リターンしてしまう。このようにスレーブ側から
データ転送がない場合には、RAM3からRAM
2に入力データの転送は行なわれない。
Referring to the flowchart of FIG. 17, first, in step 203, the interrupt counter is cleared, and in steps 204 and 205, it is checked whether the contents of the interrupt counter match twice the transfer clock period TM, and the antenna terminal is checked. A check is made to see if ANT is set to "1". If the slave side does not start data transfer even after twice the transfer clock period TM,
In other words, if the antenna terminal ANT does not fall to "0", the microcomputer 21 on the master side
returns control to the main program without doing anything. In this way, when there is no data transfer from the slave side, the data is transferred from RAM3 to RAM
2, input data is not transferred.

しかし、ステツプ205において、アンテナ端
子ANTが“0”になつていることが検知される
と、その時点から転送周期がスタートし、ステツ
プ206でサブルーチン“CNT CLR”が実行さ
れる。そして、ビツト34に相当する期間が経過す
ると、転送されたデータの取り込みに入るが、転
送クロツク周期TMの中間点でデータのサンプリ
ングをするために、ステツプ207においてその
タイミングが調整されてから、ステツプ208の
サブルーチン“DATA IN”が実行される。この
サブルーチン“DATA IN”は、データ管理番号
に従つて、RAM3に入力データが読み込まれる
ステツプ224〜230からなる。
However, when it is detected in step 205 that the antenna terminal ANT has become "0", the transfer cycle starts from that point, and in step 206 the subroutine "CNT CLR" is executed. Then, when a period corresponding to bit 34 has elapsed, the transferred data starts to be captured, but the timing is adjusted in step 207 in order to sample the data at the midpoint of the transfer clock period TM, and then step 207 is started. The subroutine "DATA IN" at 208 is executed. This subroutine "DATA IN" consists of steps 224 to 230 in which input data is read into the RAM 3 according to the data management number.

そこで、ステツプ224では、データ管理番号
のクリアが行なわれ、ステツプ225〜227に
おいてはアンテナ端子ANTに転送されたデータ
が所定のデータ管理番号によつてきめられた
RAM3のロケーシヨンにストアされる。次のス
テツプ228では、サブルーチン“CNT CLR”
が実行されることにより、転送クロツク周期TM
に相当する期間の制御が行なわれ、さらにステツ
プ229においてデータ管理番号がインクレメン
ト(+1)される。そして、ステツプ230では
データ管理番号が“12”になつたかどうかのチエ
ツクが行なわれ、“12”に満たなければステツプ
225にコントロールが戻され、“12”になれば
サブルーチン“TASK4”に移される。
Therefore, in step 224, the data management number is cleared, and in steps 225 to 227, the data transferred to the antenna terminal ANT is cleared according to the predetermined data management number.
Stored in RAM3 location. In the next step 228, the subroutine "CNT CLR"
is executed, the transfer clock period TM
Control is performed for a period corresponding to , and further, in step 229, the data management number is incremented (+1). Then, in step 230, a check is made to see if the data management number has reached "12". If it is less than "12", control is returned to step 225, and if it is "12", control is transferred to subroutine "TASK4". .

このとき、サブルーチン“TASK4”において
は、ビツト47(第4図参照)の中間点でサンプリ
ングが行なわれ、このビツト47は3ビツトのチエ
ツクビツトの第1ビツトであり、その値はビツト
46の値と補数関数にセツトされている。従つて、
ステツプ209〜213では、そのチエツクが行
なわれ、まずステツプ209でビツト47が“0”
であれば、ステツプ210でビツト46が“1”で
あるかどうかがチエツクされる。その結果、ビツ
ト46が“0”であれば、ビツト47の値と補数関係
にないので、ステツプ212ではチエツクミスフ
ラグレジスタがセツトされ、次いでコントロール
はステツプ213のサブルーチン“CNT CLR”
に移される。しかし、ビツト46が“1”であれ
ば、コントロールはそのままステツプ213に移
されることになる。また、ビツト47が“1”でビ
ツト46が“1”の場合にも、ステツプ209,2
11で検知され、フラグレジスタがセツトされる
が、ビツト47が“1”でビツト46が“0”であれ
ば、コントロールはステツプ209,211から
そのままステツプ213に移される。
At this time, in the subroutine "TASK4", sampling is performed at the midpoint of bit 47 (see Figure 4), and this bit 47 is the first bit of the 3 check bits, and its value is
It is set to a value of 46 and a complement function. Therefore,
This check is performed in steps 209 to 213, and first, in step 209, bit 47 is set to "0".
If so, step 210 checks to see if bit 46 is "1". As a result, if bit 46 is "0", there is no complement relationship with the value of bit 47, so the check miss flag register is set in step 212, and control is then transferred to the subroutine "CNT CLR" in step 213.
will be moved to However, if bit 46 is "1", control is directly transferred to step 213. Also, when bit 47 is "1" and bit 46 is "1", steps 209 and 2 are executed.
If bit 47 is "1" and bit 46 is "0", control is directly transferred from steps 209 and 211 to step 213.

次のステツプ214〜218においては、チエ
ツクビツトの第2ビツトであるビツト48とビツト
42が同値かどうかのチエツクが行なわれる。さら
に、ステツプ219でチエツクビツトの第3ビツ
トであるビツト49が“1”かどうかチエツクさ
れ、“1”であれば、チエツクミスフラグレジス
タがステツプ220においてセツトされるが、
“0”であればコントロールはステツプ221に
移される。最後にステツプ221では、チエツク
ミスフラグレジスタが“1”かどうかが調べら
れ、データ転送に際して誤りがないかどうかがチ
エツクされる。そして、チエツクミスフラグレジ
スタが“1”でなければ、RAM3のデータが
RAM2に書き込まれるが、“0”であればチエ
ツクミスフラグレジスタのリセツトが行なわれた
のち、コントロールはメインプログラムに戻され
ることになり、RAM2にはRAM3のデータの
書き込みは実行されない。ところで、第16図な
いし第19図を参照して、主としてマスター側の
サブルーチン“TASK3”,“TASK4”を説明し
たが、スレーブ側のサブルーチン“TASK4”
(メインプログラムのステツプ73)、“TASK3”
(メインプログラムのステツプ74)についても
ほぼ同様であるからその説明を省略する。
In the next steps 214 to 218, bit 48, which is the second bit of the check bit, and
A check is made to see if 42 are equivalent. Further, in step 219, it is checked whether the third bit of the check bit, bit 49, is "1", and if it is "1", the check miss flag register is set in step 220.
If it is "0", control is transferred to step 221. Finally, in step 221, it is checked whether the check miss flag register is "1", and it is checked whether there is any error during data transfer. If the check miss flag register is not “1”, the data in RAM3 is
If it is "0", control is returned to the main program after the check miss flag register is reset, and data from RAM3 is not written to RAM2. By the way, while the subroutines "TASK3" and "TASK4" on the master side have been mainly explained with reference to FIGS. 16 to 19, the subroutine "TASK4" on the slave side has been explained.
(Step 73 of the main program), “TASK3”
(Step 74 of the main program) is also substantially the same, so its explanation will be omitted.

なお、アンテナ端子ANTに例えばフオトカプ
ラのような光電変換素子を用い、伝送ラインを光
フアイバーで構成することができる。
Note that a photoelectric conversion element such as a photocoupler can be used for the antenna terminal ANT, and the transmission line can be constructed of an optical fiber.

上述したように、本発明実施例によれば、複写
機本体とその付加装置にそれぞれデータの直並列
変換および並直列変換を行なうマイクロコンピユ
ータを設けることにより、相互にデータのシリア
ル転送ができ、しかもマイクロコンピユータを結
合するコネクターのピン数がきわめて少くなり、
信頼性の高いデータ通信装置を提供することがで
きる。特に、本発明実施例によればマスター側と
スレーブ側の伝送速度を一致させる伝送速度選択
手段を設けているので、それぞれのマイクロコン
ピユータ間の動作時間の相違によるコミユニケー
シヨンの不能が解消でき、かつ伝送路の伝送状態
の悪化の場合にも簡単に対応することができる。
しかも、本発明実施例は簡単な構成であるから、
既存の複写機に容易に適用できる。
As described above, according to the embodiment of the present invention, by providing microcomputers that perform serial-to-parallel conversion and parallel-to-serial conversion of data in the main body of the copying machine and its attached device, respectively, it is possible to serially transfer data between each other. The number of pins in the connector that connects microcomputers has become extremely small.
A highly reliable data communication device can be provided. In particular, according to the embodiment of the present invention, since the transmission speed selection means for matching the transmission speeds on the master side and the slave side is provided, it is possible to eliminate the inability to communicate due to differences in operating time between the respective microcomputers. Moreover, it is possible to easily cope with the deterioration of the transmission condition of the transmission line.
Moreover, since the embodiment of the present invention has a simple configuration,
It can be easily applied to existing copying machines.

以上説明したように、本発明によれば、第1、
第2のデータ処理装置間でデータ通信を行う際、
通信速度の通信モードを選択可能とし、さらに選
択された所望の通信モードでの同期合わせ完了後
は、第1、第2のデータ処理装置のそれぞれが互
いの相手装置に対しデータを通信することができ
るようにしたので、第1、第2のデータ処理装置
間の双方向のデータ通信を両装置間で同期のとれ
た通信モードで確実に行うことができる効果が得
られる。さらに、本発明によれば、上記の双方向
データ通信のための通信モードの設定、および同
期合わせのための処理の開始をマスタ装置に限つ
て可能としたので、データの通信を行う各装置が
勝手にデータ通信のモードを変更することにより
データ通信モードの整合がとれなくなるといつた
不都合が防止され、確実に整合のとれたモードで
双方向のデータ通信を行うことができる効果が得
られる。
As explained above, according to the present invention, the first,
When performing data communication between the second data processing devices,
The communication mode of the communication speed can be selected, and furthermore, after the synchronization is completed in the selected desired communication mode, each of the first and second data processing devices can communicate data to the other device. As a result, it is possible to reliably perform two-way data communication between the first and second data processing devices in a synchronized communication mode between the two devices. Furthermore, according to the present invention, only the master device can set the communication mode for the above-mentioned two-way data communication and start processing for synchronization, so that each device that communicates data can Inconveniences such as mismatching of data communication modes due to arbitrary data communication mode changes are prevented, and it is possible to reliably perform two-way data communication in a matched mode.

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

第1図および第2図は従来のデータ通信装置を
示すブロツク図、第3図は本発明によるデータ通
信装置の主要部の一構成例を示すブロツク図、第
4図はそのコミユニケーシヨンフオーマツトを示
す信号波形図、第5図は本発明に適用するマイク
ロコンピユータの要部ブロツク図、第6図はその
メインプログラムのフローチヤート、第7図ない
し第19図はサブルーチンのフローチヤートであ
る。 20…複写機本体用送受信部、21…マスター
側マイクロコンピユータ、22,32…マスタ
ー/スレーブ切換スイツチ、23〜26,33〜
36…増幅器、30…付加装置用送受信部、31
…スレーブ側マイクロコンピユータ、40…マス
ター側伝送速度選択用スイツチ、41…スレーブ
側伝送速度選択用スイツチ、51…制御記憶部、
52…RAM部、53…演算論理ユニツト、54
…アキユムレータ、RAM…ランダムアクセスメ
モリ、DCR…デコーダ、ROM…リードオンリー
メモリ、PC…プライムカウンタ、STK…スタツ
ク。
1 and 2 are block diagrams showing a conventional data communication device, FIG. 3 is a block diagram showing a configuration example of the main part of the data communication device according to the present invention, and FIG. 4 is a communication format thereof. FIG. 5 is a block diagram of a main part of a microcomputer to which the present invention is applied, FIG. 6 is a flowchart of its main program, and FIGS. 7 to 19 are flowcharts of subroutines. 20... Transmission/reception unit for copying machine main body, 21... Master side microcomputer, 22, 32... Master/slave changeover switch, 23-26, 33-
36...Amplifier, 30...Transmission/reception unit for additional device, 31
... Slave side microcomputer, 40... Master side transmission speed selection switch, 41... Slave side transmission speed selection switch, 51... Control storage unit,
52... RAM section, 53... Arithmetic logic unit, 54
…Accumulator, RAM…Random access memory, DCR…Decoder, ROM…Read-only memory, PC…Prime counter, STK…Stack.

Claims (1)

【特許請求の範囲】 1 第1のデータ処理装置と第2のデータ処理装
置との間でデータの送受信を行うデータ通信方式
において、前記第1および第2のデータ処理装置
はそれぞれ、 データを通信するためのデータ通信手段と、 前記データ通信手段によるデータ通信のモード
を設定するためのモード設定手段と、 前記設定されたモードで相手処理装置との同期
合わせ処理を行う処理手段と、 装置をマスタまたはスレーブに設定するための
選択手段と、 前記選択手段によつてマスタと選択されている
か否かを判別する判別手段とを有し、 前記第1および第2の処理装置は、前記判別手
段により自装置がマスタであることを判別する
と、前記モード設定手段により設定されている設
定モードに従つて前記データ通信手段のデータ通
信のモードを決定し、前記決定されたモードでの
同期合わせのための処理を開始し、同期合わせ終
了の後、前記第1および第2のデータ処理装置は
それぞれ互いの相手装置に対し、両装置間で同期
のとれたモードでデータを送信することを特徴と
するデータ通信方式。
[Claims] 1. In a data communication system in which data is transmitted and received between a first data processing device and a second data processing device, the first and second data processing devices each communicate data. a data communication means for setting a mode of data communication by the data communication means; a processing means for performing synchronization processing with a partner processing device in the set mode; or a selection means for setting it as a slave, and a determination means for determining whether or not it is selected as a master by the selection means, and the first and second processing devices are configured by the determination means to When it is determined that the device itself is the master, it determines the data communication mode of the data communication means according to the setting mode set by the mode setting means, and performs synchronization in the determined mode. After starting processing and completing synchronization, the first and second data processing devices each transmit data to the other device in a mode in which both devices are synchronized. Communication method.
JP56198382A 1981-12-04 1981-12-11 Data transfer device Granted JPS58100147A (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP56198382A JPS58100147A (en) 1981-12-11 1981-12-11 Data transfer device
US06/444,984 US4608689A (en) 1981-12-04 1982-11-29 Data processing and transfer apparatus
DE19823244848 DE3244848A1 (en) 1981-12-04 1982-12-03 IMAGE GENERATION DEVICE
GB08234479A GB2115654B (en) 1981-12-04 1982-12-03 Image forming apparatus and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP56198382A JPS58100147A (en) 1981-12-11 1981-12-11 Data transfer device

Publications (2)

Publication Number Publication Date
JPS58100147A JPS58100147A (en) 1983-06-14
JPH0587851B2 true JPH0587851B2 (en) 1993-12-20

Family

ID=16390187

Family Applications (1)

Application Number Title Priority Date Filing Date
JP56198382A Granted JPS58100147A (en) 1981-12-04 1981-12-11 Data transfer device

Country Status (1)

Country Link
JP (1) JPS58100147A (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6150445A (en) * 1984-08-20 1986-03-12 Oki Electric Ind Co Ltd Communication speed switching system

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5459804A (en) * 1977-10-21 1979-05-14 Hitachi Ltd Serial transmission equipment

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5459804A (en) * 1977-10-21 1979-05-14 Hitachi Ltd Serial transmission equipment

Also Published As

Publication number Publication date
JPS58100147A (en) 1983-06-14

Similar Documents

Publication Publication Date Title
JP2863653B2 (en) Microcomputer with built-in communication device
US5261060A (en) Eight-bit parallel communications method and apparatus
JPS5951186B2 (en) Control device
US6357015B1 (en) Data interface and high-speed communication system using the same
US4608689A (en) Data processing and transfer apparatus
JPH0424702A (en) Control system
CA1212738A (en) Remote initialization of interconnected communications stations
JPH0587851B2 (en)
JPS59114941A (en) Programmable controller
JPH0440737B2 (en)
JPH048980B2 (en)
AU607751B2 (en) Automatic processor module determination for multiprocessor systems
JP3473951B2 (en) Data processing device and system
JPS58219855A (en) Multiple input-output device of numeral control unit
KR930004948B1 (en) Method for communicating data between micro-processors
JP2841436B2 (en) Communication function self-diagnosis device
JP4604354B2 (en) Information input / output device
JPH0126213B2 (en)
JPS61270952A (en) Data transmitting system
JP2623816B2 (en) Signal transmission method
JPH0483443A (en) Rs232c interface unit
SU1278871A1 (en) Interface for linking microprocessor peripheral equipment with input-output channel of electronic computer
JPS6028026B2 (en) Central processing unit mutual communication method
JPS58100150A (en) Data transfer device
JPH04322345A (en) Information processor