JP2000115283A - Serial communication equipment - Google Patents

Serial communication equipment

Info

Publication number
JP2000115283A
JP2000115283A JP10291384A JP29138498A JP2000115283A JP 2000115283 A JP2000115283 A JP 2000115283A JP 10291384 A JP10291384 A JP 10291384A JP 29138498 A JP29138498 A JP 29138498A JP 2000115283 A JP2000115283 A JP 2000115283A
Authority
JP
Japan
Prior art keywords
terminal
level
data
communication
clock
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP10291384A
Other languages
Japanese (ja)
Other versions
JP3715803B2 (en
Inventor
Satoru Akiyama
哲 秋山
Tetsuo Kishida
徹夫 岸田
Koichi Suzuki
浩一 鈴木
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 JP29138498A priority Critical patent/JP3715803B2/en
Publication of JP2000115283A publication Critical patent/JP2000115283A/en
Application granted granted Critical
Publication of JP3715803B2 publication Critical patent/JP3715803B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Communication Control (AREA)
  • Maintenance And Management Of Digital Transmission (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide clock synchronous serial communication equipment that can conduct serial communication with a minimum number of signal lines and be restored to a normal state even when the communication hangs up. SOLUTION: The equipment where clock synchronous serial communication with a prescribed data number is conducted between a 1st device and a 2nd device is provided with a means that transmits clocks of a prescribed data number from the 1st device 1, a transmission means that sequentially transmits data synchronously with the clock from the 1st device, a reception means of the 2nd device 2 that receives the data synchronously with the clock, an initializing instruction means that transmits clocks whose number if more than the prescribed data number from the 1st device 1, and a means that uses the initializing instruction means to initialize communication by the 2nd device.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、クロックに同期し
てデータを順次送受信するクロック同期シリアル通信装
置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a clock synchronous serial communication device for sequentially transmitting and receiving data in synchronization with a clock.

【0002】[0002]

【従来の技術】従来、クロック同期シリアル通信は、特
開平6−243052号公報に記載されているように、
クロック信号線とデータ信号線の他にハンドシェイク信
号線を設け、通信にエラーが起きた場合にハンドシェイ
ク信号線を使ってリカバリーできるように構成されてい
る。
2. Description of the Related Art Conventionally, clock synchronous serial communication has been disclosed in Japanese Patent Application Laid-Open No. Hei 6-243052.
A handshake signal line is provided in addition to the clock signal line and the data signal line, so that when an error occurs in communication, recovery can be performed using the handshake signal line.

【0003】[0003]

【発明が解決しようとする課題】しかしながら、上記従
来例では、クロック同期シリアル通信に必要なクロック
信号線とデータ信号線以外にハンドシェイクのための信
号線が必要であった。
However, in the above conventional example, a signal line for handshaking is required in addition to a clock signal line and a data signal line required for clock synchronous serial communication.

【0004】本発明は、上述の点に鑑みてなされたもの
で、最低限の信号線でシリアル通信を行い、且つ通信が
ハングアップしても正常状態に復帰できるクロック同期
シリアル通信装置を提供することを目的とする。
The present invention has been made in view of the above points, and provides a clock synchronous serial communication device capable of performing serial communication with a minimum number of signal lines and returning to a normal state even if communication hangs up. The purpose is to:

【0005】[0005]

【課題を解決するための手段】上記目的を達成するため
に、本発明の請求項1に係わるシリアル通信装置は、第
一の装置と第二の装置との間で、所定データ数のクロッ
ク同期シリアル通信を行う装置において、前記第一の装
置から所定のデータ数分のクロックを送出する手段と、
前記第一の装置から前記クロックに同期して順次データ
を送出する送信手段と、前記第二の装置で前記クロック
に同期して前記データを受信する受信手段と、前記第一
の装置から所定のデータ数より多いクロックを送出する
初期化指示手段と、前記初期化指示手段により前記第二
の装置の通信を初期化する手段とを設けたことを特徴と
する。
In order to achieve the above object, a serial communication device according to the first aspect of the present invention comprises a first device and a second device which perform clock synchronization of a predetermined number of data. In a device that performs serial communication, means for transmitting a clock for a predetermined number of data from the first device,
Transmitting means for sequentially transmitting data from the first device in synchronization with the clock; receiving means for receiving the data in synchronization with the clock in the second device; An initialization instructing unit for transmitting a clock larger than the number of data, and a unit for initializing communication of the second device by the initialization instructing unit are provided.

【0006】[0006]

【発明の実施の形態】以下、本発明の実施の形態を図面
を参照して詳細に説明する。
Embodiments of the present invention will be described below in detail with reference to the drawings.

【0007】(第1の実施の形態)図1は、本発明に係
るシリアル通信装置の第1の実施の形態を示す全体構成
図である。
(First Embodiment) FIG. 1 is an overall configuration diagram showing a first embodiment of a serial communication device according to the present invention.

【0008】図1において、1は第一の装置としてのシ
リアル通信のマスタ側である装置、2は第二の装置とし
てのシリアル通信のスレーブ側である装置、3は装置1
から出力されるクロック信号線、4はクロック信号に同
期してデータを送受信する双方向のデータ信号線、5は
装置1を制御するマイクロコンピュータ、6はマイクロ
コンピュータ5の出力ポートで、クロック信号に同期し
てデータを出力するSO出力端子、7はマイクロコンピ
ュータ5の入力ポートでクロック信号に同期してデータ
を入力するSI入力端子、8はオープンコレクタで使わ
れているトランジスタで、ベースがSO出力端子6に、
コレクタがデータ信号線4に接続されており、SO出力
端子6がハイ(以下「H」という)レベルのとき、トラ
ンジスタ8がオンしてデータ信号線4をLレベルにし、
SO出力端子6がロー(以下「L」という)レベルのと
き、トランジスタ8がオフしてデータ信号線4は抵抗9
でプルアップされているためにHレベルになる。
In FIG. 1, reference numeral 1 denotes an apparatus which is a master side of serial communication as a first apparatus, 2 denotes an apparatus which is a slave side of serial communication as a second apparatus, and 3 denotes an apparatus 1
4 is a bidirectional data signal line for transmitting and receiving data in synchronization with the clock signal, 5 is a microcomputer for controlling the device 1, 6 is an output port of the microcomputer 5, and 6 is an output port of the microcomputer 5. An SO output terminal for outputting data in synchronization, 7 is an input port of the microcomputer 5 and an SI input terminal for inputting data in synchronization with a clock signal, 8 is a transistor used as an open collector, and the base is an SO output terminal. To terminal 6,
When the collector is connected to the data signal line 4 and the SO output terminal 6 is at a high (hereinafter referred to as “H”) level, the transistor 8 is turned on to bring the data signal line 4 to an L level,
When the SO output terminal 6 is at a low (hereinafter “L”) level, the transistor 8 is turned off and the data signal line 4 is connected to the resistor 9.
Becomes H level because it is pulled up.

【0009】10は装置2を制御するマイクロコンピュ
ータ、11はCK端子12に入力されたクロック信号の
立ち上がり毎にSI入力端子13のデータを入力し、順
次内部のラッチデータをシフトさせ、最終段のラッチの
出力をSO端子14に出力する8ビットのシフトレジス
タであり、当該シフトレジスタ11を構成している8個
の各ラッチのデータは、マイクロコンピュータ10がR
/W端子15をLレベルにすることでDATAバス端子
16に出力されマイクロコンピュータ10に入力され
る。
Reference numeral 10 denotes a microcomputer for controlling the device 2, and reference numeral 11 denotes data at the SI input terminal 13 every time the clock signal input to the CK terminal 12 rises, sequentially shifts internal latch data, and The microcomputer 10 is an 8-bit shift register that outputs the output of the latch to the SO terminal 14.
When the / W terminal 15 is set to L level, the data is output to the DATA bus terminal 16 and input to the microcomputer 10.

【0010】また、マイクロコンピュータ10は、R/
W端子15をHレベルにし、DATAバス端子16に送
信データをセットし、LD端子17をLレベルにするこ
とでシフトレジスタ11の各ラッチにデータを入力でき
る。
The microcomputer 10 has an R /
By setting the W terminal 15 to H level, setting the transmission data to the DATA bus terminal 16 and setting the LD terminal 17 to L level, data can be input to each latch of the shift register 11.

【0011】18は0から8までをカウントするカウン
タで、クロック信号3の立ち上がりでカウント値が+1
され、マイクロコンピュータ10はそのカウント値19
を読み取ることができ、CLR端子20をLレベルにす
ることでカウント値を0に戻すことができる。
Reference numeral 18 denotes a counter for counting from 0 to 8, and the count value is increased by +1 at the rise of the clock signal 3.
The microcomputer 10 counts the count value 19
Can be read, and the count value can be returned to 0 by setting the CLR terminal 20 to the L level.

【0012】21はEX−OR回路で、マイクロコンピ
ュータ10がMD端子22をHレベルにすることでクロ
ック信号3を反転した信号をCK端子12に出力し、M
D端子22をLレベルにすることでクロック信号3をそ
のままCK端子12に出力する。
Reference numeral 21 denotes an EX-OR circuit. The microcomputer 10 outputs an inverted signal of the clock signal 3 to the CK terminal 12 by setting the MD terminal 22 to the H level.
By setting the D terminal 22 to the L level, the clock signal 3 is output to the CK terminal 12 as it is.

【0013】23はDフリップフロップで、D端子がプ
ルアップされているため、CK端子12の立ち上がりエ
ッジでQ端子24はHレベルになり、マイクロコンピュ
ータ10がRXS端子25をHレベルにすることでDフ
リップフロップ23にリセットがかかりQ端子24はL
レベルになる。
Reference numeral 23 denotes a D flip-flop. Since the D terminal is pulled up, the Q terminal 24 goes high at the rising edge of the CK terminal 12, and the microcomputer 10 turns the RXS terminal 25 high. The D flip-flop 23 is reset and the Q terminal 24 is L
Become a level.

【0014】26はNAND回路、27はオープンコレ
クタで使われているトランジスタで、ベースがNAND
回路26の出力に、コレクタがデータ信号線4に接続さ
れており、NAND回路26の出力がHレベルのとき、
トランジスタ27がオンしてデータ信号線4をLレベル
にし、NAND回路26の出力がLレベルのとき、トラ
ンジスタ27がオフしてデータ信号線4は抵抗28でプ
ルアップされているためにHレベルになる。
26 is a NAND circuit, 27 is a transistor used as an open collector, and the base is a NAND circuit.
When the collector of the circuit 26 is connected to the data signal line 4 and the output of the NAND circuit 26 is at the H level,
When the transistor 27 is turned on to set the data signal line 4 to the L level and the output of the NAND circuit 26 is at the L level, the transistor 27 is turned off and the data signal line 4 is pulled up by the resistor 28 to the H level. Become.

【0015】29は0から24までをカウントするカウ
ンタで、クロック信号3の立ち上がりでカウント値が+
1され、マイクロコンピュータ10はそのカウント値3
1を読み取ることができ、CLR端子30をLレベルに
することでカウント値を0に戻すことができる。
Reference numeral 29 denotes a counter for counting from 0 to 24, and the count value is increased by + at the rise of the clock signal 3.
The microcomputer 10 counts the count value 3
1 can be read, and the count value can be returned to 0 by setting the CLR terminal 30 to L level.

【0016】以上の構成においてマイクロコンピュータ
5は、クロックを送出して第一の装置1が送信若しくは
受信のためにデータ数に合わせてクロック信号を第二の
装置2に送出するように動作し、マイクロコンピュータ
10は、シフトレジスタ11を使って第一の装置1が送
出したクロック信号に同期して順次データ信号のデータ
を受信若しくはデータを順次データ信号に送出するよう
に動作し、初期化指示手段は、第一の装置1がデータ数
に対して十分多い数のクロック信号を送出することで、
第二の装置2に通信の初期化を指示するように動作す
る。マイクロコンピュータ10は、初期化指示手段で第
一の装置1から初期化を指示されたと認識したときに、
第二の装置2の通信を初期状態にするように動作する。
In the above configuration, the microcomputer 5 operates so that the first device 1 sends a clock signal to the second device 2 in accordance with the number of data for transmission or reception, by sending a clock, The microcomputer 10 operates to receive the data of the data signal sequentially or transmit the data to the data signal sequentially using the shift register 11 in synchronization with the clock signal transmitted by the first device 1. Is that the first device 1 sends out a sufficiently large number of clock signals with respect to the number of data,
It operates to instruct the second device 2 to initialize communication. When the microcomputer 10 recognizes that the initialization has been instructed from the first device 1 by the initialization instructing means,
It operates so that the communication of the second device 2 is initialized.

【0017】以下に図1乃至図5を参照して回路動作を
説明する。
The operation of the circuit will be described below with reference to FIGS.

【0018】図2は、本発明の第1の実施の形態に係わ
るタイミングチャート、図3、4は、本発明の第1の実
施の形態に係わるフローチャート、図5は、本発明の第
1の実施の形態に係わるフローチャートである。
FIG. 2 is a timing chart according to the first embodiment of the present invention, FIGS. 3 and 4 are flowcharts according to the first embodiment of the present invention, and FIG. 5 is a timing chart according to the first embodiment of the present invention. 6 is a flowchart according to the embodiment.

【0019】図2は送受信1サイクルを正常に行ってい
るときのタイミングチャートであり、図3、4は装置1
の通信制御フローチャート、図5は装置2の通信制御フ
ローチャートである。
FIG. 2 is a timing chart when one cycle of transmission / reception is performed normally, and FIGS.
FIG. 5 is a communication control flowchart of the device 2.

【0020】これらの図1乃至図5を使って装置1から
装置2にコマンドデータを送信し、装置1が装置2から
ステータスデータを受信する通信の動作を説明する。
A communication operation in which command data is transmitted from the device 1 to the device 2 and the device 1 receives status data from the device 2 will be described with reference to FIGS.

【0021】先ず、図3、4で第一の装置1の動作を説
明する。
First, the operation of the first apparatus 1 will be described with reference to FIGS.

【0022】ステップS301では、マイクロコンピュ
ータ5が送信するコマンドデータを、送信のために使用
する内蔵の8ビット汎用レジスタである送信レジスタに
セットする。ステップS302では、ループ回数を記憶
する内蔵の汎用レジスタ(ループレジスタ)に1をセッ
トする。ステップS303ではCK端子3をLレベルに
する。ステップS304では、送信レジスタのビット位
置の8ビット目のデータが0か1かを判断し、8ビット
目が0ならばステップ305へ移り、8ビット目が1な
らばステップS306へ移る。ステップS305では、
SO端子6をHレベルにすることで、DATA信号線4
をLレベルにする。ステップS306では、SO端子6
をLレベルにすることで、DATA信号線4をHレベル
にする。ステップS307では、CK端子3をHレベル
にする。ステップS308では、ループレジスタの値を
判断し、ループ回数が8以外ならばステップS309へ
移り、ループ回数が8ならばステップS311へ移る。
ステップS309では、ループレジスタの値に1を加算
する。ステップS310では、送信レジスタのデータを
左に1ビットシフト(7ビット目のデータを8ビット目
に、6ビット目のデータを7ビット目に、というように
各ビットを移動し、1ビット目のデータは0をセット)
し、ステップS303に戻る。
In step S301, command data transmitted by the microcomputer 5 is set in a transmission register which is a built-in 8-bit general-purpose register used for transmission. In step S302, 1 is set to a built-in general-purpose register (loop register) that stores the number of loops. In step S303, the CK terminal 3 is set to L level. In step S304, it is determined whether the data of the 8th bit at the bit position of the transmission register is 0 or 1. If the 8th bit is 0, the process proceeds to step 305. If the 8th bit is 1, the process proceeds to step S306. In step S305,
By setting the SO terminal 6 to the H level, the DATA signal line 4
To L level. In step S306, the SO terminal 6
Is set to L level, so that the DATA signal line 4 is set to H level. In step S307, the CK terminal 3 is set to the H level. In step S308, the value of the loop register is determined. If the number of loops is other than 8, the process proceeds to step S309, and if the number of loops is 8, the process proceeds to step S311.
In step S309, 1 is added to the value of the loop register. In step S310, the data of the transmission register is shifted to the left by one bit (the data of the seventh bit is moved to the eighth bit, the data of the sixth bit is moved to the seventh bit, and so on. (Data is set to 0)
Then, the process returns to step S303.

【0023】ステップS311では、8ビットのコマン
ドデータの送信が終了したので、SO端子6をLレベル
にすることで、DATA信号線4をHレベルにしてDA
TA信号線4を装置2に開放する。ステップS312で
は、SI端子7がLレベルであるかを監視し、装置2が
ステータスデータの送信準備を完了すると、SI端子7
がLレベルになるため、ステップS313へ移り、ステ
ータスの受信を開始する。ステップS313では、ルー
プレジスタに1をセットする。ステップS314では、
CK端子3をLレベルにする。ステップS315では、
CK端子3をHレベルにする。ステップS316では、
SI端子7のレベルを判断し、SI端子7がHレベルで
あればステップS317へ移り、SI端子7がLレベル
であればステップS318へ移る。ステップS317で
は、マイクロコンピュータ5がステータスデータを受信
するために使用する内蔵の8ビット汎用レジスタである
受信レジスタの1ビット目に1をセットする。ステップ
S318では、受信レジスタの1ビット目に0をセット
する。
In step S311, since transmission of the 8-bit command data has been completed, the SO terminal 6 is set to the L level, and the DATA signal line 4 is set to the H level to set the DA signal.
The TA signal line 4 is opened to the device 2. In step S312, it is monitored whether or not the SI terminal 7 is at the L level.
Goes to the L level, the flow shifts to step S313 to start receiving the status. In step S313, 1 is set in the loop register. In step S314,
The CK terminal 3 is set to L level. In step S315,
The CK terminal 3 is set to the H level. In step S316,
The level of the SI terminal 7 is determined. If the SI terminal 7 is at the H level, the process proceeds to step S317. If the SI terminal 7 is at the L level, the process proceeds to step S318. In step S317, the microcomputer 5 sets 1 to the first bit of a reception register which is a built-in 8-bit general-purpose register used for receiving status data. In step S318, 0 is set to the first bit of the reception register.

【0024】ステップS319では、ループレジスタの
値を判断し、ループ回数が8以外ならばステップS32
0へ移り、ループ回数が8ならばステップS322へ移
る。ステップS320では、ループレジスタの値に1を
加算する。ステップS321では、受信レジスタのデー
タを左に1ビットシフトし、ステップS314に戻る。
ステップS322では、8ビットのステータスデータの
受信が終了したので、受信レジスタのデータを別のレジ
スタに格納し、コマンド/ステータスデータの1サイク
ル分の通信を終了し、ステップS301に戻る。
In step S319, the value of the loop register is determined, and if the number of loops is not 8, step S32
The process proceeds to 0, and if the number of loops is 8, the process proceeds to step S322. In step S320, 1 is added to the value of the loop register. In step S321, the data in the reception register is shifted left by one bit, and the process returns to step S314.
In step S322, since the reception of the 8-bit status data has been completed, the data of the reception register is stored in another register, the communication for one cycle of the command / status data is completed, and the process returns to step S301.

【0025】次に、図5で装置2の動作を説明する。Next, the operation of the apparatus 2 will be described with reference to FIG.

【0026】ステップS401では、マイクロコンピュ
ータ10が、CLR端子20を所定期間Lレベルにする
ことでカウンタ18のカウント値を0にする。ステップ
S402では、RXS端子25をLレベルにし、DAT
A信号線4を装置1が使用できるようにする。ステップ
S403では、シフトレジスタ11にデータ0をセット
(R/W端子15をHレベルにし、DATAバス端子1
6に0を入力し、LD端子17をLレベルにすることで
シフトレジスタ11の各ラッチを0にセット)すること
で、SO端子14をLレベルにし、DATA信号線4を
HレベルにしてDATA信号線4を装置1に開放する。
また、MD端子22をLレベルにすることで、クロック
信号線3をそのまま使用する受信モードにする。ステッ
プS404では、カウンタ18のカウント値を監視し、
カウント値が8になったらステップS405に移る。
In step S401, the microcomputer 10 sets the count value of the counter 18 to 0 by setting the CLR terminal 20 to the L level for a predetermined period. In step S402, the RXS terminal 25 is set to L level,
The A signal line 4 is used by the device 1. In step S403, data 0 is set in the shift register 11 (the R / W terminal 15 is set to the H level,
6, the LD terminal 17 is set to L level to set each latch of the shift register 11 to 0), so that the SO terminal 14 is set to L level, the DATA signal line 4 is set to H level, and DATA is set. The signal line 4 is opened to the device 1.
Further, by setting the MD terminal 22 to the L level, the reception mode is set in which the clock signal line 3 is used as it is. In step S404, the count value of the counter 18 is monitored,
When the count value reaches 8, the process proceeds to step S405.

【0027】ステップS405では、8ビットのコマン
ドデータの受信が終了したため、DATAバス端子16
のデータを内蔵のコマンド用レジスタに格納する。ステ
ップS406では、コマンド用レジスタの内容を解析
し、コマンドで指示された処理を実行する。ステップS
407では、CLR端子20を所定期間Lレベルにする
ことでカウンタ18のカウント値を0にする。ステップ
S408では、シフトレジスタ11にステータスデータ
をセットするため、R/W端子15をHレベルにし、D
ATAバス端子16にステータスデータを入力し、LD
端子17をLレベルにすることでシフトレジスタ11の
各ラッチにステータスデータをセットする。
In step S405, since the reception of the 8-bit command data has been completed, the data bus terminal 16
Is stored in the built-in command register. In step S406, the contents of the command register are analyzed, and the process specified by the command is executed. Step S
At 407, the count value of the counter 18 is set to 0 by setting the CLR terminal 20 to the L level for a predetermined period. In step S408, in order to set status data in the shift register 11, the R / W terminal 15 is set to H level,
Status data is input to the ATA bus terminal 16 and LD
By setting the terminal 17 to L level, status data is set in each latch of the shift register 11.

【0028】ステップS409では、LD端子17をH
レベルに、R/W端子15をLレベルに戻し、MD端子
22をHレベルにすることで、クロック信号線3を反転
して使用する送信モードにし、RXS端子25を所定期
間HレベルにすることでDATA信号線4をLレベルに
して装置1に送信準備が完了したことを知らせる。ステ
ップS410では、カウンタ18のカウント値を監視
し、カウント値が8になったら送信が終了したのでステ
ップS403に戻る。
In step S409, the LD terminal 17 is set to H level.
By returning the R / W terminal 15 to the L level and setting the MD terminal 22 to the H level, the clock signal line 3 is inverted and set to the transmission mode for use, and the RXS terminal 25 is set to the H level for a predetermined period. To set the DATA signal line 4 to the L level to notify the device 1 that the transmission preparation is completed. In step S410, the count value of the counter 18 is monitored, and when the count value reaches 8, the transmission ends, and the process returns to step S403.

【0029】図6は、本発明の第1の実施の形態に係わ
るタイミングチャート、図7は、本発明の第1の実施の
形態に係わるフローチャート、図8は、本発明の第1の
実施の形態に係わるフローチャートである。
FIG. 6 is a timing chart according to the first embodiment of the present invention, FIG. 7 is a flowchart according to the first embodiment of the present invention, and FIG. 8 is a flowchart according to the first embodiment of the present invention. It is a flowchart concerning a form.

【0030】図6は装置1が装置2に通信の初期化を指
示しているときのタイミングチャートであり、図7は装
置1の初期化指示制御フローチャート、図8は装置2の
通信初期化制御フローチャートである。
FIG. 6 is a timing chart when the device 1 is instructing the device 2 to initialize communication. FIG. 7 is a flowchart for controlling the initialization of the device 1, and FIG. It is a flowchart.

【0031】これらの図6乃至図8を使用して装置1か
らの初期化指示により装置2が通信を初期化する動作を
説明する。
The operation of the apparatus 2 for initializing communication in response to an initialization instruction from the apparatus 1 will be described with reference to FIGS.

【0032】先ず、図7で装置1の初期化指示動作を説
明する。
First, an initialization instruction operation of the device 1 will be described with reference to FIG.

【0033】ステップS601では、SO端子6をHレ
ベルにすることで、DATA信号線4をLレベルにす
る。ステップS602では、マイクロコンピュータ5
が、ループ回数を記憶する内蔵の汎用レジスタ(第二ル
ープレジスタ)に1をセットする。ステップS603で
は、CK端子3をLレベルにする。ステップS604で
は、CK端子3をHレベルにする。ステップS605で
は、第二ループレジスタの値を判断し、ループ回数が2
4以外ならばステップS606へ移り、ループ回数が2
4ならばステップS603へ戻る。ステップS606で
は、ループレジスタの値に1を加算し、ステップS60
3へ戻る。ステップS607では、SO端子6をLレベ
ルにすることで、DATA信号線4をHレベルにする。
ステップS608では、図3、4で説明した通信処理を
止め、所定時間待機した後、通信をステップS301か
ら再開する。
In step S601, the data terminal line 4 is set to L level by setting the SO terminal 6 to H level. In step S602, the microcomputer 5
Sets 1 in a built-in general-purpose register (second loop register) that stores the number of loops. In step S603, the CK terminal 3 is set to L level. In step S604, the CK terminal 3 is set to the H level. In step S605, the value of the second loop register is determined, and the number of loops is 2
If it is other than 4, the process proceeds to step S606, and the number of loops is 2
If it is 4, the process returns to step S603. In step S606, 1 is added to the value of the loop register, and in step S60
Return to 3. In step S607, the DATA signal line 4 is set to the H level by setting the SO terminal 6 to the L level.
In step S608, the communication process described with reference to FIGS. 3 and 4 is stopped, and after waiting for a predetermined time, communication is restarted from step S301.

【0034】次に、図8で装置2の通信初期化動作を説
明する。
Next, the communication initialization operation of the device 2 will be described with reference to FIG.

【0035】ステップS701では、SI端子7がLレ
ベルであるかを監視し、SI端子7がHレベルのとき
は、ステップS702へ移り、SI端子7がLレベルの
ときには、ステップS703へ移る。ステップS702
では、初期化指示ではないと判断し、CLR端子30を
所定期間Lレベルにすることでカウンタ29の値を0に
する。ステップS703では、カウンタ29のカウント
値を監視し、カウント値が24でなければステップS7
01に戻り、カウント値が24であれば、ステップS7
04に移る。ステップS704では、装置1が通信の初
期化を指示したと判断し、図5で説明した通信処理を止
め、所定時間待機した後、通信をステップS401から
再開する。
In step S701, it is monitored whether the SI terminal 7 is at the L level. When the SI terminal 7 is at the H level, the process proceeds to step S702, and when the SI terminal 7 is at the L level, the process proceeds to step S703. Step S702
Then, it is determined that the instruction is not an initialization instruction, and the value of the counter 29 is set to 0 by setting the CLR terminal 30 to the L level for a predetermined period. In step S703, the count value of the counter 29 is monitored.
01 and if the count value is 24, the process proceeds to step S7.
Move to 04. In step S704, it is determined that the device 1 has instructed communication initialization, the communication process described with reference to FIG. 5 is stopped, and after waiting for a predetermined time, communication is restarted from step S401.

【0036】以上説明したように、通信に異常があった
場合に、装置1が装置2に対してDATA信号をLレベ
ルに固定し、通常より多いクロックを送出することで、
通信の初期化が行えるため、クロック信号線3とデータ
信号線4の2本でシリアル通信を行うことができる。
As described above, when there is an abnormality in communication, the device 1 fixes the DATA signal to the L level to the device 2 and sends out more clocks than usual,
Since communication initialization can be performed, serial communication can be performed using two clock signal lines 3 and data signal lines 4.

【0037】(第2の実施の形態)本発明に係るシリア
ル通信装置の第2の実施の形態は、図1に示す装置2に
おいてカウンタ29をなくした構成としており、その他
の構成は実施の形態1と同様でありその説明は省略す
る。また、図1において装置1の通信制御は、実施の形
態1と同様であり、その説明は省略する。
(Second Embodiment) A second embodiment of the serial communication device according to the present invention has a configuration in which the counter 29 is eliminated from the device 2 shown in FIG. 1, and the description is omitted. In FIG. 1, the communication control of the device 1 is the same as that of the first embodiment, and the description thereof is omitted.

【0038】図9は、本発明に係わるシリアル通信装置
の第2の実施の形態に係わるタイミングチャート、図1
0は、本発明の第2の実施の形態に係わるフローチャー
ト、図11は、本発明の第2の実施の形態に係わるフロ
ーチャートである。
FIG. 9 is a timing chart according to a second embodiment of the serial communication apparatus according to the present invention.
0 is a flowchart according to the second embodiment of the present invention, and FIG. 11 is a flowchart according to the second embodiment of the present invention.

【0039】図9は、装置1が装置2に通信の初期化を
指示しているときのタイミングチャートであり、図10
は、装置1の初期化指示制御フローチャート、図11
は、装置2の通信制御フローチャートである。
FIG. 9 is a timing chart when the device 1 instructs the device 2 to initialize communication.
FIG. 11 is a flowchart of an initialization instruction control of the apparatus 1;
5 is a communication control flowchart of the device 2.

【0040】図9乃至図11を使用して装置1からの初
期化指示により装置2が通信を初期化する動作を説明す
る。
The operation of the apparatus 2 for initializing communication in response to an initialization instruction from the apparatus 1 will be described with reference to FIGS.

【0041】先ず、図10のフローチャートにより装置
1の初期化指示動作を説明する。
First, the initialization instruction operation of the device 1 will be described with reference to the flowchart of FIG.

【0042】ステップS901では、SO端子6をLレ
ベルにすることで、DATA信号線4を開放する。ステ
ップS902では、マイクロコンピュータ5が、ループ
回数を記憶する内蔵の汎用レジスタ(第二ループレジス
タ)を1にセットする。ステップS903では、CK端
子3をLレベルにする。ステップS904では、CK端
子3をHレベルにする。ステップS905では、第二ル
ープレジスタの値を判断し、ループ回数が24以外なら
ばステップS906へ移り、ループ回数が24ならばス
テップS907へ移る。ステップS906では、ループ
レジスタの値に1を加算し、ステップS903へ戻る。
ステップS907では、実施の形態1の図3、4で説明
した通信処理を止め、ステップS301から再開する。
In step S901, the DATA signal line 4 is released by setting the SO terminal 6 to the L level. In step S902, the microcomputer 5 sets a built-in general-purpose register (second loop register) for storing the number of loops to one. In step S903, the CK terminal 3 is set to L level. In step S904, the CK terminal 3 is set to the H level. In step S905, the value of the second loop register is determined. If the number of loops is other than 24, the process proceeds to step S906, and if the number of loops is 24, the process proceeds to step S907. In step S906, 1 is added to the value of the loop register, and the process returns to step S903.
In step S907, the communication processing described in the first embodiment with reference to FIGS. 3 and 4 is stopped, and the processing is restarted from step S301.

【0043】次に、図11のフローチャートにより装置
2の通信制御及び通信初期化動作を説明する。
Next, the communication control and communication initialization operation of the device 2 will be described with reference to the flowchart of FIG.

【0044】ステップS101では、マイクロコンピュ
ータ10が、CLR端子20を所定期間Lレベルにする
ことでカウンタ18のカウント値を0にする。ステップ
S102では、RXS端子25をLレベルにし、DAT
A信号線4を装置1で使用できるようにする。ステップ
S103では、シフトレジスタ11にデータ0をセット
(R/W端子15をHレベルにし、DATAバス端子1
6に0を入力し、LD端子17をLレベルにすることで
シフトレジスタ11の各ラッチを0にセット)すること
で、SO端子14をLレベルにし、DATA信号線4を
HレベルにしてDATA信号線4を装置1に開放する。
また、MD端子22をLレベルにすることで、クロック
信号線3をそのまま使用する受信モードにする。
In step S101, the microcomputer 10 sets the count value of the counter 18 to 0 by setting the CLR terminal 20 to the L level for a predetermined period. In step S102, the RXS terminal 25 is set to L level,
The A signal line 4 can be used in the device 1. In step S103, data 0 is set in the shift register 11 (the R / W terminal 15 is set to the H level, and the DATA bus terminal 1 is set).
6, the LD terminal 17 is set to L level to set each latch of the shift register 11 to 0), so that the SO terminal 14 is set to L level, the DATA signal line 4 is set to H level, and DATA is set. The signal line 4 is opened to the device 1.
Further, by setting the MD terminal 22 to the L level, the reception mode is set in which the clock signal line 3 is used as it is.

【0045】ステップS104では、カウンタ18のカ
ウント値を監視し、カウント値が8になったらステップ
S105に移る。ステップS105では、8ビットのコ
マンドデータの受信が終了したため、DATAバス端子
16のデータを内蔵のコマンド用レジスタに格納する。
ステップS106では、コマンド用レジスタの内容がF
Fhであれば通信の初期化指示と判断し、ステップ11
2へ移り、所定時間待機した後ステップS101に戻
り、コマンド用レジスタの内容がFFh以外であればス
テップS107へ移る。
In step S104, the count value of the counter 18 is monitored, and when the count value reaches 8, the process proceeds to step S105. In step S105, since the reception of the 8-bit command data is completed, the data of the DATA bus terminal 16 is stored in the built-in command register.
In step S106, the content of the command register is F
If it is Fh, it is determined that the communication is to be initialized, and step 11 is performed.
The process returns to step S101 after waiting for a predetermined time, and if the contents of the command register are other than FFh, the process proceeds to step S107.

【0046】ステップS107では、コマンド用レジス
タの内容を解析し、コマンドで指示された処理を実行す
る。ステップS108では、CLR端子20を所定期間
Lレベルにすることでカウンタ18のカウント値を0に
する。ステップS109では、シフトレジスタ11にス
テータスデータをセットするため、R/W端子15をH
レベルにし、DATAバス端子16にステータスデータ
を入力し、LD端子17をLレベルにすることでシフト
レジスタ11の各ラッチにステータスデータをセットす
る。ステップS110では、LD端子17をHレベル
に、R/W端子15をLレベルに戻し、MD端子22を
Hレベルにすることで、クロック信号線3を反転して使
用する送信モードにし、RXS端子25を所定期間Hレ
ベルにすることでDATA信号線4をLレベルにして装
置1に送信準備が完了したことを知らせる。ステップS
111では、カウンタ18のカウント値を監視し、カウ
ント値が7になったら送信が終了したのでステップS1
03に戻る。
In step S107, the contents of the command register are analyzed, and the processing specified by the command is executed. In step S108, the count value of the counter 18 is set to 0 by setting the CLR terminal 20 to the L level for a predetermined period. In step S109, the R / W terminal 15 is set to the H level to set the status data in the shift register 11.
Level, status data is input to the DATA bus terminal 16, and the LD terminal 17 is set to L level, thereby setting the status data in each latch of the shift register 11. In step S110, the LD terminal 17 is returned to the H level, the R / W terminal 15 is returned to the L level, and the MD terminal 22 is set to the H level, thereby setting the transmission mode in which the clock signal line 3 is inverted and used, and the RXS terminal is used. By setting 25 to the H level for a predetermined period, the DATA signal line 4 is set to the L level to notify the device 1 that the transmission preparation is completed. Step S
At 111, the count value of the counter 18 is monitored, and when the count value reaches 7, the transmission is terminated.
Return to 03.

【0047】以上説明したように、通信に異常があった
場合に、装置1が装置2に対してDATA信号を開放し
たまま、通常の3倍以上のクロックを送出することで、
装置2が必ずFFhデータを受信するようにし、データ
がFFhのときに通信の初期化を行うようにすること
で、初期化のためにクロックをカウントするカウンタを
設けなくても通信の初期化を行える。
As described above, when there is an abnormality in the communication, the device 1 sends a clock three times or more the normal frequency while leaving the DATA signal open to the device 2,
The apparatus 2 always receives the FFh data, and initializes the communication when the data is FFh, so that the communication can be initialized without providing a counter for counting the clock for the initialization. I can do it.

【0048】[0048]

【発明の効果】以上説明したように、請求項1のシリア
ル通信装置によれば、1回の送受信のデータ数に対して
十分に多い数のクロックを通信の初期化指示とすること
で、ハングアップ状態からの復帰を行うことができ、必
要最低限の信号線数でシリアル通信を行うことができ
る。
As described above, according to the serial communication device of the first aspect, a hang can be achieved by setting a sufficiently large number of clocks for the number of data of one transmission / reception as the communication initialization instruction. It is possible to recover from the up state, and to perform serial communication with the minimum necessary number of signal lines.

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

【図1】本発明に係るシリアル通信装置の第1の実施の
形態を示す全体構成図である。
FIG. 1 is an overall configuration diagram showing a first embodiment of a serial communication device according to the present invention.

【図2】本発明の第1の実施の形態に係わるタイミング
チャートである。
FIG. 2 is a timing chart according to the first embodiment of the present invention.

【図3】本発明の第1の実施の形態に係わるフローチャ
ートである。
FIG. 3 is a flowchart according to the first embodiment of the present invention.

【図4】図3の続きのフローチャートである。FIG. 4 is a flowchart continued from FIG. 3;

【図5】本発明の第1の実施の形態に係わるフローチャ
ートである。
FIG. 5 is a flowchart according to the first embodiment of the present invention.

【図6】本発明の第1の実施の形態に係わるタイミング
チャートである。
FIG. 6 is a timing chart according to the first embodiment of the present invention.

【図7】本発明の第1の実施の形態に係わるフローチャ
ートである。
FIG. 7 is a flowchart according to the first embodiment of the present invention.

【図8】本発明の第1の実施の形態に係わるフローチャ
ートである。
FIG. 8 is a flowchart according to the first embodiment of the present invention.

【図9】本発明に係わるシリアル通信装置の第2の実施
の形態に係わるタイミングチャートである。
FIG. 9 is a timing chart according to a second embodiment of the serial communication device according to the present invention.

【図10】本発明の第2の実施の形態に係わるフローチ
ャートである。
FIG. 10 is a flowchart according to a second embodiment of the present invention.

【図11】本発明の第2の実施の形態に係わるフローチ
ャートである。
FIG. 11 is a flowchart according to a second embodiment of the present invention.

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

1 装置1(第一の装置) 2 装置2(第二の装置) 3 クロック信号線 4 データ信号線 5、10 マイクロコンピュータ Reference Signs List 1 device 1 (first device) 2 device 2 (second device) 3 clock signal line 4 data signal line 5, 10 microcomputer

───────────────────────────────────────────────────── フロントページの続き (72)発明者 鈴木 浩一 東京都大田区下丸子3丁目30番2号 キヤ ノン株式会社内 Fターム(参考) 5B083 AA00 BB03 CD00 CE01 DD13 GG04 5K034 AA05 AA12 CC01 DD01 FF01 HH01 HH02 HH09 HH12 LL03 PP01 5K035 AA05 DD01 FF01 FF02  ────────────────────────────────────────────────── ─── Continuing on the front page (72) Inventor Koichi Suzuki 3-30-2 Shimomaruko, Ota-ku, Tokyo F-term within Canon Inc. (reference) 5B083 AA00 BB03 CD00 CE01 DD13 GG04 5K034 AA05 AA12 CC01 DD01 FF01 HH01 HH02 HH09 HH12 LL03 PP01 5K035 AA05 DD01 FF01 FF02

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 第一の装置と第二の装置との間で、所定
データ数のクロック同期シリアル通信を行う装置におい
て、 前記第一の装置から所定のデータ数分のクロックを送出
する手段と、 前記第一の装置から前記クロックに同期して順次データ
を送出する送信手段と、 前記第二の装置で前記クロックに同期して前記データを
受信する受信手段と、 前記第一の装置から所定のデータ数より多いクロックを
送出する初期化指示手段と、 前記初期化指示手段により前記第二の装置の通信を初期
化する手段とを設けたことを特徴とするシリアル通信装
置。
An apparatus for performing clock synchronous serial communication of a predetermined number of data between a first apparatus and a second apparatus, comprising: means for transmitting a clock of a predetermined number of data from the first apparatus; Transmitting means for sequentially transmitting data from the first device in synchronization with the clock; receiving means for receiving the data in synchronization with the clock in the second device; A serial communication device comprising: an initialization instruction unit for transmitting a clock having a number of data larger than the number of data; and a unit for initializing communication of the second device by the initialization instruction unit.
JP29138498A 1998-09-30 1998-09-30 Serial communication device Expired - Lifetime JP3715803B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP29138498A JP3715803B2 (en) 1998-09-30 1998-09-30 Serial communication device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP29138498A JP3715803B2 (en) 1998-09-30 1998-09-30 Serial communication device

Publications (2)

Publication Number Publication Date
JP2000115283A true JP2000115283A (en) 2000-04-21
JP3715803B2 JP3715803B2 (en) 2005-11-16

Family

ID=17768229

Family Applications (1)

Application Number Title Priority Date Filing Date
JP29138498A Expired - Lifetime JP3715803B2 (en) 1998-09-30 1998-09-30 Serial communication device

Country Status (1)

Country Link
JP (1) JP3715803B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7743273B2 (en) 2007-05-25 2010-06-22 Toyota Jidosha Kabushiki Kaisha Serial communication system and method for transmitting and receiving data in synchronization with a clock signal
CN110971389A (en) * 2018-10-01 2020-04-07 发那科株式会社 Communication system, transmission device, reception device, communication method, transmission method, and reception method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7743273B2 (en) 2007-05-25 2010-06-22 Toyota Jidosha Kabushiki Kaisha Serial communication system and method for transmitting and receiving data in synchronization with a clock signal
CN110971389A (en) * 2018-10-01 2020-04-07 发那科株式会社 Communication system, transmission device, reception device, communication method, transmission method, and reception method
CN110971389B (en) * 2018-10-01 2023-06-02 发那科株式会社 Communication system, transmission device, reception device, communication method, transmission method, and reception method

Also Published As

Publication number Publication date
JP3715803B2 (en) 2005-11-16

Similar Documents

Publication Publication Date Title
CN101911000B (en) Control bus for connection of electronic devices
JP4188588B2 (en) Method and display system for updating an image frame on a screen
CN102253913B (en) Device for carrying out state acquisition and output control on multi-board-card port
EP1962198B1 (en) Bus system and methods of operation thereof
US5758073A (en) Serial interface between DSP and analog front-end device
JP2863653B2 (en) Microcomputer with built-in communication device
CN101089838A (en) Method for implementing 12C read-write sequence
GB2075310A (en) Bus extender circuitry for data transmission
GB1581836A (en) Cpu-i/o bus interface for a data processing system
EP3336710B1 (en) I²c bridge device
US4047246A (en) I/O bus transceiver for a data processing system
CN114911743B (en) SPI slave device, SPI master device and related communication method
US4047201A (en) I/O Bus transceiver for a data processing system
US6665757B1 (en) Communication interface having a master activating/deactivating a first signal with a clock signal after a predetermined time after a slave activating/deactivating the first signal
JP2000115283A (en) Serial communication equipment
CN116192624A (en) Communication interface configuration method and communication interface
WO2005083577A2 (en) Integrated circuit with two different bus control units
CN101324873B (en) Compatible type non-standard bit wide serial perimeter interface and data transmission method among interfaces
JP4604956B2 (en) Information processing device
JP3826004B2 (en) Numerical control apparatus and control method
JP4561590B2 (en) Information processing device
US5586272A (en) Asynchronous data transfers among a plurality of computer devices
KR100295683B1 (en) General call acknowledge apparatus and method for inter-integrated circuit
JPH05252227A (en) Serial communication equipment
JP3947330B2 (en) Synchronous serial communication controller

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20050425

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050510

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050711

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20050823

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050826

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20090902

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20090902

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20100902

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20110902

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20110902

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20120902

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20120902

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20130902

Year of fee payment: 8

EXPY Cancellation because of completion of term