JP2001290764A - Data transfer system device and its data transferring method - Google Patents

Data transfer system device and its data transferring method

Info

Publication number
JP2001290764A
JP2001290764A JP2000105097A JP2000105097A JP2001290764A JP 2001290764 A JP2001290764 A JP 2001290764A JP 2000105097 A JP2000105097 A JP 2000105097A JP 2000105097 A JP2000105097 A JP 2000105097A JP 2001290764 A JP2001290764 A JP 2001290764A
Authority
JP
Japan
Prior art keywords
data
transfer
data transfer
slave device
bytes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2000105097A
Other languages
Japanese (ja)
Inventor
Mitsutaka Iwasaki
充孝 岩崎
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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP2000105097A priority Critical patent/JP2001290764A/en
Publication of JP2001290764A publication Critical patent/JP2001290764A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To obtain a data transfer system device and its data transferring method capable of avoiding the conflict of a bus connecting a master unit and a slave unit. SOLUTION: When the slave unit 3 transfers data to the master unit 2 through a data line 4, a data transfer end deciding part 13 counts the number of bytes of transferred data, judges whether or not the data transfer has been finished by comparing the number of counted bytes with the number of transfer bytes stored in a register 31 from the master unit 2 and also releases the data line 4 when it is judged that the data transfer has been finished.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、マスタ装置とスレ
ーブ装置との間でシリアルデータ転送が行われるデータ
転送システム装置及びそのデータ転送方法に関し、特に
LSI間でI2Cバスを使用したデータのシリアル転送
が行われるデータ転送システム装置及びそのデータ転送
方法に関する。
The present invention relates to relates to a method data transfer system apparatus and the data transfer serial data is transferred between the master and slave devices, data using the I 2 C bus, especially between LSI The present invention relates to a data transfer system device for performing serial transfer and a data transfer method thereof.

【0002】[0002]

【従来の技術】従来、図4で示したような、マスタ装置
101とスレーブ装置102との間でシリアルにデータ
転送を行うシリアル転送システム装置100があった。
マスタ装置101及びスレーブ装置102は、データ転
送を行うためのデータライン103とクロック転送を行
うためのクロックライン104とで構成されたいわゆる
2Cバスで接続されている。
2. Description of the Related Art Conventionally, there has been a serial transfer system device 100 for serially transferring data between a master device 101 and a slave device 102 as shown in FIG.
The master device 101 and the slave device 102 are connected by a so-called I 2 C bus including a data line 103 for performing data transfer and a clock line 104 for performing clock transfer.

【0003】図5は、スレーブ装置102からマスタ装
置101にデータ転送する場合のデータ転送フォーマッ
トを示しており、マスタ装置101が1バイト目のすぐ
後からスレーブ装置102のデータを読み出す場合を示
している。なお、図5では、斜線で示した部分は、マス
タ装置101からスレーブ装置102へのデータ転送部
分を示しており、その他の部分はスレーブ装置102か
らマスタ装置101へのデータ転送部分を示している。
FIG. 5 shows a data transfer format when data is transferred from the slave device 102 to the master device 101, and shows a case where the master device 101 reads data from the slave device 102 immediately after the first byte. I have. In FIG. 5, the hatched portion indicates a data transfer portion from the master device 101 to the slave device 102, and the other portions indicate a data transfer portion from the slave device 102 to the master device 101. .

【0004】マスタ装置101は、スレーブ装置102
との通信を開始するための開始条件Sをスレーブ装置1
02に出力し、スレーブ装置102のアドレスを出力し
た後、データの転送方向を示すデータR/W#を出力す
る。該アドレスは7ビットで構成され、1バイトデータ
の8ビット目に1ビットデータR/W#が続く。また、
データR/W#が「0」のときは、マスタ装置からスレ
ーブ装置の方向にデータ転送が行われ、データR/W#
が「1」のときは、スレーブ装置からマスタ装置の方向
にデータ転送が行われる。
A master device 101 is a slave device 102
Start condition S for starting communication with the slave device 1
02 and outputs the address of the slave device 102, and then outputs data R / W # indicating the data transfer direction. The address is composed of 7 bits, and 1-bit data R / W # follows 8th bit of 1-byte data. Also,
When the data R / W # is "0", data transfer is performed from the master device to the slave device, and the data R / W #
Is "1", data is transferred from the slave device to the master device.

【0005】更に、各バイトデータの後には、「A」又
は「A#」で示した確認応答が続き、「A#」で示した
確認応答は、「A」で示した確認応答の信号レベルを反
転させた信号レベルであることを示している。例えば、
「A」で示した確認応答がLowレベルであると、「A
#」で示した確認応答はHighレベルである。マスタ
装置101は、スレーブ装置102から所望のデータの
読み出しが終了すると「A#」で示したデータ転送終了
の応答をスレーブ装置102に出力した後、スレーブ装
置102との通信を停止するための停止条件Pをスレー
ブ装置102に出力して通信が完了する。
[0005] Further, after each byte data, an acknowledgment indicated by "A" or "A #" follows, and the acknowledgment indicated by "A #" is a signal level of the acknowledgment indicated by "A". Is the inverted signal level. For example,
If the acknowledgment indicated by “A” is at a low level, “A”
The confirmation response indicated by “#” is at the High level. When the reading of the desired data from the slave device 102 is completed, the master device 101 outputs a data transfer completion response indicated by “A #” to the slave device 102, and then stops the communication with the slave device 102. The condition P is output to the slave device 102, and the communication is completed.

【0006】[0006]

【発明が解決しようとする課題】しかし、スレーブ装置
へのデータ転送が終了したことを示す応答をスレーブ装
置に出力しないマスタ装置があった。また、本来なら
ば、スレーブ装置102へのデータ転送が終了したこと
を示す応答がマスタ装置101から出力されるはずが、
ノイズ等の影響によって該応答が出力されない、又はス
レーブ装置102に正常に伝わらないといった場合があ
った。このような場合、スレーブ装置102側は、マス
タ装置101からのデータ転送の終了を認識することが
できず、スレーブ装置102は、マスタ装置101に引
き続きデータ転送を行うためにデータライン103をホ
ールドしたままの状態となる。
However, there has been a master device that does not output a response indicating that data transfer to the slave device has been completed to the slave device. Also, originally, a response indicating that the data transfer to the slave device 102 has been completed should be output from the master device 101.
In some cases, the response was not output due to the influence of noise or the like, or the response was not transmitted to the slave device 102 normally. In such a case, the slave device 102 cannot recognize the end of the data transfer from the master device 101, and the slave device 102 holds the data line 103 in order to perform the data transfer continuously to the master device 101. It remains as it is.

【0007】例えば、スレーブ装置102が、マスタ装
置101に引き続きデータ転送を行うためにデータライ
ン103をLowレベルにホールドすると、マスタ装置
101は、バスのコンフリクトによって停止条件Pをス
レーブ装置102に送ることができなくなり、データラ
イン103の制御を行うことができず、スレーブ装置1
02との通信に不具合が生じるという問題があった。
For example, when the slave device 102 holds the data line 103 at the Low level in order to continue data transfer to the master device 101, the master device 101 sends a stop condition P to the slave device 102 due to a bus conflict. Cannot be controlled, and the data line 103 cannot be controlled.
There is a problem that a problem occurs in communication with the C.02.

【0008】本発明は、上記のような問題を解決するた
めになされたものであり、マスタ装置からデータ転送終
了の応答が得られなくとも、スレーブ装置側でデータ転
送の終了を判定できるようにしたことによって、マスタ
装置とスレーブ装置とを接続するバスのコンフリクトを
回避させることができる、シリアルデータ転送を行うデ
ータ転送システム装置及びそのデータ転送方法を得るこ
とを目的とする。
SUMMARY OF THE INVENTION The present invention has been made to solve the above-described problem, and enables the slave device to determine the end of data transfer without receiving a response from the master device to end the data transfer. Accordingly, an object of the present invention is to provide a data transfer system device for performing serial data transfer and a data transfer method thereof, which can avoid a conflict of a bus connecting a master device and a slave device.

【0009】[0009]

【課題を解決するための手段】この発明に係るデータ転
送システム装置は、データ転送を行うためのデータライ
ン及びクロック転送を行うためのクロックラインで接続
されたマスタ装置とスレーブ装置との間でシリアルデー
タ転送を行うデータ転送システム装置において、スレー
ブ装置は、マスタ装置から入力されるデータ転送時にお
ける転送データバイト数を格納する転送バイト数格納部
と、マスタ装置との間で転送を行ったデータのバイト数
をカウントし、該カウントしたバイト数と転送バイト数
格納部に格納された転送バイト数とを比較してデータ転
送の終了判定を行うデータ転送終了判定部と、該データ
転送終了判定部によってデータ転送が終了したと判定さ
れると、データラインを所定の2値のレベルにして解放
するデータライン解放部とを備え、データ転送終了判定
部は、カウントしたバイト数と転送バイト数格納部に格
納された転送バイト数が一致すると、データ転送が終了
したと判定するものである。
According to the present invention, there is provided a data transfer system device comprising: a serial device for connecting a master device and a slave device connected by a data line for performing data transfer and a clock line for performing clock transfer; In a data transfer system device that performs data transfer, a slave device includes a transfer byte number storage unit that stores the number of transfer data bytes during data transfer input from the master device, and a transfer byte number storage unit that stores data transferred between the master device. A data transfer end determining unit that counts the number of bytes and compares the counted number of bytes with the number of transfer bytes stored in the transfer byte number storage unit to determine whether to end the data transfer; and When it is determined that the data transfer is completed, the data line is released by setting the data line to a predetermined binary level. And a release unit, the data transfer termination determination unit, when the number of transfer bytes stored number of bytes counted and the transfer byte number storage unit match, is to determine the data transfer is completed.

【0010】具体的には、上記データ転送終了判定部
は、クロックラインを介してマスタ装置から入力される
クロックをカウントすることによって、転送が行われた
データのバイト数のカウントを行うようにした。
More specifically, the data transfer end determining unit counts the number of bytes of the transferred data by counting the clock input from the master device via the clock line. .

【0011】また、データ転送を行うためのデータライ
ン及びクロック転送を行うためのクロックラインで接続
されたマスタ装置とスレーブ装置との間でシリアルデー
タ転送を行うデータ転送システム装置におけるデータ転
送方法において、マスタ装置から出力されるデータ転送
時の転送データバイト数をスレーブ装置に格納し、マス
タ装置とスレーブ装置との間で転送が行われたデータの
バイト数をスレーブ装置でカウントし、スレーブ装置に
格納された転送データバイト数と、該カウントしたバイ
ト数とをスレーブ装置で比較し、カウントしたバイト数
と格納したマスタ装置からの転送バイト数が一致すると
データ転送が終了したとスレーブ装置で判定し、データ
ラインをスレーブ装置で所定の2値のレベルにして解放
するようにした。
In a data transfer method in a data transfer system device for performing serial data transfer between a master device and a slave device connected by a data line for performing data transfer and a clock line for performing clock transfer, The number of transfer data bytes output from the master device during data transfer is stored in the slave device, the number of bytes of data transferred between the master device and the slave device is counted by the slave device, and stored in the slave device. The slave device compares the number of transferred data bytes and the counted number of bytes with the slave device, and when the counted byte number matches the stored number of transferred bytes from the master device, the slave device determines that the data transfer is completed, The data line is set to a predetermined binary level by the slave device and released.

【0012】具体的には、クロックラインを介してマス
タ装置から入力されるクロックをスレーブ装置でカウン
トすることにより、転送が行われたデータのバイト数を
カウントするようにした。
More specifically, the number of bytes of transferred data is counted by counting the clock input from the master device via the clock line by the slave device.

【0013】[0013]

【発明の実施の形態】次に、図面に示す実施の形態に基
づいて、本発明を詳細に説明する。図1は、本発明の実
施の形態におけるデータ転送システム装置の例を示した
概略の構成図である。図1において、データ転送システ
ム装置1は、マスタ装置2とスレーブ装置3との間でシ
リアルにデータ転送を行うものであり、マスタ装置2及
びスレーブ装置3は、データ転送を行うためのデータラ
イン4とクロック転送を行うクロックライン5とで構成
されたいわゆるI2Cバスで接続されている。データラ
イン4はプルアップ抵抗R1で、クロックライン5はプ
ルアップ抵抗R2でそれぞれ電源ラインVddにプルアッ
プされている。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, the present invention will be described in detail based on an embodiment shown in the drawings. FIG. 1 is a schematic configuration diagram showing an example of a data transfer system device according to an embodiment of the present invention. In FIG. 1, a data transfer system device 1 performs serial data transfer between a master device 2 and a slave device 3, and a master device 2 and a slave device 3 are connected to a data line 4 for performing data transfer. are connected by a so-called I 2 C bus is composed of a clock line 5 for clock transfer with. The data line 4 is pulled up to a power supply line Vdd by a pull-up resistor R1, and the clock line 5 is pulled up to a power supply line Vdd by a pull-up resistor R2.

【0014】スレーブ装置3は、データライン4及びク
ロックライン5を介してマスタ装置2とのインタフェー
スを行うインタフェース部11と、インタフェース部1
1の動作制御を行う制御信号生成部12とを備えてい
る。更に、スレーブ装置3は、マスタ装置2との間でデ
ータラインを介して転送を行ったデータのバイト数をカ
ウントしてデータ転送が終了したか否かを判定するデー
タ転送終了判定部13と、マスタ装置2から転送されて
くるデータを基にしてインタフェース部11、制御信号
生成部12及びデータ転送終了判定部13の動作制御を
行うデータ処理部14とを備えている。なお、図1で
は、スレーブ装置3におけるデータの格納を行うデータ
格納部は省略している。
The slave device 3 includes an interface unit 11 for interfacing with the master device 2 via the data line 4 and the clock line 5, and an interface unit 1
1 and a control signal generation unit 12 for performing the operation control of the first control signal. Further, the slave device 3 counts the number of bytes of data transferred to the master device 2 via the data line and determines whether or not the data transfer has ended, and a data transfer end determining unit 13; The data processing unit 14 controls the operation of the interface unit 11, the control signal generation unit 12, and the data transfer end determination unit 13 based on data transferred from the master device 2. In FIG. 1, a data storage unit for storing data in the slave device 3 is omitted.

【0015】インタフェース部11は、データライン4
を介してマスタ装置2とのインタフェースを行うデータ
インタフェース回路16と、クロックライン5を介して
マスタ装置2とのインタフェースを行うクロックインタ
フェース回路17とで構成され、データインタフェース
回路16及びクロックインタフェース回路17は、I 2
Cインタフェース回路をなしている。データインタフェ
ース回路16は、バッファ21とNチャネル形MOSト
ランジスタ(以下、NMOSトランジスタと呼ぶ)22
とで構成され、同様にクロックインタフェース回路17
は、バッファ23とNMOSトランジスタ24とで構成
されている。
The interface unit 11 includes a data line 4
For interfacing with master device 2 via
Via the interface circuit 16 and the clock line 5
Clock interface for interfacing with master device 2
And a data interface.
The circuit 16 and the clock interface circuit 17 Two
It has a C interface circuit. Data interface
The source circuit 16 includes a buffer 21 and an N-channel MOS transistor.
Transistor (hereinafter referred to as NMOS transistor) 22
And the clock interface circuit 17
Consists of a buffer 23 and an NMOS transistor 24
Have been.

【0016】データライン4は、データインタフェース
回路16のバッファ21を介してデータ転送終了判定部
13及びデータ処理部14にそれぞれ接続され、クロッ
クライン5は、クロックインタフェース回路17のバッ
ファ23を介して制御信号生成部12、データ転送終了
判定部13及びデータ処理部14にそれぞれ接続されて
いる。データインタフェース回路16のNMOSトラン
ジスタ22は、ドレインとソースがデータライン4と接
地との間に接続されると共にゲートが制御信号生成部1
2に接続され、制御信号生成部12によって動作制御さ
れる。また、クロックインタフェース回路17のNMO
Sトランジスタ24は、ドレインとソースがクロックラ
イン5と接地との間に接続されると共にゲートがデータ
処理部14に接続され、データ処理部14によって動作
制御される。
The data line 4 is connected to the data transfer end determination unit 13 and the data processing unit 14 via a buffer 21 of the data interface circuit 16, and the clock line 5 is controlled via a buffer 23 of the clock interface circuit 17. The signal generation unit 12, the data transfer end determination unit 13, and the data processing unit 14 are connected to each other. The NMOS transistor 22 of the data interface circuit 16 has a drain and a source connected between the data line 4 and the ground, and a gate connected to the control signal generator 1.
2 and the operation is controlled by the control signal generator 12. The NMO of the clock interface circuit 17
The drain and source of the S transistor 24 are connected between the clock line 5 and the ground, and the gate is connected to the data processing unit 14. The operation of the S transistor 24 is controlled by the data processing unit 14.

【0017】更に、データ処理部14は、データライン
4から入力されるデータ及びクロックライン5から入力
されるクロックを基にして制御信号生成部12及びデー
タ転送終了判定部13の動作制御を行う。また、データ
転送終了判定部13は、データ転送が終了したか否かの
判定結果を制御信号生成部12に出力する。
Further, the data processing unit 14 controls the operation of the control signal generation unit 12 and the data transfer end determination unit 13 based on the data input from the data line 4 and the clock input from the clock line 5. Further, the data transfer end determination unit 13 outputs a result of the determination as to whether the data transfer has been completed to the control signal generation unit 12.

【0018】なお、クロックライン5を介して転送され
るクロックは、通常マスタ装置2からスレーブ装置3に
転送され、スレーブ装置3からマスタ装置2に転送され
ることはない。このことから、クロックインタフェース
回路17におけるNMOSトランジスタ24のゲートに
はLowレベルの信号がデータ処理部14から入力され
ており、NMOSトランジスタ24はオフしている。た
だし、マスタ装置2から入力されるクロック信号の調整
を行うために、データ処理部14は、NMOSトランジ
スタ24をオンさせることがある。マスタ装置2からク
ロックライン5に出力されたクロック信号は、バッファ
23を介して制御信号生成部12、データ転送終了判定
部13及びデータ処理部14にそれぞれ入力される。
The clock transferred via the clock line 5 is normally transferred from the master device 2 to the slave device 3 and is not transferred from the slave device 3 to the master device 2. Therefore, a low-level signal is input from the data processing unit 14 to the gate of the NMOS transistor 24 in the clock interface circuit 17, and the NMOS transistor 24 is off. However, the data processing unit 14 may turn on the NMOS transistor 24 to adjust the clock signal input from the master device 2. The clock signal output from the master device 2 to the clock line 5 is input to the control signal generation unit 12, the data transfer end determination unit 13, and the data processing unit 14 via the buffer 23.

【0019】マスタ装置2からスレーブ装置3にデータ
転送する場合、データ処理部14は、制御信号生成部1
2に対してデータインタフェース回路16のNMOSト
ランジスタ22をオフさせ、マスタ装置2からデータラ
イン4に出力されたデータは、バッファ21を介してデ
ータ処理部14に入力される。また、スレーブ装置3か
らマスタ装置2にデータ転送する場合、データ処理部1
4は、制御信号生成部12にリードデータを出力し、制
御信号生成部12は、該入力されたリードデータに応じ
てNMOSトランジスタ22をスイッチングさせデータ
ライン4の電位レベルを変化させる。このようにしてス
レーブ装置3からマスタ装置2にデータ転送が行われ
る。
When data is transferred from the master device 2 to the slave device 3, the data processing unit 14
2, the NMOS transistor 22 of the data interface circuit 16 is turned off, and the data output from the master device 2 to the data line 4 is input to the data processing unit 14 via the buffer 21. When data is transferred from the slave device 3 to the master device 2, the data processing unit 1
4 outputs read data to the control signal generator 12, and the control signal generator 12 switches the NMOS transistor 22 according to the input read data to change the potential level of the data line 4. Thus, data transfer is performed from the slave device 3 to the master device 2.

【0020】図2は、マスタ装置2とスレーブ装置3と
の間で行われるデータ転送の例を示した波形図であり、
図2を用いてマスタ装置2とスレーブ装置3との間で行
われるデータ転送について説明する。なお、図2では、
データライン4を介して転送されるデータ信号をSD
A、クロックライン5を介して転送されるクロック信号
SCLとしている。
FIG. 2 is a waveform diagram showing an example of data transfer performed between the master device 2 and the slave device 3.
The data transfer performed between the master device 2 and the slave device 3 will be described with reference to FIG. In FIG. 2,
The data signal transferred via the data line 4 is SD
A, a clock signal SCL transferred via the clock line 5.

【0021】マスタ装置2とスレーブ装置3との間でデ
ータ転送が行われる場合、まず最初に、マスタ装置2
は、クロック信号SCLをHighレベルにすると共に
データ信号SDAを立ち下げてデータ転送を開始するこ
とを示す「開始」条件(以下、スタートコンディション
と呼ぶ)をスレーブ装置3に出力する。また、マスタ装
置2は、データ転送が終了すると、クロック信号SCL
をHighレベルにすると共にデータ信号SDAを立ち
上げてデータ転送を終了することを示す「終了」条件
(以下、ストップコンディションと呼ぶ)をスレーブ装
置3に出力する。
When data is transferred between the master device 2 and the slave device 3, first, the master device 2
Outputs a “start” condition (hereinafter referred to as a start condition) indicating that the clock signal SCL is set to the high level and the data signal SDA is started to start data transfer. When the data transfer is completed, master device 2 transmits clock signal SCL.
To a high level, and also raises the data signal SDA to output an “end” condition (hereinafter referred to as a stop condition) indicating that the data transfer is ended to the slave device 3.

【0022】このように、マスタ装置2は、スタートコ
ンディション及びストップコンディションをスレーブ装
置3に示す場合、必ずクロック信号SCLをHighレ
ベルにする。このことから、マスタ装置2及びスレーブ
装置3は、クロック信号SCLがLowレベルのときに
データ信号SDAの信号レベルを変化させるようにして
データ転送を行う。
As described above, when the master device 2 indicates the start condition and the stop condition to the slave device 3, the master device 2 always sets the clock signal SCL to the high level. Accordingly, the master device 2 and the slave device 3 perform data transfer by changing the signal level of the data signal SDA when the clock signal SCL is at the low level.

【0023】マスタ装置2は、ストップコンディション
をスレーブ装置3に出力した後、スレーブ装置3から読
み出したいデータが格納されている場所、又はスレーブ
装置3にデータの格納を行いたい場所を示す7ビットの
アドレスデータを出力する。続いて、マスタ装置2は、
スレーブ装置3に対してデータの書き込みを行うのか又
はデータの読み出しを行うのかを示す、すなわちデータ
の転送方向を示す1ビットのデータR/W#をデータラ
イン4に出力する。このようにして、合計1バイトのデ
ータを、データライン4を介してスレーブ装置3に出力
する。なお、マスタ装置2は、スレーブ装置3にデータ
を書き込む場合はLowレベル、すなわち「0」のデー
タR/W#を、スレーブ装置3からデータを読み出す場
合はHighレベル、すなわち「1」のデータR/W#
を出力する。
After the master device 2 outputs the stop condition to the slave device 3, the master device 2 stores a 7-bit data indicating a location where data to be read from the slave device 3 is stored or a location where data is to be stored in the slave device 3. Output address data. Subsequently, the master device 2
1-bit data R / W #, which indicates whether data is to be written to or read from the slave device 3, that is, indicates the data transfer direction, is output to the data line 4. In this way, a total of one byte of data is output to the slave device 3 via the data line 4. When writing data to the slave device 3, the master device 2 outputs data R / W # of low level, that is, “0”, and when reading data from the slave device 3, high level, that is, data R / W # of “1”. / W #
Is output.

【0024】データ処理部14は、マスタ装置2から1
バイトのデータが入力されると、制御信号生成部12に
対して、NMOSトランジスタ22のゲートにHigh
レベルの信号を出力させLowレベルの確認応答ACK
をマスタ装置2に出力する。データ処理部14は、入力
されたデータR/W#がHighレベルの場合は、指定
されたアドレスに格納されているデータを制御信号生成
部12に出力し、制御信号生成部12からNMOSトラ
ンジスタ22を介してデータライン4に出力する。
The data processing unit 14 receives the
When the byte data is input, the control signal generating unit 12 outputs High to the gate of the NMOS transistor 22.
Outputs a low-level signal and sends a low-level acknowledgment ACK
Is output to the master device 2. When the input data R / W # is at the High level, the data processing unit 14 outputs the data stored at the specified address to the control signal generation unit 12, and the control signal generation unit 12 sends the data to the NMOS transistor 22. Is output to the data line 4 via.

【0025】一方、データ処理部14は、入力されたデ
ータR/W#がLowレベルの場合は、制御信号生成部
12に対してNMOSトランジスタ22をオフさせ、マ
スタ装置2から入力されたデータを指定されたアドレス
に格納する。スレーブ装置3からデータを読み出す場
合、マスタ装置2は、1バイトのデータが入力されるご
とにLowレベルの確認応答ACKを、データライン4
を介してスレーブ装置3に出力する。また、スレーブ装
置3にデータを書き込む場合、スレーブ装置3は、1バ
イトのデータが入力されるごとに制御信号生成部12に
対してNMOSトランジスタ22をオンさせ、Lowレ
ベルの確認応答ACKを、データライン4を介してマス
タ装置2に出力する。
On the other hand, when the input data R / W # is at the low level, the data processing unit 14 turns off the NMOS transistor 22 to the control signal generation unit 12 and transmits the data input from the master device 2. Store at the specified address. When reading data from the slave device 3, the master device 2 sends a low-level acknowledgment ACK every time 1-byte data is input to the data line 4.
To the slave device 3 via the. When writing data to the slave device 3, the slave device 3 turns on the NMOS transistor 22 for the control signal generation unit 12 every time 1-byte data is input, and sends a low-level acknowledgment ACK to the data. Output to master device 2 via line 4.

【0026】スレーブ装置3からデータを読み出す場
合、マスタ装置2は、要求したデータがスレーブ装置3
からすべて転送されると、データ転送が終了したことを
示すHighレベルの応答ACKをスレーブ装置3に出
力し、データ処理部14は、該応答ACKが入力された
ことによってデータ転送の終了を認識することができ、
制御信号生成部12に対してNMOSトランジスタ22
をオフさせる。逆に、スレーブ装置3にデータを書き込
む場合は、スレーブ装置3からマスタ装置2にデータ転
送が終了したことを示す応答が出力される。最後に、マ
スタ装置2は、スレーブ装置3に対してストップコンデ
ィションを出力してスレーブ装置3との通信が終了す
る。
When reading data from the slave device 3, the master device 2 transmits the requested data to the slave device 3.
When all the data is transferred from the slave device, a high-level response ACK indicating that the data transfer has been completed is output to the slave device 3, and the data processing unit 14 recognizes the end of the data transfer by receiving the response ACK. It is possible,
An NMOS transistor 22 for the control signal generation unit 12
Off. Conversely, when writing data to the slave device 3, a response indicating that the data transfer has been completed is output from the slave device 3 to the master device 2. Finally, the master device 2 outputs a stop condition to the slave device 3 and the communication with the slave device 3 ends.

【0027】このような構成において、マスタ装置2
は、スレーブ装置3とデータ転送を行う場合、転送デー
タのバイト数を示すデータをスレーブ装置3の所定のレ
ジスタ31に書き込ませる。次に、データ処理部14
は、データ読み出しを行うための1バイトデータがマス
タ装置2から入力されると、データ転送終了判定部13
に対して、データライン4を介してマスタ装置2に転送
するデータのバイト数をカウントさせる。データ転送終
了判定部13は、クロックライン5を介して入力される
クロック信号を基にして転送データ数のカウントを行
う。
In such a configuration, the master device 2
Causes the data indicating the number of bytes of the transfer data to be written into a predetermined register 31 of the slave device 3 when performing data transfer with the slave device 3. Next, the data processing unit 14
When 1-byte data for reading data is input from the master device 2, the data transfer end determination unit 13
, The number of bytes of data transferred to the master device 2 via the data line 4 is counted. The data transfer end determination unit 13 counts the number of transfer data based on a clock signal input via the clock line 5.

【0028】データ転送終了判定部13は、カウントし
た転送データ数とレジスタ31に格納された転送バイト
数とを比較し、一致すると制御信号生成部12に対して
所定の転送バイト一致フラグFをセットする。制御信号
生成部12は、該転送バイト一致フラグFがセットされ
るとNMOSトランジスタ22をオフさせてデータライ
ン4を解放する。一方、制御信号生成部12は、データ
転送終了判定部13から転送バイト一致フラグFがセッ
トされていない場合、データ処理部14から入力される
リードデータに応じてNMOSトランジスタの制御信号
を生成して出力する。
The data transfer end determining unit 13 compares the counted number of transfer data with the number of transfer bytes stored in the register 31, and sets a predetermined transfer byte match flag F to the control signal generator 12 when they match. I do. When the transfer byte match flag F is set, the control signal generator 12 turns off the NMOS transistor 22 and releases the data line 4. On the other hand, when the transfer byte match flag F is not set from the data transfer end determination unit 13, the control signal generation unit 12 generates a control signal for the NMOS transistor according to the read data input from the data processing unit 14. Output.

【0029】図3は、スレーブ装置3からマスタ装置2
にデータ転送する場合の動作例を示したフローチャート
であり、図3を用いて、スレーブ装置3からマスタ装置
2にデータ転送する場合における各部の動作の流れにつ
いて説明する。図3において、マスタ装置2は、スレー
ブ装置3のデータ処理部14にデバイスIDの書き込み
を行い(ステップS1)、データ処理部14は、書き込
まれたデバイスIDがあらかじめ設定されたIDと一致
するか否かを調べ(ステップS2)、一致しなかった場
合(NO)は、ステップS1に戻る。
FIG. 3 shows that the slave device 3 and the master device 2
FIG. 4 is a flowchart showing an operation example when data is transferred to the master device 2 with reference to FIG. 3, and a flow of operations of each unit when data is transferred from the slave device 3 to the master device 2 will be described. In FIG. 3, the master device 2 writes a device ID in the data processing unit 14 of the slave device 3 (step S1), and the data processing unit 14 checks whether the written device ID matches a preset ID. It is checked (step S2) whether or not they match (NO), and the process returns to step S1.

【0030】また、ステップS2で、一致した場合(Y
ES)、マスタ装置2は、スレーブ装置3に対してデー
タ処理部14のレジスタ31に転送バイト数を書き込ま
せる(ステップS3)。次に、データ処理部14は、デ
ータライン4を介してマスタ装置2に指定されたデータ
の転送を行うと共に、データ転送終了判定部13に対し
て、転送バイト数のカウントを行わせる(ステップS
4)。データ転送終了判定部13は、カウントしたバイ
ト数とレジスタ31に格納されている転送バイト数とを
比較し、一致したか否かを調べ(ステップS5)、一致
しなかった場合(NO)は、ステップS4に戻り、一致
した場合(YES)は、制御信号生成部12に対して転
送バイト一致フラグFをセットする(ステップS6)。
In step S2, if they match (Y
ES), the master device 2 causes the slave device 3 to write the number of transfer bytes to the register 31 of the data processing unit 14 (step S3). Next, the data processing unit 14 transfers the designated data to the master device 2 via the data line 4 and causes the data transfer end determination unit 13 to count the number of transfer bytes (Step S).
4). The data transfer end determination unit 13 compares the counted number of bytes with the number of transfer bytes stored in the register 31 to check whether they match (step S5). If they do not match (NO), Returning to step S4, if they match (YES), the transfer byte match flag F is set in the control signal generator 12 (step S6).

【0031】制御信号生成部12は、転送バイト一致フ
ラグFがセットされると、NMOSトランジスタ22を
オフさせてデータライン4を解放させ(ステップS
7)、この後、マスタ装置2は、ストップコンディショ
ンをスレーブ装置3に出力して(ステップS8)マスタ
装置2とスレーブ装置3との間で行われるデータ転送が
終了する。
When the transfer byte match flag F is set, the control signal generator 12 turns off the NMOS transistor 22 to release the data line 4 (step S).
7) After that, the master device 2 outputs a stop condition to the slave device 3 (step S8), and the data transfer performed between the master device 2 and the slave device 3 ends.

【0032】このように、本実施の形態におけるデータ
転送システム装置は、データライン4を介してスレーブ
装置3からマスタ装置2にデータを転送する際、データ
転送終了判定部13で転送データのバイト数をカウント
してデータ転送が終了したか否かの判断を行うと共に、
データ転送が終了したと判断した場合はデータライン4
を解放するようにした。このことから、マスタ装置から
データ転送終了の応答が得られない場合でもスレーブ装
置側でデータ転送の終了を判定でき、マスタ装置とスレ
ーブ装置とを接続するバスのコンフリクトを回避させる
ことができる。
As described above, when data is transferred from the slave device 3 to the master device 2 via the data line 4 in the data transfer system device according to the present embodiment, the data transfer end determination unit 13 determines the number of bytes of the transfer data. To determine whether the data transfer has been completed,
If it is determined that the data transfer has been completed,
Was released. Thus, even when a response to the end of the data transfer cannot be obtained from the master device, the end of the data transfer can be determined on the slave device side, and a conflict of a bus connecting the master device and the slave device can be avoided.

【0033】なお、上記実施の形態では、スレーブ装置
からマスタ装置にデータ転送する場合を例にして主に説
明したが、本発明はこれに限定するものではなく、マス
タ装置からスレーブ装置にデータ転送する場合において
も適用できることは言うまでもない。
In the above embodiment, the case where data is transferred from the slave device to the master device has mainly been described as an example. However, the present invention is not limited to this, and data transfer from the master device to the slave device is performed. Needless to say, the present invention can be applied to such a case.

【0034】[0034]

【発明の効果】上記の説明から明らかなように、本発明
のデータ転送システム装置によれば、データラインを介
してマスタ装置とスレーブ装置との間でデータ転送を行
う際、データ転送終了判定部で転送データのバイト数を
カウントしてデータ転送が終了したか否かの判断を行う
と共に、データ転送終了判定部でデータ転送が終了した
と判断した場合はデータライン解放部でデータラインを
解放するようにした。このことから、マスタ装置からデ
ータ転送終了の応答が得られない場合でもスレーブ装置
側でデータ転送の終了を判定してデータラインを解放す
ることができ、マスタ装置とスレーブ装置とを接続する
バスのコンフリクトを回避させることができる。
As is apparent from the above description, according to the data transfer system of the present invention, when data transfer is performed between the master device and the slave device via the data line, the data transfer end determination unit is provided. The number of bytes of the transfer data is counted to determine whether or not the data transfer is completed. If the data transfer end determination unit determines that the data transfer is completed, the data line release unit releases the data line. I did it. From this, even when a response of the data transfer end is not obtained from the master device, the slave device side can determine the end of the data transfer and release the data line, and the bus connecting the master device and the slave device can be used. Conflicts can be avoided.

【0035】具体的には、上記データ転送終了判定部
は、クロックラインを介してマスタ装置から入力される
クロックをカウントすることによって、転送が行われた
データのバイト数をカウントするようにしたことから、
マスタ装置との間で転送が行われたデータのバイト数を
容易にカウントすることができる。
Specifically, the data transfer end determination unit counts the number of bytes of the transferred data by counting the clock input from the master device via the clock line. From
The number of bytes of data transferred to and from the master device can be easily counted.

【0036】また、本発明のデータ転送システム装置に
おけるデータ転送方法によれば、データラインを介して
マスタ装置とスレーブ装置との間でデータ転送を行う
際、スレーブ装置によって、転送データのバイト数をカ
ウントしてデータ転送が終了したか否かの判断を行うと
共に、データ転送が終了したと判断した場合はデータラ
インを解放するようにした。このことから、マスタ装置
からデータ転送終了の応答が得られない場合でもスレー
ブ装置側でデータ転送の終了を判定してデータラインを
解放することができ、マスタ装置とスレーブ装置とを接
続するバスのコンフリクトを回避させることができる。
Further, according to the data transfer method in the data transfer system device of the present invention, when data is transferred between the master device and the slave device via the data line, the number of bytes of the transfer data is determined by the slave device. It is determined whether or not the data transfer is completed by counting, and when it is determined that the data transfer is completed, the data line is released. From this, even when a response of the data transfer end is not obtained from the master device, the slave device side can determine the end of the data transfer and release the data line, and the bus connecting the master device and the slave device can be used. Conflicts can be avoided.

【0037】具体的には、クロックラインを介してマス
タ装置から入力されるクロックをカウントすることによ
って、転送が行われたデータのバイト数をカウントする
ようにしたことから、マスタ装置との間で転送が行われ
たデータのバイト数を容易にカウントすることができ
る。
More specifically, since the number of bytes of transferred data is counted by counting the clock input from the master device via the clock line, the number of bytes of the transferred data is counted. The number of bytes of transferred data can be easily counted.

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

【図1】 本発明の実施の形態におけるデータ転送シス
テム装置の例を示した概略の構成図である。
FIG. 1 is a schematic configuration diagram illustrating an example of a data transfer system device according to an embodiment of the present invention.

【図2】 図1のマスタ装置2とスレーブ装置3との間
で行われるデータ転送の例を示した波形図である。
FIG. 2 is a waveform diagram showing an example of data transfer performed between a master device 2 and a slave device 3 in FIG.

【図3】 図1におけるスレーブ装置3からマスタ装置
2にデータ転送する場合の動作例を示したフローチャー
トである。
FIG. 3 is a flowchart showing an operation example when data is transferred from a slave device 3 to a master device 2 in FIG.

【図4】 従来のデータ転送システム装置の例を示した
概略の構成図である。
FIG. 4 is a schematic configuration diagram showing an example of a conventional data transfer system device.

【図5】 図4のスレーブ装置102からマスタ装置1
01にデータ転送する場合のデータ転送フォーマット例
を示した図である。
FIG. 5 is a diagram showing a slave device 102 to a master device 1 shown in FIG. 4;
FIG. 11 is a diagram showing an example of a data transfer format when data is transferred to 01.

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

1 データ転送システム装置 2 マスタ装置 3 スレーブ装置 4 データライン 5 クロックライン 11 インタフェース部 12 制御信号生成部 13 データ転送終了判定部 14 データ処理部 16 データインタフェース回路 17 クロックインタフェース回路 31 レジスタ REFERENCE SIGNS LIST 1 data transfer system device 2 master device 3 slave device 4 data line 5 clock line 11 interface unit 12 control signal generation unit 13 data transfer end determination unit 14 data processing unit 16 data interface circuit 17 clock interface circuit 31 register

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 データ転送を行うためのデータライン及
びクロック転送を行うためのクロックラインで接続され
たマスタ装置とスレーブ装置との間でシリアルデータ転
送を行うデータ転送システム装置において、 上記スレーブ装置は、 上記マスタ装置から入力されるデータ転送時における転
送データバイト数を格納する転送バイト数格納部と、 上記マスタ装置との間で転送を行ったデータのバイト数
をカウントし、該カウントしたバイト数と転送バイト数
格納部に格納された転送バイト数とを比較してデータ転
送の終了判定を行うデータ転送終了判定部と、 該データ転送終了判定部によってデータ転送が終了した
と判定されると、上記データラインを所定の2値のレベ
ルにして解放するデータライン解放部と、を備え、 上記データ転送終了判定部は、カウントしたバイト数と
転送バイト数格納部に格納された転送バイト数が一致す
ると、データ転送が終了したと判定することを特徴とす
るデータ転送システム装置。
1. A data transfer system device for performing serial data transfer between a master device and a slave device connected by a data line for performing data transfer and a clock line for performing clock transfer, wherein the slave device is A transfer byte number storage unit for storing the number of transfer data bytes at the time of data transfer input from the master device; and counting the number of bytes of data transferred between the master device and the counted byte number. And a data transfer end determining unit that determines the end of data transfer by comparing the transfer byte number stored in the transfer byte number storage unit with the transfer byte number. A data line release unit for releasing the data line to a predetermined binary level, and ending the data transfer. Tough, when the number of transfer bytes stored number of bytes counted and the transfer byte number storage unit match, the data transfer system apparatus and determines that the data transfer is completed.
【請求項2】 上記データ転送終了判定部は、クロック
ラインを介してマスタ装置から入力されるクロックをカ
ウントすることによって、転送が行われたデータのバイ
ト数のカウントを行うことを特徴とする請求項1に記載
のデータ転送システム装置。
2. The data transfer end determination unit counts the number of bytes of transferred data by counting clocks input from a master device via a clock line. Item 2. The data transfer system device according to item 1.
【請求項3】 データ転送を行うためのデータライン及
びクロック転送を行うためのクロックラインで接続され
たマスタ装置とスレーブ装置との間でシリアルデータ転
送を行うデータ転送システム装置におけるデータ転送方
法において、 上記マスタ装置から出力されるデータ転送時の転送デー
タバイト数をスレーブ装置に格納し、 マスタ装置とスレーブ装置との間で転送が行われたデー
タのバイト数をスレーブ装置でカウントし、 上記スレーブ装置に格納された転送データバイト数と、
該カウントしたバイト数とをスレーブ装置で比較し、 カウントしたバイト数と格納したマスタ装置からの転送
バイト数が一致するとデータ転送が終了したとスレーブ
装置で判定し、 上記データラインをスレーブ装置で所定の2値のレベル
にして解放することを特徴とするデータ転送方法。
3. A data transfer method in a data transfer system device for performing serial data transfer between a master device and a slave device connected by a data line for performing data transfer and a clock line for performing clock transfer, The number of transferred data bytes at the time of data transfer output from the master device is stored in the slave device, and the number of bytes of data transferred between the master device and the slave device is counted by the slave device. The number of transfer data bytes stored in
The slave device compares the counted number of bytes with the slave device. If the counted number of bytes matches the stored number of bytes transferred from the master device, the slave device determines that data transfer has been completed. A data transfer method characterized in that the data is released after being set to a binary level.
【請求項4】 クロックラインを介してマスタ装置から
入力されるクロックをスレーブ装置でカウントすること
により、転送が行われたデータのバイト数をカウントす
ることを特徴とする請求項3に記載のデータ転送方法。
4. The data according to claim 3, wherein the number of bytes of the transferred data is counted by counting the clock input from the master device via the clock line by the slave device. Transfer method.
JP2000105097A 2000-04-06 2000-04-06 Data transfer system device and its data transferring method Pending JP2001290764A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000105097A JP2001290764A (en) 2000-04-06 2000-04-06 Data transfer system device and its data transferring method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000105097A JP2001290764A (en) 2000-04-06 2000-04-06 Data transfer system device and its data transferring method

Publications (1)

Publication Number Publication Date
JP2001290764A true JP2001290764A (en) 2001-10-19

Family

ID=18618523

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000105097A Pending JP2001290764A (en) 2000-04-06 2000-04-06 Data transfer system device and its data transferring method

Country Status (1)

Country Link
JP (1) JP2001290764A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006099410A (en) * 2004-09-29 2006-04-13 Mitsubishi Electric Corp Method for controlling i2c
US7133947B2 (en) 2003-09-05 2006-11-07 Alpine Electronics, Inc. Data communication system, data communication method, and communication unit
JP2008197752A (en) * 2007-02-08 2008-08-28 Sharp Corp Data communication malfunction preventing device, electronic equipment, control method for data communication malfunction preventing device, control program for data communication malfunction preventing device and recording medium with the program recorded
EP2194460A2 (en) 2008-12-04 2010-06-09 Sony Corporation Information-processing apparatus, information-processing method, and program
JP2016144158A (en) * 2015-02-04 2016-08-08 三洋電機株式会社 Communication method and equipment
WO2024048263A1 (en) * 2022-08-29 2024-03-07 ソニーセミコンダクタソリューションズ株式会社 Communication device, communication method, and program

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7133947B2 (en) 2003-09-05 2006-11-07 Alpine Electronics, Inc. Data communication system, data communication method, and communication unit
JP2006099410A (en) * 2004-09-29 2006-04-13 Mitsubishi Electric Corp Method for controlling i2c
JP2008197752A (en) * 2007-02-08 2008-08-28 Sharp Corp Data communication malfunction preventing device, electronic equipment, control method for data communication malfunction preventing device, control program for data communication malfunction preventing device and recording medium with the program recorded
EP2194460A2 (en) 2008-12-04 2010-06-09 Sony Corporation Information-processing apparatus, information-processing method, and program
US8918556B2 (en) 2008-12-04 2014-12-23 Sony Corporation Information-processing apparatus, information-processing method, and program
US9864723B2 (en) 2008-12-04 2018-01-09 Sony Corporation Information-processing apparatus, information-processing method, and program
JP2016144158A (en) * 2015-02-04 2016-08-08 三洋電機株式会社 Communication method and equipment
WO2024048263A1 (en) * 2022-08-29 2024-03-07 ソニーセミコンダクタソリューションズ株式会社 Communication device, communication method, and program

Similar Documents

Publication Publication Date Title
US7397717B2 (en) Serial peripheral interface memory device with an accelerated parallel mode
JP4773742B2 (en) 2-wire interface between chips
KR101507628B1 (en) System and method for data read of a synchronous serial interface nand
JP2008539497A (en) Device identification coding of slave devices between integrated circuits
TW200935234A (en) System and method for setting access and modification for synchronous serial interface NAND
US9063849B2 (en) Different types of memory integrated in one chip by using a novel protocol
US7231467B2 (en) Method and apparatus for providing an inter integrated circuit interface with an expanded address range and efficient priority-based data throughput
US7376020B2 (en) Memory using a single-node data, address and control bus
KR20010053365A (en) Improved inter-device serial bus protocol
JP2001290764A (en) Data transfer system device and its data transferring method
KR20080080799A (en) Method and device for memory of serial interface
EP1096745B1 (en) Serial data transfer method in synchronism with a clock signal
JP2008015876A (en) Data access system, data access device, data access integrated circuit and data accessing method
US6917994B2 (en) Device and method for automatically generating an appropriate number of wait cycles while reading a nonvolatile memory
JPH11502643A (en) Error recognition and elimination in serial data bus systems
CN210052151U (en) Double-chip program updating device
US5938746A (en) System for prioritizing slave input register to receive data transmission via bi-directional data line from master
US6334165B1 (en) Address type determination for an I2C EEPROM
KR101109600B1 (en) Method for transmitting data using direct memory access control and apparatus therefor
CN113722261A (en) Method for expanding chip selection number and enhancing flexibility of read-write response time by SPI
EP2141607A1 (en) Method for transferring or erasing data in a master-slave environment
EP0829095B1 (en) Method and apparatus for reducing latency time on an interface by overlapping transmitted packets
JP3900327B2 (en) Serial data transfer device
CN111581140B (en) Data transmission and processing method and slave device
US5764907A (en) Computer to microcomputer interface

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20040721

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070301

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070313

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20080205