JP2004021859A - Usb controller - Google Patents

Usb controller Download PDF

Info

Publication number
JP2004021859A
JP2004021859A JP2002179117A JP2002179117A JP2004021859A JP 2004021859 A JP2004021859 A JP 2004021859A JP 2002179117 A JP2002179117 A JP 2002179117A JP 2002179117 A JP2002179117 A JP 2002179117A JP 2004021859 A JP2004021859 A JP 2004021859A
Authority
JP
Japan
Prior art keywords
usb
data
memory
controller
request
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
JP2002179117A
Other languages
Japanese (ja)
Inventor
Sunao Nakabachi
中鉢 直
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ricoh Co Ltd
Original Assignee
Ricoh Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP2002179117A priority Critical patent/JP2004021859A/en
Publication of JP2004021859A publication Critical patent/JP2004021859A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a USB (Universal Serial Bus) controller by which the size/kind or the like of transmission data are easily changed and a circuit scale is miniaturized. <P>SOLUTION: The USB controller carries out an automatic response without interposing a user circuit with respect to request for control transfer accompanied with data transmission from a USB host. The USB controller comprises: a memory means 28 sharing an end point previously writing the response data of the request in the initial setting; and a serial input engine 22 reading the data written on the memory means 28 and outputting the data to the USB host when the request for the automatic response arrives from the USB host. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
本発明は、USB(Universal Serial Bus)コントローラに関し、特にUSBホストへデータ送信を伴うコントロール転送のリクエストに対して、ユーザ回路の介在無しに自動応答を行うUSBコントローラに関する。
【0002】
【従来の技術】
USBホストに対するデータ送信を伴うコントロール転送のリクエストに対してユーザ回路の介在無しに自動応答を行うUSBコントローラに関連する従来技術として、特開2000−305890公報に記載のインターフェースボックスが挙げられる。また、製品としてはNetChip社のUSBコントローラIC(NetChip2270)等が挙げられる。
近年、パーソナルコンピュータ(PC)と周辺機器を接続するインターフェースとしてUSBが使用されている。USBではPCが唯一のホストとなり、このホストの下に複数のデバイスがツリー状に接続され、デバイスのUSBコントローラがそれぞれ固有のアドレスを持つ。
ホストであるPCは固有のアドレスのUSBコントローラに対してデータ送受信の要求とデータの送受信を行う。USBコントローラではホストからのデータ送受信の要求を受信した時に、割込み信号等の手段でユーザ回路に対してホストからデータ送受信の要求を受けたことを通知する。そして、ユーザ回路はUSBコントローラからデータ送受信の要求の内容を読み出して、USBコントローラがホストから受信したデータを読み出し、また、ホストに対する送信データをUSBコントローラに書き込む。
なお、USBコントローラはホストに対してデータを送信する、または、ホストからのデータを受信する、通常FIFOメモリ(First In First Out Memory)からなるエンドポイントを複数もつ(その数は規格によって決められている)。そして、デバイスのUSBコントローラのローカルバスに接続される機器は、エンドポイントのFIFOメモリに対してアクセスすることになる。
【0003】
ところで、USBバスでのデータの転送は、パケットという単位で行われる。
パケットには転送方向やセットアップ情報を送るトークンパケット、実際のデータであるデータパケット、データ転送結果(成功・失敗)を送るハンドシェークパケットの種類がある。また、転送の種類も、エンドポイントゼロを介して行われるデバイスの初期化や各種情報のやりとりに使用するコントロール転送、転送周期を問わずプリンタのデータのように、まとまった量のデータを転送するバルク転送、マウス、キーボードのステータスを送るような一定周期で少量のデータを送るインタラプト転送、音声データなどリアルタイムのデータを送るときにデータの正当性を保証しない代わりにバンド幅を保証するアイソクロナス転送、の4つのデータ転送のモードがある。
このうち、コントロール転送については、ユーザ回路の負担を減らす為にユーザ回路の介在無しにUSBコントローラがホストからのデータ送受信の要求に対して応答を行う場合がある。USBコントローラがユーザ回路の介在無しにホストからのデータ送信要求に対してデータ送信を行う場合、従来はホストに対する送信データをUSBコントローラの動作に関する各種設定を行うレジスタに格納しておき、その値を常にシリアル入力エンジンに出力しておくか、ホストからの送信要求が来た場合にシリアル入力エンジンに出力して、シリアル入力エンジンがホストに送信するものが知られている。
【0004】
図5は従来のUSBコントローラの構成である。USBトランシーバ11は、USBバスに接続され、図中には示されないUSBホストから送信されたパケットをUSBバスの信号から論理信号に変換して、次に説明するシリアル入力エンジン12に出力すると同時に、シリアル入力エンジン12からUSBホストに送信するパケットを論理信号からUSBバスの信号に変換してUSBホストに出力する。シリアル入力エンジン12は、USBトランシーバ11から入力されるUSBホストから送信されたパケットのうちトークンパケット、ハンドシェークパケットをデコードし、それを基にUSBホストとの通信制御を行い、必要に応じてハンドシェークパケットをUSBトランシーバ11に出力する。
【0005】
またシリアル入力エンジン12は、USBホストに出力するデータを、後で説明するメモリ18からメモリアクセスコントローラ群13を介して読み出し、制御データを付加してデータパケットとしてUSBトランシーバ11に出力し、USBトランシーバ11から入力するUSBホストからのデータパケットの中のデータをメモリアクセスコントローラ群13を介してメモリ18に書き込む制御を行う。またコントロール転送の自動応答リクエストに対しては、後で説明するレジスタ16から自動応答データを読み出して、制御データを付加してデータパケットとしてUSBトランシーバ11に出力する。メモリ18はRAMで構成されており、ローカルバスから受信してUSBホストへ送信するデータ、およびUSBホストから受信してローカルバスに送信するデータを一時的に保持する。メモリアクセスコントローラ群13はローカルバスから受信してUSBホストへ送信するデータをメモリ18に書き込む制御を行うとともに、USBホストから受信してローカルバスに送信するデータをメモリ18から読み出す制御を行うメモリアクセスコントローラ群である。I/Oコントローラ15は図中には示されないユーザ回路と、メモリアクセスコントローラ群13と、次に述べるレジスタ16との間でのデータ転送の制御を行う。レジスタ16はUSBコントローラ内部モジュールの各種設定を行い、またコントロール転送の自動応答リクエストを格納しておくレジスタである。
【0006】
なお、メモリアクセスコントローラ群13は、エンドポイント毎に用意され、エンドポイントゼロ用のメモリコントローラ(図中の130)と、コントロール転送以外の転送で使用される複数のエンドポイント用のメモリコントローラ(131、132、・・・,13n)と、各メモリコントローラからメモリ18へのアクセスが同時に複数発生する場合の調停を行うアービター19から構成される。ここで、エンドポイントゼロ用のメモリコントローラ130とその他のメモリコントローラの違いは、エンドポイントゼロ用のメモリコントローラ130がコントロール転送で使用されることから、シリアル入力エンジン12と、ローカルバス双方で書き込み/読み出しが可能であるのに対して、他のエンドポイント用のメモリコントローラでは、エンドポイントの方向に応じて、シリアル入力エンジン12かローカルバスのうちの一方で書き込みが行われ、他方で読み出しが行われることである。
【0007】
図5のUSBコントローラではUSBホストに対するデータ送信を伴うコントロール転送のリクエストのとき、自動応答を行うリクエストに対しては、シリアル入力エンジン12がレジスタ16に格納した自動応答データを読み出して、制御信号を付加してデータパケットとしてUSBトランシーバ11に出力してUSBトランシーバ11でUSBバスの信号に変換してUSBホストに出力する。また、自動応答を行わないリクエストに対しては、リクエストを受信してからユーザ回路からI/Oコントローラ15を介してエンドポイントゼロ用メモリコントローラ130を介してメモリ18にデータを書き込み、シリアル入力エンジン12がメモリ18からエンドポイントゼロ用メモリコントローラ130を介してデータを読み出して、制御信号を付加してデータパケットとしてUSBトランシーバ11に出力してUSBトランシーバ11でUSBバスの信号に変換してUSBホストに出力する。
【0008】
【発明が解決しようとする課題】
しかし、従来の方式では送信データをレジスタに格納しているために、送信データのサイズ・種類等の変更が困難であった。また、レジスタは構成に必要な素子数が他のメモリデバイスに比べて多いので格納するデータ量が増やし難いという問題があった。
そこで、本発明は、USBコントローラがユーザ回路の介在無しにホストからのデータ送信要求に対して、送信データのサイズ・種類等の変更が容易な、また、レジスタに格納するよりも回路規模を小さくできるUSBコントローラを提供することを目的とする。
【0009】
【課題を解決するための手段】
上記の課題を解決するために、本発明の請求項1は、USBホストに対するデータ送信を伴うコントロール転送のリクエストに対して、ユーザ回路の介在無しに自動応答を行うUSBコントローラにおいて、各エンドポイントのFIFOに対応してデータを記憶するメモリを備え、前記リクエストへの応答データをも初期設定の際に予め前記メモリに書き込んでおき、USBホストから自動応答を必要とするリクエストが来た際に、シリアル入力エンジンが前記メモリから応答データを読み出して、USBホストに出力することを特徴とする。
また、本発明の請求項2は、請求項1記載のUSBコントローラにおいて、前記シリアル入力エンジンおよびユーザ回路双方からの前記メモリへのデータの書き込み/読み出しの際に、各エンドポイント用データおよび前記応答用データ単位でアクセスの制御をするメモリアクセスコントローラを設けたことを特徴とする。
また、本発明の請求項3は、請求項1または2記載のUSBコントローラにおいて、前記メモリが複数の入出力ポートを持つことを特徴とする。
また、本発明の請求項4は、請求項1、2または3記載のUSBコントローラにおいて、USBコントローラの動作に関する各種設定行うレジスタを設け、前記メモリに書き込むリクエストへの応答データの種類・内容・サイズ、およびエンドポイントのFIFOのサイズをユーザが変更可能に前記レジスタに保持するようにしたことを特徴とする。
また、本発明の請求項5は、請求項1記載のUSBコントローラにおいて、USBホストから自動応答を必要とするリクエストが来た際に、前記シリアル入力エンジンが応答データの種類・内容・サイズに基づいて、前記メモリのアドレスから応答データを読み出してUSBホストに出力することを特徴とする。
また、本発明の請求項6は、請求項1記載のUSBコントローラにおいて、USBコントローラの動作に関する各種設定を行うレジスタを設け、USBコントローラの初期設定の際にユーザ回路から応答データを前記メモリに書き込むと同時に前記レジスタにリクエストの種類・内容・サイズに対応した値を設定することを特徴とする。
また、本発明の請求項7は、請求項1記載のUSBコントローラにおいて、予め応答データを収めた不揮発メモリと、コントローラの動作に関する各種設定を行うレジスタとを設け、初期設定の際に前記不揮発メモリの応答データを前記メモリに書き込むと同時に、前記レジスタにリクエストの種類・内容・サイズに対応した値を設定することを特徴とする。
【0010】
【発明の実施の形態】
以下、図面を参照して、本発明の実施形態を詳細に説明する。図1はUSBバスの接続概念図である。図中で1はルートHUB機能をもつUSBホスト、2a、2bはHUB、3a〜3dはデバイスである。このようにUSBでは1つのホストの下に複数のHUBまたはデバイスがツリー状に接続される。また、デバイスは図2のようにUSBコントローラ21、ターゲットの機器22から構成される。
図3は本発明のUSBコントローラの構成である。図3でUSBトランシーバ21はUSBバスに接続されており、図中には示されないUSBホストから送信されたパケットを、USBバスの信号から論理信号に変換して、シリアル入力エンジン22に出力する一方、シリアル入力エンジン22からUSBホストに送信するパケットを論理信号からUSBバスの信号に変換して、USBホストに出力する。シリアル入力エンジン22はUSBトランシーバ21から入力するUSBホストから送信されたパケットのうちトークンパケット、ハンドシェークパケットをデコードし、それを基にUSBホストとの通信制御を行い、必要に応じてハンドシェークパケットをUSBトランシーバ21に出力するとともに、USBホストに出力するデータを後で説明するメモリ2らメモリアクセスコントローラ群23を介して読み出し、制御データを付加してデータパケットとしてUSBトランシーバ21に出力する。また、シリアル入力エンジン22はUSBトランシーバ21から入力するUSBホストからのデータパケットの中のデータをメモリアクセスコントローラ群23を介してメモリ28に書き込む制御を行い、更にコントロール転送の自動応答リクエストに対しては後で説明するレジスタ26から自動応答データを読み出し、制御データを付加してデータパケットとしてUSBトランシーバ21に出力する。メモリ28はRAMで構成される、ローカルバスから受信しUSBホストへ送信するデータ、およびUSBホストから受信しローカルバスに送信するデータを一時的に保持するメモリである。メモリアクセスコントローラ群23は、ローカルバスから受信してUSBホストへ送信するデータをメモリ28に書き込む制御を行うとともに、USBホストから受信してローカルバスに送信するデータをメモリ28から読み出す制御を行うものである。I/Oコントローラ25は図中には示されないユーザ回路と、メモリコントローラ群23と、次に述べるレジスタとの間でのデータ転送の制御を行う。レジスタ26はUSBコントローラ内部モジュールの各種設定を行うレジスタである。
【0011】
メモリアクセスコントローラ群23は、エンドポイント毎に、また、コントロール転送の自動応答値用に用意されたメモリコントローラで、エンドポイントゼロ用のメモリコントローラ(図中の230)と、コントロール転送以外の転送で使用される複数のエンドポイント用のメモリコントローラ(231、232、・・・、23n)と、コントロール転送の自動応答値用のメモリコントローラ24と、各メモリコントローラからメモリ28へのアクセスが同時に複数発生する場合の調停を行うアービター29から構成される。ここで、エンドポイントゼロ用のメモリコントローラ230とその他のメモリコントローラの違いは、エンドポイントゼロ用のメモリコントローラ230が、コントロール転送で使用されることからシリアル入力エンジン22と、ローカルバスの双方で書き込み/読み出しが可能であるのに対して、他のエンドポイント用のメモリコントローラでは、エンドポイントの方向に応じてシリアル入力エンジン22と、ローカルバスのうちの一方で書き込みが行われ、他方で読み出しが行われることである。
なお、図中には示さないが、この他に内蔵する場合があるモジュールとして、各モジュールにクロックを供給するCLKモジュール、エンドポイントとユーザ回路との間でDMA転送を行う為のDMAコントローラがあげられる。なお、USBトランシーバ21は、USBコントローラとは別チップとする場合もある。
また、各メモリコントローラからメモリ28へのアクセスであるが、メモリ28に通常のSRAMを用いる場合は、各メモリコントローラのシリアル入力エンジン側とローカルバス側のアクセスを共通のアービター29で調停して行う。メモリ28に2ポートSRAMを用いる場合は、各メモリコントローラのシリアル入力エンジン側とローカルバス側のアクセスを別々のアービター29で調停して行う。
【0012】
図3のUSBコントローラでは、電源投入後まず初期設定が行われる。初期設定ではユーザ回路からI/Oコントローラ25を介してレジスタ26にUSBコントローラ内部モジュールの各種設定が行われる。この際コントロール転送のデバイスリクエストの自動応答データは、ユーザ回路からI/Oコントローラ25、自動応答値用メモリコントローラ24を介してメモリ28に書き込まれる。同時に自動応答データをシリアル入力エンジンからアクセスする場合のスタートアドレスとサイズ、自動応答を行うリクエストの種類を変えることが可能な場合は、それも加えた情報をI/Oコントローラ25を介してレジスタ26に書き込む。そして、初期設定終了後、USBホストへの接続が行われ、実際のデータ転送が開始される。
【0013】
USBでの転送の種類は、先に説明したようにコントロール転送、バルク転送、インタラプト転送、アイソクロナス転送の4つの転送モードがあるが、本発明はこのうち、コントロール転送に関わるものである。
以下に、その手順を説明する。
コントロール転送は、セットアップステージ、データステージ、ステータスステージの3つのステージからなる。
セットアップステージは、USBホストがUSBコントローラに対してセットアップトークンパケットを送信することで開始する。USBホストは続けて8バイトのデータパケットを送信してUSBコントローラにリクエストの内容を示す。
USBコントローラでは、USBトランシーバ21がUSBバスの信号を論理信号に変換してシリアル入力エンジン22に出力する。シリアル入力エンジン22ではUSBトランシーバ21からの入力信号をデコードして、セットアップトークンと8バイトのデータパケットを受信したことが判ると、USBトランシーバ21にACKハンドシェークパケットを出力する。USBトランシーバ21ではシリアル入力エンジン22から入力したACKハンドシェークパケットをUSBバスの信号に変換してUSBホストに返信してリクエストを受信したことを示す。また、シリアル入力エンジン22では同時にリクエストのデコードが行われる。ここまでがセットアップステージである。
この後はリクエストの種類によって、GET_DESCRIPTORやGET_CONFIGURATIONのようにUSBホストにデータを送信する場合や、SET_DESCRIPTORのようにUSBホストからデータを受信する場合や、SET_CONFIGURATIONやSET_ADDRESSのようにデータ送受信を伴わない場合とで動作が異なってくる。
【0014】
はじめに、GET_DESCRIPTORやGET_CONFIGURATIONのようにUSBホストにデータを送信するリクエストの場合のデータステージであるが、そのリクエストが自動応答に対応する必要があるときは、シリアル入力エンジン22は該当するリクエストをメモリ28から読み出す為に、リクエストが格納されている領域のスタートアドレスを自動応答値メモリ用メモリコントローラ24に出力する等の準備を行う。リクエストが自動応答を必要としないときは、シリアル入力エンジン22はセットアップリクエストの受信信号をレジスタ26に出力する。レジスタ26では、セットアップリクエストの受信信号を受けるとユーザ回路に対して割込み信号を出力する。ユーザ回路は割込みの要因確認を行い、この場合それがセットアップリクエスト受信であるので、セットアップリクエストの内容を示すレジスタからリクエストの内容を確認し、それに対応するデータをI/Oコントローラ25、エンドポイントゼロ用メモリコントローラ230を介してメモリ28に書き込む。エンドポイントゼロ用メモリコントローラ230では自動応答値メモリからのデータの書き込みと同様に、ユーザ回路からのデータ書き込みが終了するとデータ送信の準備が出来たことをシリアル入力エンジン22に伝える。
一方、USBホストは8バイトのデータパケットに対するACKハンドシェークパケットを受信した後でイントークンパケットをUSBコントローラに送信してデータの送信を要求する。
【0015】
USBコントローラでは、USBトランシーバ21で論理信号に変換されたUSBホストからのイントークンパケットがシリアル入力エンジン22に入力すると、シリアル入力エンジン22はエンドポイントゼロに送信データの準備が出来ていない時はNAKハンドシェークパケットをUSBトランシーバ21に出力し、USBコントローラ21はそれをUSBバスの信号に変換してUSBホストに返信してデータが準備出来ていないことを通知する。この場合USBホストは一定時間経過後再びUSBコントローラにイントークンパケットを送信する。一方、データが準備出来ている時、そのリクエストが自動応答に対応する必要がある場合は、シリアル入力エンジン22は自動応答値メモリコントローラ24を、そうでない場合は、エンドポイントゼロ用コントローラ230を介してメモリ28からデータを読み出し、制御信号を付加してデータパケットとしてUSBトランシーバ21に出力し、USBトランシーバ21ではそれをUSBバスの信号に変換してホストに返信する。USBコントーラからのデータパケットの受信が成功した場合USBホストはACKハンドシェークパケットをUSBコントローラに送信する。ここまでがデータを送信するリクエストの場合のデータステージである。なお、USBコントーラからのデータパケットの返信が失敗した場合USBホストはUSBコントローラに一定時間送信を行わないことでデータパケットの受信失敗をUSBコントローラに示し、一定時間経過後再びUSBコントローラにイントークンパケットを送信する。
【0016】
次にUSBホストにデータを送信するリクエストの場合のステータスステージであるが、USBホストは、先のデータステージでのACKハンドシェークパケット送信後にアウトトークンパケットと引き続いてゼロレングスデータをUSBコントローラに送信する。USBコントローラではUSBトランシーバ21で論理信号に変換されたUSBホストからのアウトトークンパケットとゼロレングスパケット(制御信号のみで構成され、実際のデータが含まれないデータパケット)がシリアル入力エンジン22に入力すると、シリアル入力エンジン22は先のデータステージでの後処理が終わっている場合はACKハンドシェークパケットをUSBトランシーバ21に出力し、USBコントローラ21はそれをUSBバスの信号に変換してUSBホストに返信する。ここまでがデータを送信するリクエストの場合のステータスステージである。なお、USBホストからのアウトトークンパケットとゼロレングスパケットがシリアル入力エンジン22に入力した際にデータステージでの後処理が終わっていない場合は、シリアル入力エンジン22はNAKハンドシェークパケットをUSBトランシーバ21に出力し、USBコントローラ21はそれをUSBバスの信号に変換してUSBホストに返信する。この場合USBホストは一定時間経過後再びアウトトークンパケットと引き続いてゼロレングスデータをACKハンドシェークパケットが返信されるまでUSBコントローラに出力する。
【0017】
なお、以上はUSB1.1規格の場合であり、USB2.0規格ではUSBホストがアウトトークンパケットとゼロレングスデータパケットを送信する前にピングトークンパケットをUSBコントローラに出力する点でUSB1.1と異なる。USBコントローラではUSBトランシーバ21がUSBバスの信号を論理信号に変換してシリアル入力エンジン22に出力し、シリアル入力エンジン22がUSBトランシーバ21からの入力信号をデコードしてピングトークンを受信すると、エンドポイントゼロ用メモリコントローラ230はメモリ28のエンドポイントゼロ用の領域がデータ書き込み可能を示す場合は、ACKハンドシェークパケットを、データ書き込みが不可能な場合はNAKハンドシェークパケットをUSBトランシーバ21に出力する。USBトランシーバ21では入力したハンドシェークパケットをUSBバスの信号に変換してUSBホストに返信する。USBホストではACKハンドシェークパケットが返信された場合は以後USB1.1と同様のステータスステージの動作が行われる。一方NAKハンドシェークパケットが返信された場合は、再びACKハンドシェークパケットが返信されるまでUSBコントローラに対してピングトークンパケットを送信する。
【0018】
次に、SET_DESCRIPTORのようにUSBホストからデータを受信するリクエストの場合のデータステージであるが、USBホストは先のセットアップステージでのACKハンドシェーク受信後にアウトトークンパケットを、続けてデータパケットをUSBコントローラに送信する。
USBコントローラでは、USBトランシーバ21がUSBバスの信号を論理信号に変換してシリアル入力エンジン22に出力する。シリアル入力エンジン22ではUSBトランシーバ21からの入力信号をデコードしてアウトトークンを受信すると直ちにエンドポイントゼロに対するデータ書き込みの準備を行い、USBトランシーバ21で論理信号に変換されたデータパケットが入力すると、そのデータパケットの中のデータをエンドポイントゼロ用メモリコントローラ230を介してメモリ28へ書き込む。そして、メモリ28へのデータ書き込みが正常に終了すると、シリアル入力エンジン22はUSBトランシーバ21にACKハンドシェークパケットを出力し、USBトランシーバ21はそれをUSBバスの信号に変換してUSBホストに出力する。ここまでがデータを受信するリクエストの場合のデータステージである。 一方、ここでCRCエラー等がありUSBコントーラからのデータパケットの受信、あるいはエンドポイントゼロへの書き込みが失敗した場合、USBホストはUSBコントローラに一定時間送信を行わないことでデータパケットの受信失敗をUSBコントローラに示し、一定時間経過後再びUSBコントローラにイントークンパケットを送信する。
【0019】
なお、エンドポイントゼロ用メモリコントローラ230では、シリアル入力エンジン22からのメモリ28へのデータ書き込みが成功すると、レジスタ26に対してデータ受信信号を出力する。レジスタ26では、データ受信信号が入力するとユーザ回路に対して割込み信号を出力する。ユーザ回路は割込みの要因確認を行う、この場合それがデータ受信信号であるので、エンドポイントゼロ用メモリコントローラ230、I/Oコントローラ25を介して、メモリ28からのデータ読み出しを開始する。
以上はUSB1.1規格の場合であり、USB2.0規格ではUSBホストがアウトトークンパケットとデータパケットを送信する前にピングトークンパケットをUSBコントローラに出力する点でUSB1.1とは異なる。USBコントローラではUSBトランシーバ21がUSBバスの信号を論理信号に変換してシリアル入力エンジン22に出力し、シリアル入力エンジン22がUSBトランシーバ21からの入力信号をデコードしてピングトークンを受信すると、エンドポイントゼロがデータ書き込み可能な場合はACKハンドシェークパケットを、データ書き込みが不可能な場合はNAKハンドシェークパケットをUSBトランシーバ21に出力する。USBトランシーバ21では入力したハンドシェークパケットをUSBバスの信号に変換してUSBホストに返信する。
USBホストではACKハンドシェークパケットが返信された場合は以後USB1.1同様のデータステージの動作が行われる。一方NAKハンドシェークパケットが返信された場合は、再びACKハンドシェークパケットが返信されるまでUSBコントローラに対してピングトークンパケットを送信する。
【0020】
次にUSBホストからデータを受信するリクエストの場合のステータスステージであるが、USBホストは先のデータステージでのACKハンドシェークパケット送信後にイントークンパケットをUSBコントローラに送信する。USBコントローラではUSBトランシーバ21がUSBバスの信号を論理信号に変換してシリアル入力エンジン22に出力し、シリアル入力エンジン22がUSBトランシーバ21からの入力信号をデコードしてイントークンを受信すると、先のデータステージでエンドポイントゼロに書き込まれたデータに対するユーザ回路からの読み出しが終了している場合はゼロレングスデータのデータパケットをUSBトランシーバに出力し、USBトランシーバ21はそれをUSBバスの信号に変換してUSBホストに出力する。USBホストはゼロレングスデータパケットを受信するとACKハンドシェークパケットをUSBコントローラに出力する。ここまでがデータを送信するリクエストの場合のステータスステージである。なお、エンドポイントゼロに書き込まれたデータに対するユーザ回路からの読み出しが終了していない場合は、シリアル入力エンジン22がNAKハンドシェークパケットをUSBトランシーバ21に出力し、USBコントローラ21はそれをUSBバスの信号に変換してUSBホストに返信する。この場合USBホストは一定時間経過後再びイントークンパケットをゼロレングスデータパケットが返信されるまでUSBコントローラに出力する。
最後にデータ送受信を伴わないリクエストの場合、データステージは無く、シリアル入力エンジン22は、セットアップステージで受信した8バイトのデータを基にUSBコントローラのアドレス等の設定値の更新やHALT等の設定を行い、データ転送の方向に応じてデータ送受信を伴う場合と同様のステータスステージが行われる。
【0021】
図4は、本発明のUSBコントローラの別の構成である。同じ構成要素には同じ参照番号が付されているので、重複する説明は省略する。図4のUSBコントローラの動作は、初期設定の際に予め応答データを収めたROMまたはフラッシュメモリ等の電源遮断時もデータの保持が可能な不揮発メモリ27から応答データをRAMに読み込み、同時にコントローラの動作に関する各種設定を行うレジスタに、RAMに書き込まれるリクエストの種類・内容・サイズに対応した値を設定することを除いて図3のUSBコントローラと同じである。
【0022】
【発明の効果】
以上説明したように本発明によれば、リクエストの応答データを、初期設定の際に予めエンドポイントのFIFOと共有するRAMに書き込んでおき、USBホストから自動応答を必要とするリクエストが来た際に、シリアル入力エンジンが予め書き込んでおいた応答データをRAMから読み出してUSBホストに出力するので、ユーザ回路の介在無しに自動応答を行う従来のものよりも自由度が高く、回路規模の小さいUSBコントローラを実現できる。
また、リクエストの応答データを、初期設定の際に予め書き込んでおくエンドポイントのFIFOと共有するRAMが複数の入出力ポートを持つことで、シリアル入力エンジン側、ユーザ回路側双方からRAMに同時にアクセス可能であり、より高速なUSBコントローラを実現できる。
また、RAMに書き込むリクエストの応答データの種類・内容・サイズをUSBコントローラの動作に関する各種設定を行うレジスタに保持して、ユーザが変更可能とすることで柔軟性の有るUSBコントローラを実現できる。
また、初期設定の際に予め応答データを収めたROMまたはフラッシュメモリ等の電源遮断時もデータの保持が可能な不揮発メモリから応答データをRAMに書き込み、同時にコントローラの動作に関する各種設定を行うレジスタに、RAMに書き込まれるリクエストの種類・内容・サイズに対応した値を設定することで、ユーザ回路が初期設定に要する時間を減らした立ち上がりの速いUSBコントローラを実現できる。
【図面の簡単な説明】
【図1】USBバスの接続概念図である。
【図2】デバイスの構成図である。
【図3】本発明の第1の実施の形態に係るUSBコントローラの構成図である。
【図4】本発明の第2の実施の形態に係るUSBコントローラの構成図である。
【図5】従来のUSBコントローラの構成図である。
【符号の説明】
21 USBトランシーバ、22 シリアル入力エンジン(SIE)、23 メモリコントローラ群、24 自動応答値用のメモリコントローラ、25 I/Oコントローラ、26 レジスタ、27 ROM、28 メモリ、29 アービター
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a USB (Universal Serial Bus) controller, and more particularly to a USB controller that automatically responds to a control transfer request accompanied by data transmission to a USB host without the intervention of a user circuit.
[0002]
[Prior art]
As a related art related to a USB controller that automatically responds to a control transfer request accompanied by data transmission to a USB host without intervention of a user circuit, there is an interface box described in JP-A-2000-305890. Examples of the product include a USB controller IC (NetChip 2270) manufactured by NetChip.
In recent years, USB has been used as an interface for connecting a personal computer (PC) and peripheral devices. In the USB, a PC is the only host, a plurality of devices are connected in a tree structure under the host, and the USB controllers of the devices have unique addresses.
The PC, which is the host, sends and receives data to and from the USB controller at the unique address. When the USB controller receives a data transmission / reception request from the host, it notifies the user circuit of the reception of the data transmission / reception request from the host by means of an interrupt signal or the like. Then, the user circuit reads the content of the data transmission / reception request from the USB controller, reads the data received by the USB controller from the host, and writes the transmission data to the host to the USB controller.
Note that the USB controller has a plurality of endpoints, each of which is composed of a normal FIFO memory (First In First Out Memory), which transmits data to the host or receives data from the host (the number thereof is determined by the standard). There). The device connected to the local bus of the USB controller of the device accesses the FIFO memory of the endpoint.
[0003]
Incidentally, data transfer on the USB bus is performed in units of packets.
Packets include types of token packets for transmitting transfer direction and setup information, data packets as actual data, and handshake packets for transmitting data transfer results (success / failure). Regarding the type of transfer, control transfer used for device initialization and various information exchange performed via endpoint zero, and transfer of a large amount of data such as printer data regardless of transfer cycle Bulk transfer, interrupt transfer that sends a small amount of data at fixed intervals such as sending mouse and keyboard status, isochronous transfer that guarantees bandwidth instead of guaranteeing data validity when sending real-time data such as voice data, There are four data transfer modes.
Among these, in the case of control transfer, the USB controller may respond to a data transmission / reception request from the host without the intervention of the user circuit in order to reduce the load on the user circuit. When the USB controller performs data transmission in response to a data transmission request from the host without the intervention of a user circuit, conventionally, transmission data to the host is stored in a register for performing various settings relating to the operation of the USB controller, and the value is stored in the register. It is known that the data is always output to the serial input engine, or is output to the serial input engine when a transmission request is received from the host, and the serial input engine transmits the data to the host.
[0004]
FIG. 5 shows the configuration of a conventional USB controller. The USB transceiver 11 is connected to a USB bus, converts a packet transmitted from a USB host (not shown) from a signal on the USB bus to a logical signal, and outputs the signal to a serial input engine 12 described below. A packet transmitted from the serial input engine 12 to the USB host is converted from a logical signal into a signal on the USB bus and output to the USB host. The serial input engine 12 decodes the token packet and the handshake packet among the packets transmitted from the USB host input from the USB transceiver 11 and performs communication control with the USB host based on the token packet and the handshake packet if necessary. To the USB transceiver 11.
[0005]
The serial input engine 12 reads data to be output to the USB host from a memory 18 described later via the memory access controller group 13, adds control data to the data, and outputs the data to the USB transceiver 11 as a data packet. Control is performed to write data in a data packet from the USB host input from the USB host 11 into the memory 18 via the memory access controller group 13. In response to an automatic response request for control transfer, the automatic response data is read from a register 16 described later, control data is added thereto, and the data is output to the USB transceiver 11 as a data packet. The memory 18 is composed of a RAM, and temporarily stores data received from the local bus and transmitted to the USB host, and data received from the USB host and transmitted to the local bus. A memory access controller group 13 controls writing of data received from the local bus and transmitted to the USB host to the memory 18, and also controls reading of data received from the USB host and transmitted to the local bus from the memory 18. It is a controller group. The I / O controller 15 controls data transfer between a user circuit (not shown), a memory access controller group 13, and a register 16 described below. The register 16 is a register for performing various settings of the USB controller internal module and for storing an automatic response request for control transfer.
[0006]
The memory access controller group 13 is prepared for each endpoint, and a memory controller for endpoint zero (130 in the figure) and a memory controller for multiple endpoints (131 for transfer other than control transfer) are used. , 132,..., 13n), and an arbiter 19 that performs arbitration when a plurality of accesses from each memory controller to the memory 18 occur at the same time. Here, the difference between the memory controller 130 for the endpoint zero and the other memory controllers is that the memory controller 130 for the endpoint zero is used for control transfer. While reading is possible, the memory controller for the other endpoint performs writing on one of the serial input engine 12 and the local bus and performs reading on the other depending on the direction of the endpoint. It is to be done.
[0007]
In the USB controller shown in FIG. 5, when a request for control transfer accompanied by data transmission to the USB host is issued, the serial input engine 12 reads out the automatic response data stored in the register 16 and responds to the control signal in response to the request for performing an automatic response. The USB transceiver 11 adds the data packet as a data packet to the USB transceiver 11, converts the data packet into a USB bus signal, and outputs the signal to the USB host. For a request that does not perform an automatic response, after receiving the request, data is written from the user circuit to the memory 18 via the endpoint zero memory controller 130 via the I / O controller 15 and the serial input engine. 12 reads data from the memory 18 through the endpoint zero memory controller 130, adds a control signal, outputs the data as a data packet to the USB transceiver 11, converts the data packet into a USB bus signal by the USB transceiver 11, and Output to
[0008]
[Problems to be solved by the invention]
However, in the conventional method, since the transmission data is stored in the register, it is difficult to change the size and type of the transmission data. Further, since the number of elements required for the configuration of the register is larger than that of other memory devices, there is a problem that it is difficult to increase the amount of stored data.
Therefore, according to the present invention, the USB controller can easily change the size and type of transmission data in response to a data transmission request from the host without the intervention of a user circuit, and can reduce the circuit scale compared to storing the data in a register. It is an object of the present invention to provide a USB controller that can perform such operations.
[0009]
[Means for Solving the Problems]
In order to solve the above problem, a first aspect of the present invention is a USB controller that automatically responds to a control transfer request accompanied by data transmission to a USB host without the intervention of a user circuit. A memory for storing data corresponding to the FIFO is provided, and response data to the request is also written in the memory in advance at the time of initial setting, and when a request that requires an automatic response from the USB host comes, A serial input engine reads response data from the memory and outputs the response data to a USB host.
According to a second aspect of the present invention, in the USB controller according to the first aspect, when writing / reading data to / from the memory from both the serial input engine and the user circuit, the data for each endpoint and the response are provided. A memory access controller for controlling access in units of data for use.
A third aspect of the present invention is the USB controller according to the first or second aspect, wherein the memory has a plurality of input / output ports.
According to a fourth aspect of the present invention, in the USB controller according to the first, second, or third aspect, a register for performing various settings relating to the operation of the USB controller is provided, and the type, content, and size of response data to a request to be written to the memory are provided. , And the size of the FIFO of the endpoint is held in the register so as to be changeable by the user.
According to a fifth aspect of the present invention, in the USB controller according to the first aspect, when a request that requires an automatic response comes from a USB host, the serial input engine determines the type, content, and size of the response data. Reading response data from an address of the memory and outputting the data to a USB host.
According to a sixth aspect of the present invention, in the USB controller according to the first aspect, a register for performing various settings relating to the operation of the USB controller is provided, and response data is written from the user circuit to the memory at the time of initial setting of the USB controller. At the same time, a value corresponding to the type, content and size of the request is set in the register.
According to a seventh aspect of the present invention, in the USB controller according to the first aspect, a nonvolatile memory storing response data in advance and a register for performing various settings relating to the operation of the controller are provided. And writing a value corresponding to the type, content, and size of the request in the register at the same time as writing the response data to the memory.
[0010]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. FIG. 1 is a conceptual diagram of a USB bus connection. In the figure, 1 is a USB host having a root HUB function, 2a and 2b are HUBs, and 3a to 3d are devices. In this way, in the USB, a plurality of hubs or devices are connected in a tree under one host. The device includes a USB controller 21 and a target device 22 as shown in FIG.
FIG. 3 shows the configuration of the USB controller of the present invention. In FIG. 3, the USB transceiver 21 is connected to a USB bus, converts a packet transmitted from a USB host (not shown) from a signal on the USB bus into a logical signal, and outputs the logical signal to the serial input engine 22. , Converts a packet transmitted from the serial input engine 22 to the USB host from a logical signal to a signal on the USB bus, and outputs the signal to the USB host. The serial input engine 22 decodes the token packet and the handshake packet among the packets transmitted from the USB host input from the USB transceiver 21 and performs communication control with the USB host based on the token packet and the handshake packet. In addition to outputting to the transceiver 21, data to be output to the USB host is read from the memory 2 described later through the memory access controller group 23, control data is added, and the data is output to the USB transceiver 21 as a data packet. The serial input engine 22 controls writing of data in a data packet from the USB host input from the USB transceiver 21 to the memory 28 via the memory access controller group 23, and further responds to an automatic response request for control transfer. Reads the automatic response data from the register 26 described later, adds the control data, and outputs the data to the USB transceiver 21 as a data packet. The memory 28 is a RAM that temporarily stores data received from the local bus and transmitted to the USB host and data received from the USB host and transmitted to the local bus. The memory access controller group 23 controls writing of data received from the local bus and transmitted to the USB host to the memory 28, and control of reading data received from the USB host and transmitted to the local bus from the memory 28. It is. The I / O controller 25 controls data transfer between a user circuit (not shown), the memory controller group 23, and a register described below. The register 26 is a register for performing various settings of the USB controller internal module.
[0011]
The memory access controller group 23 is a memory controller prepared for each endpoint and for an automatic response value of the control transfer. The memory access controller group 23 includes a memory controller for the endpoint zero (230 in the figure) and a transfer other than the control transfer. A plurality of memory controllers (231, 232,..., 23n) for a plurality of endpoints to be used, a memory controller 24 for an automatic response value of control transfer, and a plurality of accesses from each memory controller to the memory 28 simultaneously. And an arbiter 29 that performs arbitration in the case where the arbitration is performed. Here, the difference between the memory controller 230 for the endpoint zero and the other memory controllers is that the memory controller 230 for the endpoint zero is used for the control transfer, so that the memory controller 230 is used for writing on both the serial input engine 22 and the local bus. Whereas the memory controller for the other endpoint writes to one of the serial input engine 22 and the local bus depending on the direction of the endpoint, and reads to the other. Is to be done.
Although not shown in the figure, other modules that may be incorporated include a CLK module for supplying a clock to each module, and a DMA controller for performing DMA transfer between an endpoint and a user circuit. Can be Note that the USB transceiver 21 may be a separate chip from the USB controller.
The access from each memory controller to the memory 28 is performed. When a normal SRAM is used as the memory 28, the access on the serial input engine side and the local bus side of each memory controller is arbitrated by a common arbiter 29. . When a two-port SRAM is used as the memory 28, accesses to the serial input engine side and the local bus side of each memory controller are arbitrated by separate arbiters 29.
[0012]
In the USB controller shown in FIG. 3, initial settings are first performed after the power is turned on. In the initial setting, various settings of the USB controller internal module are performed in the register 26 from the user circuit via the I / O controller 25. At this time, the automatic response data of the device request for the control transfer is written from the user circuit to the memory 28 via the I / O controller 25 and the automatic response value memory controller 24. At the same time, when it is possible to change the start address and size when the automatic response data is accessed from the serial input engine, and the type of the request for performing the automatic response, the added information is added to the register 26 via the I / O controller 25. Write to. Then, after completion of the initial setting, connection to the USB host is performed, and actual data transfer is started.
[0013]
As described above, there are four types of USB transfer modes: control transfer, bulk transfer, interrupt transfer, and isochronous transfer. The present invention relates to control transfer.
The procedure will be described below.
The control transfer includes three stages, a setup stage, a data stage, and a status stage.
The setup stage starts when the USB host sends a setup token packet to the USB controller. The USB host subsequently transmits an 8-byte data packet to indicate the content of the request to the USB controller.
In the USB controller, the USB transceiver 21 converts a signal on the USB bus into a logical signal and outputs the logical signal to the serial input engine 22. The serial input engine 22 decodes the input signal from the USB transceiver 21 and outputs an ACK handshake packet to the USB transceiver 21 when it is determined that the setup token and the 8-byte data packet have been received. The USB transceiver 21 converts the ACK handshake packet input from the serial input engine 22 into a signal on the USB bus and returns it to the USB host to indicate that the request has been received. In the serial input engine 22, the request is decoded at the same time. This is the setup stage.
After that, depending on the type of request, a case where data is transmitted to a USB host like GET_DESCRIPTOR or GET_CONFIGURATION, a case where data is received from a USB host like SET_DESCRIPTOR, or a case where data transmission / reception is not accompanied like SET_CONFIGURATION or SET_ADDRESS And the operation differs.
[0014]
First, this is a data stage in the case of a request for transmitting data to the USB host, such as GET_DESCRIPTOR or GET_CONFIGURATION. In order to read out from the automatic response value memory, preparation is made to output the start address of the area where the request is stored to the memory controller 24 for the automatic response value memory. When the request does not require an automatic response, the serial input engine 22 outputs a setup request reception signal to the register 26. Upon receiving the setup request reception signal, the register 26 outputs an interrupt signal to the user circuit. The user circuit confirms the cause of the interrupt. In this case, since it is a setup request reception, the content of the request is confirmed from the register indicating the content of the setup request, and the corresponding data is stored in the I / O controller 25 and the endpoint zero. To the memory 28 via the memory controller 230 for use. The endpoint zero memory controller 230 informs the serial input engine 22 that the data transmission is ready when the data writing from the user circuit is completed, similarly to the writing of data from the automatic response value memory.
On the other hand, after receiving the ACK handshake packet for the 8-byte data packet, the USB host transmits an in-token packet to the USB controller to request data transmission.
[0015]
In the USB controller, when the in-token packet from the USB host converted into a logical signal by the USB transceiver 21 is input to the serial input engine 22, the serial input engine 22 is set to the endpoint NAK when the transmission data is not ready. The handshake packet is output to the USB transceiver 21, and the USB controller 21 converts the handshake packet into a signal on the USB bus and returns it to the USB host to notify that the data is not ready. In this case, the USB host transmits an in-token packet to the USB controller again after a predetermined time has elapsed. On the other hand, when the data is ready, if the request needs to correspond to an auto-response, the serial input engine 22 sends it to the auto-response value memory controller 24, otherwise, via the endpoint zero controller 230. Then, data is read from the memory 28, a control signal is added to the data, and the data packet is output to the USB transceiver 21 as a data packet. The USB transceiver 21 converts the data into a USB bus signal and returns it to the host. If the data packet is successfully received from the USB controller, the USB host sends an ACK handshake packet to the USB controller. This is the data stage in the case of a request for transmitting data. If the data packet is not returned from the USB controller, the USB host does not transmit the data packet to the USB controller for a certain period of time, so that the reception failure of the data packet is indicated to the USB controller. Send
[0016]
Next, in a status stage in the case of a request to transmit data to the USB host, the USB host transmits an out token packet and subsequently zero-length data to the USB controller after transmitting the ACK handshake packet in the previous data stage. In the USB controller, when the out token packet and the zero-length packet (a data packet composed of only a control signal and not including actual data) from the USB host converted into a logical signal by the USB transceiver 21 are input to the serial input engine 22. When the post-processing in the previous data stage is completed, the serial input engine 22 outputs an ACK handshake packet to the USB transceiver 21, and the USB controller 21 converts it into a USB bus signal and returns it to the USB host. . This is the status stage in the case of a request to transmit data. When the post-processing in the data stage is not completed when the out token packet and the zero-length packet from the USB host are input to the serial input engine 22, the serial input engine 22 outputs a NAK handshake packet to the USB transceiver 21. Then, the USB controller 21 converts the signal into a signal on the USB bus and returns the signal to the USB host. In this case, the USB host outputs the out token packet and the zero-length data again to the USB controller until the ACK handshake packet is returned after a predetermined time has elapsed.
[0017]
The above is the case of the USB 1.1 standard. The USB 2.0 standard differs from the USB 1.1 in that the USB host outputs the ping token packet to the USB controller before transmitting the out token packet and the zero-length data packet. . In the USB controller, the USB transceiver 21 converts the signal of the USB bus into a logical signal and outputs the logical signal to the serial input engine 22. When the serial input engine 22 decodes the input signal from the USB transceiver 21 and receives the ping token, the endpoint The zero memory controller 230 outputs an ACK handshake packet to the USB transceiver 21 when the end point zero area of the memory 28 indicates that data can be written, and outputs a NAK handshake packet when the data cannot be written. The USB transceiver 21 converts the input handshake packet into a signal on the USB bus and returns the signal to the USB host. When the ACK handshake packet is returned, the USB host performs the same status stage operation as in USB 1.1. On the other hand, when the NAK handshake packet is returned, the ping token packet is transmitted to the USB controller until the ACK handshake packet is returned again.
[0018]
Next, in the data stage in the case of a request to receive data from the USB host, such as SET_DESCRIPTOR, the USB host sends an out token packet after receiving the ACK handshake in the previous setup stage, and then sends the data packet to the USB controller. Send.
In the USB controller, the USB transceiver 21 converts a signal on the USB bus into a logical signal and outputs the logical signal to the serial input engine 22. The serial input engine 22 decodes the input signal from the USB transceiver 21 and immediately prepares to write data to the endpoint zero upon receiving the out token. When a data packet converted to a logical signal by the USB transceiver 21 is input, the serial input engine 22 decodes the input signal. The data in the data packet is written to the memory 28 via the endpoint zero memory controller 230. When the data writing to the memory 28 is completed normally, the serial input engine 22 outputs an ACK handshake packet to the USB transceiver 21, and the USB transceiver 21 converts the ACK handshake packet into a signal on the USB bus and outputs the signal to the USB host. This is the data stage in the case of a request to receive data. On the other hand, if the reception of the data packet from the USB controller or the writing to the endpoint zero fails due to a CRC error or the like, the USB host does not transmit the data packet to the USB controller for a certain period of time. The in-token packet is transmitted to the USB controller again after a predetermined time has elapsed.
[0019]
Note that, when the data writing from the serial input engine 22 to the memory 28 succeeds, the endpoint zero memory controller 230 outputs a data reception signal to the register 26. The register 26 outputs an interrupt signal to the user circuit when the data reception signal is input. The user circuit confirms the cause of the interrupt. In this case, since this is a data reception signal, data reading from the memory 28 via the memory controller 230 for endpoint zero and the I / O controller 25 is started.
The above is the case of the USB 1.1 standard. The USB 2.0 standard is different from USB 1.1 in that the USB host outputs the ping token packet to the USB controller before transmitting the out token packet and the data packet. In the USB controller, the USB transceiver 21 converts the signal of the USB bus into a logical signal and outputs the logical signal to the serial input engine 22. When the serial input engine 22 decodes the input signal from the USB transceiver 21 and receives the ping token, the endpoint If zero can be written into the data, an ACK handshake packet is output to the USB transceiver 21. If data cannot be written, a NAK handshake packet is output to the USB transceiver 21. The USB transceiver 21 converts the input handshake packet into a signal on the USB bus and returns the signal to the USB host.
When the ACK handshake packet is returned, the USB host performs the same data stage operation as USB 1.1. On the other hand, when the NAK handshake packet is returned, the ping token packet is transmitted to the USB controller until the ACK handshake packet is returned again.
[0020]
Next, in the status stage in the case of a request to receive data from the USB host, the USB host transmits an Token handshake packet in the previous data stage and then transmits an IN token packet to the USB controller. In the USB controller, the USB transceiver 21 converts the signal of the USB bus into a logical signal and outputs the logical signal to the serial input engine 22. When the serial input engine 22 decodes the input signal from the USB transceiver 21 and receives the in token, When the data written to the endpoint zero in the data stage has been read from the user circuit, a data packet of zero-length data is output to the USB transceiver, and the USB transceiver 21 converts it into a signal on the USB bus. Output to the USB host. Upon receiving the zero-length data packet, the USB host outputs an ACK handshake packet to the USB controller. The above is the status stage in the case of a request for transmitting data. If the reading of the data written to the endpoint zero from the user circuit has not been completed, the serial input engine 22 outputs a NAK handshake packet to the USB transceiver 21, and the USB controller 21 outputs the signal to the USB bus. And returns it to the USB host. In this case, the USB host outputs the in-token packet to the USB controller again after a lapse of a predetermined time until a zero-length data packet is returned.
Finally, in the case of a request that does not involve data transmission / reception, there is no data stage, and the serial input engine 22 updates the setting values such as the address of the USB controller and sets HALT based on the 8-byte data received in the setup stage. Then, the same status stage as in the case where data transmission / reception is performed is performed according to the direction of data transfer.
[0021]
FIG. 4 shows another configuration of the USB controller of the present invention. The same components are denoted by the same reference numerals, and duplicate description will be omitted. The operation of the USB controller shown in FIG. 4 is as follows. At the time of initial setting, response data is read into the RAM from the non-volatile memory 27 which can hold data even when the power is turned off, such as a ROM or a flash memory in which response data is stored in advance. It is the same as the USB controller in FIG. 3 except that values corresponding to the type, content, and size of the request written to the RAM are set in the registers for performing various settings related to the operation.
[0022]
【The invention's effect】
As described above, according to the present invention, the response data of the request is written in advance in the RAM shared with the FIFO of the endpoint at the time of the initial setting, and when the request that requires the automatic response from the USB host comes. In addition, since the serial input engine reads out the response data written in advance from the RAM and outputs it to the USB host, the USB has a higher degree of freedom and a smaller circuit scale than the conventional one which performs an automatic response without the intervention of a user circuit. A controller can be realized.
Also, since the RAM shared with the FIFO of the endpoint in which the response data of the request is previously written at the time of initial setting has a plurality of input / output ports, the RAM can be simultaneously accessed from both the serial input engine side and the user circuit side. It is possible to realize a higher-speed USB controller.
Further, the type, content, and size of the response data of the request to be written to the RAM are stored in registers for performing various settings relating to the operation of the USB controller, and the user can change the data, thereby realizing a flexible USB controller.
Also, at the time of initial setting, response data is written from a non-volatile memory, such as a ROM or a flash memory, in which response data is stored in advance, which can retain data even when power is turned off, to a RAM, and at the same time, a register for performing various settings relating to the operation of the controller. By setting values corresponding to the type, content, and size of the request to be written to the RAM, it is possible to realize a fast-start USB controller that reduces the time required for the user circuit to perform the initial setting.
[Brief description of the drawings]
FIG. 1 is a conceptual diagram of a USB bus connection.
FIG. 2 is a configuration diagram of a device.
FIG. 3 is a configuration diagram of a USB controller according to the first embodiment of the present invention.
FIG. 4 is a configuration diagram of a USB controller according to a second embodiment of the present invention.
FIG. 5 is a configuration diagram of a conventional USB controller.
[Explanation of symbols]
21 USB transceiver, 22 serial input engine (SIE), 23 memory controller group, 24 memory controller for automatic response value, 25 I / O controller, 26 register, 27 ROM, 28 memory, 29 arbiter

Claims (7)

USBホストに対するデータ送信を伴うコントロール転送のリクエストに対してユーザ回路の介在無しに自動応答を行うUSBコントローラにおいて、
各エンドポイントのFIFOに対応してデータを記憶するメモリを備え、前記リクエストへの応答データをも初期設定の際に予め前記メモリに書き込んでおき、USBホストから自動応答を必要とするリクエストが来た際に、シリアル入力エンジンが前記メモリから応答データを読み出して、USBホストに出力することを特徴とするUSBコントローラ。
In a USB controller which automatically responds to a control transfer request accompanied by data transmission to a USB host without intervention of a user circuit,
A memory for storing data corresponding to the FIFO of each endpoint is provided. Response data to the request is also written in the memory in advance at the time of initial setting, and a request that requires an automatic response from the USB host comes in. A serial input engine that reads response data from the memory and outputs the response data to a USB host.
請求項1記載のUSBコントローラにおいて、前記シリアル入力エンジンおよびユーザ回路双方からの前記メモリへのデータの書き込み/読み出しの際に、各エンドポイント用データおよび前記応答用データ単位でアクセスの制御をするメモリアクセスコントローラを設けたことを特徴とするUSBコントローラ。2. The USB controller according to claim 1, wherein when writing / reading data to / from the memory from both the serial input engine and the user circuit, the memory controls access in units of data for each endpoint and data for response. A USB controller comprising an access controller. 前記メモリが複数の入出力ポートを持つことを特徴とする請求項1または2記載のUSBコントローラ。3. The USB controller according to claim 1, wherein the memory has a plurality of input / output ports. 請求項1、2または3記載のUSBコントローラにおいて、USBコントローラの動作に関する各種設定行うレジスタを設け、前記メモリに書き込むリクエストへの応答データの種類・内容・サイズ、およびエンドポイントのFIFOのサイズをユーザが変更可能に前記レジスタに保持するようにしたことを特徴とするUSBコントローラ。4. The USB controller according to claim 1, further comprising a register for performing various settings relating to the operation of the USB controller, wherein a type, a content, and a size of response data to a request to be written to the memory, and a size of an end point FIFO are set by a user. The USB controller is configured to be able to change the value in the register. 請求項1記載のUSBコントローラにおいて、USBホストから自動応答を必要とするリクエストが来た際に、前記シリアル入力エンジンが応答データの種類・内容・サイズに基づいて、前記メモリのアドレスから応答データを読み出してUSBホストに出力することを特徴とするUSBコントローラ。2. The USB controller according to claim 1, wherein, when a request that requires an automatic response from a USB host is received, the serial input engine converts the response data from the address of the memory based on the type, content, and size of the response data. A USB controller for reading out and outputting to a USB host. 請求項1記載のUSBコントローラにおいて、USBコントローラの動作に関する各種設定を行うレジスタを設け、USBコントローラの初期設定の際にユーザ回路から応答データを前記メモリに書き込むと同時に前記レジスタにリクエストの種類・内容・サイズに対応した値を設定することを特徴とするUSBコントローラ。2. The USB controller according to claim 1, further comprising: a register for performing various settings relating to the operation of the USB controller, wherein at the time of initial setting of the USB controller, response data is written from the user circuit to the memory, and at the same time, the type and content of the request are stored in the register. -A USB controller characterized by setting a value corresponding to the size. 請求項1記載のUSBコントローラにおいて、予め応答データを収めた不揮発メモリと、コントローラの動作に関する各種設定を行うレジスタとを設け、初期設定の際に前記不揮発メモリの応答データを前記メモリに書き込むと同時に、前記レジスタにリクエストの種類・内容・サイズに対応した値を設定することを特徴とするUSBコントローラ。2. The USB controller according to claim 1, further comprising: a nonvolatile memory in which response data is stored in advance; and a register for performing various settings relating to the operation of the controller, wherein response data of the nonvolatile memory is written to the memory at the time of initial setting. A value corresponding to the type, content, and size of the request is set in the register.
JP2002179117A 2002-06-19 2002-06-19 Usb controller Pending JP2004021859A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002179117A JP2004021859A (en) 2002-06-19 2002-06-19 Usb controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002179117A JP2004021859A (en) 2002-06-19 2002-06-19 Usb controller

Publications (1)

Publication Number Publication Date
JP2004021859A true JP2004021859A (en) 2004-01-22

Family

ID=31176639

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002179117A Pending JP2004021859A (en) 2002-06-19 2002-06-19 Usb controller

Country Status (1)

Country Link
JP (1) JP2004021859A (en)

Similar Documents

Publication Publication Date Title
US5525971A (en) Integrated circuit
JP4837659B2 (en) Bus controller for processing split transactions
US6928505B1 (en) USB device controller
CN108268414B (en) SD card driver based on SPI mode and control method thereof
US7260667B2 (en) Data transfer device, semiconductor integrated circuit, and microcomputer
JPH02289017A (en) Method of data transfer in computer system
JP3664664B2 (en) Bus system and bus arbitration method thereof
US20090216926A1 (en) Apparatus to improve bandwidth for circuits having multiple memory controllers
JP2008501178A (en) Bus connection device
JPS6282449A (en) Interface unit for computer
JP4696199B2 (en) USB host controller with transfer descriptor memory
JPH0520278A (en) Microcomputer
JP3481308B2 (en) Interface device, data transfer system and data transfer method
US6721833B2 (en) Arbitration of control chipsets in bus transaction
JPH1055331A (en) Programmable read and write access signal and its method
JPH05227247A (en) Circuit and method for acquiring and verifying data
US7003638B2 (en) Memory bus interface for use in a peripheral device
US20070131767A1 (en) System and method for media card communication
US6684284B1 (en) Control chipset, and data transaction method and signal transmission devices therefor
JP2004021859A (en) Usb controller
US6665748B1 (en) Specialized PCMCIA host adapter for use with low cost microprocessors
JPH03171355A (en) Data transfer system
CN106325377A (en) External device expansion card and input/output external device data processing method
JP2003242096A (en) Usb controller
JP2006011926A (en) Serial data transfer system, serial data transfer device, serial data transfer method and image forming apparatus

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050223

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20050406

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070727

A131 Notification of reasons for refusal

Effective date: 20070810

Free format text: JAPANESE INTERMEDIATE CODE: A131

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20071004

A02 Decision of refusal

Effective date: 20080619

Free format text: JAPANESE INTERMEDIATE CODE: A02