JP2004246750A - Usb communication method - Google Patents

Usb communication method Download PDF

Info

Publication number
JP2004246750A
JP2004246750A JP2003037645A JP2003037645A JP2004246750A JP 2004246750 A JP2004246750 A JP 2004246750A JP 2003037645 A JP2003037645 A JP 2003037645A JP 2003037645 A JP2003037645 A JP 2003037645A JP 2004246750 A JP2004246750 A JP 2004246750A
Authority
JP
Japan
Prior art keywords
communication device
host
side communication
peripheral device
data packet
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
JP2003037645A
Other languages
Japanese (ja)
Inventor
Masabumi Yoshioka
正文 吉岡
Akinori Hirukawa
明則 蛭川
Satoshi Aikawa
聡 相河
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.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone Corp
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 Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP2003037645A priority Critical patent/JP2004246750A/en
Publication of JP2004246750A publication Critical patent/JP2004246750A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Transfer Systems (AREA)
  • Communication Control (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a USB communication method which enables normal communication even in the case where delay is large between a host PC and peripheral devices when communication is made in compliance with a USB standard. <P>SOLUTION: Communication between a host controller and a peripheral device is relayed using a host side communication device and a peripheral device side communication device, and the communication of the host controller is terminated at the host side communication device. A data packet from the peripheral device is held in a memory on the host side communication device. When the data packet corresponding to a request from the host controller is present in the memory, the host side communication device directly transmits a data packet read from the memory to the host controller. The host side communication device and peripheral device side communication device identify a data transmission direction for control. In a normal mode, the host side communication device returns a response to the host controller, and the peripheral device side communication device returns a response to the peripheral device. <P>COPYRIGHT: (C)2004,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、USB(Universal Serial Bus)規格に従って通信する場合に用いられるUSB通信方法に関する。
【0002】
【従来の技術】
従来より、USB規格に準じた通信インタフェースは、パーソナルコンピュータ(PC)や様々な周辺機器に広く採用されている。
USB規格の仕様については、USB仕様書として公開されている。USB規格では、最大で127台の周辺機器を接続することができる。
【0003】
また、この種の従来技術は特許文献1に開示されている。
【特許文献1】
特表2002−542527
【0004】
【発明が解決しようとする課題】
しかしながら、USB仕様書においては装置はホストPCから5メートル以内になければならないとされている。
【0005】
勿論、USBハブを用いればその距離を伸ばすことは可能であるが、その場合でも最大で30mまでしか伸ばすことはできない。このため、USBインタフェースを用いて通信する場合には、従来は周辺機器をホストPCから30m離れた場所では利用できなかった。
このような距離の制限はUSBの動作原理にある。すなわち、USBではバスの使用権は全てホストPCが持ち、ホストPCが各周辺機器に使用可能な帯域を割り振るように制御される。
【0006】
また、ホストPCが各周辺機器に帯域を割り振ってからホストPCがデータを受信するまでの時間が16bitタイム以内と短く、更にケーブル内の遅延として7.5bitタイムが割り当てられているので、周辺機器がバスの使用権を受け取ってから送信するまでには8.5bitタイム(12Mbpsで0.7μs)しか許されず余裕が小さい。
【0007】
このような仕様であるため、仕様を無視して多くの遅延が生ずるUSB機器を接続したとしても信号の衝突が生じることになり、実際には通信はできない。
本発明は、USB規格に従って通信する場合に、ホストPCと周辺機器との間の遅延が大きい場合であっても正常な通信が可能なUSB通信方法を提供することを目的とする。
【0008】
【課題を解決するための手段】
請求項1は、ホスト装置側に接続されたホストコントローラと、所定の周辺機器との間でUSBの規格に従って通信するためのUSB通信方法において、前記ホストコントローラに接続されたホスト側通信装置と、前記周辺機器に接続された周辺機器側通信装置とを用いて、前記ホストコントローラとホスト側通信装置との間、前記周辺機器と周辺機器側通信装置との間、前記ホスト側通信装置と周辺機器側通信装置との間でそれぞれ通信を行うと共に、前記ホストコントローラからのパケットをホスト側通信装置が受信した場合に、ホスト側通信装置が前記パケットから第1の伝送方向を識別する第1の手順と、前記第1の伝送方向が前記ホストコントローラに入力される方向でない場合には、次に続くデータパケットの有無をホスト側通信装置が識別する第2の手順と、前記第2の手順で続くデータパケットがある場合には、そのデータパケットを前記ホスト側通信装置がホストコントローラから受信する第3の手順と、前記ホスト側通信装置が受信した前記ホストコントローラからのパケットを前記周辺機器側通信装置に転送する第4の手順と、前記第1の伝送方向が前記ホストコントローラに入力される方向である場合には、前記ホスト側通信装置は該当するデータパケットが自身のメモリに保持されているか否かを識別し、保持されている場合には該当するデータパケットを前記ホストコントローラに転送する第5の手順と、前記ホスト側通信装置が周辺機器側通信装置からのデータパケットを受信してメモリに保存する第6の手順と、前記周辺機器側通信装置がホスト側通信装置からのパケットを受信した場合に、前記パケットから前記周辺機器側通信装置が第2の伝送方向を識別する第7の手順と、前記第2の伝送方向が前記ホストコントローラに入力される方向でない場合には、次に続くデータパケットの有無を前記周辺機器側通信装置が識別する第8の手順と、前記第8の手順で続くデータパケットがある場合には、そのデータパケットを前記周辺機器側通信装置が受信する第9の手順と、前記第2の伝送方向が前記ホストコントローラに入力される方向でない場合に、前記周辺機器側通信装置が受信したパケットを前記周辺機器に転送する第10の手順と、前記第2の伝送方向が前記ホストコントローラに入力される方向である場合に、前記周辺機器側通信装置が受信したパケットを前記周辺機器に転送する第11の手順と、前記第2の伝送方向が前記ホストコントローラに入力される方向である場合に、前記周辺機器からのパケットを前記周辺機器側通信装置が受信する第12の手順と、前記第12の手順でデータパケットを受信した場合には、前記周辺機器側通信装置が受信したデータパケットに宛先情報を付加して前記ホスト側通信装置に転送する第13の手順とを設けたことを特徴とする。
【0009】
請求項1においては、ホストコントローラ(ホストPC)に接続されたホスト側通信装置と、周辺機器に接続された周辺機器側通信装置とを用いて、前記ホストコントローラと周辺機器との間の通信を中継する。
また、周辺機器が送出したデータをホスト側通信装置のメモリに保持しておくため、ホスト側通信装置と周辺機器側通信装置との間の遅延時間が大きい場合であっても、ホストコントローラからの要求に対して短い時間で要求されたデータを送信することが可能になる。
【0010】
すなわち、ホスト側通信装置と周辺機器側通信装置との間の距離が大きい場合であっても、USB規格で規定された時間内にデータをホスト側通信装置に対して送信可能であり、正しく通信を行うことができる。
請求項2は、請求項1のUSB通信方法において、前記ホスト側通信装置と周辺機器側通信装置との間で無線回線を用いて通信を行うことを特徴とする。
【0011】
請求項2においては、ホスト側通信装置と周辺機器側通信装置とをケーブルで接続する必要が無くなるため、ホストコントローラ(ホストPC)や各周辺機器を配置する上での位置の自由度が高くなる。
請求項3は、請求項1のUSB通信方法において、前記ホスト側通信装置と周辺機器側通信装置との間で、少なくとも周辺機器の消費電力に関する情報を伝送することを特徴とする。
【0012】
請求項3においては、周辺機器の消費電力をホストコントローラ側で監視できるので、過負荷などの警告を出力することが可能になる。
請求項4は、請求項1のUSB通信方法において、前記ホスト側通信装置と周辺機器側通信装置との間で、少なくともUSBインタフェースに対する周辺機器の脱着に関する情報を伝送することを特徴とする。
【0013】
請求項4においては、周辺機器の脱着をホストコントローラ側で監視できるので、周辺機器の脱着に関する警告を出力することが可能になる。
請求項5は、請求項1のUSB通信方法において、前記ホスト側通信装置と周辺機器側通信装置との間で通信を行う際に、再送を含む誤り補償制御を行うことを特徴とする。
【0014】
ホストコントローラの通信をホスト側通信装置で終端し、周辺機器の通信を周辺機器側通信装置で終端する場合には、ホスト側通信装置と周辺機器側通信装置との間でデータが消失した場合に送信元と宛先との間でデータの不一致が生じる。例えば、ホストコントローラが周辺機器宛に送信したデータがホスト側通信装置と周辺機器側通信装置との間で消失すると、ホストコントローラは送信を完了したと見なすが、そのデータは周辺機器に届かない。
【0015】
請求項5においては、ホスト側通信装置と周辺機器側通信装置との間で通信を行う際に再送を含む誤り補償制御を行うので、ホスト側通信装置と周辺機器側通信装置との間でデータが消失するのを防止することができ、送信元と宛先との間でデータの不一致の発生を防止できる。
請求項6は、請求項1のUSB通信方法において、前記第3の手順でホストコントローラからのデータパケットを受信した場合に、前記ホスト側通信装置がホストコントローラに対して受信確認の応答を返す第14の手順と、前記第5の手順で前記ホスト側通信装置がデータパケットを前記ホストコントローラに送信した後で、前記ホストコントローラから受信確認の応答を受け取った場合には、送信したデータパケットをメモリから削除する第15の手順と、前記第1の伝送方向が前記ホストコントローラに入力される方向である場合に、前記ホスト側通信装置のメモリに該当するデータパケットが存在しない場合には、前記ホスト側通信装置が前記ホストコントローラに対して存在しないことを表す応答を送信する第16の手順と、前記第12の手順で周辺機器側通信装置が周辺機器からのデータパケットを受信した場合には、周辺機器側通信装置が周辺機器に対して受信確認の応答を返す第17の手順とを更に設けたことを特徴とする。
【0016】
請求項6においては、ハンドシェイクパケット(ACKパケット,NAKパケット,STALLパケット)やフレームパケットについてホスト側通信装置及び周辺機器側通信装置が終端することができるので、ホストコントローラとホスト側通信装置との間、並びに周辺機器側通信装置と周辺機器との間の帯域を有効活用することが可能になる。
【0017】
請求項7は、請求項6のUSB通信方法において、前記ホスト側通信装置及び周辺機器側通信装置は、通信モードがアイソクロナス転送か否かを識別し、その結果に応じて制御の内容を変更することを特徴とする。
USB通信のアイソクロナス転送においては、ACKパケットなどの応答確認を行わない。請求項7では、通信モードがアイソクロナス転送か否かを識別して制御を行うので、アイソクロナス転送にも対応できる。
【0018】
【発明の実施の形態】
本発明のUSB通信方法の1つの実施の形態について図1〜図10を参照して説明する。この形態は全ての請求項に対応する。
図1はホスト側通信装置の動作(1)を示すフローチャートである。図2は周辺機器側通信装置の動作(1)を示すフローチャートである。図3はホスト側通信装置の動作(2)を示すフローチャートである。図4は周辺機器側通信装置の動作(2)を示すフローチャートである。図5は通信システムの主要部の構成例を示すブロック図である。
【0019】
図6は下り方向の通信動作を示すシーケンス図である。図7は上り方向の通信動作を示すシーケンス図である。図8は通信システムの主要部の構成例を示すブロック図である。図9はアイソクロナス転送モードの下り方向の通信動作を示すシーケンス図である。図10はアイソクロナス転送モードの上り方向の通信動作を示すシーケンス図である。
【0020】
この形態では、請求項1における第1の手順,第2の手順,第3の手順,第4の手順,第5の手順,第6の手順,第7の手順,第8の手順,第9の手順,第10の手順,第11の手順,第12の手順及び第13の手順は、それぞれステップS11,S12,S13,S15,S17,S42,S22,S23,S24,S25,S27,S28及びS32に相当する。
【0021】
また、請求項6における第14の手順,第15の手順,第16の手順及び第17の手順は、それぞれステップS14,S18,S19及びS30に相当する。この形態においては、図5又は図8に示すような通信システムに本発明を適用する場合を想定している。
図5において、例えばパーソナルコンピュータ上に配置されるホストコントローラ10にはUSBインタフェース11が設けられ、周辺機器40にもUSBインタフェース41が設けられている。
【0022】
一般的な接続形態では、ホストコントローラ10のUSBインタフェース11と周辺機器40のUSBインタフェース41とを1つのUSBケーブルで直接接続することになるが、図5の例ではホストコントローラ10と周辺機器40との間にホスト側通信装置20及び周辺機器側通信装置30を介在するように接続してある。
【0023】
すなわち、ホストコントローラ10のUSBインタフェース11はUSBケーブル51を介してホスト側通信装置20と接続され、周辺機器40のUSBインタフェース41はUSBケーブル52を介して周辺機器側通信装置30と接続され、ホスト側通信装置20と周辺機器側通信装置30との間は有線の通信回線53で接続されている。
【0024】
ホスト側通信装置20にはUSBインタフェース21,通信制御部22,通信インタフェース23,誤り補償制御部24及び記憶部25が設けてあり、周辺機器側通信装置30には通信インタフェース31,通信制御部32,USBインタフェース33及び誤り補償制御部34が設けてある。
【0025】
USBインタフェース11,21,31及び41は、いずれもUSB規格の仕様に従って動作する通信インタフェースである。
なお、ホスト側通信装置20と周辺機器側通信装置30との間の接続は有線に限らない。すなわち、図8に示すように無線通信インタフェース61,62を設ければホスト側通信装置20と周辺機器側通信装置30とを無線回線で接続することができる。
【0026】
図5及び図8に示す通信システムにおいては、ホスト側通信装置20及び周辺機器側通信装置30がホストコントローラ10と周辺機器40との間の通信を中継することにより、本発明特有の動作が実現する。
ホスト側通信装置20に設けられた誤り補償制御部24及び周辺機器側通信装置30に設けられた誤り補償制御部34は、ホスト側通信装置20と周辺機器側通信装置30との間で通信する際に、再送制御を含む誤り補償制御を行う。この誤り補償制御により、ホストコントローラ10と周辺機器40との間でデータの不一致が生じるのを防止する。
【0027】
また、周辺機器側通信装置30は周辺機器40における電力消費量の大きさや、周辺機器40がUSBインタフェース33と実際に接続されているか否かを表す脱着情報を検出し、それらの情報をホスト側通信装置20を介してホストコントローラ10に送信する。
ホスト側通信装置20の動作の主要部は図1及び図3に示されたとおりであり、周辺機器側通信装置30の動作の主要部は図2及び図4に示されたとおりである。また、図1に示す内容はホスト側通信装置20がホストコントローラ10からの情報を受け取った場合の動作であり、図3に示す内容はホスト側通信装置20が周辺機器側通信装置30からの情報を受け取った場合の動作である。
【0028】
また、図2に示す内容は周辺機器側通信装置30がホスト側通信装置20側からの情報を受け取った場合の動作であり、図4に示す内容は周辺機器側通信装置30が定期的に行う動作である。
実際のホスト側通信装置20及び周辺機器側通信装置30の動作について説明する前に、一般的なUSB規格の通信動作について以下に説明する。
【0029】
情報は基本的にトークンパケット,データパケット,ハンドシェイクパケットの順に送信される。
トークンパケットは、どのようなデータをどの方向に流すかなどを指示するためのパケットである。トークンパケット内のPID(4ビットの識別子)により、セットアップ,IN,OUT,SOF,データ,NAK,ACK,STALLなどが区別される。
【0030】
データパケットは伝送するデータ本体を表す。ハンドシェイクパケットは、前に送られたであろうパケットが受信されたか否かの通知に利用されるパケットであり、ACKパケット,NAKパケット及びSTALLパケットの3種類がある。
これらのパケットは連続的に送信される。連続するパケットは同方向でない場合が多い。また、基本的にACKは前パケットと逆方向に流れる。更に、データパケットは存在しない場合もある。
【0031】
データの伝送方向を表す「IN」は、ホストコントローラに入力される方向を表し、「OUT」はホストコントローラから周辺機器に向かう方向を表している。
また、SOFは1msec毎にホストコントローラから送信されるパケットである。エンドポイント(Endpoint)は、トークンパケット内に記載されている値であり、パケットの引き渡し先の周辺機器のアプリケーションを特定するために利用される。
【0032】
次に、図1に示すホスト側通信装置20の動作について説明する。
ホストコントローラ10とホスト側通信装置20との間で通信を開始すると、ステップS10でホストコントローラ10からのトークンパケットをホスト側通信装置20が受信する。
【0033】
この場合、ホスト側通信装置20は受信したトークンパケットを調べてホストコントローラ10がINパケットの送信要求(周辺機器に対して)を行っているか否かを識別する。すなわち、INパケットフラグの有無をステップS11で調べる。INパケットの場合にはステップS16に進み、それ以外、すなわちセットアップパケットやOUTパケットの場合にはステップS12に進む。
【0034】
ステップS12では、続くデータパケットがホストコントローラ10から到着するか否かを識別する。そして、ホストコントローラ10からのデータパケットが到着した場合にはそれをホスト側通信装置20が受信する。
続くステップS14では、受信したパケットに対する応答としてホスト側通信装置20はACKをホストコントローラ10に返信する。
【0035】
次のステップS15では、ホストコントローラ10から受信したトークンパケット及びデータパケット(もしあれば)をホスト側通信装置20が周辺機器側通信装置30に送信する。
受信したトークンパケットがINパケットの送信要求であった場合には、ステップS11からS16に進む。この場合、ホスト側通信装置20はトークンパケットに記述されているエンドポイント/PIDを参照し、該当するデータパケットが記憶部25のメモリに保存されているか否かを調べる。
【0036】
該当するデータパケットが記憶部25に保存されている(前に周辺機器40から受け取った結果)場合には、ステップS16からS17に進み、記憶部25に保持されているデータ(同じ送信元(周辺機器40)からのデータ)の中で最も古いデータパケットを取り出してホストコントローラ10に送信する。
ここで送信したデータパケットに対する応答としてホストコントローラ10のACKパケットをホスト側通信装置20が受信した場合には、ホスト側通信装置20はステップS18で該当するデータパケットを記憶部25のメモリから削除する。
【0037】
また、ステップS16で該当する要求されたデータパケットが記憶部25のメモリに存在しない場合には、ステップS19に進み、ホスト側通信装置20はNAKをホストコントローラ10に返信する。
一方、ホスト側通信装置20が周辺機器側通信装置30からの情報を受け取った場合には、図3に示す動作を実行する。
【0038】
すなわち、ステップS41でホスト側通信装置20は周辺機器側通信装置30からのデータパケットを受信する。
ステップS42では、受け取ったパケットに記載されたPID,エンドポイントを抽出し、このデータパケットをPID,エンドポイントに対応付けて記憶部25のメモリに蓄積する。
【0039】
これらの動作を繰り返し行う。
次に、図2に示す周辺機器側通信装置30の動作について説明する。
ホストコントローラ10から送信されホスト側通信装置20で中継されて送出されたトークンパケットは、周辺機器側通信装置30が図2のステップS21で受信する。
【0040】
周辺機器側通信装置30は、このトークンパケットを受信した後、次のステップS22でトークンパケットの内容を調べ、それがINパケットの送信要求であるか否か、すなわちINパケットフラグがあるか否かを識別する。
INパケットの送信要求でない場合には、ステップS22からS23に進み、続くデータパケットがホスト側通信装置20から到着するか否かを確認する。データパケットが到着した場合には、そのデータパケットを周辺機器側通信装置30がステップS24で受信する。
【0041】
その後、周辺機器側通信装置30はステップS21で受信したトークンパケットと受信したデータパケット(もしあれば)とをステップS25で周辺機器40に対して送信する。
また、ステップS25で送信したパケットに対する周辺機器40からの応答であるACKパケットを周辺機器側通信装置30が受信したか否かをステップS26で確認する。
【0042】
ACKパケットが到着しない場合には、ステップS26からS25に戻って同じパケットを再び送信する。ACKパケットが到着するとステップS21の処理に戻る。
一方、周辺機器側通信装置30が受信したホストコントローラ10からのトークンパケットがINパケットの送信要求であった場合には、ステップS22からS27に進む。
【0043】
ステップS27では、周辺機器側通信装置30はステップS21で受信したトークンパケットを周辺機器40に対して送信する。
また、ステップS27で送信したパケットに対する応答として周辺機器40から送信されるパケットを周辺機器側通信装置30はステップS28で受信する。ステップS29では、ステップS28で受信したパケットがデータパケットであるか否かを識別する。そして、データパケットである場合にはステップS30に進む。
【0044】
ステップS30では、周辺機器40からのデータパケットに対する応答として、周辺機器側通信装置30はACKを周辺機器40へ送信する。
ステップS31では、周辺機器側通信装置30はホストコントローラ10からのトークンパケットに記載された宛先のPID,エンドポイントをステップS28で周辺機器40から受信したデータパケットに付加する。
【0045】
そして、このデータパケットを周辺機器側通信装置30は次のステップS32でホスト側通信装置20に送信する。
ステップS28でデータパケット以外のパケット(ACK,NAK,STALL)を受信した場合には、ステップS29からS21に戻る。
周辺機器側通信装置30は、これらの動作を繰り返し行う。
【0046】
また、周辺機器側通信装置30は図4に示す処理を周期的に実行する。
図4のステップS51では、周辺機器側通信装置30は周辺機器40に対してSOFフレームを送信すると共に、SOFフレームに入力する値(フレーム番号)を1増やす。
その後、周辺機器側通信装置30はステップS52で1msecの時間待ちを行った後、再びステップS51に戻る。
【0047】
従って、周辺機器40には周辺機器側通信装置30から1msecの間隔で周期的にSOFフレームが入力される。
次に、システム全体の動作例について図6,図7を参照して説明する。ホストコントローラ10から周辺機器40へ向けて下り方向にデータを伝送する場合の動作が図6に示されており、周辺機器40からホストコントローラ10に向けて上り方向にデータを伝送する場合の動作が図7に示されている。
【0048】
図6に示すように、ホストコントローラ10がトークンパケットP12及びデータパケットP11を周辺機器40に向けて送信すると、ホスト側通信装置20はそれを受信してからACKパケットP13をホストコントローラ10に返す。また、ホスト側通信装置20はホストコントローラ10から受信した各パケットをトークンパケットP15及びデータパケットP14として周辺機器側通信装置30へ送信する。
【0049】
周辺機器側通信装置30は、ホスト側通信装置20から送信された各パケットを受信し、それをトークンパケットP17及びデータパケットP16として周辺機器40に送信する。
【0050】
周辺機器側通信装置30からのパケットを周辺機器40が受信すると周辺機器40はACKパケットP18を周辺機器側通信装置30に返す。
ここで、ホストコントローラ10からのパケットP11,P12の送信に対する応答が、周辺機器40ではなくホスト側通信装置20から直接、ACKパケットP13としてホストコントローラ10に返されるので、ホスト側通信装置20と周辺機器側通信装置30との間の伝送遅延時間が大きい場合であっても、短時間で応答を返すことができる。
【0051】
従って、ホストコントローラ10と周辺機器40との間でUSB規格の仕様を超える長さの通信網を形成した場合であっても、正常な通信が可能である。
一方、周辺機器40からホストコントローラ10へデータを送る場合には、図7に示すような動作が実施される。
図7において、ホストコントローラ10はそれが周辺機器40宛に送信するトークンパケットP21により、周辺機器40に対してデータの送信が可能である(送信を許可した)ことを通知する。
【0052】
ホスト側通信装置20はトークンパケットP21を受信するとそれに対して応答するが、この時点ではホスト側通信装置20は周辺機器40からのデータパケットをまだ受け取っておらずメモリに保持していないので、NAKパケットP22をホストコントローラ10に返す。
ホスト側通信装置20は、ホストコントローラ10から受信したトークンパケットP21をトークンパケットP23として周辺機器側通信装置30に転送する。
【0053】
周辺機器側通信装置30は、ホスト側通信装置20からのトークンパケットP23を受信すると、それをトークンパケットP24として周辺機器40に転送する。
周辺機器40は、周辺機器側通信装置30から転送されたトークンパケットP24の受信により、自分に送信権があることを知る。そして、周辺機器40はデータパケットP25を作成しそれを周辺機器側通信装置30に送信する。
【0054】
周辺機器側通信装置30は、周辺機器40からのデータパケットP25を受信すると、それに対する応答としてACKパケットP26を周辺機器40に送信する。また、周辺機器側通信装置30は周辺機器40からのデータパケットP25を送信元の情報を付加したデータパケットP27としてホスト側通信装置20に転送する。
【0055】
なお、ACKパケットP26の送信とデータパケットP27の送信のタイミングについてはどちらが先でもよいし同時でもよい。
ホスト側通信装置20は、周辺機器側通信装置30から転送されたデータパケットP27を受信すると、ステップS71で、送信元の情報に対応付けてそのデータパケットをメモリに保持する。
【0056】
その後、ホストコントローラ10から再び周辺機器40に対してデータを送信可能であることを表すトークンパケットP30が送信される。このトークンパケットP30をホスト側通信装置20が受信すると、該当するデータパケットがホスト側通信装置20のメモリに保持されているので、ホスト側通信装置20はそのデータをメモリから取り出してデータパケットP31としてホストコントローラ10に送信する。
【0057】
ホストコントローラ10は、ホスト側通信装置20からのデータパケットP31を受信すると、それを受信したことを表す応答としてACKパケットP32をホスト側通信装置20に返す。
この場合、ホスト側通信装置20はACKパケットP32を受信すると該当するデータパケットをメモリ上から削除する。
【0058】
また、ホスト側通信装置20はトークンパケットP30を受信すると、それをトークンパケットP33として周辺機器側通信装置30に転送する。周辺機器側通信装置30は、トークンパケットP33を受信するとそれをトークンパケットP34として周辺機器40に送信する。
【0059】
このように、周辺機器40が送信するデータパケットを予めホスト側通信装置20のメモリ上に保持しておき、ホストコントローラ10からのトークンパケットを受信した時に、ホスト側通信装置20が直接ホストコントローラ10に対して該当するデータパケットを送信するので、ホスト側通信装置20と周辺機器側通信装置30との間の伝送遅延時間が大きい場合であっても、ホストコントローラ10が周辺機器40に対して送信を要求してから短時間で応答することができる。このため、ホストコントローラ10と周辺機器40との間の距離が大きい場合であっても、USBの規格に違反することなく情報を正常に伝送できる。
【0060】
以上に示した動作例は、一般的な転送モードの場合を想定している。USB規格ではACKパケットの存在しないアイソクロナス転送モードを利用することもできる。
そこで、アイソクロナス転送モードを使う可能性がある場合には、図9,図10に示すようにホスト側通信装置20及び周辺機器側通信装置30の動作を変更すればよい。
【0061】
図9において、ホスト側通信装置20はステップS81でアイソクロナス転送モードか否かを識別し、周辺機器側通信装置30はステップS82でアイソクロナス転送モードか否かを識別する。
図9の例では、アイソクロナス転送モードの場合を想定しているので、図6に示したACKパケットP13やACKパケットP18の送信は省略される。
【0062】
同様に、図10においてホスト側通信装置20はステップS83でアイソクロナス転送モードか否かを識別し、周辺機器側通信装置30はステップS84でアイソクロナス転送モードか否かを識別する。
図10の例では、アイソクロナス転送モードの場合を想定しているので、図7に示した各パケットP22,P26,P32の送信は省略されている。
【0063】
なお、ホスト側通信装置20と周辺機器側通信装置30との間の通信回線においてデータパケットの転送に失敗すると、ホストコントローラ10と周辺機器40との間で伝送したデータの不一致が生じることになる。しかし、この例では誤り補償制御部24,34の制御によりホスト側通信装置20と周辺機器側通信装置30との間でデータ伝送に誤りが発生した場合には再送などの手続きを行うので、確実にデータが伝送される。これにより、ホストコントローラ10と周辺機器40との間でデータの不一致が生じるのが防止される。
【0064】
【発明の効果】
本発明によれば、USBの通信区間を従来より大幅に延長することが可能になる。
【図面の簡単な説明】
【図1】ホスト側通信装置の動作(1)を示すフローチャートである。
【図2】周辺機器側通信装置の動作(1)を示すフローチャートである。
【図3】ホスト側通信装置の動作(2)を示すフローチャートである。
【図4】周辺機器側通信装置の動作(2)を示すフローチャートである。
【図5】通信システムの主要部の構成例を示すブロック図である。
【図6】下り方向の通信動作を示すシーケンス図である。
【図7】上り方向の通信動作を示すシーケンス図である。
【図8】通信システムの主要部の構成例を示すブロック図である。
【図9】アイソクロナス転送モードの下り方向の通信動作を示すシーケンス図である。
【図10】アイソクロナス転送モードの上り方向の通信動作を示すシーケンス図である。
【符号の説明】
10 ホストコントローラ
11 USBインタフェース
20 ホスト側通信装置
21 USBインタフェース
22 通信制御部
23 通信インタフェース
24 誤り補償制御部
25 記憶部
30 周辺機器側通信装置
31 通信インタフェース
32 通信制御部
33 USBインタフェース
34 誤り補償制御部
40 周辺機器
41 USBインタフェース
51,52 USBケーブル
53 通信回線
61,62 無線通信インタフェース
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a USB communication method used when communicating according to the USB (Universal Serial Bus) standard.
[0002]
[Prior art]
2. Description of the Related Art Conventionally, communication interfaces conforming to the USB standard have been widely used in personal computers (PCs) and various peripheral devices.
The specification of the USB standard is disclosed as a USB specification document. According to the USB standard, up to 127 peripheral devices can be connected.
[0003]
Further, a conventional technique of this kind is disclosed in Patent Document 1.
[Patent Document 1]
Table 2002-542527
[0004]
[Problems to be solved by the invention]
However, the USB specification states that the device must be within 5 meters of the host PC.
[0005]
Of course, if a USB hub is used, the distance can be extended, but even in that case, it can be extended only up to a maximum of 30 m. For this reason, when communicating using the USB interface, conventionally, peripheral devices could not be used at a place 30 m away from the host PC.
Such a limitation on the distance lies in the operating principle of the USB. That is, in the USB, the host PC has all rights to use the bus, and is controlled so that the host PC allocates a usable band to each peripheral device.
[0006]
In addition, since the time from when the host PC allocates a band to each peripheral device to when the host PC receives data is as short as 16 bit time or less, and 7.5 bit time is assigned as a delay in the cable, the peripheral device Only 8.5 bit time (0.7 μs at 12 Mbps) is allowed from transmission of the right to use of the bus until transmission of the right to use the bus, and the margin is small.
[0007]
Because of such specifications, even if a USB device that causes a lot of delay is connected ignoring the specifications, signal collision will occur and communication cannot be actually performed.
An object of the present invention is to provide a USB communication method capable of performing normal communication even when a delay between a host PC and a peripheral device is large when performing communication according to the USB standard.
[0008]
[Means for Solving the Problems]
Claim 1 is a USB communication method for communicating with a host controller connected to a host device and a predetermined peripheral device according to the USB standard, wherein the host communication device connected to the host controller; Using the peripheral device-side communication device connected to the peripheral device, between the host controller and the host-side communication device, between the peripheral device and the peripheral device-side communication device, the host-side communication device and the peripheral device A first procedure for communicating with the communication device on the host side, and when the communication device on the host side receives a packet from the host controller, the communication device on the host side identifies a first transmission direction from the packet. If the first transmission direction is not the direction input to the host controller, the presence / absence of the next data packet is transmitted to the host side. A second procedure for the device to identify, and a third procedure in which the host-side communication device receives the data packet from the host controller when there is a data packet following the second procedure; A fourth procedure of transferring a packet from the host controller received by the device to the peripheral device side communication device; and, if the first transmission direction is a direction input to the host controller, the host side The communication device identifies whether the corresponding data packet is held in its own memory, and if so, transfers the corresponding data packet to the host controller; A sixth procedure in which the device receives a data packet from the peripheral device-side communication device and stores the data packet in a memory; A seventh procedure in which the peripheral device-side communication device identifies a second transmission direction from the packet when receiving a packet from the communication device; and a direction in which the second transmission direction is input to the host controller. If not, an eighth procedure in which the peripheral device-side communication device identifies the presence or absence of the next data packet, and if there is a data packet that follows in the eighth procedure, the data packet is transmitted to the peripheral device. A ninth procedure for receiving the packet received by the peripheral device-side communication device to the peripheral device when the second transmission direction is not the direction input to the host controller; And transmitting the packet received by the peripheral device side communication device to the peripheral device when the second transmission direction is a direction input to the host controller. An eleventh procedure for transmitting, and a twelfth procedure for the peripheral device-side communication device to receive a packet from the peripheral device when the second transmission direction is a direction input to the host controller; And a thirteenth procedure in which, when a data packet is received in the twelfth procedure, the peripheral device-side communication device adds destination information to the received data packet and transfers the data packet to the host-side communication device. It is characterized by.
[0009]
According to the first aspect, communication between the host controller and the peripheral device is performed using a host communication device connected to a host controller (host PC) and a peripheral device communication device connected to a peripheral device. Relay.
In addition, since the data transmitted by the peripheral device is stored in the memory of the host communication device, even if the delay time between the host communication device and the peripheral device communication device is large, the communication from the host controller is not possible. Requested data can be transmitted in a short time in response to a request.
[0010]
That is, even when the distance between the host-side communication device and the peripheral device-side communication device is large, data can be transmitted to the host-side communication device within the time specified by the USB standard, and communication can be performed correctly. It can be performed.
According to a second aspect of the present invention, in the USB communication method of the first aspect, communication is performed between the host-side communication device and the peripheral device-side communication device using a wireless line.
[0011]
According to the second aspect, since it is not necessary to connect the host-side communication device and the peripheral device-side communication device with a cable, the degree of freedom of the position in arranging the host controller (host PC) and each peripheral device is increased. .
According to a third aspect of the present invention, in the USB communication method of the first aspect, at least information on power consumption of the peripheral device is transmitted between the host-side communication device and the peripheral device-side communication device.
[0012]
According to the third aspect, since the power consumption of the peripheral device can be monitored on the host controller side, it is possible to output a warning such as an overload.
According to a fourth aspect of the present invention, in the USB communication method of the first aspect, at least information relating to attachment / detachment of a peripheral device to / from a USB interface is transmitted between the host side communication device and the peripheral device side communication device.
[0013]
According to the fourth aspect, since the attachment / detachment of the peripheral device can be monitored on the host controller side, it is possible to output a warning regarding attachment / detachment of the peripheral device.
According to a fifth aspect of the present invention, in the USB communication method according to the first aspect, when performing communication between the host-side communication device and the peripheral device-side communication device, error compensation control including retransmission is performed.
[0014]
When the communication of the host controller is terminated by the host communication device and the communication of the peripheral device is terminated by the peripheral device communication device, when data is lost between the host communication device and the peripheral device communication device. Data mismatch occurs between the source and the destination. For example, when the data transmitted by the host controller to the peripheral device disappears between the host communication device and the peripheral device communication device, the host controller regards the transmission as completed, but the data does not reach the peripheral device.
[0015]
According to the fifth aspect, when performing communication between the host side communication device and the peripheral device side communication device, error compensation control including retransmission is performed, so that data communication between the host side communication device and the peripheral device side communication device is performed. Can be prevented from disappearing, and occurrence of data mismatch between the transmission source and the destination can be prevented.
According to a sixth aspect of the present invention, in the USB communication method according to the first aspect, when the data packet is received from the host controller in the third step, the host-side communication device returns a response of a reception confirmation to the host controller. After the host-side communication device has transmitted a data packet to the host controller in the procedure of step 14 and the fifth procedure, when the host-side communication device receives a response of reception confirmation from the host controller, the transmitted data packet is stored in a memory. A fifteenth procedure for deleting from the host controller, if the first transmission direction is the direction to be input to the host controller, and if there is no corresponding data packet in the memory of the host-side communication device, A sixteenth step of transmitting a response indicating that the communication device does not exist to the host controller; A seventeenth procedure in which, when the peripheral device-side communication device receives a data packet from the peripheral device in step 12, the peripheral device-side communication device returns a reception confirmation response to the peripheral device. It is characterized by.
[0016]
According to the sixth aspect, the host-side communication device and the peripheral device-side communication device can terminate a handshake packet (ACK packet, NAK packet, STALL packet) and a frame packet. It is possible to effectively use the bandwidth between the peripheral device side communication device and the peripheral device.
[0017]
According to a seventh aspect of the present invention, in the USB communication method according to the sixth aspect, the host-side communication device and the peripheral device-side communication device identify whether or not the communication mode is the isochronous transfer, and change the content of the control according to the result. It is characterized by the following.
In isochronous transfer of USB communication, a response confirmation such as an ACK packet is not performed. According to the seventh aspect, control is performed by identifying whether the communication mode is isochronous transfer or not, so that isochronous transfer can be supported.
[0018]
BEST MODE FOR CARRYING OUT THE INVENTION
One embodiment of a USB communication method according to the present invention will be described with reference to FIGS. This form corresponds to all claims.
FIG. 1 is a flowchart showing the operation (1) of the host communication device. FIG. 2 is a flowchart showing the operation (1) of the peripheral device side communication device. FIG. 3 is a flowchart showing the operation (2) of the host-side communication device. FIG. 4 is a flowchart showing the operation (2) of the peripheral device side communication device. FIG. 5 is a block diagram showing a configuration example of a main part of the communication system.
[0019]
FIG. 6 is a sequence diagram illustrating a downlink communication operation. FIG. 7 is a sequence diagram showing an uplink communication operation. FIG. 8 is a block diagram showing a configuration example of a main part of the communication system. FIG. 9 is a sequence diagram showing a downstream communication operation in the isochronous transfer mode. FIG. 10 is a sequence diagram showing the upstream communication operation in the isochronous transfer mode.
[0020]
In this embodiment, the first procedure, the second procedure, the third procedure, the fourth procedure, the fifth procedure, the sixth procedure, the seventh procedure, the eighth procedure, and the ninth procedure in claim 1 are described. , The tenth procedure, the eleventh procedure, the twelfth procedure, and the thirteenth procedure are described in steps S11, S12, S13, S15, S17, S42, S22, S23, S24, S25, S27, S28 and S28, respectively. This corresponds to S32.
[0021]
The fourteenth, fifteenth, sixteenth, and seventeenth procedures in claim 6 correspond to steps S14, S18, S19, and S30, respectively. In this embodiment, it is assumed that the present invention is applied to a communication system as shown in FIG. 5 or FIG.
In FIG. 5, for example, a USB interface 11 is provided in a host controller 10 arranged on a personal computer, and a USB interface 41 is also provided in a peripheral device 40.
[0022]
In a general connection mode, the USB interface 11 of the host controller 10 and the USB interface 41 of the peripheral device 40 are directly connected by one USB cable, but in the example of FIG. Are connected so that the host-side communication device 20 and the peripheral device-side communication device 30 are interposed therebetween.
[0023]
That is, the USB interface 11 of the host controller 10 is connected to the host-side communication device 20 via the USB cable 51, and the USB interface 41 of the peripheral device 40 is connected to the peripheral-device-side communication device 30 via the USB cable 52. The side communication device 20 and the peripheral device side communication device 30 are connected by a wired communication line 53.
[0024]
The host-side communication device 20 includes a USB interface 21, a communication control unit 22, a communication interface 23, an error compensation control unit 24, and a storage unit 25, and the peripheral device-side communication device 30 includes a communication interface 31, a communication control unit 32 , USB interface 33 and error compensation control unit 34 are provided.
[0025]
The USB interfaces 11, 21, 31, and 41 are communication interfaces that operate according to the specifications of the USB standard.
The connection between the host-side communication device 20 and the peripheral device-side communication device 30 is not limited to wired. That is, if the wireless communication interfaces 61 and 62 are provided as shown in FIG. 8, the host communication device 20 and the peripheral device communication device 30 can be connected by a wireless line.
[0026]
In the communication system shown in FIGS. 5 and 8, the host-side communication device 20 and the peripheral device-side communication device 30 relay the communication between the host controller 10 and the peripheral device 40, thereby realizing the operation unique to the present invention. I do.
The error compensation control unit 24 provided in the host communication device 20 and the error compensation control unit 34 provided in the peripheral device communication device 30 communicate between the host communication device 20 and the peripheral device communication device 30. At this time, error compensation control including retransmission control is performed. This error compensation control prevents data mismatch between the host controller 10 and the peripheral device 40.
[0027]
Also, the peripheral device side communication device 30 detects the amount of power consumption in the peripheral device 40 and the detachment information indicating whether or not the peripheral device 40 is actually connected to the USB interface 33 and detects such information on the host side. The data is transmitted to the host controller 10 via the communication device 20.
The main part of the operation of the host side communication device 20 is as shown in FIGS. 1 and 3, and the main part of the operation of the peripheral device side communication device 30 is as shown in FIGS. 2 and 4. 1 shows the operation when the host communication device 20 receives the information from the host controller 10, and the content shown in FIG. 3 shows the information when the host communication device 20 receives the information from the peripheral device communication device 30. This is the operation when receiving the message.
[0028]
FIG. 2 shows the operation when the peripheral device communication device 30 receives information from the host communication device 20, and the content shown in FIG. 4 is performed periodically by the peripheral device communication device 30. Action.
Before describing the actual operations of the host-side communication device 20 and the peripheral device-side communication device 30, a general USB standard communication operation will be described below.
[0029]
Information is basically transmitted in the order of a token packet, a data packet, and a handshake packet.
The token packet is a packet for instructing what data is to flow in which direction. The setup, IN, OUT, SOF, data, NAK, ACK, STALL, and the like are distinguished by the PID (4-bit identifier) in the token packet.
[0030]
The data packet represents the data body to be transmitted. The handshake packet is a packet used for notifying whether or not a packet that would have been sent before has been received, and has three types: an ACK packet, a NAK packet, and a STALL packet.
These packets are transmitted continuously. Consecutive packets are often not in the same direction. The ACK basically flows in the opposite direction to the previous packet. Further, there may be no data packets.
[0031]
“IN” indicating the data transmission direction indicates a direction input to the host controller, and “OUT” indicates a direction from the host controller to the peripheral device.
The SOF is a packet transmitted from the host controller every 1 msec. The end point (Endpoint) is a value described in the token packet, and is used to specify an application of a peripheral device to which the packet is delivered.
[0032]
Next, the operation of the host-side communication device 20 shown in FIG. 1 will be described.
When communication is started between the host controller 10 and the host-side communication device 20, the host-side communication device 20 receives a token packet from the host controller 10 in step S10.
[0033]
In this case, the host-side communication device 20 examines the received token packet and identifies whether or not the host controller 10 has issued an IN packet transmission request (to a peripheral device). That is, the presence or absence of an IN packet flag is checked in step S11. If the packet is an IN packet, the process proceeds to step S16. Otherwise, that is, if the packet is a setup packet or an OUT packet, the process proceeds to step S12.
[0034]
In step S12, it is determined whether or not a subsequent data packet arrives from the host controller 10. Then, when a data packet from the host controller 10 arrives, the host-side communication device 20 receives it.
In the following step S14, the host-side communication device 20 returns an ACK to the host controller 10 as a response to the received packet.
[0035]
In the next step S15, the host communication device 20 transmits the token packet and the data packet (if any) received from the host controller 10 to the peripheral device communication device 30.
If the received token packet is an IN packet transmission request, the process proceeds from step S11 to S16. In this case, the host-side communication device 20 refers to the endpoint / PID described in the token packet and checks whether the corresponding data packet is stored in the memory of the storage unit 25.
[0036]
If the corresponding data packet is stored in the storage unit 25 (result previously received from the peripheral device 40), the process proceeds from step S16 to S17, and the data stored in the storage unit 25 (the same transmission source (peripheral The oldest data packet in the data from the device 40) is extracted and transmitted to the host controller 10.
When the host communication device 20 receives the ACK packet of the host controller 10 as a response to the transmitted data packet, the host communication device 20 deletes the corresponding data packet from the memory of the storage unit 25 in step S18. .
[0037]
If the requested data packet does not exist in the memory of the storage unit 25 in step S16, the process proceeds to step S19, and the host communication device 20 returns a NAK to the host controller 10.
On the other hand, when the host communication device 20 receives the information from the peripheral device communication device 30, the operation shown in FIG. 3 is executed.
[0038]
That is, in step S41, the host-side communication device 20 receives a data packet from the peripheral device-side communication device 30.
In step S42, the PID and endpoint described in the received packet are extracted, and the data packet is stored in the memory of the storage unit 25 in association with the PID and endpoint.
[0039]
These operations are repeated.
Next, the operation of the peripheral device-side communication device 30 shown in FIG. 2 will be described.
The peripheral device-side communication device 30 receives the token packet transmitted from the host controller 10 and relayed by the host-side communication device 20 in step S21 in FIG.
[0040]
After receiving the token packet, the peripheral device-side communication device 30 checks the contents of the token packet in the next step S22, and determines whether or not the token packet is an IN packet transmission request, that is, whether or not there is an IN packet flag. Identify.
If the request is not an IN packet transmission request, the process proceeds from step S22 to S23, and it is determined whether or not a subsequent data packet arrives from the host communication device 20. When the data packet has arrived, the peripheral device-side communication device 30 receives the data packet in step S24.
[0041]
Thereafter, the peripheral device-side communication device 30 transmits the token packet received in step S21 and the received data packet (if any) to the peripheral device 40 in step S25.
In step S26, it is confirmed whether or not the peripheral device-side communication device 30 has received an ACK packet, which is a response from the peripheral device 40 to the packet transmitted in step S25.
[0042]
If the ACK packet has not arrived, the process returns from step S26 to S25 and transmits the same packet again. When the ACK packet arrives, the process returns to step S21.
On the other hand, if the token packet from the host controller 10 received by the peripheral device-side communication device 30 is an IN packet transmission request, the process proceeds from step S22 to S27.
[0043]
In step S27, the peripheral device-side communication device 30 transmits the token packet received in step S21 to the peripheral device 40.
In addition, the peripheral device side communication device 30 receives a packet transmitted from the peripheral device 40 in response to the packet transmitted in step S27 in step S28. In step S29, it is determined whether or not the packet received in step S28 is a data packet. If it is a data packet, the process proceeds to step S30.
[0044]
In step S30, the peripheral device-side communication device 30 transmits ACK to the peripheral device 40 as a response to the data packet from the peripheral device 40.
In step S31, the peripheral device-side communication device 30 adds the destination PID and endpoint described in the token packet from the host controller 10 to the data packet received from the peripheral device 40 in step S28.
[0045]
Then, the peripheral device-side communication device 30 transmits the data packet to the host-side communication device 20 in the next step S32.
When a packet (ACK, NAK, STALL) other than the data packet is received in step S28, the process returns from step S29 to S21.
The peripheral device-side communication device 30 repeats these operations.
[0046]
Further, the peripheral device-side communication device 30 periodically executes the processing shown in FIG.
In step S51 in FIG. 4, the peripheral device communication device 30 transmits the SOF frame to the peripheral device 40 and increases the value (frame number) input to the SOF frame by one.
After that, the peripheral device communication device 30 waits for 1 msec in step S52, and then returns to step S51 again.
[0047]
Therefore, the SOF frame is periodically input to the peripheral device 40 from the peripheral device side communication device 30 at an interval of 1 msec.
Next, an operation example of the entire system will be described with reference to FIGS. FIG. 6 shows an operation when data is transmitted in a downward direction from the host controller 10 to the peripheral device 40. An operation when data is transmitted in an upward direction from the peripheral device 40 to the host controller 10 is shown in FIG. This is shown in FIG.
[0048]
As shown in FIG. 6, when the host controller 10 transmits the token packet P12 and the data packet P11 to the peripheral device 40, the host communication device 20 receives the token packet P12 and the data packet P11 and returns an ACK packet P13 to the host controller 10. The host-side communication device 20 transmits each packet received from the host controller 10 to the peripheral device-side communication device 30 as a token packet P15 and a data packet P14.
[0049]
The peripheral device-side communication device 30 receives each packet transmitted from the host-side communication device 20, and transmits it to the peripheral device 40 as a token packet P17 and a data packet P16.
[0050]
When the peripheral device 40 receives the packet from the peripheral device communication device 30, the peripheral device 40 returns an ACK packet P18 to the peripheral device communication device 30.
Here, a response to the transmission of the packets P11 and P12 from the host controller 10 is returned directly to the host controller 10 as the ACK packet P13 from the host-side communication device 20 instead of the peripheral device 40. Even if the transmission delay time with the device-side communication device 30 is long, a response can be returned in a short time.
[0051]
Therefore, even when a communication network having a length exceeding the USB standard is formed between the host controller 10 and the peripheral device 40, normal communication is possible.
On the other hand, when data is transmitted from the peripheral device 40 to the host controller 10, an operation as shown in FIG. 7 is performed.
In FIG. 7, the host controller 10 notifies the peripheral device 40 that data transmission is possible (transmission is permitted) by the token packet P21 transmitted to the peripheral device 40.
[0052]
When the host-side communication device 20 receives the token packet P21, it responds to it. At this point, the host-side communication device 20 has not yet received the data packet from the peripheral device 40 and has not stored it in the memory. The packet P22 is returned to the host controller 10.
The host communication device 20 transfers the token packet P21 received from the host controller 10 to the peripheral device communication device 30 as a token packet P23.
[0053]
Upon receiving the token packet P23 from the host-side communication device 20, the peripheral device-side communication device 30 transfers the token packet P23 to the peripheral device 40 as a token packet P24.
The peripheral device 40 knows that it has the transmission right by receiving the token packet P24 transferred from the peripheral device side communication device 30. Then, the peripheral device 40 creates the data packet P25 and transmits it to the peripheral device side communication device 30.
[0054]
Upon receiving the data packet P25 from the peripheral device 40, the peripheral device-side communication device 30 transmits an ACK packet P26 to the peripheral device 40 as a response thereto. Further, the peripheral device side communication device 30 transfers the data packet P25 from the peripheral device 40 to the host side communication device 20 as a data packet P27 to which information of a transmission source is added.
[0055]
Either the transmission of the ACK packet P26 or the transmission of the data packet P27 may be performed first or simultaneously.
When the host-side communication device 20 receives the data packet P27 transferred from the peripheral device-side communication device 30, in step S71, the host-side communication device 20 stores the data packet in the memory in association with the transmission source information.
[0056]
After that, the host controller 10 transmits a token packet P30 indicating that data can be transmitted to the peripheral device 40 again. When this token packet P30 is received by the host-side communication device 20, the corresponding data packet is held in the memory of the host-side communication device 20, so that the host-side communication device 20 fetches the data from the memory and converts it into a data packet P31. Transmit to the host controller 10.
[0057]
Upon receiving the data packet P31 from the host-side communication device 20, the host controller 10 returns an ACK packet P32 to the host-side communication device 20 as a response indicating that the data packet P31 has been received.
In this case, upon receiving the ACK packet P32, the host-side communication device 20 deletes the corresponding data packet from the memory.
[0058]
When receiving the token packet P30, the host communication device 20 transfers the token packet P30 to the peripheral device communication device 30 as a token packet P33. Upon receiving the token packet P33, the peripheral device-side communication device 30 transmits the token packet P33 to the peripheral device 40 as a token packet P34.
[0059]
As described above, the data packet transmitted by the peripheral device 40 is held in the memory of the host-side communication device 20 in advance, and when the token packet from the host controller 10 is received, the host-side communication device 20 , The host controller 10 transmits the data packet to the peripheral device 40 even when the transmission delay time between the host-side communication device 20 and the peripheral device-side communication device 30 is large. And then respond in a short time. Therefore, even when the distance between the host controller 10 and the peripheral device 40 is large, information can be transmitted normally without violating the USB standard.
[0060]
The operation example described above assumes a case of a general transfer mode. In the USB standard, an isochronous transfer mode in which no ACK packet exists can be used.
Therefore, when there is a possibility that the isochronous transfer mode may be used, the operations of the host communication device 20 and the peripheral device communication device 30 may be changed as shown in FIGS.
[0061]
In FIG. 9, the host-side communication device 20 identifies whether or not the device is in the isochronous transfer mode in step S81, and the peripheral device-side communication device 30 identifies whether or not the device is in the isochronous transfer mode in step S82.
In the example of FIG. 9, since the case of the isochronous transfer mode is assumed, the transmission of the ACK packet P13 and the ACK packet P18 shown in FIG. 6 is omitted.
[0062]
Similarly, in FIG. 10, the host-side communication device 20 identifies whether or not it is in the isochronous transfer mode in step S83, and the peripheral device-side communication device 30 identifies whether or not it is in the isochronous transfer mode in step S84.
In the example of FIG. 10, since the case of the isochronous transfer mode is assumed, transmission of each packet P22, P26, and P32 shown in FIG. 7 is omitted.
[0063]
If the transfer of the data packet on the communication line between the host-side communication device 20 and the peripheral device-side communication device 30 fails, the data transmitted between the host controller 10 and the peripheral device 40 will not match. . However, in this example, if an error occurs in data transmission between the host-side communication device 20 and the peripheral device-side communication device 30 under the control of the error compensation control units 24 and 34, a procedure such as retransmission is performed. Is transmitted to the device. This prevents data mismatch between the host controller 10 and the peripheral device 40.
[0064]
【The invention's effect】
ADVANTAGE OF THE INVENTION According to this invention, it becomes possible to extend a USB communication area significantly conventionally.
[Brief description of the drawings]
FIG. 1 is a flowchart illustrating an operation (1) of a host-side communication device.
FIG. 2 is a flowchart showing an operation (1) of the peripheral device side communication device.
FIG. 3 is a flowchart showing an operation (2) of the host-side communication device.
FIG. 4 is a flowchart illustrating an operation (2) of the peripheral device-side communication device.
FIG. 5 is a block diagram illustrating a configuration example of a main part of a communication system.
FIG. 6 is a sequence diagram illustrating a downlink communication operation.
FIG. 7 is a sequence diagram showing an uplink communication operation.
FIG. 8 is a block diagram illustrating a configuration example of a main part of a communication system.
FIG. 9 is a sequence diagram showing a downstream communication operation in the isochronous transfer mode.
FIG. 10 is a sequence diagram illustrating an upstream communication operation in the isochronous transfer mode.
[Explanation of symbols]
10 Host controller
11 USB interface
20 Host side communication device
21 USB interface
22 Communication control unit
23 Communication Interface
24 error compensation controller
25 Memory
30 Peripheral device communication device
31 Communication Interface
32 Communication control unit
33 USB interface
34 error compensation control unit
40 Peripheral equipment
41 USB interface
51,52 USB cable
53 communication line
61, 62 wireless communication interface

Claims (7)

ホスト装置側に接続されたホストコントローラと、所定の周辺機器との間でUSBの規格に従って通信するためのUSB通信方法において、前記ホストコントローラに接続されたホスト側通信装置と、前記周辺機器に接続された周辺機器側通信装置とを用いて、前記ホストコントローラとホスト側通信装置との間、前記周辺機器と周辺機器側通信装置との間、前記ホスト側通信装置と周辺機器側通信装置との間でそれぞれ通信を行うと共に、
前記ホストコントローラからのパケットをホスト側通信装置が受信した場合に、ホスト側通信装置が前記パケットから第1の伝送方向を識別する第1の手順と、
前記第1の伝送方向が前記ホストコントローラに入力される方向でない場合には、次に続くデータパケットの有無をホスト側通信装置が識別する第2の手順と、
前記第2の手順で続くデータパケットがある場合には、そのデータパケットを前記ホスト側通信装置がホストコントローラから受信する第3の手順と、
前記ホスト側通信装置が受信した前記ホストコントローラからのパケットを前記周辺機器側通信装置に転送する第4の手順と、
前記第1の伝送方向が前記ホストコントローラに入力される方向である場合には、前記ホスト側通信装置は該当するデータパケットが自身のメモリに保持されているか否かを識別し、保持されている場合には該当するデータパケットを前記ホストコントローラに転送する第5の手順と、
前記ホスト側通信装置が周辺機器側通信装置からのデータパケットを受信してメモリに保存する第6の手順と、
前記周辺機器側通信装置がホスト側通信装置からのパケットを受信した場合に、前記パケットから前記周辺機器側通信装置が第2の伝送方向を識別する第7の手順と、
前記第2の伝送方向が前記ホストコントローラに入力される方向でない場合には、次に続くデータパケットの有無を前記周辺機器側通信装置が識別する第8の手順と、
前記第8の手順で続くデータパケットがある場合には、そのデータパケットを前記周辺機器側通信装置が受信する第9の手順と、
前記第2の伝送方向が前記ホストコントローラに入力される方向でない場合に、前記周辺機器側通信装置が受信したパケットを前記周辺機器に転送する第10の手順と、
前記第2の伝送方向が前記ホストコントローラに入力される方向である場合に、前記周辺機器側通信装置が受信したパケットを前記周辺機器に転送する第11の手順と、
前記第2の伝送方向が前記ホストコントローラに入力される方向である場合に、前記周辺機器からのパケットを前記周辺機器側通信装置が受信する第12の手順と、
前記第12の手順でデータパケットを受信した場合には、前記周辺機器側通信装置が受信したデータパケットに宛先情報を付加して前記ホスト側通信装置に転送する第13の手順と
を設けたことを特徴とするUSB通信方法。
In a USB communication method for communicating between a host controller connected to a host device and a predetermined peripheral device in accordance with the USB standard, a host communication device connected to the host controller and a connection to the peripheral device Between the host controller and the host-side communication device, between the peripheral device and the peripheral-device-side communication device, and between the host-side communication device and the peripheral-device-side communication device. Communicate with each other,
A first procedure in which when the host communication device receives a packet from the host controller, the host communication device identifies a first transmission direction from the packet;
If the first transmission direction is not the direction input to the host controller, a second procedure in which the host-side communication device identifies the presence or absence of the next data packet;
If there is a data packet following the second procedure, a third procedure in which the host-side communication device receives the data packet from the host controller;
A fourth procedure of transferring a packet from the host controller received by the host-side communication device to the peripheral device-side communication device;
If the first transmission direction is the direction to be input to the host controller, the host-side communication device identifies whether the corresponding data packet is stored in its own memory, and the data packet is stored. A fifth procedure for transferring the relevant data packet to the host controller in such a case;
A sixth procedure in which the host-side communication device receives a data packet from a peripheral device-side communication device and stores the data packet in a memory;
A seventh procedure in which, when the peripheral device-side communication device receives a packet from the host-side communication device, the peripheral device-side communication device identifies a second transmission direction from the packet;
If the second transmission direction is not the direction input to the host controller, an eighth procedure in which the peripheral device-side communication device identifies the presence or absence of a subsequent data packet;
If there is a data packet following the eighth procedure, a ninth procedure in which the peripheral device-side communication device receives the data packet;
A tenth procedure for transferring the packet received by the peripheral device side communication device to the peripheral device when the second transmission direction is not the direction input to the host controller;
An eleventh procedure of transferring a packet received by the peripheral device-side communication device to the peripheral device when the second transmission direction is a direction input to the host controller;
A twelfth procedure in which the peripheral device side communication device receives a packet from the peripheral device when the second transmission direction is a direction input to the host controller;
And a thirteenth procedure in which, when a data packet is received in the twelfth procedure, the peripheral device-side communication device adds destination information to the received data packet and transfers the data packet to the host-side communication device. A USB communication method, comprising:
請求項1のUSB通信方法において、前記ホスト側通信装置と周辺機器側通信装置との間で無線回線を用いて通信を行うことを特徴とするUSB通信方法。2. The USB communication method according to claim 1, wherein communication is performed between the host-side communication device and the peripheral device-side communication device using a wireless line. 請求項1のUSB通信方法において、前記ホスト側通信装置と周辺機器側通信装置との間で、少なくとも周辺機器の消費電力に関する情報を伝送することを特徴とするUSB通信方法。2. The USB communication method according to claim 1, wherein at least information on power consumption of the peripheral device is transmitted between the host-side communication device and the peripheral device-side communication device. 請求項1のUSB通信方法において、前記ホスト側通信装置と周辺機器側通信装置との間で、少なくともUSBインタフェースに対する周辺機器の脱着に関する情報を伝送することを特徴とするUSB通信方法。2. The USB communication method according to claim 1, wherein at least information relating to attachment / detachment of a peripheral device to / from a USB interface is transmitted between the host side communication device and the peripheral device side communication device. 請求項1のUSB通信方法において、前記ホスト側通信装置と周辺機器側通信装置との間で通信を行う際に、再送を含む誤り補償制御を行うことを特徴とするUSB通信方法。2. The USB communication method according to claim 1, wherein when performing communication between the host-side communication device and the peripheral device-side communication device, error compensation control including retransmission is performed. 請求項1のUSB通信方法において、
前記第3の手順でホストコントローラからのデータパケットを受信した場合に、前記ホスト側通信装置がホストコントローラに対して受信確認の応答を返す第14の手順と、
前記第5の手順で前記ホスト側通信装置がデータパケットを前記ホストコントローラに送信した後で、前記ホストコントローラから受信確認の応答を受け取った場合には、送信したデータパケットをメモリから削除する第15の手順と、
前記第1の伝送方向が前記ホストコントローラに入力される方向である場合に、前記ホスト側通信装置のメモリに該当するデータパケットが存在しない場合には、前記ホスト側通信装置が前記ホストコントローラに対して存在しないことを表す応答を送信する第16の手順と、
前記第12の手順で周辺機器側通信装置が周辺機器からのデータパケットを受信した場合には、周辺機器側通信装置が周辺機器に対して受信確認の応答を返す第17の手順と
を更に設けたことを特徴とするUSB通信方法。
The USB communication method according to claim 1,
A fourteenth procedure in which the host-side communication device returns a response of reception confirmation to the host controller when receiving a data packet from the host controller in the third procedure;
After the host-side communication device transmits a data packet to the host controller in the fifth procedure, if a reception confirmation response is received from the host controller, the transmitted data packet is deleted from the memory. Steps and
If the first transmission direction is the direction input to the host controller, and if there is no corresponding data packet in the memory of the host-side communication device, the host-side communication device sends a signal to the host controller. A sixteenth step of transmitting a response indicating that the file does not exist;
And a seventeenth procedure in which the peripheral device-side communication device returns a reception confirmation response to the peripheral device when the peripheral device-side communication device receives a data packet from the peripheral device in the twelfth procedure. A USB communication method.
請求項6のUSB通信方法において、前記ホスト側通信装置及び周辺機器側通信装置は、通信モードがアイソクロナス転送か否かを識別し、その結果に応じて制御の内容を変更することを特徴とするUSB通信方法。7. The USB communication method according to claim 6, wherein the host-side communication device and the peripheral device-side communication device determine whether a communication mode is an isochronous transfer or not, and change control contents according to the result. USB communication method.
JP2003037645A 2003-02-17 2003-02-17 Usb communication method Pending JP2004246750A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003037645A JP2004246750A (en) 2003-02-17 2003-02-17 Usb communication method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003037645A JP2004246750A (en) 2003-02-17 2003-02-17 Usb communication method

Publications (1)

Publication Number Publication Date
JP2004246750A true JP2004246750A (en) 2004-09-02

Family

ID=33022380

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003037645A Pending JP2004246750A (en) 2003-02-17 2003-02-17 Usb communication method

Country Status (1)

Country Link
JP (1) JP2004246750A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009059018A (en) * 2007-08-30 2009-03-19 Seiko Epson Corp Information processing system, information processor and data transfer method for information processing system
WO2009050761A1 (en) * 2007-10-15 2009-04-23 Fujitsu Limited Storage system, storage controller, and method and program for controlling storage system
JP2015528163A (en) * 2012-07-05 2015-09-24 オムロン マネージメント センター オブ アメリカ, インコーポレイテッドOmron Management Center Of America, Inc. Method and apparatus for USB signaling over intermediate transport
WO2023032147A1 (en) * 2021-09-03 2023-03-09 日本電信電話株式会社 Usb transfer system, apparatus, program, and method

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009059018A (en) * 2007-08-30 2009-03-19 Seiko Epson Corp Information processing system, information processor and data transfer method for information processing system
WO2009050761A1 (en) * 2007-10-15 2009-04-23 Fujitsu Limited Storage system, storage controller, and method and program for controlling storage system
JP2015528163A (en) * 2012-07-05 2015-09-24 オムロン マネージメント センター オブ アメリカ, インコーポレイテッドOmron Management Center Of America, Inc. Method and apparatus for USB signaling over intermediate transport
WO2023032147A1 (en) * 2021-09-03 2023-03-09 日本電信電話株式会社 Usb transfer system, apparatus, program, and method

Similar Documents

Publication Publication Date Title
JP3045985B2 (en) Connection establishment method, communication method, state change transmission method, state change execution method, wireless device, wireless device, and computer
US6381666B1 (en) Method and apparatus for extending the range of the universal serial bus protocol
AU2007278728B2 (en) Method and apparatus for distributing usb hub functions across a network
EP1750401B1 (en) USB 1.1 over a high speed link
US7493431B2 (en) Method and apparatus for extending the range of the universal serial bus protocol
US20090063717A1 (en) Rate Adaptation for Support of Full-Speed USB Transactions Over a High-Speed USB Interface
US7117283B2 (en) Multi-master extended I2C protocol
JP4432385B2 (en) Data relay system
WO2003034206B1 (en) Host network interface device and drive network interface device
JP2007088775A (en) Radio communication system, device, and method
EP1516261B1 (en) Bus system, station for use in a bus system, and bus interface
US20130332504A1 (en) Station, target apparatus, initiator apparatus, communication system, and communication method
EP2685385A1 (en) Network system
JPH10308791A (en) Method and equipment for data communication and data communication program recording medium
CN100391150C (en) Data transfer device and data transfer method of virtual ether net device
JP2004246750A (en) Usb communication method
JP2006120115A (en) Information device and control method for the same
US9619005B2 (en) Apparatus and method for saving power of USB device
JP2006243866A (en) Communication system
WO2012019376A1 (en) Method and apparatus for implementing network device function of wireless communication terminal
CA2269961C (en) Method and apparatus for extending the range of the universal serial bus protocol as it applies to asynchronous transfers
JP2002290442A (en) Communication device, program, information recording medium, and communication control method
JP2948380B2 (en) Data communication device
JP3915313B2 (en) LAN communication system in PLC
CN115037795A (en) Multi-machine communication method for embedded equipment

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050201

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070720

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070814

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20080115