JP2009048444A - Control method of usb device, controller and electronic equipment - Google Patents

Control method of usb device, controller and electronic equipment Download PDF

Info

Publication number
JP2009048444A
JP2009048444A JP2007214491A JP2007214491A JP2009048444A JP 2009048444 A JP2009048444 A JP 2009048444A JP 2007214491 A JP2007214491 A JP 2007214491A JP 2007214491 A JP2007214491 A JP 2007214491A JP 2009048444 A JP2009048444 A JP 2009048444A
Authority
JP
Japan
Prior art keywords
usb
time
controller
data
signal
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
JP2007214491A
Other languages
Japanese (ja)
Inventor
Mitsuhiro Matsuo
光浩 松尾
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 JP2007214491A priority Critical patent/JP2009048444A/en
Publication of JP2009048444A publication Critical patent/JP2009048444A/en
Withdrawn legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a controller capable of preventing such a problem that a USB device cannot be recognized. <P>SOLUTION: The USB controller 40 includes a register 130 which can input information for determining the time regarding control of the USB device 10 from outside, a processing part 120 which determines the time regarding control of the USB device 10 based on the information input in the register 130, and a USB interface 80 which is connected to the USB device 10 through USB and outputs a signal or data to the USB at the timing according to the time determined by the processing part 120. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、USB(Universal Serial Bus)を介してUSBデバイスと通信を行うことによりUSBデバイスを制御する方法、USBデバイスを制御するコントローラ、そのようなコントローラを含む電子機器に関する。   The present invention relates to a method for controlling a USB device by communicating with the USB device via a USB (Universal Serial Bus), a controller for controlling the USB device, and an electronic apparatus including such a controller.

近年、USB(Universal Serial Bus)が高速シリアルインターフェースとして脚光を浴びている。USBでは、USBホスト側装置とUSBデバイス側装置との間で信号又はデータの送受信が行われる。   In recent years, USB (Universal Serial Bus) has been spotlighted as a high-speed serial interface. In USB, signals or data are transmitted and received between a USB host device and a USB device device.

USB規格においては、USBホスト側装置がUSBデバイス側装置を認識する等のために、USBホスト側装置が定常的信号、周期的信号又はデータをUSBに出力し及び/又は出力を継続する時間、若しくは或る信号又はデータをUSBに出力してから次の信号又はデータをUSBに出力するまでの種々の時間が規定されている。   In the USB standard, in order for the USB host side device to recognize the USB device side device, etc., the time for which the USB host side device outputs a steady signal, periodic signal or data to the USB and / or continues output, Alternatively, various times from when a certain signal or data is output to the USB until the next signal or data is output to the USB are defined.

しかしながら、現実には、USBホスト側装置がUSB規格に規定されている時間に従って信号又はデータをUSBに出力しても、USBデバイス側装置を認識することができない等の問題がある。   However, in reality, there is a problem that even if the USB host side device outputs a signal or data to the USB according to the time specified in the USB standard, the USB device side device cannot be recognized.

関連する技術として、下記の特許文献1には、データ転送中にケーブルが引き抜かれた場合、或いはバスリセット信号が発生した場合に、転送済みデータファイルが無駄に破棄されてしまうことを防止するシリアルバス通信システムが掲載されている。   As a related technique, Japanese Patent Application Laid-Open No. 2004-228561 discloses a serial that prevents a transferred data file from being discarded unnecessarily when a cable is pulled out during data transfer or when a bus reset signal is generated. A bus communication system is listed.

特開2003−242103号公報JP 2003-242103 A

本発明は、以上のような技術的課題に鑑みてなされたものであり、その目的とするところは、USBホスト側装置がUSB規格に規定されている時間に従って信号又はデータをUSBに出力しても、USBデバイス側装置を認識することができない等の問題を防止することが可能なUSBデバイスの制御方法を提供することにある。また、本発明は、そのようなコントローラを提供することにある。また、本発明は、そのようなコントローラを含む電子機器を提供することにある。   The present invention has been made in view of the above technical problems, and the object of the present invention is to output a signal or data to the USB according to the time specified by the USB host device on the USB standard. Another object of the present invention is to provide a USB device control method capable of preventing problems such as inability to recognize a USB device side device. The present invention also provides such a controller. Moreover, this invention is providing the electronic device containing such a controller.

本発明は、USB(Universal Serial Bus)を介してUSBデバイスと通信を行うためのコントローラがUSBデバイスを制御するために実行する方法であって、USBデバイスの制御に関する少なくとも1つの時間を決定するための情報の入力を外部から受け、情報に基づいて少なくとも1つの時間を決定し、決定した少なくとも1つの時間に応じたタイミングでUSBに信号又はデータを出力することによりUSBデバイスの制御を行う、USBデバイスの制御方法に関係する。   The present invention is a method executed by a controller for communicating with a USB device via a USB (Universal Serial Bus) to control the USB device, in order to determine at least one time related to the control of the USB device. USB is received from the outside, determines at least one time based on the information, and controls a USB device by outputting a signal or data to the USB at a timing according to the determined at least one time. Related to device control method.

本発明によれば、信号又はデータをUSBに出力するタイミングを外部から設定することができ、USBデバイス側装置を認識することができない等の問題を防止することができるようになる。   According to the present invention, the timing for outputting a signal or data to USB can be set from the outside, and problems such as inability to recognize the USB device side device can be prevented.

また、本発明は、USB(Universal Serial Bus)を介してUSBデバイスと通信を行うためのコントローラであって、USBデバイスの制御に関する少なくとも1つの時間を決定するための情報をコントローラの外部から入力されることが可能な情報入力部と、情報入力部に入力された情報に基づいて少なくとも1つの時間を決定する処理部と、USBを介してUSBデバイスに接続され、処理部によって決定された少なくとも1つの時間に応じたタイミングでUSBに信号又はデータを出力するUSBインタフェース部と、を含む、コントローラに関係する。   The present invention is also a controller for communicating with a USB device via a USB (Universal Serial Bus), and information for determining at least one time related to the control of the USB device is input from the outside of the controller. An information input unit that can be connected, a processing unit that determines at least one time based on information input to the information input unit, and at least one determined by the processing unit connected to the USB device via USB And a USB interface unit that outputs a signal or data to the USB at a timing corresponding to one time.

本発明によれば、信号又はデータをUSBに出力するタイミングを外部から設定することができるようになる。これにより、USBデバイス側装置を認識することができない等の問題を防止することができるようになる。   According to the present invention, the timing for outputting a signal or data to a USB can be set from the outside. As a result, problems such as inability to recognize the USB device side device can be prevented.

また、本発明では、処理部が、USBインタフェース部を制御するドライバプログラムを実行するCPUコアを含み、CPUコアが、情報入力部に入力された情報に基づいて少なくとも1つの時間を決定するようにしても良い。   In the present invention, the processing unit includes a CPU core that executes a driver program for controlling the USB interface unit, and the CPU core determines at least one time based on information input to the information input unit. May be.

このようにすれば、外部から入力された情報に基づいて少なくとも1つの時間を決定する処理をプログラムによって容易に実現することができるようになる。   In this way, it is possible to easily realize the process of determining at least one time based on information input from the outside by the program.

また、本発明では、情報入力部が、コントローラの設定及び/又は制御に関する情報を外部から書き込むためのレジスタを含み、少なくとも1つの時間を決定するための少なくとも1つのデータがレジスタに外部から書き込まれ、処理部が、レジスタに書き込まれた少なくとも1つのデータに基づいて少なくとも1つの時間を決定するようにしても良い。   In the present invention, the information input unit includes a register for externally writing information relating to controller setting and / or control, and at least one data for determining at least one time is externally written to the register. The processing unit may determine at least one time based on at least one data written in the register.

このようにすれば、本来コントローラの設定及び/又は制御に関する情報を外部から書き込むためのレジスタを利用して、少なくとも1つの時間を決定するための少なくとも1つのデータを外部から入力することができる。これにより、外部入力端子等を新たに設けることなく、信号又はデータをUSBに出力するタイミングを外部から設定することができるようになる。   In this way, it is possible to input at least one data for determining at least one time from the outside by using a register for originally writing information relating to controller setting and / or control from the outside. As a result, the timing for outputting a signal or data to the USB can be set from the outside without newly providing an external input terminal or the like.

また、本発明では、レジスタに少なくとも1つの時間を表す少なくとも1つの値が書き込まれ、処理部が、少なくとも1つの値によって表される時間を少なくとも1つの時間として決定するようにしても良い。   In the present invention, at least one value representing at least one time may be written to the register, and the processing unit may determine the time represented by the at least one value as at least one time.

このようにすれば、処理部が少なくとも1つの時間を決定するための処理を簡易な処理とすることができるようになる。また、コントローラに接続されレジスタにアクセス可能なメインCPU等から少なくとも1つの時間を設定することができるようになる。   In this way, the processing for the processing unit to determine at least one time can be simplified. Further, at least one time can be set from a main CPU or the like that is connected to the controller and can access the register.

また、本発明では、少なくとも1つの時間を表す少なくとも1つの値をそれぞれ含む複数のテーブルを記憶する記憶部を更に含み、レジスタに複数のテーブルのいずれかを特定するデータが書き込まれ、処理部が、複数のテーブルの内のデータによって特定されるテーブルに含まれている少なくとも1つの値によって表される時間を少なくとも1つの時間として決定するようにしても良い。   The present invention further includes a storage unit that stores a plurality of tables each including at least one value representing at least one time, and data specifying any of the plurality of tables is written to the register, and the processing unit The time represented by at least one value included in the table specified by the data in the plurality of tables may be determined as at least one time.

このようにすれば、外部からレジスタに書き込むデータ量を少なくしながら、複数の時間を決定することができるようになる。   In this way, a plurality of times can be determined while reducing the amount of data written to the register from the outside.

また、本発明では、情報入力部が、少なくとも1つの時間を決定するための少なくとも1つの信号を外部から入力することが可能な信号入力回路を含み、処理部が、信号入力回路に入力された少なくとも1つの信号に基づいて少なくとも1つの時間を決定するようにしても良い。   In the present invention, the information input unit includes a signal input circuit capable of inputting at least one signal for determining at least one time from the outside, and the processing unit is input to the signal input circuit. At least one time may be determined based on at least one signal.

このようにすれば、コントローラに接続されるメインCPUのソフトウェア等に変更や追加を行うことなく、外部から少なくとも1つの時間を設定することができるようになる。   In this way, at least one time can be set from outside without changing or adding to the software or the like of the main CPU connected to the controller.

また、本発明では、少なくとも1つの時間を表す少なくとも1つの値をそれぞれ含む複数のテーブルを記憶する記憶部を更に含み、信号入力回路に複数のテーブルのいずれかを特定する少なくとも1つの信号が入力され、処理部が、複数のテーブルの内の少なくとも1つの信号によって特定されるテーブルに含まれている少なくとも1つの値によって表される時間を少なくとも1つの時間として決定するようにしても良い。   The present invention further includes a storage unit that stores a plurality of tables each including at least one value representing at least one time, and at least one signal specifying any of the plurality of tables is input to the signal input circuit. The processing unit may determine a time represented by at least one value included in a table specified by at least one signal among the plurality of tables as at least one time.

このようにすれば、外部から入力する信号数を少なくしながら、複数の時間を決定することができるようになる。   In this way, a plurality of times can be determined while reducing the number of externally input signals.

また、本発明では、少なくとも1つの時間が、USBデバイスを初期化するための制御に関する時間及び/又はUSBデバイスをレジュームさせる制御に関する時間を含むようにしても良い。   In the present invention, at least one time may include a time related to control for initializing the USB device and / or a time related to control for resuming the USB device.

このようにすれば、実際のUSBデバイスにおいて正常に認識されない及び/又は正常に動作できないという事象の要因となり得るUSBデバイスを初期化するための制御に関する時間及び/又はUSBデバイスをレジュームさせる制御に関する時間を外部から設定することができるようになる。これにより、実際のUSBデバイスにおいて正常に認識されない及び/又は正常に動作できないという事象が発生することを防止することができるようになる。   In this way, the time related to the control for initializing the USB device and / or the time related to the control for resuming the USB device, which may cause an event that the actual USB device is not normally recognized and / or cannot operate normally. Can be set from the outside. As a result, it is possible to prevent an event that the actual USB device is not normally recognized and / or cannot be normally operated.

また、本発明では、少なくとも1つの時間が、定常的信号、周期的信号又はデータをUSBに出力し及び/又は出力を継続する時間、若しくは或る信号又はデータをUSBに出力してから次の信号又はデータをUSBに出力するまでの時間を含むようにしても良い。   In the present invention, at least one time is a time for outputting a steady signal, a periodic signal or data to the USB and / or a time for continuing the output, or a certain signal or data is output to the USB, and then the next time. The time until the signal or data is output to the USB may be included.

また、本発明は、本発明に係るコントローラと、バスを介してコントローラに接続されるホストCPUと、を含む電子機器に関係する。   The present invention also relates to an electronic device including the controller according to the present invention and a host CPU connected to the controller via a bus.

以下、本発明の実施形態について詳細に説明する。なお、以下に説明する本実施形態は、特許請求の範囲に記載された本発明の内容を不当に限定するものではない。また本実施形態で説明される構成の全てが本発明の解決手段として必須であるとは限らない。また同一の構成要素には同一の参照番号を付して説明を省略する。   Hereinafter, embodiments of the present invention will be described in detail. In addition, this embodiment demonstrated below does not unduly limit the content of this invention described in the claim. Further, not all of the configurations described in the present embodiment are essential as a solution means of the present invention. The same constituent elements are denoted by the same reference numerals and description thereof is omitted.

1. USBデバイスを制御するためにUSB規格において規定されている時間
USBデバイスを制御するためにUSB規格において規定されている幾つかの時間について、例を挙げて説明する。
1. Times stipulated in the USB standard for controlling a USB device Several times stipulated in the USB standard for controlling a USB device will be described by way of examples.

1.1 USBホストとUSBデバイスが接続された場合
まず、USBホストとUSBデバイスが接続(attach)された場合について説明する。
1.1 When a USB Host and a USB Device are Connected First, a case where a USB host and a USB device are connected (attached) will be described.

1.1.1 HSホストとHSデバイスが接続された場合
図1にHS(High-speed)ホストとHSデバイスが接続された場合におけるUSB上の信号の波形図を示す。
1.1.1 When HS Host and HS Device are Connected FIG. 1 shows a waveform diagram of signals on the USB when an HS (High-speed) host and HS device are connected.

ホストとデバイスが接続されると、ホストからVBUSに電位が供給される。タイミングTM0においてVBUSの電位が所与の閾値電位まで上昇した後、タイミングTM1において、デバイスは、DP(D+)を1.5KΩのプルアップ抵抗を用いて3.3Vにプルアップすることと規定されている。デバイスが行うこのプルアップ動作を、FSターミネーションをオン(ON)にすると言う。VBUSから電力の供給を受けて動作するバスパワー動作デバイスは、タイミングTM0から100ms以内に、FSターミネーションをオン(ON)にすることと規定されている。   When the host and the device are connected, a potential is supplied from the host to VBUS. After the VBUS potential rises to a given threshold potential at timing TM0, at timing TM1, the device is specified to pull up DP (D +) to 3.3V using a 1.5KΩ pull-up resistor. ing. This pull-up operation performed by the device is said to turn on FS termination. A bus power operation device that operates by receiving power supply from VBUS is specified to turn on FS termination within 100 ms from timing TM0.

なお、DP(D+)がHレベル且つDM(D−)がLレベルであること(より正確には、Differential "1"であること(D+>VOH(min)且つD−<VOL(max)であること))は、Jステート(J state)、チャープJ(chirp J)又は単にJと呼ばれる。また、DPがLレベル且つDMがHレベルであること(より正確には、Differential "0"であること(D−>VOH(min)且つD+<VOL(max)であること))は、Kステート(K state)、チャープK(chirp K)又は単にKと呼ばれる。また、DPがLレベル且つDMがLレベルであること(より正確には、D+及びD−<VOL(max)であること)は、SE0(Single-ended 0)と呼ばれる。 It should be noted that DP (D +) is at H level and DM (D−) is at L level (more precisely, differential “1” (D +> V OH (min) and D− <V OL (max )))) Is called J state, chirp J or simply J. Further, DP is at L level and DM is at H level (more precisely, it is Differential “0” (D−> V OH (min) and D + <V OL (max))). , K state, chirp K, or simply K. Further, the fact that DP is at L level and DM is at L level (more precisely, D + and D− <V OL (max)) is called SE0 (Single-ended 0).

後で詳しく説明するように、JステートはタイミングTM1から100ms以上継続することとして規定されている。そして、タイミングTM1から100ms経過した後のタイミングTM2において、デバイスはサスペンド(SUSPEND)状態になる。これは、USB規格において、Jステートが100ms以上続いた場合には、デバイスがサスペンド状態になることと規定されているためである。   As will be described in detail later, the J state is defined as continuing for 100 ms or more from the timing TM1. Then, at timing TM2 after 100 ms has elapsed from timing TM1, the device enters a suspend (SUSPEND) state. This is because the USB standard stipulates that the device enters the suspended state when the J state continues for 100 ms or longer.

その後タイミングTM3においてDPがLレベルになり、SE0となる。タイミングTM1からタイミングTM3までの時間は、USB規格において、TATTDBとして規定されており、USBデバイスはこの時間を100ms以内にすることとして規定されている。 Thereafter, at timing TM3, DP becomes L level and becomes SE0. The time from the timing TM1 to the timing TM3 is defined as T ATTDB in the USB standard, and the USB device is defined as setting this time within 100 ms.

SE0が2.5μs以上継続すると、デバイスは、タイミングTM4において、サスペンド状態からリセット状態に遷移する。また、デバイスは、SE0の開始即ちタイミングTM3から2.5μs〜3ms以内にチャープKの出力を開始し、チャープKの出力を1ms以上継続する。その後、デバイスは、SE0の開始時刻即ちタイミングTM3から7ms未満のタイミングTM5において、チャープKの出力を終了する。   When SE0 continues for 2.5 μs or longer, the device transitions from the suspended state to the reset state at timing TM4. Further, the device starts chirp K output within 2.5 μs to 3 ms from the start of SE 0, that is, timing TM 3, and continues the chirp K output for 1 ms or longer. Thereafter, the device ends the output of the chirp K at the start time of SE0, that is, at timing TM5 less than 7 ms from timing TM3.

タイミングTM5からSE0が100μs継続した後のタイミングTM6において、ホストは、チャープKとチャープJの組み合わせを出力する(チャープKとチャープJを交互に出力する)。デバイスは、タイミングTM7においてチャープKとチャープJの組み合わせを3組(3回)検出すると、FSターミネーションをオフ(OFF)にし、HSモードに移行する。   At timing TM6 after SE0 continues for 100 μs from timing TM5, the host outputs a combination of chirp K and chirp J (alternately outputs chirp K and chirp J). When the device detects three (three times) combinations of chirp K and chirp J at timing TM7, the device turns off FS termination and shifts to the HS mode.

その後、ホストは、タイミングTM8においてチャープKとチャープJの組み合わせの出力を終了し、デバイスは、HSアイドルとなる。なお、タイミングTM3からタイミングTM8までの時間は、USB規格において、TDRST(ルートハブにおいてはTDRSTR)として規定されており、TDRSTは10ms以上20ms以下であることとして規定されている。また、TDRSTRは50ms以上であることとして規定されている。 Thereafter, the host ends the output of the combination of chirp K and chirp J at timing TM8, and the device becomes HS idle. The time from the timing TM3 to timing TM8, the USB standard, (in the root hub T DRSTR) T DRST are defined as, T DRST is defined as that at 20ms or less than 10 ms. Also, T DRSTR is defined as being 50 ms or longer.

また、タイミングTM8からタイミングTM9までの時間は、USB規格において、TRSTRCYとして規定されており、USBデバイスはこの時間を10ms以内にすることとして規定されている。 Further, the time from timing TM8 to timing TM9 is defined as TRSTRCY in the USB standard, and the USB device is defined as setting this time within 10 ms.

1.1.2 HSホストとFSデバイスが接続された場合
図2にHSホストとFS(Full-Speed)デバイスが接続された場合におけるUSB上の信号の波形図を示す。
1.1.2 When HS Host and FS Device are Connected FIG. 2 shows a waveform diagram of signals on the USB when the HS host and FS (Full-Speed) device are connected.

ホストとデバイスが接続されると、ホストからVBUSに電位が供給される。タイミングTM10においてVBUSの電位が所与の閾値電位まで上昇した後、タイミングTM11において、デバイスは、FSターミネーションをオンにする。VBUSから電力の供給を受けて動作するバスパワー動作デバイスは、タイミングTM10から100ms以内に、FSターミネーションをオンにすることと規定されている。   When the host and the device are connected, a potential is supplied from the host to VBUS. After the potential of VBUS rises to a given threshold potential at timing TM10, the device turns on FS termination at timing TM11. A bus power operation device that operates by receiving power supply from VBUS is defined to turn on FS termination within 100 ms from timing TM10.

JステートはタイミングTM11から100ms以上継続することとして規定されている。そして、タイミングTM11から100ms経過した後のタイミングTM12において、デバイスはサスペンド状態になる。   The J state is defined as continuing for 100 ms or more from the timing TM11. The device enters a suspended state at timing TM12 after 100 ms has elapsed from timing TM11.

その後タイミングTM13においてDPがLレベルになり、SE0となる。タイミングTM11からタイミングTM13までの時間は、USB規格において、TATTDBとして規定されており、USBデバイスはこの時間を100ms以内にすることとして規定されている。 Thereafter, at timing TM13, DP becomes L level and becomes SE0. The time from the timing TM11 to the timing TM13 is defined as TATTDB in the USB standard, and the USB device is defined as setting this time within 100 ms.

SE0が2.5μs以上継続すると、デバイスは、タイミングTM14において、サスペンド状態からリセット状態に遷移する。なお、FSデバイスは、先に説明したHSデバイスと異なり、チャープKの出力を行わない。   When SE0 continues for 2.5 μs or longer, the device transitions from the suspended state to the reset state at timing TM14. Note that the FS device does not output chirp K, unlike the HS device described above.

タイミングTM13からSE0が10ms継続した後のタイミングTM18において、デバイスは、FSアイドルとなる。なお、HSホストとHSデバイスが接続された場合(先述)と異なり、タイミングTM13からタイミングTM18までの間にチャープKとチャープJの組み合わせの出力は行われない。また、タイミングTM13からタイミングTM18までの時間は、HSホストとHSデバイスが接続された場合と同様に、10ms以上であることとして規定されている。また、タイミングTM18からタイミングTM19までの時間も、HSホストとHSデバイスが接続された場合と同様に、10ms以上であることとして規定されている。   At timing TM18 after SE0 continues for 10 ms from timing TM13, the device becomes FS idle. Note that, unlike the case where the HS host and the HS device are connected (described above), the combination of chirp K and chirp J is not output between timing TM13 and timing TM18. Further, the time from the timing TM13 to the timing TM18 is defined as being 10 ms or more as in the case where the HS host and the HS device are connected. Also, the time from the timing TM18 to the timing TM19 is defined as being 10 ms or more as in the case where the HS host and the HS device are connected.

1.2 SetAddress標準デバイス・リクエストのリカバリ・インターバル時間
USBの通信は、ホストとデバイスのエンドポイントとの間で行われる。ホストは、1つのシステムの中でユニークなアドレスをデバイスに割り当てて、デバイスのエンドポイントと通信する。ホストがデバイスにアドレスを割り当てる場合には、SetAddress標準デバイス・リクエストが用いられる。USB規格においては、ホストがSetAddress標準デバイス・リクエストに対する応答をUSBデバイスから受け取ってから次のリクエストをUSBデバイスに送信するまでの待ち(ウェイト)時間であるSetAddress標準デバイス・リクエストのリカバリ・インターバル(recovery interval)時間は2ms以上として規定されている。すなわち、USBデバイスは、SetAddress標準デバイス・リクエストに対する応答をUSBホストに送信してから2ms以内に次のリクエストを受信可能な状態になる必要がある。
1.2 SetAddress Standard Device Request Recovery Interval Time USB communication is performed between the host and the device endpoint. The host communicates with the device endpoint by assigning the device a unique address within a system. When the host assigns an address to a device, a SetAddress standard device request is used. In the USB standard, the recovery interval (recovery) of the SetAddress standard device request, which is a wait time from when the host receives a response to the SetAddress standard device request from the USB device until the next request is transmitted to the USB device. interval) The time is specified as 2 ms or more. That is, the USB device needs to be ready to receive the next request within 2 ms after transmitting a response to the SetAddress standard device request to the USB host.

1.3 サスペンド状態のデバイスをレジュームさせるレジューム信号の出力時間
USB規格においては、ホストがサスペンド(SUSPEND)状態のデバイスをレジューム(RESUME)させることができることが規定されている。そして、USB規格においては、ホストがサスペンド状態のデバイスをレジュームさせるためのレジューム信号の出力時間は、TDRSMDNとして規定されており、このTDRSMDNは、20ms以上として規定されている。
1.3 Resume Signal Output Time to Resume Suspended Device The USB standard stipulates that the host can resume a SUSPEND device. Then, the USB standard, the output time of the resume signal for the host to resume a device suspend state is defined as a T DRSMDN, this T DRSMDN is defined as more than 20 ms.

1.4 USBデバイス装置の実測値
本発明者は、市販されている一般的なUSBデバイス装置において、上記のような各種の時間の実測を行った。また、本発明者は、市販されている一般的なパーソナルコンピュータ(USBホスト装置)と市販されている一般的なプリンタ(USBデバイス装置)との間において、上記のような各種の時間の実測を行った。
1.4 Measured value of USB device device The present inventor measured the various times as described above in a general USB device device on the market. In addition, the present inventor measured various times as described above between a commercially available general personal computer (USB host device) and a commercially available general printer (USB device device). went.

図3に、USB規格において規定されている時間(規格値)と、USBデバイス装置において実測した時間(実測値)を示す。本発明者は、図3に示すように、市販されているUSBデバイス装置の実測値がUSBの規格値より長くなってしまっていることを見出した。このようなUSBデバイス装置がUSBホスト装置に接続されている場合に、USBホスト装置がUSBの規格値に従って動作すると、USBホスト装置がUSBデバイス装置を正常に認識できなかったり、USBデバイス装置が正常に動作しないということが起こり得る。   FIG. 3 shows the time defined in the USB standard (standard value) and the time actually measured in the USB device device (actual value). As shown in FIG. 3, the present inventor has found that the measured value of a commercially available USB device device is longer than the standard value of USB. When such a USB device device is connected to the USB host device, if the USB host device operates according to the USB standard value, the USB host device cannot recognize the USB device device normally, or the USB device device is normal. It can happen that it doesn't work.

また、USB規格においては、USBデバイス装置はレジューム(RESUME)機能を有することとして規定されている。しかしながら、本発明者は、レジューム機能を有していない、いわば規格違反とも言えるUSBデバイス装置が存在することも見出した。このような規格違反とも言えるUSBデバイス装置がUSBホスト装置に接続されている場合には、USBホスト装置はUSBデバイス装置をレジュームさせることが出来ず、その結果として、USBホスト装置及び/又はUSBデバイス装置がフリーズしてしまうということが起こり得る。   In the USB standard, the USB device device is defined as having a resume function. However, the present inventor has also found that there is a USB device device that does not have a resume function and can be said to be a violation of the standard. When a USB device device that can be said to be in violation of the standard is connected to the USB host device, the USB host device cannot resume the USB device device, and as a result, the USB host device and / or the USB device It can happen that the device freezes.

2. 第1の実施形態
2.1 構成
図4に、以上のような問題を解決できる本実施形態のUSBホストコントローラ40(広義にはコントローラ)及びこれを含む電子機器20の構成例を示す。
2. First Embodiment 2.1 Configuration FIG. 4 shows a configuration example of a USB host controller 40 (controller in a broad sense) and an electronic apparatus 20 including the USB host controller 40 of the present embodiment that can solve the above problems.

電子機器20は、メインCPU30と、USBホストコントローラ40とを含む。USBホストコントローラ40は、USBI/F80と、転送コントローラ100と、処理部120と、レジスタ130(広義には情報入力部)と、DMA処理部140とを含む。なおUSBホストコントローラ40を半導体集積回路として実現するようにしても良い。   The electronic device 20 includes a main CPU 30 and a USB host controller 40. The USB host controller 40 includes a USB I / F 80, a transfer controller 100, a processing unit 120, a register 130 (information input unit in a broad sense), and a DMA processing unit 140. The USB host controller 40 may be realized as a semiconductor integrated circuit.

なおUSBホストコントローラ40、電子機器20は図4の構成に限定されず、その構成要素の一部を省略したり、構成要素間の接続形態を変更したり、図4とは異なる構成要素を追加する変形実施が可能である。例えばUSBホストコントローラ40において転送コントローラ100や処理部120やDMA処理部140等の構成を省く変形実施も可能である。また電子機器20において、図2に示されるもの以外の構成要素(例えば操作部、表示部、ROM、RAM、撮像部又は電源等)を追加してもよい。   Note that the USB host controller 40 and the electronic device 20 are not limited to the configuration shown in FIG. 4, and some of the components are omitted, the connection form between components is changed, or components different from those shown in FIG. It is possible to carry out a modified implementation. For example, the USB host controller 40 can be modified to omit the configuration of the transfer controller 100, the processing unit 120, the DMA processing unit 140, and the like. Moreover, in the electronic device 20, you may add components (for example, an operation part, a display part, ROM, RAM, an imaging part, a power supply etc.) other than what is shown by FIG.

また本実施形態の電子機器20としては、ビデオカメラ、デジタルカメラ、携帯型音楽プレーヤ、携帯型映像プレーヤ、光ディスクドライブ装置、ハードディスクドライブ装置、オーディオ機器、携帯電話機、携帯型ゲーム機、電子手帳、電子辞書又は携帯型情報端末等の種々のものが考えられる。   As the electronic device 20 of the present embodiment, a video camera, a digital camera, a portable music player, a portable video player, an optical disk drive device, a hard disk drive device, an audio device, a mobile phone, a portable game machine, an electronic notebook, an electronic notebook Various things such as a dictionary or a portable information terminal can be considered.

メインCPU30は電子機器20の全体的な処理、制御を行う。例えば電子機器20がビデオカメラである場合には、メインCPU30はカメラプロセッサとして機能し、撮像デバイスの制御や画像のエフェクト処理や画像の圧縮処理などを行う。   The main CPU 30 performs overall processing and control of the electronic device 20. For example, when the electronic device 20 is a video camera, the main CPU 30 functions as a camera processor, and performs control of the imaging device, image effect processing, image compression processing, and the like.

レジスタ130は、メインCPU30のアドレス空間(メモリ空間、I/O空間等)にマッピングされており、レジスタ130には、CPUバスを介してメインCPU30が発行したコマンドが書き込まれる。USBI/F80、転送コントローラ100、処理部120、DMA処理部140は、レジスタ130に書き込まれたコマンドに基づいて動作する。またレジスタ130にはUSBI/F80、転送コントローラ100、処理部120、DMA処理部140等の動作ステータスが書き込まれ、メインCPU30はレジスタ130に書き込まれた動作ステータスを読み出すことができる。   The register 130 is mapped to the address space (memory space, I / O space, etc.) of the main CPU 30, and commands issued by the main CPU 30 via the CPU bus are written into the register 130. The USB I / F 80, the transfer controller 100, the processing unit 120, and the DMA processing unit 140 operate based on a command written in the register 130. In addition, the operation statuses of the USB I / F 80, the transfer controller 100, the processing unit 120, the DMA processing unit 140, and the like are written in the register 130, and the main CPU 30 can read out the operation status written in the register 130.

USBI/F80は、USBを介してデータ転送(高速シリアル転送)を行うためのインターフェースである。具体的にはUSBI/F80は、USB(シリアルバス)を介してデータの受信や送信を行う物理層回路を含み、USB機器10との間のデータ転送を行う。   The USB I / F 80 is an interface for performing data transfer (high-speed serial transfer) via the USB. Specifically, the USB I / F 80 includes a physical layer circuit that receives and transmits data via a USB (serial bus), and performs data transfer with the USB device 10.

なおUSBI/F80がホスト機能を有する場合には、USBにUSBデバイスを接続し、そのUSBデバイスとの間でデータ転送を行うようにしてもよい。   When the USB I / F 80 has a host function, a USB device may be connected to the USB, and data transfer may be performed between the USB device.

DMA処理部140は、CPUバスに接続されており、USB機器10に送信されるデータをCPUバスから受け取って転送コントローラ100にDMA転送し及び/又はUSB機器10から受信されたデータを転送コントローラ100からCPUバスにDMA転送する。   The DMA processing unit 140 is connected to the CPU bus, receives data transmitted to the USB device 10 from the CPU bus, performs DMA transfer to the transfer controller 100, and / or transfers data received from the USB device 10 to the transfer controller 100. To DMA transfer to the CPU bus.

転送コントローラ100は、USBI/F80、DMA処理部140の間でのデータ転送を制御する。これにより、CPUバスから転送されてきたデータをUSB機器10に書き込んだり、USB機器10に書き込まれたデータをCPUバスに転送することが可能になる。   The transfer controller 100 controls data transfer between the USB I / F 80 and the DMA processing unit 140. As a result, the data transferred from the CPU bus can be written to the USB device 10 and the data written to the USB device 10 can be transferred to the CPU bus.

転送コントローラ100はデータバッファ102(例えばFIFO)を含む。データバッファ102は、転送コントローラ100により転送されるデータを一時的に格納するためのバッファである。このデータバッファ102は、RAMなどのメモリにより実現できる。   The transfer controller 100 includes a data buffer 102 (for example, a FIFO). The data buffer 102 is a buffer for temporarily storing data transferred by the transfer controller 100. The data buffer 102 can be realized by a memory such as a RAM.

処理部120は、USBホストコントローラ40の全体的な処理、制御を行ったり、USBホストコントローラ40が含む各回路ブロックの制御を行う。この処理部120の機能の一部又は全部は、例えばCPUとCPU上で動作するファームウェアにより実現することができる。なお、処理部120を専用のハードウェア回路により実現することもできる。   The processing unit 120 performs overall processing and control of the USB host controller 40 and controls each circuit block included in the USB host controller 40. A part or all of the functions of the processing unit 120 can be realized by, for example, a CPU and firmware operating on the CPU. The processing unit 120 can also be realized by a dedicated hardware circuit.

本実施形態においては、処理部120は、CPU121と、RAM122と、ROM123を含む。ROM123には、OS(オペレーティングシステム)、BIOS(Basic Input/Output System)、API(Application Programming Interface)、ICコモンファンクションドライバ、USBホストクラスドライバ、USBホストスタック等のプログラムが記憶されている。なお、ROM123は、EEPROM等であっても良い。   In the present embodiment, the processing unit 120 includes a CPU 121, a RAM 122, and a ROM 123. The ROM 123 stores programs such as an OS (Operating System), a BIOS (Basic Input / Output System), an API (Application Programming Interface), an IC common function driver, a USB host class driver, and a USB host stack. The ROM 123 may be an EEPROM or the like.

なお処理部120をUSBホストコントローラ40に内蔵させず、メインCPU30との間のインタフェース処理を行うCPUI/Fを設けるようにしてもよい。この場合には、USBホストコントローラ40やUSBホストコントローラ40が含む各回路ブロックの制御は、CPUI/Fを介してメインCPU30が行うことになる。   The processing unit 120 may not be built in the USB host controller 40, and a CPU I / F that performs interface processing with the main CPU 30 may be provided. In this case, the main CPU 30 controls the USB host controller 40 and each circuit block included in the USB host controller 40 via the CPU I / F.

また処理部120を動作させるためのプログラムは、メインCPU30側のメモリ(EEPROM等)に記憶しておき、電源投入後にメインCPU30がダウンロードコマンドを発行し、CPUバスを介してUSBホストコントローラ40にダウンロードするようにしてもよい。   A program for operating the processing unit 120 is stored in a memory (EEPROM, etc.) on the main CPU 30 side, the main CPU 30 issues a download command after power-on, and is downloaded to the USB host controller 40 via the CPU bus. You may make it do.

CPU121は、RAM122を作業領域として利用しながら、ROM123に記憶されているプログラムを実行する。   The CPU 121 executes a program stored in the ROM 123 while using the RAM 122 as a work area.

図5に、CPU121がROM123に記憶されているプログラムを実行することにより実現される機能ブロックを示す。   FIG. 5 shows functional blocks realized by the CPU 121 executing a program stored in the ROM 123.

OSブロックは、CPU121がROM123に記憶されているOSプログラムを実行することにより実現され、ROM123内の他のプログラムを動作させるためのオペレーティングシステムブロックであり、タスクの生成や管理、他のソフトウェアブロックに対するサービスコールを提供する。   The OS block is realized by the CPU 121 executing the OS program stored in the ROM 123, and is an operating system block for operating other programs in the ROM 123. Task generation and management, and other software blocks Provide service calls.

BIOSブロックは、CPU121がROM123に記憶されているBIOSプログラムを実行することにより実現されるブロックであり、メインCPU30がUSBホストコントローラ40のレジスタ130に設定したコマンドを解析し、APIブロックの適切な関数を呼び出してUSBホストコントローラ40の機能を実現するソフトウェアブロックである。   The BIOS block is a block realized by the CPU 121 executing the BIOS program stored in the ROM 123, and the main CPU 30 analyzes the command set in the register 130 of the USB host controller 40, and an appropriate function of the API block. Is a software block that implements the functions of the USB host controller 40 by calling.

APIブロックは、CPU121がROM123に記憶されているAPIプログラムを実行することにより実現されるブロックであり、USBホストコントローラ40のハードウェアとファームウェアが有する機能をBIOSブロックに対して関数形式で提供するソフトウェアブロックである。   The API block is a block realized by the CPU 121 executing an API program stored in the ROM 123, and software that provides the functions of the hardware and firmware of the USB host controller 40 to the BIOS block in a functional format. It is a block.

ICコモンファンクションブロックは、CPU121がROM123に記憶されているICコモンファンクションプログラムを実行することにより実現されるブロックであり、USBホストコントローラ40の初期設定および、パワーマネージメント機能等、USBホストコントローラ40自体の設定や制御を行うソフトウェアブロックである。   The IC common function block is a block that is realized by the CPU 121 executing the IC common function program stored in the ROM 123. The initial setting of the USB host controller 40, the power management function, and the like of the USB host controller 40 itself. This is a software block for setting and control.

USBホストクラスドライバブロックは、CPU121がROM123に記憶されているUSBホストクラスドライバプログラムを実行することにより実現されるブロックであり、USBホストスタックの上位プロトコルを処理するソフトウェアブロックであり、USB規格のHID(Human Interface Device)クラス、マスストレージ(Mass Storage)クラス、オーディオ(Audio)クラス、ビデオ(Video)クラス、プリンタ(Printer)クラス、通信デバイス(Communication Device)クラス、ピクチャ転送プロトコル(Picture Transfer Protocol)クラス等に対応するクラスドライバのブロックである。   The USB host class driver block is a block realized by the CPU 121 executing the USB host class driver program stored in the ROM 123, and is a software block that processes the upper protocol of the USB host stack. The USB standard HID (Human Interface Device) class, Mass Storage class, Audio (Audio) class, Video (Video) class, Printer (Printer) class, Communication device (Communication Device) class, Picture Transfer Protocol class Is a class driver block corresponding to.

USBホストスタックブロックは、CPU121がROM123に記憶されているUSBホストスタックプログラムを実行することにより実現されるブロックであり、USBI/F80を制御し、USB機器10の接続/切断処理、パワーマネージメント、エンドポイント毎の転送処理を行うソフトウェアブロックである。   The USB host stack block is a block realized by the CPU 121 executing a USB host stack program stored in the ROM 123. The USB host stack block controls the USB I / F 80 to connect / disconnect the USB device 10, power management, and end. It is a software block that performs transfer processing for each point.

2.2 USBI/F
USBでは、図6(A)に示すようなエンドポイント(EP0〜15)がUSBデバイス側に用意される。またUSBでは、転送(transfer)のタイプとして、コントロール転送、アイソクロナス転送、インタラプト転送、バルク転送などが定義されており、各転送は一連のトランザクションにより構成される。そしてトランザクションは図6(B)に示すように、トークンパケットと、オプショナルなデータパケットと、オプショナルなハンドシェークパケットにより構成される。
2.2 USB I / F
In USB, endpoints (EP0 to EP15) as shown in FIG. 6A are prepared on the USB device side. In USB, control transfer, isochronous transfer, interrupt transfer, bulk transfer, and the like are defined as transfer types, and each transfer includes a series of transactions. As shown in FIG. 6B, the transaction includes a token packet, an optional data packet, and an optional handshake packet.

OUTトランザクションでは、図6(C)に示すように、まず、USBホストがUSBデバイスに対してOUTトークン(トークパケット)を発行する。次に、USBホストはUSBデバイスに対してOUTデータ(データパケット)を送信する。そして、USBデバイスは、OUTデータの受信に成功すれば、USBホストに対してACK(ハンドシェークパケット)を送信する。一方、INトランザクションでは、図6(D)に示すように、まず、USBホストがUSBデバイスに対してINトークンを発行する。そしてINトークンを受信したUSBデバイスは、USBホストに対してINデータを送信する。そしてUSBホストは、INデータの受信に成功すると、USBデバイスに対してACKを送信する。   In the OUT transaction, as shown in FIG. 6C, first, the USB host issues an OUT token (talk packet) to the USB device. Next, the USB host transmits OUT data (data packet) to the USB device. If the USB device succeeds in receiving the OUT data, the USB device transmits an ACK (handshake packet) to the USB host. On the other hand, in the IN transaction, as shown in FIG. 6D, first, the USB host issues an IN token to the USB device. The USB device that has received the IN token transmits IN data to the USB host. When the USB host succeeds in receiving the IN data, the USB host transmits ACK to the USB device.

なお"D←H"は、USBホストからUSBデバイスに対して情報が転送されることを意味し、"D→H"は、USBデバイスからUSBホストに対して情報が転送されることを意味する。   “D ← H” means that information is transferred from the USB host to the USB device, and “D → H” means that information is transferred from the USB device to the USB host. .

次に、USBのバルクオンリートランスポートのプロトコルについて説明する。ハードディスクドライブや光ディスクドライブなどの大容量記憶装置は、マスストレージと呼ばれるクラスに属する。このマスストレージクラスには、バルクオンリートランスポートというプロトコルが規格化されている。   Next, a USB bulk-only transport protocol will be described. Mass storage devices such as hard disk drives and optical disk drives belong to a class called mass storage. In this mass storage class, a protocol called bulk-only transport is standardized.

バルクオンリートランスポートでは、バルクIN、バルクOUTの2つのエンドポイントを用いてパケット転送が行われる。即ち、コマンドには、CBW(Command Block Wrapper)と呼ばれる31バイトのデータが使用され、バルクOUTのエンドポイントを用いて転送される。データ転送には、転送方向に応じてバルクIN、バルクOUTのエンドポイントが使用される。コマンドに対するステータスには、CSW(Command Status Wrapper)と呼ばれる13バイトのデータが使用され、バルクINのエンドポイントを用いて転送される。   In bulk-only transport, packet transfer is performed using two endpoints, bulk IN and bulk OUT. That is, 31 bytes of data called CBW (Command Block Wrapper) is used for the command and transferred using the endpoint of the bulk OUT. For data transfer, endpoints of bulk IN and bulk OUT are used according to the transfer direction. As the status for the command, 13-byte data called CSW (Command Status Wrapper) is used and transferred using the bulk IN endpoint.

次に、バルクオンリートランスポートの送受信処理(プロトコル制御)について、図7(A)、(B)を用いて説明する。図7(A)に示すように、USBホストがUSBデバイスにデータを送信する場合には、まずUSBホストがCBWをUSBデバイスに送信するコマンドトランスポートが行われる。具体的には、USBホストが、エンドポイントEP1を指定するトークンパケットをUSBデバイスに送信し、次に、CBWをUSBデバイスのエンドポイントEP1に送信する。このCBWはライトコマンドを含む。そして、USBデバイスからUSBホストにACKのハンドシェークパケットが返却されると、コマンドトランスポートが終了する。   Next, transmission / reception processing (protocol control) of bulk-only transport will be described with reference to FIGS. As shown in FIG. 7A, when the USB host transmits data to the USB device, first, command transport is performed in which the USB host transmits CBW to the USB device. Specifically, the USB host transmits a token packet designating the end point EP1 to the USB device, and then transmits CBW to the end point EP1 of the USB device. This CBW includes a write command. When the ACK handshake packet is returned from the USB device to the USB host, the command transport is completed.

コマンドトランスポートが終了するとデータトランスポートに移行する。このデータトランスポートでは、まずUSBホストが、エンドポイントEP1を指定するトークンパケットをUSBデバイスに送信し、次に、OUTデータをUSBデバイスのエンドポイントEP1に送信する。そして、USBデバイスからUSBホストにACKのハンドシェークパケットが返却されると、1つのトランザクションが終了する。そして、このようなトランザクションが繰り返され、CBWで指定されるデータ長の分だけデータが送信されると、データトランスポートが終了する。   When the command transport is completed, the process moves to the data transport. In this data transport, the USB host first transmits a token packet designating the end point EP1 to the USB device, and then transmits OUT data to the end point EP1 of the USB device. When an ACK handshake packet is returned from the USB device to the USB host, one transaction is completed. When such a transaction is repeated and data is transmitted for the data length specified by the CBW, the data transport is completed.

データトランスポートが終了するとステータストランスポートに移行する。このステータストランスポートでは、まず、USBホストが、エンドポイントEP2を指定するトークンパケットをUSBデバイスに送信する。すると、USBデバイスが、エンドポイントEP2にあるCSWをUSBホストに送信する。そして、USBホストからUSBデバイスにACKのハンドシェークパケットが返却されると、ステータストランスポートが終了する。   When the data transport ends, the status transport is entered. In this status transport, first, the USB host transmits a token packet designating the end point EP2 to the USB device. Then, the USB device transmits the CSW at the end point EP2 to the USB host. When the ACK handshake packet is returned from the USB host to the USB device, the status transport is completed.

USBホストがUSBデバイスからデータを受信する場合は、図7(B)に示すように処理が行われる。図7(B)が図7(A)と異なるのは、コマンドトランスポートのCBWがリードコマンドを含む点と、データトランスポートにおいてINデータの転送が行われる点である。   When the USB host receives data from the USB device, processing is performed as shown in FIG. FIG. 7B is different from FIG. 7A in that the CBW of the command transport includes a read command and that IN data is transferred in the data transport.

図8にUSBI/F80の構成例を示す。USBI/F80は、トランシーバ220、転送コントローラ250、データバッファ290を含む。   FIG. 8 shows a configuration example of the USB I / F 80. The USB I / F 80 includes a transceiver 220, a transfer controller 250, and a data buffer 290.

トランシーバ220(デュアルトランシーバ)は、差動信号(DP、DM)を用いてUSBのデータを送受信するための回路であり、ホストトランシーバ230、デバイストランシーバ240を含む。   The transceiver 220 (dual transceiver) is a circuit for transmitting and receiving USB data using differential signals (DP, DM), and includes a host transceiver 230 and a device transceiver 240.

ホストトランシーバ230は、アナログフロントエンド回路(物理層回路)及び高速ロジック回路を有し、USBのHSモード(480Mbps)、FSモード(12Mbps)、LSモード(1.5Mbps)をサポートする。デバイストランシーバ240は、アナログフロントエンド回路(物理層回路)及び高速ロジック回路を有し、USBのHSモード、FSモードをサポートする。このデバイストランシーバ240としてはUTMI(USB2.0 Transceiver Macrocell Interface)仕様に準拠した回路を用いることができる。   The host transceiver 230 has an analog front-end circuit (physical layer circuit) and a high-speed logic circuit, and supports USB HS mode (480 Mbps), FS mode (12 Mbps), and LS mode (1.5 Mbps). The device transceiver 240 has an analog front-end circuit (physical layer circuit) and a high-speed logic circuit, and supports USB HS mode and FS mode. As the device transceiver 240, a circuit compliant with the UTMI (USB 2.0 Transceiver Macrocell Interface) specification can be used.

転送コントローラ250は、USBを介したデータ転送を制御するためのコントローラであり、トランザクション層やリンク層などのデータ転送制御を行う。この転送コントローラ250は、ホストコントローラ260、デバイスコントローラ270、ポートセレクタ280を含む。なおこれらの一部を省略する構成としてもよい。   The transfer controller 250 is a controller for controlling data transfer via the USB, and performs data transfer control such as a transaction layer and a link layer. The transfer controller 250 includes a host controller 260, a device controller 270, and a port selector 280. Note that some of these may be omitted.

ホストコントローラ260(ホストSerial Interface Engine)は、ホストモード時のデータ転送を制御する。具体的にはホストコントローラ260は、トランザクションのスケジューリング(発行)やトランザクションの管理やパケットの生成&解析などを行う。またサスペンド、レジューム、リセット等のバスイベントを生成する。更にバスの接続・切断状態の検出やVBUSの制御などを行う。   The host controller 260 (host serial interface engine) controls data transfer in the host mode. Specifically, the host controller 260 performs transaction scheduling (issue), transaction management, packet generation & analysis, and the like. It also generates bus events such as suspend, resume, and reset. Further, it detects the connection / disconnection state of the bus and controls the VBUS.

デバイスコントローラ270(デバイスSerial Interface Engine)は、デバイスモード時のデータ転送を制御する。具体的にはデバイスコントローラ270は、トランザクションの管理やパケットの生成&解析などを行う。またサスペンド、レジューム、リセット等のバスイベントを制御する。   A device controller 270 (device serial interface engine) controls data transfer in the device mode. Specifically, the device controller 270 performs transaction management, packet generation & analysis, and the like. It also controls bus events such as suspend, resume, and reset.

ポートセレクタ280は、ホストモードとデバイスモードのいずれかを選択して有効にするためのセレクタである。例えばレジスタ等の設定によりホストモードが選択されると、ポートセレクタ280はホストコントローラ260、ホストトランシーバ230を選択(イネーブル)する。一方、レジスタ等の設定によりデバイスモードが選択されると、ポートセレクタ280はデバイスコントローラ270、デバイストランシーバ240を選択(イネーブル)する。   The port selector 280 is a selector for selecting and enabling either the host mode or the device mode. For example, when the host mode is selected by setting a register or the like, the port selector 280 selects (enables) the host controller 260 and the host transceiver 230. On the other hand, when the device mode is selected by setting the register or the like, the port selector 280 selects (enables) the device controller 270 and the device transceiver 240.

データバッファ290(FIFO、パケットバッファ)は、USB(シリアルバス)を介して転送されるデータ(送信データ、受信データ)を一時的に格納(バッファリング)するためのバッファである。このデータバッファ290は、RAMなどのメモリにより実現できる。   The data buffer 290 (FIFO, packet buffer) is a buffer for temporarily storing (buffering) data (transmission data, reception data) transferred via a USB (serial bus). The data buffer 290 can be realized by a memory such as a RAM.

なお、転送コントローラ250やデータバッファ290の一部の機能を、図4の転送コントローラ100やデータバッファ102により実現してもよい。また図8では、ホスト動作とデバイス動作の両方の動作を行うUSBI/F80の例を示したが、デバイス動作だけを行うものであってもよい。   Note that some functions of the transfer controller 250 and the data buffer 290 may be realized by the transfer controller 100 and the data buffer 102 of FIG. FIG. 8 shows an example of the USB I / F 80 that performs both the host operation and the device operation. However, only the device operation may be performed.

2.3 動作
次に、本実施形態の動作について説明する。本実施形態のUSBホストコントローラ40においては、USBデバイスの制御に関する時間としてUSB規格で規定されている時間(規格値)に固定することなく、メインCPU30からの指示に応じて、USBデバイスの制御に関する時間を変更することとしている。
2.3 Operation Next, the operation of this embodiment will be described. In the USB host controller 40 according to the present embodiment, the time related to the USB device control is not fixed to the time (standard value) defined in the USB standard as the time related to the USB device control, but according to the instruction from the main CPU 30. Try to change the time.

2.3.1 初期時における動作
まず、初期時(パワーオン時、リセット時等)における電子機器20の動作について説明する。
2.3.1 Operation at Initial Time First, the operation of the electronic device 20 at the initial time (power-on, reset time, etc.) will be described.

図9は、初期時における電子機器20の動作を示すフローチャートである。
まず、メインCPU30が、変更対象である時間を特定する情報(時間を表す名称(TATTDB、TDRST等)等であっても良い)及び/又は時間値をレジスタ130に設定する(ステップS11)。
FIG. 9 is a flowchart showing the operation of the electronic device 20 at the initial time.
First, the main CPU 30 sets information (which may be a name indicating time (T ATTDB , T DRST, etc.)) and / or a time value in the register 130 (step S11). .

例えば、メインCPU30が、図10(a)〜(c)に示すように、時間を表す名称及び時間値をレジスタ130に設定するようにしても良い。図10(a)は、多くのUSB機器を認識又は動作可能とできるように長めの時間値を設定する場合の例であり、図10(b)は、待ち時間を短くして動作を素早くするために短めの時間値を設定する場合の例であり、図10(c)は、USB規格に準拠した時間値を設定する場合の例である。或いは、図10(a)〜(c)をテーブルとしてROM123に予め記憶しておき、メインCPU30が、いずれのテーブルを使用するかを表す情報をレジスタ130に設定するようにしても良い。   For example, the main CPU 30 may set a name and a time value representing time in the register 130 as shown in FIGS. FIG. 10A shows an example in which a long time value is set so that many USB devices can be recognized or operated. FIG. 10B shortens the waiting time and speeds up the operation. Therefore, this is an example in which a shorter time value is set, and FIG. 10C is an example in which a time value conforming to the USB standard is set. Alternatively, FIGS. 10A to 10C may be stored in advance in the ROM 123 as tables, and the main CPU 30 may set information indicating which table is used in the register 130.

なお、図10(a)〜(c)では、5個の時間値を設定することとしているが、これら5個以外の時間値は、USB規格において規定されている値(規格値)を用いるようにすれば良い。   In FIGS. 10A to 10C, five time values are set. However, values (standard values) defined in the USB standard are used as time values other than these five time values. You can do it.

なお、変更対象である時間が予め決められている場合には、変更対象である時間を特定する情報(時間を表す名称等)を不要とすることができる。   In addition, when the time to be changed is determined in advance, information for specifying the time to be changed (such as a name indicating time) can be made unnecessary.

USBホストコントローラ40のBIOSブロックは、レジスタ130の内容を解析し、変更対象である時間を特定する情報及び時間値を引数として、APIをコールする(ステップS21)。   The BIOS block of the USB host controller 40 analyzes the contents of the register 130 and calls the API with information specifying the time to be changed and the time value as arguments (step S21).

USBホストコントローラ40のAPIブロックは、変更対象である時間を特定する情報及び時間値を引数として、USBホストスタックをコールする(ステップS31)。   The API block of the USB host controller 40 calls the USB host stack with information specifying the time to be changed and the time value as arguments (step S31).

USBホストコントローラ40のUSBホストスタックブロックは、引数に基づいて、RAM122上の時間値を設定及び/又は変更する(ステップS41)。なお、RAM122上には予めデフォルトの時間値が書き込まれるようにしておき、USBホストスタックブロックが、このデフォルト値を上書き変更するようにしても良い。   The USB host stack block of the USB host controller 40 sets and / or changes the time value on the RAM 122 based on the argument (step S41). A default time value may be written in advance on the RAM 122, and the USB host stack block may overwrite this default value.

ステップS41(USBホストスタックブロック)及びステップS31(APIブロック)からリターンすると、BIOSブロックは、時間値変更完了ステータスをレジスタ130に設定する(ステップS22)。メインCPU30は、レジスタ130を参照することで、時間値変更完了ステータスを読み出すことができる。   When returning from step S41 (USB host stack block) and step S31 (API block), the BIOS block sets a time value change completion status in the register 130 (step S22). The main CPU 30 can read the time value change completion status by referring to the register 130.

2.3.2 USBホストとUSBデバイスが接続された場合における動作
次に、USB機器10が接続された場合におけるUSBホストコントローラ40の動作について説明する。
2.3.2 Operation when USB Host and USB Device are Connected Next, the operation of the USB host controller 40 when the USB device 10 is connected will be described.

図11は、USB機器10が接続された場合におけるUSBホストコントローラ40の動作を示すフローチャートである。
まず、USBホストコントローラ40(より詳細にはUSBホストスタックブロック)は、システム初期化動作を行い(ステップS51)、USB機器10が接続されるのを待つ。
FIG. 11 is a flowchart showing the operation of the USB host controller 40 when the USB device 10 is connected.
First, the USB host controller 40 (more specifically, the USB host stack block) performs a system initialization operation (step S51) and waits for the USB device 10 to be connected.

USB機器10が接続される(例えば、USBホストコントローラ40とUSB機器10との間を接続するUSBケーブルが挿入される等)と、USBホストコントローラ40は、電源安定待ち時間調節動作を行う(ステップS52)。より詳細には、USBホストコントローラ40は、メインCPU30から設定されたTATTDBの設定値(図10(a)〜(c)参照)に基づいて、電源安定待ち時間(図1のタイミングTM1〜TM3及び/又は図2のタイミングTM11〜TM13参照)の調節動作を行う。すなわち、USBホストコントローラ40は、メインCPU30から設定されたTATTDBの設定値に基づく時間に応じたタイミングでUSBに信号又はデータを出力する。例えば、USBホストコントローラ40は、図1のタイミングTM1〜TM3及び/又は図2のタイミングTM11〜TM13の長さ(時間)を調節する。 When the USB device 10 is connected (for example, a USB cable for connecting the USB host controller 40 and the USB device 10 is inserted), the USB host controller 40 performs a power supply stabilization wait time adjustment operation (steps). S52). More specifically, the USB host controller 40 determines the power supply stabilization wait time (timing TM1 to TM3 in FIG. 1) based on the set value of TATTDB set from the main CPU 30 (see FIGS. 10A to 10C). And / or adjusting operation of timing TM11 to TM13 in FIG. That is, the USB host controller 40 outputs a signal or data to the USB at a timing according to the time based on the setting value of TATTDB set from the main CPU 30. For example, the USB host controller 40 adjusts the length (time) of the timings TM1 to TM3 in FIG. 1 and / or the timings TM11 to TM13 in FIG.

次に、USBホストコントローラ40は、USB機器10のリセットからパケット発行までの時間調節動作を行う(ステップS53)。より詳細には、USBホストコントローラ40は、メインCPU30から設定されたTDRST及びTRSTRCYの設定値(図10(a)〜(c)参照)に基づいて、USB機器10のリセットからパケット発行までの時間(図1のタイミングTM3〜TM8及び/又は図2のタイミングTM13〜TM18参照)の調節動作を行う。すなわち、USBホストコントローラ40は、メインCPU30から設定されたTRSTRCYの設定値に基づく時間に応じたタイミングでUSBに信号又はデータを出力する。例えば、USBホストコントローラ40は、図1のタイミングTM3〜TM8及び/又は図2のタイミングTM13〜TM18の長さ(時間)を調節する。 Next, the USB host controller 40 performs a time adjustment operation from the reset of the USB device 10 to the packet issuance (step S53). More specifically, USB host controller 40, based on the set value of T DRST and T RSTRCY set from the main CPU 30 (see FIG. 10 (a) ~ (c) ), until the packet issued from the reset of the USB device 10 (See timings TM3 to TM8 in FIG. 1 and / or timings TM13 to TM18 in FIG. 2). That is, the USB host controller 40 outputs a signal or data to the USB at a timing according to the time based on the setting value of TRSTRCY set from the main CPU 30. For example, the USB host controller 40 adjusts the length (time) of the timings TM3 to TM8 in FIG. 1 and / or the timings TM13 to TM18 in FIG.

次に、USBホストコントローラ40は、エニュメレーション動作を行う(ステップS54)。エニュメーレション動作は、アドレス変更時間調節動作を含む。   Next, the USB host controller 40 performs an enumeration operation (step S54). The enumeration operation includes an address change time adjustment operation.

図12は、アドレス変更時間調節動作を示すフローチャートである。
まず、USBホストコントローラ40(より詳細にはUSBホストスタックブロック)が、SetAddress標準デバイス・リクエストをUSB機器10に発行し(ステップS61)、USB機器10が、SetAddress標準デバイス・リクエストを実行し(ステップS71)、SetAddress標準デバイス・リクエストへの応答をUSBホストコントローラ40に送信する(ステップS72)。
FIG. 12 is a flowchart showing the address change time adjustment operation.
First, the USB host controller 40 (more specifically, the USB host stack block) issues a SetAddress standard device request to the USB device 10 (step S61), and the USB device 10 executes the SetAddress standard device request (step S61). In step S71, a response to the SetAddress standard device request is transmitted to the USB host controller 40 (step S72).

USBホストコントローラ40は、SetAddress標準デバイス・リクエストへの応答をUSB機器10から受信すると、メインCPU30から設定されたSetAddress標準デバイス・リクエストのリカバリ・インターバル時間の設定値(図10(a)〜(c)参照)に基づいて、待ち(ウェイト)処理を行う(ステップS62)。   When the USB host controller 40 receives a response to the SetAddress standard device request from the USB device 10, the set value of the recovery interval time of the SetAddress standard device request set from the main CPU 30 (FIGS. 10A to 10C). ))), A wait process is performed (step S62).

そして、USBホストコントローラ40は、メインCPU30から設定されたSetAddress標準デバイス・リクエストのリカバリ・インターバル時間の設定値に基づく待ち(ウェイト)処理が終了すると、GetDescriptor標準デバイス・リクエストをUSB機器10に発行し(ステップS63)、USB機器10が、GetDescriptor標準デバイス・リクエストを実行し(ステップS73)、GetDescriptor標準デバイス・リクエストへの応答をUSBホストコントローラ40に送信する(ステップS74)。すなわち、USBホストコントローラ40は、メインCPU30から設定されたSetAddress標準デバイス・リクエストのリカバリ・インターバル時間の設定値に基づく時間に応じたタイミングでGetDescriptor標準デバイス・リクエストをUSBに出力する。換言すると、USBホストコントローラ40は、SetAddress標準デバイス・リクエストへの応答をUSB機器10から受信してからGetDescriptor標準デバイス・リクエストを発行するまでの待ち(ウェイト)時間の長さを調節する。   The USB host controller 40 issues a GetDescriptor standard device request to the USB device 10 when the wait (wait) processing based on the set value of the recovery address time of the SetAddress standard device request set from the main CPU 30 is completed. (Step S63), the USB device 10 executes a GetDescriptor standard device request (Step S73), and transmits a response to the GetDescriptor standard device request to the USB host controller 40 (Step S74). In other words, the USB host controller 40 outputs a GetDescriptor standard device request to the USB at a timing corresponding to the time based on the set value of the recovery interval time of the SetAddress standard device request set from the main CPU 30. In other words, the USB host controller 40 adjusts the length of the wait (wait) time from when a response to the SetAddress standard device request is received from the USB device 10 until the GetDescriptor standard device request is issued.

以後、必要に応じて、USBホストコントローラ40とUSB機器10との間で通信が行われる。   Thereafter, communication is performed between the USB host controller 40 and the USB device 10 as necessary.

以上説明したように、本実施形態によれば、USBデバイスを制御するためにUSB規格で規定されている時間(規格値)に固定することなく、メインCPU30からの指示に応じて、USB機器10の制御に関する時間を変更することができる。これにより、USBホストコントローラ40がUSB機器10を正常に認識できない又はUSB機器10が正常に動作しないことを防止することが可能になる。   As described above, according to the present embodiment, the USB device 10 is controlled in accordance with an instruction from the main CPU 30 without being fixed to the time (standard value) defined by the USB standard for controlling the USB device. The time related to the control can be changed. Accordingly, it is possible to prevent the USB host controller 40 from recognizing the USB device 10 normally or from not operating normally.

2.3.3 USBデバイスをレジュームさせる場合における動作
次に、サスペンド状態にあるUSB機器10をレジュームさせる場合におけるUSBホストコントローラ40の動作について説明する。
2.3.3 Operation when Resume USB Device Next, the operation of the USB host controller 40 when the USB device 10 in the suspended state is resumed will be described.

図13は、サスペンド状態にあるUSB機器10をレジュームさせる場合におけるUSBホストコントローラ40の動作を示すフローチャートである。
まず、USBホストコントローラ40(より詳細にはUSBホストスタックブロック)は、レジューム動作を行う(ステップS81)。レジューム動作は、レジューム時間調節動作(ステップS82)を含む。
FIG. 13 is a flowchart showing the operation of the USB host controller 40 when the USB device 10 in the suspended state is resumed.
First, the USB host controller 40 (more specifically, the USB host stack block) performs a resume operation (step S81). The resume operation includes a resume time adjustment operation (step S82).

レジューム時間調節動作(ステップS82)において、USBホストコントローラ40は、メインCPU30から設定されたTDRSMDNの設定値(図10(a)〜(c)参照)に基づいて、USB機器10をレジュームさせるためのレジューム信号の長さ(時間)を調節する。すなわち、USBホストコントローラ40は、レジューム信号の出力をメインCPU30から設定されたTDRSMDNの設定値(図10(a)〜(c)参照)に基づく時間だけ継続する。 In the resume time adjustment operation (step S82), the USB host controller 40 resumes the USB device 10 based on the set value of TDRSMDN set by the main CPU 30 (see FIGS. 10A to 10C ). Adjust the length (time) of the resume signal. That is, the USB host controller 40 continues the output of the resume signal for a time based on the set value of TDRSMDN set by the main CPU 30 (see FIGS. 10A to 10C ).

そして、USBホストコントローラ40は、USB機器10のレジュームが失敗した場合(ステップS83)には、USB機器10のリセット処理を行う(ステップS84)。具体的には、USBホストコントローラ40は、USB機器10をリセットするためのリセット信号(SE0)をUSB機器10に出力する。   Then, when the resume of the USB device 10 fails (step S83), the USB host controller 40 performs a reset process of the USB device 10 (step S84). Specifically, the USB host controller 40 outputs a reset signal (SE0) for resetting the USB device 10 to the USB device 10.

以上説明したように、本実施形態によれば、USBデバイスを制御するためにUSB規格で規定されている時間(規格値)に固定することなく、メインCPU30からの指示に応じて、USB機器10の制御に関する時間を変更することができる。これにより、USB機器10がレジューム機能を有しない、いわば規格違反とも言えるUSBデバイス装置であっても、USBホストコントローラ40及び/又はUSB機器10がフリーズしてしまうことを防止することが可能になる。   As described above, according to the present embodiment, the USB device 10 is controlled in accordance with an instruction from the main CPU 30 without being fixed to the time (standard value) defined by the USB standard for controlling the USB device. The time related to the control can be changed. This makes it possible to prevent the USB host controller 40 and / or the USB device 10 from freezing even if the USB device 10 does not have a resume function and is a USB device device that can be said to be a violation of the standard. .

3. 第2の実施形態
3.1 構成
図14に、本実施形態のATA−USBブリッジコントローラ70(広義にはコントローラ)及びこれを含む電子機器50の構成例を示す。本実施形態では、メインCPU60が有するATAのホスト側I/F62の存在に着目し、このホスト側I/F62に対応するATAのデバイス側I/F160をATA−USBブリッジコントローラ70に設けている。こうすることで、メインCPU60からのデータを、デバイス側I/F160を介して転送コントローラ100に書き込むことが可能になる。また本実施形態では、転送コントローラ100に書き込まれたデータをUSB機器10に転送するためのUSBI/F80を設けている。こうすることで、ATAバスとUSBの間のバスブリッジ機能を実現できる。
3. Second Embodiment 3.1 Configuration FIG. 14 shows a configuration example of an ATA-USB bridge controller 70 (controller in a broad sense) of the present embodiment and an electronic device 50 including the same. In the present embodiment, paying attention to the presence of the ATA host I / F 62 of the main CPU 60, the ATA device I / F 160 corresponding to the host I / F 62 is provided in the ATA-USB bridge controller 70. In this way, data from the main CPU 60 can be written to the transfer controller 100 via the device-side I / F 160. In this embodiment, a USB I / F 80 for transferring data written in the transfer controller 100 to the USB device 10 is provided. In this way, a bus bridge function between the ATA bus and the USB can be realized.

なおATA−USBブリッジコントローラ70、電子機器50は図14の構成に限定されず、その構成要素の一部を省略したり、構成要素間の接続形態を変更したり、図14とは異なる構成要素を追加する変形実施が可能である。例えばATA−USBブリッジコントローラ70において処理部150やUSBI/F80やデバイス側I/F160等の構成を省く変形実施も可能である。また電子機器50において、図14に示されるもの以外の構成要素(例えば操作部、表示部、ROM、RAM、撮像部又は電源等)を追加してもよい。   Note that the ATA-USB bridge controller 70 and the electronic device 50 are not limited to the configuration in FIG. 14, and some of the components are omitted, the connection form between the components is changed, or components different from those in FIG. 14. It is possible to carry out a modification in which For example, the ATA-USB bridge controller 70 may be modified to omit the configuration of the processing unit 150, USB I / F 80, device side I / F 160, and the like. In the electronic device 50, components other than those shown in FIG. 14 (for example, an operation unit, a display unit, a ROM, a RAM, an imaging unit, or a power source) may be added.

電子機器50は、メインCPU60と、ATA−USBブリッジコントローラ70とを含む。なお、ATA−USBブリッジコントローラ70を半導体集積回路として実現するようにしても良い。   The electronic device 50 includes a main CPU 60 and an ATA-USB bridge controller 70. The ATA-USB bridge controller 70 may be realized as a semiconductor integrated circuit.

メインCPU60は電子機器50の全体的な処理、制御を行う。このメインCPU60はATAのホスト側I/F(インターフェース)62を含む。なおホスト側I/F62は、モード設定によりCF+インタフェースからATAインターフェースに切り替わるCF+のインターフェース規格のものであってもよい。   The main CPU 60 performs overall processing and control of the electronic device 50. The main CPU 60 includes an ATA host-side I / F (interface) 62. The host-side I / F 62 may be of the CF + interface standard that switches from the CF + interface to the ATA interface by mode setting.

ATA−USBブリッジコントローラ70は、ATA(IDE)のデバイス側I/F160を含む。またUSBI/F80や転送コントローラ100や処理部150やGPI(入力)回路170(広義には情報入力部)を含むことができる。   The ATA-USB bridge controller 70 includes an ATA (IDE) device-side I / F 160. Further, it can include a USB I / F 80, a transfer controller 100, a processing unit 150, and a GPI (input) circuit 170 (information input unit in a broad sense).

ここでデバイス側I/F160は、ATABUS1を介してメインCPU60(ATAホスト)との間でデータ転送(通信)を行うためのインターフェースである。なお本実施形態におけるATAは、ATAPI(AT Attachment with Packet Interface)を含むことができる。また、シリアルATAやCE−ATAなどの従来のATA規格を発展した規格を含むこともできる。またATA−USBブリッジコントローラ70に、ATAのホスト側I/Fを設けてもよい。   Here, the device-side I / F 160 is an interface for performing data transfer (communication) with the main CPU 60 (ATA host) via the ATABUS1. The ATA in this embodiment can include ATAPI (AT Attachment with Packet Interface). In addition, it is possible to include standards developed from conventional ATA standards such as serial ATA and CE-ATA. The ATA-USB bridge controller 70 may be provided with an ATA host-side I / F.

デバイス側I/F160はレジスタ162を含む。このレジスタ162には、ATABUS1を介してメインCPU60が発行したコマンドが書き込まれる。具体的には、このレジスタ162として、ATAのデバイス側I/Fが含むタスクレジスタを使用できる。そして本実施形態では、ATAのコマンドのうちベンダ定義コマンド(Vender specific command)として割り当てられたコマンドが、レジスタ162(タスクレジスタ)に書き込まれる。転送コントローラ100、処理部150は、このベンダ定義コマンドに基づいて動作することができる。例えば転送コントローラ100は、レジスタ162に設定されたベンダ定義の転送制御コマンド(転送方向や転送データ量を指定するコマンド)に基づいて、デバイス側I/F160、USBI/F80間のデータ転送方向を決定する。また転送コントローラ100は、インターフェース間で転送するデータ量を決定する。   The device side I / F 160 includes a register 162. A command issued by the main CPU 60 via the ATABUS 1 is written in the register 162. Specifically, a task register included in the device side I / F of the ATA can be used as the register 162. In this embodiment, a command assigned as a vendor definition command (Vender specific command) among ATA commands is written to the register 162 (task register). The transfer controller 100 and the processing unit 150 can operate based on the vendor definition command. For example, the transfer controller 100 determines the data transfer direction between the device-side I / F 160 and the USB I / F 80 based on a vendor-defined transfer control command (command for specifying the transfer direction and transfer data amount) set in the register 162. To do. The transfer controller 100 also determines the amount of data to be transferred between the interfaces.

GPI回路170は、外部から信号を入力可能なGPI(入力)端子171、172を含んでいる。図14においては、GPI端子171は、プルアップ抵抗を介して電源電位VDDに接続されている。すなわち、GPI端子171には、Hレベルが入力されている。また、GPI端子172は、プルダウン抵抗を介して電源電位(接地電位)VSSに接続されている。すなわち、GPI端子172には、Lレベルが入力されている。   The GPI circuit 170 includes GPI (input) terminals 171 and 172 capable of inputting signals from the outside. In FIG. 14, the GPI terminal 171 is connected to the power supply potential VDD via a pull-up resistor. That is, the H level is input to the GPI terminal 171. The GPI terminal 172 is connected to a power supply potential (ground potential) VSS via a pull-down resistor. That is, the L level is input to the GPI terminal 172.

なお、ここでは、GPI回路170が2個のGPI端子171、172を含むこととしているが、1個又は3個以上のGPI端子を含んでも良い。また、GPI(入力)回路170に代えて、GPIO(入出力)回路を用いることとしても良い。また、ここでは、GPI端子171、172がプルアップ又はプルダウンされているが、出力レベルを可変とする出力回路からの出力信号がGPI端子171、172に入力されることとしても良い。   Although the GPI circuit 170 includes two GPI terminals 171 and 172 here, it may include one or three or more GPI terminals. Further, instead of the GPI (input) circuit 170, a GPIO (input / output) circuit may be used. In addition, although the GPI terminals 171 and 172 are pulled up or pulled down here, an output signal from an output circuit whose output level is variable may be input to the GPI terminals 171 and 172.

USBI/F80がホスト機能を有する場合には、USBにUSBデバイスを接続し、そのUSBデバイスとの間でデータ転送を行うようにしてもよい。   When the USB I / F 80 has a host function, a USB device may be connected to the USB, and data transfer may be performed between the USB device.

転送コントローラ100は、デバイス側I/F160、USBI/F80の間でのデータ転送を制御する。これにより、メインCPU60から転送されてきたデータをUSB機器10に書き込んだり、USB機器10に書き込まれたデータをメインCPU60に転送することが可能になる。   The transfer controller 100 controls data transfer between the device side I / F 160 and the USB I / F 80. As a result, the data transferred from the main CPU 60 can be written to the USB device 10, and the data written to the USB device 10 can be transferred to the main CPU 60.

処理部150は、ATA−USBブリッジコントローラ70の全体的な処理、制御を行ったり、ATA−USBブリッジコントローラ70が含む各回路ブロックの制御を行う。この処理部150の機能の一部又は全部は、例えばCPUとCPU上で動作するファームウェアにより実現することができる。なお、処理部150を専用のハードウェア回路により実現することもできる。   The processing unit 150 performs overall processing and control of the ATA-USB bridge controller 70 and controls each circuit block included in the ATA-USB bridge controller 70. A part or all of the functions of the processing unit 150 can be realized by, for example, a CPU and firmware operating on the CPU. The processing unit 150 can also be realized by a dedicated hardware circuit.

本実施形態においては、処理部150は、CPU151と、RAM152と、ROM153を含む。ROM153には、OS(オペレーティングシステム)、メインタスク、ATAデバイス側I/Fドライバ、API、ICコモンファンクションドライバ、USBホストクラスドライバ、USBホストスタック、GPI回路ドライバ等のプログラムやパラメータテーブルが記憶されている。なお、ROM153は、EEPROM等であっても良い。   In the present embodiment, the processing unit 150 includes a CPU 151, a RAM 152, and a ROM 153. The ROM 153 stores an OS (operating system), main task, ATA device side I / F driver, API, IC common function driver, USB host class driver, USB host stack, GPI circuit driver, and other programs and parameter tables. Yes. The ROM 153 may be an EEPROM or the like.

なお処理部150をATA−USBブリッジコントローラ70に内蔵させず、メインCPU60との間のインターフェース処理を行うCPUI/Fを設けるようにしてもよい。この場合には、ATA−USBブリッジコントローラ70やATA−USBブリッジコントローラ70が含む各回路ブロックの制御は、CPUI/Fを介してメインCPU60が行うことになる。   The processing unit 150 may not be built in the ATA-USB bridge controller 70, and a CPU I / F that performs interface processing with the main CPU 60 may be provided. In this case, the main CPU 60 controls the circuit blocks included in the ATA-USB bridge controller 70 and the ATA-USB bridge controller 70 via the CPU I / F.

また処理部150を動作させるためのプログラムは、メインCPU60側のメモリ(EEPROM等)に記憶しておき、電源投入後にメインCPU60がダウンロードコマンドを発行し、ATABUS1を介してATA−USBブリッジコントローラ70(ATA−USBブリッジコントローラが有するメモリ)にダウンロードするようにしてもよい。   A program for operating the processing unit 150 is stored in a memory (EEPROM or the like) on the main CPU 60 side. After the power is turned on, the main CPU 60 issues a download command, and the ATA-USB bridge controller 70 ( You may make it download to the memory which an ATA-USB bridge controller has.

CPU151は、RAM152を作業領域として利用しながら、ROM153に記憶されているプログラムを実行する。   The CPU 151 executes a program stored in the ROM 153 while using the RAM 152 as a work area.

図15に、CPU151がROM153に記憶されているプログラムを実行することにより実現される機能ブロックを示す。   FIG. 15 shows functional blocks realized by the CPU 151 executing a program stored in the ROM 153.

OSブロックは、CPU151がROM153に記憶されているOSプログラムを実行することにより実現され、ROM153内の他のプログラムを動作させるためのオペレーティングシステムブロックであり、タスクの生成や管理、他のソフトウェアブロックに対するサービスコールを提供する。   The OS block is realized by the CPU 151 executing the OS program stored in the ROM 153, and is an operating system block for operating other programs in the ROM 153. The OS block is used for task generation and management, and for other software blocks. Provide service calls.

ATAデバイス側I/Fドライバブロックは、CPU151がROM153に記憶されているATAデバイス側I/Fドライバプログラムを実行することにより実現されるブロックであり、ATAデバイス側I/F160のハードウェアを制御し、メインCPU60のATAホスト側I/F62からATAデバイス側I/F160のレジスタ162(タスクレジスタ)に書き込まれたコマンドをATA/ATAPIプロトコルに則って処理するドライバブロックである。   The ATA device side I / F driver block is a block realized by the CPU 151 executing the ATA device side I / F driver program stored in the ROM 153, and controls the hardware of the ATA device side I / F 160. This is a driver block that processes commands written from the ATA host-side I / F 62 of the main CPU 60 to the register 162 (task register) of the ATA device-side I / F 160 in accordance with the ATA / ATAPI protocol.

メインタスクブロックは、CPU151がROM153に記憶されているメインタスクプログラムを実行することにより実現され、他のソフトウェアブロックを統括するブロックであり、メインCPU60がデバイス側I/F160のレジスタ162(タスクレジスタ)に設定したコマンドを解析し、APIブロックの適切な関数を呼び出してATA−USBブリッジコントローラ70の機能を実現するソフトウェアブロックである。   The main task block is realized by the CPU 151 executing the main task program stored in the ROM 153 and controls other software blocks. The main CPU 60 registers the device 162 I / F 160 in the register 162 (task register). Is a software block that analyzes the command set to, and calls an appropriate function of the API block to realize the function of the ATA-USB bridge controller.

APIブロックは、CPU151がROM153に記憶されているAPIプログラムを実行することにより実現されるブロックであり、ATA−USBブリッジコントローラ70のハードウェアとファームウェアが有する機能をメインタスクブロックに対して関数形式で提供するソフトウェアブロックである。   The API block is a block realized by the CPU 151 executing the API program stored in the ROM 153, and the functions of the hardware and firmware of the ATA-USB bridge controller 70 are expressed in a function format with respect to the main task block. Software block to be provided.

ICコモンファンクションブロックは、CPU151がROM153に記憶されているICコモンファンクションプログラムを実行することにより実現されるブロックであり、ATA−USBブリッジコントローラ70の初期設定および、パワーマネージメント機能等、ATA−USBブリッジコントローラ70自体の設定や制御を行うソフトウェアブロックである。   The IC common function block is a block realized by the CPU 151 executing an IC common function program stored in the ROM 153. The ATA-USB bridge includes initial settings of the ATA-USB bridge controller 70, a power management function, and the like. It is a software block for setting and controlling the controller 70 itself.

USBホストクラスドライバブロックは、CPU151がROM153に記憶されているUSBホストクラスドライバプログラムを実行することにより実現されるブロックであり、USBホストスタックの上位プロトコルを処理するソフトウェアブロックであり、USB規格のHIDクラス、マスストレージクラス、オーディオクラス、ビデオクラス、プリンタクラス、通信デバイスクラス、ピクチャ転送プロトコルクラス等に対応するクラスドライバのブロックである。   The USB host class driver block is a block realized by the CPU 151 executing a USB host class driver program stored in the ROM 153. The USB host class driver block is a software block that processes the upper protocol of the USB host stack. Class driver blocks corresponding to classes, mass storage classes, audio classes, video classes, printer classes, communication device classes, picture transfer protocol classes, and the like.

USBホストスタックブロックは、CPU151がROM153に記憶されているUSBホストスタックプログラムを実行することにより実現されるブロックであり、USBI/F80を制御し、USB機器10の接続/切断処理、パワーマネージメント、エンドポイント毎の転送処理を行うソフトウェアブロックである。   The USB host stack block is a block realized by the CPU 151 executing the USB host stack program stored in the ROM 153. The USB host stack block controls the USB I / F 80, connects / disconnects the USB device 10, performs power management, and ends. It is a software block that performs transfer processing for each point.

GPI回路ドライバブロックは、CPU151がROM153に記憶されているGPI回路ドライバプログラムを実行することにより実現されるブロックであり、GPI回路170のハードウェアを制御し、GPI回路170のGPI端子171、172に供給される値(Hレベル又はLレベル)を読み取ってメインタスクブロックに出力する等のGPI回路170を制御する機能を提供するドライバブロックである。   The GPI circuit driver block is a block that is realized by the CPU 151 executing a GPI circuit driver program stored in the ROM 153, controls the hardware of the GPI circuit 170, and is connected to the GPI terminals 171 and 172 of the GPI circuit 170. This is a driver block that provides a function of controlling the GPI circuit 170 such as reading a supplied value (H level or L level) and outputting it to the main task block.

また、ROM153には、例えば図10(a)〜(c)に示すような複数のパラメータテーブルが記憶されている。後で説明するように、ATA−USBブリッジコントローラ70は、GPI回路170に外部から入力される信号に基づいて、ROM153に記憶されている複数のパラメータテーブルの中の1つを選択して、利用する。   Further, the ROM 153 stores a plurality of parameter tables as shown in FIGS. 10A to 10C, for example. As will be described later, the ATA-USB bridge controller 70 selects and uses one of a plurality of parameter tables stored in the ROM 153 based on a signal input to the GPI circuit 170 from the outside. To do.

3.2 ATAのデバイス側I/F
図16にATAのデバイス側I/F160の構成例を示す。図16に示すようにデバイス側I/F160は、タスクレジスタ200、MDMA/PIO制御部202、UltraDMA制御部204、データバッファ206、転送制御部208を含む。
3.2 Device side I / F of ATA
FIG. 16 shows a configuration example of the ATA device-side I / F 160. As shown in FIG. 16, the device-side I / F 160 includes a task register 200, an MDMA / PIO control unit 202, an UltraDMA control unit 204, a data buffer 206, and a transfer control unit 208.

タスクレジスタ200は、ATA(IDE)で規格化されているレジスタであり、コマンドブロックレジスタや、コントロールブロックレジスタを含む。ここでコマンドブロックレジスタは、コマンドを発行したりステータスを読み込むのに使用されるレジスタである。またコントロールブロックレジスタは、デバイスをコントロールしたり、代替えステータスを読み込むのに使用されるレジスタである。   The task register 200 is a register standardized by ATA (IDE), and includes a command block register and a control block register. Here, the command block register is a register used to issue a command or read a status. The control block register is a register used for controlling the device and reading the substitute status.

図17にタスクレジスタ200のレジスタ構成を示す。図17は、チップセレクト信号CS1、CS0(#は負論理を示す)が、各々、H、Lレベルの場合にアドレス選択されるコマンドブロックレジスタを示している。図17において、チップセレクト信号CS1、CS0、アドレス信号DA2、DA1、DA0が、各々、H、L、H、H、Hレベルであり、ホストによるレジスタライトの場合には、A1に示すCommandレジスタにアクセスされ、ホストによるレジスタリードの場合には、A1に示すStatusレジスタにアクセスされる。   FIG. 17 shows a register configuration of the task register 200. FIG. 17 shows a command block register that is selected when the chip select signals CS1 and CS0 (# indicates negative logic) are at the H and L levels, respectively. In FIG. 17, chip select signals CS1 and CS0 and address signals DA2, DA1, and DA0 are at H, L, H, H, and H levels, respectively. In the case of register write by the host, the command register indicated by A1 is set. In the case of a register read by the host, the status register indicated by A1 is accessed.

MDMA/PIO制御部202は、ATAのマルチワードDMA転送やPIO転送についてのデバイス側の制御処理を行う。UltraDMA制御部204は、ATAのUltraDMA転送についてのデバイス側の制御処理を行う。データバッファ206(FIFO)は、データ転送の転送レートの差を調整(緩衝)するためのバッファである。転送制御部208は後段の回路(転送コントローラ100、データバッファ102)との間のデータ転送を制御する。   The MDMA / PIO control unit 202 performs device-side control processing for ATA multiword DMA transfer and PIO transfer. The UltraDMA control unit 204 performs device-side control processing for ATA UltraDMA transfer. The data buffer 206 (FIFO) is a buffer for adjusting (buffering) the difference in transfer rate of data transfer. The transfer control unit 208 controls data transfer with the subsequent circuit (transfer controller 100, data buffer 102).

次に、ATAのデータ転送について図18(A)〜図19(B)の信号波形を用いて説明する。図18(A)〜図19(B)においてCS[1:0]は、ATAの各レジスタにアクセスするために使用するチップセレクト信号である。DA[2:0]は、データ又はデータポートにアクセスするためのアドレス信号である。DMARQ、DMACKは、DMA転送に使用される信号である。データ転送の準備が整った時にデバイス側がDMARQをアクティブ(アサート)にし、これに応答して、ホスト側がDMACKをアクティブにする。   Next, ATA data transfer will be described with reference to the signal waveforms in FIGS. 18 (A) to 19 (B). In FIGS. 18A to 19B, CS [1: 0] is a chip select signal used to access each register of the ATA. DA [2: 0] is an address signal for accessing data or a data port. DMARQ and DMACK are signals used for DMA transfer. When the device is ready for data transfer, the device side activates (asserts) DMARQ, and in response, the host side activates DMACK.

DIOW(STOP)は、レジスタ又はデータポートの書き込み時に使用するライト信号である。なお、UrtraDMA転送中はSTOP信号として機能する。DIOR(HDMARDY、HSTROBE)は、レジスタ又はデータポートの読み出し時に使用するリード信号である。なお、UrtraDMA転送中はHDMARDY、HSTROBE信号として機能する。IORDY(DDMARDY、DSTROBE)は、デバイス側のデータ転送の準備が整っていない時のウェイト信号等に使用される。なお、UrtraDMA転送中はDDMARDY、DSTROBE信号として機能する。   DIOW (STOP) is a write signal used when writing to a register or a data port. Note that it functions as a STOP signal during UltraDMA transfer. DIOR (HDMARDY, HSTROBE) is a read signal used when reading a register or a data port. During UltraDMA transfer, it functions as an HDMARDY and HSTROBE signal. IORDY (DDARDY, DSTROBE) is used as a wait signal when the device side is not ready for data transfer. During UltraDMA transfer, it functions as a DDMRDY and DSTROBE signal.

INTRQは、デバイス側が、ホスト側に対して割り込みを要求するために使用される信号である。このINTRQがアクティブになった後、ホスト側がデバイス側のタスクレジスタのステータスレジスタの内容を読むと、所定時間後にデバイス側はINTRQを非アクティブ(ネゲート)にする。このINTRQを用いることで、デバイス側は、コマンド処理の終了をホスト側に通知できる。   INTRQ is a signal used by the device side to request an interrupt from the host side. After the INTRQ becomes active, when the host reads the contents of the status register of the task register on the device side, the device side makes INTRQ inactive (negate) after a predetermined time. By using this INTRQ, the device side can notify the host side of the end of command processing.

図18(A)、(B)は、PIO(Parallel I/O)リード、PIOライト時の信号波形例である。ATAのステータスレジスタのリードは図18(A)のPIOリードにより行い、コマンドレジスタへのライトは図18(B)のPIOライトにより行う。例えば、メインCPU30によるベンダ定義のコマンドの発行は、PIOライトにより実現できる。   18A and 18B are signal waveform examples at the time of PIO (Parallel I / O) read and PIO write. Reading of the ATA status register is performed by PIO reading of FIG. 18A, and writing to the command register is performed by PIO writing of FIG. 18B. For example, the issue of a vendor-defined command by the main CPU 30 can be realized by PIO write.

図19(A)、(B)は、DMAリード、DMAライト時の信号波形例である。データ転送の準備ができると、デバイス側が、DMARQをアクティブにする。そして、それを受けて、ホスト側が、DMACKをアクティブにして、DMA転送を開始する。その後、DIOR(リード時)又はDIOW(ライト時)を使用して、データDD[15:0]のDMA転送を行う。   FIGS. 19A and 19B are signal waveform examples during DMA read and DMA write. When ready for data transfer, the device activates DMARQ. In response to this, the host side activates DMACK and starts DMA transfer. Thereafter, DMA transfer of the data DD [15: 0] is performed using DIOR (during reading) or DIOW (during writing).

3.3 動作
次に、本実施形態の動作について説明する。本実施形態のATA−USBブリッジコントローラ70においてはUSBデバイスを制御するためにUSB規格で規定されている時間(規格値)に固定することなく、メインCPU30からの指示に応じて、USB装置10の制御に関する時間を変更することとしている。
3.3 Operation Next, the operation of the present embodiment will be described. In the ATA-USB bridge controller 70 according to the present embodiment, the time of the USB device 10 is controlled according to an instruction from the main CPU 30 without fixing the time (standard value) defined in the USB standard for controlling the USB device. The time related to control is to be changed.

3.3.1 初期時における動作
まず、初期時(パワーオン時、リセット時等)におけるATA−USBブリッジコントローラ70の動作について説明する。
3.3.1 Operation at Initial Time First, the operation of the ATA-USB bridge controller 70 at the initial time (power-on, reset, etc.) will be described.

図20は、初期時におけるATA−USBブリッジコントローラ70の動作を示すフローチャートである。
まず、ATA−USBブリッジコントローラ70のメインタスクブロックが、GPI回路ドライバブロックをコールする(ステップS101)。
FIG. 20 is a flowchart showing the operation of the ATA-USB bridge controller 70 at the initial time.
First, the main task block of the ATA-USB bridge controller 70 calls the GPI circuit driver block (step S101).

GPI回路ドライバブロックは、GPI端子171、172に入力されている信号を検出し、検出した信号に基づく値を戻り値としてメインタスクブロックに返却する(ステップS111)。例えば、図14において、GPI回路170は、2個のGPI端子171、172を含んでいるので、2ビットの入力を外部から受け付けることが可能である。そして、図14において、GPI端子171にはHレベルが、GPI端子172にはLレベルがそれぞれ入力されているので、GPI回路ドライバは、「0b10」(或いは「0b01」としても良い。)という2ビットの戻り値をメインタスクブロックに返却する。   The GPI circuit driver block detects signals input to the GPI terminals 171 and 172, and returns a value based on the detected signals to the main task block as a return value (step S111). For example, in FIG. 14, since the GPI circuit 170 includes two GPI terminals 171 and 172, it is possible to accept a 2-bit input from the outside. In FIG. 14, since the H level is input to the GPI terminal 171 and the L level is input to the GPI terminal 172, the GPI circuit driver may be “0b10” (or “0b01”). Return the bit return value to the main task block.

次に、メインタスクブロックは、GPI回路ドライバブロックからの戻り値を引数としてAPIブロックをコールする(ステップS102)。   Next, the main task block calls the API block with the return value from the GPI circuit driver block as an argument (step S102).

APIブロックは、メインタスクブロックからの引数を引数として、USBホストスタックブロック内の時間変更関数をコールする(ステップS121)。   The API block calls the time change function in the USB host stack block using the argument from the main task block as an argument (step S121).

USBホストスタックブロックの時間変更関数は、ROM153に記憶されている複数のパラメータテーブルの中のAPIブロックからの引数に応じた1つのパラメータテーブルを選択する(ステップS131)。なお、このとき、USBホストスタックブロックの時間変更関数が、選択したパラメータテーブルをROM153からRAM152に転送し、USB機器10が接続された場合(後述)等において、RAM152に転送されたパラメータテーブルを参照して使用するようにしても良い。   The time change function of the USB host stack block selects one parameter table corresponding to the argument from the API block among the plurality of parameter tables stored in the ROM 153 (step S131). At this time, the time change function of the USB host stack block transfers the selected parameter table from the ROM 153 to the RAM 152, and refers to the parameter table transferred to the RAM 152 when the USB device 10 is connected (described later). And may be used.

3.3.2 USBホストとUSBデバイスが接続された場合における動作
USB機器10が接続された場合におけるATA−USBブリッジコントローラ70の動作は、先に説明したUSBホストコントローラ40の動作(図11及び図12のフローチャート参照)と同様である。
3.3.2 Operation when USB Host and USB Device are Connected The operation of the ATA-USB bridge controller 70 when the USB device 10 is connected is the operation of the USB host controller 40 described above (see FIG. 11 and FIG. 11). This is the same as the flowchart shown in FIG.

3.3.3 USBデバイスをレジュームさせる場合における動作
サスペンド状態にあるUSB機器10をレジュームさせる場合におけるATA−USBブリッジコントローラ70の動作は、先に説明したUSBホストコントローラ40の動作(図13のフローチャート参照)と同様である。
3.3.3 Operation when resuming USB device The operation of the ATA-USB bridge controller 70 when resuming the suspended USB device 10 is the same as the operation of the USB host controller 40 described above (the flowchart of FIG. 13). See).

以上説明したように、本実施形態によれば、USBデバイスを制御するためにUSB規格で規定されている時間(規格値)に固定することなく、外部から入力される信号に応じて、USB装置10の制御に関する時間を変更することができる。これにより、ATA−USBブリッジコントローラ70がUSB機器10を正常に認識できない又はUSB機器10が正常に動作しないことを防止することが可能になる。また、USB機器10がレジューム機能を有しない、いわば規格違反とも言えるUSBデバイス装置であっても、ATA−USBホストコントローラ70及び/又はUSB機器10がフリーズしてしまうことを防止することが可能になる。   As described above, according to the present embodiment, the USB device is controlled according to a signal input from the outside without being fixed to the time (standard value) defined in the USB standard for controlling the USB device. The time for 10 controls can be changed. As a result, it is possible to prevent the ATA-USB bridge controller 70 from recognizing the USB device 10 normally or from malfunctioning. In addition, even if the USB device 10 does not have a resume function and is a USB device device that can be said to be in violation of the standard, it is possible to prevent the ATA-USB host controller 70 and / or the USB device 10 from freezing. Become.

なお、本実施形態において、メインCPU60が、変更対象である時間を特定する情報(時間を表す名称(TATTDB、TDRST等)等であっても良い)及び/又は時間値をデバイス側I/F160のレジスタ162(タスクレジスタ)に設定し、ATA−USBブリッジコントローラ70が、レジスタ162(タスクレジスタ)に設定された時間値を用いてUSB装置10の制御に関する時間を変更するようにしても良い。 In the present embodiment, the main CPU 60 uses the device side I / O to specify information (may be a name indicating time (T ATTDB , T DRST, etc.)) and / or a time value for specifying the time to be changed. It may be set in the register 162 (task register) of F160, and the ATA-USB bridge controller 70 may change the time related to the control of the USB device 10 using the time value set in the register 162 (task register). .

また、先に説明した第1の実施形態において、USBホストコントローラ70が、GPI回路170を含み、USBコントローラ70の処理部120が、GPI回路170に外部から入力される信号に基づいて、USB装置10の制御に関する時間を変更するようにしても良い。   In the first embodiment described above, the USB host controller 70 includes the GPI circuit 170, and the processing unit 120 of the USB controller 70 is connected to the USB device based on a signal input from the outside to the GPI circuit 170. You may make it change the time regarding 10 control.

なお、上記のように本実施形態について詳細に説明したが、本発明の新規事項および効果から実体的に逸脱しない多くの変形が可能であることは当業者には容易に理解できるであろう。従って、このような変形例はすべて本発明の範囲に含まれるものとする。例えば、明細書又は図面において、少なくとも一度、より広義または同義な異なる用語と共に記載された用語(コントローラ、メインCPU、ATAデバイス側I/F、USBI/F等)は、明細書又は図面のいかなる箇所においても、その異なる用語に置き換えることができる。またコントローラや電子機器の構成、動作も本実施形態で説明したものに限定に限定されず、種々の変形実施が可能である。例えばATAバスは、シリアルATAやCE−ATAのバスであってもよい。   Although the present embodiment has been described in detail as described above, it will be easily understood by those skilled in the art that many modifications can be made without departing from the novel matters and effects of the present invention. Accordingly, all such modifications are intended to be included in the scope of the present invention. For example, in the specification or drawings, terms (controller, main CPU, ATA device side I / F, USB I / F, etc.) described at least once together with different terms having a broader meaning or the same meaning may be used anywhere in the specification or drawings. Can also be replaced by the different terms. Further, the configuration and operation of the controller and the electronic device are not limited to those described in this embodiment, and various modifications can be made. For example, the ATA bus may be a serial ATA or CE-ATA bus.

USBホストとUSBデバイスが接続された場合のUSBの波形図。FIG. 6 is a waveform diagram of USB when a USB host and a USB device are connected. USBホストとUSBデバイスが接続された場合のUSBの波形図。FIG. 6 is a waveform diagram of USB when a USB host and a USB device are connected. USBの規格値と市販のUSBデバイスの実測値。USB standard values and measured values of commercially available USB devices. 第1の実施形態のUSBコントローラ、電子機器の構成例。1 is a configuration example of a USB controller and an electronic device according to a first embodiment. 処理部の機能ブロックの説明図。Explanatory drawing of the functional block of a process part. 図6(A)〜(D)はUSBのデータ転送の説明図。6A to 6D are explanatory diagrams of USB data transfer. 図7(A)(B)はバルクオンリートランスポートの説明図。7A and 7B are explanatory diagrams of bulk-only transport. USBI/Fの構成例。2 shows a configuration example of a USB I / F. 第1の実施形態のフローチャート。The flowchart of 1st Embodiment. USBデバイスの制御に関する時間値の設定例の説明図。Explanatory drawing of the example of a setting of the time value regarding control of a USB device. 第1の実施形態のフローチャート。The flowchart of 1st Embodiment. 第1の実施形態のフローチャート。The flowchart of 1st Embodiment. 第1の実施形態のフローチャート。The flowchart of 1st Embodiment. 第2の実施形態のUSBコントローラ、電子機器の構成例。6 is a configuration example of a USB controller and an electronic device according to a second embodiment. 処理部の機能ブロックの説明図。Explanatory drawing of the functional block of a process part. ATAのデバイス側I/Fの構成例。6 is a configuration example of an ATA device-side I / F. ATAのタスクレジスタの説明図。Explanatory drawing of the task register of ATA. 図18(A)(B)はATAのPIO転送の信号波形例。FIGS. 18A and 18B show signal waveform examples of ATA PIO transfer. 図19(A)(B)はATAのDMA転送の信号波形例。19A and 19B are signal waveform examples of ATA DMA transfer. 第2の実施形態のフローチャート。The flowchart of 2nd Embodiment.

符号の説明Explanation of symbols

ATABUS1 ATAバス、
10 USB機器、20、50 電子機器、30、60 メインCPU、
40 USBホストコントローラ、62 ATAのホスト側I/F、
70 ATA−USBブリッジコントローラ、80 USBI/F、
100 転送コントローラ、102 データバッファ、120、150 処理部、
121、151 CPU、122、152 RAM、123、153 ROM、
130 レジスタ、140 DMA処理部、160 ATAのデバイス側I/F、
162 ATAのタスクレジスタ、170 GPI回路、171、172 GPI端子
ATABUS1 ATA bus,
10 USB device, 20, 50 Electronic device, 30, 60 Main CPU,
40 USB host controller, 62 ATA host side I / F,
70 ATA-USB bridge controller, 80 USB I / F,
100 transfer controller, 102 data buffer, 120, 150 processing unit,
121, 151 CPU, 122, 152 RAM, 123, 153 ROM,
130 registers, 140 DMA processor, 160 ATA device side I / F,
162 ATA task register, 170 GPI circuit, 171, 172 GPI terminal

Claims (11)

USB(Universal Serial Bus)を介してUSBデバイスと通信を行うためのコントローラが前記USBデバイスを制御するために実行する方法であって、
前記USBデバイスの制御に関する少なくとも1つの時間を決定するための情報の入力を外部から受け、前記情報に基づいて前記少なくとも1つの時間を決定し、決定した前記少なくとも1つの時間に応じたタイミングでUSBに信号又はデータを出力することにより前記USBデバイスの制御を行う、USBデバイスの制御方法。
A method executed by a controller for communicating with a USB device via a USB (Universal Serial Bus) to control the USB device,
Information input for determining at least one time relating to the control of the USB device is received from the outside, the at least one time is determined based on the information, and the USB at a timing according to the determined at least one time A USB device control method for controlling the USB device by outputting a signal or data to the USB device.
USB(Universal Serial Bus)を介してUSBデバイスと通信を行うためのコントローラであって、
前記USBデバイスの制御に関する少なくとも1つの時間を決定するための情報を前記コントローラの外部から入力されることが可能な情報入力部と、
前記情報入力部に入力された前記情報に基づいて前記少なくとも1つの時間を決定する処理部と、
USBを介して前記USBデバイスに接続され、前記処理部によって決定された前記少なくとも1つの時間に応じたタイミングでUSBに信号又はデータを出力するUSBインタフェース部と、
を含む、コントローラ。
A controller for communicating with a USB device via a USB (Universal Serial Bus),
An information input unit capable of inputting information for determining at least one time relating to control of the USB device from the outside of the controller;
A processing unit that determines the at least one time based on the information input to the information input unit;
A USB interface unit connected to the USB device via USB and outputting a signal or data to the USB at a timing according to the at least one time determined by the processing unit;
Including the controller.
請求項2において、
前記処理部が、
前記USBインタフェース部を制御するドライバプログラムを実行するCPUコアを含み、前記CPUコアが、前記情報入力部に入力された前記情報に基づいて前記少なくとも1つの時間を決定するプログラムを実行する、コントローラ。
In claim 2,
The processing unit is
A controller including a CPU core that executes a driver program for controlling the USB interface unit, wherein the CPU core executes a program that determines the at least one time based on the information input to the information input unit.
請求項2又は3において、
前記情報入力部が、
前記コントローラの設定及び/又は制御に関する情報を外部から書き込むためのレジスタを含み、
前記少なくとも1つの時間を決定するための少なくとも1つのデータが前記レジスタに外部から書き込まれ、
前記処理部が、
前記レジスタに書き込まれた前記少なくとも1つのデータに基づいて前記少なくとも1つの時間を決定する、コントローラ。
In claim 2 or 3,
The information input unit is
A register for externally writing information relating to setting and / or control of the controller;
At least one data for determining the at least one time is externally written to the register;
The processing unit is
A controller that determines the at least one time based on the at least one data written to the register.
請求項4において、
前記レジスタに前記少なくとも1つの時間を表す少なくとも1つの値が書き込まれ、
前記処理部が、
前記少なくとも1つの値によって表される時間を前記少なくとも1つの時間として決定する、コントローラ。
In claim 4,
At least one value representing the at least one time is written to the register;
The processing unit is
A controller that determines the time represented by the at least one value as the at least one time.
請求項4において、
前記少なくとも1つの時間を表す少なくとも1つの値をそれぞれ含む複数のテーブルを記憶する記憶部を更に含み、
前記レジスタに前記複数のテーブルのいずれかを特定するデータが書き込まれ、
前記処理部が、
前記複数のテーブルの内の前記データによって特定されるテーブルに含まれている前記少なくとも1つの値によって表される時間を前記少なくとも1つの時間として決定する、コントローラ。
In claim 4,
A storage unit that stores a plurality of tables each including at least one value representing the at least one time;
Data specifying any of the plurality of tables is written to the register,
The processing unit is
A controller that determines, as the at least one time, a time represented by the at least one value included in a table specified by the data of the plurality of tables.
請求項2又は3において、
前記情報入力部が、
前記少なくとも1つの時間を決定するための少なくとも1つの信号を外部から入力することが可能な信号入力回路を含み、
前記処理部が、
前記信号入力回路に入力された前記少なくとも1つの信号に基づいて前記少なくとも1つの時間を決定する、コントローラ。
In claim 2 or 3,
The information input unit is
A signal input circuit capable of inputting at least one signal for determining the at least one time from the outside;
The processing unit is
A controller that determines the at least one time based on the at least one signal input to the signal input circuit.
請求項7において、
前記少なくとも1つの時間を表す少なくとも1つの値をそれぞれ含む複数のテーブルを記憶する記憶部を更に含み、
前記信号入力回路に前記複数のテーブルのいずれかを特定する前記少なくとも1つの信号が入力され、
前記処理部が、
前記複数のテーブルの内の前記少なくとも1つの信号によって特定されるテーブルに含まれている前記少なくとも1つの値によって表される時間を前記少なくとも1つの時間として決定する、コントローラ。
In claim 7,
A storage unit for storing a plurality of tables each including at least one value representing the at least one time;
The at least one signal specifying any of the plurality of tables is input to the signal input circuit;
The processing unit is
A controller for determining, as the at least one time, a time represented by the at least one value included in a table specified by the at least one signal of the plurality of tables;
請求項2乃至8のいずれかにおいて、
前記少なくとも1つの時間が、前記USBデバイスを初期化するための制御に関する時間及び/又は前記USBデバイスをレジュームさせる制御に関する時間を含む、コントローラ。
In any of claims 2 to 8,
The controller, wherein the at least one time includes a time related to control for initializing the USB device and / or a time related to control for resuming the USB device.
請求項2乃至9のいずれかにおいて、
前記少なくとも1つの時間が、定常的信号、周期的信号又はデータをUSBに出力し及び/又は出力を継続する時間、若しくは或る信号又はデータをUSBに出力してから次の信号又はデータをUSBに出力するまでの時間を含む、コントローラ。
In any one of Claims 2 thru | or 9.
The at least one time is a time for outputting a steady signal, a periodic signal or data to the USB and / or a time for continuing the output, or outputting a certain signal or data to the USB and then transferring the next signal or data to the USB. A controller that includes the time to output.
請求項1乃至10のいずれかに記載のコントローラと、
バスを介して前記コントローラに接続されるホストCPUと、
を含むことを特徴とする電子機器。
A controller according to any one of claims 1 to 10;
A host CPU connected to the controller via a bus;
An electronic device comprising:
JP2007214491A 2007-08-21 2007-08-21 Control method of usb device, controller and electronic equipment Withdrawn JP2009048444A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007214491A JP2009048444A (en) 2007-08-21 2007-08-21 Control method of usb device, controller and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007214491A JP2009048444A (en) 2007-08-21 2007-08-21 Control method of usb device, controller and electronic equipment

Publications (1)

Publication Number Publication Date
JP2009048444A true JP2009048444A (en) 2009-03-05

Family

ID=40500587

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007214491A Withdrawn JP2009048444A (en) 2007-08-21 2007-08-21 Control method of usb device, controller and electronic equipment

Country Status (1)

Country Link
JP (1) JP2009048444A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011198226A (en) * 2010-03-23 2011-10-06 Hitachi Ltd Recording device, backup recording control method and program
JP2014006725A (en) * 2012-06-25 2014-01-16 Ricoh Co Ltd Information processing device, information processing method, and program
JP2014006726A (en) * 2012-06-25 2014-01-16 Ricoh Co Ltd Controller, electronic apparatus, and control method of usb device
JP2016028521A (en) * 2012-12-27 2016-02-25 インテル・コーポレーション Execution of command within transport mechanism based on get and set architecture
CN113064804A (en) * 2021-03-30 2021-07-02 深圳市广和通无线股份有限公司 Statistical method, module and storage medium for memory equipment identification time

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001512870A (en) * 1997-08-12 2001-08-28 アトメル・コーポレイション Universal serial bus device controller

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001512870A (en) * 1997-08-12 2001-08-28 アトメル・コーポレイション Universal serial bus device controller

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011198226A (en) * 2010-03-23 2011-10-06 Hitachi Ltd Recording device, backup recording control method and program
JP2014006725A (en) * 2012-06-25 2014-01-16 Ricoh Co Ltd Information processing device, information processing method, and program
JP2014006726A (en) * 2012-06-25 2014-01-16 Ricoh Co Ltd Controller, electronic apparatus, and control method of usb device
US9098640B2 (en) 2012-06-25 2015-08-04 Ricoh Company, Ltd. Controller, electronic equipment unit, and USB device control method
JP2016028521A (en) * 2012-12-27 2016-02-25 インテル・コーポレーション Execution of command within transport mechanism based on get and set architecture
US9600296B2 (en) 2012-12-27 2017-03-21 Intel Corporation Executing a command within a transport mechanism based on a get and set architecture
CN113064804A (en) * 2021-03-30 2021-07-02 深圳市广和通无线股份有限公司 Statistical method, module and storage medium for memory equipment identification time
CN113064804B (en) * 2021-03-30 2022-12-16 深圳市广和通无线股份有限公司 Statistical method, module and storage medium for memory equipment identification time

Similar Documents

Publication Publication Date Title
KR101043842B1 (en) Physical device(phy) support of the usb2.0 link power management addendum using a ulpi phy interface standard
US7272676B2 (en) Data transmission controller that restarts data transmission when reconstruction is completed
US7028109B2 (en) Data transfer control device including buffer controller with plurality of pipe regions allocated to plurality of endpoints
US7739419B2 (en) Data transfer control device and electronic instrument
US20040073697A1 (en) Data transfer control device, electronic equipment, and data transfer control method
US7409471B2 (en) Data transfer control device for data transfer over a bus, electronic equipment and method for data transfer over a bus
JP2009048444A (en) Control method of usb device, controller and electronic equipment
JP2006215891A (en) Data transfer control unit and electronic apparatus
US7359996B2 (en) Data transfer control device, electronic equipment, and data transfer control method
JP4434218B2 (en) Data transfer control device and electronic device
US7469304B2 (en) Data transfer control device, electronic equipment, and method for a data transfer through a bus, the data transfer control device including a register and a packet buffer that are commonly used during a host operation and a peripheral operation
JP4404023B2 (en) Data transfer control device and electronic device
US7428600B2 (en) Data transfer control device, electronic equipment, and data transfer control method
JP2006227985A (en) Data transfer control device and electronic apparatus
JP2008242701A (en) Data transfer controller and electronic device
JP4442523B2 (en) Data transfer control device and electronic device
JP2009037479A (en) Data transfer control device and electronic device
JP2008204048A (en) Data transfer control device and electronic device
JP4337783B2 (en) Data transfer control device and electronic device
JP2008204049A (en) Data transfer control device and electronic device
JP2008204050A (en) Data transfer control device and electronic device
JP2008293154A (en) Data transfer control device and electronic device
JP2009032011A (en) Data transfer control device and electronic device
JP2009032010A (en) Data transfer control device and electronic device
JP2010093437A (en) Data transfer control device, and electronic equipment

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20100726

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120210

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120221

A761 Written withdrawal of application

Free format text: JAPANESE INTERMEDIATE CODE: A761

Effective date: 20120330