[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

JP2003323399A - Data transfer control device, electronic device, and data transfer control method - Google Patents

Data transfer control device, electronic device, and data transfer control method

Info

Publication number
JP2003323399A
JP2003323399A JP2003041563A JP2003041563A JP2003323399A JP 2003323399 A JP2003323399 A JP 2003323399A JP 2003041563 A JP2003041563 A JP 2003041563A JP 2003041563 A JP2003041563 A JP 2003041563A JP 2003323399 A JP2003323399 A JP 2003323399A
Authority
JP
Japan
Prior art keywords
transfer
data
sof
packet
controller
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.)
Withdrawn
Application number
JP2003041563A
Other languages
Japanese (ja)
Inventor
伸之 ▲斎▼藤
Nobuyuki Saito
Takashi Oshita
俊 大下
Yoshiyuki Kanbara
義幸 神原
Kuniaki Matsuda
邦昭 松田
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.)
Seiko Epson Corp
Original Assignee
Seiko Epson 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 Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2003041563A priority Critical patent/JP2003323399A/en
Publication of JP2003323399A publication Critical patent/JP2003323399A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Information Transfer Systems (AREA)

Abstract

(57)【要約】 【課題】 非周期転送時の転送効率を向上できるデータ
転送制御装置、電子機器及びデータ転送制御方法を提供
すること。 【解決手段】 第1のモード(SOF有りモード)が設
定された場合には、SOFパケットをフレーム周期で転
送しながらデータ転送を行い、第2のモード(SOF無
しモード)が設定され且つ非周期(バルク)転送を行う
場合には、SOFパケットの周期転送を無効にして、非
周期データを転送する。転送すべき非周期データが無い
場合には、第2のモードが設定された場合にも、SOF
パケットをフレーム周期で転送する。USBのOTG
(On−The−Go)のホスト動作時にパケットバッ
ファにパイプ領域を確保し、パイプ領域と非周期転送の
エンドポイントとの間でSOFパケットの周期転送を無
効にしながら非周期データを自動転送する。パイプ領域
の自動転送指示信号が全て非アクティブの場合には、第
2のモードが設定された場合にも、SOFパケットを周
期転送する。
(57) [Problem] To provide a data transfer control device, an electronic device, and a data transfer control method capable of improving transfer efficiency at the time of aperiodic transfer. SOLUTION: When a first mode (mode with SOF) is set, data transfer is performed while transferring an SOF packet at a frame cycle, and a second mode (mode without SOF) is set and a non-cycle mode is set. When performing (bulk) transfer, the periodic transfer of the SOF packet is invalidated, and the aperiodic data is transferred. If there is no aperiodic data to be transferred, even if the second mode is set, the SOF
Transfer packets at frame intervals. USB OTG
During the (On-The-Go) host operation, a pipe area is secured in the packet buffer, and the non-periodic data is automatically transferred between the pipe area and the end point of the aperiodic transfer while disabling the periodic transfer of the SOF packet. When all the automatic transfer instruction signals in the pipe area are inactive, the SOF packet is periodically transferred even when the second mode is set.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は、データ転送制御装
置、電子機器及びデータ転送制御方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data transfer control device, an electronic device and a data transfer control method.

【0002】[0002]

【背景技術及び発明が解決しようとする課題】USB
(Universal Serial Bus)2.0の市場が順調に拡大し
ているなか、USB Implementers Forum(USB−I
F)によって、USB On−The−Go(OTG)
と呼ばれるインターフェース規格が策定された。USB
2.0を拡張する形で策定されたOTG規格(OTG
1.0)は、USBインターフェースの新たな付加価値
を生む可能性を秘めており、その特質を生かしたアプリ
ケーションの登場が待たれている。
BACKGROUND AND PROBLEMS TO BE SOLVED BY THE INVENTION USB
While the market for (Universal Serial Bus) 2.0 is steadily expanding, the USB Implementers Forum (USB-I
F) allows USB On-The-Go (OTG)
The interface standard called as. USB
The OTG standard (OTG) developed in the form of extending 2.0
1.0) has the potential to create new added value for the USB interface, and the emergence of applications that take advantage of its characteristics is awaited.

【0003】このOTGによれば、これまでUSBを介
してホスト(パーソナルコンピュータ等)に接続されて
いたペリフェラル(周辺機器)に、ホスト機能を持たせ
ることができる。これにより、ペリフェラル同士をUS
Bで接続してデータを転送することが可能になり、例え
ばデジタルカメラとプリンタとをダイレクトに接続し
て、デジタルカメラの画像を印刷することが可能にな
る。また、デジタルカメラやデジタルビデオカメラをス
トレージ装置に接続して、データを保存することが可能
になる。
According to this OTG, a peripheral (peripheral device) which has been connected to a host (personal computer or the like) via a USB can have a host function. This allows the peripherals to
It becomes possible to connect by B and transfer data, and for example, it becomes possible to directly connect a digital camera and a printer and print an image of the digital camera. In addition, it becomes possible to connect a digital camera or a digital video camera to a storage device to store data.

【0004】しかしながら、OTGによりホスト機能を
持たせるペリフェラルには、低性能のCPU(処理部)
が組み込まれているのが一般的である。従って、ホスト
機能の追加により、ペリフェラルが有するCPU(ファ
ームウェア)の処理負荷が重くなったり、処理が複雑化
すると、他の処理に支障が生じたり、機器の設計期間が
長期化するなどの問題が生じる。
However, a low-performance CPU (processing unit) is used as a peripheral which has a host function by OTG.
Is generally incorporated. Therefore, when the host function is added, the processing load of the CPU (firmware) of the peripheral becomes heavy, or the processing becomes complicated, other processing is hindered, and the device design period becomes long. Occurs.

【0005】また、USB1.1、USB2.0、OT
GなどのUSB規格では、アイソクロナス転送、バルク
転送、コントロール転送、インタラプト転送という4種
類の転送タイプが定義されている。USBのホストは、
これらの各転送タイプのパケットの転送順序を管理し、
フレームの残り時間を考慮しながら、各転送タイプのパ
ケットを転送する。このために、USBではホストがフ
レーム管理を行い、FS(Full Speed)、LS(Low Sp
eed)では1ms毎に、HS(High Speed)では125
μs毎に、SOF(Start Of Frame)パケットをホスト
がペリフェラル(デバイス)に転送する。
In addition, USB1.1, USB2.0, OT
The USB standard such as G defines four types of transfer types: isochronous transfer, bulk transfer, control transfer, and interrupt transfer. The USB host is
Manage the transfer order of packets of each of these transfer types,
The packets of each transfer type are transferred while considering the remaining time of the frame. For this reason, in USB, the host manages frames, and FS (Full Speed) and LS (Low Sp
eed) every 1ms, HS (High Speed) 125
The host transfers an SOF (Start Of Frame) packet to the peripheral (device) every μs.

【0006】しかしながら、バルク転送やコントロール
転送などの非周期転送では、このようなSOFパケット
の転送はバス帯域を狭める結果となり、転送効率が低下
してしまうという課題があることが判明した。
However, in aperiodic transfer such as bulk transfer and control transfer, it has been found that such transfer of SOF packets results in narrowing the bus band, resulting in a decrease in transfer efficiency.

【0007】本発明は、以上のような技術的課題に鑑み
てなされたものであり、その目的とするところは、非周
期転送時の転送効率を向上できるデータ転送制御装置、
電子機器及びデータ転送制御方法を提供することにあ
る。
The present invention has been made in view of the above technical problems, and an object of the present invention is to provide a data transfer control device capable of improving transfer efficiency during aperiodic transfer,
An object is to provide an electronic device and a data transfer control method.

【0008】[0008]

【課題を解決するための手段】本発明は、バスを介した
データ転送のためのデータ転送制御装置であって、転送
データを記憶するパケットバッファのアクセス制御を行
うバッファコントローラと、パケットバッファのデータ
の転送を制御する転送コントローラとを含み、前記転送
コントローラが、第1のモードが設定された場合には、
SOF(StartOf Frame)パケットをフレーム周期で転
送しながらデータ転送を行い、第2のモードが設定され
且つ非周期転送を行う場合には、SOFパケットの周期
転送を無効にして、非周期データの転送を行うデータ転
送制御装置に関係する。
SUMMARY OF THE INVENTION The present invention is a data transfer control device for data transfer via a bus, comprising a buffer controller for controlling access to a packet buffer for storing transfer data, and data in the packet buffer. And a transfer controller for controlling the transfer of the first transfer mode, the transfer controller, when the first mode is set,
When data transfer is performed while transferring an SOF (StartOfFrame) packet at a frame cycle, and when the second mode is set and aperiodic transfer is performed, the periodic transfer of the SOF packet is disabled and the aperiodic data transfer is performed. And a data transfer control device that performs

【0009】本発明では、第1のモードの設定時には、
SOFパケットがフレーム周期で転送されながら、デー
タ転送が行われる。これにより、例えばアイソクロナス
転送等の周期転送を適正に行うことが可能になる。一
方、第2のモードの設定時には、SOFパケットの転送
が無効にされて、非周期データの転送が行われる。これ
により、複数のフレームの境界をまたがったトランザク
ションの発生等が可能になり、例えばバルク転送、コン
トロール転送等の非周期転送の転送効率を向上できる。
According to the present invention, when the first mode is set,
Data transfer is performed while the SOF packet is transferred at the frame cycle. This makes it possible to properly perform periodic transfer such as isochronous transfer. On the other hand, when the second mode is set, the SOF packet transfer is disabled and the aperiodic data transfer is performed. As a result, it is possible to generate transactions that cross the boundaries of a plurality of frames, and improve the transfer efficiency of aperiodic transfer such as bulk transfer and control transfer.

【0010】また本発明では、前記転送コントローラ
が、転送すべき非周期データが無い場合には、第2のモ
ードが設定された場合にも、SOFパケットをフレーム
周期で転送するようにしてもよい。
In the present invention, the transfer controller may transfer the SOF packet at the frame cycle even when the second mode is set when there is no aperiodic data to be transferred. .

【0011】このようにすれば、バスに接続される他の
機器が不適切なステートに移行してしまう事態等を防止
できる。なお、転送すべき非周期データが有るか無いか
は、例えば、転送開始指示信号や、パケットバッファの
フル、エンプティ信号等により判断できる。
By doing so, it is possible to prevent a situation in which another device connected to the bus shifts to an inappropriate state. Whether there is aperiodic data to be transferred or not can be determined by, for example, a transfer start instruction signal, a packet buffer full, an empty signal, or the like.

【0012】また本発明では、ホストの役割として動作
するホスト動作のステートと、ペリフェラルの役割とし
て動作するペリフェラル動作のステートを含む複数のス
テートの制御を行うステートコントローラを含み、前記
パケットバッファには、各エンドポイントとの間で転送
されるデータが各パイプ領域に記憶される複数のパイプ
領域が確保され、前記転送コントローラが、ホスト動作
時において、ホストとしてのデータ転送を行うホストコ
ントローラと、ペリフェラル動作時において、ペリフェ
ラルとしてのデータ転送を行うペリフェラルコントロー
ラとを含み、前記ホストコントローラが、エンドポイン
トに対するトランザクションを自動発生し、パイプ領域
と、そのパイプ領域に対応するエンドポイントとの間
で、データを自動転送するようにしてもよい。
Further, according to the present invention, a state controller for controlling a plurality of states including a host operation state operating as a host role and a peripheral operation state operating as a peripheral role is included, and the packet buffer includes: A plurality of pipe areas in which data transferred to and from each endpoint are stored in the respective pipe areas are secured, and the transfer controller performs a data transfer as a host during the host operation, and a peripheral operation. Sometimes, the host controller includes a peripheral controller that transfers data as a peripheral, and the host controller automatically generates a transaction for the endpoint, and automatically transfers data between the pipe area and the endpoint corresponding to the pipe area. Turning It may be.

【0013】本発明によれば、例えば、ステートコント
ローラにより制御されるステートが、ホスト動作のステ
ートになると、ホストコントローラにより、ホストの役
割としてのデータ転送が行われる。また、ステートコン
トローラにより制御されるステートが、ペリフェラル動
作のステートになると、ペリフェラルコントローラによ
り、ペリフェラルの役割としてのデータ転送が行われ
る。これにより、いわゆるデュアルロール・デバイス機
能を実現できるようになる。
According to the present invention, for example, when the state controlled by the state controller becomes the state of the host operation, the host controller performs the data transfer as the role of the host. When the state controlled by the state controller becomes the state of peripheral operation, the peripheral controller performs data transfer as the role of the peripheral. This allows the so-called dual roll device function to be realized.

【0014】そして本発明では、ホスト動作時におい
て、パケットバッファに対して複数のパイプ領域が確保
(allocate)され、確保されたパイプ領域とエンドポイ
ントとの間で、データが自動転送される。これにより、
デュアルロール・デバイス機能を実現できると共に、ホ
スト動作時における処理部の処理負荷を軽減できる。
According to the present invention, a plurality of pipe areas are allocated to the packet buffer during host operation, and data is automatically transferred between the allocated pipe areas and the end points. This allows
The dual roll device function can be realized, and the processing load on the processing unit during host operation can be reduced.

【0015】また本発明では、前記ホストコントローラ
が、第2のモードが設定された場合には、パイプ領域と
そのパイプ領域に対応する非周期転送のエンドポイント
との間で、SOFパケットの周期転送を無効にしなが
ら、非周期データを自動転送するようにしてもよい。
Further, according to the present invention, when the second mode is set, the host controller periodically transfers the SOF packet between the pipe region and the aperiodic transfer endpoint corresponding to the pipe region. The non-periodic data may be automatically transferred while invalidating.

【0016】このようにすれば、パイプ領域を用いて、
非周期転送のエンドポイントとの間で、非周期データの
自動転送が可能になり、データ転送を効率化できる。そ
して、この時に本発明では、SOFパケットの周期転送
が無効になるため、データ転送を更に効率化できる。な
お、SOFパケットの転送を無効にする場合(第2のモ
ードに設定する場合)には、パケットバッファに確保さ
れるパイプ領域に、周期転送(アイソクロナス転送等)
以外の転送種別のエンドポイントを割り当てることが望
ましい。
In this way, using the pipe region,
The aperiodic data can be automatically transferred to and from the aperiodic transfer endpoint, and the data transfer can be made efficient. At this time, in the present invention, the periodic transfer of the SOF packet is invalidated, so that the data transfer can be made more efficient. When invalidating the SOF packet transfer (when setting the second mode), cyclic transfer (isochronous transfer, etc.) is performed in the pipe area secured in the packet buffer.
It is desirable to assign endpoints of transfer types other than.

【0017】また本発明では、前記ホストコントローラ
が、パイプ領域の自動転送指示信号が全て非アクティブ
の場合には、第2のモードが設定された場合にも、SO
Fパケットをフレーム周期で自動転送するようにしても
よい。
Also, in the present invention, when the host controller automatically sets the second mode when all the automatic transfer instruction signals in the pipe area are inactive,
The F packet may be automatically transferred at the frame cycle.

【0018】このようにすれば、転送すべきデータが有
るか無いかを、自動転送指示信号に基づいて判断できる
ため、判断処理を簡素化できる。そして、自動転送指示
信号が全て非アクティブの場合(転送すべきデータが無
い場合)に、SOFパケットを転送することで、バスに
接続される他の機器が不適切なステートに移行してしま
う事態等を防止できる。
With this configuration, it is possible to determine whether or not there is data to be transferred based on the automatic transfer instruction signal, so that the determination process can be simplified. Then, when all the automatic transfer instruction signals are inactive (when there is no data to be transferred), by transferring the SOF packet, another device connected to the bus shifts to an inappropriate state. Etc. can be prevented.

【0019】また本発明では、前記ホストコントローラ
が、フレーム周期毎にSOF転送開始トリガをアクティ
ブにし、SOFパケットの転送が完了した場合に前記S
OF転送開始トリガを非アクティブにするSOF転送開
始トリガ生成回路と、パイプ領域の自動転送指示信号
と、ステートコントローラからのステート情報信号と、
第1又は第2のモードを指示する信号を受け、前記SO
F転送開始トリガを無効にする信号を生成するSOF無
効信号生成回路とを含んでもよい。
Further, in the present invention, when the host controller activates the SOF transfer start trigger for each frame period and the transfer of the SOF packet is completed, the S
An SOF transfer start trigger generation circuit for deactivating the OF transfer start trigger, an automatic transfer instruction signal for the pipe region, a state information signal from the state controller,
The signal indicating the first or second mode is received, and the SO
An SOF invalid signal generation circuit that generates a signal for invalidating the F transfer start trigger may be included.

【0020】このようにすれば、SOFパケットの転送
を無効にする処理等を簡素な回路で実現できる。なお、
例えば、ステート情報信号が示すステートがホスト動作
であり、第2のモードが指示され、自動転送指示信号の
少なくとも1つがアクティブの場合には、SOF転送開
始トリガの無効信号をアクティブにして、SOF転送開
始トリガの生成を無効にすることができる。一方、ステ
ート情報信号が示すステートがホスト動作であり、第2
のモードが指示された場合にも、自動転送指示信号が全
て非アクティブの場合(転送すべきデータが無い場合)
には、SOF転送開始トリガの無効信号を非アクティブ
にして、SOF転送開始トリガの生成が無効にされない
ようにすることができる。
With this configuration, the processing for invalidating the transfer of the SOF packet can be realized with a simple circuit. In addition,
For example, when the state indicated by the state information signal is the host operation, the second mode is instructed, and at least one of the automatic transfer instruction signals is active, the invalid signal of the SOF transfer start trigger is activated and the SOF transfer is performed. Start trigger generation can be disabled. On the other hand, the state indicated by the state information signal is the host operation, and the second
When all the automatic transfer instruction signals are inactive even when the mode is instructed (when there is no data to be transferred)
In addition, the SOF transfer start trigger invalidation signal can be deactivated so that the generation of the SOF transfer start trigger is not invalidated.

【0021】また本発明では、ペリフェラル動作時に
は、ホストとの間で転送されるデータが各エンドポイン
ト領域に記憶される複数のエンドポイント領域が、パケ
ットバッファに確保され、前記ペリフェラルコントロー
ラが、エンドポイント領域とホストとの間でデータを転
送するようにしてもよい。
Further, according to the present invention, at the time of peripheral operation, a plurality of endpoint areas in which data to be transferred to and from the host are stored in the respective endpoint areas are secured in the packet buffer, and the peripheral controller causes the endpoint controller to operate. Data may be transferred between the area and the host.

【0022】このようにすれば、パケットバッファのバ
ッファ領域を、ホスト動作時にはパイプ領域として使用
し、ペリフェラル動作時にはエンドポイント領域として
使用できるようになる。これにより、パケットバッファ
のリソースの有効利用や、処理部の処理負荷の軽減化を
図れる。
With this configuration, the buffer area of the packet buffer can be used as a pipe area during host operation and as an endpoint area during peripheral operation. This makes it possible to effectively use the resources of the packet buffer and reduce the processing load of the processing unit.

【0023】また本発明では、前記非周期転送がUSB
(Universal Serial Bus)規格のバルク転送又はコント
ロール転送であり、前記非周期データがバルクデータ又
はコントロールデータであってもよい。
In the present invention, the aperiodic transfer is USB.
(Universal Serial Bus) standard bulk transfer or control transfer, and the aperiodic data may be bulk data or control data.

【0024】また本発明では、USB(Universal Seri
al Bus)のOTG(On−The−Go)規格に準拠し
たデータ転送を行うようにしてもよい。
Further, according to the present invention, a USB (Universal Seri
Data may be transferred in conformity with the OTG (On-The-Go) standard of al Bus).

【0025】また本発明は、上記のいずれかのデータ転
送制御装置と、前記データ転送制御装置及びバスを介し
て転送されるデータの出力処理又は取り込み処理又は記
憶処理を行う装置と、前記データ転送制御装置のデータ
転送を制御する処理部とを含む電子機器に関係する。
The present invention also provides any one of the above-mentioned data transfer control devices, a device for performing an output process, a fetch process, or a storage process of data transferred via the data transfer control device and a bus, and the data transfer The present invention relates to an electronic device including a processing unit that controls data transfer of a control device.

【0026】また本発明は、バスを介したデータ転送の
ためのデータ転送制御方法であって、転送データを記憶
するパケットバッファのアクセス制御を行い、パケット
バッファのデータの転送を制御すると共に、第1のモー
ドが設定された場合には、SOF(Start Of Frame)パ
ケットをフレーム周期で転送しながらデータ転送を行
い、第2のモードが設定され且つ非周期転送を行う場合
には、SOFパケットの周期転送を無効にして、非周期
データの転送を行うデータ転送制御方法に関係する。
The present invention is also a data transfer control method for data transfer via a bus, which performs access control of a packet buffer for storing transfer data, controls data transfer of the packet buffer, and When the mode 1 is set, the data transfer is performed while transferring the SOF (Start Of Frame) packet at the frame cycle, and when the second mode is set and the aperiodic transfer is performed, the SOF packet The present invention relates to a data transfer control method that disables cyclic transfer and transfers aperiodic data.

【0027】[0027]

【発明の実施の形態】以下、本実施形態について説明す
る。
BEST MODE FOR CARRYING OUT THE INVENTION The present embodiment will be described below.

【0028】なお、以下に説明する本実施形態は、特許
請求の範囲に記載された本発明の内容を不当に限定する
ものではない。また本実施形態で説明される構成の全て
が本発明の解決手段として必須であるとは限らない。
The present embodiment described below does not unduly limit the contents of the present invention described in the claims. Further, not all of the configurations described in the present embodiment are essential as the solving means of the present invention.

【0029】1.OTG まず、OTG(USB On−The−Go)について
簡単に説明する。
1. OTG First, OTG (USB On-The-Go) will be briefly described.

【0030】1.1 Aデバイス、Bデバイス OTGでは、コネクタの規格として、図1(A)に示す
ようなMini-Aプラグ、Mini-Bプラグが定義されてい
る。また、これらのMini-Aプラグ、Mini−Bプラグ
(広義にはケーブルの第1、第2のプラグ)の両方を接
続できるコネクタとして、Mini-ABレセプタクル(rec
eptacle)が定義されている。
1.1 In the A device and B device OTG, Mini-A plugs and Mini-B plugs as shown in FIG. 1A are defined as connector standards. In addition, as a connector that can connect both of these Mini-A plugs and Mini-B plugs (broadly speaking, the first and second plugs of the cable), a Mini-AB receptacle (rec
eptacle) is defined.

【0031】そして例えば図1(B)のように、USB
ケーブルのMini-Aプラグに電子機器Pが接続され、Min
i-Bプラグに電子機器Qが接続されると、電子機器Pは
Aデバイスに設定され、電子機器QはBデバイスに設定
される。一方、図1(C)に示すように、Mini-Bプラ
グ、Mini-Aプラグが電子機器P、Qに接続されると、
電子機器P、Qは、各々、Bデバイス、Aデバイスに設
定される。
Then, for example, as shown in FIG.
Electronic device P is connected to the Mini-A plug of the cable, and Min
When the electronic device Q is connected to the i-B plug, the electronic device P is set to the A device and the electronic device Q is set to the B device. On the other hand, as shown in FIG. 1C, when the Mini-B plug and the Mini-A plug are connected to the electronic devices P and Q,
The electronic devices P and Q are set to the B device and the A device, respectively.

【0032】Mini-Aプラグ内ではIDピンがGNDに
接続されており、Mini-Bプラグ内ではIDピンはフロ
ーティング状態になっている。電子機器は、内蔵するプ
ルアップ抵抗回路を用いて、このIDピンの電圧レベル
を検出することで、自身がMini-Aプラグに接続された
のか、或いはMini-Bプラグに接続されたのかを判断す
る。
In the Mini-A plug, the ID pin is connected to GND, and in the Mini-B plug, the ID pin is in a floating state. The electronic device uses the built-in pull-up resistor circuit to detect the voltage level of this ID pin to determine whether it is connected to the Mini-A plug or the Mini-B plug. To do.

【0033】OTGでは、Aデバイス(マスター)が、
電源(VBUS)を供給する側(供給元)になり、Bデ
バイス(スレイブ)が、電源の供給を受ける側(供給
先)になる。また、Aデバイスは、デフォルトのステー
トがホストになり、Bデバイスは、デフォルトのステー
トがペリフェラル(周辺機器)になる。
In OTG, the A device (master) is
The power supply (VBUS) is the supply side (supply source), and the B device (slave) is the supply side (supply destination). The default state of the A device is the host, and the default state of the B device is the peripheral (peripheral device).

【0034】1.2 デュアルロール・デバイス OTGでは、ホスト(簡易ホスト)としての役割とペリ
フェラルとしての役割の両方を持つことができるデュア
ルロール・デバイス(Dual-Role Device)が定義されて
いる。
1.2 Dual-Role Device OTG defines a dual-role device capable of having both a role as a host (simple host) and a role as a peripheral.

【0035】デュアルロール・デバイスは、ホストにも
ペリフェラルにもなれる。そして、デュアルロール・デ
バイスに接続された相手が、従来のUSB規格における
ホストやペリフェラルである場合には、デュアルロール
・デバイスの役割は一意に定まる。つまり、接続相手が
ホストであれば、デュアルロール・デバイスはペリフェ
ラルになり、接続相手がペリフェラルであれば、デュア
ルロール・デバイスはホストになる。
The dual role device can be a host or a peripheral. Then, when the partner connected to the dual roll device is a host or peripheral in the conventional USB standard, the role of the dual roll device is uniquely determined. That is, if the connection partner is a host, the dual role device becomes a peripheral, and if the connection partner is a peripheral, the dual role device becomes a host.

【0036】一方、接続相手がデュアルロール・デバイ
スである場合には、両方のデュアルロール・デバイス
は、お互いにホストとペリフェラルの役割を交換でき
る。
On the other hand, when the connection partner is a dual role device, both dual role devices can exchange the roles of the host and the peripheral with each other.

【0037】1.3 SRP、HNP デュアルロール・デバイスは、図2(A)、(B)に示
すようなセッション開始要求手順SRP(Session Requ
est Protocol)やホスト交換手順HNP(HostNegotiat
ion Protocol)の機能を持つ。
1.3 SRP, HNP The dual roll device has a session start request procedure SRP (Session Requence) as shown in FIGS. 2 (A) and 2 (B).
est Protocol) and host exchange procedure HNP (HostNegotiat)
ion protocol) function.

【0038】ここでセッション開始要求手順SRPは、
BデバイスがAデバイスに対して、VBUS(電源)の
供給を要求するプロトコルである。
Here, the session start request procedure SRP is
This is a protocol in which the B-device requests the A-device to supply VBUS (power supply).

【0039】バスを使用しない場合にOTGでは、Aデ
バイスはVBUSの供給を停止できる。これにより、A
デバイスが例えば小型の携帯機器であった場合に、無駄
な電力消費を防止できる。そして、AデバイスがVBU
Sの供給を停止した後に、BデバイスがVBUSを供給
してもらいたい場合には、このSRPを使用して、Aデ
バイスに対してVBUSの供給の再開を要求する。
In the OTG when the bus is not used, the A device can stop supplying VBUS. This gives A
When the device is, for example, a small mobile device, it is possible to prevent unnecessary power consumption. And A device is VBU
When the B device wants to supply VBUS after stopping the supply of S, the SRP is used to request the A device to restart the supply of VBUS.

【0040】図2(A)にSRPの流れを示す。図2
(A)に示すように、Bデバイスは、データ・ライン・
パルシングとVBUSパルシングを行うことで、Aデバ
イスに対してVBUSの供給を要求する。そして、Aデ
バイスによるVBUSの供給の開始後に、Bデバイスの
ペリフェラル動作(peripheral operation)と、Aデバ
イスのホスト動作(host operation)が開始する。
FIG. 2 (A) shows the flow of SRP. Figure 2
As shown in (A), the B device has a data line
By performing pulsing and VBUS pulsing, supply of VBUS is requested to the A device. Then, after the supply of VBUS by the A device is started, the peripheral operation (peripheral operation) of the B device and the host operation (host operation) of the A device are started.

【0041】図1(A)〜図1(C)で説明したよう
に、デュアルロール・デバイス同士の接続では、Mini-
Aプラグが接続された側であるAデバイスがデフォルト
のホストとなり、Mini-Bプラグが接続された側である
Bデバイスがデフォルトのペリフェラルになる。そし
て、OTGでは、プラグの抜き差しを行わなくても、ホ
ストとペリフェラルの役割を交換できる。HNPは、こ
のホストとペリフェラルの役割を交換するためのプロト
コルである。
As described with reference to FIGS. 1 (A) to 1 (C), when connecting dual-role devices, Mini-
The A device on the side to which the A plug is connected becomes the default host, and the B device on the side to which the Mini-B plug is connected becomes the default peripheral. Then, in the OTG, the roles of the host and the peripheral can be exchanged without plugging and unplugging. HNP is a protocol for exchanging the roles of this host and peripherals.

【0042】HNPの流れを図2(B)に示す。デフォ
ルトのホストとして動作するAデバイスが、バスの使用
を終了すると、バスがアイドル状態になる。その後に、
Bデバイスがデータ信号線DP(D+)のプルアップ抵
抗を無効にすると、AデバイスがDPのプルアップ抵抗
を有効にする。これにより、Aデバイスの役割はホスト
からペリフェラルに変わり、ペリフェラルとしての動作
を開始する。また、Bデバイスの役割はペリフェラルか
らホストに変わり、ホストとしての動作を開始する。
The flow of HNP is shown in FIG. When the A device, which acts as the default host, finishes using the bus, the bus goes idle. After that,
When the B device disables the pull-up resistor of the data signal line DP (D +), the A device enables the pull-up resistor of DP. As a result, the role of the A device is changed from the host to the peripheral, and the operation as the peripheral is started. The role of the B device is changed from the peripheral to the host, and the operation as the host is started.

【0043】その後、Bデバイスが、バスの使用を終了
し、AデバイスがDPのプルアップ抵抗を無効にする
と、Bデバイスが、DPのプルアップ抵抗を有効にす
る。これにより、Bデバイスの役割はホストからペリフ
ェラルに戻り、ペリフェラルとしての動作を再開する。
また、Aデバイスの役割はペリフェラルからホストに戻
り、ホストとしての動作を再開する。
After that, when the B device finishes using the bus and the A device disables the DP pull-up resistor, the B device enables the DP pull-up resistor. As a result, the role of the B device returns from the host to the peripheral, and the operation as the peripheral is restarted.
The role of the A device returns from the peripheral to the host and resumes the operation as the host.

【0044】以上に説明したOTGによれば、携帯電話
やデジタルカメラなどの携帯機器をUSBのホストとし
て動作させ、携帯機器同士をピア・ツー・ピアで接続し
てデータ転送を行うことが可能になる。これにより、U
SBインターフェースに新たな付加価値を生むことがで
き、これまでには存在しなかったアプリケーションを創
出できる。
According to the OTG described above, it is possible to operate a mobile device such as a mobile phone or a digital camera as a USB host and connect the mobile devices peer-to-peer to transfer data. Become. This makes U
The SB interface can create new added value and create applications that have never existed before.

【0045】2.OHCI さて、従来のUSBでは、ホストであるパーソナルコン
ピュータが有するデータ転送制御装置(ホストコントロ
ーラ)は、マイクロソフト社が提唱したOHCI(Open
Host Controller Interface)や、UHCI(Universa
l Host Controller Interface)といった規格に準拠し
ていた。また、使用されるOS(Operating System)
も、マイクロソフト社のWindowsやアップル社のマッキ
ントッシュのOSなどに限定されていた。
2. OHCI In the conventional USB, the data transfer control device (host controller) of the personal computer that is the host is the OHCI (Open
Host Controller Interface) and UHCI (Universa
l Host Controller Interface). Also, the OS (Operating System) used
Was limited to Microsoft's Windows and Apple's Macintosh OS.

【0046】しかしながら、OTGのターゲット・アプ
リケーションである小型携帯機器では、組み込まれるC
PUのアーキテクチャや、使用されるOSは千差万別で
ある。更に、パーソナルコンピュータのホストコントロ
ーラ向けに規格化されたOHCIやUHCIは、USB
ホストとしての機能をフルに実装することを前提として
おり、小型携帯機器への実装に最適であるとは言い難
い。
However, in the small portable device which is the target application of OTG, the C
The architecture of the PU and the OS used vary widely. Furthermore, OHCI and UHCI standardized for host controllers of personal computers are USB
Assuming that the host functions are fully implemented, it is difficult to say that it is optimal for small portable devices.

【0047】例えば、図3(A)に、OHCIで使用さ
れるリスト構造のディスクリプタの一例を示す。
For example, FIG. 3A shows an example of a descriptor having a list structure used in OHCI.

【0048】図3(A)において、エンドポイントディ
スクリプタED1、ED2、ED3は、リンクポインタ
によりリンクされており、エンドポイント1、2、3と
のコミュニケーションに必要な情報が含まれている。そ
して、これらのED1、ED2、ED3には、転送ディ
スクリプタTD11〜TD13、TD21、TD31〜
TD32がリンクポインタにより更にリンクされてい
る。そして、これらの転送ディスクリプタには、エンド
ポイント1、2、3との間で転送するパケットデータに
必要な情報が含まれている。
In FIG. 3A, the endpoint descriptors ED1, ED2, and ED3 are linked by a link pointer, and include information necessary for communication with the endpoints 1, 2, and 3. Then, transfer descriptors TD11 to TD13, TD21, TD31 to ED1, ED2 and ED3 are provided.
The TD 32 is further linked by the link pointer. Then, these transfer descriptors include information necessary for packet data transferred between the endpoints 1, 2, and 3.

【0049】図3(A)のリスト構造のディスクリプタ
は、図3(B)のCPU610(広義には処理部)上で
動作するファームウェア(ホストコントローラ・ドライ
バ)が作成し、システムメモリ620に書き込む。即
ち、ファームウェアは、システム中のエンドポイントに
対してエンドポイントディスクリプタを割り当て、エン
ドポイント情報等に基づいてエンドポイントディスクリ
プタ、転送ディスクリプタを作成する。そして、これら
のディスクリプタをリンクポインタでリンクさせて、シ
ステムメモリ620に書き込む。
The descriptor having the list structure of FIG. 3A is created by the firmware (host controller driver) operating on the CPU 610 (broadly speaking, processing unit) of FIG. 3B and written in the system memory 620. That is, the firmware allocates the endpoint descriptor to the endpoint in the system, and creates the endpoint descriptor and the transfer descriptor based on the endpoint information and the like. Then, these descriptors are linked by the link pointer and written in the system memory 620.

【0050】データ転送制御装置600(ホストコント
ローラ)は、システムメモリ620に書き込まれたリス
ト構造のディスクリプタを読み出し、エンドポイントデ
ィスクリプタや転送ディスクリプタに記述される情報に
基づいて、データ転送を実行する。
The data transfer control device 600 (host controller) reads the descriptor of the list structure written in the system memory 620 and executes the data transfer based on the information described in the endpoint descriptor and the transfer descriptor.

【0051】具体的には、データ転送制御装置600
(ホストコントローラ)は、ED1に基づいてエンドポ
イント1の情報を設定し、ED1にリンクされるTD1
1に基づいて、エンドポイント1との間でデータ転送を
行う。次に、ED2に基づいてエンドポイント2の情報
を設定し、ED2にリンクされるTD21に基づいて、
エンドポイント2との間でデータ転送を行う。同様にし
て、データ転送制御装置600は、TD31、TD1
2、TD32、TD13に基づいてデータ転送を実行す
る。
Specifically, the data transfer control device 600
The (host controller) sets the information of the endpoint 1 based on ED1, and TD1 linked to ED1
Based on 1, data transfer is performed with the endpoint 1. Next, set the information of the endpoint 2 based on ED2, and based on TD21 linked to ED2,
Data transfer is performed with the endpoint 2. Similarly, the data transfer control device 600 uses the TD31 and TD1.
2, data transfer is executed based on TD32 and TD13.

【0052】以上のように、OHCI準拠のデータ転送
制御装置(ホストコントローラ)では、CPU上で動作
するファームウェア(ホストコントローラ・ドライバ)
が、図3(A)に示すような複雑な構造のディスクリプ
タを作成しなければならない。従って、CPUの処理負
荷が非常に重い。
As described above, in the OHCI-compliant data transfer control device (host controller), the firmware (host controller driver) that operates on the CPU
However, it is necessary to create a descriptor having a complicated structure as shown in FIG. Therefore, the processing load of the CPU is very heavy.

【0053】この場合、従来のUSBでは、ホストの役
割が割り当てられるのはパーソナルコンピュータだけで
あり、このパーソナルコンピュータは高性能のCPUを
有している。従って、図3(A)に示すような複雑な構
造のディスクリプタの作成も、余裕を持って行うことが
可能であった。
In this case, in the conventional USB, only the personal computer is assigned the role of host, and this personal computer has a high-performance CPU. Therefore, it is possible to prepare a descriptor having a complicated structure as shown in FIG. 3A with a margin.

【0054】ところが、OTGのターゲットアプリケー
ションである小型携帯機器(デジタルカメラ、携帯電話
等)に組み込まれるCPU(embedded CPU)は、パーソ
ナルコンピュータのCPUに比べて、性能が格段に低い
のが一般的である。従って、携帯機器にOTGのホスト
動作を行わせると、携帯機器に組み込まれるCPUに過
大な負荷がかかり、他の処理に支障が生じたり、データ
転送のパフォーマンスが低下するなどの問題が生じる。
However, a CPU (embedded CPU) incorporated in a small portable device (digital camera, mobile phone, etc.), which is a target application of OTG, generally has much lower performance than the CPU of a personal computer. is there. Therefore, when the portable device is made to perform the host operation of the OTG, the CPU incorporated in the portable device is overloaded, which causes problems such as hindering other processing and degrading the data transfer performance.

【0055】3.構成例 図4に、以上のような問題を解決できる本実施形態のデ
ータ転送制御装置の構成例を示す。なお、本実施形態の
データ転送制御装置は、図4の全ての回路ブロックを含
む必要はなく、その一部の回路ブロックを省略してもよ
い。
3. Configuration Example FIG. 4 shows a configuration example of the data transfer control device of the present embodiment that can solve the above problems. The data transfer control device of this embodiment does not need to include all the circuit blocks in FIG. 4, and some of the circuit blocks may be omitted.

【0056】トランシーバ10(以下、適宜Xcvrと
呼ぶ)は、差動データ信号DP、DMを用いてUSB
(広義にはバス)のデータを送受信する回路であり、U
SBの物理層(PHY)回路12を含む。より具体的に
はトランシーバ10は、DP、DMのラインステート
(J、K、SE0等)の生成、シリアル/パラレル変
換、パラレル/シリアル変換、ビットスタッフィング、
ビットアンスタッフィング、NRZIデコード、NRZ
Iエンコードなどを行う。なお、トランシーバ10をデ
ータ転送制御装置の外部に設けるようにしてもよい。
The transceiver 10 (hereinafter, appropriately referred to as Xcvr) uses the differential data signals DP and DM for USB.
A circuit that sends and receives data (bus in a broad sense)
It includes an SB physical layer (PHY) circuit 12. More specifically, the transceiver 10 generates DP, DM line states (J, K, SE0, etc.), serial / parallel conversion, parallel / serial conversion, bit stuffing,
Bit unstuffing, NRZI decoding, NRZ
Performs I encoding and the like. The transceiver 10 may be provided outside the data transfer control device.

【0057】OTGコントローラ20(広義にはステー
トコントローラ。以下、適宜OTGCと呼ぶ)は、OT
GのSRP機能やHNP機能(図2(A)、(B)参
照)を実現するための種々の処理を行う。即ち、OTG
コントローラ20は、ホストの役割として動作するホス
ト動作のステートや、ペリフェラルの役割として動作す
るペリフェラル動作のステートなどを含む複数のステー
トの制御を行う。
The OTG controller 20 (state controller in a broad sense; hereinafter referred to as OTGC as appropriate) is an OT controller.
Various processes for realizing the SRP function and the HNP function of G (see FIGS. 2A and 2B) are performed. That is, OTG
The controller 20 controls a plurality of states including a host operation state operating as a host role and a peripheral operation state operating as a peripheral role.

【0058】より具体的には、OTG規格には、デュア
ルロール・デバイスのAデバイス時(図1(B)、
(C)参照)のステート遷移やBデバイス時のステート
遷移が定義されている。OTGコントローラ20は、こ
れらのステート遷移を実現するためのステートマシーン
を含む。また、OTGコントローラ20は、USBのデ
ータラインステートや、VBUSレベルや、IDピンの
ステートを検出(監視)する回路を含む。そして、OT
Gコントローラ20が含むステートマシーンは、これら
の検出情報に基づいて、そのステート(例えば、ホス
ト、ペリフェラル、サスペンド又はアイドルなどのステ
ート)を変化させる。この場合のステートの遷移は、ハ
ードウェア回路により実現してもよいし、ファームウェ
アがステートコマンドをレジスタに設定することで実現
してもよい。そして、ステートが遷移すると、OTGコ
ントローラ20は、遷移後のステートに基づいて、VB
USを制御したり、DP、DMのプルアップ抵抗/プル
ダウン抵抗の接続/非接続を制御する。また、ホストコ
ントローラ50(以下、適宜HCと呼ぶ)、ペリフェラ
ルコントローラ60(以下、適宜PCと呼ぶ)のイネー
ブル/ディスエーブルを制御する。
More specifically, according to the OTG standard, the dual roll device A device (FIG. 1B,
(See (C)) and the state transition at the time of B device are defined. The OTG controller 20 includes a state machine for realizing these state transitions. The OTG controller 20 also includes a circuit that detects (monitors) the USB data line state, the VBUS level, and the ID pin state. And OT
The state machine included in the G controller 20 changes its state (for example, a state such as host, peripheral, suspend or idle) based on the detection information. The state transition in this case may be realized by a hardware circuit, or may be realized by the firmware setting a state command in a register. Then, when the state transitions, the OTG controller 20 determines the VB based on the state after the transition.
It controls US and controls connection / disconnection of pull-up / pull-down resistors of DP and DM. It also controls enable / disable of the host controller 50 (hereinafter appropriately referred to as HC) and the peripheral controller 60 (hereinafter appropriately referred to as PC).

【0059】HC/PC切り替え回路30(HC/PC
・コモン回路)は、トランシーバ10と、ホストコント
ローラ50又はペリフェラルコントローラ60との間の
接続の切り替え制御を行う。また、USBのデータ(D
P、DM)のラインステートの生成の指示をトランシー
バ10に対して行う。なお、接続の切り替え制御は、H
C/PCセレクタ32により実現され、ラインステート
の生成指示は、ラインステートコントローラ34により
実現される。
HC / PC switching circuit 30 (HC / PC
The common circuit controls switching of the connection between the transceiver 10 and the host controller 50 or the peripheral controller 60. In addition, USB data (D
The transceiver 10 is instructed to generate the line state (P, DM). In addition, the connection switching control is H
This is realized by the C / PC selector 32, and the line state generation instruction is realized by the line state controller 34.

【0060】例えばOTGコントローラ20が、ホスト
動作時(ホストステート時)にHCイネーブル信号をア
クティブにすると、HC/PC切り替え回路30(HC
/PCセレクタ32)は、トランシーバ10とホストコ
ントローラ50を接続する。一方、OTGコントローラ
20が、ペリフェラル動作時(ペリフェラルステート
時)にPCイネーブル信号をアクティブにすると、HC
/PC切り替え回路30は、トランシーバ10とペリフ
ェラルコントローラ60を接続する。このようにするこ
とで、ホストコントローラ50とペリフェラルコントロ
ーラ60とを排他的に動作させることが可能になる。
For example, when the OTG controller 20 activates the HC enable signal during the host operation (in the host state), the HC / PC switching circuit 30 (HC
The / PC selector 32) connects the transceiver 10 and the host controller 50. On the other hand, when the OTG controller 20 activates the PC enable signal during the peripheral operation (during the peripheral state), the HC
The / PC switching circuit 30 connects the transceiver 10 and the peripheral controller 60. By doing so, the host controller 50 and the peripheral controller 60 can be operated exclusively.

【0061】転送コントローラ40は、USB(広義に
はバス)を介したデータ転送を制御する回路であり、ホ
ストコントローラ50(HC)とペリフェラルコントロ
ーラ60(PC)を含む。
The transfer controller 40 is a circuit for controlling data transfer via USB (broadly speaking: bus), and includes a host controller 50 (HC) and a peripheral controller 60 (PC).

【0062】ここでホストコントローラ50は、ホスト
動作時(OTGコントローラ20からのHCイネーブル
信号のアクティブ時)に、ホストの役割としてのデータ
転送制御を行う回路である。
Here, the host controller 50 is a circuit that performs data transfer control as the role of the host during host operation (when the HC enable signal from the OTG controller 20 is active).

【0063】即ち、ホストコントローラ50は、ホスト
動作時に、HC/PC切り替え回路30によりトランシ
ーバ10に接続される。そしてホストコントローラ50
は、レジスタ部70の転送条件レジスタ部72に設定さ
れた転送条件情報に基づいて、エンドポイントに対する
トランザクションを自動発生する。そして、パケットバ
ッファ100に確保(allocate)されたパイプ領域(P
IPE0〜PIPEe。以下、適宜PIPEと呼ぶ)
と、そのパイプ領域に対応するエンドポイントとの間
で、データ(パケット)の自動転送(処理部が介在しな
いハードウェア回路によるデータ転送)を行う。
That is, the host controller 50 is connected to the transceiver 10 by the HC / PC switching circuit 30 during host operation. And the host controller 50
Automatically generates a transaction for the endpoint based on the transfer condition information set in the transfer condition register unit 72 of the register unit 70. Then, the pipe area (P) allocated in the packet buffer 100 is allocated.
IPE0 to PIPEe. Hereinafter referred to as PIPE as appropriate)
And automatic transfer of data (packet) (data transfer by a hardware circuit without a processing unit) between the end point and the end point corresponding to the pipe area.

【0064】より具体的にはホストコントローラ50
は、複数のパイプ転送間の調停、フレームにおける時間
管理、転送のスケジューリング、再送の管理などを行
う。また、パイプ転送の転送条件情報(オペレーション
情報)をレジスタ部70を介して管理する。また、トラ
ンザクションの管理を行ったり、パケットを生成/分解
したり、サスペンド/レジューム/リセット状態生成の
指示を行う。
More specifically, the host controller 50
Performs arbitration between multiple pipe transfers, time management in frames, transfer scheduling, and retransmission management. Further, transfer condition information (operation information) of pipe transfer is managed via the register unit 70. It also manages transactions, generates / disassembles packets, and issues suspend / resume / reset state generation instructions.

【0065】一方、ペリフェラルコントローラ60は、
ペリフェラル動作時(OTGコントローラ20からのP
Cイネーブル信号のアクティブ時)に、ペリフェラルの
役割としてのデータ転送制御を行う回路である。
On the other hand, the peripheral controller 60 is
During peripheral operation (P from OTG controller 20)
This circuit performs data transfer control as a role of a peripheral when the C enable signal is active.

【0066】即ち、ペリフェラルコントローラ60は、
ペリフェラル動作時に、HC/PC切り替え回路30に
よりトランシーバ10に接続される。そして、レジスタ
部70の転送条件レジスタ部72に設定された転送条件
情報に基づいて、パケットバッファ100に確保された
エンドポイント領域(EP0〜EPe。以下適宜EPと
呼ぶ)とホストとの間でデータを転送する。
That is, the peripheral controller 60 is
During the peripheral operation, the HC / PC switching circuit 30 connects to the transceiver 10. Then, based on the transfer condition information set in the transfer condition register unit 72 of the register unit 70, data is transferred between the endpoint area (EP0 to EPe; hereinafter referred to as EP as appropriate) secured in the packet buffer 100 and the host. To transfer.

【0067】より具体的には、ペリフェラルコントロー
ラ60は、エンドポイント転送の転送条件情報(オペレ
ーション情報)をレジスタ部70を介して管理する。ま
た、トランザクションの管理を行ったり、パケットを生
成/分解したり、リモート・ウェイクアップ信号生成の
指示を行う。
More specifically, the peripheral controller 60 manages transfer condition information (operation information) for endpoint transfer via the register unit 70. It also manages transactions, generates / disassembles packets, and issues remote wakeup signal generation instructions.

【0068】なお、エンドポイントは、ユニークなアド
レスを割り当てることができる、ペリフェラル(デバイ
ス)上のポイント(部分)である。ホストとペリフェラ
ル(デバイス)との間でのデータ転送は、全て、このエ
ンドポイントを経由して行われる。また、トランザクシ
ョンは、トークンパケットと、オプショナルなデータパ
ケットと、オプショナルなハンドシェークパケットによ
り構成される。
The end point is a point (portion) on the peripheral (device) to which a unique address can be assigned. All data transfer between the host and peripherals (devices) is done via this endpoint. The transaction is composed of a token packet, an optional data packet, and an optional handshake packet.

【0069】レジスタ部70は、データ転送(パイプ転
送、エンドポイント転送)制御、バッファアクセス制
御、バッファ管理、割り込み制御、ブロック制御、或い
はDMA制御などを行うための種々のレジスタを含む。
なお、レジスタ部70が含むレジスタは、RAMなどの
メモリにより実現してもよいし、Dフリップフロップな
どにより実現してもよい。また、レジスタ部70のレジ
スタは、1つにまとめずに、各ブロック(HC、PC、
OTGC、Xcvr等)に分散して配置してもよい。
The register section 70 includes various registers for performing data transfer (pipe transfer, endpoint transfer) control, buffer access control, buffer management, interrupt control, block control, DMA control and the like.
The register included in the register unit 70 may be realized by a memory such as a RAM or a D flip-flop. Further, the registers of the register unit 70 are not combined into one, but each block (HC, PC,
(OTGC, Xcvr, etc.).

【0070】レジスタ部70は、転送条件レジスタ部7
2を含む。そして、この転送条件レジスタ部72は、ホ
スト動作時にパケットバッファ100に確保されるパイ
プ領域(PIPE0〜PIPEe)とエンドポイントと
の間でのデータ転送の転送条件情報(転送制御情報)を
記憶するレジスタを含む。これらの各転送条件レジスタ
は、パケットバッファ100の各パイプ領域に対応して
設けられる。
The register section 70 is a transfer condition register section 7
Including 2. The transfer condition register unit 72 stores transfer condition information (transfer control information) for data transfer between the pipe area (PIPE0 to PIPEe) secured in the packet buffer 100 during host operation and the endpoint. including. Each of these transfer condition registers is provided corresponding to each pipe area of the packet buffer 100.

【0071】なお、ペリフェラル動作時には、パケット
バッファ100にはエンドポイント領域(EP0〜EP
e)が確保される。そして、転送条件レジスタ部72に
設定された転送条件情報に基づいて、データ転送制御装
置とホストとの間でのデータ転送が行われる。
During the peripheral operation, the packet buffer 100 stores the endpoint areas (EP0 to EP).
e) is secured. Then, based on the transfer condition information set in the transfer condition register unit 72, data transfer is performed between the data transfer control device and the host.

【0072】バッファコントローラ80(FIFOマネ
ージャ)は、パケットバッファ100に対するアクセス
(リード/ライト)制御や領域管理を行う。より具体的
には、CPU(広義には処理部)、DMA(Direct Mem
ory Access)、USBによるパケットバッファ100へ
のアクセス・アドレスを生成・管理する。また、CP
U、DMA、USBによるパケットバッファ100への
アクセスの調停を行う。
The buffer controller 80 (FIFO manager) controls access (read / write) to the packet buffer 100 and area management. More specifically, CPU (processor in a broad sense), DMA (Direct Mem)
ory Access), and generates and manages an access address to the packet buffer 100 by USB. Also, CP
It arbitrates access to the packet buffer 100 by U, DMA, and USB.

【0073】例えば、ホスト動作時には、バッファコン
トローラ80は、インターフェース回路110(CPU
又はDMA)とパケットバッファ100の間のデータ転
送経路と、パケットバッファ100とホストコントロー
ラ50(USB)の間のデータ転送経路を設定(確立)
する。
For example, when the host is operating, the buffer controller 80 uses the interface circuit 110 (CPU
(Or DMA) and the data transfer path between the packet buffer 100 and the data transfer path between the packet buffer 100 and the host controller 50 (USB).
To do.

【0074】一方、ペリフェラル動作時には、バッファ
コントローラ80は、インターフェース回路110(C
PU又はDMA)とパケットバッファ100の間のデー
タ転送経路と、パケットバッファ100とペリフェラル
コントローラ60(USB)の間のデータ転送経路を設
定する。
On the other hand, during the peripheral operation, the buffer controller 80 uses the interface circuit 110 (C
The data transfer path between the PU or DMA) and the packet buffer 100 and the data transfer path between the packet buffer 100 and the peripheral controller 60 (USB) are set.

【0075】パケットバッファ100(FIFO、パケ
ットメモリ、バッファ)は、USBを介して転送される
データ(送信データ又は受信データ)を一時的に記憶
(バッファリング)するものである。このパケットバッ
ファ100は、例えばRAM(Random Access Memory)
などにより構成できる。なお、パケットバッファ100
をデータ転送制御装置の外部に設けてもよい(外付けメ
モリにしてもよい)。
The packet buffer 100 (FIFO, packet memory, buffer) temporarily stores (buffers) data (transmission data or reception data) transferred via the USB. The packet buffer 100 is, for example, a RAM (Random Access Memory).
Etc. The packet buffer 100
May be provided outside the data transfer control device (may be an external memory).

【0076】ホスト動作時には、パケットバッファ10
0はパイプ転送用のFIFO(First-In First-Out)と
して使用される。即ち、パケットバッファ100には、
USB(バス)の各エンドポイントに対応するように、
パイプ領域PIPE0〜PIPEe(広義にはバッファ
領域)が確保される。また、各パイプ領域PIPE0〜
PIPEeには、それに対応する各エンドポイントとの
間で転送されるデータ(送信データ又は受信データ)が
記憶される。
During host operation, the packet buffer 10
0 is used as a FIFO (First-In First-Out) for pipe transfer. That is, in the packet buffer 100,
To correspond to each endpoint of USB (bus),
Pipe areas PIPE0 to PIPEe (buffer areas in a broad sense) are secured. In addition, each pipe area PIPE0 to
The PIPEe stores data (transmission data or reception data) transferred to and from each corresponding endpoint.

【0077】一方、ペリフェラル動作時には、パケット
バッファ100はエンドポイント転送用のFIFOとし
て使用される。即ち、パケットバッファ100には、エ
ンドポイント領域EP0〜EPe(広義にはバッファ領
域)が確保される。また、各エンドポイント領域EP0
〜EPeには、ホストとの間で転送されるデータ(送信
データ又は受信データ)が記憶される。
On the other hand, during the peripheral operation, the packet buffer 100 is used as a FIFO for endpoint transfer. That is, the endpoint areas EP0 to EPe (buffer areas in a broad sense) are secured in the packet buffer 100. In addition, each endpoint area EP0
The data (transmission data or reception data) transferred with the host is stored in to EPe.

【0078】なお、パケットバッファ100に確保され
るバッファ領域(ホスト動作時にパイプ領域に設定さ
れ、ペリフェラル動作時にエンドポイント領域に設定さ
れる領域)は、先に入力された情報が先に出力されるよ
うな記憶領域(FIFO領域)に設定されている。
The buffer area secured in the packet buffer 100 (the area set in the pipe area during the host operation and set in the endpoint area during the peripheral operation) outputs the previously input information first. Such a storage area (FIFO area) is set.

【0079】また、PIPE0は、コントロール転送用
のエンドポイント0に専用のパイプ領域であり、PIP
Ea〜PIPEeは、任意のエンドポイントに割り当て
可能な汎用のパイプ領域である。
PIPE0 is a pipe area dedicated to control transfer endpoint 0,
Ea to PIPEe are general-purpose pipe areas that can be assigned to arbitrary endpoints.

【0080】即ち、USBでは、エンドポイント0がコ
ントロール転送に専用のエンドポイントに設定される。
従って、本実施形態のようにPIPE0をコントロール
転送に専用のパイプ領域にすることで、ユーザが混乱す
るのを防止できる。また、PIPEa〜PIPEeを、
任意のエンドポイントに割り当て可能なパイプ領域にす
ることで、エンドポイントに対応するパイプ領域を動的
に変化させることが可能になる。これにより、パイプ転
送のスケジューリングの自由度を向上でき、データ転送
の効率化を図れる。
That is, in the USB, the endpoint 0 is set as the dedicated endpoint for control transfer.
Therefore, by making PIPE0 a pipe area dedicated to control transfer as in the present embodiment, it is possible to prevent the user from being confused. In addition, PIPEa to PIPEe are
By setting the pipe area that can be assigned to an arbitrary endpoint, the pipe area corresponding to the endpoint can be dynamically changed. As a result, the flexibility of pipe transfer scheduling can be improved, and the efficiency of data transfer can be improved.

【0081】なお本実施形態では、バッファ領域(パイ
プ領域又はエンドポイント領域)は、マックスパケット
サイズMaxPktSize(広義にはページサイズ)とページ数
BufferPageにより、その領域サイズRSizeが設定される
(RSize=MaxPktSize×BufferPage)。このようにするこ
とで、バッファ領域の領域サイズや面数(ページ数)を
任意に設定できるようになり、パケットバッファ100
のリソースの有効利用を図れる。
In this embodiment, the buffer area (pipe area or endpoint area) has the maximum packet size MaxPktSize (page size in a broad sense) and the number of pages.
The area size RSize is set by BufferPage (RSize = MaxPktSize × BufferPage). By doing so, it becomes possible to arbitrarily set the area size and the number of pages (the number of pages) of the buffer area.
The effective use of the resources can be achieved.

【0082】インターフェース回路110は、USBと
は異なる他のバスであるDMA(システムメモリ)バス
やCPUバスと、パケットバッファ100との間でのデ
ータ転送を行うための回路である。このインターフェー
ス回路110は、パケットバッファ100と外部のシス
テムメモリとの間で、DMA転送を行うためのDMAハ
ンドラ回路112を含む。また、パケットバッファ10
0と外部のCPUとの間で、PIO(Parallel I/O)転
送を行うためのCPUインターフェース回路114を含
む。なお、CPU(処理部)をデータ転送制御装置に内
蔵させてもよい。
The interface circuit 110 is a circuit for transferring data between the packet buffer 100 and a DMA (system memory) bus or a CPU bus which is another bus different from the USB. The interface circuit 110 includes a DMA handler circuit 112 for performing DMA transfer between the packet buffer 100 and an external system memory. In addition, the packet buffer 10
A CPU interface circuit 114 for performing PIO (Parallel I / O) transfer between 0 and an external CPU is included. The CPU (processing unit) may be built in the data transfer control device.

【0083】クロックコントローラ120は、内蔵PL
L又は外部入力クロックに基づいて、データ転送制御装
置の内部で使用する各種のクロックを生成する。
The clock controller 120 has a built-in PL
Based on L or an external input clock, various clocks used inside the data transfer control device are generated.

【0084】4.パイプ領域 本実施形態では図5(A)に示すように、ホスト動作時
に、パケットバッファ100にパイプ領域PIPE0〜
PIPEeが確保(allocate)される。そして、この各
パイプ領域PIPE0〜PIPEeとペリフェラルの各
エンドポイントの間で、データが転送される。
4. Pipe Area In the present embodiment, as shown in FIG. 5A, the pipe areas PIPE0 to PIPE0 are stored in the packet buffer 100 during host operation.
PIPEe is allocated. Then, data is transferred between each of the pipe regions PIPE0 to PIPEe and each end point of the peripheral.

【0085】ここで、本実施形態のパイプ領域の「パイ
プ」は、USBで定義される「パイプ」(デバイス上の
エンドポイントとホスト上のソフトウェアとの間の関連
を表す論理的な抽象化、論理的な経路)とは若干意味合
いが異なる。
Here, the “pipe” in the pipe area of the present embodiment is a “pipe” defined by USB (a logical abstraction representing the relationship between the endpoint on the device and the software on the host, (Logical path) has a slightly different meaning.

【0086】本実施形態のパイプ領域は、図5(A)に
示すように、USB(バス)に接続されるペリフェラル
が有する各エンドポイントに対応して、パケットバッフ
ァ100上に確保される。例えば図5(A)において、
パイプ領域PIPEaはペリフェラル1のエンドポイン
ト1(バルクIN)に対応し、PIPEbはペリフェラ
ル1のエンドポイント2(バルクOUT)に対応する。
また、PIPEcはペリフェラル2のエンドポイント1
(バルクIN)に対応し、PIPEdはペリフェラル2
のエンドポイント2(バルクOUT)に対応する。ま
た、PIPEeはペリフェラル3のエンドポイント1
(インタラプトIN)に対応する。なお、PIPE0
は、コントロール転送のエンドポイント0に専用のパイ
プ領域である。
As shown in FIG. 5A, the pipe area of this embodiment is secured on the packet buffer 100 corresponding to each endpoint of the peripheral connected to the USB (bus). For example, in FIG.
The pipe region PIPEa corresponds to the endpoint 1 of the peripheral 1 (bulk IN), and the PIPEb corresponds to the endpoint 2 of the peripheral 1 (bulk OUT).
PIPEc is the endpoint 1 of peripheral 2.
Corresponding to (Bulk IN), PIPEd is peripheral 2
End point 2 (bulk OUT). PIPEe is the end point 1 of peripheral 3.
Corresponds to (Interrupt IN). PIPE0
Is a pipe area dedicated to the endpoint 0 of control transfer.

【0087】そして図5(A)の例では、パイプ領域P
IPEaとペリフェラル1のエンドポイント1との間で
USBのバルクIN転送が行われ、PIPEbとペリフ
ェラル1のエンドポイント2との間ではバルクOUT転
送が行われる。また、PIPEcとペリフェラル2のエ
ンドポイント1との間ではバルクIN転送が行われ、P
IPEdとペリフェラル2のエンドポイント2との間で
はバルクOUT転送が行われる。また、PIPEeとペ
リフェラル3のエンドポイント1との間ではインタラプ
トIN転送が行われる。
In the example of FIG. 5A, the pipe area P
Bulk IN transfer of USB is performed between the IPEa and the end point 1 of the peripheral 1, and bulk OUT transfer is performed between the PIPEb and the end point 2 of the peripheral 1. Further, bulk IN transfer is performed between PIPEc and the endpoint 1 of the peripheral 2, and P
Bulk OUT transfer is performed between the IPEd and the endpoint 2 of the peripheral 2. Further, the interrupt IN transfer is performed between the PIPEe and the endpoint 1 of the peripheral 3.

【0088】このように本実施形態では、パイプ領域
(汎用)とそれに対応するエンドポイントとの間では、
任意のデータ転送(アイソクロナス転送、バルク転送、
インタラプト転送)を行うことができる。
As described above, in this embodiment, between the pipe area (general-purpose) and the corresponding endpoint,
Arbitrary data transfer (isochronous transfer, bulk transfer,
Interrupt transfer) can be performed.

【0089】そして本実施形態では、パイプ領域とそれ
に対応するエンドポイントの間では、所与のデータ単位
(トータルサイズで指定されるデータ単位)のデータが
転送される。この場合のデータ単位としては、例えばI
RP(I/Oリクエストパケット)により転送要求され
るデータ単位又はそれを適当なサイズに分割したデータ
単位などを考えることができる。エンドポイントに対す
るこのデータ単位のデータ転送(一連のトランザクショ
ン)を、本実施形態における「パイプ」と呼ぶことがで
きる。そして、そのような「パイプ」のデータ(送信デ
ータ、受信データ)を記憶する領域がパイプ領域にな
る。
In the present embodiment, data of a given data unit (data unit designated by total size) is transferred between the pipe area and the endpoint corresponding thereto. The data unit in this case is, for example, I
A data unit requested to be transferred by an RP (I / O request packet) or a data unit obtained by dividing the data unit into an appropriate size can be considered. The data transfer (a series of transactions) of this data unit to the endpoint can be called a "pipe" in this embodiment. An area for storing such "pipe" data (transmission data, reception data) becomes a pipe area.

【0090】パイプ領域を用いた所与のデータ単位の転
送が終了すると、そのパイプ領域は解放することができ
る。そして、解放されたパイプ領域は、任意のエンドポ
イントに割り当てることができる。このように本実施形
態では、パイプ領域とエンドポイントとの対応づけを、
動的に変化させることができる。
When the transfer of a given data unit using the pipe area is completed, the pipe area can be released. Then, the released pipe area can be allocated to an arbitrary endpoint. As described above, in the present embodiment, the correspondence between the pipe area and the endpoint is
It can be changed dynamically.

【0091】また本実施形態では図5(B)に示すよう
に、ペリフェラル動作時には、パケットバッファ100
にエンドポイント領域EP0〜EPeが確保(設定)さ
れる。そして、この各エンドポイント領域EP0〜EP
eとホスト(ホストコントローラ、システムメモリ)と
の間で、データが転送される。
Further, in this embodiment, as shown in FIG. 5B, the packet buffer 100 is operated during the peripheral operation.
The endpoint areas EP0 to EPe are secured (set) in the. Then, each of these end point regions EP0 to EP
Data is transferred between e and the host (host controller, system memory).

【0092】このように本実施形態では、パケットバッ
ファ100のバッファ領域を、ホスト動作時にはパイプ
領域に割り当て、ペリフェラル動作時にはエンドポイン
ト領域に割り当てている。これにより、ホスト動作時と
ペリフェラル動作時とでパケットバッファ100のリソ
ースを共用(兼用)することが可能になり、パケットバ
ッファ100の使用記憶容量を節約できる。
As described above, in this embodiment, the buffer area of the packet buffer 100 is allocated to the pipe area during the host operation and to the endpoint area during the peripheral operation. As a result, the resources of the packet buffer 100 can be shared (shared) between the host operation and the peripheral operation, and the storage capacity used by the packet buffer 100 can be saved.

【0093】なおパイプ領域、エンドポイント領域の個
数は6個に限定されず任意である。
The number of pipe areas and endpoint areas is not limited to six, and is arbitrary.

【0094】5.SOF無しモード(SOF無しバルク
のみ転送モード) さて、USB規格(USB1.1、USB2.0、OT
G等)では、4種類の転送タイプ(アイソクロナス、バ
ルク、コントロール、インタラプト)が定義されてい
る。USBホストは、これらの各転送タイプのパケット
の転送順序を制御、管理し、各転送タイプのパケットの
転送を指示する。このために、USBではホストがフレ
ーム管理を行い、図6(A)に示すように、フレーム
(1ms、125μs)毎に、SOF(Start Of Fram
e)パケットをペリフェラルに発行する。
5. SOF-less mode (Transfer mode without SOF only bulk) USB standard (USB1.1, USB2.0, OT
(G, etc.), four types of transfer types (isochronous, bulk, control, interrupt) are defined. The USB host controls and manages the transfer order of these transfer type packets, and instructs the transfer of each transfer type packet. Therefore, in the USB, the host manages the frame, and as shown in FIG. 6A, the SOF (Start Of Fram) is performed for each frame (1 ms, 125 μs).
e) Issue the packet to the peripheral.

【0095】なお、SOFは、フレームの先頭を示すた
めのトークンパケットであり、PIDとフレーム番号と
CRCを含む。このSOFはホストが送信する。ホスト
は、1つのトランザクションが複数のフレームにまたが
らないようにスケジューリング管理を行う。また、フレ
ームは、SOFと次のSOFとの間のインターバルであ
る。また、バルク転送は、印刷データや画像データなど
の大量のデータを、非周期的に転送する方式である。
The SOF is a token packet for indicating the beginning of the frame and includes the PID, frame number and CRC. This SOF is transmitted by the host. The host manages scheduling so that one transaction does not span multiple frames. Also, a frame is the interval between an SOF and the next SOF. Bulk transfer is a method of transferring a large amount of data such as print data and image data aperiodically.

【0096】周期(同期)転送であるアイソクロナス転
送、インタラプト転送では、フレームタイミングやフレ
ーム番号などの情報が重要な意味を持つ。従って、これ
らの情報を伝達するためにSOFパケットが必要にな
る。
In isochronous transfer and interrupt transfer, which are cyclic (synchronous) transfers, information such as frame timing and frame number is important. Therefore, an SOF packet is required to convey this information.

【0097】一方、非周期転送であるバルク転送、コン
トロール転送では、これらの情報は特に必要ではないと
考えられるが、USBでは、このような非周期転送の場
合にも、ホストがSOFパケットを転送することを要求
している。
On the other hand, in bulk transfer and control transfer, which are aperiodic transfers, it is considered that such information is not particularly necessary. However, in USB, the host transfers the SOF packet even in the case of such aperiodic transfer. Are demanding to do so.

【0098】しかしながら、バルク転送などの非周期転
送においてSOFパケットを転送すると、このSOFパ
ケットの転送自体によりバス帯域を消費してしまう。更
に、図6(B)に示すように、USBでは、このSOF
パケットがあることで、フレーム終端に転送禁止期間
(転送禁止領域)が生じ、バス帯域が更に狭まってしま
う。
However, when the SOF packet is transferred in the non-periodic transfer such as the bulk transfer, the transfer of the SOF packet itself consumes the bus band. Further, as shown in FIG.
The presence of the packet causes a transfer prohibited period (transfer prohibited area) at the end of the frame, further narrowing the bus band.

【0099】そしてUSBは、プリンタの印刷データの
転送、デジタルカメラの画像データの転送、ストレージ
装置の記憶データの転送などに広く利用されており、こ
れらのデータの転送には、バルク転送が用いられる。従
って、このバルク転送において、本来は必要でないSO
Fパケットによりバス帯域が狭まってしまうと、リソー
スの無駄な消費になってしまう。
The USB is widely used for transfer of print data of a printer, transfer of image data of a digital camera, transfer of storage data of a storage device, etc., and bulk transfer is used for transfer of these data. . Therefore, in this bulk transfer, SO that is not originally necessary
If the bus bandwidth is narrowed by the F packet, resources are wasted.

【0100】そこで本実施形態では、バルク転送などの
非周期転送において、SOFパケット(フレーム開始を
指示するパケット)の転送を無効(cancel)にする手法
を採用している。
Therefore, in this embodiment, a method of canceling the transfer of the SOF packet (packet instructing the start of the frame) in the non-periodic transfer such as bulk transfer is adopted.

【0101】より具体的には、SOF有りモード(広義
には第1のモード)が設定された場合には、SOFパケ
ット(SOFトークンパケット)をフレーム周期で転送
しながらデータ転送を行う。一方、SOF無しモード
(広義には第2のモード)が設定され且つ非周期転送
(バルク転送又はコントロール転送等)を行う場合に
は、SOFパケットの周期転送を無効にして、非同期デ
ータ(バルクデータ又はコントロールデータ等)を転送
する。
More specifically, when the SOF mode (first mode in a broad sense) is set, data transfer is performed while transferring the SOF packet (SOF token packet) at the frame cycle. On the other hand, when the SOF-less mode (second mode in a broad sense) is set and the aperiodic transfer (bulk transfer or control transfer) is performed, the cyclic transfer of the SOF packet is disabled and the asynchronous data (bulk data Or control data, etc.).

【0102】図7、図8、図9に、本実施形態の手法に
よるデータ転送の信号波形例を示す。
FIG. 7, FIG. 8 and FIG. 9 show examples of signal waveforms of data transfer by the method of this embodiment.

【0103】例えば図7において、自動トランザクショ
ンの開始指示がファームウェア(処理部)により行われ
ると、C1に示すように、PipeXTranGo(PipeXについて
のファームウェアからの転送要求信号)がアクティブに
なる。これにより、そのPipeX(X=0〜e)について
の、ホストコントローラ50による自動トランザクショ
ン処理が開始する。
For example, in FIG. 7, when an instruction to start an automatic transaction is issued by the firmware (processing unit), PipeXTranGo (a transfer request signal from the firmware for PipeX) becomes active, as indicated by C1. As a result, the automatic transaction processing by the host controller 50 for the PipeX (X = 0 to e) is started.

【0104】ここで、図7では、EnNoSOFMode(SOF
無しモード指定、SOF無しバルクのみ転送モード指
定)が非アクティブ(Lレベル)になっており、SOF
有りモード(第1のモード)に設定されている。従っ
て、この場合には、ホストコントローラ50(広義には
転送コントローラ。以下の説明でも同様)は、C2に示
すようにSOFパケットを生成して、ペリフェラルに転
送する。
Here, in FIG. 7, EnNoSOFMode (SOF
No mode, SOF no bulk only transfer mode specified) is inactive (L level),
It is set to the existence mode (first mode). Therefore, in this case, the host controller 50 (transfer controller in a broad sense, the same applies in the following description) generates an SOF packet as indicated by C2 and transfers it to the peripheral.

【0105】次に、C3に示すようにPipeTranGo(ホス
トコントローラ50内のHCシーケンス管理回路からの
転送要求信号)がアクティブになり、C4に示すように
ホストコントローラ50がトランザクションを自動発生
してパケットを転送する。このトランザクションは、ト
ークンパケットと、オプショナルなデータパケットと、
オプショナルなハンドシェークパケットにより構成され
る。そして、トランザクションが完了すると、C5に示
すようにTranCmpACKがアクティブになる。次に、C6に
示すようにPipeTranGoがアクティブになり、C7に示す
ように次のトランザクションが行われ、トランザクショ
ンが終了するとC8に示すようにTranCmpACKがアクティ
ブになる。
Next, as shown in C3, PipeTranGo (transfer request signal from the HC sequence management circuit in the host controller 50) becomes active, and the host controller 50 automatically generates a transaction to send a packet as shown in C4. Forward. This transaction consists of a token packet, an optional data packet,
It consists of optional handshake packets. Then, when the transaction is completed, TranCmpACK becomes active as shown in C5. Next, PipeTranGo becomes active as shown in C6, the next transaction is made as shown in C7, and when the transaction ends, TranCmpACK becomes active as shown in C8.

【0106】以上のようにしてホストコントローラ50
は、トランザクションを次々と自動発生して、そのトラ
ンザクションを構成するパケットを自動転送する。そし
て、残りフレーム時間が少なくなり、C9に示すように
転送禁止期間になると、当該フレームでのトランザクシ
ョンの発生を終了する。
As described above, the host controller 50
Automatically generates transactions one after another and automatically transfers the packets constituting the transaction. Then, when the remaining frame time becomes short and the transfer prohibited period is reached as indicated by C9, the generation of the transaction in the frame is ended.

【0107】即ち、USBでは、フレーム終端に転送禁
止期間が規定されており、この期間においてはパケット
の転送が禁止される。このため、ホストコントローラ5
0は、この転送禁止期間ではトランザクションを発生し
ない。そして、C2に示す前回のSOFの転送から1フ
レーム(1ms)のインターバルが経過した後に、C1
0に示すように次のSOFを転送する。これにより、次
のフレームが開始し、ホストコントローラ50は、C1
1に示すようにこの次のフレームでのトランザクション
を自動発生する。
That is, the USB defines a transfer prohibition period at the end of the frame, and packet transfer is prohibited during this period. Therefore, the host controller 5
0 does not generate a transaction during this transfer prohibition period. Then, after one frame (1 ms) interval has passed from the previous SOF transfer shown in C2, C1
The next SOF is transferred as indicated by 0. As a result, the next frame starts, and the host controller 50 sets the C1
As shown in 1, a transaction is automatically generated in the next frame.

【0108】このように本実施形態では、SOF有りモ
ードの設定時には、C2、C10に示すようにSOFパ
ケットをフレーム毎に周期的に発生してペリフェラルに
転送する。これにより、アイソクロナス転送などの周期
転送を適正に行うことが可能になる。
As described above, in this embodiment, when the mode with SOF is set, SOF packets are periodically generated for each frame and transferred to the peripheral, as indicated by C2 and C10. This makes it possible to properly perform periodic transfer such as isochronous transfer.

【0109】一方、本実施形態では図8に示すように、
EnNoSOFModeがアクティブ(Hレベル)になると、SO
F無しモード(第2のモード)に設定される。すると、
ホストコントローラ50は、D1、D2、D3に示すよ
うに、SOFパケットの周期転送を行わないようにな
る。そして、D4〜D15に示すように、バルク転送の
トランザクションを間断なく連続実行する。
On the other hand, in this embodiment, as shown in FIG.
When EnNoSOFMode becomes active (H level), SO
The F-free mode (second mode) is set. Then,
The host controller 50 does not perform the periodic transfer of the SOF packet as indicated by D1, D2, and D3. Then, as shown in D4 to D15, bulk transfer transactions are continuously executed without interruption.

【0110】即ち図7のSOF有りモードでは、C9に
示す転送禁止期間において、トランザクションは実行さ
れない(パケットは転送されない)。
That is, in the SOF mode of FIG. 7, no transaction is executed (no packet is transferred) during the transfer prohibition period shown at C9.

【0111】これに対して図8のSOF無しモード(S
OF無しバルクのみ転送モード)では、D7に示すよう
に、転送禁止期間においても、トランザクションを実行
する。また、D2に示すフレーム開始タイミングでSO
Fパケットを転送せずに、D8に示すようにSOF転送
期間においてもトランザクションを実行する。
On the other hand, the SOF-less mode (S
In the bulk mode without OF only transfer mode), as shown in D7, the transaction is executed even during the transfer prohibited period. Further, at the frame start timing shown in D2, SO
Without transferring the F packet, the transaction is executed during the SOF transfer period as shown in D8.

【0112】このようにすれば、図7、図8を比較すれ
ば明らかなように、バルク転送時(バルクのみの転送
時)において、SOFパケットの転送期間とフレーム終
端の転送禁止期間(禁止領域)を合わせた期間(帯域)
を、バルク転送に割り当てることが可能になる。即ち、
複数フレームにまたがったトランザクションを発生でき
る。これにより、バス帯域が広がり、転送効率の向上を
図れる。
In this way, as is clear from a comparison between FIGS. 7 and 8, during the bulk transfer (when transferring only the bulk), the transfer period of the SOF packet and the transfer prohibition period (prohibition area) at the end of the frame. ) Combined period (band)
Can be assigned to a bulk transfer. That is,
Transactions that span multiple frames can be generated. As a result, the bus band is widened and the transfer efficiency can be improved.

【0113】なお、SOF無しモードの設定時には、図
5(A)のパイプ領域の転送種別を、バルク転送(非周
期転送)に設定しておくことが望ましい。即ち、ファー
ムウェア等が、パイプ領域の転送種別を、アイソクロナ
ス転送やインタラプト転送などの周期転送に設定しない
ようにする。これにより適正な周期転送を実現できる。
When the SOF-free mode is set, it is desirable to set the transfer type of the pipe area in FIG. 5A to bulk transfer (aperiodic transfer). That is, the firmware or the like does not set the transfer type of the pipe area to the periodic transfer such as isochronous transfer or interrupt transfer. As a result, proper periodic transfer can be realized.

【0114】6.転送データが無い場合のSOF発行 さて、アプリケーションの状況によっては、図8に示す
ような間断の無い連続的なバルク転送を実行できない場
合があり、転送すべきデータが一定期間存在しない事態
も生じる。
6. Issuing SOF when there is no data to be transferred In some cases, depending on the situation of the application, continuous bulk transfer without interruption as shown in FIG. 8 may not be possible, and the data to be transferred may not exist for a certain period of time.

【0115】このような場合に、SOF無しモードが設
定されていると、バス・アクティビティが無くなってし
まい、ペリフェラル(デバイス)のステートがサスペン
ドなどに移行してしまうおそれがある。
In such a case, if the SOF-less mode is set, there is a risk that the bus activity will be lost and the peripheral (device) state will shift to suspend or the like.

【0116】そこで本実施形態では、転送すべきバルク
(非周期)データが無い場合には、SOF無しモード
(第2のモード)が設定された場合にも、SOFパケッ
トをフレーム周期で転送するようにしている。
Therefore, in this embodiment, when there is no bulk (aperiodic) data to be transferred, the SOF packet is transferred at the frame cycle even when the SOF-less mode (second mode) is set. I have to.

【0117】即ち図9では、EnNoBulkModeがアクティブ
(Hレベル)になっており、SOF無しモードに設定さ
れている。従って、E1、E2に示すようにSOFパケ
ットは発行されず、E3〜E6に示すようにバルク転送
のトランザクションが連続実行されている。
That is, in FIG. 9, EnNoBulkMode is active (H level), and the SOF-less mode is set. Therefore, the SOF packet is not issued as indicated by E1 and E2, and the bulk transfer transactions are continuously executed as indicated by E3 to E6.

【0118】ところが図9のE7では、トランザクショ
ンを連続実行したことにより、転送すべきデータ(実行
すべきトランザクション)が無くなっている。このよう
な場合に本実施形態では、SOF無しモードに設定され
ているのにもかかわらず、E8、E9、E10に示すよ
うに、ホストコントローラ50がSOFパケットをペリ
フェラルに自動転送する。このSOFパケットの転送に
より、バス・アクティビティが生じ、ペリフェラルがサ
スペンドに移行してしまう事態を防止でき、適正なデー
タ転送を実現できる。
However, at E7 in FIG. 9, there is no data to be transferred (transaction to be executed) due to continuous execution of transactions. In such a case, in the present embodiment, the host controller 50 automatically transfers the SOF packet to the peripheral, as indicated by E8, E9, and E10, even though the SOF-less mode is set. The transfer of the SOF packet can prevent a situation in which bus activity occurs and the peripheral shifts to the suspend, and proper data transfer can be realized.

【0119】なお、転送すべきデータがあるか否かの検
出は、例えば、自動トランザクションの開始指示信号に
より判断したり、パケットバッファ100の状態(フ
ル、エンプティ信号)を監視することなどにより判断で
きる。
Whether or not there is data to be transferred can be detected, for example, by the automatic transaction start instruction signal or by monitoring the state (full or empty signal) of the packet buffer 100. .

【0120】より具体的には例えば図5(A)におい
て、パイプ領域PIPE0〜PIPEeの自動転送の開
始指示信号(PipeXTranGo:X=0〜e)が、全て非アクティ
ブの時に、転送すべきデータが無いと判断する。そし
て、このように判断した場合には、SOF無しモードに
設定されていてもSOFパケットを自動転送する。この
ようにすれば、転送すべきデータが有るか無いかを、少
ない負荷の処理で簡素に判断できる。
More specifically, for example, in FIG. 5A, when the automatic transfer start instruction signals (PipeXTranGo: X = 0 to e) of the pipe regions PIPE0 to PIPEe are all inactive, the data to be transferred is Judge that there is no. When such a determination is made, the SOF packet is automatically transferred even if the SOF-less mode is set. By doing so, it is possible to easily determine whether or not there is data to be transferred, by processing with a small load.

【0121】7.回路例 図10に、SOFパケットの周期転送を無効にする回路
の具体例を示す。この図10の回路は、図4のホストコ
ントローラ50に含まれる。
7. Circuit Example FIG. 10 shows a specific example of a circuit that invalidates the periodic transfer of SOF packets. The circuit of FIG. 10 is included in the host controller 50 of FIG.

【0122】SOF転送開始トリガ生成回路200は、
フレーム周期毎にSOFTranGo(SOF転送開始トリガ)
をアクティブ(論理値「1」=Hレベル)にし、SOF
パケットの転送が完了した場合にSOFTranGoを非アクテ
ィブ(論理値「0」=Lレベル)にする回路である。
The SOF transfer start trigger generation circuit 200
SOFTranGo (SOF transfer start trigger) every frame cycle
Is made active (logical value “1” = H level), and SOF
It is a circuit that makes SOFTranGo inactive (logical value “0” = L level) when packet transfer is completed.

【0123】具体的には、SOF転送開始トリガ生成回
路200は、図4のOTGコントローラ20(ステート
コントローラ)からのRemainCount(フレーム残り時間
カウント値)とCLK(クロック信号)を受ける。ま
た、論理積回路AND1を介してSOFTranComp(SOF
転送完了信号)を受ける。そして、RemainCountに基づ
いてフレーム周期毎にSOFTranGoをアクティブ
(「1」)にする。そして、SOFTranCompがアクティブ
になり、論理積回路AND1の出力であるCLR(クリ
ア信号)がアクティブ(「0」)になると、SOFTranGo
を非アクティブ(「0」)にする。これにより、フレー
ム周期毎にアクティブになるパルス状のトリガ信号SOFT
ranGoを生成できる。
Specifically, the SOF transfer start trigger generation circuit 200 receives RemainCount (frame remaining time count value) and CLK (clock signal) from the OTG controller 20 (state controller) of FIG. In addition, SOFTranComp (SOF
Receive a transfer completion signal). Then, SOFTranGo is activated (“1”) every frame cycle based on RemainCount. When SOFTranComp becomes active and the CLR (clear signal) output from the AND circuit AND1 becomes active (“0”), SOFTranGo
To inactive (“0”). As a result, a pulse-shaped trigger signal SOFT that becomes active every frame period
Can generate ranGo.

【0124】SOF無効信号生成回路210(SOF無
しモード条件判断回路)は、Pipe0TranGo〜PipeeTranGo
(パイプ領域PIPE0〜PIPEeの転送開始指示信
号)と、HCState[1],[0](OTGコントローラ20から
のステート情報信号)と、EnNoSOFMode(SOF無しモ
ード指示信号、SOF無しバルク転送のみモード指示信
号。広義には第1又は第2のモードを指示する信号)を
受ける。そして、SOFTranGoを無効にする信号(SOFTran
Goが常に非アクティブになるように設定する信号)であ
るSOFCancelを生成する。このSOF無効信号生成回路
210は、論理和回路OR1、OR2、論理積回路AN
D2、AND3、AND4、インバータ回路INV2、
INV3を含む。
The SOF invalid signal generation circuit 210 (SOF-less mode condition determination circuit) operates in Pipe0TranGo to PipeeTranGo.
(Transfer start instruction signals for the pipe areas PIPE0 to PIPEe), HCState [1], [0] (state information signals from the OTG controller 20), and EnNoSOFMode (SOF-less mode instruction signal, SOF-less bulk transfer only mode instruction signal) In a broad sense, receive a signal indicating the first or second mode). And a signal to disable SOFTranGo (SOFTran
SOFCancel which is a signal that sets Go to always be inactive. The SOF invalid signal generation circuit 210 includes OR circuits OR1 and OR2 and an AND circuit AN.
D2, AND3, AND4, inverter circuit INV2,
Includes INV3.

【0125】ここで、OR1にはPipe0TranGo〜PipeeTr
anGoが入力される。このPipeXTran(X=0〜e)は、図7
のC1、C12に示すように、ファームウェア(処理
部)が各パイプ領域の自動転送の開始を指示した時にア
クティブ(「1」)になり、そのパイプ領域についての
ホストコントローラ50による自動転送が完了した時に
非アクティブ(「0」)になる信号である。
Here, Pipe0TranGo to PipeeTr is set to OR1.
anGo is input. This PipeXTran (X = 0 ~ e) is shown in Fig. 7.
As indicated by C1 and C12 in FIG. 1, the firmware (processing unit) becomes active (“1”) when the automatic transfer of each pipe area is instructed, and the automatic transfer by the host controller 50 for the pipe area is completed. This signal is sometimes inactive ("0").

【0126】AND2にはHCState[1],[0]が入力され
る。このHCState[1],[0]は、図11(A)に示すよう
に、図4のOTGコントローラ20により制御されるデ
ータ転送制御装置のステート(Aデバイス、Bデバイス
のOTGステート)が、サスペンド、リセット、レジュ
ーム、ホスト動作(Host Operation)の時に、各々、
「00」、「01」、「10」、「11」になる信号で
ある。
HCState [1] and [0] are input to AND2. As shown in FIG. 11 (A), these HCStates [1] and [0] are the states in which the states of the data transfer control device controlled by the OTG controller 20 of FIG. 4 (OTG states of the A device and B device) are suspended. , Reset, Resume, Host Operation (Host Operation)
The signals are "00", "01", "10", and "11".

【0127】INV2にはEnNoSOFModeが入力される。
このEnNoSOFModeは、図7のC13に示すようにSOF
有りモード(第1のモード)の時に非アクティブ
(「0」)になり、図8のD16に示すようにSOF無
しモード(第2のモード)の時にアクティブ(「1」)
になる信号である。
EnNoSOFMode is input to INV2.
This EnNoSOFMode is SOF as shown in C13 of FIG.
It becomes inactive ("0") in the presence mode (first mode), and active ("1") in the SOF-less mode (second mode) as shown in D16 of FIG.
Is a signal that becomes.

【0128】AND3には、OR1、AND2、INV
2の出力Q1、Q2、Q3が入力され、INV3にはQ
1が入力される。AND4には、INV3の出力Q4と
AND2の出力Q2が入力される。OR2には、AND
3、AND4の出力Q5、Q6が入力され、SOFCancel
を出力する。
AND1, AND2, INV are applied to AND3.
2 outputs Q1, Q2, Q3 are input, and INV3 has Q
1 is input. The output Q4 of INV3 and the output Q2 of AND2 are input to AND4. AND for OR2
3, output of AND4 Q5, Q6 is input, SOFCancel
Is output.

【0129】図11(B)に、SOF無効信号生成回路
210の真理値表を示す。
FIG. 11B shows a truth table of the SOF invalid signal generation circuit 210.

【0130】図11(B)のF1に示すように、HCStat
e[1],[0]が、「00」、「01」、又は「10」の場合
には、SOFCancelが「0」になる。即ち、データ転送制
御装置(ホストコントローラ50)のステートがサスペ
ンド、リセット、又はレジュームの場合には、SOFCance
lが「0」になり、SOFTranGoが常に「0」になること
で、SOFパケットの周期転送が無効になる。
As shown in F1 of FIG. 11 (B), HCStat
When e [1] and [0] are "00", "01", or "10", SOFCancel becomes "0". That is, when the state of the data transfer control device (host controller 50) is suspend, reset, or resume, SOFCance
Since l becomes “0” and SOFTranGo always becomes “0”, the periodic transfer of SOF packets is invalidated.

【0131】図11(B)のF2に示すように、HCStat
e[1],[0]が「11」で、EnNoSOFModeが「0」の場合に
は、SOFCancelが「1」になる。即ち、ステートがホス
ト動作(Host Operation)であり、SOF有りモード
(EnNoSOFMode=「0」)に設定されている場合には、
図7のC2、C10に示すようにSOFパケットがフレ
ーム周期で転送されながら、データ転送が行われる。
As shown in F2 of FIG. 11 (B), HCStat
When e [1] and [0] are “11” and EnNoSOFMode is “0”, SOFCancel is “1”. That is, when the state is the host operation (Host Operation) and the SOF mode is set (EnNoSOFMode = "0"),
As shown by C2 and C10 in FIG. 7, data transfer is performed while the SOF packet is transferred at the frame cycle.

【0132】図11(B)のF3に示すように、HCStat
e[1],[0]が「11」で、EnNoSOFModeが「1」で、且
つ、Pipe0TranGo〜PipeeTranGoの少なくとも1つが
「1」の場合には、SOFCancelが「0」になる。即ち、
ステートがホスト動作であり、SOF無しモード(EnNo
SOFMode=「1」)に設定され、且つ、転送すべきデー
タが有る場合には、図8のD1、D2、D3に示すよう
にSOFパケットの周期転送が無効になる。そして図8
のD4〜D15に示すように、バルクデータのトランザ
クションがフレーム間にまたがって間断無く連続実行さ
れる。即ちホストコントローラ50は、パイプ領域とそ
のパイプ領域に対応するバルク(非周期)転送のエンド
ポイントの間で、SOFパケットの周期転送を無効にし
ながら、バルクデータ(パケット)を自動転送する。
As shown in F3 of FIG. 11 (B), HCStat
When e [1] and [0] are “11”, EnNoSOFMode is “1”, and at least one of Pipe0TranGo to PipeeTranGo is “1”, SOFCancel becomes “0”. That is,
State is host operation, SOF-less mode (EnNo
When SOFMode = “1”) is set and there is data to be transferred, the periodic transfer of SOF packets is invalidated as indicated by D1, D2, and D3 in FIG. And FIG.
As indicated by D4 to D15, the bulk data transaction is continuously executed without interruption over the frames. That is, the host controller 50 automatically transfers bulk data (packet) between the pipe area and the bulk (aperiodic) transfer endpoint corresponding to the pipe area while disabling the periodic transfer of the SOF packet.

【0133】図11(B)のF4に示すように、HCStat
e[1],[0]が「11」で、EnNoSOFModeが「1」で、且
つ、Pipe0TranGo〜PipeeTranGoの全てが「0」の場合に
は、SOFCancelが「1」になる。即ち、ステートがホス
ト動作であり、SOF無しモード(EnNoSOFMode=
「1」)に設定されている場合にも、転送すべきデータ
が無い場合(Pipe0TranGo〜PipeeTranGo=「0」)に
は、図9のE8、E9、E10に示すように、SOFパ
ケットが周期転送される。即ちホストコントローラ50
は、パイプ領域の自動転送開始指示信号Pipe0TranGo〜P
ipeeTranGoが全て非アクティブ(「0」)の場合には、
転送すべきデータが無いと判断する。そして、この場合
には、SOF無しモードが設定されていても、SOFパ
ケットをフレーム周期で自動転送する。これにより、ペ
リフェラルが誤ってサスペンドステートに移行してしま
う事態を防止できる。
As shown in F4 of FIG. 11 (B), HCStat
When e [1] and [0] are “11”, EnNoSOFMode is “1”, and all of Pipe0TranGo to PipeeTranGo are “0”, SOFCancel becomes “1”. That is, the state is the host operation, and the SOF-less mode (EnNoSOFMode =
Even if it is set to "1", if there is no data to be transferred (Pipe0TranGo to PipeeTranGo = "0"), the SOF packet is periodically transferred as shown in E8, E9, and E10 of FIG. To be done. That is, the host controller 50
Is a pipe area automatic transfer start instruction signal Pipe0TranGo to P
If all ipeeTranGo are inactive (“0”),
Judge that there is no data to transfer. In this case, the SOF packet is automatically transferred at the frame cycle even if the SOF-less mode is set. As a result, it is possible to prevent a situation in which the peripheral accidentally shifts to the suspend state.

【0134】8.転送条件レジスタ(共用レジスタ) 本実施形態では図12に示すように、ホスト動作時に
は、パイプ領域PIPE0〜PIPEeとエンドポイン
トとの間で行われるデータ転送の転送条件情報(転送方
向、転送種別、マックスパケットサイズ又はページ数
等)が、転送条件レジスタTREG0〜TREGeに設
定される。即ち、PIPE0、PIPEa、PIPE
b、PIPEc、PIPEd、PIPEeの転送条件情
報は、各々、TREG0、TREGa、TREGb、T
REGc、TREGd、TREGeに設定(記憶)され
る。この設定は、例えばファームウェア(CPU)によ
り行われる。
8. Transfer condition register (shared register) In the present embodiment, as shown in FIG. 12, transfer condition information (transfer direction, transfer type, maximum) of data transfer performed between the pipe areas PIPE0 to PIPEe and the endpoint during host operation. The packet size or the number of pages) is set in the transfer condition registers TREG0 to TREGe. That is, PIPE0, PIPEa, PIPE
The transfer condition information of b, PIPEc, PIPEd, PIPEe is TREG0, TREGa, TREGb, T, respectively.
It is set (stored) in REGc, TREGd, and TREGe. This setting is performed by firmware (CPU), for example.

【0135】そしてホストコントローラ50(広義には
転送コントローラ)は、転送条件レジスタTREG0〜
TREGeに設定された転送条件情報に基づいて、エン
ドポイントに対するトランザクションを発生する。そし
て、パイプ領域とそれに対応するエンドポイントとの間
で、データ(パケット)を自動転送する。
The host controller 50 (transfer controller in a broad sense) transfers the transfer condition registers TREG0 to TREG0.
A transaction for the endpoint is generated based on the transfer condition information set in TREGe. Then, data (packet) is automatically transferred between the pipe area and the corresponding endpoint.

【0136】このように本実施形態では、各パイプ領域
(バッファ領域)に対応して各転送条件レジスタが設け
られ、この各転送条件レジスタに設定された転送条件情
報に基づいて、各パイプ領域のパイプ転送(所与のデー
タ単位の転送)がホストコントローラ50により自動的
に行われる。従って、ファームウェア(ドライバ、ソフ
トウェア)は、転送条件レジスタに転送条件情報を設定
した後は、データ転送が完了するまで、データ転送制御
に関わらなくて済むようになる。そして、所与のデータ
単位のパイプ転送が完了すると割り込みが発生し、転送
の完了がファームウェアに伝えられる。これにより、フ
ァームウェア(CPU)の処理負荷を格段に低減でき
る。
As described above, in this embodiment, each transfer condition register is provided corresponding to each pipe region (buffer region), and based on the transfer condition information set in each transfer condition register, each pipe region Pipe transfer (transfer of a given data unit) is automatically performed by the host controller 50. Therefore, after setting the transfer condition information in the transfer condition register, the firmware (driver, software) does not need to be involved in the data transfer control until the data transfer is completed. Then, when the pipe transfer of the given data unit is completed, an interrupt is generated and the completion of the transfer is notified to the firmware. As a result, the processing load on the firmware (CPU) can be significantly reduced.

【0137】なお、本実施形態では図13に示すように
ペリフェラル動作時には、エンドポイント領域EP0〜
EPeとホストとの間で行われるデータ転送の転送条件
情報(転送方向、転送種別、マックスパケットサイズ又
はページ数等)が、転送条件レジスタTREG0〜TR
EGeに設定される。そしてペリフェラルコントローラ
60(広義には転送コントローラ)は、転送条件レジス
タTREG0〜TREGeに設定された転送条件情報に
基づいて、エンドポイント領域とホストとの間でのデー
タ転送を行う。
In this embodiment, as shown in FIG. 13, during the peripheral operation, the end point regions EP0 to EP0.
Transfer condition information (transfer direction, transfer type, max packet size, number of pages, etc.) of data transfer performed between the EPe and the host is transfer condition registers TREG0 to TREG.
It is set to EGe. Then, the peripheral controller 60 (transfer controller in a broad sense) performs data transfer between the endpoint area and the host based on the transfer condition information set in the transfer condition registers TREG0 to TREGe.

【0138】このように本実施形態では、転送条件レジ
スタTREG0〜TREGeが、ホスト動作時とペリフ
ェラル動作時とで共用(兼用)される。これにより、レ
ジスタ部70のリソースを節約でき、データ転送制御装
置を小規模化できる。
As described above, in this embodiment, the transfer condition registers TREG0 to TREGe are shared (shared) between the host operation and the peripheral operation. As a result, the resources of the register unit 70 can be saved and the data transfer control device can be downsized.

【0139】図14に、レジスタ部70のレジスタ構成
例を示す。なお、レジスタ部70のレジスタの一部を、
各ブロック(OTGC、HC、PC、Xcvr等)内に
含ませてもよい。
FIG. 14 shows a register configuration example of the register section 70. In addition, a part of the registers of the register unit 70 is
It may be included in each block (OTGC, HC, PC, Xcvr, etc.).

【0140】図14に示すように、レジスタ部70の転
送条件レジスタ(TREG0〜TREGeの各々)は、
ホスト動作時(HC、PIPE)とペリフェラル動作時
(PC、EP)で共用されるHC/PC共用レジスタ
(共用転送条件レジスタ)を含む。また、ホスト動作時
にのみ使用されるHC(PIPE)用レジスタ(ホスト
用転送条件レジスタ)を含む。また、ペリフェラル動作
時にのみ使用されるPC(EP)用レジスタ(ペリフェ
ラル用転送条件レジスタ)を含む。また、パケットバッ
ファ(FIFO)のアクセス制御などを行うためのレジ
スタであり、ホスト動作時とペリフェラル動作時で共用
されるアクセス制御レジスタを含む。
As shown in FIG. 14, the transfer condition registers (each of TREG0 to TREGe) of the register section 70 are
It includes an HC / PC shared register (shared transfer condition register) shared during host operation (HC, PIPE) and peripheral operation (PC, EP). It also includes an HC (PIPE) register (host transfer condition register) used only during host operation. Further, it includes a PC (EP) register (peripheral transfer condition register) used only during peripheral operation. Further, it is a register for performing access control of the packet buffer (FIFO) and the like, and includes an access control register shared during host operation and peripheral operation.

【0141】例えば、デュアルロール・デバイスのホス
ト動作時に、ホストコントローラ50(HC)は、HC
/PC共用レジスタとHC用レジスタに設定される転送
条件情報に基づいて、データ(パケット)を転送する。
For example, during host operation of the dual roll device, the host controller 50 (HC)
/ Transfer data (packet) based on the transfer condition information set in the PC shared register and the HC register.

【0142】一方、ペリフェラル動作時には、ペリフェ
ラルコントローラ60(PC)は、HC/PC共用レジ
スタとPC用レジスタに設定される転送条件情報に基づ
いて、データ(パケット)を転送する。
On the other hand, during the peripheral operation, the peripheral controller 60 (PC) transfers data (packet) based on the transfer condition information set in the HC / PC shared register and the PC register.

【0143】また、ホスト動作時、ペリフェラル動作時
の両方において、バッファコントローラ80は、共用ア
クセス制御レジスタに基づいて、パケットバッファ10
0へのアクセス制御(リード/ライト・アドレスの発
生、データのリード/ライト、アクセスの調停等)を行
うことになる。
In both the host operation and the peripheral operation, the buffer controller 80 uses the shared access control register to determine whether the packet buffer 10 is to be operated.
Access control to 0 (generation of read / write address, data read / write, access arbitration, etc.) is performed.

【0144】図14のHC/PC共用レジスタには、デ
ータの転送方向(IN、OUT又はSETUP等)、転
送種別(アイソクロナス、バルク、インタラプト、コン
トロールなどのトランザクションの種別)、エンドポイ
ント番号(各USBデバイスのエンドポイントに関連づ
けられる番号)、マックスパケットサイズ(エンドポイ
ントが送信又は受信可能なパケットの最大ペイロードサ
イズ。ページサイズ)が設定される。また、バッファ領
域(パイプ領域、エンドポイント領域)のページ数(バ
ッファ領域の面数)が設定される。また、DMA接続の
有無(DMAハンドラ回路112によるDMA転送の使
用の有無)を指示する情報が設定される。
In the HC / PC shared register of FIG. 14, the data transfer direction (IN, OUT, SETUP, etc.), transfer type (transaction type such as isochronous, bulk, interrupt, control), end point number (each USB). The maximum packet size (maximum payload size of packets that the endpoint can send or receive. Page size) is set. Further, the number of pages (number of faces of the buffer area) of the buffer area (pipe area, endpoint area) is set. In addition, information indicating the presence / absence of a DMA connection (presence / absence of use of DMA transfer by the DMA handler circuit 112) is set.

【0145】HC(PIPE)用レジスタには、インタ
ラプト転送のトークン発行周期(インタラプト・トラン
ザクションを起動する周期、インターバル)が設定され
る。また、トランザクションの連続実行回数(パイプ領
域間の転送比率を設定する情報。各パイプ領域のトラン
ザクションの連続実行回数)が設定される。また、ファ
ンクションアドレス(エンドポイントを有するファンク
ションのUSBアドレス)、転送データのトータルサイ
ズ(各パイプ領域を介して転送されるデータのトータル
サイズ。IRPなどのデータ単位)が設定される。ま
た、自動トランザクションの開始指示(ホストコントロ
ーラに対する自動トランザクション処理の開始指示)が
設定される。また、自動コントロール転送モードの指示
(コントロール転送のセットアップステージ、データス
テージ、ステータスステージのトランザクションを自動
発生するモードの指示)が設定される。
In the HC (PIPE) register, a token issue cycle (interrupt transaction activation cycle, interval) of interrupt transfer is set. In addition, the number of continuous executions of transactions (information for setting the transfer ratio between pipe areas. The number of continuous executions of transactions in each pipe area) is set. Further, a function address (USB address of a function having an end point) and a total size of transfer data (total size of data transferred through each pipe area, data unit such as IRP) are set. In addition, an automatic transaction start instruction (an automatic transaction process start instruction to the host controller) is set. Further, an instruction of the automatic control transfer mode (instruction of a mode for automatically generating a control transfer setup stage, data stage, and status stage transaction) is set.

【0146】PC(EP)用レジスタには、エンドポイ
ントイネーブル(エンドポイントのイネーブルやディス
エーブルの指示)、ハンドシェーク指定(各トランザク
ションで行われるハンドシェークの指定)が設定され
る。
Endpoint enable (endpoint enable or disable instruction) and handshake designation (handshake designation performed in each transaction) are set in the PC (EP) register.

【0147】パケットバッファ(FIFO)用の共用ア
クセス制御レジスタには、バッファ・I/Oポート(C
PUによりPIO転送を行う場合のI/Oポート)が設
定される。また、バッファ・フル/エンプティ(各バッ
ファ領域のフル、エンプティの通知)、バッファ・残り
データサイズ(各バッファ領域の残りデータサイズ)が
設定される。
The shared access control register for the packet buffer (FIFO) includes a buffer / I / O port (C
The I / O port for PIO transfer by the PU is set. In addition, buffer full / empty (notification of full / empty of each buffer area) and buffer / remaining data size (remaining data size of each buffer area) are set.

【0148】レジスタ部70は、インタラプト系レジス
タ、ブロック系レジスタ、DMA制御レジスタなども含
む。
The register section 70 also includes an interrupt system register, a block system register, a DMA control register and the like.

【0149】インタラプト系レジスタは、割り込みのス
テータス(要因)をCPUに対して示すためのインタラ
プト・ステータスレジスタ、割り込みのイネーブル、デ
ィスエーブル(非マスク、マスク)を設定するインタラ
プト・イネーブルレジスタを含む。なお、割り込みに
は、OTGコントローラ20系、ホストコントローラ5
0系、ペリフェラルコントローラ60系の割り込みがあ
る。
The interrupt system registers include an interrupt status register for indicating the status (factor) of the interrupt to the CPU, and an interrupt enable register for setting interrupt enable and disable (non-mask, mask). For interrupts, the OTG controller 20 system and the host controller 5
There are interrupts of the 0 system and the peripheral controller 60 system.

【0150】ブロック系レジスタは、ブロック間で共用
されるブロック間共用レジスタや、各ブロック(Xcv
r、OTGC、HC、PC)内で使用されるブロック用
レジスタを含む。
Block-related registers include inter-block shared registers shared between blocks and each block (Xcv
r, OTGC, HC, PC).

【0151】ブロック間共用レジスタには、各ブロック
のリセットを指示するレジスタなどがある。ブロック用
レジスタには、トランシーバ10(Xcvr)を制御す
るためのレジスタや、OTGコントローラ20(OTG
C)のステートコマンドレジスタや、ホストコントロー
ラ50(HC)のステートコマンドレジスタや、フレー
ム番号を設定するレジスタなどがある。
The inter-block shared register includes a register for instructing reset of each block. The block register includes a register for controlling the transceiver 10 (Xcvr) and an OTG controller 20 (OTG).
There are a C) state command register, a host controller 50 (HC) state command register, a frame number setting register, and the like.

【0152】以上のように本実施形態では、ホスト動作
時とペリフェラル動作時で共用されるレジスタ(HC/
PC共用レジスタ、共用アクセス制御レジスタ)をレジ
スタ部70に設けている。これにより、ホスト動作時用
のレジスタとペリフェラル動作時用のレジスタを全く別
個に設ける場合に比べて、レジスタ部70を小規模化で
きる。また、CPU上で動作するファームウェア(ドラ
イバ)から見た共用レジスタのアクセスアドレスを、ホ
スト動作時とペリフェラル動作時とで同一にできる。従
って、ファームウェアは、これらの共用レジスタを同一
アドレスで管理できるようになり、ファームウェア処理
を簡素化できる。
As described above, according to the present embodiment, the register (HC / HC) shared between the host operation and the peripheral operation is used.
A PC shared register and a shared access control register) are provided in the register unit 70. As a result, the register unit 70 can be made smaller than in the case where the register for host operation and the register for peripheral operation are provided separately. Further, the access address of the shared register viewed from the firmware (driver) operating on the CPU can be made the same during the host operation and the peripheral operation. Therefore, the firmware can manage these shared registers at the same address, and the firmware processing can be simplified.

【0153】また、HC用レジスタや、PC用レジスタ
を設けることで、ホスト動作時(PIPE)の転送やペ
リフェラル動作時(EP)の転送に特有の転送条件を設
定できる。例えば、トークン発行周期を設定すること
で、ホスト動作時にインタラプト転送のトークンを所望
の周期で発行することが可能になる。また、連続実行回
数を設定することで、ホスト動作時にパイプ領域間の転
送比率を任意に設定できる。また、トータルサイズを設
定することで、ホスト動作時にパイプ領域を介して自動
転送されるデータのサイズを任意に設定できる。またフ
ァームウェアは、ホスト動作時に、自動トランザクショ
ンの開始を指示したり、自動コントロール転送モードの
オン/オフを指示できるようになる。
By providing the HC register and the PC register, it is possible to set transfer conditions specific to the transfer during the host operation (PIPE) and the transfer during the peripheral operation (EP). For example, by setting the token issue period, it becomes possible to issue the interrupt transfer token at a desired period during host operation. Further, by setting the number of continuous executions, it is possible to arbitrarily set the transfer ratio between the pipe regions during host operation. Further, by setting the total size, it is possible to arbitrarily set the size of data that is automatically transferred through the pipe area during host operation. Further, the firmware can instruct the start of the automatic transaction and the on / off of the automatic control transfer mode when the host operates.

【0154】9.自動トランザクション 図15に、ホストコントローラ50の自動トランザクシ
ョン(IN、OUT)処理時におけるファームウェア処
理のフローチャート例を示す。
9. Automatic Transaction FIG. 15 shows an example of a flowchart of firmware processing during automatic transaction (IN, OUT) processing of the host controller 50.

【0155】まず、ファームウェア(処理部、ドライ
バ)は、図14等で説明した転送条件レジスタに転送条
件情報(パイプ情報)を設定する(ステップS1)。よ
り具体的には、転送データのトータルサイズ、マックス
パケットサイズ(MaxPktSize)、ページ数(BufferPag
e)、転送方向(IN、OUT又はSETUP)、転送
種別(アイソクロナス、バルク、コントロール、インタ
ラプト)、エンドポイント番号、パイプ領域のトランザ
クションの連続実行回数(転送比率)、インタラプト転
送のトークン発行周期などを、転送条件レジスタに設定
する。
First, the firmware (processing unit, driver) sets transfer condition information (pipe information) in the transfer condition register described in FIG. 14 and the like (step S1). More specifically, the total size of transfer data, the maximum packet size (MaxPktSize), and the number of pages (BufferPag
e), transfer direction (IN, OUT, or SETUP), transfer type (isochronous, bulk, control, interrupt), endpoint number, number of consecutive executions of pipe area transactions (transfer ratio), interrupt issue token issue period, etc. , Set in transfer condition register.

【0156】次に、外部のシステムメモリとパケットバ
ッファ100の間に転送経路を設定する(ステップS
2)。即ち図4のDMAハンドラ回路112を介したD
MA転送経路を設定する。
Next, a transfer path is set between the external system memory and the packet buffer 100 (step S
2). That is, D via the DMA handler circuit 112 of FIG.
Set MA transfer path.

【0157】次に、ファームウェアは、DMA転送の開
始指示を行う(ステップS3)。即ち、図14のDMA
制御レジスタのDMA転送開始指示ビットをアクティブ
にする。なお、CPUによる転送では、図14のバッフ
ァ・I/Oポートにアクセスすることで、パケットバッ
ファ100にアクセスすることが可能になる。
Next, the firmware issues a DMA transfer start instruction (step S3). That is, the DMA of FIG.
The DMA transfer start instruction bit of the control register is activated. In the transfer by the CPU, the packet buffer 100 can be accessed by accessing the buffer / I / O port of FIG.

【0158】次に、ファームウェアは、自動トランザク
ションの開始指示を行う(ステップS4)。即ち、図1
4のHC用レジスタ(パイプレジスタ)の自動トランザ
クション開始指示ビットをアクティブにする。これによ
り、ホストコントローラ50による、自動トランザクシ
ョン処理、パケット処理(パケットの生成、分解)、ス
ケジューリング処理が行われる。即ち、ホストコントロ
ーラ50は、トータルサイズで指定されるデータを、マ
ックスパケットサイズのペイロードのパケットを用い
て、転送方向で指定される方向(IN、OUT)で、自
動転送する。
Next, the firmware gives an instruction to start an automatic transaction (step S4). That is, FIG.
4 activates the automatic transaction start instruction bit of the HC register (pipe register). As a result, the host controller 50 performs automatic transaction processing, packet processing (packet generation and disassembly), and scheduling processing. That is, the host controller 50 automatically transfers the data specified by the total size in the direction (IN, OUT) specified by the transfer direction using the packet of the payload of the maximum packet size.

【0159】なお、ステップS3、S4の処理の順序は
問わず、自動トランザクション開始指示の後にDMA転
送の開始指示を行ってもよい。
The order of the processes of steps S3 and S4 does not matter, and the DMA transfer start instruction may be issued after the automatic transaction start instruction.

【0160】次に、ファームウェアは、パイプ転送の完
了を知らせる割り込みが発生するのを待つ(ステップS
5)。そして、割り込みが発生すると、ファームウェア
は、図14のインタラプト系レジスタの割り込みステー
タス(要因)を調べる。そして、処理が正常完了又はエ
ラー終了する(ステップS6)。
Next, the firmware waits for the generation of an interrupt indicating the completion of the pipe transfer (step S
5). When an interrupt occurs, the firmware checks the interrupt status (factor) of the interrupt system register in FIG. Then, the process ends normally or ends in error (step S6).

【0161】このように本実施形態によれば、ファーム
ウェアは、各パイプ領域毎に転送条件情報を設定し(ス
テップS1)、DMA転送開始の指示(ステップS3)
と自動トランザクション開始の指示(ステップS4)を
行うだけで、その後のデータ転送処理はホストコントロ
ーラ50のハードウェア回路により自動的に行われるよ
うになる。従って、図3(A)、(B)で説明したOH
CI準拠の手法に比べて、ファームウェアの処理負荷が
軽減され、低性能のCPUが組み込まれる携帯機器に最
適なデータ転送制御装置を提供できる。
As described above, according to the present embodiment, the firmware sets transfer condition information for each pipe area (step S1), and gives a DMA transfer start instruction (step S3).
By simply instructing to start the automatic transaction (step S4), the subsequent data transfer processing is automatically performed by the hardware circuit of the host controller 50. Therefore, the OH described in FIGS.
As compared with the CI-compliant method, the processing load of the firmware is reduced, and it is possible to provide the optimum data transfer control device for the mobile device incorporating the low-performance CPU.

【0162】10.各ブロックの詳細な構成例 次に各ブロックの詳細な構成例について説明する。10. Detailed configuration example of each block Next, a detailed configuration example of each block will be described.

【0163】10.1 OTGコントローラ 図16に、OTGコントローラ20の構成例を示す。10.1 OTG Controller FIG. 16 shows a configuration example of the OTG controller 20.

【0164】OTGコントローラ20は、OTGレジス
タ部22を含む。このOTGレジスタ部22は、OTG
コントローラ20のモニタレジスタや制御レジスタを含
む。またファームウェア(CPU)により書き込まれる
OTGステートコマンドをデコードする回路を含む。
The OTG controller 20 includes an OTG register section 22. The OTG register unit 22 is
It includes a monitor register and a control register of the controller 20. It also includes a circuit for decoding the OTG state command written by the firmware (CPU).

【0165】またOTGコントローラ20はOTG制御
回路23を含む。そして、このOTG制御回路23は、
OTGステートの管理を行うOTG管理回路24、ID
ピンの電圧レベルを検出するID検出回路25、VBU
Sの電圧レベルを検出するVBUS検出回路26、DP
及びDMのラインステートを検出するラインステート検
出回路27を含む。
The OTG controller 20 also includes an OTG control circuit 23. Then, the OTG control circuit 23
OTG management circuit 24 for managing the OTG state, ID
ID detection circuit 25 for detecting the voltage level of the pin, VBU
VBUS detection circuit 26 for detecting the voltage level of S, DP
And a line state detection circuit 27 for detecting the line state of DM.

【0166】またOTGコントローラ20は、OTGス
テートの遷移判断条件の1つである時間を計測するタイ
マ28を含む。
Further, the OTG controller 20 includes a timer 28 for measuring the time which is one of the conditions for judging the transition of the OTG state.

【0167】OTGステートを遷移させるために検出す
べき情報は、ID、VBUSの電圧レベル、DP/DM
のラインステートである。本実施形態のOTGコントロ
ーラ20は、これらの情報を検出し、モニタレジスタを
介してファームウェア(CPU)に伝える。
Information to be detected in order to transit the OTG state is ID, voltage level of VBUS, DP / DM.
Is the line state of. The OTG controller 20 of the present embodiment detects these pieces of information and transmits them to the firmware (CPU) via the monitor register.

【0168】ファームウェアは、これらの検出情報に基
づいて自身のステートを遷移させると共に、次に遷移す
べきステートを、OTGステートコマンドを用いてOT
Gコントローラ20に伝える。
The firmware transits its own state on the basis of these detection information, and uses the OTG state command to OT the next state to transit to.
Notify the G controller 20.

【0169】OTGコントローラ20は、OTGステー
トコマンドをデコードし、そのデコード結果に基づい
て、VBUSのドライブ制御、プルアップ/プルダウン
抵抗の接続制御等を行い、図2(A)、(B)で説明し
たSRPやHNPを実現する。
The OTG controller 20 decodes the OTG state command and performs drive control of VBUS, connection control of pull-up / pull-down resistors, etc. based on the decoding result, which will be described with reference to FIGS. 2 (A) and 2 (B). It realizes SRP and HNP.

【0170】このように本実施形態では、ステート毎の
OTG制御はOTGコントローラ20が担当し、ファー
ムウェアはステートの遷移管理に専念できる。この結
果、全てのステート制御をファームウェアで実現する場
合に比べて、ファームウェア(CPU)の処理負荷を軽
減できると共に、効率的なファームウェア開発が可能に
なる。
As described above, in this embodiment, the OTG controller 20 takes charge of OTG control for each state, and the firmware can concentrate on state transition management. As a result, the processing load of the firmware (CPU) can be reduced and efficient firmware development can be performed as compared with the case where all state control is realized by firmware.

【0171】なお、OTGのステート遷移の判断を、フ
ァームウェアが行わずに、ハードウェア回路が行うよう
にしてもよい。或いは、OTGコントローラ20のほと
んど全ての処理(例えばVBUS制御、プルアップ/プ
ルダウン抵抗制御、ID検出、VBUS検出、ラインス
テート検出以外の処理)をファームウェア(ソフトウェ
ア)により実現してもよい。
The determination of the OTG state transition may be made by the hardware circuit instead of the firmware. Alternatively, almost all the processing of the OTG controller 20 (for example, processing other than VBUS control, pull-up / pull-down resistance control, ID detection, VBUS detection, line state detection) may be implemented by firmware (software).

【0172】10.2 ホストコントローラ、ペリフェ
ラルコントローラ 図17(A)に、ホストコントローラ50の構成例を示
す。
10.2 Host Controller, Peripheral Controller FIG. 17A shows a configuration example of the host controller 50.

【0173】ホストコントローラ50はHCシーケンス
管理回路52を含む。このHCシーケンス管理回路52
は、パイプ転送(パイプ領域を用いたデータ転送)の調
停、時間管理、パイプ転送のスケジューリング、再送管
理などを行う。
The host controller 50 includes an HC sequence management circuit 52. This HC sequence management circuit 52
Performs pipe transfer (data transfer using a pipe area) arbitration, time management, pipe transfer scheduling, retransmission management, and the like.

【0174】より具体的にはHCシーケンス管理回路5
2は、フレーム番号のカウントや、SOF(Start-Of-F
rame)パケットの送信指示を行う。また、アイソクロナ
ス転送を各フレームの先頭で優先的に実行するための処
理を行ったり、インタラプト転送をアイソクロナス転送
の次に優先的に取り扱うための処理を行う。また、パイ
プ転送の順序に従って各パイプ転送を指示する処理を行
う。また、トランザクションの連続実行回数を管理した
り、残りフレーム時間の確認処理を行う。また、ペリフ
ェラルから返ってきたハンドシェークパケット(AC
K、NAK)に対する処理を行う。また、トランザクシ
ョン実行時のエラー処理を行う。
More specifically, the HC sequence management circuit 5
2 is the frame number count and SOF (Start-Of-F
rame) Send a packet. Also, processing for preferentially executing isochronous transfer at the beginning of each frame, and processing for preferentially handling interrupt transfer next to isochronous transfer are performed. In addition, processing for instructing each pipe transfer is performed according to the pipe transfer order. It also manages the number of consecutive executions of transactions and confirms the remaining frame time. In addition, the handshake packet (AC
K, NAK) are processed. It also performs error handling during transaction execution.

【0175】ホストコントローラ50はターゲットパイ
プ管理回路54を含む。このターゲットパイプ管理回路
54は、レジスタ部70の転送条件レジスタに設定され
た転送条件情報のハンドリング処理などを行う。
The host controller 50 includes a target pipe management circuit 54. The target pipe management circuit 54 performs handling processing of transfer condition information set in the transfer condition register of the register unit 70.

【0176】より具体的にはターゲットパイプ管理回路
54は、転送条件情報の選択処理や、割り込み信号の生
成処理を行う。また自動トランザクションの開始が指示
された場合に、そのパイプ領域の転送データのトータル
サイズをロードする。そして、残り転送データサイズの
カウント(デクリメント)処理を行う。また、バッファ
コントローラ80へのデータの送受信の際にバッファ
(FIFO)領域の状態を確認する処理を行う。また、
トランザクション管理回路56への転送指示を行う。ま
た、予期しないショートパケットの受信の判断処理や、
マックスパケットサイズ以上のパケットの受信の判断処
理を行う。また、零長パケットを自動転送するモードが
設定されている場合には、最後の零長パケットの送信を
トランザクション管理回路56に指示する。また、自動
コントロール転送モードでのシーケンス管理を行う。
More specifically, the target pipe management circuit 54 performs transfer condition information selection processing and interrupt signal generation processing. When the start of an automatic transaction is instructed, the total size of transfer data in the pipe area is loaded. Then, the remaining transfer data size is counted (decremented). Further, when transmitting / receiving data to / from the buffer controller 80, a process of confirming the state of the buffer (FIFO) area is performed. Also,
A transfer instruction is issued to the transaction management circuit 56. In addition, judgment processing of unexpected short packet reception,
The judgment processing of the reception of the packet of the maximum packet size or more is performed. When the mode for automatically transferring the zero-length packet is set, the transaction management circuit 56 is instructed to transmit the last zero-length packet. It also manages sequences in the automatic control transfer mode.

【0177】ホストコントローラ50はトランザクショ
ン管理回路56を含む。このトランザクション管理回路
56は、転送パケットの種類や転送順序の管理(トラン
ザクションのシーケンス管理)を行う。また、タイムア
ウトの監視処理を行う。また、トランザクション終了の
通知処理を行う。
The host controller 50 includes a transaction management circuit 56. The transaction management circuit 56 manages the types of transfer packets and the transfer sequence (transaction sequence management). In addition, it monitors the timeout. It also performs transaction end notification processing.

【0178】ホストコントローラ50はパケットハンド
ラ回路58を含む。このパケットハンドラ回路58は、
パケットの生成、分解処理を行う。また、PIDのチェ
ックやCRCのデコード、エンコードを行う。また、バ
ッファ領域のパケットのペイロードのリード、ライト処
理や、SOFパケットの送信処理を行う。また、送受信
データのカウント処理を行う。
The host controller 50 includes a packet handler circuit 58. This packet handler circuit 58 is
Generates and decomposes packets. It also checks the PID and decodes and encodes the CRC. In addition, the payload of the packet in the buffer area is read and written, and the SOF packet is transmitted. Also, the transmission / reception data counting process is performed.

【0179】図17(B)にペリフェラルコントローラ
60の構成例を示す。
FIG. 17B shows a configuration example of the peripheral controller 60.

【0180】ペリフェラルコントローラ60は、トラン
ザクション管理回路62、パケットハンドラ回路64を
含む。これらのトランザクション管理回路62、パケッ
トハンドラ回路64は、ホストコントローラ50のトラ
ンザクション管理回路56、パケットハンドラ回路58
とほぼ同様の処理を行う。
The peripheral controller 60 includes a transaction management circuit 62 and a packet handler circuit 64. The transaction management circuit 62 and the packet handler circuit 64 are the transaction management circuit 56 and the packet handler circuit 58 of the host controller 50.
Performs almost the same processing as.

【0181】10.3 バッファコントローラ 図18にバッファコントローラ80の構成例を示す。10.3 Buffer Controller FIG. 18 shows a configuration example of the buffer controller 80.

【0182】バッファコントローラ80は領域確保(al
location)回路82を含む。この領域確保回路82は、
パケットバッファ100に、バッファ領域(ホスト動作
時にパイプ領域に設定され、ペリフェラル動作時にエン
ドポイント領域に設定される領域)を確保する回路であ
る。
The buffer controller 80 reserves the area (al
location) circuit 82. This area securing circuit 82
It is a circuit that secures a buffer area (area set in the pipe area during host operation and set in endpoint area during peripheral operation) in the packet buffer 100.

【0183】領域確保回路82は領域計算回路83を含
む。この領域計算回路83は、マックスパケットサイズ
(広義にはページサイズ)やページ数に基づいて、バッ
ファ領域の領域サイズ、スタートアドレス、エンドアド
レスなどを計算する回路である。
The area reservation circuit 82 includes an area calculation circuit 83. The area calculation circuit 83 is a circuit for calculating the area size, start address, end address, etc. of the buffer area based on the maximum packet size (page size in a broad sense) and the number of pages.

【0184】例えば図19(A)に示すバッファ領域P
IPE0/EP0、PIPEa/EPa、PIPEb/
EPb、PIPEc/EPcでは、マックスパケットサ
イズ(MaxPktSize)が、各々、32、64、64、64
バイトに設定され、ページ数(BufferPage)が、各々、
1、1、3、2ページに設定されている。領域計算回路
83は、これらのマックスパケットサイズ、ページ数な
どに基づいて、バッファ領域PIPE0/EP0〜PI
PEc/EPcの領域サイズ、スタートアドレス、エン
ドアドレスを計算する。例えば図19(A)において、
PIPE0/EP0、PIPEa/EPa、PIPEb
/EPb、PIPEc/EPcの領域サイズは、各々、
32(=32×1)、64(=64×1)、192(=
64×3)、128(=64×2)バイトと計算される
ことになる。
For example, the buffer area P shown in FIG.
IPE0 / EP0, PIPEa / EPa, PIPEb /
In EPb and PIPEc / EPc, the maximum packet size (MaxPktSize) is 32, 64, 64, 64, respectively.
The number of pages (BufferPage) is set to bytes,
It is set to pages 1, 1, 3, and 2. The area calculation circuit 83 determines the buffer area PIPE0 / EP0 / PI0-PI based on the maximum packet size, the number of pages, and the like.
The area size of PEc / EPc, start address, and end address are calculated. For example, in FIG. 19 (A),
PIPE0 / EP0, PIPEa / EPa, PIPEb
The area sizes of / EPb and PIPEc / EPc are
32 (= 32 × 1), 64 (= 64 × 1), 192 (=
It is calculated as 64 × 3) and 128 (= 64 × 2) bytes.

【0185】ポインタ割り当て回路84は、各バッファ
領域の書き込みポインタWP(WP0、WPa、WP
b、WPc)、読み出しポインタRP(RP0、RP
a、RPb、RPc)を、DMA用ポインタ、CPU用
ポインタ、USB用ポインタに割り当てる回路である。
The pointer allocation circuit 84 uses the write pointers WP (WP0, WPa, WP) of the respective buffer areas.
b, WPc), read pointer RP (RP0, RP
a, RPb, RPc) are assigned to the DMA pointer, the CPU pointer, and the USB pointer.

【0186】例えば図19(B)に示すように、データ
送信時(DMA又はCPUからパケットバッファ100
を介してUSB側にデータが転送される時)であり、且
つ、DMA転送使用時には、そのバッファ領域の書き込
みポインタWPはDMA(DMAアクセス)用のポイン
タに割り当てられ、読み出しポインタRPはUSB(U
SBアクセス)用のポインタに割り当てられる。また、
データ送信時であり且つCPU(PIO)転送使用時に
は、そのバッファ領域の書き込みポインタWPはCPU
(CPUアクセス)用のポインタに割り当てられ、読み
出しポインタRPはUSB用のポインタに割り当てられ
る。
For example, as shown in FIG. 19B, during data transmission (from DMA or CPU to packet buffer 100
(When data is transferred to the USB side via USB) and when DMA transfer is used, the write pointer WP of the buffer area is assigned to the pointer for DMA (DMA access), and the read pointer RP is USB (U).
It is assigned to a pointer for SB access). Also,
During data transmission and when using CPU (PIO) transfer, the write pointer WP of the buffer area is the CPU
The pointer for (CPU access) is assigned, and the read pointer RP is assigned to the pointer for USB.

【0187】一方、図19(C)に示すように、データ
受信時(USBからパケットバッファ100を介してD
MA又はCPU側にデータが転送される時)であり、且
つ、DMA転送使用時には、そのバッファ領域の書き込
みポインタWPはUSB用ポインタに割り当てられ、読
み出しポインタRPはDMA用ポインタに割り当てられ
る。また、データ受信時であり且つCPU転送使用時に
は、そのバッファ領域の書き込みポインタWPはUSB
用ポインタに割り当てられ、読み出しポインタRPはC
PU用ポインタに割り当てられる。
On the other hand, as shown in FIG. 19C, when data is received (from the USB via the packet buffer 100, D
When data is transferred to the MA or CPU side) and when DMA transfer is used, the write pointer WP of the buffer area is assigned to the USB pointer and the read pointer RP is assigned to the DMA pointer. When receiving data and using CPU transfer, the write pointer WP of the buffer area is USB.
Assigned to the read pointer RP and the read pointer RP is assigned to C
It is assigned to the PU pointer.

【0188】なお、各バッファ領域の書き込みポインタ
WP、読み出しポインタRPのポインタ情報(位置情
報)は、レジスタ部70の各転送条件レジスタ(PIP
E/EPレジスタ)に保持される。
The pointer information (positional information) of the write pointer WP and the read pointer RP of each buffer area is stored in each transfer condition register (PIP) of the register unit 70.
E / EP register).

【0189】ポインタ管理回路86は、ポインタの更新
を行いながら、パケットバッファ100にアクセスする
ための実アドレスを生成する回路である。
The pointer management circuit 86 is a circuit for generating a real address for accessing the packet buffer 100 while updating the pointer.

【0190】ポインタ管理回路86は、CPU用アドレ
ス生成回路87、DMA用アドレス生成回路88、US
B用アドレス生成回路89を含む。これらの生成回路8
7、88、89は、各々、ポインタ割り当て回路84に
より割り当てられたCPU用ポインタ、DMA用ポイン
タ、USB用ポインタに基づいて、CPU用アドレス、
DMA用アドレス、USB用アドレスを生成する。ま
た、CPU(CPUインターフェース回路)、DMA
(DMAハンドラ回路)からのアクセス毎に、或いはU
SB(HC又はPC)のトランザクション終了(AC
K、NAKなどのハンドシェーク送受信)毎に、ポイン
タを更新する処理を行う。なお、更新後のポインタの情
報は、領域確保回路82を介してレジスタ部70の各転
送条件レジスタに書き戻される。
The pointer management circuit 86 includes a CPU address generation circuit 87, a DMA address generation circuit 88, and a US
A B address generation circuit 89 is included. These generation circuits 8
Reference numerals 7, 88, and 89 denote CPU addresses based on the CPU pointer, the DMA pointer, and the USB pointer assigned by the pointer assigning circuit 84, respectively.
The DMA address and the USB address are generated. In addition, CPU (CPU interface circuit), DMA
Each access from (DMA handler circuit) or U
SB (HC or PC) transaction end (AC
The pointer is updated for each handshake (K, NAK, etc.). The updated pointer information is written back to each transfer condition register of the register unit 70 via the area securing circuit 82.

【0191】バッファ管理回路90は、パケットバッフ
ァ100へのアクセスを管理する回路である。
The buffer management circuit 90 is a circuit for managing access to the packet buffer 100.

【0192】バッファ管理回路90はバッファインター
フェース回路92を含む。このバッファインターフェー
ス回路92は、ポインタ管理回路86からのCPU用ア
ドレス、DMA用アドレス、USB用アドレスなどを受
け、パケットバッファ100へのデータの入出力や、ア
ドレス、出力イネーブル、ライトイネーブル、リードイ
ネーブルなどの出力を行う。
The buffer management circuit 90 includes a buffer interface circuit 92. The buffer interface circuit 92 receives a CPU address, a DMA address, a USB address, etc. from the pointer management circuit 86, and inputs / outputs data to / from the packet buffer 100, and addresses, output enable, write enable, read enable, etc. Is output.

【0193】バッファ管理回路90は調停回路93を含
む。この調停回路93は、CPU(CPUインターフェ
ース回路)、DMA(DMAハンドラ回路)、USB
(ホストコントローラ又はペリフェラルコントローラ)
からのアクセスを調停する回路である。この調停結果に
基づいて、CPU用アドレス、DMA用アドレス、US
B用アドレスのいずれかが、パケットバッファ100の
アクセス・アドレスとして出力され、CPU、DMA又
はUSBとパケットバッファ100との間のデータ転送
経路が設定される。
The buffer management circuit 90 includes an arbitration circuit 93. The arbitration circuit 93 includes a CPU (CPU interface circuit), a DMA (DMA handler circuit), and a USB.
(Host controller or peripheral controller)
It is a circuit that arbitrates access from. Based on the arbitration result, the CPU address, the DMA address, the US
One of the B addresses is output as the access address of the packet buffer 100, and the data transfer path between the CPU, DMA or USB and the packet buffer 100 is set.

【0194】HC/PCセレクタ94は、バッファ管理
回路90(バッファコントローラ80)とホストコント
ローラ50(HC)又はペリフェラルコントローラ60
(PC)との間の接続の切り替え制御を行う。例えばホ
スト動作時には、ホストコントローラ50とバッファ管
理回路90を接続し、ペリフェラル動作時には、ペリフ
ェラルコントローラ60とバッファ管理回路90を接続
する。なお、この接続の切り替え制御は、OTGコント
ローラ20(OTGC)からのHC/PCイネーブル信
号に基づいて行う。
The HC / PC selector 94 includes a buffer management circuit 90 (buffer controller 80) and a host controller 50 (HC) or a peripheral controller 60.
Controls switching of connection with (PC). For example, during host operation, the host controller 50 and the buffer management circuit 90 are connected, and during peripheral operation, the peripheral controller 60 and the buffer management circuit 90 are connected. The connection switching control is performed based on the HC / PC enable signal from the OTG controller 20 (OTGC).

【0195】11.電子機器 次に、本実施形態のデータ転送制御装置を含む電子機器
の例について説明する。
11. Electronic Device Next, examples of electronic devices including the data transfer control device of the present embodiment will be described.

【0196】例えば図20(A)に電子機器の1つであ
るプリンタの内部ブロック図を示し、図21(A)にそ
の外観図を示す。CPU510(処理部)はシステム全
体の制御などを行う。操作部511はプリンタをユーザ
が操作するためのものである。ROM516には、制御
プログラム、フォントなどが格納され、RAM517
(システムメモリ)はCPU510のワーク領域として
機能する。DMAC518は、CPU510を介さずに
データ転送を行うためのDMAコントローラである。表
示パネル519はプリンタの動作状態をユーザに知らせ
るためのものである。
For example, FIG. 20A shows an internal block diagram of a printer which is one of the electronic devices, and FIG. 21A shows its external view. The CPU 510 (processing unit) controls the entire system. The operation unit 511 is for the user to operate the printer. The ROM 516 stores a control program, fonts, etc., and a RAM 517.
The (system memory) functions as a work area of the CPU 510. The DMAC 518 is a DMA controller for performing data transfer without going through the CPU 510. The display panel 519 is for notifying the user of the operating state of the printer.

【0197】USBを介してパーソナルコンピュータ、
デジタルカメラ、デジタルビデオカメラなどの他の機器
から送られてきたシリアルの印刷データ(印字データ、
画像データ)は、データ転送制御装置500によりパラ
レルの印刷データに変換される。そして、変換後のパラ
レル印刷データは、CPU510又はDMAC518に
より、印刷処理部(プリンタエンジン)512に送られ
る。そして、印刷処理部512においてパラレル印刷デ
ータに対して所与の処理が施され、プリントヘッダなど
からなる印刷部(データの出力処理を行う装置)514
により紙に印刷されて出力される。
Personal computer via USB,
Serial print data (print data, sent from other devices such as digital cameras and digital video cameras)
The image data) is converted into parallel print data by the data transfer control device 500. Then, the converted parallel print data is sent to the print processing unit (printer engine) 512 by the CPU 510 or the DMAC 518. Then, a given process is performed on the parallel print data in the print processing unit 512, and a print unit (device that performs data output processing) 514 including a print header and the like.
Is printed on paper and output.

【0198】図20(B)に電子機器の1つであるデジ
タルカメラの内部ブロック図を示し、図21(B)にそ
の外観図を示す。CPU520はシステム全体の制御な
どを行う。操作部521(シャッターボタン、操作ボタ
ン等)はデジタルカメラをユーザが操作するためのもの
である。ROM526には制御プログラムなどが格納さ
れ、RAM527はCPU520のワーク領域として機
能する。DMAC528はDMAコントローラである。
FIG. 20B shows an internal block diagram of a digital camera which is one of the electronic devices, and FIG. 21B shows its external view. The CPU 520 controls the entire system. The operation unit 521 (shutter button, operation button, etc.) is for the user to operate the digital camera. A control program and the like are stored in the ROM 526, and the RAM 527 functions as a work area of the CPU 520. The DMAC 528 is a DMA controller.

【0199】CCD、レンズなどからなる撮像部(デー
タの取り込み処理を行う装置)522により画像が撮像
され、撮像された画像のデータは画像処理部524によ
り処理される。そして、処理後の画像データは、CPU
520又はDMAC528によりデータ転送制御装置5
00に送られる。データ転送制御装置500は、このパ
ラレルの画像データをシリアルデータに変換し、USB
を介してプリンタ、ストレージ装置、パーソナルコンピ
ュータなどの他の機器に送信する。
An image is picked up by an image pickup section 522 (device for performing a data fetching process) including a CCD and a lens, and the data of the picked up image is processed by an image processing section 524. The processed image data is stored in the CPU.
520 or DMAC 528 for data transfer control device 5
Sent to 00. The data transfer control device 500 converts this parallel image data into serial data,
To other devices such as a printer, storage device, personal computer, etc.

【0200】図20(C)に電子機器の1つであるCD
−RWドライブ(ストレージ装置)の内部ブロック図を
示し、図21(C)にその外観図を示す。CPU530
はシステム全体の制御などを行う。操作部531はCD
−RWをユーザが操作するためのものである。ROM5
36には制御プログラムなどが格納され、RAM537
はCPU530のワーク領域として機能する。DMAC
538はDMAコントローラである。
FIG. 20C shows a CD which is one of the electronic devices.
An internal block diagram of the RW drive (storage device) is shown, and an external view thereof is shown in FIG. CPU 530
Controls the entire system. The operation unit 531 is a CD
-For the user to operate the RW. ROM5
36 stores a control program and the like, and a RAM 537
Functions as a work area of the CPU 530. DMAC
Reference numeral 538 is a DMA controller.

【0201】レーザ、モータ、光学系などからなる読み
取り&書き込み部(データの取り込み処理を行う装置又
はデータの記憶処理を行うための装置)533によりC
D−RW532から読み取られたデータは、信号処理部
534に入力され、エラー訂正処理などの所与の信号処
理が施される。そして、信号処理が施されたデータが、
CPU530又はDMAC538によりデータ転送制御
装置500に送られる。データ転送制御装置500は、
このパラレルのデータをシリアルデータに変換し、US
Bを介して他の機器に送信する。
A reading and writing unit (a device for performing a data acquisition process or a device for performing a data storage process) 533 including a laser, a motor, an optical system, etc.
The data read from the D-RW 532 is input to the signal processing unit 534, and given signal processing such as error correction processing is performed. Then, the signal-processed data is
It is sent to the data transfer control device 500 by the CPU 530 or the DMAC 538. The data transfer control device 500
This parallel data is converted to serial data and US
Send to another device via B.

【0202】一方、USBを介して他の機器から送られ
てきたシリアルのデータは、データ転送制御装置500
によりパラレルのデータに変換される。そして、このパ
ラレルデータは、CPU530又はDMAC538によ
り信号処理部534に送られる。そして、信号処理部5
34においてこのパラレルデータに対して所与の信号処
理が施され、読み取り&書き込み部533によりCD−
RW532に記憶される。
On the other hand, the serial data sent from another device via the USB is the data transfer control device 500.
Is converted into parallel data by. Then, this parallel data is sent to the signal processing unit 534 by the CPU 530 or the DMAC 538. Then, the signal processing unit 5
At 34, the given signal processing is applied to the parallel data, and the reading and writing unit 533 performs CD-
It is stored in RW532.

【0203】なお、図20(A)、(B)、(C)にお
いて、CPU510、520、530の他に、データ転
送制御装置500でのデータ転送制御のためのCPUを
別に設けるようにしてもよい。
20A, 20B and 20C, CPUs for controlling data transfer in the data transfer control device 500 may be provided separately in addition to the CPUs 510, 520 and 530. Good.

【0204】本実施形態のデータ転送制御装置を電子機
器に用いれば、OTG機能を有する電子機器を実現でき
る。即ち、電子機器にホストとしての役割を持たせた
り、デバイスとしての役割を持たせることが可能にな
り、これまでに存在しなかったアプリケーションを創出
できる。
If the data transfer control device of this embodiment is used in an electronic device, an electronic device having an OTG function can be realized. That is, the electronic device can be made to have a role as a host or a device, and an application that has never existed can be created.

【0205】また本実施形態のデータ転送制御装置を電
子機器に用いれば、電子機器に組み込まれるCPU(処
理部)の処理負荷が軽減され、安価なCPUを用いるこ
とが可能になる。また、CPUが、データ転送制御処理
以外の他の処理を余裕を持って行うことが可能になり、
電子機器の性能向上や低コスト化を図れる。また、CP
U上で動作するファームウェアのプログラムを簡素化で
き、電子機器の開発期間の短縮化を図れる。
If the data transfer control device of this embodiment is used in an electronic device, the processing load of the CPU (processing section) incorporated in the electronic device can be reduced and an inexpensive CPU can be used. In addition, the CPU can perform other processing other than the data transfer control processing with a margin,
It is possible to improve the performance of electronic devices and reduce costs. Also, CP
The firmware program operating on the U can be simplified, and the development period of the electronic device can be shortened.

【0206】なお本実施形態のデータ転送制御装置を適
用できる電子機器としては、上記以外にも例えば、種々
の光ディスクドライブ(CD−ROM、DVD)、光磁
気ディスクドライブ(MO)、ハードディスクドライ
ブ、デジタルビデオカメラ、携帯電話、スキャナ、T
V、VTR、オーディオ機器、電話機、プロジェクタ、
パーソナルコンピュータ、電子手帳、或いはワードプロ
セッサなど種々のものを考えることができる。
As the electronic equipment to which the data transfer control device of this embodiment can be applied, other than the above, for example, various optical disk drives (CD-ROM, DVD), magneto-optical disk drives (MO), hard disk drives, digital devices. Video camera, mobile phone, scanner, T
V, VTR, audio equipment, telephone, projector,
Various things such as a personal computer, an electronic notebook, or a word processor can be considered.

【0207】なお、本発明は本実施形態に限定されず、
本発明の要旨の範囲内で種々の変形実施が可能である。
The present invention is not limited to this embodiment,
Various modifications can be made within the scope of the present invention.

【0208】例えば、本発明のデータ転送制御装置の構
成は、図4等で説明した構成に限定されるものではな
く、種々の変形実施が可能である。
For example, the configuration of the data transfer control device of the present invention is not limited to the configuration described with reference to FIG. 4 and the like, and various modifications can be implemented.

【0209】また、データ転送制御装置の各ブロック
(HC、PC、OTGC等)の構成も、本実施形態で説
明したものに限定されず、種々の変形実施が可能であ
る。
The configuration of each block (HC, PC, OTGC, etc.) of the data transfer control device is not limited to that described in the present embodiment, and various modifications can be made.

【0210】また、SOFパケットの周期転送を無効に
する回路も、図10に示す構成に限定されず、種々の変
形実施が可能である。
The circuit for invalidating the SOF packet periodic transfer is not limited to the configuration shown in FIG. 10, and various modifications can be made.

【0211】また、本発明のSOFパケットは、その名
称は問わず、SOFパケットと同等の機能を有するパケ
ット(フレーム開始を指示、管理するパケット)であれ
ばよい。
The SOF packet of the present invention may have any name, as long as it has a function equivalent to that of the SOF packet (packet for instructing and managing frame start).

【0212】また、明細書中の記載において広義な用語
(非周期転送、周期転送、第1のモード、第2のモー
ド、ステートコントローラ、処理部、転送コントロー
ラ、バス、バッファ領域等)として引用された用語(バ
ルク転送、アイソクロナス転送、SOF有りモード、S
OF無しモード、OTGコントローラ、CPU・ファー
ムウェア、ホストコントローラ・ペリフェラルコントロ
ーラ、USB、パイプ領域・エンドポイント領域等)
は、明細書中の他の記載においても広義な用語に置き換
えることができる。
Also, in the description in the specification, it is referred to as a broad term (aperiodic transfer, cyclic transfer, first mode, second mode, state controller, processing unit, transfer controller, bus, buffer area, etc.). Terms (bulk transfer, isochronous transfer, SOF mode, S
(OFF mode, OTG controller, CPU / firmware, host controller / peripheral controller, USB, pipe area / endpoint area, etc.)
Can be replaced with a broad term in other descriptions in the specification.

【0213】また、本発明のうち従属請求項に係る発明
においては、従属先の請求項の構成要件の一部を省略す
る構成とすることもできる。また、本発明の1の独立請
求項に係る発明の要部を、他の独立請求項に従属させる
こともできる。
In the invention according to the dependent claim of the present invention, a part of the constituent elements of the claim on which the invention is dependent can be omitted. Further, a main part of the invention according to one independent claim of the present invention can be made dependent on another independent claim.

【0214】また、本実施形態ではUSBのOTG規格
への適用例を説明したが、本発明が適用されるのはOT
G規格に限定されない。即ち、USBのOTGのみなら
ず、従来のUSB1.1、USB2.0や、これらの規
格を発展させた規格におけるデータ転送にも本発明は適
用できる。
Further, although an example of applying the USB to the OTG standard has been described in the present embodiment, the present invention is applied to the OT.
It is not limited to the G standard. That is, the present invention can be applied not only to the OTG of USB, but also to the data transfer according to the conventional USB1.1, USB2.0, and the standards developed from these standards.

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

【図1】 図1(A)、(B)、(C)は、USBのO
TG規格について説明するための図である。
FIG. 1A, FIG. 1B, and FIG. 1C are USB O
It is a figure for demonstrating a TG standard.

【図2】 図2(A)、(B)は、SRPやHNPの手
順について説明するための図である。
FIG. 2A and FIG. 2B are diagrams for explaining the procedure of SRP and HNP.

【図3】 図3(A)、(B)は、OHCIのリスト構
造のディスクリプタなどについて説明するための図であ
る。
FIG. 3A and FIG. 3B are views for explaining a descriptor having a list structure of OHCI and the like.

【図4】 本実施形態のデータ転送制御装置の構成例を
示す図である。
FIG. 4 is a diagram showing a configuration example of a data transfer control device of the present embodiment.

【図5】 図5(A)、(B)は、パイプ領域、エンド
ポイント領域について説明するための図である。
5A and 5B are diagrams for explaining a pipe region and an endpoint region.

【図6】 図6(A)、(B)は、SOFパケットにつ
いて説明するための図である。
6A and 6B are diagrams for explaining an SOF packet.

【図7】 SOF有りモード(第1のモード)設定時の
信号波形例である。
FIG. 7 is an example of a signal waveform when a mode with SOF (first mode) is set.

【図8】 SOF無しモード(第2のモード)設定時の
信号波形例である。
FIG. 8 is an example of a signal waveform when the SOF-less mode (second mode) is set.

【図9】 SOF無しモードに設定され、且つ、転送す
べきデータが無い場合の信号波形例である。
FIG. 9 is an example of a signal waveform when the SOF-less mode is set and there is no data to be transferred.

【図10】 SOFパケットの周期転送を無効にする回
路の構成例である。
FIG. 10 is a configuration example of a circuit that invalidates the periodic transfer of the SOF packet.

【図11】 図11(A)、(B)は、図10の回路の
動作を説明するための真理値表である。
11A and 11B are truth table for explaining the operation of the circuit of FIG.

【図12】 データ転送制御装置のホスト時の動作につ
いて説明するための図である。
FIG. 12 is a diagram for explaining an operation of the data transfer control device at the time of a host.

【図13】 データ転送制御装置のペリフェラル時の動
作について説明するための図である。
FIG. 13 is a diagram for explaining an operation of the data transfer control device at the time of peripheral.

【図14】 レジスタ部について説明するための図であ
る。
FIG. 14 is a diagram for explaining a register unit.

【図15】 ファームウェアの処理例を説明するための
フローチャートである。
FIG. 15 is a flowchart illustrating an example of firmware processing.

【図16】 OTGコントローラの詳細な構成例を示す
図である。
FIG. 16 is a diagram showing a detailed configuration example of an OTG controller.

【図17】 図17(A)、(B)は、ホストコントロ
ーラ、ペリフェラルコントローラの詳細な構成例を示す
図である。
17A and 17B are diagrams showing a detailed configuration example of a host controller and a peripheral controller.

【図18】 バッファコントローラの詳細な構成例を示
す図である。
FIG. 18 is a diagram showing a detailed configuration example of a buffer controller.

【図19】 図19(A)、(B)、(C)は、領域確
保手法やポインタ割り当て手法について説明するための
図である。
19 (A), (B), and (C) are diagrams for explaining an area securing method and a pointer allocating method.

【図20】 図20(A)、(B)、(C)は、種々の
電子機器の内部ブロック図の例である。
20A, 20B, and 20C are examples of internal block diagrams of various electronic devices.

【図21】 図21(A)、(B)、(C)は、種々の
電子機器の外観図の例である。
21A, 21B, and 21C are examples of external views of various electronic devices.

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

PIPE0〜PIPEe パイプ(バッファ)領域 EP0〜EPe エンドポイント(バッファ)
領域 TREG0〜TREGe 転送条件レジスタ(共用レジ
スタ) 10 トランシーバ、 12 物理層回路、 20 O
TGコントローラ(ステートコントローラ)、 30
HC/PC切り替え回路、 32 HC/PCセレク
タ、 34 ラインステートコントローラ、 40 転
送コントローラ、50 ホストコントローラ、 60
ペリフェラルコントローラ、 70 レジスタ部、 7
2 転送条件レジスタ部(共用レジスタ)、 80 バ
ッファコントローラ、 100 パケットバッファ(F
IFO、RAM)、 110 インターフェース回路、
112 DMAハンドラ回路、 114 CPUイン
ターフェース回路、 120 クロックコントローラ
PIPE0 to PIPEe Pipe (buffer) area EP0 to EPe Endpoint (buffer)
Area TREG0 to TREGe Transfer condition register (shared register) 10 Transceiver, 12 Physical layer circuit, 20 O
TG controller (state controller), 30
HC / PC switching circuit, 32 HC / PC selector, 34 line state controller, 40 transfer controller, 50 host controller, 60
Peripheral controller, 70 register section, 7
2 transfer condition register section (shared register), 80 buffer controller, 100 packet buffer (F
IFO, RAM), 110 interface circuit,
112 DMA handler circuit, 114 CPU interface circuit, 120 clock controller

───────────────────────────────────────────────────── フロントページの続き (72)発明者 神原 義幸 長野県諏訪市大和3丁目3番5号 セイコ ーエプソン株式会社内 (72)発明者 松田 邦昭 長野県諏訪市大和3丁目3番5号 セイコ ーエプソン株式会社内 Fターム(参考) 5B077 AA22 AA41 MM01 MM02 NN02   ─────────────────────────────────────────────────── ─── Continued front page    (72) Inventor Yoshiyuki Kambara             Seiko, 3-3-3 Yamato, Suwa City, Nagano Prefecture             -In Epson Corporation (72) Inventor Kuniaki Matsuda             Seiko, 3-3-3 Yamato, Suwa City, Nagano Prefecture             -In Epson Corporation F term (reference) 5B077 AA22 AA41 MM01 MM02 NN02

Claims (11)

【特許請求の範囲】[Claims] 【請求項1】 バスを介したデータ転送のためのデータ
転送制御装置であって、 転送データを記憶するパケットバッファのアクセス制御
を行うバッファコントローラと、 パケットバッファのデータの転送を制御する転送コント
ローラとを含み、 前記転送コントローラが、 第1のモードが設定された場合には、SOF(Start Of
Frame)パケットをフレーム周期で転送しながらデータ
転送を行い、第2のモードが設定され且つ非周期転送を
行う場合には、SOFパケットの周期転送を無効にし
て、非周期データの転送を行うことを特徴とするデータ
転送制御装置。
1. A data transfer control device for data transfer via a bus, comprising: a buffer controller that controls access to a packet buffer that stores transfer data; and a transfer controller that controls transfer of data in the packet buffer. In the case where the first mode is set, the transfer controller includes an SOF (Start Of
(Frame) When data transfer is performed while transferring packets at a frame cycle, and when the second mode is set and aperiodic transfer is performed, the periodic transfer of the SOF packet is invalidated and the aperiodic data is transferred. And a data transfer control device.
【請求項2】 請求項1において、 前記転送コントローラが、 転送すべき非周期データが無い場合には、第2のモード
が設定された場合にも、SOFパケットをフレーム周期
で転送することを特徴とするデータ転送制御装置。
2. The transfer controller according to claim 1, wherein, when there is no aperiodic data to be transferred, the SOF packet is transferred at a frame cycle even when the second mode is set. And a data transfer control device.
【請求項3】 請求項1又は2において、 ホストの役割として動作するホスト動作のステートと、
ペリフェラルの役割として動作するペリフェラル動作の
ステートを含む複数のステートの制御を行うステートコ
ントローラを含み、 前記パケットバッファには、 各エンドポイントとの間で転送されるデータが各パイプ
領域に記憶される複数のパイプ領域が確保され、 前記転送コントローラが、 ホスト動作時において、ホストとしてのデータ転送を行
うホストコントローラと、 ペリフェラル動作時において、ペリフェラルとしてのデ
ータ転送を行うペリフェラルコントローラとを含み、 前記ホストコントローラが、 エンドポイントに対するトランザクションを自動発生
し、パイプ領域と、そのパイプ領域に対応するエンドポ
イントとの間で、データを自動転送することを特徴とす
るデータ転送制御装置。
3. The host operation state according to claim 1, which operates as a host,
The packet buffer includes a state controller that controls a plurality of states including states of peripheral operations that operate as a role of the peripheral, and the packet buffer stores a plurality of data stored in each pipe area for transfer to and from each endpoint. The pipe area is secured, and the transfer controller includes a host controller that transfers data as a host during host operation, and a peripheral controller that transfers data as a peripheral during peripheral operation. , A data transfer control device characterized by automatically generating a transaction for an endpoint and automatically transferring data between a pipe region and an endpoint corresponding to the pipe region.
【請求項4】 請求項3において、 前記ホストコントローラが、 第2のモードが設定された場合には、パイプ領域とその
パイプ領域に対応する非周期転送のエンドポイントとの
間で、SOFパケットの周期転送を無効にしながら、非
周期データを自動転送することを特徴とするデータ転送
制御装置。
4. The SOF packet according to claim 3, wherein when the second mode is set, the host controller transmits an SOF packet between the pipe area and an aperiodic transfer endpoint corresponding to the pipe area. A data transfer control device characterized by automatically transferring aperiodic data while disabling cyclic transfer.
【請求項5】 請求項3又は4において、 前記ホストコントローラが、 パイプ領域の自動転送指示信号が全て非アクティブの場
合には、第2のモードが設定された場合にも、SOFパ
ケットをフレーム周期で自動転送することを特徴とする
データ転送制御装置。
5. The SOF packet according to claim 3, wherein the host controller sets the SOF packet to the frame cycle even when the second mode is set when all the automatic transfer instruction signals in the pipe area are inactive. A data transfer control device characterized by automatic transfer by.
【請求項6】 請求項3乃至5のいずれかにおいて、 前記ホストコントローラが、 フレーム周期毎にSOF転送開始トリガをアクティブに
し、SOFパケットの転送が完了した場合に前記SOF
転送開始トリガを非アクティブにするSOF転送開始ト
リガ生成回路と、 パイプ領域の自動転送指示信号と、ステートコントロー
ラからのステート情報信号と、第1又は第2のモードを
指示する信号を受け、前記SOF転送開始トリガを無効
にする信号を生成するSOF無効信号生成回路とを含む
ことを特徴とするデータ転送制御装置。
6. The SOF transfer method according to claim 3, wherein the host controller activates an SOF transfer start trigger for each frame period and the SOF packet transfer is completed.
The SOF transfer start trigger generation circuit for deactivating the transfer start trigger, the automatic transfer instruction signal for the pipe region, the state information signal from the state controller, and the signal for instructing the first or second mode are received, and the SOF is received. A data transfer control device comprising: an SOF invalid signal generation circuit that generates a signal that invalidates a transfer start trigger.
【請求項7】 請求項3乃至6のいずれかにおいて、 ペリフェラル動作時には、 ホストとの間で転送されるデータが各エンドポイント領
域に記憶される複数のエンドポイント領域が、パケット
バッファに確保され、前記ペリフェラルコントローラ
が、エンドポイント領域とホストとの間でデータを転送
することを特徴とするデータ転送制御装置。
7. The packet buffer according to claim 3, wherein at the time of peripheral operation, a plurality of endpoint areas in which data transferred to and from the host are stored in each endpoint area are secured in a packet buffer, The data transfer control device, wherein the peripheral controller transfers data between the endpoint area and the host.
【請求項8】 請求項1乃至7のいずれかにおいて、 前記非周期転送がUSB(Universal Serial Bus)規格
のバルク転送又はコントロール転送であり、前記非周期
データがバルクデータ又はコントロールデータであるこ
とを特徴とするデータ転送制御装置。
8. The method according to claim 1, wherein the aperiodic transfer is bulk transfer or control transfer of USB (Universal Serial Bus) standard, and the aperiodic data is bulk data or control data. Characteristic data transfer control device.
【請求項9】 請求項1乃至8のいずれかにおいて、 USB(Universal Serial Bus)のOTG(On−Th
e−Go)規格に準拠したデータ転送を行うことを特徴
とするデータ転送制御装置。
9. The OTG (On-Th) of USB (Universal Serial Bus) according to claim 1.
e-Go) A data transfer control device characterized by performing data transfer conforming to the standard.
【請求項10】 請求項1乃至9のいずれかのデータ転
送制御装置と、 前記データ転送制御装置及びバスを介して転送されるデ
ータの出力処理又は取り込み処理又は記憶処理を行う装
置と、 前記データ転送制御装置のデータ転送を制御する処理部
と、 を含むことを特徴とする電子機器。
10. The data transfer control device according to claim 1, a device for performing an output process, a fetch process, or a storage process of data transferred via the data transfer control device and a bus, and the data. An electronic device comprising: a processing unit that controls data transfer of a transfer control device.
【請求項11】 バスを介したデータ転送のためのデー
タ転送制御方法であって、 転送データを記憶するパケットバッファのアクセス制御
を行い、 パケットバッファのデータの転送を制御すると共に、 第1のモードが設定された場合には、SOF(Start Of
Frame)パケットをフレーム周期で転送しながらデータ
転送を行い、第2のモードが設定され且つ非周期転送を
行う場合には、SOFパケットの周期転送を無効にし
て、非周期データの転送を行うことを特徴とするデータ
転送制御方法。
11. A data transfer control method for data transfer via a bus, comprising: controlling access of a packet buffer for storing transfer data, controlling data transfer of the packet buffer; and a first mode. Is set, SOF (Start Of
(Frame) When data transfer is performed while transferring packets at a frame cycle, and when the second mode is set and aperiodic transfer is performed, the periodic transfer of the SOF packet is invalidated and the aperiodic data is transferred. And a data transfer control method.
JP2003041563A 2003-02-19 2003-02-19 Data transfer control device, electronic device, and data transfer control method Withdrawn JP2003323399A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003041563A JP2003323399A (en) 2003-02-19 2003-02-19 Data transfer control device, electronic device, and data transfer control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003041563A JP2003323399A (en) 2003-02-19 2003-02-19 Data transfer control device, electronic device, and data transfer control method

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2002126880A Division JP3726898B2 (en) 2002-04-26 2002-04-26 Data transfer control device, electronic device, and data transfer control method

Publications (1)

Publication Number Publication Date
JP2003323399A true JP2003323399A (en) 2003-11-14

Family

ID=29546031

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003041563A Withdrawn JP2003323399A (en) 2003-02-19 2003-02-19 Data transfer control device, electronic device, and data transfer control method

Country Status (1)

Country Link
JP (1) JP2003323399A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013246457A (en) * 2012-05-23 2013-12-09 Renesas Electronics Corp Host controller and host device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013246457A (en) * 2012-05-23 2013-12-09 Renesas Electronics Corp Host controller and host device

Similar Documents

Publication Publication Date Title
JP3636157B2 (en) Data transfer control device, electronic device, and data transfer control method
JP3649226B2 (en) Data transfer control device, electronic device, and data transfer control method
US7349973B2 (en) Data transfer control device, electronic equipment, and data transfer control method
US7505461B2 (en) Data transfer control device, electronic instrument, and data transfer control method
JP3726898B2 (en) Data transfer control device, electronic device, and data transfer control method
US7337382B2 (en) Data transfer control device, electronic instrument, and data transfer control method
JP3870717B2 (en) Data transfer control device and electronic device
JP3755594B2 (en) Data transfer control device and electronic device
JP3636158B2 (en) Data transfer control device and electronic device
JP3636160B2 (en) Data transfer control device, electronic device, and data transfer control method
JP3614161B2 (en) Data transfer control device, electronic device, and data transfer control method
JP2003323399A (en) Data transfer control device, electronic device, and data transfer control method
JP4127069B2 (en) Data transfer control device, electronic device, and data transfer control method
JP4127071B2 (en) Data transfer control device, electronic device, and data transfer control method
JP2003316734A (en) Data transfer control device, electronic device, and data transfer control method
JP2003323391A (en) Data transfer control device, electronic device, and data transfer control method
JP2005122303A (en) Data transfer controller, electronic equipment and data transfer control method
JP2004021976A (en) Data transfer control device, electronic device, and data transfer control method
TW591523B (en) Virtual input/output device connected to a memory controller

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20050705