JP2005107677A - Communication controller, communication system, communication apparatus, and communication method - Google Patents

Communication controller, communication system, communication apparatus, and communication method Download PDF

Info

Publication number
JP2005107677A
JP2005107677A JP2003337797A JP2003337797A JP2005107677A JP 2005107677 A JP2005107677 A JP 2005107677A JP 2003337797 A JP2003337797 A JP 2003337797A JP 2003337797 A JP2003337797 A JP 2003337797A JP 2005107677 A JP2005107677 A JP 2005107677A
Authority
JP
Japan
Prior art keywords
packet
data packet
host
function
communication
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
JP2003337797A
Other languages
Japanese (ja)
Inventor
Fumihiro Fukae
文博 深江
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.)
Sharp Corp
Original Assignee
Sharp 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 Sharp Corp filed Critical Sharp Corp
Priority to JP2003337797A priority Critical patent/JP2005107677A/en
Priority to TW093129262A priority patent/TWI296083B/en
Priority to CNB2004100120211A priority patent/CN100366029C/en
Priority to US10/950,563 priority patent/US7461318B2/en
Publication of JP2005107677A publication Critical patent/JP2005107677A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Transfer Systems (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To realize a send and receive system capable of carrying out data transfer by IN transaction of a USB2.0 without problems, even when a channel with a transfer rate that is slower, in comparison with the native speed of the USB2.0 is used between a host and a function. <P>SOLUTION: In a host side controller 100, when reception of an IN packet from a USB host is confirmed, the IN packet is transferred to a function-side controller 110, and a DATA packet is received from the function side. The received DATA packet is temporarily stored in a FIFO 108, and when an IN packet is received from the USB host again, the DATA packet stored in the FIFO 108 is sent to the USB host. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、USB規格におけるUSB信号の伝送を行う通信コントローラに関するものである。   The present invention relates to a communication controller that transmits USB signals in the USB standard.

ユニバーサルシリアルバス(Universal Serial Bus:以下USB)は、パーソナルコンピュータ等において、周辺装置の拡張性の自由度を高めるために開発されたインタフェース仕様であり、様々なUSB対応デバイスとの通信に共通に使用できるシリアルインタフェース規格である。   Universal Serial Bus (hereinafter referred to as USB) is an interface specification developed to increase the degree of freedom of expandability of peripheral devices in personal computers, etc., and is commonly used for communication with various USB compatible devices. It is a serial interface standard that can be used.

このUSBは、原理上、1つのシステムの中で、1台のホストと最大127台までのデバイスを同一バス上に接続できる。これらの接続は、物理的にはツリー型のネットワーク構造のバスであり、論理的にはUSBホストのクライアントソフトウェアとUSBファンクションのクライアントソフトウェアとが1対1で通信する。このような接続形態を維持するために、最下層のプロトコルは時分割で通信し、ホストがスケジューリングを行う。USB1.xでは、ロースピードモード(以下LS)において1.5Mbps、また、フルスピードモード(以下FS)において12Mbpsと2つのデータ転送速度が規定されている。   In principle, this USB can connect one host and up to 127 devices on the same bus in one system. These connections are physically a bus having a tree-type network structure, and logically, client software of the USB host and client software of the USB function communicate on a one-to-one basis. In order to maintain such a connection form, the lowest layer protocol communicates in a time division manner, and the host performs scheduling. In USB 1.x, two data transfer rates of 1.5 Mbps in the low speed mode (hereinafter LS) and 12 Mbps in the full speed mode (hereinafter FS) are defined.

近年、ハードディスク、DVDなどの高速データ転送が必要なアプリケーションにUSBが採用されるようになり、前記転送速度では不十分となってきていた。そこで、USB2.0という新しい規格が策定され、USB2.0規格では、ハイスピードモード(以下HS)において、480Mbpsと非常に高速なデータ転送速度が追加された。   In recent years, USB has been adopted for applications that require high-speed data transfer such as hard disks and DVDs, and the transfer speed has been insufficient. Therefore, a new standard called USB 2.0 was established, and in the USB 2.0 standard, a very high data transfer speed of 480 Mbps was added in the high speed mode (hereinafter referred to as HS).

USB上のデータ通信は、トランザクションと呼ばれる単位で行われる。このトランザクションは、トークンパケット、データパケット、そしてハンドシェイクパケットと呼ばれるパケットで構成されている。ホストがトランザクション開始時に発行するトークンパケットで必ず始まり、トークンパケットに含まれるアドレス及びエンドポイントにより、対応するファンクションが応答する。   Data communication on the USB is performed in units called transactions. This transaction consists of a packet called a token packet, a data packet, and a handshake packet. It always starts with a token packet issued by the host at the start of the transaction, and the corresponding function responds with the address and endpoint contained in the token packet.

エンドポイントとは、転送データを格納するためのFIFOバッファのことであり、USBホストとUSBファンクションとのデータのやりとりは、かならずエンドポイントを介して実行される。USBファンクションは、最大16個のエンドポイントを持つことができ、複数のエンドポイントを認識するために、エンドポイントには番号がつけられる。USBホストはデータ転送の際にUSBファンクションのUSBアドレスとエンドポイントとによりアクセスを行う。エンドポイントの中で0番のものは、エンドポイント0と呼ばれ、USBファンクションに必ず1つ存在しなければならない。このエンドポイント0は、コントロール転送時にSETUPパケットによって行われる初期化時に用いられる。   The end point is a FIFO buffer for storing transfer data, and data exchange between the USB host and the USB function is always executed via the end point. A USB function can have up to 16 endpoints, and the endpoints are numbered to recognize multiple endpoints. The USB host performs access using the USB address and end point of the USB function during data transfer. The end point number 0 is called the end point 0 and must always exist in the USB function. This endpoint 0 is used at the time of initialization performed by the SETUP packet at the time of control transfer.

USBパケットの種別としては、図21に示すように、トークンパケット、データパケット、ハンドシェイクパケット、及び特殊(スペシャル)パケットがある。トークンパケットには、INパケット、OUTパケット、SETUPパケット、SOFパケットがある。それぞれのパケットは、図21に示す目的で用いられる。データパケットには、DATA0パケット、DATA1パケットなどがある。ハンドシェイクパケットには、ACKパケット、NAKパケット、STALLパケット、NYETパケットがある。また、特殊パケットとして、PINGパケットなどがある。   As types of USB packets, there are a token packet, a data packet, a handshake packet, and a special packet as shown in FIG. Token packets include IN packets, OUT packets, SETUP packets, and SOF packets. Each packet is used for the purpose shown in FIG. Data packets include a DATA0 packet and a DATA1 packet. Handshake packets include ACK packets, NAK packets, STALL packets, and NYET packets. Further, as a special packet, there is a PING packet or the like.

USBのパケットフォーマットを図22に示す。PIDはパケットの識別子であり8ビットで構成される。また、トークンパケットにはCRC5、データパケットにはCRC16がそれぞれ付加されており、パケットを受信した際に前記CRCをチェックすることで、パケットの中身が正しいかどうかを判別することが可能となる。   The USB packet format is shown in FIG. PID is an identifier of a packet and is composed of 8 bits. Further, CRC5 is added to the token packet and CRC16 is added to the data packet, respectively, and it is possible to determine whether or not the contents of the packet are correct by checking the CRC when the packet is received.

SOFパケットは、ホストが発行するフレームの始まりを示すパケットである。SOFパケットは、LS、FSモードでは1ms周期で、またHSモードでは、125us周期でホストから発行される。   The SOF packet is a packet indicating the start of a frame issued by the host. The SOF packet is issued from the host at a 1 ms cycle in the LS and FS modes and at a 125 us cycle in the HS mode.

〔INトランザクション〕
USB2.0規格におけるUSBホストがUSBファンクションからデータを読み出す方法として、INトランザクションがある。以下に図23を用いてINトランザクションを説明する。
[IN transaction]
An IN transaction is a method by which a USB host in the USB 2.0 standard reads data from a USB function. The IN transaction will be described below with reference to FIG.

まず、タイミングt2201において、USBホストからUSBファンクションに向けてINパケットが送信される。前記INパケットを受信したUSBファンクションは、その時点で転送すべきデータがないため、その旨を通知するNAKパケットをt2202においてUSBホストに向けて送信する。USBホストは、前記NAKパケットを受信するとUSBファンクションには送信すべきデータが無いことを認識し、次の送信タイミングt2203に再びINパケットをUSBファンクションに送信する。これを受信したUSBファンクションでは、この時は転送すべきデータが存在するため、t2204のタイミングでUSBホストに向けてDATAパケットを送信する。USBホストが予め定められた時間以内に、前記DATAパケットを誤り無く受信すると、t2205のタイミングで正常に受信したことを示すACKパケットをUSBファンクションに向けて送信する。   First, at timing t2201, an IN packet is transmitted from the USB host toward the USB function. The USB function that has received the IN packet does not have data to transfer at that time, and therefore transmits a NAK packet to that effect to the USB host at t2202. Upon receiving the NAK packet, the USB host recognizes that there is no data to be transmitted in the USB function, and transmits the IN packet to the USB function again at the next transmission timing t2203. In the USB function that has received this, since there is data to be transferred at this time, a DATA packet is transmitted to the USB host at the timing of t2204. When the USB host receives the DATA packet without error within a predetermined time, it transmits an ACK packet indicating that it has been received normally at the timing of t2205 toward the USB function.

前記DATAパケットにはCRC16の符号が付加されているため、データ受信側はこのCRCをチェックすることで、受信データに誤りがあるかどうかを判別することができる。CRC16の判別によりデータに誤りがあると判別された場合は、USBホストはUSBファンクションに向けてなにもパケットを返さない。つまり、USBファンクションは、前記ACKパケットを受信することで、USBホストに対して正常にデータが転送できたことを認識することができる。USBファンクションは、USBホストからのACKパケットを予め定められた時間内に受信できない場合は、USBホストに正常にデータ転送が行えなかったことを認識し、INトランザクションが失敗に終わったと認識する。   Since a CRC16 code is added to the DATA packet, the data receiving side can check whether there is an error in the received data by checking the CRC. If the CRC 16 determines that there is an error in the data, the USB host does not return any packet to the USB function. That is, the USB function can recognize that data has been transferred normally to the USB host by receiving the ACK packet. If the USB function cannot receive the ACK packet from the USB host within a predetermined time, the USB function recognizes that data transfer to the USB host has not been performed normally, and recognizes that the IN transaction has failed.

前記の方法により、INトランザクションが行われ、USBホストはUSBファンクションからデータの読み出しを行うことが可能となる。   By the above method, an IN transaction is performed, and the USB host can read data from the USB function.

〔USBの時間的制約〕
USB2.0規格では、データ信号の伝播時間に制約が存在する。
[USB time constraints]
In the USB 2.0 standard, there is a restriction on the propagation time of the data signal.

LS及びFSモードでは、USBホストからUSBファンクションまでのターンアラウンドタイムは16ビットタイム(1333ns)以下でなければならない。つまり、USBホストがUSBファンクションに向けて送信したパケットに対するUSBファンクションからの返答パケットが、前記1333ns以内にUSBホストに届かない場合、USBホストはUSBファンクションに送信したパケットは正常にUSBファンクションに届かなかったとみなし、前記パケットを再送する。   In the LS and FS modes, the turnaround time from the USB host to the USB function must be 16 bits time (1333 ns) or less. In other words, if the response packet from the USB function to the packet sent from the USB host to the USB function does not reach the USB host within 1333 ns, the USB host does not normally send the packet sent to the USB function to the USB function. The packet is retransmitted.

また、HSモードでは、USBホストからUSBファンクションまでのターンアラウンドタイムは721ビットタイム(1502ns)以下でなければならない。USBホストがUSBファンクションに向けて送信したパケットに対するUSBファンクションからの返答パケットが、前記1502ns以内にUSBホストに届かない場合、USBホストはUSBファンクションに送信したパケットは正常にUSBファンクションに届かなかったとみなし、前記パケットを再送する。   In the HS mode, the turnaround time from the USB host to the USB function must be 721 bit times (1502 ns) or less. If the response packet from the USB function to the packet sent by the USB host to the USB function does not reach the USB host within the 1502 ns, the USB host considers that the packet sent to the USB function has not normally reached the USB function. , Resend the packet.

前記INトランザクションにおいて、USBホストがINパケット送信後に待つ予め定められた時間、およびUSBファンクションがDATAパケット送信後に待つ予め定められた時間は、USBの時間制約として定められているLS、FSモードにおける1333nsおよびHSモードにおける1502nsである。各転送モードにおいて、前記の制約時間以内に前記DATAパケットもしくは、ACKパケットを受信できなければ、INトランザクションは正常終了しない。
特開2000−284872号公報(公開日平成12年10月13日)
In the IN transaction, the predetermined time that the USB host waits after transmitting the IN packet and the predetermined time that the USB function waits after transmitting the DATA packet are 1333 ns in the LS and FS modes defined as USB time constraints. And 1502 ns in the HS mode. In each transfer mode, if the DATA packet or the ACK packet cannot be received within the restricted time, the IN transaction does not end normally.
JP 2000-284872 A (publication date October 13, 2000)

近年、デジタルカメラ、PDA(Personal Digital Assistants)などにUSBが搭載されるようになってきている。これらのモバイル機器におけるデータ伝送手段では、クレイドル方式が多く用いられており、クレイドルについたUSBコネクタと前記モバイル機器のUSBコネクタを接続することでUSB伝送を可能としている。これらのコネクタは物理的な接点を持つため、コネクタの抜き差しによりコネクタの劣化が進み、品質の高いデータ転送が困難になる可能性がある。   In recent years, USB has been installed in digital cameras, PDAs (Personal Digital Assistants), and the like. The data transmission means in these mobile devices often use the cradle method, and USB transmission is possible by connecting the USB connector attached to the cradle and the USB connector of the mobile device. Since these connectors have physical contacts, there is a possibility that the deterioration of the connectors will progress due to the insertion / removal of the connectors, and high-quality data transfer will be difficult.

前記の物理的な接点をなくす方法として、光を用いた空間伝送を行う方法があるが、USB2.0の480Mbpsをそのまま空間伝送するためには、光学系及び受信部でのCDR(Clock Data Recovery)などに高い性能が必要となり、コスト増へとつながる。前記光学系及び受信部でのCDRのコストを抑えるためには、より低速な転送速度でUSB2.0のデータ転送を行うことが考えられるが、その場合は以下のような問題がある。   As a method of eliminating the physical contact, there is a method of performing spatial transmission using light. In order to perform spatial transmission of 480 Mbps of USB 2.0 as it is, CDR (Clock Data Recovery) in the optical system and the receiving unit is used. ), Etc., require high performance, leading to increased costs. In order to reduce the cost of CDR in the optical system and the receiving unit, it is conceivable to perform USB 2.0 data transfer at a lower transfer speed, but in this case, there are the following problems.

図24に光通信路の転送速度をたとえば100Mbpsと、USB2.0のネイティブ速度480Mbpsよりも遅い転送速度にした場合のINトランザクションの様子を示す。   FIG. 24 shows the state of an IN transaction when the transfer speed of the optical communication path is, for example, 100 Mbps and a transfer speed slower than the native speed 480 Mbps of USB 2.0.

USBホストにより、タイミングt2301に送信されたINパケットは、ホスト側コントローラにより光信号に変換され、ファンクション側コントローラに送信される。ファンクション側コントローラは受信した光信号から、USBパケットを抽出し、USBファンクションに送信する。ここで、ファンクション側コントローラがUSBファンクションに送信を開始するタイミングがt2302であるのは、USBファンクションに対する送信ではUSBネイティブの480Mbpsでの転送が行われるためである。   The IN packet transmitted by the USB host at timing t2301 is converted into an optical signal by the host-side controller and transmitted to the function-side controller. The function-side controller extracts the USB packet from the received optical signal and transmits it to the USB function. Here, the timing at which the function-side controller starts transmission to the USB function is t2302, because USB native 480 Mbps transfer is performed for transmission to the USB function.

t2303でUSBファンクションがINパケットの受信を完了すると、t2304においてUSBホストに向けてDATAパケットを送信する。ファンクション側コントローラは、USBファンクションからのDATAパケットを光信号に変換し、ホスト側コントローラに送信する。ホスト側コントローラは、ファンクション側コントローラと同様にDATAパケットの受信完了を待ってから、t2305にUSBホストに向かってDATAパケットを送信する。USBホストはt2306に初めてUSBファンクションからのDATAパケットを受信することが可能となる。   When the USB function completes receiving the IN packet at t2303, the DATA packet is transmitted to the USB host at t2304. The function-side controller converts the DATA packet from the USB function into an optical signal and transmits it to the host-side controller. The host-side controller waits for the completion of the reception of the DATA packet in the same manner as the function-side controller, and then transmits the DATA packet toward the USB host at t2305. The USB host can receive the DATA packet from the USB function for the first time at t2306.

ここで、ホスト−ファンクション間でのデータ転送速度がUSB2.0のネイティブ速度と比べて遅い場合(特に、DATAパケット長が長い場合)、t2301からt2306までの時間(ターンアラウンドタイム)が長くなるため、最大ターンアラウンドタイム(HSモードにおける1502ns)を超えてしまうこととなり、INトランザクションが正常に終了しないこととなる。   Here, when the data transfer speed between the host and the function is slower than the native speed of USB 2.0 (particularly when the DATA packet length is long), the time from t2301 to t2306 (turnaround time) becomes long. The maximum turnaround time (1502 ns in the HS mode) will be exceeded, and the IN transaction will not end normally.

本発明は、上記の問題点に鑑みてなされたものであり、その目的は、ホスト−ファンクション間でUSB2.0のネイティブ速度と比べて転送速度が低い通信路(例えば100Mbpsの光通信路)を用いた場合でも、USB2.0のINトランザクションによるデータ転送を問題なく行える送受信回路を実現することにある。   The present invention has been made in view of the above-described problems, and an object of the present invention is to provide a communication path (for example, an optical communication path of 100 Mbps) having a lower transfer speed than the native speed of USB 2.0 between the host and the function. Even when it is used, it is to realize a transmission / reception circuit capable of performing data transfer by USB 2.0 IN transaction without any problem.

本発明に係る通信コントローラは、上記課題を解決するために、USB上のデータ通信としてINトランザクションを行う際に、ホスト装置から送信されるINパケットをファンクション装置側に転送し、該INパケットに対する返答となるDATAパケットをホスト装置に転送するホスト側コントローラとして機能する通信コントローラであって、ホスト装置からのINパケットの受信を確認する受信確認手段と、ファンクション装置側から送信されてくるDATAパケットを格納する格納手段と、上記受信認識手段によりホスト装置からのINパケット受信が確認された時点で、上記格納手段にDATAパケットが格納されているか否かを確認するデータ格納確認手段と、上記データ格納確認手段により上記DATAパケットが格納されていないことが確認された時には、ホスト装置から受信したINパケットをファンクション装置側に転送し、上記データ格納確認手段により上記DATAパケットが格納されていることが確認された時には、ホスト装置に上記DATAパケットを送信する送信制御手段とを備えていることを特徴としている。   In order to solve the above-described problem, the communication controller according to the present invention transfers an IN packet transmitted from the host device to the function device when performing an IN transaction as data communication on the USB, and responds to the IN packet. Is a communication controller that functions as a host-side controller that transfers the DATA packet to the host device, and stores reception confirmation means for confirming reception of the IN packet from the host device, and stores the DATA packet transmitted from the function device side Storage means for confirming reception of an IN packet from the host device by the reception recognition means, data storage confirmation means for confirming whether a DATA packet is stored in the storage means, and the data storage confirmation Means to store the above DATA packet. When it is confirmed that the data packet is not received, the IN packet received from the host device is transferred to the function device side. When the data storage confirmation means confirms that the DATA packet is stored, the DATA packet is transmitted to the host device. And a transmission control means for transmitting.

また、上記通信コントローラは、ホスト装置側から送信されるUSB規格のINパケットをファンクション装置に転送し、該INパケットに対する返答となるDATAパケットをホスト装置側に転送するファンクション側コントローラとしても機能するものであり、ホスト装置側からINパケットを受信した時にはこれを保持し、ホスト装置側に送信したDATAパケットに対するACKパケットをホスト装置側から受信した場合には、USBファンクションに上記保持していたINパケットを送信し、該INパケットに対するDATAパケットをファンクション装置から受信した時点でACKパケットをファンクション装置に送信することを特徴としている。   The communication controller also functions as a function-side controller that transfers a USB standard IN packet transmitted from the host device side to the function device and forwards a DATA packet as a response to the IN packet to the host device side. When an IN packet is received from the host device side, the IN packet is retained. When an ACK packet for the DATA packet transmitted to the host device side is received from the host device side, the IN packet held in the USB function is retained. And when the DATA packet corresponding to the IN packet is received from the function device, an ACK packet is transmitted to the function device.

また、上記通信コントローラは、ホスト装置からのINパケットの受信およびホスト装置へのDATAパケットの送信に係る転送速度がUSB規格に定められた転送速度であり、INパケットのファンクション装置側への送信およびファンクション装置側からのDATAパケットの受信に係る転送速度がUSB規格に定められた転送速度よりも低く、さらに、ファンクション装置側から受信したDATAパケットを上記格納手段に格納する際の格納データ量を確認するデータ量確認手段を有し、上記送信制御手段は、上記データ量確認手段によって確認された受信データ量が予め定められた値よりも多くなった時点で、ホスト装置へのDATAパケットの送信を開始することを特徴としている。   In the communication controller, the transfer rate related to the reception of the IN packet from the host device and the transmission of the DATA packet to the host device is the transfer rate defined in the USB standard, and the transmission of the IN packet to the function device side and The transfer rate for receiving DATA packets from the function device side is lower than the transfer rate stipulated in the USB standard, and the amount of data stored when storing the DATA packets received from the function device side in the storage means is confirmed. A data amount confirming unit configured to transmit the DATA packet to the host device when the received data amount confirmed by the data amount confirming unit exceeds a predetermined value. It is characterized by starting.

また、上記通信コントローラは、ファンクション装置側から受信したDATAパケットが誤りを含むものであるか否かを解析する誤り解析手段を有し、上記送信制御手段は、上記誤り解析手段により、受信したDATAパケットが誤っていると判断される場合、該DATAパケットを破棄し、ホスト装置に転送しないことを特徴としている。   The communication controller has error analysis means for analyzing whether or not the DATA packet received from the function device side contains an error. The transmission control means uses the error analysis means to receive the received DATA packet. If it is determined that the data packet is incorrect, the DATA packet is discarded and not transferred to the host device.

また、上記通信コントローラは、ファンクション装置側から受信したDATAパケットが誤りを含むものであるか否かを解析する誤り解析手段を有し、上記送信制御手段は、上記誤り解析手段により、受信したDATAパケットが誤っていると判断された場合、ホスト装置へのDATAパケットの送信をその時点で中止することを特徴としている。   The communication controller has error analysis means for analyzing whether or not the DATA packet received from the function device side contains an error. The transmission control means uses the error analysis means to receive the received DATA packet. If it is determined that the data is wrong, the transmission of the DATA packet to the host device is stopped at that time.

また、上記通信コントローラは、上記受信確認手段は、ホスト装置にDATAパケットを送信した後、該DATAパケット対するACKパケットがホスト装置から返ってきたか否かを確認し、上記送信制御手段は、ホスト装置にDATAパケットを送信した後、上記受信確認手段によるACKパケットの受信が確認されずに、次のINパケットの受信が確認された場合には、前回ホスト装置に送信したDATAパケットと同じDATAパケットをホスト装置に送信する再送処理を行うことを特徴としている。   In the communication controller, the reception confirmation unit transmits a DATA packet to the host device, and then confirms whether or not an ACK packet for the DATA packet is returned from the host device. If the reception of the next IN packet is confirmed without confirming the reception of the ACK packet by the reception confirmation means after the DATA packet is transmitted to the host device, the same DATA packet as the DATA packet transmitted to the previous host device is transmitted. It is characterized by performing retransmission processing to be transmitted to the host device.

また、上記通信コントローラは、ファンクション装置側から受信したDATAパケットが誤りを含むものであるか否かを解析する誤り解析手段を有し、上記送信制御手段は、上記再送処理を、上記誤り解析手段により自機器が保有しているDATAパケットに誤りがないと確認された場合のみ行うことを特徴としている。   Further, the communication controller has error analysis means for analyzing whether or not the DATA packet received from the function device side contains an error, and the transmission control means performs the retransmission processing by the error analysis means. It is characterized in that it is performed only when it is confirmed that there is no error in the DATA packet held by the device.

また、上記通信コントローラは、ファンクション装置側から受信したDATAパケットが誤りを含むものであるか否かを解析する誤り解析手段と、上記誤り解析手段により、受信したDATAパケットが誤っていると判断された場合、ファンクション装置側にDATAパケットの再送要求を行う再送要求手段とを有していることを特徴としている。   In addition, the communication controller is configured to analyze whether or not the DATA packet received from the function device side includes an error, and when the received DATA packet is determined to be incorrect by the error analysis unit. The function device side has a retransmission request means for requesting retransmission of the DATA packet.

また、上記通信コントローラは、ホスト装置側から送信されるUSB規格のINパケットをファンクション装置に転送し、該INパケットに対する返答となるDATAパケットをホスト装置側に転送するファンクション側コントローラとしても機能するものであり、ホスト側コントローラから再送要求を受信した場合には、前回ホスト側コントローラに送信したDATAパケットと同じDATAパケットをホスト側コントローラに送信する再送処理を行うことを特徴としている。   The communication controller also functions as a function-side controller that transfers a USB standard IN packet transmitted from the host device side to the function device and forwards a DATA packet as a response to the IN packet to the host device side. When a retransmission request is received from the host-side controller, a retransmission process for transmitting the same DATA packet as the DATA packet transmitted to the host-side controller to the host-side controller is performed.

また、上記通信コントローラは、ファンクション装置から受信したDATAパケットが誤りを含むものであるか否かを解析する誤り解析手段を有し、上記送信制御手段は、上記再送処理を、上記誤り解析手段により自機器が保有しているDATAパケットに誤りがないと確認された場合のみ行うことを特徴としている。   Further, the communication controller has error analysis means for analyzing whether or not the DATA packet received from the function device includes an error, and the transmission control means performs the retransmission processing by using the error analysis means. This is performed only when it is confirmed that there is no error in the DATA packet held by.

また、上記通信コントローラは、上記誤り解析手段により自機器が保有しているDATAパケットに誤りがないと確認された場合、ホスト装置へ送信するDATAパケットのパケットフォーマット中に、該DATAパケットには誤りが無いことを示すフラグを立てることを特徴としている。   In addition, the communication controller, when it is confirmed by the error analysis means that there is no error in the DATA packet held by the device, an error is detected in the DATA packet during the packet format of the DATA packet transmitted to the host device. It is characterized by setting a flag indicating that there is no.

また、上記通信コントローラは、ファンクション側コントローラからDATAパケットを受信し、該DATAパケットにおいて誤りのあることが上記誤り解析手段により検出された場合、該DATAパケットに立てられたフラグにより、ファンクション装置側で誤りの無いDATAパケットが保有されていることが確認された場合のみ上記再送要求を行うことを特徴としている。   Further, the communication controller receives a DATA packet from the function side controller, and when the error analyzing means detects that there is an error in the DATA packet, the function controller side uses the flag set in the DATA packet. The retransmission request is made only when it is confirmed that an error-free DATA packet is held.

また、上記通信コントローラは、ホスト装置側から送信されるUSB規格のINパケットをファンクション装置に転送し、該INパケットに対する返答となるDATAパケットをホスト装置側に転送するファンクション側コントローラとしても機能するものであり、ホスト側コントローラから再送要求を受信した場合には、ファンクション装置に対してINパケットを送信し、それに対して受信したDATAパケットをホスト側コントローラに送信することを特徴としている。   The communication controller also functions as a function-side controller that transfers a USB standard IN packet transmitted from the host device side to the function device and forwards a DATA packet as a response to the IN packet to the host device side. When a retransmission request is received from the host-side controller, an IN packet is transmitted to the function device, and the received DATA packet is transmitted to the host-side controller.

また、上記通信コントローラは、上記INトランザクションの実行前に、通信相手側の通信コントローラと転送速度調整を行うことを特徴としている。   In addition, the communication controller adjusts the transfer rate with the communication controller on the communication partner side before executing the IN transaction.

また、上記通信コントローラは、上記転送速度調整において、USB規格に定められた転送速度で通信が可能であると判断される場合は、通信相手側の通信コントローラに送信される各パケットは、パケットの送信タイミング制御を行わずに、変復調のみを行って相手側の通信コントローラへの転送を行うことを特徴としている。   In addition, when the communication controller determines that communication can be performed at the transfer speed defined in the USB standard in the transfer speed adjustment, each packet transmitted to the communication controller on the communication partner side is It is characterized in that, without performing transmission timing control, only modulation / demodulation is performed and transfer to the communication controller on the other side is performed.

また、上記通信コントローラは、通信相手側の通信コントローラとの間での通信路におけるエラーレートを解析し、該エラーレートが予め定められたエラーレートよりも悪いと判断される場合、上記転送速度調整を行って転送速度を下げることを特徴としている。   The communication controller analyzes the error rate in the communication path with the communication controller on the communication partner side, and determines that the error rate is worse than a predetermined error rate, the transfer rate adjustment To reduce the transfer speed.

また、上記通信コントローラは、通信相手側の通信コントローラとの間で、全二重通信を行うことを特徴としている。   The communication controller performs full duplex communication with a communication controller on the communication partner side.

また、上記通信コントローラは、通信相手側の通信コントローラとの間の通信が、光ファイバを用いた通信路によって行われるものであることを特徴としている。   Further, the communication controller is characterized in that communication with the communication controller on the communication partner side is performed by a communication path using an optical fiber.

また、上記通信コントローラは、通信相手側の通信コントローラとの間の通信が、電波を用いた無線によって行われるものであることを特徴としている。   The communication controller is characterized in that communication with the communication controller on the communication partner side is performed by radio using radio waves.

また、上記通信コントローラは、通信相手側の通信コントローラとの間の通信が、光を用いた空間伝送によって行われるものであることを特徴としている。   Further, the communication controller is characterized in that communication with the communication controller on the communication partner side is performed by spatial transmission using light.

また、本発明に係る他の通信コントローラは、上記課題を解決するために、USB上のデータ通信としてINトランザクションを行う際に、ホスト装置側から送信されるUSB規格のINパケットをファンクション装置に転送し、該INパケットに対する返答となるDATAパケットをホスト装置側に転送するファンクション側コントローラとして機能する通信コントローラであって、ホスト装置側からINパケットを受信した時にはこれを保持し、ホスト装置側に送信したDATAパケットに対するACKパケットをホスト装置側から受信した場合には、USBファンクションに上記保持していたINパケットを送信し、該INパケットに対するDATAパケットをファンクション装置から受信した時点でACKパケットをファンクション装置に送信することを特徴としている。   In order to solve the above problems, another communication controller according to the present invention transfers a USB standard IN packet transmitted from the host device side to the function device when performing an IN transaction as data communication on the USB. A communication controller that functions as a function-side controller that transfers a DATA packet that is a response to the IN packet to the host device side. When the IN packet is received from the host device side, it is held and transmitted to the host device side. When the host device receives an ACK packet for the received DATA packet, the IN packet held above is transmitted to the USB function, and when the DATA packet for the IN packet is received from the function device, the ACK packet is It is characterized by transmitting to the location.

また、本発明に係るさらに他の通信コントローラは、上記課題を解決するために、USB上のデータ通信としてINトランザクションを行う際に、ホスト装置側から送信されるUSB規格のINパケットをファンクション装置に転送し、該INパケットに対する返答となるDATAパケットをホスト装置側に転送するファンクション側コントローラとして機能する通信コントローラであって、ホスト側コントローラから再送要求を受信した場合には、前回ホスト側コントローラに送信したDATAパケットと同じDATAパケットをホスト側コントローラに送信する再送処理を行うことを特徴としている。   In order to solve the above-described problem, another communication controller according to the present invention transmits a USB standard IN packet transmitted from the host device side to the function device when performing an IN transaction as data communication on the USB. A communication controller that functions as a function-side controller that forwards and transfers a DATA packet that is a response to the IN packet to the host device side. When a retransmission request is received from the host-side controller, it is sent to the previous host-side controller. A retransmission process is performed in which the same DATA packet as the transmitted DATA packet is transmitted to the host-side controller.

また、上記通信コントローラは、ファンクション装置から受信したDATAパケットが誤りを含むものであるか否かを解析し、上記再送処理を、上記解析により自機器が保有しているDATAパケットに誤りがないと確認された場合のみ行うことを特徴としている。   Further, the communication controller analyzes whether or not the DATA packet received from the function device includes an error, and confirms that the retransmission process is performed by the above analysis and that the DATA packet held by the own device is correct. It is characterized by being performed only in the case of.

また、上記通信コントローラは、上記解析により自機器が保有しているDATAパケットに誤りがないと確認された場合、ホスト装置へ送信するDATAパケットのパケットフォーマット中に、該DATAパケットには誤りが無いことを示すフラグを立てることを特徴としている。   In addition, when the communication controller confirms that there is no error in the DATA packet held by the device, the communication controller has no error in the DATA packet during the packet format of the DATA packet transmitted to the host device. It is characterized by setting a flag indicating that.

また、本発明に係るさらに他の通信コントローラは、上記課題を解決するために、USB上のデータ通信としてINトランザクションを行う際に、ホスト装置側から送信されるUSB規格のINパケットをファンクション装置に転送し、該INパケットに対する返答となるDATAパケットをホスト装置側に転送するファンクション側コントローラとして機能する通信コントローラであって、ホスト側コントローラから再送要求を受信した場合には、ファンクション装置に対してINパケットを送信し、それに対して受信したDATAパケットをホスト側コントローラに送信することを特徴としている。   In order to solve the above-described problem, another communication controller according to the present invention transmits a USB standard IN packet transmitted from the host device side to the function device when performing an IN transaction as data communication on the USB. A communication controller that functions as a function-side controller that forwards and transfers a DATA packet that is a response to the IN packet to the host device side. When a retransmission request is received from the host-side controller, the communication device It is characterized by transmitting a packet and transmitting the received DATA packet to the host-side controller.

また、本発明に係る通信システムは、上記課題を解決するために、上記記載のホスト側コントローラとして機能する通信コントローラと、ホスト装置側から送信されるUSB規格のINパケットをファンクション装置に転送し、該INパケットに対する返答となるDATAパケットをホスト装置側に転送するファンクション側コントローラとして機能する通信コントローラとを備えたことを特徴としている。   In order to solve the above problems, the communication system according to the present invention transfers the USB controller IN packet transmitted from the host device side to the function device and the communication controller functioning as the host side controller described above, And a communication controller functioning as a function-side controller for transferring a DATA packet as a response to the IN packet to the host device side.

また、本発明に係る通信機器は、上記課題を解決するために、上記記載の通信コントローラを備えたことを特徴としている。   In addition, a communication device according to the present invention includes the communication controller described above in order to solve the above-described problem.

また、本発明に係る通信方法は、上記課題を解決するために、ホスト装置からのINパケットの受信を確認すると、その時点で該INパケットに対する返答となるDATAパケットを受信しているか否かを確認し、上記DATAパケットを受信している場合には、受信した上記INパケットに対して該DATAパケットをホスト装置に送信し、上記DATAパケットを受信していない場合には、受信した上記INパケットをファンクション装置側に転送するとともに、ホスト装置へNAKパケットを送信することを特徴としている。   In addition, in order to solve the above-described problem, the communication method according to the present invention confirms whether an IN packet is received from the host device, and determines whether or not a DATA packet that is a response to the IN packet is received at that time. If the DATA packet is received, the DATA packet is transmitted to the host device in response to the received IN packet. If the DATA packet is not received, the received IN packet Is transmitted to the function device side, and a NAK packet is transmitted to the host device.

本発明に係る通信コントローラは、以上のように、ホスト装置からのINパケットの受信を確認する受信確認手段と、ファンクション装置側から送信されてくるDATAパケットを格納する格納手段と、上記受信認識手段によりホスト装置からのINパケット受信が確認された時点で、上記格納手段にDATAパケットが格納されているか否かを確認するデータ格納確認手段と、上記データ格納確認手段により上記DATAパケットが格納されていないことが確認された時には、ホスト装置から受信したINパケットをファンクション装置側に転送し、上記データ格納確認手段により上記DATAパケットが格納されていることが確認された時には、ホスト装置に上記DATAパケットを送信する送信制御手段とを備えているので、最初にホスト装置から受信したINパケットの応答としてファンクション装置側から送信されてくるDATAパケットを格納手段に格納しておき、ホスト装置からINパケットが再送されてきた時に、格納手段にて格納されているDATAパケットをホスト装置に送信する。それゆえ、ホスト装置から再送されてきたINパケットに対して、DATAパケットをファンクション装置側から再度送信してもらう必要が無く、ホスト−ファンクション間の転送速度が低速であったり、ホスト−ファンクション間の転送経路が長い場合であっても、USB伝送で規定される制約時間内にINトランザクションの処理を終了することができるという効果を奏する。   As described above, the communication controller according to the present invention includes a reception confirmation unit that confirms reception of an IN packet from a host device, a storage unit that stores a DATA packet transmitted from the function device side, and the reception recognition unit. When the reception of the IN packet from the host device is confirmed by the above, the data storage confirmation means for confirming whether or not the DATA packet is stored in the storage means, and the DATA packet is stored by the data storage confirmation means. When it is confirmed that there is no data, the IN packet received from the host device is transferred to the function device side. When the data storage confirmation means confirms that the DATA packet is stored, the host device receives the DATA packet. Transmission control means for transmitting The DATA packet transmitted from the function device as a response to the IN packet received from the host device is stored in the storage means, and the DATA stored in the storage means when the IN packet is retransmitted from the host device. Send the packet to the host device. Therefore, there is no need to have the DATA device send the DATA packet again for the IN packet retransmitted from the host device, and the transfer rate between the host and function is low, or between the host and function. Even when the transfer path is long, the IN transaction processing can be completed within the restricted time defined by USB transmission.

また、上記通信コントローラは、ホスト装置側から送信されるUSB規格のINパケットをファンクション装置に転送し、該INパケットに対する返答となるDATAパケットをホスト装置側に転送するファンクション側コントローラとしても機能するものであり、ホスト装置側からINパケットを受信した時にはこれを保持し、ホスト装置側に送信したDATAパケットに対するACKパケットをホスト装置側から受信した場合には、USBファンクションに上記保持していたINパケットを送信し、該INパケットに対するDATAパケットをファンクション装置から受信した時点でACKパケットをファンクション装置に送信する。それゆえ、ホスト−ファンクション間の通信路にてDATAパケットにエラーが発生した場合、ファンクション側コントローラがACKパケットをファンクション装置に送信することがないため、INトランザクションが異常終了することを防止でき、より安定したパケット転送を行うことできるという効果を奏する。   The communication controller also functions as a function-side controller that transfers a USB standard IN packet transmitted from the host device side to the function device and forwards a DATA packet as a response to the IN packet to the host device side. When an IN packet is received from the host device side, the IN packet is retained. When an ACK packet for the DATA packet transmitted to the host device side is received from the host device side, the IN packet held in the USB function is retained. When the DATA packet corresponding to the IN packet is received from the function device, an ACK packet is transmitted to the function device. Therefore, when an error occurs in the DATA packet in the communication path between the host and the function, the function-side controller does not transmit the ACK packet to the function device, so that the IN transaction can be prevented from being terminated abnormally. There is an effect that stable packet transfer can be performed.

また、上記通信コントローラは、ファンクション装置側から受信したDATAパケットを上記格納手段に格納する際の格納データ量をデータ量確認手段によって確認し、上記送信制御手段は、確認された受信データ量が予め定められた値よりも多くなった時点で、ホスト装置へのDATAパケットの送信を開始するので、ホスト−ファンクション間の通信路における転送速度が、ホスト側コントローラとホスト装置との間での転送速度(USB規格に定められた転送速度)よりも低い場合であっても、上記の予め定められた値がその時点でDATAパケットのホスト装置への転送を開始しても格納手段がEMPTYになることがないような値以上であるならば、ファンクション装置側からのDATAパケットの受信終了を待たずにDATAパケットの送信を開始することができる。それゆえ、DATAパケットの送信タイミングを早くすることが可能となり、全体としての転送速度の向上を図ることができるという効果を奏する。   The communication controller confirms the amount of data stored when the DATA packet received from the function device side is stored in the storage means by the data amount confirmation means, and the transmission control means confirms that the received data amount is Since the transmission of the DATA packet to the host device is started when the value exceeds the predetermined value, the transfer rate in the communication path between the host and the function is the transfer rate between the host-side controller and the host device. Even if the transfer rate is lower than (the transfer rate defined in the USB standard), the storage means becomes EMPTY even if the predetermined value starts to transfer the DATA packet to the host device at that time. If the value is greater than the value that does not exist, the DATA packet is not waited for the completion of reception of the DATA packet from the function device. It is possible to initiate the transmission of Tsu door. Therefore, it is possible to advance the transmission timing of the DATA packet, and it is possible to improve the transfer rate as a whole.

また、上記通信コントローラは、ファンクション装置側から受信したDATAパケットが誤りを含むものであるか否かを誤り解析手段によって解析し、上記送信制御手段は、上記誤り解析手段により、受信したDATAパケットが誤っていると判断される場合、該DATAパケットを破棄し、ホスト装置に転送しないようにする。それゆえ、送信にかかる電力を低減するとともに、USBホストが誤りのあるパケットを受信することで生じる予期せぬ異常動作の抑制を行うことが可能となるという効果を奏する。   Further, the communication controller analyzes whether or not the DATA packet received from the function device side includes an error by an error analysis unit, and the transmission control unit uses the error analysis unit to erroneously receive the received DATA packet. If it is determined, the DATA packet is discarded and not transferred to the host device. Therefore, it is possible to reduce the power required for transmission and to suppress the unexpected abnormal operation caused by the USB host receiving an erroneous packet.

また、上記通信コントローラは、ファンクション装置側から受信したDATAパケットが誤りを含むものであるか否かを誤り解析手段によって解析し、上記送信制御手段は、上記誤り解析手段により、受信したDATAパケットが誤っていると判断された場合、ホスト装置へのDATAパケットの送信をその時点で中止する。それゆえ、転送の途中でも上記DATAパケットの送信をやめることで、低速通信路の転送効率の悪化を抑制することができるという効果を奏する。   Further, the communication controller analyzes whether or not the DATA packet received from the function device side includes an error by an error analysis unit, and the transmission control unit uses the error analysis unit to erroneously receive the received DATA packet. If it is determined that there is, the transmission of the DATA packet to the host device is stopped at that time. Therefore, by stopping the transmission of the DATA packet even during the transfer, there is an effect that the deterioration of the transfer efficiency of the low-speed communication path can be suppressed.

また、上記通信コントローラは、ホスト装置にDATAパケットを送信した後、該DATAパケット対するACKパケットがホスト装置から返ってきたか否かを上記受信確認手段にて確認し、上記送信制御手段は、ホスト装置にDATAパケットを送信した後、上記受信確認手段によるACKパケットの受信が確認されずに、次のINパケットの受信が確認された場合には、前回ホスト装置に送信したDATAパケットと同じDATAパケットをホスト装置に送信する再送処理を行う。それゆえ、ホスト側コントローラがDATAパケットをホスト装置に対して送信する際に、ホスト装置とホスト側コントローラとの間でデータ誤りが発生した場合、ファンクション装置側に再度DATAパケットの送信を要求することなく、DATAパケットの再送処理を行うことができるという効果を奏する。   In addition, after the communication controller transmits the DATA packet to the host device, the reception controller confirms whether or not the ACK packet for the DATA packet has been returned from the host device. If the reception of the next IN packet is confirmed without confirming the reception of the ACK packet by the reception confirmation means after the DATA packet is transmitted to the host device, the same DATA packet as the DATA packet transmitted to the previous host device is transmitted. Performs retransmission processing to be sent to the host device. Therefore, when a data error occurs between the host device and the host-side controller when the host-side controller transmits a DATA packet to the host device, the function device side is requested to send the DATA packet again. In this way, the data packet can be retransmitted.

また、上記通信コントローラは、ファンクション装置側から受信したDATAパケットが誤りを含むものであるか否かを誤り解析手段によって解析し、上記送信制御手段は、上記再送処理を、上記誤り解析手段により自機器が保有しているDATAパケットに誤りがないと確認された場合のみ行う。それゆえ、上記通信コントローラがホスト側コントローラとして機能する場合、受信DATAパケットが正しいと判別される場合のみ、ホスト装置への再送処理を行うことができるという効果を奏する。   In addition, the communication controller analyzes whether or not the DATA packet received from the function device side contains an error by an error analysis unit, and the transmission control unit performs the retransmission process by the error analysis unit. This is performed only when it is confirmed that there is no error in the held DATA packet. Therefore, when the communication controller functions as a host-side controller, there is an effect that retransmission processing to the host device can be performed only when the received DATA packet is determined to be correct.

また、上記通信コントローラは、ファンクション装置側から受信したDATAパケットが誤りを含むものであるか否かを誤り解析手段によって解析し、上記誤り解析手段により、受信したDATAパケットが誤っていると判断された場合、再送要求手段によってファンクション装置側にDATAパケットの再送要求を行う。それゆえ、上記の動作を行うことにより、ホスト−ファンクション間の通信路において、DATAパケットに誤りが発生した場合は、ホスト側コントローラは、ファンクション装置側に対して、その旨を通知することができるという効果を奏する。   Further, the communication controller analyzes whether or not the DATA packet received from the function device side includes an error by the error analysis means, and when the error analysis means determines that the received DATA packet is incorrect Then, the retransmission request means makes a retransmission request for the DATA packet to the function device side. Therefore, by performing the above operation, if an error occurs in the DATA packet in the communication path between the host and the function, the host controller can notify the function device to that effect. There is an effect.

また、上記通信コントローラは、ホスト装置側から送信されるUSB規格のINパケットをファンクション装置に転送し、該INパケットに対する返答となるDATAパケットをホスト装置側に転送するファンクション側コントローラとしても機能するものであり、ホスト側コントローラから再送要求を受信した場合には、前回ホスト側コントローラに送信したDATAパケットと同じDATAパケットをホスト側コントローラに送信する再送処理を行う。それゆえ、ホスト側コントローラからの再送要求を元にファンクション側コントローラからの再送処理が可能となるという効果を奏する。   The communication controller also functions as a function-side controller that transfers a USB standard IN packet transmitted from the host device side to the function device and forwards a DATA packet as a response to the IN packet to the host device side. When a retransmission request is received from the host-side controller, a retransmission process for transmitting the same DATA packet as the DATA packet transmitted to the host-side controller last time to the host-side controller is performed. Therefore, it is possible to perform retransmission processing from the function-side controller based on a retransmission request from the host-side controller.

また、上記通信コントローラは、ファンクション装置から受信したDATAパケットが誤りを含むものであるか否かを誤り解析手段によって解析し、上記送信制御手段は、上記再送処理を、上記誤り解析手段により自機器が保有しているDATAパケットに誤りがないと確認された場合のみ行う。それゆえ、上記通信コントローラがファンクション側コントローラとして機能する場合、受信DATAパケットが正しいと判別される場合のみ、ホスト側コントローラへの再送処理を行うことができるという効果を奏する。   In addition, the communication controller analyzes whether or not the DATA packet received from the function device contains an error by an error analysis unit, and the transmission control unit owns the retransmission process by the error analysis unit. This is performed only when it is confirmed that there is no error in the DATA packet being processed. Therefore, when the communication controller functions as a function-side controller, there is an effect that retransmission processing to the host-side controller can be performed only when the received DATA packet is determined to be correct.

また、上記通信コントローラは、上記誤り解析手段により自機器が保有しているDATAパケットに誤りがないと確認された場合、ホスト装置へ送信するDATAパケットのパケットフォーマット中に、該DATAパケットには誤りが無いことを示すフラグを立てる。それゆえ、ファンクション側コントローラの保有しているDATAパケットが再送できるパケットかどうかという情報をホスト装置側に通知することが可能となるという効果を奏する。   In addition, the communication controller, when it is confirmed by the error analysis means that there is no error in the DATA packet held by the device, an error is detected in the DATA packet during the packet format of the DATA packet transmitted to the host device. Set a flag to indicate that there is no. Therefore, there is an effect that it is possible to notify the host device side of information indicating whether or not the DATA packet held by the function-side controller is a retransmittable packet.

また、上記通信コントローラは、ファンクション側コントローラからDATAパケットを受信し、該DATAパケットにおいて誤りのあることが誤り解析手段により検出された場合、該DATAパケットに立てられたフラグにより、ファンクション装置側で誤りの無いDATAパケットが保有されていることが確認された場合のみ上記再送要求を行う。それゆえ、受信DATAパケットに誤りがあると判断された場合に、ファンクション側コントローラに対して再送要求を行うことができるという効果を奏する。   Further, the communication controller receives a DATA packet from the function side controller, and when the error analysis means detects that there is an error in the DATA packet, an error is detected on the function device side by the flag set in the DATA packet. The retransmission request is made only when it is confirmed that a DATA packet with no packet is held. Therefore, when it is determined that there is an error in the received DATA packet, there is an effect that a retransmission request can be made to the function side controller.

また、上記通信コントローラは、ホスト装置側から送信されるUSB規格のINパケットをファンクション装置に転送し、該INパケットに対する返答となるDATAパケットをホスト装置側に転送するファンクション側コントローラとしても機能するものであり、ホスト側コントローラから再送要求を受信した場合には、ファンクション装置に対してINパケットを送信し、それに対して受信したDATAパケットをホスト側コントローラに送信する。それゆえ、ホスト側コントローラからの再送要求を元にファンクション側コントローラからの再送処理が可能となるという効果を奏する。   The communication controller also functions as a function-side controller that transfers a USB standard IN packet transmitted from the host device side to the function device and forwards a DATA packet as a response to the IN packet to the host device side. When a retransmission request is received from the host-side controller, an IN packet is transmitted to the function device, and the received DATA packet is transmitted to the host-side controller. Therefore, it is possible to perform retransmission processing from the function-side controller based on a retransmission request from the host-side controller.

また、上記通信コントローラは、上記INトランザクションの実行前に、通信相手側の通信コントローラと転送速度調整を行う。それゆえ、ホスト−ファンクション間の通信路において、実際の通信が可能な転送速度で、かつ、必要以上に転送速度を低下させない転送速度が設定可能となるという効果を奏する。   The communication controller adjusts the transfer rate with the communication controller on the communication partner side before executing the IN transaction. Therefore, in the communication path between the host and the function, it is possible to set a transfer rate at which actual communication is possible and a transfer rate that does not lower the transfer rate more than necessary.

また、上記通信コントローラは、上記転送速度調整において、USB規格に定められた転送速度で通信が可能であると判断される場合は、通信相手側の通信コントローラに送信される各パケットは、パケットの送信タイミング制御を行わずに、変復調のみを行って相手側の通信コントローラへの転送を行う。それゆえ、ホスト−ファンクション間の通信路における転送速度が前述の最大ターンアラウンドを満足する程、十分であると判断される場合は、データ転送速度の低下をおこすことなく、USB2.0のデータ転送を行うことができるという効果を奏する。   In addition, when the communication controller determines that communication can be performed at the transfer speed defined in the USB standard in the transfer speed adjustment, each packet transmitted to the communication controller on the communication partner side is Without performing transmission timing control, only modulation / demodulation is performed and transfer to the communication controller on the other side is performed. Therefore, if it is determined that the transfer speed on the communication path between the host and the function is sufficient to satisfy the above-mentioned maximum turnaround, the USB 2.0 data transfer is performed without causing a decrease in the data transfer speed. There is an effect that can be performed.

また、上記通信コントローラは、通信相手側の通信コントローラとの間での通信路におけるエラーレートを解析し、該エラーレートが予め定められたエラーレートよりも悪いと判断される場合、上記転送速度調整を行って転送速度を下げる。それゆえ、仮にホスト−ファンクション間の通信路における品質が悪いと判断された場合は、転送速度を落とすことにより、品質の良い通信路においてデータ転送が可能となるという効果を奏する。   The communication controller analyzes the error rate in the communication path with the communication controller on the communication partner side, and determines that the error rate is worse than a predetermined error rate, the transfer rate adjustment To reduce the transfer speed. Therefore, if it is determined that the quality of the communication path between the host and the function is poor, it is possible to transfer the data on the communication path with a good quality by reducing the transfer speed.

また、上記通信コントローラは、通信相手側の通信コントローラとの間で、全二重通信を行うので、ホスト−ファンクション間の通信において、半二重通信の際に必要なプリアンブルをなくすことが可能となり、通信路の使用効率を向上することができるという効果を奏する。   In addition, since the communication controller performs full-duplex communication with the communication controller on the communication partner side, it is possible to eliminate the preamble required for half-duplex communication in host-function communication. There is an effect that the use efficiency of the communication path can be improved.

また、上記通信コントローラは、通信相手側の通信コントローラとの間の通信が、光ファイバを用いた通信路によって行われるので、ホスト−ファンクション間の通信において長距離伝送が可能となるという効果を奏する。   In addition, since the communication controller communicates with the communication controller on the communication partner side through a communication path using an optical fiber, there is an effect that long-distance transmission is possible in communication between the host and the function. .

また、上記通信コントローラは、通信相手側の通信コントローラとの間の通信が、電波を用いた無線によって行われる、あるいは、光を用いた空間伝送によって行われるので、ホスト−ファンクション間の通信において、ケーブルレスのため利便性が向上するという効果を奏する。   In addition, since the communication controller performs communication with the communication controller on the communication partner side by radio using radio waves or by spatial transmission using light, in communication between the host and function, Because it is cableless, it has the effect of improving convenience.

〔実施の形態1〕
本発明の一実施形態について図1ないし図3に基づいて説明すると以下の通りである。
[Embodiment 1]
An embodiment of the present invention will be described below with reference to FIGS.

先ず、実施の形態1に係る送受信システムの概略構成を図1に示す。図1に示す送受信システムは、ホスト側コントローラ100とファンクション側コントローラ110とから構成される。また、USBホスト(ホスト装置)となる機器とUSBファンクション(ファンクション装置)となる機器との間での通信は、USBホスト側に接続されるホスト側コントローラ100と、USBファンクション側に接続されるファンクション側コントローラ110との間で行われる。   First, FIG. 1 shows a schematic configuration of the transmission / reception system according to the first embodiment. The transmission / reception system shown in FIG. 1 includes a host-side controller 100 and a function-side controller 110. In addition, communication between a device serving as a USB host (host device) and a device serving as a USB function (function device) is performed by a host-side controller 100 connected to the USB host side and a function connected to the USB function side. This is performed with the side controller 110.

また、図1におけるホスト側コントローラ100とファンクション側コントローラ110との間の通信は光通信手段によって行われ、該光通信手段はUSB規格に定められた転送速度と同一もしくはそれ以下の転送速度を有しているものとする。   In addition, communication between the host-side controller 100 and the function-side controller 110 in FIG. 1 is performed by optical communication means, and the optical communication means has a transfer speed equal to or lower than the transfer speed defined in the USB standard. Suppose you are.

ホスト側コントローラ100は、USBホストからの信号を受信するとこれをファンクション側コントローラ110に送信し、ファンクション側コントローラ110からの信号を受信するとこれをUSBホストに向かって送信する。ホスト側コントローラ100は、USBホストとUSBケーブルで接続する以外にUSBハブのダウンストリームのポートとUSBケーブルで接続されていても構わない。また、USBホストやUSBハブの一部として、構成されていても構わない。   When receiving a signal from the USB host, the host-side controller 100 transmits it to the function-side controller 110, and when receiving a signal from the function-side controller 110, transmits it to the USB host. The host-side controller 100 may be connected to the downstream port of the USB hub via a USB cable in addition to being connected to the USB host via a USB cable. Further, it may be configured as a part of a USB host or a USB hub.

ファンクション側コントローラ110は、ホスト側コントローラ100からの信号を受信するとこれをUSBファンクションに送信し、USBファンクションからの信号を受信するとこれをホスト側コントローラ100に向かって送信する。ファンクション側コントローラ110は、USBファンクションとUSBケーブルで接続する以外にUSBハブのアップストリームのポートとUSBケーブルで接続されても構わない。また、USBファンクションやUSBハブの一部として構成されていても構わない。   When the function-side controller 110 receives a signal from the host-side controller 100, the function-side controller 110 transmits the signal to the USB function. When the function-side controller 110 receives a signal from the USB function, the function-side controller 110 transmits the signal to the host-side controller 100. The function-side controller 110 may be connected to the upstream port of the USB hub via a USB cable, in addition to being connected to the USB function via a USB cable. Moreover, you may comprise as a part of USB function or USB hub.

以下にホスト側コントローラ100およびファンクション側コントローラ110の各構成要素の説明を行う。   Hereinafter, each component of the host-side controller 100 and the function-side controller 110 will be described.

ホスト側コントローラ100は、ホスト側ステートマシン101、USB受信機102、FIFO103、変調回路104、光送信機105、光受信機106、復調回路107、FIFO108、USB送信機109を備えている。また、ファンクション側コントローラ110は、ファンクション側ステートマシン111、光受信機112、復調回路113、FIFO114、USB送信機115、USB受信機116、FIFO117、変調回路118、光送信機119を備えている。   The host-side controller 100 includes a host-side state machine 101, a USB receiver 102, a FIFO 103, a modulation circuit 104, an optical transmitter 105, an optical receiver 106, a demodulation circuit 107, a FIFO 108, and a USB transmitter 109. The function-side controller 110 includes a function-side state machine 111, an optical receiver 112, a demodulation circuit 113, a FIFO 114, a USB transmitter 115, a USB receiver 116, a FIFO 117, a modulation circuit 118, and an optical transmitter 119.

ホスト側コントローラ100において、USBホストから送信されてUSB受信機102にて受信されたUSB信号は、ホスト側ステートマシン101によって、信号及びパケット解析が行われるとともに、FIFO103によってパケットが蓄えられる。このFIFO103は、ホスト側コントローラ100とファンクション側コントローラ110間の通信路がUSBの通信路と比べて同一もしくは低速であるため、前記通信路にパケットを転送する際のタイミング調整を行う。   In the host-side controller 100, the USB signal transmitted from the USB host and received by the USB receiver 102 is subjected to signal and packet analysis by the host-side state machine 101, and packets are stored by the FIFO 103. Since the communication path between the host-side controller 100 and the function-side controller 110 is the same or slower than the USB communication path, the FIFO 103 performs timing adjustment when transferring a packet to the communication path.

ホスト側ステートマシン101は、USBホストからの受信パケットがINパケットもしくはACKパケットである場合は、ファンクション側コントローラ110へのパケット転送を行う。すなわち、ホスト側コントローラ100では、転送しても良いと判断されるパケットをUSBホストから受信すると、ホスト側ステートマシン101は、変調回路104に該パケットの送信及び変調の開始を通知する。これにより、FIFO103に蓄えられたパケットは、変調回路104にて変調され、光送信機105によってファンクション側コントローラ110に向けて送信される。   When the received packet from the USB host is an IN packet or an ACK packet, the host-side state machine 101 performs packet transfer to the function-side controller 110. In other words, when the host-side controller 100 receives from the USB host a packet that can be transferred, the host-side state machine 101 notifies the modulation circuit 104 of the transmission of the packet and the start of modulation. Thus, the packet stored in the FIFO 103 is modulated by the modulation circuit 104 and transmitted to the function-side controller 110 by the optical transmitter 105.

本実施の形態に係る説明では、ホスト側コントローラ100とファンクション側コントローラ110との間(以下、ホスト−ファンクション間)の通信路を光通信路としているため、光送信機105は、例えば発光ダイオードやレーザーとなるが、光通信路は、光ファイバを用いた有線の通信路であっても、空間通信であっても問題ない。光ファイバを用いた場合は、長距離伝送が可能となり、空間通信の場合は、ケーブルレスのため利便性が向上することとなる。   In the description according to the present embodiment, since the communication path between the host-side controller 100 and the function-side controller 110 (hereinafter referred to as host-function) is an optical communication path, the optical transmitter 105 is, for example, a light-emitting diode, Although it is a laser, there is no problem whether the optical communication path is a wired communication path using an optical fiber or spatial communication. When an optical fiber is used, long-distance transmission is possible, and in the case of spatial communication, convenience is improved because it is cable-free.

また、変調回路104では、ホスト−ファンクション間の通信路を光通信とする場合、例えば8B10Bなどの変調方法が選択されるが、上記通信路は光に限定する必要は無く、例えば無線でも構わない。その場合は、変調回路104において別の変調方式を用いても構わない。また、ホスト−ファンクション間の通信方式は、半二重通信と全二重通信のどちらを選択してもよいが、全二重通信を選択すると、光送信機105が常に発光しているため、パケットにプリアンブルを付加する必要がなく、通信路の使用効率の向上へとつながる。   In the modulation circuit 104, when the communication path between the host and the function is optical communication, a modulation method such as 8B10B is selected. However, the communication path is not necessarily limited to light, and may be wireless, for example. . In that case, the modulation circuit 104 may use another modulation method. The communication method between the host and function may be selected from half duplex communication or full duplex communication. However, when full duplex communication is selected, the optical transmitter 105 always emits light. There is no need to add a preamble to the packet, which leads to an improvement in communication path usage efficiency.

また、ホスト側コントローラ100がUSBホストからINパケットもしくはACKパケットの受信パケットを受けた場合、ホスト側コントローラ100はこの時点でファンクション側コントローラ110からDATAパケットを受信していない。このため、ホスト側ステートマシン101は、FIFO108およびUSB送信機109を介してNAKパケットをUSBホストに送信する。こうすることで、ホスト側コントローラ100は、USBホストに対して、ファンクション側コントローラ110から受信したDATAパケットがないことを通知することができる。   When the host controller 100 receives an IN packet or an ACK packet from the USB host, the host controller 100 has not received a DATA packet from the function controller 110 at this time. For this reason, the host-side state machine 101 transmits a NAK packet to the USB host via the FIFO 108 and the USB transmitter 109. By doing so, the host-side controller 100 can notify the USB host that there is no DATA packet received from the function-side controller 110.

一方、ホスト側コントローラ100からファンクション側コントローラ110に向けて送信された光信号は、ファンクション側コントローラ110の光受信機112によって受信されると、復調回路113により例えば8B10B復調された後、ファンクション側ステートマシン111によってそのパケットの中身が解釈される。ここで光受信機112は例えばフォトダイオードであるが、前述のとおり、ホスト−ファンクション間の通信路の種類により異なり、無線である場合は受信アンテナとなる。上記パケットが、ホスト側コントローラ100からのINパケットもしくはACKパケットであると判断された場合は、該パケットはFIFO114に蓄えられる。また、ファンクション側ステートマシン111は、ホスト側コントローラ100からのパケットの受信が完了するのを待って、該パケットを、USB送信機115を通してUSBファンクションにUSB信号として送信する。   On the other hand, when the optical signal transmitted from the host-side controller 100 to the function-side controller 110 is received by the optical receiver 112 of the function-side controller 110, the demodulating circuit 113 demodulates, for example, 8B10B, and then the function-side state. The machine 111 interprets the contents of the packet. Here, the optical receiver 112 is, for example, a photodiode. As described above, the optical receiver 112 differs depending on the type of the communication path between the host and the function. When it is determined that the packet is an IN packet or an ACK packet from the host-side controller 100, the packet is stored in the FIFO 114. Also, the function-side state machine 111 waits for completion of reception of the packet from the host-side controller 100, and transmits the packet as a USB signal to the USB function through the USB transmitter 115.

こうして、ファンクション側コントローラ110のUSB送信機115から送信されたINパケットをUSBファンクションが受信すると、USBファンクションは、送信すべきDATAを持っている場合はDATAパケットを、また、送信すべきDATAが無い場合はNAKパケットをそれぞれファンクション側コントローラ110に送信する。ファンクション側コントローラ110のUSB受信機116にて受信された前記DATAパケットもしくはNAKパケットは、ファンクション側ステートマシン111により、そのパケットの中身を解釈されると共に、FIFO117に蓄えられる。そして、変調回路118により例えば8B10B変調され、光送信機119を介して光信号としてホスト側コントローラ100に向けて送信される。   Thus, when the USB function receives the IN packet transmitted from the USB transmitter 115 of the function-side controller 110, the USB function receives a DATA packet if it has DATA to be transmitted, and there is no DATA to be transmitted. In this case, a NAK packet is transmitted to the function-side controller 110. The DATA packet or NAK packet received by the USB receiver 116 of the function-side controller 110 is interpreted by the function-side state machine 111 and stored in the FIFO 117. Then, for example, 8B10B modulation is performed by the modulation circuit 118 and transmitted to the host-side controller 100 as an optical signal via the optical transmitter 119.

ホスト側コントローラ100の光受信機106によって受信された信号は、復調回路107によって例えば8B10B復調され、ホスト側ステートマシン101によって該受信信号がDATAパケットもしくはNAKパケットであることが認識されると、FIFO108によってそのパケットが蓄えられる。   The signal received by the optical receiver 106 of the host-side controller 100 is demodulated by, for example, 8B10B by the demodulation circuit 107. When the host-side state machine 101 recognizes that the received signal is a DATA packet or NAK packet, the FIFO 108 To store the packet.

また、USBホストは、上述したように、最初のINパケットの送信に対してホスト側コントローラ100からNAKパケットを返されるため、ホスト側コントローラ100にINパケットを再度送信する。ホスト側コントローラ100は、USB受信機102によりINパケットを再度受信した時点で、FIFO108に格納されている前記DATAパケットもしくはNAKパケットがあれば、このパケットをUSBホストに送信する。   In addition, as described above, the USB host returns the NAK packet from the host-side controller 100 in response to the transmission of the first IN packet. When the host-side controller 100 receives the IN packet again by the USB receiver 102, if there is the DATA packet or NAK packet stored in the FIFO 108, the host-side controller 100 transmits this packet to the USB host.

また、NAKパケットに関しては、ホスト側コントローラ100がUSBホストからINパケットを受信した時点で、ファンクション側コントローラ110からDATAパケットを受信していない場合においても、ファンクション側コントローラ110からのNAKパケットの受信に関係なく、USBホストに対してホスト側コントローラ100から送信される。   Further, regarding the NAK packet, even when the host-side controller 100 receives an IN packet from the USB host and does not receive a DATA packet from the function-side controller 110, the NAK packet is received from the function-side controller 110. Regardless, it is transmitted from the host-side controller 100 to the USB host.

以上のように、ホスト側コントローラ100では、USBホストから最初に受信したINパケットに対する返答としてのDATAパケットまたはNAKパケットをFIFO108にて格納し、USBホストからINパケットが再送されてきた時に、FIFO108にて格納されているDATAパケットまたはNAKパケットをUSBホストに送信する。これにより、USBホストとUSBファンクションとの間にUSB規格よりも低速な通信路が存在していても、再送されてきたINパケットに対しては、ホスト−ファンクション間での通信を再度行うことなくDATAパケットまたはNAKパケットを制約時間内にUSBホストに確実に送信することができるので、問題なくINトランザクションを行うことができる。   As described above, the host-side controller 100 stores the DATA packet or NAK packet as a response to the IN packet first received from the USB host in the FIFO 108, and when the IN packet is retransmitted from the USB host, The stored DATA packet or NAK packet is transmitted to the USB host. As a result, even if a communication path slower than the USB standard exists between the USB host and the USB function, communication between the host and the function is not performed again for the retransmitted IN packet. Since the DATA packet or the NAK packet can be reliably transmitted to the USB host within the limited time, the IN transaction can be performed without any problem.

ここで、図2を用いて、本発明の実施の形態1におけるホスト側コントローラ100のホスト側ステートマシン101の動作説明を行う。   Here, the operation of the host-side state machine 101 of the host-side controller 100 according to Embodiment 1 of the present invention will be described with reference to FIG.

S201は、USBホストから受信したパケットがINパケットかどうかを判別するステップである。INパケットである場合はS202に、またINパケット以外のパケットである場合は再びS201へとそれぞれ遷移する。   S201 is a step of determining whether or not the packet received from the USB host is an IN packet. If it is an IN packet, the process proceeds to S202. If it is a packet other than an IN packet, the process proceeds to S201 again.

S202は、ファンクション側コントローラ110にINパケットを送信するステップである。送信完了の後、S203へと遷移する。   S 202 is a step of transmitting an IN packet to the function-side controller 110. After the transmission is completed, the process proceeds to S203.

S203は、ファンクション側コントローラ110から、DATAパケットを受信しているかどうかを判別するステップである。DATAパケットを受信している場合はS205へ、また受信していない場合はS204へそれぞれ遷移する。   S203 is a step of determining whether or not a DATA packet is received from the function-side controller 110. If a DATA packet has been received, the process proceeds to S205, and if not, the process proceeds to S204.

S204は、USBホストに対して、NAKパケットを送信するステップである。NAKパケット送信後S201へと遷移する。   S204 is a step of transmitting a NAK packet to the USB host. After transmitting the NAK packet, the process proceeds to S201.

S205は、受信したDATAパケットが正しいか否かを判断するステップである。DATAパケットが正しくない場合はS206へ、DATAパケットが正しい場合はS207へと遷移する。   S205 is a step of determining whether or not the received DATA packet is correct. If the DATA packet is not correct, the process proceeds to S206. If the DATA packet is correct, the process proceeds to S207.

S206は、USBファンクションにDATAパケットの再送要求を行うステップである。この再送要求後、S201へと遷移する。   S206 is a step of requesting the USB function to retransmit the DATA packet. After this retransmission request, the process proceeds to S201.

S207は、USBホストにDATAパケットを送信するステップである。このDATAパケット送信後、INトランザクションを終了する。   S207 is a step of transmitting a DATA packet to the USB host. After transmitting the DATA packet, the IN transaction is terminated.

次に、図3を用いて、本発明の実施の形態1におけるファンクション側コントローラ110のファンクション側ステートマシン111の動作説明を行う。   Next, the operation of the function side state machine 111 of the function side controller 110 in the first embodiment of the present invention will be described with reference to FIG.

S301は、ホスト側コントローラ100から受信したパケットがINパケットかどうかを判別するステップである。INパケットである場合はS302へ、それ以外のパケットである場合は再びS302へとそれぞれ遷移する。   S301 is a step of determining whether or not the packet received from the host-side controller 100 is an IN packet. If it is an IN packet, the process proceeds to S302, and if it is any other packet, the process proceeds to S302 again.

S302は、USBファンクションに対して、INパケットを送信するステップである。INパケットを送信後、タイマをスタートした後S303へと遷移する。   S302 is a step of transmitting an IN packet to the USB function. After transmitting the IN packet, the timer is started and then the process proceeds to S303.

S303は、USBファンクションから受信したパケットを判別するステップである。DATAパケットである場合はS305へ、NAKパケットである場合はS304へ、また予め定められた時間が経過しタイムアウトした場合はS301へとそれぞれ遷移する
S304は、ホスト側コントローラ100にNAKパケットを送信するステップである。NAKパケット送信後S301へと遷移する。
S303 is a step of determining a packet received from the USB function. If it is a DATA packet, the process proceeds to S305, if it is a NAK packet, the process proceeds to S304, and if a predetermined time has elapsed and timed out, the process proceeds to S301. S304 transmits a NAK packet to the host-side controller 100. It is a step. After transmitting the NAK packet, the process proceeds to S301.

S305は、ホスト側コントローラ100にDATAパケットを送信するステップである。ホスト側コントローラ100にDATAパケット送信後S306へと遷移する。   S305 is a step of transmitting a DATA packet to the host-side controller 100. After transmitting the DATA packet to the host-side controller 100, the process proceeds to S306.

S306は、USBファンクションにACKパケットを送信するステップである。ACKパケット送信後、INトランザクションを終了する。   S306 is a step of transmitting an ACK packet to the USB function. After transmitting the ACK packet, the IN transaction is terminated.

上記のようにホスト側コントローラ100においては、図2に示すような動作を行うステートマシンを、またファンクション側コントローラ110においては、図3に示すような動作を行うステートマシンをそれぞれ実装することで、ホスト側コントローラ100とファンクション側コントローラ110との通信路がUSBと同一もしくは低速であっても、問題なくINトランザクションを行うことが可能となる。   As described above, the host-side controller 100 implements a state machine that performs the operation shown in FIG. 2, and the function-side controller 110 implements a state machine that performs the operation shown in FIG. Even if the communication path between the host-side controller 100 and the function-side controller 110 is the same as or slower than the USB, an IN transaction can be performed without any problem.

尚、上記図2の処理では、ホスト側コントローラ100は、USBホストから受信したINパケットをS202においてファンクション側コントローラ110に転送している。しかしながら、ホスト側コントローラ100がUSBホストに対してDATAパケットを送信できる状態である場合には、上記INパケットをファンクション側コントローラ110に送信する必要は無い。厳密には、このINパケットがUSBファンクションに届いてしまうとUSBファンクションが新たにDATAパケットを出してくる可能性があるため、このような場合は、INパケットをUSBファンクションに転送しないほうがいいと考えられる。   In the process of FIG. 2, the host-side controller 100 transfers the IN packet received from the USB host to the function-side controller 110 in S202. However, when the host-side controller 100 can send a DATA packet to the USB host, it is not necessary to send the IN packet to the function-side controller 110. Strictly speaking, if this IN packet arrives at the USB function, the USB function may generate a new DATA packet. In such a case, it is better not to transfer the IN packet to the USB function. It is done.

このため、ホスト側コントローラ100がUSBホストからINパケットを受信した時点でファンクション側コントローラ110からDATAパケットを受信していた場合には、例えば、上記INパケットをファンクション側コントローラ110に送信しないという制御を行うことが考えられる。あるいは、ファンクション側コントローラ110がDATAパケットを送信した後に、ホスト側コントローラ100からACKパケットを受信するまでは、ホスト側コントローラ100からのINパケットを無視するといった方法も考えられる。   For this reason, when the host-side controller 100 receives a DATA packet from the function-side controller 110 at the time when the host-side controller 100 receives an IN packet from the USB host, for example, control is performed so that the IN packet is not transmitted to the function-side controller 110. It is possible to do. Alternatively, after the function-side controller 110 transmits a DATA packet, an IN packet from the host-side controller 100 is ignored until an ACK packet is received from the host-side controller 100.

〔実施の形態2〕
本発明の他の実施形態について図4ないし図7に基づいて説明すると以下の通りである。
[Embodiment 2]
Another embodiment of the present invention will be described below with reference to FIGS.

本実施の形態2に係る送受信システムの概略構成は実施の形態1における図1に示した構成と同様であり、各構成要素は、実施の形態1に係る送受信システムと同じ機能をもつため、詳細な説明は省略する。   The schematic configuration of the transmission / reception system according to the second embodiment is the same as the configuration shown in FIG. 1 in the first embodiment, and each component has the same function as the transmission / reception system according to the first embodiment. Detailed explanation is omitted.

先ず、図4を用いて、実施の形態2に係るホスト側コントローラ100のホスト側ステートマシン101の動作を説明する。   First, the operation of the host-side state machine 101 of the host-side controller 100 according to the second embodiment will be described with reference to FIG.

S401は、USBホストから受信したパケットがINパケットであるかどうかを判別するステップである。INパケットである場合はS402へ、またそれ以外のパケットである場合は再びS401へとそれぞれ遷移する。   S401 is a step of determining whether or not the packet received from the USB host is an IN packet. If it is an IN packet, the process proceeds to S402, and if it is any other packet, the process proceeds to S401 again.

S402は、ファンクション側コントローラ110にINパケットを送信するステップである。INパケットを送信終了後S403へと遷移する。   S <b> 402 is a step of transmitting an IN packet to the function-side controller 110. After completing the transmission of the IN packet, the process proceeds to S403.

S403は、ファンクション側コントローラ110から、DATAパケットを受信しているかどうかを判別するステップである。DATAパケットを受信している場合はS405へ、また受信していない場合はS404へとそれぞれ遷移する。   S403 is a step of determining whether or not a DATA packet has been received from the function-side controller 110. If a DATA packet has been received, the process proceeds to S405. If not, the process proceeds to S404.

S404は、USBホストにNAKパケットを送信するステップである。NAKパケット送信終了後S401へと遷移する。   S404 is a step of transmitting a NAK packet to the USB host. After the NAK packet transmission is completed, the process proceeds to S401.

S405は、USBホストにDATAパケットを送信するステップである。DATAパケット送信終了後、タイマをスタートした後、S406へと遷移する。   S405 is a step of transmitting a DATA packet to the USB host. After the completion of the DATA packet transmission, the timer is started and then the process proceeds to S406.

S406は、USBホストからACKパケットを受信したかどうかを判別するステップである。ACKパケットを受信した場合はS407へ、ACKパケットを受信せずに予め定められた時間が経過しタイムアウトした場合はS401へとそれぞれ遷移する。   S406 is a step of determining whether or not an ACK packet has been received from the USB host. If an ACK packet is received, the process proceeds to S407. If a predetermined time has elapsed without receiving an ACK packet and a time-out occurs, the process proceeds to S401.

S407は、ファンクション側コントローラ110に対して、ACKパケットを送信するステップである。ACKパケット送信後、INトランザクションを終了する。   S 407 is a step of transmitting an ACK packet to the function-side controller 110. After transmitting the ACK packet, the IN transaction is terminated.

次に、図5を用いて、実施の形態2に係るファンクション側コントローラ110のファンクション側ステートマシン111の動作を説明する。   Next, the operation of the function side state machine 111 of the function side controller 110 according to the second embodiment will be described with reference to FIG.

S501は、ホスト側コントローラ100から受信したパケットがINパケットであるかどうかを判別するステップである。INパケットである場合は、S502へ、またそれ以外のパケットである場合は、再びS501へとそれぞれ遷移する。   S501 is a step of determining whether or not the packet received from the host-side controller 100 is an IN packet. If the packet is an IN packet, the process proceeds to S502. If the packet is any other packet, the process proceeds to S501 again.

S502は、INパケットを保持するステップである。INパケットを保持した後、S503へと遷移する。   S502 is a step of holding an IN packet. After holding the IN packet, the process proceeds to S503.

S503は、USBファンクションにINパケットを送信するステップである。INパケット送信終了後、タイマをスタートした後、S504へと遷移する。   S503 is a step of transmitting an IN packet to the USB function. After completing the IN packet transmission, the timer is started, and then the process proceeds to S504.

S504は、USBファンクションから受信したパケットを判別するステップである。DATAパケットである場合はS506へ、NAKパケットである場合はS505へ、またDATAパケットもNAKパケットも受信せず、予め定められた時間が経過し、タイムアウトした場合は、S501へとそれぞれ遷移する。   S504 is a step of determining a packet received from the USB function. If the packet is a DATA packet, the process proceeds to S506. If the packet is a NAK packet, the process proceeds to S505. If neither a DATA packet nor a NAK packet is received and a predetermined time elapses, the process proceeds to S501.

S505は、ホスト側コントローラ100にNAKパケットを送信するステップである。NAKパケット送信終了後、S501へと遷移する。   S505 is a step of transmitting a NAK packet to the host-side controller 100. After the NAK packet transmission is completed, the process proceeds to S501.

S506は、ホスト側コントローラ100からACKパケットを受信しているかどうかを判別するステップである。ACKパケットを受信している場合はS508へ、また受信していない場合はS507へとそれぞれ遷移する。   S506 is a step of determining whether or not an ACK packet has been received from the host-side controller 100. If an ACK packet has been received, the process proceeds to S508. If not, the process proceeds to S507.

S507は、ホスト側コントローラ100にDATAパケットを送信するステップである。DATAパケット送信終了後、S501へと遷移する。   S507 is a step of transmitting a DATA packet to the host-side controller 100. After completion of the DATA packet transmission, the process proceeds to S501.

S508は、USBファンクションに対して、予め保持しておいたINパケットを送信するステップである。INパケット送信終了後、S522へと遷移する。   S508 is a step of transmitting the previously stored IN packet to the USB function. After completing the IN packet transmission, the process proceeds to S522.

S509は、USBファンクションからDATAパケットを受信するステップである。DATAパケット終了後、S510へと遷移する。   S509 is a step of receiving a DATA packet from the USB function. After completion of the DATA packet, the process proceeds to S510.

S510は、USBファンクションにACKパケットを送信するステップである。USBファンクションにACKパケットを送信終了後、INトランザクションを終了する。   S510 is a step of transmitting an ACK packet to the USB function. After sending the ACK packet to the USB function, the IN transaction is finished.

上記のようにホスト側コントローラ100においては図4に示すような動作を行うステートマシンを、またファンクション側コントローラ110においては、図5に示すような動作を行うステートマシンをそれぞれ実装することで、ホスト側コントローラ100とファンクション側コントローラ110との通信路がUSBと同一もしくは低速であっても、問題なくINトランザクションを行うことが可能となる。上記図4および図5の処理をまとめると、図6に示すタイミングチャートのようになる。   As described above, the host-side controller 100 implements the state machine that performs the operation as shown in FIG. 4, and the function-side controller 110 implements the state machine that performs the operation as shown in FIG. Even if the communication path between the side controller 100 and the function side controller 110 is the same as or slower than the USB, an IN transaction can be performed without any problem. 4 and FIG. 5 is summarized as a timing chart shown in FIG.

また、ファンクション側コントローラ110から受信し、USBホストに送信したDATAパケットが誤っていた場合は、ホスト側コントローラ100は、USBホストからACKパケットを受信しないため、USBファンクションに対してACKパケットを送信せず、DATAパケットが正しく転送された場合のみINトランザクションを正常終了することが可能となる。すなわち、上記処理においては、ホスト−ファンクション間の通信路にてDATAパケットにエラーが発生した場合、ファンクション側コントローラ110がACKパケットをUSBファンクションに送信することがないため、INトランザクションが異常終了することを防止でき、より安定したパケット転送を行うことが可能となる。   If the DATA packet received from the function-side controller 110 and sent to the USB host is incorrect, the host-side controller 100 does not receive the ACK packet from the USB host, so send the ACK packet to the USB function. Therefore, the IN transaction can be normally terminated only when the DATA packet is correctly transferred. In other words, in the above processing, if an error occurs in the DATA packet in the communication path between the host and the function, the function side controller 110 does not transmit the ACK packet to the USB function, so that the IN transaction ends abnormally. Can be prevented, and more stable packet transfer can be performed.

実施の形態1および実施の形態2において、ホスト側コントローラ100では、USBホストからINパケットを受信した際に、ファンクション側コントローラ110からDATAパケットを完全に受信していた場合のみ、USBホストに対してDATAパケットを送信することが可能であった。これは、DATAパケットのパケットフォーマット中にパケットの長さを意味するフィールドが存在しないことが原因であり、低速通信路からの受信データをUSBの高速通信路に転送する際にDATAの抜けなく転送を確実に行うためである。但し、DATAパケットのパケット長の上限は、USB2.0においては、図7に示すように各転送モードにおいて、パケットの最大長が定められている。   In the first embodiment and the second embodiment, the host-side controller 100 only receives the DATA packet from the function-side controller 110 when receiving the IN packet from the USB host. It was possible to send a DATA packet. This is because there is no field indicating the length of the packet in the packet format of the DATA packet. When receiving data from the low-speed communication path is transferred to the USB high-speed communication path, the data is transferred without omission. This is to ensure that However, the upper limit of the packet length of the DATA packet is set to the maximum packet length in each transfer mode in USB 2.0 as shown in FIG.

〔実施の形態3〕
本発明のさらに他の実施形態について図8に基づいて説明すると以下の通りである。
[Embodiment 3]
Still another embodiment of the present invention will be described with reference to FIG.

先ず、実施の形態3に係る送受信システムの概略構成を図8に示す。図8に示す送受信システムは、ホスト側コントローラ120とファンクション側コントローラ110とから構成される。ホスト側コントローラ120は、ホスト側ステートマシン101、USB受信機102、FIFO103、変調回路104、光送信機105、光受信機106、復調回路107、FIFO108、USB送信機109、カウンタ121を備えている。ホスト側コントローラ120において、カウンタ121以外の構成要素はすべて、図1に示したホスト側コントローラ100と同一の構成および機能をもつため、詳細な説明は省略する。また、図8におけるファンクション側コントローラ110は、図1に示したファンクション側コントローラ110と同一のものであるため、これについても詳細な説明は省略する。   First, FIG. 8 shows a schematic configuration of a transmission / reception system according to the third embodiment. The transmission / reception system shown in FIG. 8 includes a host-side controller 120 and a function-side controller 110. The host-side controller 120 includes a host-side state machine 101, a USB receiver 102, a FIFO 103, a modulation circuit 104, an optical transmitter 105, an optical receiver 106, a demodulation circuit 107, a FIFO 108, a USB transmitter 109, and a counter 121. . In the host-side controller 120, all the components other than the counter 121 have the same configuration and function as the host-side controller 100 shown in FIG. Further, the function-side controller 110 in FIG. 8 is the same as the function-side controller 110 shown in FIG.

カウンタ121は、ファンクション側コントローラ110から受信したDATAパケットがFIFO108に書き込まれる際に、書き込まれたDATAパケットの分だけその値が増えていくカウンタである。   The counter 121 is a counter whose value increases by the amount of the written DATA packet when the DATA packet received from the function-side controller 110 is written to the FIFO 108.

ここで、上記実施の形態1および2では、ホスト側コントローラ100からUSBホストへのDATAパケットの送信は、ホスト側コントローラ100においてDATAパケットの受信が完全に終了した後で開始されていた。これは、ホスト−ファンクション間の通信路における転送速度が、ホスト側コントローラ100とUSBホストとの間での転送速度(USB規格に定められた転送速度)よりも低い場合、ファンクション側コントローラ110からのDATAパケットの受信が終了する前にUSBホストへのDATAパケットの転送を開始すると、正常な転送処理が行えなくなる可能性があるためである。すなわち、上述の場合では、ファンクション側コントローラ110からのDATAパケットの受信終了前に、ホスト側コントローラ100においてDATAパケットを格納するFIFO108がEMPTYになり、USBホストに対してDATAパケットを連続して転送できないといった不具合が生じる可能性がある。   In the first and second embodiments, transmission of the DATA packet from the host-side controller 100 to the USB host is started after the host-side controller 100 has completely received the DATA packet. This is because when the transfer speed in the communication path between the host and the function is lower than the transfer speed between the host-side controller 100 and the USB host (transfer speed defined in the USB standard), the function-side controller 110 This is because if transfer of the DATA packet to the USB host is started before reception of the DATA packet is completed, normal transfer processing may not be performed. That is, in the above-described case, the FIFO 108 that stores the DATA packet in the host-side controller 100 becomes EMPTY before receiving the DATA packet from the function-side controller 110, and the DATA packet cannot be continuously transferred to the USB host. Such a problem may occur.

しかしながら、例えば、ホスト側コントローラ100とUSBホストとの間での転送がアイソクロナス転送である場合、FIFO108に格納されているDATAパケットのデータ量が、図7中で示されているアイソクロナス転送時の最大パケット長の3072バイトに相当する値まで達していない状態でUSB2.0の通信路にDATAパケットの送信を開始したとしても、その後の送信においてFIFO108がEMPTYになることがなければ、ファンクション側コントローラ110からのDATAパケットの受信終了を待たずにUSB通信路に対してDATAパケットを送信しても上記不具合は生じない。   However, for example, when the transfer between the host-side controller 100 and the USB host is isochronous transfer, the data amount of the DATA packet stored in the FIFO 108 is the maximum at the time of isochronous transfer shown in FIG. Even if the transmission of the DATA packet to the USB 2.0 communication path is started without reaching the value corresponding to the packet length of 3072 bytes, if the FIFO 108 does not become EMPTY in the subsequent transmission, the function-side controller 110 Even if the DATA packet is transmitted to the USB communication path without waiting for the completion of the reception of the DATA packet from the above, the above problem does not occur.

このため、本実施の形態3に係るホスト側コントローラ120では、ファンクション側コントローラ110からDATAパケットを受信し、該DATAパケットをFIFO108に格納する際、格納されたDATAパケットのデータ量の値をカウンタ121で管理する。そして、カウンタ121で管理される値が、その時点でDATAパケットのUSBホストへの転送を開始してもFIFO108がEMPTYになることがないような値以上であるならば、ファンクション側コントローラ110からのDATAパケットの受信終了を待たずにUSBホストへDATAパケットの送信を開始することで、DATAパケットの送信タイミングを早くすることが可能となり、全体としての転送速度の向上を図ることが可能となる。   For this reason, when the host-side controller 120 according to the third embodiment receives a DATA packet from the function-side controller 110 and stores the DATA packet in the FIFO 108, the value of the data amount of the stored DATA packet is set to the counter 121. Manage with. If the value managed by the counter 121 is equal to or greater than the value at which the FIFO 108 does not become EMPTY even if the transfer of the DATA packet to the USB host is started at that time, the value from the function-side controller 110 is By starting the transmission of the DATA packet to the USB host without waiting for the completion of the reception of the DATA packet, the transmission timing of the DATA packet can be advanced, and the transfer rate as a whole can be improved.

また、ホスト側コントローラ100とUSBホストとの間での転送方式がアイソクロナス転送でなく、最大データ長がアイソクロナス転送よりも小さいバルク転送を行うようなアプリケーションの場合は、上記カウンタの設定値を低くすることが可能となり、より全体としての転送速度の向上を図ることが可能となる。   If the transfer method between the host-side controller 100 and the USB host is not isochronous transfer, and the application performs bulk transfer in which the maximum data length is smaller than that of isochronous transfer, the setting value of the counter is lowered. It becomes possible to improve the transfer speed as a whole.

〔実施の形態4〕
本発明のさらに他の実施形態について図9に基づいて説明すると以下の通りである。
[Embodiment 4]
Still another embodiment of the present invention will be described with reference to FIG.

先ず、実施の形態4に係る送受信システムの概略構成を図9に示す。図9に示す送受信システムは、ホスト側コントローラ130とファンクション側コントローラ110とから構成される。ホスト側コントローラ130は、ホスト側ステートマシン101、USB受信機102、FIFO103、変調回路104、光送信機105、光受信機106、復調回路107、FIFO108、USB送信機109、CRCチェック回路131を備えている。ホスト側コントローラ130において、CRCチェック回路131以外の構成要素はすべて、図1に示したホスト側コントローラ100と同一の構成および機能をもつため、詳細な説明は省略する。また、図9におけるファンクション側コントローラ110は、図1に示したファンクション側コントローラ110と同一のものであるため、これについても詳細な説明は省略する。   First, FIG. 9 shows a schematic configuration of a transmission / reception system according to the fourth embodiment. The transmission / reception system shown in FIG. 9 includes a host-side controller 130 and a function-side controller 110. The host-side controller 130 includes a host-side state machine 101, a USB receiver 102, a FIFO 103, a modulation circuit 104, an optical transmitter 105, an optical receiver 106, a demodulation circuit 107, a FIFO 108, a USB transmitter 109, and a CRC check circuit 131. ing. In the host-side controller 130, all the components other than the CRC check circuit 131 have the same configuration and function as those of the host-side controller 100 shown in FIG. Further, the function-side controller 110 in FIG. 9 is the same as the function-side controller 110 shown in FIG.

CRCチェック回路131は、ファンクション側コントローラ110から受信したDATAパケット中のCRC(Cyclic Redundancy Check)16を計算し、受信したDATAパケットに誤りがあるかどうかを判別することが可能である。CRCチェック回路131によって誤りがあると判断されたDATAパケットはホスト側ステートマシン101によって破棄され、USBパケットとして送信しないことで、送信にかかる電力を低減するとともに、USBホストが誤りのあるパケットを受信することで生じる予期せぬ異常動作の抑制を行うことが可能となる。   The CRC check circuit 131 can calculate a CRC (Cyclic Redundancy Check) 16 in the DATA packet received from the function-side controller 110 and determine whether or not there is an error in the received DATA packet. The DATA packet determined to have an error by the CRC check circuit 131 is discarded by the host-side state machine 101 and is not transmitted as a USB packet, so that the power required for transmission is reduced and the USB host receives an erroneous packet. This makes it possible to suppress unexpected abnormal operations that occur.

〔実施の形態5〕
本発明のさらに他の実施形態について図10に基づいて説明すると以下の通りである。
[Embodiment 5]
Still another embodiment of the present invention will be described with reference to FIG.

先ず、実施の形態5に係る送受信システムの概略構成を図10に示す。図10に示す送受信システムは、ホスト側コントローラ100とファンクション側コントローラ140とから構成される。ファンクション側コントローラ140は、ファンクション側ステートマシン111、光受信機112、復調回路113、FIFO114、USB送信機115、USB受信機116、FIFO117、変調回路118、光送信機119、CRCチェック回路141を備えている。ファンクション側コントローラ140において、CRCチェック回路141以外の構成要素はすべて、図1に示したファンクション側コントローラ110と同一の構成および機能をもつため、詳細な説明は省略する。また、図10におけるホスト側コントローラ100は、図1に示したホスト側コントローラ100と同一のものであるため、これについても詳細な説明は省略する。   First, FIG. 10 shows a schematic configuration of a transmission / reception system according to the fifth embodiment. The transmission / reception system shown in FIG. 10 includes a host-side controller 100 and a function-side controller 140. The function-side controller 140 includes a function-side state machine 111, an optical receiver 112, a demodulation circuit 113, a FIFO 114, a USB transmitter 115, a USB receiver 116, a FIFO 117, a modulation circuit 118, an optical transmitter 119, and a CRC check circuit 141. ing. In the function-side controller 140, all the components other than the CRC check circuit 141 have the same configuration and functions as those of the function-side controller 110 shown in FIG. Further, the host-side controller 100 in FIG. 10 is the same as the host-side controller 100 shown in FIG.

CRCチェック回路141は、USBファンクションから受信したDATAパケット中のCRC16を計算し、受信したDATAパケットに誤りがないかどうかを判別することが可能である。ここで、USBファンクションから受信したDATAパケットに誤りがある場合、これをホスト側コントローラ100に転送しても意味がなく、この場合のホスト−ファンクション間の低速通信路へのDATAパケットの転送は、無駄なものとなる。このため、CRCチェック回路141によって誤りがあると判断されたDATAパケットは、転送の途中でも該パケットの送信をやめることで、低速通信路の転送効率の悪化を抑制することが可能となる。   The CRC check circuit 141 can calculate the CRC 16 in the DATA packet received from the USB function and determine whether or not there is an error in the received DATA packet. If there is an error in the DATA packet received from the USB function, there is no point in transferring it to the host-side controller 100. In this case, the transfer of the DATA packet to the low-speed communication path between the host and the function is as follows: It becomes useless. For this reason, a DATA packet determined to have an error by the CRC check circuit 141 can be prevented from deteriorating the transfer efficiency of the low-speed communication path by stopping the transmission of the packet even during the transfer.

〔実施の形態6〕
本発明のさらに他の実施形態について図11および図12に基づいて説明すると以下の通りである。
[Embodiment 6]
Still another embodiment of the present invention will be described with reference to FIGS. 11 and 12 as follows.

先ず、実施の形態6に係る送受信システムの概略構成を図11に示す。図11に示す送受信システムは、ホスト側コントローラ150とファンクション側コントローラ110とから構成される。ホスト側コントローラ150は、ホスト側ステートマシン101、USB受信機102、FIFO103、変調回路104、光送信機105、光受信機106、復調回路107、FIFO151、USB送信機109、CRCチェック回路131を備えている。ホスト側コントローラ150において、FIFO151以外の構成要素はすべて、図9に示したホスト側コントローラ130と同一の構成および機能をもつため、詳細な説明は省略する。また、図11におけるファンクション側コントローラ110は、図1に示したファンクション側コントローラ110と同一のものであるため、これについても詳細な説明は省略する。   First, FIG. 11 shows a schematic configuration of a transmission / reception system according to the sixth embodiment. The transmission / reception system shown in FIG. 11 includes a host-side controller 150 and a function-side controller 110. The host-side controller 150 includes a host-side state machine 101, a USB receiver 102, a FIFO 103, a modulation circuit 104, an optical transmitter 105, an optical receiver 106, a demodulation circuit 107, a FIFO 151, a USB transmitter 109, and a CRC check circuit 131. ing. In the host-side controller 150, all the components other than the FIFO 151 have the same configuration and functions as those of the host-side controller 130 shown in FIG. Further, the function side controller 110 in FIG. 11 is the same as the function side controller 110 shown in FIG.

ホスト側コントローラ150は、ファンクション側コントローラ110からのDATAパケットを受信すると、ホスト側ステートマシン101が受信したDATAパケットをFIFO151に書き込むよう制御する。また、FIFO151にDATAパケットが格納されている状態で、ホスト側コントローラ150がUSBホストからINパケットを再受信するとFIFO151に格納されているDATAパケットをUSBホストに送信する。   When the host-side controller 150 receives the DATA packet from the function-side controller 110, the host-side controller 150 controls to write the DATA packet received by the host-side state machine 101 into the FIFO 151. When the host-side controller 150 re-receives the IN packet from the USB host while the DATA packet is stored in the FIFO 151, the DATA packet stored in the FIFO 151 is transmitted to the USB host.

このFIFO151は、DATAパケット送信時に、あらかじめリードポインタの値を保持しておく。ホスト側ステートマシン101は、DATAパケットをUSBホストに送信後、あらかじめ定められた一定時間の間にUSBホストからACKパケットを受信しない場合は、USBホストとホスト側コントローラ150との間の通信路において、データ誤りが発生したものと判断する。そして、ホスト側ステートマシン101は、前述のリードポインタの値にリードポインタを設定し、USBホストから次のINパケットを受信後、再び同じDATAパケットをUSBホストに送信する。   The FIFO 151 holds a read pointer value in advance when a DATA packet is transmitted. If the host-side state machine 101 does not receive an ACK packet from the USB host for a predetermined time after sending the DATA packet to the USB host, the host-side state machine 101 uses the communication path between the USB host and the host-side controller 150. It is determined that a data error has occurred. Then, the host-side state machine 101 sets the read pointer to the value of the read pointer described above, and after receiving the next IN packet from the USB host, transmits the same DATA packet to the USB host again.

この場合、FIFO151でのリードポインタの制御により、DATAパケットの再送を実現しているが、この再送処理は、RAMなどで開始アドレスを保持することにより実現しても問題ない。また、CRCチェック回路131を備えている場合、CRCチェック回路131によってファンクション側コントローラ110からの受信DATAパケットが正しいかどうかを判別することが可能であるため、受信DATAパケットが正しいと判別される場合のみ、上記再送処理を行うといった制御を行うことも可能となる。   In this case, the retransmission of the DATA packet is realized by the control of the read pointer in the FIFO 151, but this retransmission process can be realized by holding the start address in the RAM or the like. When the CRC check circuit 131 is provided, the CRC check circuit 131 can determine whether the received DATA packet from the function-side controller 110 is correct. Therefore, when the received DATA packet is determined to be correct. It is also possible to perform control such as performing the retransmission processing.

ここで、図12を用いて、本発明の実施の形態6におけるホスト側コントローラ150のホスト側ステートマシン101の動作説明を行う。   Here, the operation of the host-side state machine 101 of the host-side controller 150 according to the sixth embodiment of the present invention will be described with reference to FIG.

S1101は、USBホストからINパケットを受信したかどうかを判別するステップである。INパケットを受信した場合はS1102へ、またINパケット以外のパケットを受信した場合は再びS1101へそれぞれ遷移する。   S1101 is a step of determining whether or not an IN packet has been received from the USB host. If an IN packet is received, the process proceeds to S1102, and if a packet other than the IN packet is received, the process proceeds to S1101 again.

S1102は、ファンクション側コントローラ110にINパケットを送信するステップである。INパケット送信終了後S1103へと遷移する。   S 1102 is a step of transmitting an IN packet to the function-side controller 110. After the IN packet transmission is completed, the process proceeds to S1103.

S1103は、ファンクション側コントローラ110から、DATAパケットを受信しているかどうかを判別するステップである。DATAパケットを受信していた場合はS1105へ、受信していない場合はS1104へそれぞれ遷移する。   S1103 is a step of determining whether or not a DATA packet has been received from the function-side controller 110. If a DATA packet has been received, the process proceeds to S1105, and if not, the process proceeds to S1104.

S1104は、USBホストに対して、NAKパケットを送信するステップである。NAKパケットを送信完了後S1101へと遷移する。   S1104 is a step of transmitting a NAK packet to the USB host. After the transmission of the NAK packet is completed, the process proceeds to S1101.

S1105は、USBホストに対して、DATAパケットを送信するステップである。DATAパケット送信終了後、タイマをスタートし、S1106へと遷移する。   S1105 is a step of transmitting a DATA packet to the USB host. After completion of the DATA packet transmission, the timer is started and the process proceeds to S1106.

S1106は、USBホストからACKパケットを受信したかどうかを判別するステップである。ACKパケットを受信した場合はS1107へと遷移し、ACKパケットを受信せずに予め定められた時間が経過してタイムアウトした場合はS1108へとそれぞれ遷移する。   S1106 is a step of determining whether or not an ACK packet has been received from the USB host. If an ACK packet is received, the process proceeds to S1107. If a predetermined time has elapsed without receiving an ACK packet, the process proceeds to S1108.

S1107は、USBファンクションに対してACKパケットを送信するステップである。ACKパケット送信終了後INトランザクションを終了する。   S1107 is a step of transmitting an ACK packet to the USB function. After the ACK packet transmission ends, the IN transaction ends.

S1108は、USBホストからINパケットを受信したかどうかを判別するステップである。INパケットを受信した場合はS1105へ、また、それ以外のパケットを受信した場合は再びS1108へとそれぞれ遷移する。   S1108 is a step of determining whether or not an IN packet has been received from the USB host. If an IN packet is received, the process proceeds to S1105. If any other packet is received, the process proceeds to S1108 again.

ホスト側コントローラ150において、上記のようなステートマシンの動作をおこなうことにより、ホスト側コントローラ150がDATAパケットをUSBホストに対して送信する際に、USBホストとホスト側コントローラ150との間でデータ誤りが発生した場合も、DATAパケットの再送処理を行うことが可能となる。   By performing the state machine operation as described above in the host-side controller 150, when the host-side controller 150 transmits a DATA packet to the USB host, a data error occurs between the USB host and the host-side controller 150. Even when this occurs, it is possible to perform retransmission processing of the DATA packet.

〔実施の形態7〕
本発明のさらに他の実施形態について図13ないし図15に基づいて説明すると以下の通りである。
[Embodiment 7]
Still another embodiment of the present invention will be described with reference to FIGS.

先ず、実施の形態7に係る送受信システムの概略構成を図13に示す。図13に示す送受信システムは、ホスト側コントローラ100とファンクション側コントローラ160とから構成される。ファンクション側コントローラ160は、ファンクション側ステートマシン111、光受信機112、復調回路113、FIFO114、USB送信機115、USB受信機116、FIFO161、変調回路118、光送信機119、CRCチェック回路141を備えている。ファンクション側コントローラ160において、FIFO161以外の構成要素はすべて、図10に示したファンクション側コントローラ140と同一の構成および機能をもつため、詳細な説明は省略する。また、図13におけるホスト側コントローラ100は、図1に示したホスト側コントローラ100と同一のものであるため、これについても詳細な説明は省略する。   First, FIG. 13 shows a schematic configuration of a transmission / reception system according to the seventh embodiment. The transmission / reception system shown in FIG. 13 includes a host controller 100 and a function controller 160. The function-side controller 160 includes a function-side state machine 111, an optical receiver 112, a demodulation circuit 113, a FIFO 114, a USB transmitter 115, a USB receiver 116, a FIFO 161, a modulation circuit 118, an optical transmitter 119, and a CRC check circuit 141. ing. In the function-side controller 160, all the components other than the FIFO 161 have the same configuration and function as those of the function-side controller 140 shown in FIG. Further, the host-side controller 100 in FIG. 13 is the same as the host-side controller 100 shown in FIG.

ファンクション側コントローラ160は、USBファンクションからDATAパケットを受信すると、ファンクション側ステートマシン111が、受信したDATAパケットをFIFO161に書き込むよう制御する。また、上記DATAパケットは、変調回路118により例えば8B10B変調され、ホスト側コントローラ100に対して送信される。   When receiving the DATA packet from the USB function, the function-side controller 160 controls the function-side state machine 111 to write the received DATA packet into the FIFO 161. The DATA packet is modulated by, for example, 8B10B by the modulation circuit 118 and transmitted to the host-side controller 100.

このFIFO161は、DATAパケット送信時に、あらかじめリードポインタの値を保持しておく。ファンクション側ステートマシン111は、ホスト側コントローラ100から、再送要求を受信した場合は、前述のリードポインタの値にリードポインタを設定し、再び同じDATAパケットをホスト側コントローラ100に向かって送信する。   This FIFO 161 holds the value of the read pointer in advance when transmitting a DATA packet. When the function-side state machine 111 receives a retransmission request from the host-side controller 100, the function-side state machine 111 sets the read pointer to the aforementioned read pointer value and transmits the same DATA packet toward the host-side controller 100 again.

この場合、FIFO161のリードポインタの制御により、DATAパケットの再送を実現しているが、この再送処理は、RAMなどで開始アドレスを保持することにより実現しても問題ない。また、CRCチェック回路141を備えている場合、CRCチェック回路141によってUSBファンクションからの受信DATAパケットが正しいかどうかを判別することが可能であるため、受信DATAパケットが正しいと判別される場合のみ、上記再送処理を行うといった制御を行うことも可能となる。   In this case, the retransmission of the DATA packet is realized by the control of the read pointer of the FIFO 161, but this retransmission process can be realized by holding the start address in a RAM or the like. When the CRC check circuit 141 is provided, the CRC check circuit 141 can determine whether or not the received DATA packet from the USB function is correct. Therefore, only when the received DATA packet is determined to be correct, It is also possible to perform control such as performing the above retransmission processing.

ここで、図14を用いて、本発明の実施の形態7におけるホスト側コントローラ100のホスト側ステートマシン101の動作説明を行う。尚、この再送処理に関するホスト側ステートマシン101は、実施の形態1もしくは実施の形態2に示すホスト側コントローラ100のステートマシンに組み込まれても、また単独で存在してもどちらでもよい。   Here, the operation of the host-side state machine 101 of the host-side controller 100 according to the seventh embodiment of the present invention will be described with reference to FIG. The host-side state machine 101 related to this retransmission process may be incorporated in the state machine of the host-side controller 100 shown in the first or second embodiment, or may exist alone.

S1301は、ファンクション側コントローラ160から受信したパケットがDATAパケットであるかどうかを判別するステップである。DATAパケットである場合はS1302へ、また、それ以外のパケットである場合は再びS1301へと遷移する。   S1301 is a step of determining whether or not the packet received from the function-side controller 160 is a DATA packet. If it is a DATA packet, the process proceeds to S1302, and if it is any other packet, the process proceeds to S1301 again.

S1302は、受信DATAパケットに誤りがないかどうかを判別するステップである。誤りが無い場合は再送要求を行わずに処理を終了する。また、誤りがある場合はS1303へと遷移する。   S1302 is a step of determining whether or not there is an error in the received DATA packet. If there is no error, the process is terminated without making a retransmission request. If there is an error, the process proceeds to S1303.

S1303は、ファンクション側コントローラ160に対してDATAパケットの再送を要求するステップである。再送要求が終了した後S1301へと遷移する。   In step S1303, the function-side controller 160 is requested to retransmit the DATA packet. After the retransmission request is completed, the process proceeds to S1301.

上記の動作を行うことにより、ホスト側コントローラ100とファンクション側コントローラ160との間の通信路において、DATAパケットに誤りが発生した場合は、ホスト側コントローラ100は、ファンクション側コントローラ160に対して、その旨を通知することが可能となる。   By performing the above operation, if an error occurs in the DATA packet in the communication path between the host-side controller 100 and the function-side controller 160, the host-side controller 100 sends the error to the function-side controller 160. It is possible to notify the effect.

次に、図15を用いて、実施の形態7に係るファンクション側コントローラ160のファンクション側ステートマシン111の動作を説明する。尚、この再送処理に関するファンクション側ステートマシン111は、実施の形態1もしくは実施の形態2に示すファンクション側コントローラ160のステートマシンに組み込まれても、また単独で存在してもどちらでもよい。   Next, the operation of the function side state machine 111 of the function side controller 160 according to the seventh embodiment will be described with reference to FIG. Note that the function-side state machine 111 relating to this retransmission processing may be incorporated into the state machine of the function-side controller 160 shown in the first or second embodiment, or may exist alone.

S1401は、USBファンクションから受信したパケットがDATAパケットかどうかを判別するステップである。DATAパケットである場合はS1402へ、また、それ以外のパケットである場合は再びS1401へとそれぞれ遷移する。   S1401 is a step of determining whether or not the packet received from the USB function is a DATA packet. If it is a DATA packet, the process proceeds to S1402, and if it is any other packet, the process proceeds to S1401 again.

S1402は、ホスト側コントローラ100にDATAパケットを送信するステップである。DATAパケット送信完了後S1403へと遷移する。   S1402 is a step of transmitting a DATA packet to the host-side controller 100. After the completion of DATA packet transmission, the process proceeds to S1403.

S1403は、ホスト側コントローラ100から受信した信号を判別するステップである。再送要求であればS1402へ、またACKパケットである場合は再送処理は行わずに処理を終了する。   S1403 is a step of discriminating a signal received from the host-side controller 100. If the request is a retransmission request, the process proceeds to S1402. If the request is an ACK packet, the process is terminated without performing the retransmission process.

上記の動作を行うことにより、ホスト側コントローラ100からの再送要求を元にファンクション側コントローラ160が例えばFIFO161のリードポインタを設定しなおすことにより、再送処理が可能となる。   By performing the above operation, the function-side controller 160 resets the read pointer of the FIFO 161, for example, based on the retransmission request from the host-side controller 100, thereby enabling retransmission processing.

また、ファンクション側コントローラ160は、ホスト側コントローラ100から再送要求を受けた時に、USBファンクションにINパケットを送信を,その返答として受信したDATAパケットをUSBホストに送信するものであっても良い。   Further, when receiving a retransmission request from the host-side controller 100, the function-side controller 160 may send an IN packet to the USB function and send a DATA packet received as a response to the USB host.

〔実施の形態8〕
本発明のさらに他の実施形態について図16に基づいて説明すると以下の通りである。
[Embodiment 8]
Still another embodiment of the present invention will be described with reference to FIG.

図16に、本実施の形態8に係るパケットフォーマットを示す。図16において、USBパケットとは、USBで規定された転送速度で通信されるデータパケットのパケットフォーマットであり、また、低速用パケットとは、低速通信路用に変換されたパケットフォーマットである。つまり、低速用パケットは、ファンクション側コントローラがホスト側コントローラに向けてDATAパケットを送信する際のパケットフォーマットである。   FIG. 16 shows a packet format according to the eighth embodiment. In FIG. 16, a USB packet is a packet format of a data packet communicated at a transfer rate defined by USB, and a low-speed packet is a packet format converted for a low-speed communication path. That is, the low-speed packet is a packet format when the function-side controller transmits a DATA packet to the host-side controller.

図16に示すように、低速用パケットでは、USBパケットのCRC16の後に、CRC_OKというフィールドが設けてある。ファンクション側コントローラが保有しているDATAパケットに誤りが無い場合は、上記CRC_OKのフィールドにその旨を示す値を入れ(その旨を示すフラグを立て)、また保有しているDATAパケットに誤りがある場合は、同じくその旨を入れてホスト側コントローラに該DATAパケットを送信する。そうすることで、ファンクション側コントローラの保有しているDATAパケットが再送できるパケットかどうかという情報をホスト側コントローラに通知することが可能となる。ホスト側コントローラにおいては、上記CRC_OKフィールドを監視することにより、仮に受信DATAパケットに誤りがあると判断された場合に、ファンクション側コントローラに対して、再送要求を行うかどうかの制御を行うことが可能となる。   As shown in FIG. 16, in the low-speed packet, a field CRC_OK is provided after the CRC 16 of the USB packet. When there is no error in the DATA packet held by the function-side controller, a value indicating that is put in the CRC_OK field (a flag indicating that is set), and there is an error in the held DATA packet. In this case, the DATA packet is transmitted to the host-side controller with the same effect. By doing so, it is possible to notify the host-side controller of information on whether or not the DATA packet held by the function-side controller is a retransmittable packet. By monitoring the CRC_OK field, the host-side controller can control whether to make a retransmission request to the function-side controller if it is determined that there is an error in the received DATA packet. It becomes.

〔実施の形態9〕
本発明のさらに他の実施形態について図17ないし図20に基づいて説明すると以下の通りである。
[Embodiment 9]
Still another embodiment of the present invention will be described with reference to FIGS.

先ず、実施の形態9に係る送受信システムの概略構成を図17に示す。図17に示す送受信システムは、ホスト側コントローラ170とファンクション側コントローラ180とから構成される。ホスト側コントローラ170は、ホスト側ステートマシン101、USB受信機102、FIFO103、変調回路104、光送信機105、光受信機106、復調回路107、FIFO108、USB送信機109、スピードネゴシエーションステートマシン171、エラー検出回路172、タイマ173を備えている。ホスト側コントローラ170において、スピードネゴシエーションステートマシン171、エラー検出回路172以外の構成要素はすべて、図1に示したホスト側コントローラ100と同一の構成および機能をもつため、詳細な説明は省略する。また、ファンクション側コントローラ180は、ファンクション側ステートマシン111、光受信機112、復調回路113、FIFO114、USB送信機115、USB受信機116、FIFO117、変調回路118、光送信機119、スピードネゴシエーションステートマシン181、エラー検出回路182、タイマ183を備えている。ファンクション側コントローラ180において、スピードネゴシエーションステートマシン181、エラー検出回路182以外の構成要素はすべて、図1に示したファンクション側コントローラ110と同一の構成および機能をもつため、詳細な説明は省略する。   First, FIG. 17 shows a schematic configuration of a transmission / reception system according to the ninth embodiment. The transmission / reception system shown in FIG. 17 includes a host-side controller 170 and a function-side controller 180. The host-side controller 170 includes a host-side state machine 101, a USB receiver 102, a FIFO 103, a modulation circuit 104, an optical transmitter 105, an optical receiver 106, a demodulation circuit 107, a FIFO 108, a USB transmitter 109, a speed negotiation state machine 171, An error detection circuit 172 and a timer 173 are provided. In the host-side controller 170, all the components other than the speed negotiation state machine 171 and the error detection circuit 172 have the same configuration and functions as those of the host-side controller 100 shown in FIG. The function-side controller 180 includes a function-side state machine 111, an optical receiver 112, a demodulation circuit 113, a FIFO 114, a USB transmitter 115, a USB receiver 116, a FIFO 117, a modulation circuit 118, an optical transmitter 119, and a speed negotiation state machine. 181, an error detection circuit 182, and a timer 183. In the function-side controller 180, all the components other than the speed negotiation state machine 181 and the error detection circuit 182 have the same configuration and functions as those of the function-side controller 110 shown in FIG.

スピードネゴシエーションステートマシン171および181は、ホスト側コントローラ170とファンクション側コントローラ180との間において、スピードネゴシエーション(転送速度調整)を行って、複数の転送速度から一つの転送速度を選択するためのステートマシンである。エラー検出回路172、182は、低速通信路(図17においては、ホスト−ファンクション間の光通信路)のエラー検出を行う回路である。尚、このスピードネゴシエーションは、INトランザクションの実行前に行われる。   The speed negotiation state machines 171 and 181 perform state negotiation (transfer speed adjustment) between the host-side controller 170 and the function-side controller 180 and select one transfer speed from a plurality of transfer speeds. It is. The error detection circuits 172 and 182 are circuits that perform error detection on a low-speed communication path (in FIG. 17, an optical communication path between the host and the function). This speed negotiation is performed before the execution of the IN transaction.

図18を用いて、スピードネゴシエーションの動作を説明する。尚、図18におけるスピードネゴシエーションのプロトコルは一例であり、本発明はこのプロトコルに限定されるものではない。   The speed negotiation operation will be described with reference to FIG. The speed negotiation protocol in FIG. 18 is an example, and the present invention is not limited to this protocol.

ホスト側コントローラ170のスピードネゴシエーションステートマシン171は、t1401において、所定の転送速度Aで、keep_speed信号の送信を開始し、また、keep_speed信号の送信と同時にタイマをスタートさせる。なお、keep_speed信号は、転送速度を決めるための送信コード(リクエスト信号)の1つであり、ファンクション側コントローラ180に、現在の転送速度を維持することを求める信号である。   The speed negotiation state machine 171 of the host-side controller 170 starts transmitting a keep_speed signal at a predetermined transfer speed A at t1401, and starts a timer simultaneously with the transmission of the keep_speed signal. The keep_speed signal is one of transmission codes (request signals) for determining the transfer rate, and is a signal for requesting the function-side controller 180 to maintain the current transfer rate.

一方、ファンクション側コントローラ180では、このkeep_speed信号の受信をシグナルディテクト信号によって確認すると、t1402において、タイマをスタートさせると共に、ホスト側コントローラ170に対するkeep_speed信号の送信を開始する。   On the other hand, when the function-side controller 180 confirms reception of the keep_speed signal with the signal detect signal, the function-side controller 180 starts a timer and starts transmission of the keep_speed signal to the host-side controller 170 at t1402.

ホスト側コントローラ170およびファンクション側コントローラ180のそれぞれは、予め定められた時間Tの期間は、特定の送信コードを送信しつづける。   Each of the host-side controller 170 and the function-side controller 180 continues to transmit a specific transmission code during a predetermined time T.

t1403においてホスト側コントローラ170から送信されたkeep_speed信号が、光通信路においてピット化けし、ファンクション側コントローラ180が正常に受信できなかった場合、ファンクション側コントローラ180は、t1404において、keep_speed信号に代えて、lower_speed信号をホスト側コントローラ170に送信する。このlower_speed信号は、転送速度を決めるためのリクエスト信号の1つであり、送信先(ホスト側コントローラ170)に、転送速度を下げるよう求める信号である。   If the keep_speed signal transmitted from the host-side controller 170 at t1403 is pitted in the optical communication path and the function-side controller 180 cannot receive normally, the function-side controller 180 replaces the keep_speed signal at t1404, A lower_speed signal is transmitted to the host-side controller 170. This lower_speed signal is one of request signals for determining the transfer rate, and is a signal for requesting the transmission destination (host-side controller 170) to lower the transfer rate.

ファンクション側コントローラ180からのlower_speed信号を受信したホスト側コントローラ170では、現在の転送速度Aでは、ファンクション側コントローラ180が受信を正常に行えないと認識する。そして、ファンクション側コントローラ180に対し、lower_speed信号を送信する(t1405において、送信コードをlower_speedに切り替える)。   The host-side controller 170 that has received the lower_speed signal from the function-side controller 180 recognizes that the function-side controller 180 cannot normally receive at the current transfer rate A. Then, a lower_speed signal is transmitted to the function-side controller 180 (at t1405, the transmission code is switched to lower_speed).

ファンクション側コントローラ180は、t1406において、ホスト側コントローラ170からlower_speed信号を受信することで、自身の送信したlower_speed信号がホスト側コントローラ170に認識されたと判断する。   The function-side controller 180 receives the lower_speed signal from the host-side controller 170 at t1406, thereby determining that the lower-speed signal transmitted by the function-side controller 180 has been recognized by the host-side controller 170.

そして、ホスト側コントローラ170およびファンクション側コントローラ180のそれぞれにおいて所定時間Tの経過後、ホスト側コントローラ170およびファンクション側コントローラ180は、その時点で送受信されている信号がlower_speed信号であるため、転送速度を、例えば半分(A/2)に低下させる。   Then, after a predetermined time T has elapsed in each of the host-side controller 170 and the function-side controller 180, the host-side controller 170 and the function-side controller 180 have a transfer rate that is the lower_speed signal because the signal being transmitted and received at that time is For example, it is reduced to half (A / 2).

すなわち、ホスト側コントローラ170が、t1407において、転送速度A/2でkeep_speed信号の送信を開始するとともに、タイマをリスタートさせる。一方、ファンクション側コントローラ180も、t1408において、転送速度A/2でkeep_speed信号の送信を開始するとともに、タイマをリスタートさせる。   That is, at t1407, the host-side controller 170 starts transmitting a keep_speed signal at the transfer rate A / 2 and restarts the timer. On the other hand, the function-side controller 180 also starts transmitting a keep_speed signal at the transfer rate A / 2 at t1408 and restarts the timer.

そして、ホスト側コントローラ170およびファンクション側コントローラ180の双方でエラーが検出されずに所定時間Tが経過すると、ホスト側コントローラ170およびファンクション側コントローラ180は、t1409、t1410において、スピードネゴシエーションの終了信号(終了リクエスト)であるEnd_Nego信号の送信を開始する。そして、ホスト側コントローラ170およびファンクション側コントローラ180のそれぞれは、相手機器からのEnd_Nego信号を受信したときに、スピードネゴシエーションを終了し、アクティブ状態へと遷移する。   Then, when a predetermined time T has elapsed without an error being detected by both the host-side controller 170 and the function-side controller 180, the host-side controller 170 and the function-side controller 180 indicate a speed negotiation end signal (end) at t1409 and t1410. Transmission of an End_Nego signal, which is a request). Each of the host-side controller 170 and the function-side controller 180 ends the speed negotiation when it receives the End_Nego signal from the counterpart device, and transitions to the active state.

ここで、図19を用いて、ホスト側コントローラ170におけるスピードネゴシエーションステートマシン171の動作を説明する。   Here, the operation of the speed negotiation state machine 171 in the host-side controller 170 will be described with reference to FIG.

ステートST0は、スピードネゴシエーションの開始ステートである。ここでは、スピードネゴシエーションステートマシン171は、送信コードをkeep_speed信号とし、タイマをリスタートした後、ステートST1に状態を遷移する。   State ST0 is a speed negotiation start state. Here, the speed negotiation state machine 171 uses the transmission code as a keep_speed signal, restarts the timer, and then transitions to the state ST1.

ステートST1は、スピードネゴシエーションを行うステートである。ここでは、スピードネゴシエーションステートマシン171は、受信コードにエラーがあるか、相手機器(ファンクション側コントローラ180)からのlower_speed信号を受信した場合は、送信コードをlower_speedに切り替える。   The state ST1 is a state for performing speed negotiation. Here, the speed negotiation state machine 171 switches the transmission code to lower_speed when there is an error in the reception code or when a lower_speed signal is received from the counterpart device (function-side controller 180).

また、スピードネゴシエーションステートマシン171は、所定時間Tの経過した後、送信コードがlower_speed信号であった場合はステートST0へ、また送信コードがkeep_speedであった場合はステートST2に状態を遷移する。   Further, after a predetermined time T has elapsed, the speed negotiation state machine 171 transitions to the state ST0 when the transmission code is a lower_speed signal, and transitions to the state ST2 when the transmission code is keep_speed.

ここで、ステートST0に遷移する場合は、転送速度を現在の転送速度に対して、例えば半分にする(転送速度の低下の幅(度合い)は、ユーザーの所望の値に設定可能である。また、この幅は、あらかじめスピードネゴシエーションステートマシン171に記憶されている)。   Here, when transitioning to the state ST0, the transfer rate is halved with respect to the current transfer rate, for example (the width (degree) of decrease in the transfer rate can be set to a value desired by the user. This width is stored in advance in the speed negotiation state machine 171).

一方、ステートST2に遷移する場合は、送信コードをEnd_Nego信号へと切り替える。このステートST2は、スピードネゴシエーションの終了を確認するステートである。相手機器(ファンクション側コントローラ180)からEnd_Nego信号を受信すると、スピードネゴシエーションを終了し、アクティプ状態へと遷移する。   On the other hand, when transitioning to the state ST2, the transmission code is switched to the End_Nego signal. This state ST2 is a state for confirming the end of the speed negotiation. When the End_Nego signal is received from the counterpart device (function side controller 180), the speed negotiation is terminated and the state transits to the active state.

次に、図20を用いて、ファンクション側コントローラ180におけるスピードネゴシエーションステートマシン181の動作について説明する。   Next, the operation of the speed negotiation state machine 181 in the function-side controller 180 will be described with reference to FIG.

ステートST0,ST1,ST2の各ステートにおける動作は、スピードネゴシエーションステートマシン171の動作と同一である。   The operation in each of the states ST0, ST1, and ST2 is the same as the operation of the speed negotiation state machine 171.

ステートST0の前の状態であるステートST4は、ホスト側コントローラ170からリクエスト信号を受信したか否かを判別するステートである。光受信機112(あるいは他の受信信号検出回路)からシグナルディテクト信号を受けた場合、スピードネゴシエーションステートマシン181は、ステートST0に状態を遷移する。   State ST4, which is a state before state ST0, is a state for determining whether or not a request signal has been received from host-side controller 170. When receiving a signal detect signal from the optical receiver 112 (or other received signal detection circuit), the speed negotiation state machine 181 transitions to the state ST0.

上記のステートマシンをホスト側コントローラ170とファンクション側コントローラ180とがそれぞれ構成することで、複数の転送速度から一つの転送速度を決定することが可能となる。   By configuring the state machine with the host-side controller 170 and the function-side controller 180, one transfer rate can be determined from a plurality of transfer rates.

エラー検出回路172および182は、ホスト−ファンクション間の光通信路におけるビットエラーの検出を行う。具体的には、例えば8B10B復調時にテーブル引きを行い、テーブルにないキャラクタを受信した場合はエラーとする。このエラーの定義については、言及しない。   The error detection circuits 172 and 182 detect bit errors in the optical communication path between the host and the function. Specifically, for example, table lookup is performed at the time of 8B10B demodulation, and an error occurs when a character not in the table is received. I will not mention the definition of this error.

スピードネゴシエーション終了後、アクティブ状態になると、エラー検出回路172および182により得られたエラー数とタイマ173および183の計測値により、一定時間におけるエラー数(エラーレート)を測定することが可能となる。前記エラーレートが予め定められた値よりも大きい場合は、通信路の品質が悪くなっている(例えばモバイル機器とPC(Personal Computer)間の通信におけるモバイル機器とPCとの通信距離の変化など)と判断されるため、現時点での転送速度での通信をあきらめ、再度スピードネゴシエーションを行い、正常な通信が可能な転送速度を再決定した後、INトランザクションを行うことで正常にデータ転送を行うことが可能となる。   When an active state is established after the speed negotiation is completed, the number of errors (error rate) in a fixed time can be measured from the number of errors obtained by the error detection circuits 172 and 182 and the measured values of the timers 173 and 183. When the error rate is larger than a predetermined value, the quality of the communication path is deteriorated (for example, a change in the communication distance between the mobile device and the PC in communication between the mobile device and the PC (Personal Computer)). Therefore, after giving up communication at the current transfer rate, performing speed negotiation again, re-determining the transfer rate at which normal communication is possible, and then performing data transfer normally by performing an IN transaction. Is possible.

また、本実施の形態に係る説明では、ホスト−ファンクション間の光通信路はUSBのネイティブ速度よりも低い転送速度であることを想定しているが、将来的に安価でより高速な光トランシーバが製造可能となれば、ホスト−ファンクション間における光通信路でUSBのネイティブ速度でのデータ転送が可能な通信手段を用いることも考えられる。このような場合、はじめはUSBのネイティブ速度に相当する速度(8B10B変調の場合、600Mbps)でスピードネゴシエーションを行い、仮にエラーレートが悪くなかった場合は、本発明のステートマシンによるパケット制御を行わずに、純粋なリピートを行うことでUSB2.0の純粋な光化を行うことが可能となり、データ転送速度の低下を防ぐことができる。   In the description according to the present embodiment, it is assumed that the optical communication path between the host and the function has a transfer speed lower than the native speed of USB. However, an inexpensive and faster optical transceiver will be used in the future. If it can be manufactured, it is possible to use a communication means capable of transferring data at the USB native speed on the optical communication path between the host and the function. In such a case, first, speed negotiation is performed at a speed corresponding to the native speed of USB (600 Mbps in the case of 8B10B modulation). If the error rate is not bad, packet control by the state machine of the present invention is not performed. In addition, it is possible to perform pure opticalization of USB 2.0 by performing pure repeat, and it is possible to prevent a decrease in data transfer speed.

そして、600Mbpsで正常に通信ができなければ、転送速度を落とした上で本発明のステートマシンによりパケットを制御し、INトランザクションを行うことが可能となる。つまり、ステートマシンによるパケットの制御のON、OFFをスピードネゴシエーションの結果で判断することにより、最も高効率な方法でパケット転送を行うことが可能となる。   If communication cannot be performed normally at 600 Mbps, the packet can be controlled by the state machine of the present invention after the transfer rate is lowered, and an IN transaction can be performed. That is, it is possible to perform packet transfer by the most efficient method by determining ON / OFF of packet control by the state machine based on the result of speed negotiation.

尚、上記実施の形態1ないし9の説明は、ホスト−ファンクション間の通信速度がUSBのネイティブ速度に比べて低速であり、従来の伝送方式ではUSBで規定されている制約時間内での通信が完了しないといった課題を解決するものとして記載されている。しかしながら、ホスト−ファンクション間の通信速度がUSBのネイティブ速度と等しい場合であっても、ホスト−ファンクション間の通信経路が非常に長くなる場合(例えば数100mの光ファイバ)には、ターンアラウンドタイムが長くなり、制約時間内にINトランザクションを終了できなくなる可能性がある。これは、USBの規格では、USBハブの段数(最大6段)のリピート時間とUSBのケーブル長(最大5m)によって、最大ターンアラウンドタイムが定められているためである。本発明の伝送方法は、このようにホスト−ファンクション間の通信経路が非常に長くなり、従来の伝送方式ではUSBで規定されている制約時間内での通信が完了しないといった場合においても適用可能である。   In the description of the first to ninth embodiments, the communication speed between the host and the function is lower than the native speed of the USB. In the conventional transmission method, communication within the restricted time defined by the USB is possible. It is described as solving the problem of not completing. However, even when the host-function communication speed is equal to the USB native speed, if the host-function communication path is very long (for example, an optical fiber of several hundred meters), the turnaround time is There is a possibility that the IN transaction cannot be completed within the restricted time. This is because in the USB standard, the maximum turnaround time is determined by the repeat time of the number of stages of the USB hub (maximum of 6 stages) and the cable length of the USB (maximum of 5 m). The transmission method of the present invention can be applied even when the communication path between the host and the function becomes very long as described above, and the conventional transmission method does not complete communication within the restricted time defined by USB. is there.

また、上記実施の形態1ないし9の説明においては、USB2.0規格を想定しているが、USB2.0規格ではホスト側とファンクション側との機能がそれぞれ固定している。すなわち、USB2.0規格の下でのデータのやり取りは、PCをUSBホストとして、該PCにUSBファンクションとなるデバイス(デジタルカメラやプリンタ等)を接続して行っていた。   In the description of the first to ninth embodiments, the USB 2.0 standard is assumed. In the USB 2.0 standard, the functions on the host side and the function side are fixed. That is, data exchange under the USB 2.0 standard is performed by connecting a device (digital camera, printer, or the like) serving as a USB function to the PC using the PC as a USB host.

しかしながら、近年、USB−OTG(USB-On-The-Go)という規格が制定され、通常USBシステムで必要であったPC(USBホスト)が必要でなくなっている。すなわち、USB−OTG規格では、PC(USBホスト)なしにUSB機器同士でデータの送受信が可能であるため、利便性の向上が図られている。USB−OTGにおいては、繋がれたケーブルのコネクタの種類により、USBホストとしても、USBファンクションとしても動作可能となる。   However, in recent years, a standard called USB-OTG (USB-On-The-Go) has been established, and a PC (USB host) that is normally required in a USB system is no longer necessary. That is, in the USB-OTG standard, data can be transmitted and received between USB devices without a PC (USB host), so that convenience is improved. The USB-OTG can operate as a USB host or a USB function depending on the type of connector of the connected cable.

USB−OTGでは、USB2.0と同様に、LS(1.5Mbps),FS(12Mbps),HS(480Mbps)の転送速度をサポートしている。また、USB−OTG対応機器は、USBホストとしても、またUSBファンクションとしても動作可能である。また、USB−OTG規格においては、miniABという新しいコネクタの種類が追加された。このminiABは、miniA,miniBの両方のプラグを持ったケーブルを接続することが可能であり、接続されるケーブルのプラグの形状により、miniAが接続された場合は、USBホストとして動作し、またminiBが接続された場合は、USBファンクションとして動作する。また、HNP(Host Negotiation Protocol)という新しいプロトコルにより、ケーブルを接続した状態で、動的にホストとファンクションの機能を交代するといった機構を追加されている。つまり、USB−OTGでは、接続される機器がUSBホストとなるかUSBファンクションとなるかは、ケーブルのコネクタの種類、もしくはUSB−OTGで定められたHNP(Host Negotiation Protocol)で決定する。   USB-OTG supports transfer rates of LS (1.5 Mbps), FS (12 Mbps), and HS (480 Mbps) as in USB 2.0. Further, the USB-OTG compatible device can operate as a USB host or a USB function. In the USB-OTG standard, a new connector type called miniAB has been added. This miniAB can be connected to a cable having both miniA and miniB plugs. Depending on the shape of the plug of the connected cable, when miniA is connected, it operates as a USB host, and miniB When is connected, it operates as a USB function. In addition, a new protocol called HNP (Host Negotiation Protocol) has added a mechanism for dynamically changing the function of the host and the function while the cable is connected. In other words, in USB-OTG, whether the connected device is a USB host or a USB function is determined by the type of cable connector or HNP (Host Negotiation Protocol) defined by USB-OTG.

すなわち、本発明をこのUSB−OTGに応用する場合、USBホストおよびUSBファンクションはその役割が固定されているものではなく、伝送されるデータの方向によってその役割が入れ替わることもありうる。同様に、ホスト側コントローラおよびファンクション側コントローラもその役割が固定されているものではなく、伝送されるデータの方向によってその役割が入れ替わることも可能であるため、一つの通信コントローラがホスト側コントローラとファンクション側コントローラとの両方の機能を持っていることが好ましい。このためには、各コントローラのステートマシンにおいて、ホスト側コントローラおよびファンクション側コントローラの両方の機能として動作可能なプログラムが組み込まれていれば良い。   That is, when the present invention is applied to the USB-OTG, the roles of the USB host and the USB function are not fixed, and the roles may be switched depending on the direction of data to be transmitted. Similarly, the roles of the host-side controller and the function-side controller are not fixed, and the roles can be switched depending on the direction of the transmitted data. It is preferable to have both functions of the side controller. For this purpose, it is only necessary to incorporate a program operable as a function of both the host-side controller and the function-side controller in the state machine of each controller.

また、上記実施の形態1ないし9の説明において、ホスト側コントローラおよびファンクション側コントローラ間の通信は全二重通信である。こうすることで、ホスト−ファンクション間の通信において、半二重通信の際に必要なプリアンブルをなくすことが可能となり、通信路の使用効率を向上することができる。もちろん、半二重通信でシステムを構築しても問題はない。   In the description of the first to ninth embodiments, communication between the host-side controller and the function-side controller is full-duplex communication. By doing so, it is possible to eliminate the preamble necessary for half-duplex communication in the communication between the host and the function, and the use efficiency of the communication path can be improved. Of course, there is no problem even if the system is constructed with half-duplex communication.

本発明に係る送受信システムでは、以上の実施の形態にて説明したように、USBネイティブの速度よりも遅い速度(例えば100Mbps)でUSBホスト−ホスト側コントローラ−ファンクション側コントローラ−USBファンクション間のデータ転送を行う場合であっても、USBネイティブの速度(480Mbps)でUSBホストとUSBファンクション間のデータ転送を行う場合に比べて、全体としてほぼ同じ転送速度が得られる場合もある。   In the transmission / reception system according to the present invention, as described in the above embodiment, data transfer between the USB host, the host side controller, the function side controller, and the USB function at a speed (for example, 100 Mbps) slower than the USB native speed. Even when performing the above, there may be a case where almost the same transfer speed as a whole can be obtained as compared with the case where the data transfer between the USB host and the USB function is performed at the USB native speed (480 Mbps).

例えば、フラッシュメモリなどの低速データ転送(50Mbps)のアプリケーション用いるような場合に、上記INトランザクションを連続して実施すると、HDDなどの高速データ転送(200Mbps程度)が必要なアプリケーションを用いる場合に比べてINトランザクション間の時間を長く取る必要がある。つまり、高速データ転送のアプリケーション使用時には、トランザクション間の時間が短く、低速データ転送のアプリケーション使用時には、トランザクション間の時間が長くなる。   For example, when an application for low-speed data transfer (50 Mbps) such as a flash memory is used, if the above IN transaction is continuously performed, compared to a case where an application such as HDD that requires high-speed data transfer (about 200 Mbps) is used. It is necessary to take a long time between IN transactions. That is, the time between transactions is short when using an application for high-speed data transfer, and the time between transactions is long when using an application for low-speed data transfer.

このため、本発明に係る方法でINトランザクションを行った場合、1回のINトランザクションに係る時間は、USBネイティブの転送速度でホスト−ファンクション間のデータ転送を行う場合に比べて長くなるものの、トランザクション間において要する時間内に終了すれば、次のINトランザクション開始時間は、USBのネイティブ速度の場合のINトランザクション開始時間と比べて遅くならない。つまり、ホスト−ファンクション間に低速通信路を用いた場合とUSBネイティブの速度で通信を行う場合とを比較すると、全体としては転送速度が変わらない結果となる。   For this reason, when an IN transaction is performed by the method according to the present invention, the time for one IN transaction is longer than that when performing data transfer between a host and a function at a USB native transfer rate. If it is completed within the time required, the next IN transaction start time is not delayed compared to the IN transaction start time in the case of the USB native speed. That is, comparing the case where the low-speed communication path is used between the host and the function and the case where communication is performed at the USB native speed, the result is that the transfer speed does not change as a whole.

また、USB2.0を単純に光化しようとする場合、例えば8B10Bの変調方式を用いたとすると、480×10/8=600Mbpsの帯域を持った光トランシーバが必要である。これを満たす光トランシーバはLD(レーザーダイオード)ある。一方、本発明を用いて低速な通信路でUSB2.0の転送ができる場合、低速通信路が例えば100Mbpsの場合、これを満たす光トランシーバは、LED(発光ダイオード)である。LDとLEDを比較すると、圧倒的にLEDの方が安価であり、本発明の構成により、光トランシーバのコストの削減が可能となる。   In addition, in the case where the USB 2.0 is simply made optical, for example, if an 8B10B modulation method is used, an optical transceiver having a bandwidth of 480 × 10/8 = 600 Mbps is required. An optical transceiver that satisfies this requirement is an LD (laser diode). On the other hand, when USB 2.0 can be transferred over a low-speed communication path using the present invention, when the low-speed communication path is, for example, 100 Mbps, the optical transceiver satisfying this is an LED (light emitting diode). Compared with the LD and the LED, the LED is overwhelmingly less expensive, and the configuration of the present invention enables the cost of the optical transceiver to be reduced.

さらに、コントローラにおいても、たとえばホスト側コントローラがUSBホストに一体化され、他のメタルポートをなくし、光ポートのみの構成となった場合、コントローラの必要とする帯域が、600Mbpsから100Mbpsへと大きく低くなる。これは、安価な製造プロセスにより、コントローラの作成が可能となることを意味しており、やはり本発明によりコスト削減が可能となる。   Furthermore, in the controller, for example, when the host-side controller is integrated with the USB host, and other metal ports are eliminated and only the optical port is configured, the bandwidth required by the controller is greatly reduced from 600 Mbps to 100 Mbps. Become. This means that the controller can be created by an inexpensive manufacturing process, and the present invention can also reduce the cost.

以上により、低速のアプリケーションを使用する場合、本発明によりコスト削減が可能であり、低速のアプリケーションとして例えばフラッシュメモリが搭載された携帯電話、デジタルカメラなどの機器においては、本発明が有効であると考えられる。   As described above, when a low-speed application is used, the present invention can reduce the cost. For example, the present invention is effective in a low-speed application such as a mobile phone or a digital camera equipped with a flash memory. Conceivable.

ホスト−ファンクション間の転送速度を低速としても、ターンアラウンドタイムを意識することなくINトランザクションを正常に行える送受信システムによって、USBにてデータ通信を行う種々の通信機器に適用できる。   Even if the transfer rate between the host and the function is low, the present invention can be applied to various communication devices that perform data communication with USB by a transmission / reception system that can normally perform IN transactions without being aware of turnaround time.

本発明の一実施形態を示すものであり、実施の形態1における送受信システムの要部構成を示すブロック図である。BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 illustrates an embodiment of the present invention and is a block diagram illustrating a main configuration of a transmission / reception system according to a first embodiment. 実施の形態1における送受信システムのホスト側コントローラのステートマシンの動作を示すフローチャートである。4 is a flowchart showing the operation of the state machine of the host-side controller of the transmission / reception system in the first embodiment. 実施の形態1における送受信システムのファンクション側コントローラのステートマシンの動作を示すフローチャートである。3 is a flowchart showing the operation of the state machine of the function-side controller of the transmission / reception system in the first embodiment. 実施の形態2における送受信システムのホスト側コントローラのステートマシンの動作を示すフローチャートである。10 is a flowchart illustrating an operation of a state machine of a host-side controller of the transmission / reception system according to the second embodiment. 実施の形態2における送受信システムのファンクション側コントローラのステートマシンの動作を示すフローチャートである。10 is a flowchart showing the operation of the state machine of the function-side controller of the transmission / reception system in the second embodiment. 実施の形態2における送受信システムでのINトランザクションを示すタイミングチャートである。10 is a timing chart illustrating an IN transaction in the transmission / reception system according to the second embodiment. USB2.0において各転送モードにおけるDATAパケット最大長を示す図である。It is a figure which shows the DATA packet maximum length in each transfer mode in USB2.0. 実施の形態3における送受信システムの要部構成を示すブロック図である。FIG. 10 is a block diagram showing a main configuration of a transmission / reception system in a third embodiment. 実施の形態4における送受信システムの要部構成を示すブロック図である。FIG. 10 is a block diagram illustrating a main configuration of a transmission / reception system in a fourth embodiment. 実施の形態5における送受信システムの要部構成を示すブロック図である。FIG. 10 is a block diagram illustrating a main configuration of a transmission / reception system in a fifth embodiment. 実施の形態6における送受信システムの要部構成を示すブロック図である。FIG. 20 is a block diagram showing a main configuration of a transmission / reception system in a sixth embodiment. 実施の形態6における送受信システムのホスト側コントローラのステートマシンの動作を示すフローチャートである。20 is a flowchart illustrating the operation of a state machine of a host-side controller of a transmission / reception system according to a sixth embodiment. 実施の形態7における送受信システムの要部構成を示すブロック図である。FIG. 20 is a block diagram showing a configuration of main parts of a transmission / reception system in a seventh embodiment. 実施の形態7における送受信システムのホスト側コントローラのステートマシンの動作を示すフローチャートである。20 is a flowchart illustrating the operation of a state machine of a host-side controller of a transmission / reception system in a seventh embodiment. 実施の形態7における送受信システムのファンクション側コントローラのステートマシンの動作を示すフローチャートである。18 is a flowchart showing the operation of a state machine of a function-side controller of a transmission / reception system in a seventh embodiment. 実施の形態8におけるUSBパケットおよび低速通信路におけるパケットフォーマットを示す図である。FIG. 20 is a diagram illustrating a USB packet and a packet format in a low-speed communication path in the eighth embodiment. 実施の形態9における送受信システムの要部構成を示すブロック図である。209 is a block diagram illustrating a main configuration of a transmission / reception system according to Embodiment 9. FIG. 実施の形態9におけるスピードネゴシエーション処理を示すタイミングチャートである。10 is a timing chart illustrating a speed negotiation process according to the ninth embodiment. 実施の形態9における送受信システムのホスト側コントローラのスピードネゴシエーションステートマシンの動作を示すタイミングチャートである。FIG. 40 is a timing chart illustrating an operation of a speed negotiation state machine of the host-side controller of the transmission / reception system according to the ninth embodiment. 実施の形態9における送受信システムのファンクション側コントローラのスピードネゴシエーションステートマシンの動作を示すタイミングチャートである。FIG. 40 is a timing chart showing the operation of the speed negotiation state machine of the function-side controller of the transmission / reception system in the ninth embodiment. USB2.0におけるパケットの種類を示す図である。It is a figure which shows the kind of packet in USB2.0. USB2.0における代表的なパケットのパケットフォーマットを示す図である。It is a figure which shows the packet format of the typical packet in USB2.0. USB2.0におけるINトランザクションを示すタイミングチャートである。It is a timing chart which shows IN transaction in USB2.0. USB2.0におけるINトランザクションを低速通信路で行う場合のパケット転送の様子を示すタイミングチャートである。It is a timing chart which shows the mode of the packet transfer in the case of performing IN transaction in USB2.0 by a low-speed communication path.

符号の説明Explanation of symbols

100,120,130,150,170
ホスト側コントローラ
101 ホスト側ステートマシン
(受信確認手段,データ格納確認手段,送信制御手段,再送要求手段)
108,151 FIFO(格納手段)
110,140,160,180
ファンクション側コントローラ
111 ファンクション側ステートマシン
121 カウンタ(データ量確認手段)
131,141 CRCチェック回路(誤り解析手段)
100, 120, 130, 150, 170
Host-side controller 101 Host-side state machine
(Reception confirmation means, data storage confirmation means, transmission control means, retransmission request means)
108,151 FIFO (storage means)
110, 140, 160, 180
Function-side controller 111 Function-side state machine 121 Counter (data amount confirmation means)
131, 141 CRC check circuit (error analysis means)

Claims (28)

USB上のデータ通信としてINトランザクションを行う際に、ホスト装置から送信されるINパケットをファンクション装置側に転送し、該INパケットに対する返答となるDATAパケットをホスト装置に転送するホスト側コントローラとして機能する通信コントローラであって、
ホスト装置からのINパケットの受信を確認する受信確認手段と、
ファンクション装置側から送信されてくるDATAパケットを格納する格納手段と、
上記受信認識手段によりホスト装置からのINパケット受信が確認された時点で、上記格納手段にDATAパケットが格納されているか否かを確認するデータ格納確認手段と、
上記データ格納確認手段により上記DATAパケットが格納されていないことが確認された時には、ホスト装置から受信したINパケットをファンクション装置側に転送するとともに、ホスト装置へNAKパケットを送信し、上記データ格納確認手段により上記DATAパケットが格納されていることが確認された時には、ホスト装置に上記DATAパケットを送信する送信制御手段とを備えていることを特徴とする通信コントローラ。
When performing an IN transaction as data communication over USB, it functions as a host-side controller that transfers an IN packet transmitted from the host device to the function device and transfers a DATA packet that is a response to the IN packet to the host device. A communication controller,
A reception confirmation means for confirming reception of an IN packet from the host device;
Storage means for storing a DATA packet transmitted from the function device side;
Data storage confirmation means for confirming whether or not a DATA packet is stored in the storage means when the reception recognition means confirms reception of an IN packet from the host device;
When it is confirmed by the data storage confirmation means that the DATA packet is not stored, the IN packet received from the host device is transferred to the function device side, and a NAK packet is transmitted to the host device to confirm the data storage. A communication controller, comprising: a transmission control means for transmitting the DATA packet to a host device when the means confirms that the DATA packet is stored.
上記通信コントローラは、ホスト装置側から送信されるUSB規格のINパケットをファンクション装置に転送し、該INパケットに対する返答となるDATAパケットをホスト装置側に転送するファンクション側コントローラとしても機能するものであり、
ホスト装置側からINパケットを受信した時にはこれを保持し、
ホスト装置側に送信したDATAパケットに対するACKパケットをホスト装置側から受信した場合には、USBファンクションに上記保持していたINパケットを送信し、該INパケットに対するDATAパケットをファンクション装置から受信した時点でACKパケットをファンクション装置に送信することを特徴とする通信コントローラ。
The communication controller also functions as a function-side controller that transfers a USB standard IN packet transmitted from the host device side to the function device and transfers a DATA packet as a response to the IN packet to the host device side. ,
When receiving an IN packet from the host device side, hold this,
When an ACK packet for the DATA packet transmitted to the host device is received from the host device, the IN packet held above is transmitted to the USB function, and when the DATA packet for the IN packet is received from the function device. A communication controller that transmits an ACK packet to a function device.
ホスト装置からのINパケットの受信およびホスト装置へのDATAパケットの送信に係る転送速度がUSB規格に定められた転送速度であり、INパケットのファンクション装置側への送信およびファンクション装置側からのDATAパケットの受信に係る転送速度がUSB規格に定められた転送速度よりも低く、
さらに、ファンクション装置側から受信したDATAパケットを上記格納手段に格納する際の格納データ量を確認するデータ量確認手段を有し、
上記送信制御手段は、上記データ量確認手段によって確認された受信データ量が予め定められた値よりも多くなった時点で、ホスト装置へのDATAパケットの送信を開始することを特徴とする請求項1に記載の通信コントローラ。
The transfer rate related to the reception of the IN packet from the host device and the transmission of the DATA packet to the host device is the transfer rate defined in the USB standard, and the transmission of the IN packet to the function device side and the DATA packet from the function device side The transfer speed related to the reception is lower than the transfer speed defined in the USB standard,
Furthermore, it has a data amount confirmation means for confirming the storage data amount when storing the DATA packet received from the function device side in the storage means,
The transmission control means starts transmission of a DATA packet to the host device when the amount of received data confirmed by the data amount confirmation means exceeds a predetermined value. The communication controller according to 1.
ファンクション装置側から受信したDATAパケットが誤りを含むものであるか否かを解析する誤り解析手段を有し、
上記送信制御手段は、上記誤り解析手段により、受信したDATAパケットが誤っていると判断される場合、該DATAパケットを破棄し、ホスト装置に転送しないことを特徴とする請求項1に記載の通信コントローラ。
Having an error analysis means for analyzing whether the DATA packet received from the function device side contains an error,
2. The communication according to claim 1, wherein when the error analysis unit determines that the received DATA packet is incorrect, the transmission control unit discards the DATA packet and does not transfer it to the host device. controller.
ファンクション装置側から受信したDATAパケットが誤りを含むものであるか否かを解析する誤り解析手段を有し、
上記送信制御手段は、上記誤り解析手段により、受信したDATAパケットが誤っていると判断された場合、ホスト装置へのDATAパケットの送信をその時点で中止することを特徴とする請求項1に記載の通信コントローラ。
Having an error analysis means for analyzing whether the DATA packet received from the function device side contains an error,
2. The transmission control unit according to claim 1, wherein when the error analysis unit determines that the received DATA packet is incorrect, the transmission control unit stops transmission of the DATA packet to the host device at that time. Communication controller.
上記受信確認手段は、ホスト装置にDATAパケットを送信した後、該DATAパケット対するACKパケットがホスト装置から返ってきたか否かを確認し、
上記送信制御手段は、ホスト装置にDATAパケットを送信した後、上記受信確認手段によるACKパケットの受信が確認されずに、次のINパケットの受信が確認された場合には、前回ホスト装置に送信したDATAパケットと同じDATAパケットをホスト装置に送信する再送処理を行うことを特徴とする請求項1に記載の通信コントローラ。
The reception confirmation means confirms whether or not an ACK packet for the DATA packet is returned from the host device after transmitting the DATA packet to the host device.
After transmitting the DATA packet to the host device, the transmission control unit transmits to the host device the previous time when the reception of the next IN packet is confirmed without confirming the reception of the ACK packet by the reception confirmation unit. The communication controller according to claim 1, wherein retransmission processing is performed to transmit the same DATA packet as the transmitted DATA packet to the host device.
ファンクション装置側から受信したDATAパケットが誤りを含むものであるか否かを解析する誤り解析手段を有し、
上記送信制御手段は、上記再送処理を、上記誤り解析手段により自機器が保有しているDATAパケットに誤りがないと確認された場合のみ行うことを特徴とする請求項6に記載の通信コントローラ。
Having an error analysis means for analyzing whether the DATA packet received from the function device side contains an error,
7. The communication controller according to claim 6, wherein the transmission control unit performs the retransmission process only when it is confirmed by the error analysis unit that there is no error in the DATA packet held by the own device.
ファンクション装置側から受信したDATAパケットが誤りを含むものであるか否かを解析する誤り解析手段と、
上記誤り解析手段により、受信したDATAパケットが誤っていると判断された場合、ファンクション装置側にDATAパケットの再送要求を行う再送要求手段とを有していることを特徴とする請求項1に記載の通信コントローラ。
Error analysis means for analyzing whether or not the DATA packet received from the function device side contains an error;
2. The apparatus according to claim 1, further comprising: a retransmission request unit configured to request a retransmission of the DATA packet on the function device side when the error analysis unit determines that the received DATA packet is incorrect. Communication controller.
上記通信コントローラは、ホスト装置側から送信されるUSB規格のINパケットをファンクション装置に転送し、該INパケットに対する返答となるDATAパケットをホスト装置側に転送するファンクション側コントローラとしても機能するものであり、
ホスト側コントローラから再送要求を受信した場合には、前回ホスト側コントローラに送信したDATAパケットと同じDATAパケットをホスト側コントローラに送信する再送処理を行うことを特徴とする請求項1に記載の通信コントローラ。
The communication controller also functions as a function-side controller that transfers a USB standard IN packet transmitted from the host device side to the function device and transfers a DATA packet as a response to the IN packet to the host device side. ,
2. The communication controller according to claim 1, wherein when a retransmission request is received from the host-side controller, retransmission processing is performed to transmit the same DATA packet as the DATA packet transmitted to the host-side controller to the host-side controller last time. .
ファンクション装置から受信したDATAパケットが誤りを含むものであるか否かを解析する誤り解析手段を有し、
上記送信制御手段は、上記再送処理を、上記誤り解析手段により自機器が保有しているDATAパケットに誤りがないと確認された場合のみ行うことを特徴とする請求項9に記載の通信コントローラ。
Having an error analysis means for analyzing whether or not the DATA packet received from the function device contains an error;
The communication controller according to claim 9, wherein the transmission control unit performs the retransmission process only when it is confirmed by the error analysis unit that there is no error in the DATA packet held by the own device.
上記誤り解析手段により自機器が保有しているDATAパケットに誤りがないと確認された場合、ホスト装置へ送信するDATAパケットのパケットフォーマット中に、該DATAパケットには誤りが無いことを示すフラグを立てることを特徴とする請求項10に記載の通信コントローラ。   When it is confirmed by the error analysis means that there is no error in the DATA packet held by the own device, a flag indicating that the DATA packet has no error is included in the packet format of the DATA packet to be transmitted to the host device. The communication controller according to claim 10, wherein the communication controller is set up. ファンクション側コントローラからDATAパケットを受信し、該DATAパケットにおいて誤りのあることが上記誤り解析手段により検出された場合、
上記ファンクション側コントローラで保有されているDATAパケットにおける誤りの有無を示すフラグが受信したDATAパケットに立てられており、該フラグによりファンクション装置側で誤りの無いDATAパケットが保有されていることが確認された場合のみ上記再送要求を行うことを特徴とする請求項8に記載の通信コントローラ。
When a DATA packet is received from the function side controller, and the error analysis means detects that there is an error in the DATA packet,
The flag indicating whether there is an error in the DATA packet held by the function side controller is set in the received DATA packet, and it is confirmed by the flag that the DATA packet without error is held on the function device side. The communication controller according to claim 8, wherein the retransmission request is made only in the case of a failure.
上記通信コントローラは、ホスト装置側から送信されるUSB規格のINパケットをファンクション装置に転送し、該INパケットに対する返答となるDATAパケットをホスト装置側に転送するファンクション側コントローラとしても機能するものであり、
ホスト側コントローラから再送要求を受信した場合には、ファンクション装置に対してINパケットを送信し、それに対して受信したDATAパケットをホスト側コントローラに送信することを特徴とする請求項1に記載の通信コントローラ。
The communication controller also functions as a function-side controller that transfers a USB standard IN packet transmitted from the host device side to the function device and transfers a DATA packet as a response to the IN packet to the host device side. ,
2. The communication according to claim 1, wherein when a retransmission request is received from the host-side controller, an IN packet is transmitted to the function device, and the received DATA packet is transmitted to the host-side controller. controller.
上記INトランザクションの実行前に、通信相手側の通信コントローラと転送速度調整を行うことを特徴とする請求項1に記載の通信コントローラ。   2. The communication controller according to claim 1, wherein transfer rate adjustment is performed with a communication controller on a communication partner side before execution of the IN transaction. 上記転送速度調整において、USB規格に定められた転送速度で通信が可能であると判断される場合は、
通信相手側の通信コントローラに送信される各パケットは、パケットの送信タイミング制御を行わずに、変復調のみを行って相手側の通信コントローラへの転送を行うことを特徴とする請求項14記載の通信コントローラ。
In the above transfer speed adjustment, when it is determined that communication is possible at the transfer speed defined in the USB standard,
15. The communication according to claim 14, wherein each packet transmitted to the communication controller on the other side of the communication is transferred to the communication controller on the other side by performing only modulation / demodulation without performing packet transmission timing control. controller.
通信相手側の通信コントローラとの間での通信路におけるエラーレートを解析し、該エラーレートが予め定められたエラーレートよりも悪いと判断される場合、上記転送速度調整を行って転送速度を下げることを特徴とする請求項14記載の通信コントローラ。   Analyzing the error rate on the communication path with the communication controller on the communication partner side, and if it is determined that the error rate is worse than a predetermined error rate, the transfer rate is adjusted to reduce the transfer rate The communication controller according to claim 14. 通信相手側の通信コントローラとの間で、全二重通信を行うことを特徴とする請求項1ないし16の何れかに記載の通信コントローラ。   The communication controller according to any one of claims 1 to 16, wherein full-duplex communication is performed with a communication controller on a communication partner side. 通信相手側の通信コントローラとの間の通信が、光ファイバを用いた通信路によって行われるものであることを特徴とする請求項1ないし17の何れかに記載の通信コントローラ。   The communication controller according to any one of claims 1 to 17, wherein communication with a communication controller on a communication partner side is performed through a communication path using an optical fiber. 通信相手側の通信コントローラとの間の通信が、電波を用いた無線によって行われるものであることを特徴とする請求項1ないし16の何れかに記載の通信コントローラ。   The communication controller according to any one of claims 1 to 16, wherein communication with a communication controller on a communication partner side is performed by radio using radio waves. 通信相手側の通信コントローラとの間の通信が、光を用いた空間伝送によって行われるものであることを特徴とする請求項1ないし17の何れかに記載の通信コントローラ。   The communication controller according to any one of claims 1 to 17, wherein communication with a communication controller on a communication partner side is performed by spatial transmission using light. USB上のデータ通信としてINトランザクションを行う際に、ホスト装置側から送信されるUSB規格のINパケットをファンクション装置に転送し、該INパケットに対する返答となるDATAパケットをホスト装置側に転送するファンクション側コントローラとして機能する通信コントローラであって、
ホスト装置側からINパケットを受信した時にはこれを保持し、
ホスト装置側に送信したDATAパケットに対するACKパケットをホスト装置側から受信した場合には、USBファンクションに上記保持していたINパケットを送信し、該INパケットに対するDATAパケットをファンクション装置から受信した時点でACKパケットをファンクション装置に送信することを特徴とする通信コントローラ。
When performing an IN transaction as data communication over USB, the function side transfers a USB standard IN packet transmitted from the host device side to the function device, and transfers a DATA packet as a response to the IN packet to the host device side A communication controller that functions as a controller,
When receiving an IN packet from the host device side, hold this,
When an ACK packet for the DATA packet transmitted to the host device is received from the host device, the IN packet held above is transmitted to the USB function, and when the DATA packet for the IN packet is received from the function device. A communication controller that transmits an ACK packet to a function device.
USB上のデータ通信としてINトランザクションを行う際に、ホスト装置側から送信されるUSB規格のINパケットをファンクション装置に転送し、該INパケットに対する返答となるDATAパケットをホスト装置側に転送するファンクション側コントローラとして機能する通信コントローラであって、
ホスト側コントローラから再送要求を受信した場合には、前回ホスト側コントローラに送信したDATAパケットと同じDATAパケットをホスト側コントローラに送信する再送処理を行うことを特徴とする通信コントローラ。
When performing an IN transaction as data communication over USB, the function side transfers a USB standard IN packet transmitted from the host device side to the function device, and transfers a DATA packet as a response to the IN packet to the host device side A communication controller that functions as a controller,
A communication controller that performs a retransmission process for transmitting to the host controller the same DATA packet as the DATA packet that was previously transmitted to the host controller when a retransmission request is received from the host controller.
ファンクション装置から受信したDATAパケットが誤りを含むものであるか否かを解析し、上記再送処理を、上記解析により自機器が保有しているDATAパケットに誤りがないと確認された場合のみ行うことを特徴とする請求項22に記載の通信コントローラ。   Analyzing whether or not the DATA packet received from the function device includes an error, and performing the retransmission process only when it is confirmed by the analysis that the DATA packet held by the own device is free of errors. The communication controller according to claim 22. 上記解析により自機器が保有しているDATAパケットに誤りがないと確認された場合、ホスト装置へ送信するDATAパケットのパケットフォーマット中に、該DATAパケットには誤りが無いことを示すフラグを立てることを特徴とする請求項23に記載の通信コントローラ。   If it is confirmed by the above analysis that there is no error in the DATA packet held by the device, a flag indicating that the DATA packet has no error is set in the packet format of the DATA packet transmitted to the host device. The communication controller according to claim 23. USB上のデータ通信としてINトランザクションを行う際に、ホスト装置側から送信されるUSB規格のINパケットをファンクション装置に転送し、該INパケットに対する返答となるDATAパケットをホスト装置側に転送するファンクション側コントローラとして機能する通信コントローラであって、
ホスト側コントローラから再送要求を受信した場合には、ファンクション装置に対してINパケットを送信し、それに対して受信したDATAパケットをホスト側コントローラに送信することを特徴とする通信コントローラ。
When performing an IN transaction as data communication over USB, the function side transfers a USB standard IN packet transmitted from the host device side to the function device, and transfers a DATA packet as a response to the IN packet to the host device side A communication controller that functions as a controller,
A communication controller, wherein when a retransmission request is received from a host-side controller, an IN packet is transmitted to the function device, and the received DATA packet is transmitted to the host-side controller.
上記請求項1,3,4,5,6,7,8,12,14,15,16の何れかに記載のホスト側コントローラとして機能する通信コントローラと、
ホスト装置側から送信されるUSB規格のINパケットをファンクション装置に転送し、該INパケットに対する返答となるDATAパケットをホスト装置側に転送するファンクション側コントローラとして機能する通信コントローラとして機能する通信コントローラとを備えたことを特徴とする通信システム。
A communication controller functioning as a host-side controller according to any one of claims 1, 3, 4, 5, 6, 7, 8, 12, 14, 15, and 16;
A communication controller that functions as a communication controller that functions as a function-side controller that transfers a USB standard IN packet transmitted from the host device side to the function device and transfers a DATA packet that is a response to the IN packet to the host device side; A communication system comprising:
請求項1ないし26の何れかに記載の通信コントローラを備えた通信機器。   A communication device comprising the communication controller according to any one of claims 1 to 26. ホスト装置からのINパケットの受信を確認すると、その時点で該INパケットに対する返答となるDATAパケットを受信しているか否かを確認し、
上記DATAパケットを受信している場合には、受信した上記INパケットに対して該DATAパケットをホスト装置に送信し、
上記DATAパケットを受信していない場合には、受信した上記INパケットをファンクション装置側に転送するとともに、ホスト装置へNAKパケットを送信することを特徴とする通信方法。
When the reception of the IN packet from the host device is confirmed, it is confirmed whether or not a DATA packet that is a response to the IN packet is received at that time.
If the DATA packet is received, the DATA packet is transmitted to the host device in response to the received IN packet,
A communication method, wherein when the DATA packet is not received, the received IN packet is transferred to the function device side and a NAK packet is transmitted to the host device.
JP2003337797A 2003-09-29 2003-09-29 Communication controller, communication system, communication apparatus, and communication method Pending JP2005107677A (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP2003337797A JP2005107677A (en) 2003-09-29 2003-09-29 Communication controller, communication system, communication apparatus, and communication method
TW093129262A TWI296083B (en) 2003-09-29 2004-09-27 Communication controller, host-side controller, communication system, usb system, communication equipment, communication method, packet-based communication method, packet-based communication program, and storage medium
CNB2004100120211A CN100366029C (en) 2003-09-29 2004-09-28 Communication controller, host-side controller, communication equipment, communication system and method
US10/950,563 US7461318B2 (en) 2003-09-29 2004-09-28 Communication system realizing USB communications between a host computer and its peripheral device and a communication controller transmitting a USB signal under the USB standard

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003337797A JP2005107677A (en) 2003-09-29 2003-09-29 Communication controller, communication system, communication apparatus, and communication method

Publications (1)

Publication Number Publication Date
JP2005107677A true JP2005107677A (en) 2005-04-21

Family

ID=34533514

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003337797A Pending JP2005107677A (en) 2003-09-29 2003-09-29 Communication controller, communication system, communication apparatus, and communication method

Country Status (1)

Country Link
JP (1) JP2005107677A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006164081A (en) * 2004-12-09 2006-06-22 Y E Data Inc Wireless usb adapter and wireless usb network system
JP2007048029A (en) * 2005-08-10 2007-02-22 Seiko Epson Corp Relay device, image output system and relay method
JP2010152775A (en) * 2008-12-26 2010-07-08 Kddi Corp Usb/wirelessness conversion device
JP2011198047A (en) * 2010-03-19 2011-10-06 Kddi Corp Usb repeater and method
JP2011198046A (en) * 2010-03-19 2011-10-06 Kddi Corp Repeater and method
KR20130078660A (en) * 2011-12-30 2013-07-10 삼성전자주식회사 Electronic apparatus connecting usb device and control method thereof
CN115391255A (en) * 2022-10-27 2022-11-25 北京恩威特科技有限公司 High-availability USB equipment sharing server

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006164081A (en) * 2004-12-09 2006-06-22 Y E Data Inc Wireless usb adapter and wireless usb network system
JP2007048029A (en) * 2005-08-10 2007-02-22 Seiko Epson Corp Relay device, image output system and relay method
JP2010152775A (en) * 2008-12-26 2010-07-08 Kddi Corp Usb/wirelessness conversion device
JP2011198047A (en) * 2010-03-19 2011-10-06 Kddi Corp Usb repeater and method
JP2011198046A (en) * 2010-03-19 2011-10-06 Kddi Corp Repeater and method
KR20130078660A (en) * 2011-12-30 2013-07-10 삼성전자주식회사 Electronic apparatus connecting usb device and control method thereof
KR102018666B1 (en) * 2011-12-30 2019-09-06 삼성전자 주식회사 Electronic apparatus connecting usb device and control method thereof
CN115391255A (en) * 2022-10-27 2022-11-25 北京恩威特科技有限公司 High-availability USB equipment sharing server
CN115391255B (en) * 2022-10-27 2023-01-31 北京恩威特科技有限公司 High-availability USB equipment sharing server

Similar Documents

Publication Publication Date Title
JP2005107683A (en) Communication controller, communications system, communication apparatus, and communication method
TWI294083B (en) Device-side controller, host-side controller, communication controller, usb system, and packet communications method
US7461318B2 (en) Communication system realizing USB communications between a host computer and its peripheral device and a communication controller transmitting a USB signal under the USB standard
JP5379134B2 (en) Data communication system, communication apparatus, and communication method
EP2397949B1 (en) Flow control for universal serial bus (USB)
JP3632695B2 (en) Data transfer control device, electronic device, and data transfer control method
US20150309958A1 (en) Methods and devices for extending usb 3.0-compliant communication
JP2014507035A (en) Serial interface
KR102032862B1 (en) Arbitration Signaling within a Multimedia High Definition Link (MHL3) Device
US9197373B2 (en) Method, apparatus, and system for retransmitting data packet in quick path interconnect system
US8416803B1 (en) Low latency interconnect bus protocol
US20130346656A1 (en) Providing A Serial Protocol For A Bidirectional Serial Interconnect
WO2009012426A2 (en) A distributed interconnect bus apparatus
JP3655211B2 (en) Transmission / reception circuit and transmission / reception method
JP2007088775A (en) Radio communication system, device, and method
JP2005107677A (en) Communication controller, communication system, communication apparatus, and communication method
EP0886410A2 (en) Data communication method, data communication apparatus, and data communication program recording medium
US20150350014A1 (en) Networking implementation using a converged high speed input/output fabric technology
JP2005129008A (en) Host-side controller, usb system, communication controller, method and system for packet-based communication, and recording medium
US8000278B2 (en) De-activation, at least in part, of receiver, in response, at least in part, to determination that an idle condition exists
WO2017000737A1 (en) Transmission checking method, node, system and computer storage medium
JP2007074641A (en) Communication system
CN114443533A (en) Removal of USB devices and PING intervention in extended environments
JP2012064090A (en) Information processor, information processing system, and communication method of information processing system
JP2014222466A (en) Information processing device, information processing system, and information processing system communication method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050810

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080207

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080219

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080415

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20080415

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20081028