[go: up one dir, main page]

CN100351816C - Data transmission controller, electronic device and data transmission method - Google Patents

Data transmission controller, electronic device and data transmission method Download PDF

Info

Publication number
CN100351816C
CN100351816C CNB021193835A CN02119383A CN100351816C CN 100351816 C CN100351816 C CN 100351816C CN B021193835 A CNB021193835 A CN B021193835A CN 02119383 A CN02119383 A CN 02119383A CN 100351816 C CN100351816 C CN 100351816C
Authority
CN
China
Prior art keywords
information
data
storage area
bus
end points
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.)
Expired - Lifetime
Application number
CNB021193835A
Other languages
Chinese (zh)
Other versions
CN1385794A (en
Inventor
石田卓也
神原义幸
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
Publication of CN1385794A publication Critical patent/CN1385794A/en
Application granted granted Critical
Publication of CN100351816C publication Critical patent/CN100351816C/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • G06F13/385Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Systems (AREA)
  • Communication Control (AREA)

Abstract

在分配CBW和数据作为通过一个端点EP1传送的信息的情况下,设置准备有CBW区域12(可随机存取的命令存储区域)和EP1区域10(FIFO设定的数据存储区域)的缓冲器。然后,在从USB的命令阶段(命令传送)切换为数据阶段(数据传送)的情况下,将信息的读取区域从CBW区域12切换为EP1区域10,将从主机向端点EP1传送的OUT数据写入到EP1区域。以命令阶段中的确认返回到主机为条件,从CBW区域12切换为EP1区域10。在触发错误的情况下,即使ACK被返回,也不进行区域切换。

Figure 02119383

In the case of allocating CBW and data as information transmitted through one endpoint EP1, a buffer prepared with CBW area 12 (command storage area which can be accessed randomly) and EP1 area 10 (data storage area for FIFO setting) is provided. Then, when switching from the USB command stage (command transfer) to the data stage (data transfer), the information reading area is switched from the CBW area 12 to the EP1 area 10, and the OUT data transferred from the host to the endpoint EP1 Write to the EP1 area. Switching from the CBW area 12 to the EP1 area 10 is conditional on an acknowledgment in the command phase being returned to the host. In case of a trigger error, even if ACK is returned, zone switching is not performed.

Figure 02119383

Description

数据传送控制装置、电子装置和数据传送控制方法Data transmission control device, electronic device and data transmission control method

技术领域technical field

本发明涉及数据传送控制装置、电子装置和数据传送控制方法。The present invention relates to a data transmission control device, an electronic device and a data transmission control method.

背景技术Background technique

近年来,作为用于连接个人计算机和外围设备(广义上的电子装置)的阶段标准,USB(Universal Serial Bus;通用串行总线)引人注目。在该USB中,可以同时用相同标准的连接器来连接以往用各个标准的连接器连接的鼠标器、键盘和打印机等外围设备,具有可以实现所谓的即插即用或热插拔的优点。In recent years, USB (Universal Serial Bus; Universal Serial Bus) has attracted attention as a standard for connecting personal computers and peripheral devices (electronic devices in a broad sense). In this USB, peripheral devices such as a mouse, a keyboard, and a printer conventionally connected with connectors of each standard can be connected simultaneously with the same standard connector, and there is an advantage that so-called plug-and-play or hot swap can be realized.

另一方面,在该USB中,作为相同的串行总线阶段标准,与引人注目的IEEE1394相比,存在传送速度慢的问题。On the other hand, in this USB, as the standard of the same serial bus stage, there is a problem that the transmission speed is slower than that of IEEE1394, which is attracting attention.

因此,制定了具有相对于现有的USB1.1标准的互换性,同时与USB1.1相比,可以实现非常高速的480Mbps(HS模式)的数据传送速度的USB2.0标准,十分引人注目。Therefore, it is very attractive to formulate a USB2.0 standard that has interchangeability with respect to the existing USB1.1 standard, and can realize a very high-speed 480Mbps (HS mode) data transfer rate compared with USB1.1. Attention.

而且,在该USB2.0中,在HS(High Speed)模式时按480Mbps进行数据传送。因此,具有可以作为请求高速传送速度的硬盘驱动器或光盘等存储装置的阶段来使用的优点。Furthermore, in this USB2.0, data transfer is performed at 480 Mbps in HS (High Speed) mode. Therefore, there is an advantage that it can be used as a stage of a storage device such as a hard disk drive or an optical disk that requires a high transfer speed.

但是,在另一方面,连接到USB总线的数据传送控制装置必须处理以480Mbps这样的高速度传送的数据。因此,如果数据传送控制装置的处理速度、控制数据传送控制装置的固件(CPU)的处理速度慢,则不能确保有效的传送速度,存在会损失总线频带的课题。However, on the other hand, a data transfer control device connected to a USB bus must handle data transferred at a high speed of 480 Mbps. Therefore, if the processing speed of the data transfer control device and the processing speed of the firmware (CPU) controlling the data transfer control device are slow, an effective transfer speed cannot be ensured, and there is a problem that the bus bandwidth is lost.

发明内容Contents of the invention

本发明是鉴于以上的技术课题的发明,其目的在于,提供能够提高有效的总线传送速度的数据传送控制装置、电子装置、以及数据传送控制方法。The present invention was made in view of the above technical problems, and an object of the present invention is to provide a data transfer control device, an electronic device, and a data transfer control method capable of increasing an effective bus transfer rate.

为了解决上述课题,本发明是一种数据传送控制装置,用于通过总线的数据传送,它包括:缓冲器,在分配包含第1、第2信息的多种信息作为通过一个端点(end point)传送的信息的情况下,准备第1信息用的第1存储区域和第2信息用的第2存储区域来对应于一个端点;以及缓冲器管理电路,在通过总线传送第1信息的第1阶段中,将从主机向端点传送的信息写入到第1信息用的所述第1存储区域,而在通过总线传送第2信息的第2阶段中,将从主机向端点传送的信息写入到第2信息用的所述第2存储区域;In order to solve the above-mentioned problems, the present invention is a data transmission control device for data transmission through a bus, which includes: a buffer for distributing various information including the first and second information as a data transmission through an end point (end point) In the case of transmitted information, prepare the first storage area for the first information and the second storage area for the second information to correspond to one endpoint; and the buffer management circuit, in the first stage of transmitting the first information through the bus In the first storage area, the information transmitted from the host to the endpoint is written into the first storage area for the first information, and in the second stage of transmitting the second information through the bus, the information transmitted from the host to the endpoint is written into the the second storage area for the second information;

将为第1信息用而准备的所述第1存储区域设定于可进行信息的随机存取的区域;将为第2信息用而准备的所述第2存储区域设定于将前面输入的信息先输出的区域。The first storage area prepared for the first information is set in an area where information can be randomly accessed; the second storage area prepared for the second information is set in the previously input The area where information is output first.

根据本发明,在缓冲器中准备分配给所给与的端点的第1信息用的第1存储区域,以及分配给相同端点的第2信息用的第2存储区域。然后,在第1阶段(第1传输)中,将从主机向端点传送的信息写入到第1存储区域,在第2阶段(第2传输)中,将从主机向端点传送的信息写入到第2存储区域。例如,在从第1阶段切换为第2阶段的情况下,向端点的信息写入区域从第1存储区域切换为第2存储区域。According to the present invention, the first storage area for the first information allocated to the given endpoint and the second storage area for the second information allocated to the same endpoint are prepared in the buffer. Then, in the first phase (first transfer), the information transmitted from the host to the endpoint is written into the first storage area, and in the second phase (second transfer), the information transmitted from the host to the endpoint is written to the second storage area. For example, when switching from the first stage to the second stage, the information writing area to the endpoint is switched from the first storage area to the second storage area.

这样的话,即使在一个端点中分配多种信息的情况下,也可以对于写入到第1存储区域的信息进行处理,同时在第2存储区域中写入第2信息。因此,可以提高数据传送控制装置的处理速度,减轻处理第1信息的部件的负荷,可以提高有效的总线传送速度。In this way, even when multiple types of information are allocated to one endpoint, the information written in the first storage area can be processed while the second information can be written in the second storage area. Therefore, the processing speed of the data transfer control device can be increased, the load on the parts processing the first information can be reduced, and the effective bus transfer speed can be increased.

这样的话,可提高处理写入到第1存储区域的第1信息的部件的处理速度等。In this way, the processing speed of the means for processing the first information written in the first storage area can be improved.

此外,本发明可以在存储第1信息的所述第1存储区域的开头地址以外的区域中,写入指示传送第2信息的命令块和通过命令块指示传送的第2信息的长度信息的至少一个信息。In addition, in the present invention, at least one of the command block instructing the transfer of the second information and the length information of the second information instructed to be transferred by the command block is written in an area other than the head address of the first storage area storing the first information. a message.

即使在这样的情况下,根据本发明,也可以按随机存取来读出命令块和长度信息,可提高处理第1信息的部件的处理速度等。Even in such a case, according to the present invention, the command block and the length information can be read by random access, and the processing speed of the means for processing the first information can be improved.

此外,本发明是一种数据传送控制装置,用于通过总线的数据传送,它包括:缓冲器,在分配包含第1、第2信息的多种信息作为通过一个端点(end point)传送的信息的情况下,准备第1信息用的第1存储区域和第2信息用的第2存储区域来对应于一个端点;以及缓冲器管理电路,在通过总线传送第1信息的第1阶段中,将从主机向端点传送的信息写入到第1信息用的所述第1存储区域,而在通过总线传送第2信息的第2阶段中,将从主机向端点传送的信息写入到第2信息用的所述第2存储区域;In addition, the present invention is a data transmission control device for data transmission through a bus, which includes: a buffer for distributing various information including the first and second information as information transmitted through one endpoint (end point) In the case of , prepare the first storage area for the first information and the second storage area for the second information to correspond to one endpoint; and the buffer management circuit, in the first stage of transmitting the first information through the bus, will The information transmitted from the host to the endpoint is written in the first storage area for the first information, and in the second stage of transmitting the second information through the bus, the information transmitted from the host to the endpoint is written in the second information. said second storage area used;

能够以对于所述第1阶段的数据传送的确认被返回到主机为条件,将从主机向端点传送的信息的写入区域从所述第1存储区域切换为所述第2存储区域。The writing area of the information transferred from the host to the endpoint may be switched from the first storage area to the second storage area on condition that the acknowledgment of the data transfer in the first stage is returned to the host.

这样的话,可以用少的处理负荷来实现无差错的可靠的区域切换。In this way, error-free and reliable zone switching can be achieved with a small processing load.

此外,本发明可以在主机之间用于进行事务处理的排序同步的数据触发比特中产生差错的情况下,即使在确认被返回到主机的情况下,也不进行从所述第1存储区域向所述第2存储区域的切换。Furthermore, in the present invention, when an error occurs in the data trigger bit for sequence synchronization of transactions between the hosts, even when an acknowledgment is returned to the host, no transfer from the first storage area to the host is performed. Switching of the second storage area.

这样的话,即使在数据触发比特上产生差错的情况下(触发差错的情况),也可以实现合适的数据传送处理。In this way, even when an error occurs in the data trigger bit (trigger error), appropriate data transfer processing can be realized.

此外,本发明是一种数据传送控制装置,用于通过总线的数据传送,它包括:缓冲器,在分配包含第1、第2信息的多种信息作为通过一个端点(end point)传送的信息的情况下,准备第1信息用的第1存储区域和第2信息用的第2存储区域来对应于一个端点;以及缓冲器管理电路,在通过总线传送第1信息的第1阶段中,将从主机向端点传送的信息写入到第1信息用的所述第1存储区域,而在通过总线传送第2信息的第2阶段中,将从主机向端点传送的信息写入到第2信息用的所述第2存储区域;In addition, the present invention is a data transmission control device for data transmission through a bus, which includes: a buffer for distributing various information including the first and second information as information transmitted through one endpoint (end point) In the case of , prepare the first storage area for the first information and the second storage area for the second information to correspond to one endpoint; and the buffer management circuit, in the first stage of transmitting the first information through the bus, will The information transmitted from the host to the endpoint is written in the first storage area for the first information, and in the second stage of transmitting the second information through the bus, the information transmitted from the host to the endpoint is written in the second information. said second storage area used;

所述第1信息是命令块的信息包;所述第2信息是根据所述命令块的指示传送的数据的信息包。The first information is a packet of a command block; the second information is a packet of data transferred according to an instruction of the command block.

其中,在本发明中,存储在第1、第2存储区域中的第1、第2信息的种类可以任意地设定。However, in the present invention, the types of the first and second information stored in the first and second storage areas can be set arbitrarily.

此外,本发明可以在处理部件解释所述命令块的信息包期间,将数据的信息包写入到所述第2存储区域。Furthermore, the present invention may write packets of data into the second storage area while the processing unit interprets the packets of the command block.

这样的话,在从命令阶段(common phase)(命令传输)向数据阶段(数据传输)的切换等时,可以加快通过第2存储区域的数据的传送处理的开始定时,可以提高总线的有效传送速度。In this way, when switching from the common phase (command transmission) to the data phase (data transmission), etc., the start timing of the data transmission process through the second storage area can be accelerated, and the effective transmission speed of the bus can be improved. .

此外,本发明是一种数据传送控制装置,用于通过总线的数据传送,它包括:缓冲器,在分配命令块的信息包和数据的信息包作为通过一个端点传送的信息的情况下,对应于一个端点来准备命令块用的命令存储区域和数据用的数据存储区域;以及缓冲器管理电路,在从通过总线传送命令块的信息包的命令阶段切换为通过总线传送数据的信息包的数据阶段的情况下,将信息的写入区域从命令块用的所述命令存储区域切换为数据用的数据存储区域,将从主机向端点传送的数据的信息包写入到所述数据存储区域。In addition, the present invention is a data transfer control device for data transfer through a bus, which includes: a buffer corresponding to preparing a command storage area for a command block and a data storage area for data at one endpoint; and a buffer management circuit switching from a command stage of transmitting a packet of the command block to data of a packet of data via the bus In the case of the phase, the information writing area is switched from the command storage area for command blocks to the data storage area for data, and the data packets transmitted from the host to the endpoint are written in the data storage area.

根据本发明,在缓冲器中准备分配给所给与的端点的命令块信息包用的命令存储区域,以及分配给相同端点的数据块用的数据存储区域。然后,在从命令阶段(命令传输)切换为数据阶段(数据传输)的情况下,向端点的信息的写入区域从命令存储区域切换为数据存储区域。According to the present invention, a command storage area for command block packets allocated to a given endpoint and a data storage area for data blocks allocated to the same endpoint are prepared in the buffer. Then, when switching from the command phase (command transmission) to the data phase (data transmission), the writing area of the information to the endpoint is switched from the command storage area to the data storage area.

这样的话,即使在一个端点中分配命令块信息包和数据信息包的情况下,也可以对于写入到命令存储区域的命令块信息包进行处理,同时可以在数据存储区域中写入数据信息包。因此,可以提高数据传送控制装置的处理速度,减轻处理命令块信息包的部件的负荷,可以提高有效的总线传送速度。In this way, even when a command block packet and a data packet are allocated to one endpoint, the command block packet written in the command storage area can be processed, and the data packet can be written in the data storage area at the same time. . Therefore, the processing speed of the data transfer control device can be increased, the load on the components processing command block packets can be reduced, and the effective bus transfer speed can be increased.

此外,本发明可以进行按USB(通用串行总线)标准处理的数据传送。In addition, the present invention can perform data transfer handled in accordance with the USB (Universal Serial Bus) standard.

但是,本发明可以应用于按USB以外的标准(继承USB思想的标准)处理的数据传送。However, the present invention can be applied to data transfers handled by standards other than USB (standards that inherit the idea of USB).

此外,本发明的电子装置也可以包括上述任何一个数据传送控制装置,以及进行通过所述数据传送控制装置和总线传送的数据的输出处理或取入处理或存储处理的装置。In addition, the electronic device of the present invention may also include any one of the data transfer control devices described above, and a device that performs output processing, fetch processing, or storage processing of data transferred via the data transfer control device and the bus.

根据本发明,可以减轻控制数据传送控制装置的数据传送的处理部件(固件等)的处理负荷,实现电子装置的低成本化、小规模化等。此外,根据本发明,可以按高速的传送模式进行数据传送,所以可实现电子装置的处理高速化。According to the present invention, it is possible to reduce the processing load on the processing means (firmware, etc.) for controlling data transfer of the data transfer control device, and realize cost reduction and downsizing of the electronic device. In addition, according to the present invention, data transfer can be performed in a high-speed transfer mode, so that the processing speed of the electronic device can be realized.

附图说明Description of drawings

图1A、图1B、图1C、图1D是说明USB的端点和事务处理结构的图。1A, 1B, 1C, and 1D are diagrams illustrating USB endpoints and transaction structures.

图2A、图2B是说明CBI标准和Bulk-Only标准的图。2A and 2B are diagrams illustrating the CBI standard and the Bulk-Only standard.

图3是表示CBW格式的图。Fig. 3 is a diagram showing the CBW format.

图4是表示CSW格式的图。Fig. 4 is a diagram showing the CSW format.

图5A、图5B是说明Bulk-Only中的数据的写入处理、读出处理的图。5A and 5B are diagrams illustrating write processing and read processing of data in Bulk-Only.

图6A、图6B、图6C、图6D是说明比较例方法的图。6A, 6B, 6C, and 6D are diagrams illustrating the method of the comparative example.

图7A、图7B、图7C是说明本实施例方法的图。7A, 7B, and 7C are diagrams illustrating the method of this embodiment.

图8A、图8B是说明将CBW区域设定为可随机存取的方法的优点的图。8A and 8B are diagrams illustrating the advantages of the method of setting the CBW area to be randomly accessible.

图9是表示本实施例的数据传送控制装置的构成例的图。FIG. 9 is a diagram showing a configuration example of the data transfer control device of this embodiment.

图10是表示事务处理管理电路、端点管理电路、缓冲器管理电路、缓冲器的详细结构的一例的图。FIG. 10 is a diagram showing an example of a detailed configuration of a transaction management circuit, an endpoint management circuit, a buffer management circuit, and a buffer.

图11是表示事务处理管理电路、端点管理电路、缓冲器管理电路、缓冲器的详细结构的另一例的图。11 is a diagram showing another example of the detailed configuration of the transaction management circuit, the endpoint management circuit, the buffer management circuit, and the buffer.

图12是说明命令阶段开始时的本实施例的操作的定时波形图。FIG. 12 is a timing waveform diagram illustrating the operation of the present embodiment at the beginning of the command phase.

图13是说明数据传送成功情况下的本实施例的操作的定时波形图。FIG. 13 is a timing waveform diagram illustrating the operation of the present embodiment in the case of successful data transfer.

图14是说明数据长度差错情况下的本实施例的操作的定时波形图。Fig. 14 is a timing waveform diagram illustrating the operation of the present embodiment in the case of a data length error.

图15是说明CRC差错情况下的本实施例的操作的定时波形图。Fig. 15 is a timing waveform diagram illustrating the operation of the present embodiment in the case of a CRC error.

图16是说明触发差错情况下的本实施例的操作的定时波形图。Fig. 16 is a timing waveform diagram illustrating the operation of the present embodiment in the case of a trigger error.

图17A、图17B是说明触发比特和触发差错的图。17A and 17B are diagrams illustrating trigger bits and trigger errors.

图18A、图18B是比较例和本实施例的定时波形图。18A and 18B are timing waveform diagrams of the comparative example and the present embodiment.

图19A、图19B是表示比较例和本实施例中固件的处理的流程图。19A and 19B are flowcharts showing the processing of the firmware in the comparative example and the present embodiment.

图20A、图20B、图20C是各种电子装置的内部方框图的实例。20A, 20B, and 20C are examples of internal block diagrams of various electronic devices.

图21A、图21B、图21C是各种电子装置的外观图。21A, 21B, and 21C are external views of various electronic devices.

具体实施方式Detailed ways

以下,使用附图来详细说明本实施例。Hereinafter, this embodiment will be described in detail using the drawings.

以下说明的本实施例不限定权利要求书中所述的本发明的内容。此外,本实施例中说明的结构整体不一定必须作为本发明的解决手段。The present embodiment described below does not limit the content of the present invention described in the claims. In addition, the entire structure described in this embodiment does not necessarily have to be a solution of the present invention.

1.USB1.USB

1.1数据传送方法1.1 Data transfer method

首先,简单说明USB(USB2.0)的数据传送方法。First, the data transfer method of USB (USB2.0) will be briefly described.

在USB中,与IEEE1394等不同,主机具有数据传送的主导权。即,起动数据传送的事务处理在主机侧,主机进行与数据传送有关的大部分的控制。因此,主机的处理负荷重,但作为主机的PC(个人计算机)等具有高速、高性能的CPU(处理器),所以这样重的负荷处理也没有什么问题。In USB, unlike IEEE1394 and the like, the host has the initiative to transfer data. That is, the transaction to start data transfer is on the host side, and the host performs most of the control related to data transfer. Therefore, the processing load of the host is heavy, but since a PC (personal computer) or the like as the host has a high-speed, high-performance CPU (processor), there is no problem in processing such a heavy load.

另一方面,在USB中,装置(目标)仅简单地应对来自主机的请求就可以,所以可以简化装置侧的处理、结构。因此,在装置侧不需要使用主机那样的高性能、高速的CPU,可以使用价格低的CPU(微计算机),可实现低成本化。On the other hand, in USB, the device (target) only needs to simply respond to the request from the host, so the processing and configuration on the device side can be simplified. Therefore, it is not necessary to use a high-performance and high-speed CPU like a host on the device side, and an inexpensive CPU (microcomputer) can be used, thereby achieving cost reduction.

此外,在USB中,为了实现这样的主机主导的数据传送,如图1A所示,在装置侧准备端点(EP0~15)。这里,端点相当于用于在主机和装置之间进行数据传送的缓冲器(FIFO)的入口,USB中的数据传送都经由该端点来进行。In addition, in USB, in order to realize such host-driven data transfer, as shown in FIG. 1A , endpoints (EP0 to 15) are prepared on the device side. Here, the endpoint corresponds to the entry of a buffer (FIFO) for data transfer between the host and the device, and all data transfers in the USB are performed through the endpoint.

而且,该端点通过装置地址和端点号码进行唯一的地址指定。即,主机通过指定装置地址和端点号码,可以自由地进行向期望的端点发送数据和接收来自期望的端点的数据。Furthermore, the endpoint is uniquely addressed by the device address and endpoint number. That is, the host can freely perform transmission of data to and reception of data from a desired endpoint by designating a device address and an endpoint number.

此外,在装置侧是否设定端点是任意的,在枚举(enumeration)处理时,主机可以知道端点号码的分配和分配给各端点的存储区域的数据量等。It is optional whether or not to set endpoints on the device side, and the host can know the allocation of endpoint numbers, the data volume of storage areas allocated to each endpoint, and the like during enumeration processing.

在USB中,作为数据传送的类型,准备控制传送、同步传送、中断传送、成批传送。In USB, as types of data transfer, control transfer, isochronous transfer, interrupt transfer, and bulk transfer are prepared.

这里,控制传送是在主机和装置(目标)之间通过控制端点进行的控制用的传送模式。通过该控制传送,可传送用于装置的初始化的配置信息等。Here, the control transfer is a transfer mode for control between a host and a device (target) via a control endpoint. Through this control transmission, configuration information and the like for initialization of the device can be transmitted.

同步传送是与图像数据和话音数据那样的数据的合理性相比,为了优先确保带宽的数据传送而准备的传送模式。在该同步传送中,由于保证在一定周期内可以传送一定量的数据,所以数据的实时性在重要的应用中成为有效的传送模式。The isochronous transfer is a transfer mode prepared for data transfer that prioritizes securing a bandwidth over the availability of data such as image data and voice data. In this synchronous transmission, since it is guaranteed that a certain amount of data can be transmitted within a certain period, the real-time nature of data becomes an effective transmission mode in important applications.

中断传送是为了以比较低的传送速度来传送少量数据而准备的传送模式。Interrupt transfer is a transfer mode prepared for transferring a small amount of data at a relatively low transfer rate.

成批传送是为了传送不定期地产生的大量数据而准备的传送模式。在该成批传送中,在由同步传送和中断传送使用的时间以外的空闲时间中进行数据传送,同时检查数据的合理性。因此,实时性不太重要,但在要确保数据的可靠性的数据传送上,是有效的传送模式。The bulk transfer is a transfer mode prepared for transferring a large amount of data generated irregularly. In this bulk transfer, data is transferred during idle time other than the time used by isochronous transfer and interrupt transfer while checking the validity of the data. Therefore, real-time performance is not so important, but it is an effective transmission mode for data transmission in which reliability of data must be ensured.

1.2事务处理构成1.2 Transaction Processing Composition

如图1B所示,USB的成批传送中的事务处理基本上由标记信息包、数据信息包、信号交换信息包这样的三个信息包构成。再有,在同步传送的情况下,不需要信号交换信息包。As shown in FIG. 1B , a transaction in USB bulk transfer basically consists of three packets: a marker packet, a data packet, and a handshake packet. Also, in the case of isochronous transfer, no handshaking packets are required.

这里,标记信息包是用于主机请求装置(目标)的端点的读或写的情况等的信息包。该标记信息包例如有PID(OUT、IN、SOF、SETUP等的信息包ID)、ADDR(装置地址)、ENDP(端点号码)、CRC(CyclicRedundancy Check;循环冗余校验)的字段。Here, the marker packet is a packet used when, for example, a host requests reading or writing of an endpoint of a device (target). The tag information packet has fields such as PID (packet ID of OUT, IN, SOF, SETUP, etc.), ADDR (device address), ENDP (endpoint number), and CRC (Cyclic Redundancy Check; Cyclic Redundancy Check).

数据信息包是用于传送数据的实体的信息包,有PID(DATA0、DATA1)、DATA(数据的实体)、CRC的字段。The data packet is a packet for transmitting the entity of data, and has fields of PID (DATA0, DATA1), DATA (data entity), and CRC.

信号交换信息包是用于接收端向发送端传送在数据接收上是否成功的信息包,有PID(ACK、NAK、STALL)的字段。The handshake information packet is an information packet for the receiving end to transmit to the sending end whether the data reception is successful, and has a field of PID (ACK, NAK, STALL).

在OUT事务处理(主机向装置输出信息的事务处理)中,如图1C所示,首先,主机向装置传送OUT标记信息包。接着,主机向装置传送OUT的数据信息包。然后,如果成功接收了OUT的数据信息包,则装置向主机传送ACK的信号交换信息包。In an OUT transaction (a transaction in which the host outputs information to the device), as shown in FIG. 1C , first, the host transmits an OUT flag packet to the device. Next, the host sends the OUT data packet to the device. Then, if the data packet of OUT is successfully received, the device transmits a handshake packet of ACK to the host.

另一方面,在IN事务处理(主机从装置输入信息的事务处理)中,如图1D所示,首先,主机向装置传送IN标记信息包。然后,接收到IN标记信息包的装置向主机传送IN的数据信息包。随后,如果成功接收了IN的数据信息包,则主机向装置传送ACK的信号交换信息包。On the other hand, in an IN transaction (a transaction in which the host inputs information from the device), as shown in FIG. 1D , first, the host transmits an IN flag packet to the device. Then, the device that has received the IN tag packet transmits the IN data packet to the host. Then, if the data packet of IN is successfully received, the host transmits a handshake packet of ACK to the device.

在图1C、图1D中,“D←H”意味着从主机向装置传送信息,而“D→H”意味着从装置向主机传送信息(以下的说明和附图也同样)。In FIG. 1C and FIG. 1D , "D←H" means that information is transmitted from the host to the device, and "D→H" means that information is transmitted from the device to the host (the same applies to the following description and drawings).

1.3Bulk-Only1.3 Bulk-Only

USB的装置被分类为各个级别。而且,硬盘驱动器和光盘驱动器等装置属于被称为大容量存储的级别,在该大容量存储中,有根据电子装置的厂家等形成的CBI(Control/Bulk/Interrupt)和Bulk-Only等标准。USB devices are classified into various classes. Furthermore, devices such as hard disk drives and optical disk drives belong to a class called mass storage, and in this mass storage, there are standards such as CBI (Control/Bulk/Interrupt) and Bulk-Only established by manufacturers of electronic devices.

而且,在CBI标准中,如图2A所示,装置准备有控制、成批输出、成批输入、中断的端点EP0、1、2、3。这里,在端点EP0中传送USB层的控制的信息包和命令的信息包。在EP1中传送OUT数据(从主机传送到装置的数据),在EP2中传送IN数据(从装置传送到主机的数据),在EP3中传送中断IN的信息包。再有,是否将EP1~15的某一个分配给成批输出、成批输入、中断IN的端点,在装置侧是任意的。Furthermore, in the CBI standard, as shown in FIG. 2A, the device is prepared with endpoints EP0, 1, 2, and 3 for control, bulk output, bulk input, and interrupt. Here, control packets and command packets of the USB layer are transmitted in the endpoint EP0. OUT data (data transmitted from the host to the device) is transmitted in EP1, IN data (data transmitted from the device to the host) is transmitted in EP2, and an interrupt IN packet is transmitted in EP3. It should be noted that it is arbitrary on the device side whether to allocate any one of EP1 to 15 to the endpoints of bulk output, bulk input, and interrupt IN.

另一方面,在Bulk-Only标准中,如图2B所示,装置准备有控制、成批输出、成批输入的端点EP0、1、2。这里,在端点EP0中传送USB层的控制的信息包。在EP1中传送命令(CBW)和OUT数据,在EP2中传送状态(CSW)和IN数据的信息包。再有,是否将EP1~15的某一个设定在成批输出、成批输入的端点上,在装置侧是任意的。On the other hand, in the Bulk-Only standard, as shown in FIG. 2B , devices are prepared with endpoints EP0, 1, and 2 for control, bulk output, and bulk input. Here, a control packet of the USB layer is transmitted in the endpoint EP0. The command (CBW) and OUT data are transmitted in EP1, and the status (CSW) and IN data packets are transmitted in EP2. It should be noted that it is optional on the device side whether to set any one of EP1 to 15 as an endpoint of batch output or batch input.

这里,CBW(Command Block Wrapper)是包含命令块和与其相关信息的信息包,在图3中示出其格式。CSW(Command Status Wrapper)是包含命令块状态的信息包,图4表示其格式。Here, CBW (Command Block Wrapper) is an information package that includes a command block and its related information, and its format is shown in FIG. 3 . CSW (Command Status Wrapper) is an information packet containing the status of the command block, and its format is shown in Figure 4.

在图3中,dCBWSignature是将该信息包作为CBW来识别的信息,dCBWTag是命令块的标识符,将dCBWData Transfer Length指定为在数据阶段中传送的数据的长度。此外,bmCBWFlags是用于指定传送方向的标记,dCBWLUN是本机单元号码,bCBWCBLength是命令长度,CBWCB是将ATA/ATAPI或SCSI等命令进行盒化来记述的命令块。In Figure 3, dCBWSignature is the information to identify the information packet as CBW, dCBWTag is the identifier of the command block, and dCBWData Transfer Length is specified as the length of the data transferred in the data phase. In addition, bmCBWFlags is a flag for designating a transfer direction, dCBWLUN is a local unit number, bCBWCBLength is a command length, and CBWCB is a command block in which commands such as ATA/ATAPI or SCSI are boxed and described.

在图4中,dCSWSignature是将该信息包作为CSW来识别的信息。dCSWTag是状态块的标识符,写入与爱CSW对应的CBW的dCBWTag的值。CSWDataResidue是由CBW的dCBWDataTransferLength指定的数据的长度和装置实际处理的数据的长度的差分,bCSWStatus是状态块。In FIG. 4, dCSWSignature is information for identifying the packet as CSW. dCSWTag is an identifier of the status block, and the value of dCBWTag of the CBW corresponding to the CSW is written. CSWDataResidue is the difference between the length of data specified by dCBWDataTransferLength of CBW and the length of data actually processed by the device, and bCSWStatus is a status block.

下面,用图5A、图5B说明图2B的Bulk-Only标准中的数据的写入处理、读出处理。Next, data write processing and read processing in the Bulk-Only standard shown in FIG. 2B will be described with reference to FIGS. 5A and 5B.

在主机对装置写入数据的情况下,如图5A所示,首先,主机进行将CBW传送到装置的命令阶段(命令传输)。具体地说,主机将指定端点EP1的标记信息包传送到装置,接着,将CBW(参照图2B的A1、图3)传送到装置的端点EP1。在该CBW中包含写命令。然后,如果从装置将ACK的信号交换(H.S)返回到主机,则结束命令阶段。When the host writes data to the device, as shown in FIG. 5A , first, the host performs a command phase (command transmission) of transferring the CBW to the device. Specifically, the host transmits a marker packet specifying the endpoint EP1 to the device, and then transmits the CBW (see A1 in FIG. 2B , FIG. 3 ) to the endpoint EP1 of the device. Write commands are included in this CBW. Then, if the slave returns a handshake (H.S) of ACK to the master, the command phase ends.

如果结束命令阶段(命令传输),则移动至数据阶段(数据传输)。在该数据阶段中,首先,主机将指定端点EP1的标记信息包传送到装置,接着,将OUT数据(参照图2B的A2)传送到装置的端点EP1。然后,如果从装置向主机返回ACK的信号交换,则结束一个事务处理。随后,重复进行这样的事务处理,如果由CBW的dCBWDataTransferLength(参照图3)指定的数据长度量的数据被传送,则结束数据阶段。When the command phase (command transfer) is completed, it moves to the data phase (data transfer). In this data phase, first, the host transmits a marker packet specifying the endpoint EP1 to the device, and then transmits OUT data (refer to A2 in FIG. 2B ) to the endpoint EP1 of the device. Then, if the slave returns a handshake of ACK to the master, a transaction ends. Then, such transaction processing is repeated, and when the data of the data length amount specified by dCBWDataTransferLength (refer to FIG. 3 ) of the CBW is transferred, the data phase ends.

如果数据阶段(数据传输)结束,则移动至状态阶段(状态传输)。在该状态阶段中,首先,主机将指定端点EP2的标记信息包传送到装置。于是,装置将处于端点EP2的CSW(参照图2B的A3、图4)传送到主机。随后,如果从主机将ACK的信号交换返回到装置,则结束状态阶段。If the data phase (data transfer) is over, move to the status phase (status transfer). In this status phase, first, the host transmits a marker packet specifying the endpoint EP2 to the device. Then, the device transmits the CSW (refer to A3 of FIG. 2B , FIG. 4 ) at the endpoint EP2 to the host. Subsequently, if a handshake of ACK is returned from the host to the device, the status phase ends.

在主机读出数据的情况下,如图5B所示,首先,主机将指定端点EP1的标记信息包传送到装置,接着,将CBW传送到装置的端点EP1。该CBW包含读命令。然后,如果从装置将ACK的信号交换返回到主机,则结束命令阶段。When the host reads data, as shown in FIG. 5B , first, the host transmits a marker packet specifying the endpoint EP1 to the device, and then transmits the CBW to the endpoint EP1 of the device. The CBW contains read commands. Then, if the slave returns a handshake of ACK to the master, the command phase ends.

命令阶段结束后移动到数据阶段。在该数据阶段中,首先,主机将指定端点EP2的标记信息包传送到装置。于是,装置将处于端点EP2的IN数据(参照图2B的A4)传送到主机,如果从主机将ACK的信号交换返回到装置,则结束一个事务处理。然后,重复进行这样的事务处理,如果由CBW的dCBWDataTransferLength指定的数据长度量的数据被传送,则结束数据阶段。Move to the data phase after the command phase ends. In this data phase, first, the host transmits a marker packet specifying the endpoint EP2 to the device. Then, the device transmits the IN data (refer to A4 in FIG. 2B ) at the endpoint EP2 to the host, and when the handshake of ACK is returned from the host to the device, one transaction is ended. Then, such a transaction process is repeated, and if the data of the data length amount specified by dCBWDataTransferLength of the CBW is transferred, the data phase ends.

如果数据阶段结束后移动到状态阶段。该状态阶段的处理与图5A的数据写入处理的情况相同。If the data phase ends move to the status phase. The processing in this status stage is the same as in the case of the data writing processing in FIG. 5A.

2.本实施例的特征2. Features of this embodiment

2.1区域切换2.1 Region switching

在图2A所示的CBI标准中,有主机每隔一定期间将标记传送到装置的标准。因此,具有加重主机的处理负荷和接受该标记的装置的处理负荷的缺点。In the CBI standard shown in FIG. 2A , there is a standard that the host transfers a flag to the device at regular intervals. Therefore, there is a disadvantage of increasing the processing load of the host and the processing load of the device receiving the mark.

因此,目前,图2B的Bulk-Only标准正成为主流。Therefore, currently, the Bulk-Only standard shown in Figure 2B is becoming mainstream.

但是,在该Bulk-Only标准中,作为通过一个端点传送的信息,分配了多种信息。具体地说,在图2B中,作为通过成批输出端点EP1传送的信息,分配了命令(CBW)和OUT数据,作为通过成批输入端点EP2传送的信息,分配了状态(CSW0和IN数据。因此,主机和装置需要判别通过各端点传送的信息是哪个信息,在Bulk-Only标准中,主机和装置判断目前的阶段是哪个阶段,进行该信息的判别。However, in this Bulk-Only standard, various types of information are allocated as information transmitted through one endpoint. Specifically, in FIG. 2B, as information transmitted through the bulk-output endpoint EP1, command (CBW) and OUT data are allocated, and as information transmitted through the bulk-in endpoint EP2, status (CSW0 and IN data are allocated. Therefore, the host and the device need to distinguish which information is transmitted through each endpoint. In the Bulk-Only standard, the host and the device judge which stage is the current stage and perform the judgment of the information.

例如,在图5A、图5B的B1、B2中,当前的阶段是命令阶段,所以将通过端点EP1传送的信息判断为CBW(命令)。此外,在B3、B4中,当前的阶段是数据阶段,所以将通过端点EP1传送的信息判断为OUT数据,将通过端点EP2传送的信息判断为IN数据。此外,在B5、B6中,当前的阶段是状态阶段,所以将通过端点EP2传送的信息判断为CSW(状态)。For example, in B1 and B2 of FIG. 5A and FIG. 5B , the current stage is the command stage, so the information transmitted through the endpoint EP1 is judged as CBW (command). In addition, in B3 and B4, since the current phase is the data phase, the information transmitted through the endpoint EP1 is judged to be OUT data, and the information transmitted through the endpoint EP2 is judged to be IN data. In addition, in B5 and B6, since the current phase is the status phase, the information transmitted through the endpoint EP2 is judged as CSW (status).

而且,在Bulk-Only标准中,由于在主机和装置之间进行数据传送,以便使阶段始终一致,所以即使在对一个端点分配多个信息(CBW和OUT数据、CSW和IN数据)的情况下,也可以进行合适的数据传送。Furthermore, in the Bulk-Only standard, since the data transfer is performed between the host and the device so that the stages are always consistent, even when multiple information (CBW and OUT data, CSW and IN data) are allocated to one endpoint , and appropriate data transfers can also be performed.

但是,在Bulk-Only标准中,判明存在以下问题。However, in the Bulk-Only standard, it was found that there were the following problems.

例如,在图6A~图6D中示出本实施例的比较例的方法。在该比较例中,如图6A所示,在命令阶段中,对于以端点EP1作为入口的FIFO(EP1)600来说,写入来自主机的CBW(命令)。For example, the method of the comparative example of this embodiment is shown in FIG. 6A - FIG. 6D. In this comparative example, as shown in FIG. 6A, in the command phase, a CBW (command) from the host is written to the FIFO (EP1) 600 having the endpoint EP1 as an entry.

于是,如图6B所示,装置侧的CPU(固件,处理部件)以先入先出方式读出写入到该FIFO600中的CBW,进行命令解释。这种情况下,在CPU的命令解释结束之前,对于FIFO600不能写入来自主机的数据。Then, as shown in FIG. 6B , the CPU (firmware, processing unit) on the device side reads the CBW written into the FIFO 600 in a first-in-first-out manner, and interprets commands. In this case, the data from the host cannot be written to the FIFO 600 until the CPU's command interpretation is completed.

因此,如图6C所示,移动到数据阶段,即使在从主机传送OUT数据的标记的情况下,装置也对主机返回NAK。Therefore, as shown in FIG. 6C , moving to the data phase, the device returns NAK to the host even when a flag of OUT data is transmitted from the host.

然后,如图6D所示,以CPU的命令解释结束,FIFO600变为空的情况为条件,来自主机的OUT数据被写入到FIFO600,该OUT数据在后级的硬盘驱动器等装置中进行DMA传送。Then, as shown in FIG. 6D , the OUT data from the host computer is written into the FIFO 600 on the condition that the command interpretation by the CPU ends and the FIFO 600 becomes empty. .

于是,在图6A~图6D的比较例中,在CPU进行命令解释期间,OUT数据不写入到FIFO600。因此,在该期间的装置侧的处理迟缓,会降低有效的数据传送速度。Therefore, in the comparative example of FIGS. 6A to 6D , OUT data is not written into the FIFO 600 while the CPU is interpreting the command. Therefore, the processing on the device side is slow during this period, which reduces the effective data transfer rate.

这种情况下,在USB1.1中总线的传送速度低,所以图6B、图6C所示的装置侧的处理迟缓几乎不成为问题。In this case, since the transfer speed of the bus is low in USB1.1, the processing delay on the device side shown in FIGS. 6B and 6C is hardly a problem.

但是,在USB2.0的HS模式中以高速的480Mbps进行数据传送。因此,从主机通过USB高速地传送数据。因此,如果装置侧的处理迟缓,装置不能对付这种高速传送的数据的处理,则系统整体的有效数据传送速度大幅度下降。However, in the HS mode of USB2.0, data transfer is performed at high-speed 480Mbps. Therefore, data is transferred at high speed from the host through the USB. Therefore, if the processing on the device side is slow and the device cannot cope with the processing of such high-speed data transfer, the effective data transfer rate of the entire system will drop significantly.

特别是在装置侧,从低成本化的要求来看,使用例如以20~50MHz左右的时钟频率进行工作的便宜的CPU的情况居多。因此,在图6B、图6C的命令解释上非常花费时间,有效的数据传送速度的迟缓成为更深刻的问题。Especially on the device side, from the viewpoint of cost reduction, an inexpensive CPU that operates at a clock frequency of, for example, about 20 to 50 MHz is often used. Therefore, it takes a lot of time to interpret the commands in FIG. 6B and FIG. 6C , and the slowdown of the effective data transfer rate becomes a more serious problem.

因此,在本实施例中,为了解决这样的问题,采用按照阶段(传输)的切换来切换缓冲器的存储区域的方法。Therefore, in this embodiment, in order to solve such a problem, a method of switching the storage area of the buffer according to the switching of the stage (transfer) is adopted.

更具体地说,在如图7A所示的本实施例中,除了用于写入OUT数据(第2信息)的EP1区域10(第2存储区域,数据存储区域)以外,在作为信息包存储部件的缓冲器上还准备用于写入CBW(第1信息,命令块)的CBW区域12(第1存储区域,命令存储区域)。More specifically, in the present embodiment shown in FIG. 7A, in addition to the EP1 area 10 (the second storage area, data storage area) for writing the OUT data (the second information), the A CBW area 12 (first storage area, command storage area) for writing CBW (first information, command block) is also prepared on the buffer of the component.

这里,EP1区域10和CBW区域12都是将成批输出的端点EP1作为入口的存储区域。此外,将EP1区域10进行设定(FIFO设定),以便先输入的信息被先输出,将CBW区域12进行设定(随机存取设定),以便能够进行信息的随机存取。Here, both the EP1 area 10 and the CBW area 12 are storage areas having the bulk output endpoint EP1 as an entry. In addition, the EP1 area 10 is set (FIFO setting) so that information input first is output first, and the CBW area 12 is set (random access setting) so that random access of information can be performed.

在本实施例中,在命令阶段(第1阶段)中开关SW(切换部件)被切换到CBW区域12侧,从主机传送的CBW被写入到CBW区域12。于是,CPU(固件,处理部件)读出写入到该CBW区域12中的CBW,进行命令解释。这种情况下,CBW区域12被设定为可随机存取,所以CPU可以高速地读出CBW区域12的任意地址的信息。In the present embodiment, the switch SW (switching means) is switched to the CBW area 12 side in the command phase (first phase), and the CBW transmitted from the host is written in the CBW area 12 . Then, the CPU (firmware, processing unit) reads the CBW written in the CBW area 12 and interprets the command. In this case, since the CBW area 12 is set to be randomly accessible, the CPU can read information at an arbitrary address in the CBW area 12 at high speed.

如图7B所示,如果从命令阶段(第1阶段)移动到数据阶段(第2阶段),则开关SW被切换到EP1区域10侧。由此,能够将来自主机的OUT数据写入到EP1区域10。然后,如果CPU的命令解释结束,则起动将EP1区域10的OUT数据传送到后级的硬盘驱动器等装置的DMA传送。As shown in FIG. 7B , when shifting from the command phase (first phase) to the data phase (second phase), the switch SW is switched to the EP1 area 10 side. Thus, OUT data from the host can be written into the EP1 area 10 . Then, when the command interpretation by the CPU is completed, DMA transfer for transferring the OUT data of the EP1 area 10 to a subsequent device such as a hard disk drive is started.

例如,在图6C的比较例中,在CPU进行命令解释期间,不能接收来自主机的OUT数据,不能对主机返回NAK。For example, in the comparative example shown in FIG. 6C , during command interpretation by the CPU, OUT data from the host cannot be received, and NAK cannot be returned to the host.

相反,在本实施例中,如图7B所示,在CPU进行命令解释期间,也接收来自主机的OUT数据,并可写入到EP1区域10。因此,可以对主机返回ACK,实现处理的高速化。On the contrary, in this embodiment, as shown in FIG. 7B , during the command interpretation by the CPU, the OUT data from the host is also received and can be written into the EP1 area 10 . Therefore, it is possible to return an ACK to the host and realize high-speed processing.

特别是在USB2.0中,从主机高速传送数据。因此,如图6C的比较例所示,如果对主机持续返回NAK,则会损失总线频带,不能灵活使用USB2.0的高速数据传送。Especially in USB2.0, data is transferred at high speed from the host. Therefore, as shown in the comparative example of FIG. 6C , if the host continues to return NAK, the bus bandwidth will be lost, and the high-speed data transmission of USB2.0 cannot be used flexibly.

相反,在本实施例中,如图7B所示,可以将ACK返回到主机,所以可以将总线频带的损失抑制到最小限度,可以产生USB2.0的高速数据传送,可以提高有效的数据传送速度。On the contrary, in this embodiment, as shown in FIG. 7B, ACK can be returned to the host, so the loss of the bus frequency band can be suppressed to a minimum, high-speed data transmission of USB2.0 can be generated, and the effective data transmission speed can be improved. .

此外,在比较例中,如图8A所示,CBW被存储到先进先出的FIFO600中。因此,CPU在命令解释时需要从FIFO600的开头地址起依次读出CBW。其结果,需要花费时间,直至读出命令解释上重要的数据长度(图3的dCBWDataTransferLength)和命令(CBWCB),使命令解释的处理更加迟缓。In addition, in the comparative example, as shown in FIG. 8A , the CBW is stored in the first-in-first-out FIFO 600 . Therefore, the CPU needs to read the CBW sequentially from the head address of the FIFO 600 when interpreting the command. As a result, it takes time until the data length (dCBWDataTransferLength in FIG. 3 ) and the command (CBWCB), which are important in the command interpretation, are read, and the processing of the command interpretation is further delayed.

相反,在本实施例中,如图8B所示,CBW被存储在可随机存取的CBW区域12中。因此,CPU能够首先读出命令解释上重要的数据长度和命令,可以节约命令解释的处理时间。由此,可以进一步提高有效的数据传送速度。In contrast, in the present embodiment, the CBW is stored in the randomly accessible CBW area 12 as shown in FIG. 8B. Therefore, the CPU can first read out the data length and the command which are important in command interpretation, and the processing time for command interpretation can be saved. As a result, the effective data transfer rate can be further increased.

于是,在本实施例中,即使在CBW区域12(存储第1信息的第1存储区域)的开头地址以外的区域中,写入数据长度(第2信息的长度信息)和命令(指示传送第2信息的命令块)的情况下,CBW区域12也被设定为可随机存取,所以可以首先读出数据长度和命令,提高有效的数据传送速度。Therefore, in this embodiment, even in the area other than the head address of the CBW area 12 (the first storage area storing the first information), the data length (the length information of the second information) and the command (instructing to transmit the first information) are written. 2 information command block), the CBW area 12 is also set to be randomly accessible, so the data length and command can be read first, and the effective data transfer speed can be improved.

再有,为了向后级的装置(硬盘驱动器等)进行将数据高效率地DMA传送,对于EP1区域10来说,期望将信息设定在先进先出的区域(FIFO设定)中。这种情况下,通过由串联连接的寄存器、存储器等来构成,可以将EP1区域10设定在先进先出的区域中,也可以如后述那样,通过设法进行RAM的地址控制,而设定在先进先出的区域中。In addition, in order to efficiently DMA transfer data to a subsequent device (hard disk drive, etc.), it is desirable to set information in a first-in-first-out area (FIFO setting) in the EP1 area 10 . In this case, the EP1 area 10 can be set in a first-in first-out area by configuring registers, memories, etc. connected in series, or it can be set by trying to control the address of the RAM as described later. in a first-in, first-out zone.

2.2构成例2.2 Composition example

图9表示本实施例的数据传送控制装置的构成例。FIG. 9 shows a configuration example of the data transfer control device of this embodiment.

本实施例的数据传送控制装置包括收发机宏块20、SIE30、端点管理电路40、缓冲器管理电路50、缓冲器60、成批传送管理电路70、DMACS0。再有,本发明的数据传送控制装置不需要包含图9所示的全部电路块,也可以省略其中的一部分来构成。The data transfer control device in this embodiment includes a transceiver macro block 20, an SIE 30, an endpoint management circuit 40, a buffer management circuit 50, a buffer 60, a bulk transfer management circuit 70, and a DMACS0. In addition, the data transfer control device of the present invention does not need to include all the circuit blocks shown in FIG. 9, and may be constructed by omitting some of them.

这里,收发信机宏块20是用于实现USB(第1总线)的FS模式和HS模式中的数据传送的电路。作为该收发信机宏块20,例如可以使用依据对USB2.0的物理层电路、逻辑层电路的一部分进行定义的UTMI(USB2.0 Transceiver Macrocell Interface)中的宏块单元。该收发信机宏块20包括收发信机电路22、时钟生成电路24。Here, the transceiver macro block 20 is a circuit for realizing data transfer in the FS mode and HS mode of the USB (first bus). As the transceiver macroblock 20, for example, a macroblock unit in UTMI (USB2.0 Transceiver Macrocell Interface) that defines a part of the physical layer circuit and logical layer circuit of USB2.0 can be used. The transceiver macro block 20 includes a transceiver circuit 22 and a clock generation circuit 24 .

收发信机电路22包括使用差动信号DP、DM来发送接收USB上的数据的模拟前置电路(接收电路、发送电路)。此外,包括进行比特填充、非比特填充、串并行变换、NRZI解码、NRZI编码、采样时钟生成等处理的电路。The transceiver circuit 22 includes an analog front-end circuit (receiving circuit, transmitting circuit) for transmitting and receiving data on the USB using differential signals DP and DM. In addition, it includes circuits for processing such as bit stuffing, non-bit stuffing, serial-to-parallel conversion, NRZI decoding, NRZI encoding, and sampling clock generation.

时钟生成电路24是生成数据传送控制装置使用的工作时钟、以及在采样时钟的生成中使用的时钟的电路,包括生存480MHz和60MHz的时钟的PLL及振荡电路。The clock generating circuit 24 is a circuit for generating an operation clock used by the data transfer control device and a clock used for generating a sampling clock, and includes a PLL and an oscillation circuit that support clocks of 480 MHz and 60 MHz.

SIE(Serial Interface Engine;串行接口引擎)是进行USB的信息包传送处理等各种处理的电路,包括信息包处理电路32、停止和再继续控制电路34、事务管理电路36。SIE (Serial Interface Engine; Serial Interface Engine) is a circuit for performing various processes such as USB packet transfer processing, and includes a packet processing circuit 32, a stop and resume control circuit 34, and a transaction management circuit 36.

信息包处理电路32是进行首标和数据组成的信息包的组装(生成)和分解等的电路,包括进行CRC生成和解读的CRC处理电路33。The packet processing circuit 32 is a circuit that assembles (generates) and disassembles a packet composed of a header and data, and includes a CRC processing circuit 33 that generates and decodes a CRC.

停止和再继续控制电路34是进行停止和再继续时的顺序控制的电路。The stop and resume control circuit 34 is a circuit for performing sequence control at the time of stop and resume.

事务管理电路36是管理由标记、数据、信号交换等的信息包构成的事务的电路。具体地说,在接收到标记信息包的情况下,确认是否是送给自身,在送给自身的情况下,在主机之间进行数据信息包的传送处理,然后,进行信号交换信息包的传送处理。The transaction management circuit 36 is a circuit that manages transactions constituted by packets of flags, data, handshake, and the like. Specifically, in the case of receiving a tag packet, it is confirmed whether it is sent to itself, and in the case of sending to itself, the transfer processing of the data packet is performed between the hosts, and then the transfer of the handshake packet is performed deal with.

端点管理电路40是管理缓冲器60的各存储区域入口的端点的电路,包括存储端点的属性信息的寄存器(寄存器组)等。The endpoint management circuit 40 is a circuit that manages the endpoints of each storage area entry of the buffer 60, and includes registers (register group) that store attribute information of the endpoints, and the like.

缓冲器管理电路50是管理例如由RAM等构成的缓冲器60的电路。更具体地说,生成写入地址和读出地址,进行向缓冲器60的数据写入处理和来自缓冲器60的数据读出处理。The buffer management circuit 50 is a circuit that manages a buffer 60 composed of, for example, a RAM or the like. More specifically, a write address and a read address are generated, and data write processing to the buffer 60 and data read processing from the buffer 60 are performed.

缓冲器60(信息包存储部件)暂时存储通过USB传送的数据(信息包),具有补偿USB(第1总线)中的数据传送速度和EBUS(第2总线)中的数据传送速度的速度差的功能。再有,EBUS是连接到硬盘驱动器和CD驱动器等装置(大容量存储装置)的外部总线。The buffer 60 (packet storage means) temporarily stores data (packets) transmitted via the USB, and has a function to compensate for the speed difference between the data transmission speed in the USB (the first bus) and the data transmission speed in the EBUS (the second bus). Function. Also, EBUS is an external bus connected to devices (mass storage devices) such as hard disk drives and CD drives.

在本实施例中,作为通过一个端点传送的信息,在分配多种信息的情况下,在该缓冲器60上准备(确保)第1信息(例如命令块)用的第1存储区域(例如命令存储区域)和第2信息(例如数据)用的第2存储区域(例如数据存储区域)。In this embodiment, when distributing multiple types of information as information transmitted through one endpoint, a first storage area (such as a command block) for the first information (such as a command block) is prepared (secured) on the buffer 60. storage area) and a second storage area (eg data storage area) for second information (eg data).

成批传送管理电路70是用于管理USB中的成批传送的电路。The bulk transfer management circuit 70 is a circuit for managing bulk transfer in USB.

DMAC80是用于通过EBUS进行DMA传送的DMA控制器,包含DMA计数器82。而且,DMA计数器82是对通过EBUS传送的数据的量(传送数)进行计数的电路。DMAC 80 is a DMA controller for DMA transfer via EBUS and includes DMA counter 82 . Also, the DMA counter 82 is a circuit that counts the amount of data (the number of transfers) transferred via the EBUS.

2.3详细的构成例2.3 Detailed configuration example

图10表示事务管理电路36(SIE)、端点管理电路40、缓冲器管理电路50、缓冲器60的详细的构成例。FIG. 10 shows a detailed configuration example of the transaction management circuit 36 (SIE), the endpoint management circuit 40 , the buffer management circuit 50 , and the buffer 60 .

缓冲器60(RAM)包括:存储分配给端点EP1的信息的CBW(命令块)的CBE区域61;存储分配给EP0的信息的控制的EP0区域62;存储分配给EP1的信息的OUT数据的EP1区域63;分配给EP2的信息的IN数据的EP2区域64。Buffer 60 (RAM) includes: CBE area 61 of CBW (command block) storing information allocated to endpoint EP1; EP0 area 62 of control storing information allocated to EP0; EP1 storing OUT data of information allocated to EP1 Area 63; EP2 area 64 of the IN data allocated to the information of EP2.

在图10中,对CBW区域61进行设定,以便通过CPU(固件,处理部件)可进行随机存取。另一方面,将EP0、EP1、EP2区域62、63、64进行设定(FIFO设定),使得先输入的信息可先输出。In FIG. 10, the CBW area 61 is set so as to be randomly accessible by the CPU (firmware, processing unit). On the other hand, the EP0, EP1, and EP2 areas 62, 63, and 64 are set (FIFO settings) so that the information input first can be output first.

事务管理电路36将通过USB传送的写入数据SIEWrData(写入信息包)输出到缓冲器60,并从缓冲器60输入读出数据SIERdData(读出信息包)。The transaction management circuit 36 outputs write data SIEWrData (write packet) transmitted via USB to the buffer 60 , and inputs read data SIERdData (read packet) from the buffer 60 .

事务管理电路36对缓冲器管理电路50输出写入请求信号SIEWrReq、读出请求信号SIERdReq,并从缓冲器管理电路50接收写入确认信号SIRWrAck、读出确认信号SIERdAck。The transaction management circuit 36 outputs the write request signal SIEWrReq and the read request signal SIERdReq to the buffer management circuit 50 , and receives the write acknowledgment signal SIRWrAck and the read acknowledgment signal SIERdAck from the buffer management circuit 50 .

事务管理电路36对端点管理电路40输出事务结束信号TranEndPulse、事务状态信号TranStatus、端点号码指定信号EPnum、传送方向指定信号Direction,并从端点管理电路40接收端点存在信号Epexist。The transaction management circuit 36 outputs a transaction end signal TranEndPulse, a transaction status signal TranStatus, an endpoint number designation signal EPnum, and a transmission direction designation signal Direction to the endpoint management circuit 40 , and receives an endpoint existence signal Epexist from the endpoint management circuit 40 .

端点管理电路40包括用于记述端点的属性信息(端点号码、最大信息包量等)的寄存器(寄存器组)42、43、44。而且,根据来自事务管理电路36的各种信号、以及寄存器的属性信息,生成端点选择信号Epsel,输出到缓冲器管理电路50。The endpoint management circuit 40 includes registers (register groups) 42, 43, and 44 for describing attribute information of endpoints (endpoint number, maximum packet size, etc.). Furthermore, an endpoint selection signal Epsel is generated based on various signals from the transaction management circuit 36 and attribute information of the register, and is output to the buffer management circuit 50 .

端点管理电路40对缓冲器管理电路50输出来自CPU的写入请求信号CPUWrReq、读出请求信号CPURdReq,从缓冲器管理电路50接收对CPU的写入确认信号CPUWrAck、读出确认信号CPURdAck。The endpoint management circuit 40 outputs the write request signal CPUWrReq and the read request signal CPURdReq from the CPU to the buffer management circuit 50 , and receives the write acknowledgment signal CPUWrAck and the read acknowledgment signal CPURdAck to the CPU from the buffer management circuit 50 .

包含端点管理电路40的EP0寄存器42是用于记述由USB标准以缺省定义的控制端点的属性信息的寄存器。The EP0 register 42 including the endpoint management circuit 40 is a register for describing attribute information of control endpoints defined by default in the USB standard.

EP1、EP2寄存器43、44是用于记述由BULK-Only标准定义的成批输出和成批输入的端点的属性信息的寄存器。再有,是否将端点EP1~15的某一个设定为成批输出或成批输入的端点,在装置侧是任意的。The EP1 and EP2 registers 43 and 44 are registers for describing attribute information of bulk-out and bulk-in endpoints defined by the BULK-Only standard. It should be noted that whether any of the endpoints EP1 to 15 is set as an endpoint for batch output or batch input is optional on the device side.

在EP1寄存器43中,将表示数据的传送方向的标记DIR设定为OUT,将EP1设定为成批输出的端点。In the EP1 register 43, the flag DIR indicating the transfer direction of data is set as OUT, and EP1 is set as the end point of the batch output.

在EP1寄存器43中,将标记EnCBW设定为1。该EnCBW是用于将端点连接到缓冲器60的CBW区域61的标记,EnCBW被设定为1的端点连接到CBW区域61。In the EP1 register 43, the flag EnCBW is set to 1. This EnCBW is a flag for connecting an endpoint to the CBW area 61 of the buffer 60 , and an endpoint whose EnCBW is set to 1 is connected to the CBW area 61 .

在EP2寄存器44中,将表示数据的传送方向的标记DIR设定为IN,将EP2设定为成批输入的端点。In the EP2 register 44, the flag DIR indicating the transfer direction of the data is set to IN, and EP2 is set as the end point of the batch input.

此外,在EP2寄存器44中,将EnCBW设定为0。In addition, EnCBW is set to 0 in the EP2 register 44 .

缓冲器管理电路50接收来自事务管理电路36和端点管理电路40的写入和读出请求信号、来自端点管理电路40的端点选择信号Epsel,将地址Address和写入脉冲xWR(x意味着负逻辑)输出到缓冲器60。该缓冲器管理电路50包括CBW、EP0、EP1、BP2的地址生成电路51、52、53、54和选择器56。The buffer management circuit 50 receives the write and read request signals from the transaction management circuit 36 and the endpoint management circuit 40, the endpoint selection signal Epsel from the endpoint management circuit 40, and sends the address Address and the write pulse xWR (x means negative logic ) is output to the buffer 60. This buffer management circuit 50 includes address generation circuits 51 , 52 , 53 , and 54 for CBW, EP0 , EP1 , and BP2 , and a selector 56 .

这里,CBW地址生成电路51生成对于CBW区域61(开头地址a0)的SIEWrData、SIERdData的写入或读出地址AD0。Here, the CBW address generation circuit 51 generates a write or read address AD0 of SIEWrData and SIERdData to the CBW area 61 (start address a0).

此外,EP0、EP1、EP2的地址生成电路52、53、54分别生成EP0、EP、1、EP2的区域62、63、64(开头地址a1、a2、a3)的SIEWrData、SIERdData的写入或读出地址AD1、AD2、AD3。In addition, the address generation circuits 52, 53, and 54 of EP0, EP1, and EP2 generate write or read data of SIEWrData and SIERdData in areas 62, 63, and 64 (start addresses a1, a2, and a3) of EP0, EP, 1, and EP2, respectively. Out addresses AD1, AD2, AD3.

选择器56根据信号Epsel选择地址AD0~3的某一个,作为Address输出到缓冲器60,同时将写入脉冲xWR输出到缓冲器60。具体地说,在通过EPsel选择指定CBW的情况下选择AD0,在选择指定EP0情况下选择AD1,在选择指定EP1的情况下选择AD2,在选择指定EP2的情况下选择AD3,并作为Address输出到缓冲器60。The selector 56 selects one of the addresses AD0 to 3 according to the signal Epsel, and outputs it to the buffer 60 as an Address, and outputs the write pulse xWR to the buffer 60 . Specifically, AD0 is selected in the case of selecting and specifying CBW by EPsel, AD1 is selected in the case of selecting and specifying EP0, AD2 is selected in the case of selecting and specifying EP1, and AD3 is selected in the case of selecting and specifying EP2, and output as Address to Buffer 60.

再有,CBW区域61可通过CPU读出CPURdData。这种情况下,缓冲器管理电路50根据来自端点管理电路40的EPsel或CPURdReq,将用于读出CPURdData的Address输出到缓冲器60。In addition, CPURdData can be read from the CBW area 61 by the CPU. In this case, the buffer management circuit 50 outputs an Address for reading CPURdData to the buffer 60 according to EPsel or CPURdReq from the endpoint management circuit 40 .

图11表示事务管理电路36、端点管理电路40、缓冲器管理电路50、缓冲器60的另一构成例。FIG. 11 shows another configuration example of the transaction management circuit 36 , the endpoint management circuit 40 , the buffer management circuit 50 , and the buffer 60 .

在与图10不同的图11中,缓冲器60包括CBW、EP0、EP1、EP2使用的FIFO65、66、67、68(例如串联连接的寄存器、存储器)。In FIG. 11 , which is different from FIG. 10 , buffer 60 includes FIFOs 65 , 66 , 67 , and 68 (for example, serially connected registers and memories) used by CBW, EP0 , EP1 , and EP2 .

包含缓冲器管理电路50的选择器57根据来自端点管理电路40的EPsel,将来自事务管理电路36的SIEWrData输出到缓冲器60,作为WrDataCBW、WrDataEP0、WrDataEP1、WrDataEP2的某一个。The selector 57 including the buffer management circuit 50 outputs the SIEWrData from the transaction management circuit 36 to the buffer 60 as any one of WrDataCBW, WrDataEP0, WrDataEP1, and WrDataEP2 according to the EPsel from the endpoint management circuit 40.

或者,选择器57根据EPsel,选择来自缓冲器60的RdDataCBW、RdDataEP0、RdDataEP1、RdDataEP2的某一个,作为SIERdData输出到事务管理电路36。Alternatively, the selector 57 selects one of RdDataCBW, RdDataEP0, RdDataEP1, and RdDataEP2 from the buffer 60 according to EPsel, and outputs it to the transaction management circuit 36 as SIERdData.

更具体地说,在通过EPsel选择指示CBW的情况下,选择WrDataCBW、RdDataCBW,在选择指示EP0的情况下,选择WrDataEP0、RdDataEP0,在选择指示EP1的情况下,选择WrDataEP1、RdDataEP1,而在选择指示EP2的情况下,选择WrDataEP2、RdDataEP2。More specifically, in the case of selecting and indicating CBW through EPsel, select WrDataCBW and RdDataCBW; in the case of selecting and indicating EP0, select WrDataEP0 and RdDataEP0; in the case of selecting and indicating EP1, select WrDataEP1 and RdDataEP1; In the case of EP2, select WrDataEP2, RdDataEP2.

然后,对缓冲器60的数据的写入通过来自事务管理电路36的写入脉冲SIEWR进行,来自缓冲器60的数据的读出通过来自事务管理电路36的读出脉冲SIERD进行。Then, writing of data into the buffer 60 is performed by a write pulse SIEWR from the transaction management circuit 36 , and reading of data from the buffer 60 is performed by a read pulse SIERD from the transaction management circuit 36 .

在图11中,也可以将FIFO65(CBW)设定在可随机存取的存储区域中。In FIG. 11, the FIFO 65 (CBW) may be set in a random-accessible storage area.

2.4工作情况2.4 Working conditions

在图12~图16中,表示说明本实施例的数据传送控制装置的详细工作情况的定时波形图的示例。12 to 16 show examples of timing waveform diagrams illustrating the detailed operation of the data transfer control device of this embodiment.

2.4.1成功时2.4.1 When successful

图12是命令阶段(参照图5A的B1)开始时的定时波形图,图13是命令阶段结束时的定时波形图。FIG. 12 is a timing waveform diagram at the start of the command phase (see B1 in FIG. 5A ), and FIG. 13 is a timing waveform diagram at the end of the command phase.

如图12的C1、C2所示,如果事务管理电路36将Epnum设定为1(端点号码=1),将Direction设定为OUT,则存在成批输出端点EP1的寄存器43(参照图10),所以端点管理电路40如C3所示那样使Epexist有效(H电平)。As shown in C1 and C2 of FIG. 12, if the transaction management circuit 36 sets Epnum to 1 (endpoint number=1) and sets Direction to OUT, then there is a register 43 of the batch output endpoint EP1 (refer to FIG. 10 ). , so the endpoint management circuit 40 activates Epexist (H level) as indicated by C3.

此时,如C4所示,端点EP1的EnCBW被设定为H电平(1),所以端点管理电路40如C5所示那样将选择指示CBW区域61的地址AD0的EPsel输出到缓冲器管理电路50。由此,缓冲器管理电路50的选择器56选择由CBW地址生成电路51生成的地址AD0。At this time, as shown in C4, the EnCBW of the endpoint EP1 is set to H level (1), so the endpoint management circuit 40 outputs EPsel for selecting address AD0 indicating the CBW area 61 to the buffer management circuit as shown in C5. 50. Accordingly, the selector 56 of the buffer management circuit 50 selects the address AD0 generated by the CBW address generation circuit 51 .

然后,如C6所示,如果事务管理电路36使SIEWrReq有效,则如C7所示,缓冲器管理电路50将来自CBW地址生成电路51的AD0=a0作为Address输出到缓冲器60,同时如C8所示,使xWR有效(L电平)。由此,将缓冲器60的CBW区域61的a0作为开头地址,如C9所示,写入CBW(SIEWrData)的0~3字节。然后,如C10所示,使SIEWrAck有效,使确认返回到事务管理电路。Then, as shown in C6, if the transaction management circuit 36 validates SIEWrReq, then as shown in C7, the buffer management circuit 50 outputs AD0=a0 from the CBW address generation circuit 51 to the buffer 60 as Address, and at the same time, as shown in C8 display, make xWR valid (L level). Thus, with a0 in the CBW area 61 of the buffer 60 as the head address, bytes 0 to 3 of CBW (SIEWrData) are written as indicated by C9. Then, as indicated by C10, SIEWrAck is enabled, and an acknowledgment is returned to the transaction management circuit.

接着,如C11所示,如果事务管理电路36使SIEWrReq有效,则如C12、C13所示,缓冲器管理电路50将AD0=a0+4作为Address输出到缓冲器60,同时使xWR有效。由此,将CBW区域61的a0+4作为开头地址,如C14所示,写入CBW(SIEWrData)的4~7字节。然后,如C15所示,使SIEWrAck有效,将确认返回到事务管理电路36。Next, as shown in C11, when the transaction management circuit 36 validates SIEWrReq, as shown in C12 and C13, the buffer management circuit 50 outputs AD0=a0+4 as Address to the buffer 60, and simultaneously enables xWR. Thereby, using a0+4 of the CBW area 61 as the head address, as indicated by C14, 4 to 7 bytes of CBW (SIEWrData) are written. Then, as indicated by C15, SIEWrAck is enabled, and an acknowledgment is returned to the transaction management circuit 36.

通过重复进行以上的写入处理,如图13的C16所示,将CBW的所有的0~30字节(合计为31字节)写入到CBW区域61中。By repeating the above writing process, all 0 to 30 bytes (31 bytes in total) of the CBW are written into the CBW area 61 as shown in C16 of FIG. 13 .

然后,如C17所示,如果对主机适当返回ACK,则如C18所示,事务管理电路36使TranEndPusel有效,同时如C19所示,将TranStatus设定为Success,将事务成功的情况传送到端点管理电路40。Then, as shown in C17, if an ACK is properly returned to the host, then as shown in C18, the transaction management circuit 36 enables TranEndPusel, and simultaneously as shown in C19, TranStatus is set to Success, and the successful situation of the transaction is transmitted to the endpoint management Circuit 40.

于是,如C20所示,端点EP1(图10的寄存器43)的EnCBW被设定为L电平(0)。由此,如C21所示,端点管理电路40将选择指示EP1区域63的地址AD2的EPsel输出到缓冲器管理电路50。其结果,在随后的数据阶段(参照图5A的B3)中,缓冲器管理电路50的选择器56选择EP1区域63的地址AD2作为输出到缓冲器60的Address。Then, as indicated by C20, EnCBW of the endpoint EP1 (register 43 in FIG. 10 ) is set to L level (0). Thereby, as indicated by C21 , the endpoint management circuit 40 outputs the EPsel for selecting the address AD2 indicating the EP1 area 63 to the buffer management circuit 50 . As a result, the selector 56 of the buffer management circuit 50 selects the address AD2 of the EP1 area 63 as the Address output to the buffer 60 in the subsequent data phase (see B3 in FIG. 5A ).

于是,在本实施例中,以对于命令阶段(第1阶段)的数据传送的确认ACK返回到主机为条件(参照C17),将端点EP1的EnCBW设定为L电平(参照C20),将从主机向端点EP1传送的数据的写入区域从CBW区域61(第1存储区域)切换为EP1区域63(第2存储区域)(参照C21)。然后,在数据阶段中,将来自主机的数据写入到切换后的EP1区域63中。Therefore, in this embodiment, the EnCBW of the endpoint EP1 is set to L level (refer to C20) on the condition that the acknowledgment ACK for the data transmission in the command stage (first stage) is returned to the host (refer to C17), and the The writing area of data transferred from the host to the endpoint EP1 is switched from the CBW area 61 (first storage area) to the EP1 area 63 (second storage area) (see C21). Then, in the data phase, data from the host is written into the switched EP1 area 63 .

于是,如果按照ACK返回的有无来进行区域切换,则可以用少的处理负荷来实现没有差错的可靠的区域切换。Therefore, by performing zone switching according to whether or not an ACK is returned, reliable zone switching without errors can be realized with a small processing load.

2.4.2数据长度的差错、CRC差错2.4.2 Data length error, CRC error

图14是在命令阶段写入的数据长度(CBW的长度)中有差错情况下的定时波形图。Fig. 14 is a timing waveform diagram in the case where there is an error in the data length (CBW length) written in the command phase.

在数据长度上有差错的情况下(数据长度短或长的情况),如图14的D1所示,对主机不返回ACK,而返回NAK。然后,事务管理电路36对端点管理电路40,输出如D2所示的表示在数据长度上有差错的TranStatus。于是,这种情况下,与图13的C20的情况不同,如图14的D3所示,端点EP1的EnCBW未变为L电平。因此,如D4所示,EPsel也不变化,不进行从CBW区域61向EP1区域63的区域切换。此外,所谓在数据长度上有差错,是主机和装置之间存在接口不匹配的可能性,所以该端点被阻塞。When there is an error in the data length (when the data length is short or long), as shown in D1 of FIG. 14 , NAK is returned to the host instead of ACK. Then, the transaction management circuit 36 outputs to the endpoint management circuit 40 TranStatus indicating that there is an error in the data length as shown in D2. Therefore, in this case, unlike the case of C20 in FIG. 13 , as shown in D3 in FIG. 14 , EnCBW at the end point EP1 does not become L level. Therefore, as shown in D4, EPsel also does not change, and area switching from the CBW area 61 to the EP1 area 63 is not performed. In addition, the so-called error in the data length means that there is a possibility that there is an interface mismatch between the host and the device, so the endpoint is blocked.

图15是命令阶段中产生CRC差错情况的定时波形图。Fig. 15 is a timing waveform diagram of a case where a CRC error occurs in the command phase.

在产生CRC差错的情况下,如图15的E1所示,对主机不返回ACK。然后,事务管理电路36对端点管理电路40输出E2所示的表示CRC差错的TranStatus。于是,在这种情况下,与图13的C20的情况不同,如图15的E3所示,端点EP1的EnCBW不变为L电平。因此,如E4所示,EPsel也不变化,不进行从CBW区域61向EP1区域63的区域切换。其结果,未接收到ACK的主机进行重写处理,在能够再传送CBW的情况下,将该CBW不是写入到EP1区域63,而是写入到CBW区域61。由此,可以实现合适的数据传送。When a CRC error occurs, as shown in E1 in FIG. 15 , no ACK is returned to the host. Then, the transaction management circuit 36 outputs TranStatus indicating a CRC error indicated by E2 to the endpoint management circuit 40 . Therefore, in this case, unlike the case of C20 in FIG. 13 , EnCBW at the end point EP1 does not become L level as shown in E3 in FIG. 15 . Therefore, as indicated by E4, EPsel does not change, and the area switching from the CBW area 61 to the EP1 area 63 is not performed. As a result, the host that has not received the ACK performs rewriting processing, and if the CBW can be retransmitted, writes the CBW in the CBW area 61 instead of the EP1 area 63 . Thereby, appropriate data transfer can be realized.

2.4.3触发差错2.4.3 Trigger errors

图16是在命令阶段中产生触发差错情况下的定时波形图。Fig. 16 is a timing waveform diagram in the case where a trigger error occurs in the command phase.

首先,用图17A、图17B说明触发差错。First, a trigger error will be described with reference to FIGS. 17A and 17B.

在USB中,为了在主机和装置之间将事务的排序进行同步,如图17A所示,作为数据的PID,准备DATA0和DATA1,同时在主机和装置中具有触发比特(主机和装置之间用于将事务的排序进行同步的比特)。In USB, in order to synchronize the ordering of transactions between the host and the device, as shown in FIG. 17A, DATA0 and DATA1 are prepared as the PID of the data, and at the same time, there are trigger bits in the host and the device (used between the host and the device) bits used to synchronize the ordering of transactions).

而且,如图17A所示,主机和装置以判断为事务成功为条件,来触发数据的PID中包含的DATA0和DATA1及触发比特。Furthermore, as shown in FIG. 17A , the host and the device trigger DATA0 and DATA1 included in the PID of the data and the trigger bit on the condition that the transaction is determined to be successful.

例如,如图17A的G1所示,如果相对于发送数据(DATA1)适当返回ACK,则主机判断为事务成功,触发主机侧的触发比特。For example, as shown in G1 of FIG. 17A , if ACK is properly returned for the transmitted data (DATA1), the host determines that the transaction is successful, and triggers the trigger bit on the host side.

此外,如G2所示,如果从主机传送下次要到来的数据(PID=DATA1),将ACK返回到主机,则装置判断为事务成功,触发装置侧的触发比特。In addition, as shown in G2, if the next incoming data (PID=DATA1) is transmitted from the host and ACK is returned to the host, the device determines that the transaction is successful and triggers the trigger bit on the device side.

另一方面,如图17B的G3所示,在对发送的数据(PID=DATA1)未适当地返回ACK的情况下,主机判断为事务不成功,不触发主机侧的触发比特。然后,如G4所示,对装置再传送PID=DATA1的数据。On the other hand, as shown in G3 of FIG. 17B , when the transmitted data (PID=DATA1) is not properly returned with ACK, the host determines that the transaction is unsuccessful, and the trigger bit on the host side is not triggered. Then, as shown in G4, the data of PID=DATA1 is retransmitted to the device.

于是,如G5所示,由于具有PID=DATA0的数据,可以传送PID=DATA1的数据,所以装置判断为触发差错,不触发装置侧的触发比特。然后,在这种情况下,装置废弃该PID=DATA1的数据,并且对主机返回ACK。于是,在主机和装置之间可以确保事务的连续性。Then, as shown in G5, since there is data of PID=DATA0 and data of PID=DATA1 can be transmitted, the device judges that it is a trigger error and does not trigger the trigger bit on the device side. Then, in this case, the device discards the data of PID=DATA1, and returns ACK to the host. Thus, continuity of transactions can be ensured between the host and the device.

在本实施例中,在发生这样的触发差错的情况下,即使对主机返回确认ACK,也不进行从CBW区域61向EP1区域63的区域切换。In this embodiment, when such a trigger error occurs, even if an acknowledgment ACK is returned to the master, area switching from the CBW area 61 to the EP1 area 63 is not performed.

即,在触发差错的情况下,如图16的F1所示,对主机返回ACK。然后,事务管理电路36对端点管理电路40输出如F2所示的表示触发差错的TranStatus。于是,在这种情况下,如图16的F3所示,端点EP1的EnCBW不变为L电平。因此,如F4所示,EPsel也不变化,不进行从CBW区域向EP1区域63的区域切换。由此,即使在触发差错的情况下也可以实现合适的数据传送处理。That is, in the case of a trigger error, as shown by F1 in FIG. 16 , ACK is returned to the host. Then, the transaction management circuit 36 outputs a TranStatus indicating a trigger error as indicated by F2 to the endpoint management circuit 40 . Therefore, in this case, as shown by F3 in FIG. 16 , EnCBW at the end point EP1 does not become L level. Therefore, as indicated by F4, EPsel also does not change, and area switching from the CBW area to the EP1 area 63 is not performed. As a result, suitable data transfer processing can be achieved even in the event of a trigger error.

2.5比较例和本实施例的比较2.5 Comparative example and the comparison of present embodiment

在图18A中示出比较例(图6A~图6D)的定时波形图的示例,在图18B中示出本实施例的定时波形图。图18A、图18B是缓冲器的存储区域为双缓冲器构造情况下的定时波形图。An example of a timing waveform diagram of the comparative example (FIGS. 6A to 6D ) is shown in FIG. 18A , and a timing waveform diagram of the present embodiment is shown in FIG. 18B . 18A and 18B are timing waveform diagrams in the case where the storage area of the buffer is a double buffer structure.

例如,在图18A的比较例中,在命令阶段中,如H1所示,来自主机的CBW被写入在EP1用的FIFO(图6A的600)中。此时,FIFO在双缓冲器构造的情况下,如H2所示,对于来自主机的第一个OUT数据,可以在FIFO中写入。但是,对于下一个OUT数据不能在FIFO中写入,所以如H3所示,对于来自主机的下个OUT数据的请求,将NYET返回。For example, in the comparative example of FIG. 18A, in the command phase, as indicated by H1, the CBW from the host is written in the FIFO for EP1 (600 in FIG. 6A). At this time, when FIFO is constructed with a double buffer, as shown in H2, the first OUT data from the host can be written in FIFO. However, the next OUT data cannot be written in the FIFO, so as shown in H3, NYET is returned to the next OUT data request from the host.

然后,如H4所示,即使主机可发送查询在FIFO中是否有空缺的PING信息包,如H5所示,装置也将NAK返回。即,在CPU的命令解释结束之前,装置对主机继续返回NAK。然后,命令解释结束,如果在FIFO中产生空缺,则如H6所示,接收来自主机的OUT数据,可以在FIFO中写入。Then, as shown in H4, even if the host can send a PING packet to inquire whether there is a vacancy in the FIFO, as shown in H5, the device will return NAK. That is, the device continues to return NAK to the host until the CPU's command interpretation is completed. Then, the command interpretation ends, and if a vacancy occurs in the FIFO, as indicated by H6, the OUT data from the host is received and can be written in the FIFO.

对此,在本实施例中,如图18B的H7所示,在CBW区域中写入CBW,如果适当地返回ACK,则如H8所示,EnCBW变为L电平(参照图13的C20)。于是,如图7B中说明的那样,进行从CBW区域向EP1区域的切换,将端点EP1连接到EP1区域。In this regard, in this embodiment, as shown in H7 of FIG. 18B, CBW is written in the CBW area, and when ACK is returned appropriately, EnCBW becomes L level as shown in H8 (see C20 in FIG. 13 ). . Then, as described in FIG. 7B , switching is performed from the CBW area to the EP1 area, and the end point EP1 is connected to the EP1 area.

因此,如H9所示,可以将端点中的来自主机的OUT数据写入到该EP1区域,可以对主机返回ACK。然后,如H10所示,如果命令解释结束,则如H11所示,然后使用该EP1区域可以开始后级的硬盘驱动器等之间的DMA传送,可以高效率地传送来自USB的数据。Therefore, as shown in H9, the OUT data from the host in the endpoint can be written into this EP1 area, and ACK can be returned to the host. Then, as shown in H10, when the command interpretation is completed, as shown in H11, DMA transfer between subsequent hard disk drives and the like can be started using this EP1 area, and data from the USB can be efficiently transferred.

于是,在本实施例中,与比较例相比,可以早开始数据的DMA传送,所以可以将总线频带的损失抑制到最小限度,与比较例相比,可以提高有效的数据传送速度。Therefore, in this embodiment, the DMA transfer of data can be started earlier than in the comparative example, so that the loss of the bus bandwidth can be suppressed to a minimum, and the effective data transfer speed can be increased compared with the comparative example.

图19A表示比较例的情况下的固件(CPU)的处理流程图,图19B表示本实施例情况下的固件的处理流程图。FIG. 19A shows a processing flowchart of the firmware (CPU) in the case of the comparative example, and FIG. 19B shows a processing flowchart of the firmware in the case of the present embodiment.

在图19A的比较例中,固件首先判断OUT事务是否结束(步骤S1)。即,等待从装置返回图18A的H1的ACK。In the comparative example of FIG. 19A, the firmware first judges whether or not the OUT transaction has ended (step S1). That is, it waits for the slave to return the ACK of H1 in FIG. 18A .

然后,在判断为OUT事务结束的情况下,固件从EP1用的FIFO中读取CBW(步骤S2)。然后,判断数据长度是否为31字节(数据长度是否合适)(步骤S3),在31字节的情况下进行命令解释(步骤S4),移动至命令处理(步骤S5)。另一方面,在不为31字节的情况下,移动至差错处理(步骤S6)。Then, when it is judged that the OUT transaction is completed, the firmware reads the CBW from the FIFO for EP1 (step S2). Then, it is judged whether the data length is 31 bytes (whether the data length is appropriate) (step S3), and in the case of 31 bytes, command interpretation is performed (step S4), and the command process is moved to (step S5). On the other hand, when it is not 31 bytes, it moves to error processing (step S6).

在图19B的本实施例中,固件首先判断图18B的H7所示的CBW的事务(对CBW区域的读取)是否正好结束(步骤S11)。然后,在CBW的事务未结束的情况下,判断是否有CBW差错(步骤S12),在CBW差错的情况下移动至差错处理(步骤S16)。另一方面,在没有CBW差错的情况下,返回到步骤S11,等待CBW的事务的结束。In the present embodiment of FIG. 19B, the firmware first judges whether or not the CBW transaction (reading of the CBW area) indicated by H7 in FIG. 18B has just ended (step S11). Then, when the CBW transaction is not completed, it is judged whether there is a CBW error (step S12), and when the CBW error occurs, the process proceeds to error processing (step S16). On the other hand, if there is no CBW error, it returns to step S11 and waits for the end of the CBW transaction.

例如,在图14的数据长度差错的情况下,判断为CBW差错,移动至步骤S16的差错处理。另一方面,在图16的触发差错的情况下,不判断为CBW差错,从步骤S12返回到步骤S11。For example, in the case of an error in the data length shown in FIG. 14 , it is judged to be a CBW error, and the process proceeds to error processing in step S16 . On the other hand, in the case of a trigger error in FIG. 16, it is not judged as a CBW error, and the process returns from step S12 to step S11.

另一方面,在图13的数据传送成功的情况下,判断为CBW的事务结束,EnCBW变为L电平。然后,固件从CBW区域读取CBW(步骤S13),进行命令解释(步骤S14),移动至命令处理(步骤S15)。这种情况下,如图8A、图8B中的说明,在本实施例中将CBW区域设定为可随机存取,所以与比较例相比,可以尽快结束命令解释,可以尽快移动到DMA传送。On the other hand, when the data transfer in FIG. 13 is successful, it is determined that the transaction of CBW is completed, and EnCBW becomes L level. Then, the firmware reads the CBW from the CBW area (step S13), performs command interpretation (step S14), and moves to command processing (step S15). In this case, as described in Fig. 8A and Fig. 8B, in this embodiment, the CBW area is set to be random access, so compared with the comparative example, the command interpretation can be completed as soon as possible, and the DMA transmission can be moved to as soon as possible. .

3.电子装置3. Electronic devices

下面,说明包括本实施例的数据传送控制装置的电子装置的实例。Next, an example of an electronic device including the data transfer control device of the present embodiment will be described.

例如,图20A表示作为一个电子装置的打印机的内部方框图,图21A表示其外观图。CPU(微计算机)510进行系统整体的控制等。操作部511用于用户操作打印机。在ROM516中,存储控制程序、字体等,RAM517具有作为CPU510的工作区域的功能。DMAC518是不通过CPU510进行数据传送的DMA控制器。显示板519将打印机的工作状态通知给用户。For example, FIG. 20A shows an internal block diagram of a printer as an electronic device, and FIG. 21A shows its external view. A CPU (microcomputer) 510 performs control and the like of the entire system. The operation unit 511 is used for the user to operate the printer. ROM516 stores a control program, fonts, etc., and RAM517 functions as a work area of CPU510. DMAC518 is a DMA controller that performs data transfer without CPU510. The display panel 519 notifies the user of the working status of the printer.

通过USB可从个人计算机等其它装置传送的串行的打印数据由数据传送控制装置5000变换为并行的打印数据。然后,变换后的并行打印数据通过CPU510或DMAC518传送到打印处理部(打印机引擎)512。然后,在打印处理部512中,对并行打印数据实施所给与的处理,通过打印头等组成的打印部(进行数据的输出处理的装置)514而打印输出到纸上。Serial print data transferable from other devices such as a personal computer via USB is converted into parallel print data by the data transfer control device 5000 . Then, the converted parallel print data is sent to the print processing unit (printer engine) 512 via the CPU 510 or the DMAC 518 . Then, in the print processing unit 512, given processing is performed on the parallel print data, and the print unit (device that performs data output processing) 514 composed of a print head and the like prints out the data on paper.

图20B表示作为一个电子装置的扫描仪的内部方框图,图21B表示其外观图。CPU520进行系统整体的控制等。操作部521用于用户操作扫描仪。在ROM526中,存储控制程序等,RAM527具有作为CPU510的工作区域的功能。DMAC528是DMA控制器。FIG. 20B shows an internal block diagram of a scanner as an electronic device, and FIG. 21B shows its external view. CPU520 performs control etc. of the whole system. The operation unit 521 is used for the user to operate the scanner. ROM526 stores a control program and the like, and RAM527 functions as a work area for CPU510. DMAC528 is a DMA controller.

通过光源、光电变换器等组成的图像读取部(进行数据的读取处理的装置)522读取原稿的图像,读取出的图像的数据由图像处理部(扫描仪引擎)524进行处理。然后,处理后的图像数据通过CPU520或DMAC528传送到数据传送控制装置500。数据传送控制装置500将该并行的图像数据变换为串行数据,通过USB发送到个人计算机等其他装置。An image reading unit (device for reading data) 522 composed of a light source, a photoelectric transducer, etc. reads an image of a document, and the read image data is processed by an image processing unit (scanner engine) 524 . Then, the processed image data is transferred to the data transfer control device 500 via the CPU 520 or the DMAC 528 . The data transfer control device 500 converts the parallel image data into serial data, and sends it to other devices such as a personal computer via USB.

图20C表示作为一个电子装置的CD-RW驱动器的内部方框图,图21表示其外观图。CPU530进行系统整体的控制等。操作部531用于用户操作CD-RW。在ROM536中存储控制程序等,RAM537具有作为CPU530的工作区域的功能。DMAC538是DMA控制器。Fig. 20C shows an internal block diagram of a CD-RW drive as an electronic device, and Fig. 21 shows its external view. CPU530 performs control etc. of the whole system. The operation unit 531 is used for the user to operate the CD-RW. A control program and the like are stored in ROM536, and RAM537 functions as a work area of CPU530. DMAC538 is a DMA controller.

由激光器、电机、光学系统等组成的读取和写入部(进行数据的取入处理的装置或进行数据的存储处理的装置)533从CD-RW532读取出的数据被输入到信号处理部534,实施纠错处理等所给与的信号处理。然后,实施了信号处理的数据通过CPU530或DMAC538被传送到数据传送控制装置500。数据传送控制装置500将该并行的图像数据变换为串行数据,通过USB发送到个人计算机等其他装置。The data read from the CD-RW 532 is input to the signal processing unit by the reading and writing unit (a device for taking in data or a device for storing data) 533 composed of a laser, a motor, an optical system, etc. 534. Perform given signal processing such as error correction processing. Then, the data subjected to signal processing is transferred to the data transfer control device 500 via the CPU 530 or the DMAC 538 . The data transfer control device 500 converts the parallel image data into serial data, and sends it to other devices such as a personal computer via USB.

另一方面,通过USB从其他装置传送来的串行数据由数据传送控制装置500变换为并行数据。然后,该并行数据通过CPU530或DMAC538被送至信号处理部534。然后,在信号处理部534中对该并行数据实施所给与的信号处理,通过读取和写入部533而存储到CD-RW532中。On the other hand, serial data transferred from another device via USB is converted into parallel data by the data transfer control device 500 . And this parallel data is sent to the signal processing part 534 via CPU530 or DMAC538. Then, given signal processing is performed on the parallel data in the signal processing unit 534 , and the data is stored in the CD-RW 532 through the read/write unit 533 .

在图20A、图20B、图20C中,除了CPU510、520、530以外,还可以分别设置数据传送控制装置500中的用于数据传送控制的CPU。In FIG. 20A , FIG. 20B , and FIG. 20C , in addition to CPUs 510 , 520 , and 530 , CPUs for data transfer control in data transfer control device 500 may be provided, respectively.

如果将本实施例的数据传送控制装置用于电子装置,则可以适当进行USB2.0中的HS模式下的数据传送。因此,在用户通过个人计算机等指示打印输出的情况下,至少以实时来结束打印。此外,在对扫描仪指示图像读取后,用户可以在少的延时下观察读取图像。此外,可以高速地进行来自CD-RW的数据的读取、以及对CD-RW的数据的写入。If the data transfer control device of this embodiment is used in an electronic device, data transfer in the HS mode in USB2.0 can be appropriately performed. Therefore, when the user instructs a printout through a personal computer or the like, the printing is completed at least in real time. In addition, after instructing the scanner to read the image, the user can observe the read image with little delay. In addition, reading of data from the CD-RW and writing of data to the CD-RW can be performed at high speed.

此外,如果将本实施例的数据传送控制装置用于电子装置,则即使是制造成本便宜的普通的半导体处理器,也可以制造能够进行HS模式的数据传送的数据传送控制装置。因此,可实现数据传送控制装置的低成本化,还可实现电子装置的低成本化。此外,可以提高数据传送的可靠性,还可以提高电子装置的可靠性。Furthermore, if the data transfer control device of this embodiment is used in an electronic device, it is possible to manufacture a data transfer control device capable of data transfer in the HS mode even with an ordinary semiconductor processor which is inexpensive to manufacture. Therefore, the cost reduction of the data transfer control device can be realized, and the cost reduction of the electronic device can also be realized. In addition, the reliability of data transmission can be improved, and the reliability of electronic devices can also be improved.

此外,如果将本实施例的数据传送控制装置用于电子装置,则可减轻在CPU上操作的固件的处理负荷,可以使用便宜的CPU。而且,可实现数据传送控制装置的低成本化、小规模化,所以还可实现电子装置的低成本化、小规模化。In addition, if the data transfer control device of this embodiment is used in an electronic device, the processing load of firmware operating on the CPU can be reduced, and an inexpensive CPU can be used. Furthermore, cost reduction and downsizing of the data transfer control device can be realized, so that cost reduction and downsizing of the electronic device can also be realized.

作为可以采用本实施例的数据传送控制装置的电子装置,除了上述以外,例如有各种光盘驱动器(CD-ROM、DVD)、光磁盘驱动器(MO)、硬盘驱动器、TV、VTR、摄象机、音响设备、电话机、投影仪、个人计算机、电子笔记本、文字处理器等各种装置。As electronic devices that can adopt the data transfer control device of this embodiment, in addition to the above, there are, for example, various optical disk drives (CD-ROM, DVD), optical disk drives (MO), hard disk drives, TVs, VTRs, video cameras, etc. , audio equipment, telephones, projectors, personal computers, electronic notebooks, word processors and other devices.

本发明不限定于本实施例,在本发明的主要精神范围内可以进行各种变形实施。The present invention is not limited to this embodiment, and various modifications can be made within the scope of the main spirit of the present invention.

例如,本发明的数据传送控制装置的构成不限定于图9、图10、图11所示的构成,可进行各种变形实施。For example, the configuration of the data transfer control device of the present invention is not limited to the configurations shown in FIGS. 9 , 10 , and 11 , and various modifications can be made.

在本实施例中,说明了第1存储区域是CBW区域(命令存储区域),第2存储区域是EP1区域(数据存储区域)的情况,但本发明不限定于此。即,在第1、第2存储区域中存储的信息的种类是任意的。此外,端点中设定的信息的数目也可以在3以上,信息的种类也是任意的。In this embodiment, the case where the first storage area is the CBW area (command storage area) and the second storage area is the EP1 area (data storage area) has been described, but the present invention is not limited thereto. That is, the types of information stored in the first and second storage areas are arbitrary. In addition, the number of information set in the endpoint may be three or more, and the types of information are also arbitrary.

此外,在本实施例中,说明了对USB的Bulk-Only标准的应用例,但本发明应用的标准不限定于USB的Bulk-Only标准。In addition, in this embodiment, an application example to the USB Bulk-Only standard is described, but the standard to which the present invention is applied is not limited to the USB Bulk-Only standard.

此外,第1、第2存储区域的切换方法也不限定于图7A~图19B中详细说明的方法,可进行各种变形实施。In addition, the method of switching between the first and second storage areas is not limited to the method described in detail in FIGS. 7A to 19B , and various modifications can be made.

此外,本发明特别期望采用USB2.0中的数据传送,但并不限定于此。例如,即使是基于与USB2.0同样的思想的标准或使USB2.0发展的标准中的数据传送,本发明都可以应用。In addition, the present invention particularly expects to adopt data transmission in USB2.0, but is not limited thereto. For example, the present invention can be applied even to data transfer in a standard based on the same idea as USB2.0 or a standard developed from USB2.0.

Claims (17)

1. a data transmission control device is used for transmitting by the data of bus, it is characterized in that, comprising:
Impact damper comprises in distribution under the situation of multiple information as the information that transmits by an end points of the 1st, the 2nd information, and the 2nd storage area that the 1st storage area that the 1st information of preparing is used and the 2nd information are used comes corresponding to an end points; And
The buffer management circuit, in the 1st stage of transmitting the 1st information by bus, to be written to described the 1st storage area that the 1st information is used to the information that end points transmits from main frame, and in the 2nd stage of transmitting the 2nd information by bus, will be written to described the 2nd storage area that the 2nd information is used to the information that end points transmits from main frame;
To be set in the random-access zone of the information of can carrying out for the 1st information with described the 1st storage area of preparing;
To be set in the zone of the information elder generation output that will import previously for the 2nd information with described the 2nd storage area of preparing.
2. data transmission control device as claimed in claim 1 is characterized in that:
In the zone beyond the beginning address of described the 1st storage area of storage the 1st information, write that indication transmits the command block of the 2nd information and at least one information of the length information of the 2nd information that transmits by the command block indication.
3. data transmission control device as claimed in claim 1 is characterized in that:
Carry out with the specification of USB (universal serial bus) is the data transmission of standard.
4. a data transmission control device is used for transmitting by the data of bus, it is characterized in that: comprising:
Impact damper comprises in distribution under the situation of multiple information as the information that transmits by an end points of the 1st, the 2nd information, and the 2nd storage area that the 1st storage area that the 1st information of preparing is used and the 2nd information are used comes corresponding to an end points; And
The buffer management circuit, in the 1st stage of transmitting the 1st information by bus, to be written to described the 1st storage area that the 1st information is used to the information that end points transmits from main frame, and in the 2nd stage of transmitting the 2nd information by bus, will be written to described the 2nd storage area that the 2nd information is used to the information that end points transmits from main frame;
Being returned to main frame with the affirmation that transmits for the data in described the 1st stage is condition, the writing the zone and switch to described the 2nd storage area from described the 1st storage area of the information that will transmit to end points from main frame.
5. data transmission control device as claimed in claim 4 is characterized in that:
Trigger under the situation that bit produces mistake in the ordering data in synchronization that is used for carrying out issued transaction between the main frame,, also do not carry out from of the switching of described the 1st storage area to described the 2nd storage area even be returned under the situation of main frame confirming.
6. data transmission control device as claimed in claim 4 is characterized in that:
Carry out with the specification of USB (universal serial bus) is the data transmission of standard.
7. a data transmission control device is used for transmitting by the data of bus, it is characterized in that: comprising:
Impact damper comprises in distribution under the situation of multiple information as the information that transmits by an end points of the 1st, the 2nd information, and the 2nd storage area that the 1st storage area that the 1st information of preparing is used and the 2nd information are used comes corresponding to an end points; And
The buffer management circuit, in the 1st stage of transmitting the 1st information by bus, to be written to described the 1st storage area that the 1st information is used to the information that end points transmits from main frame, and in the 2nd stage of transmitting the 2nd information by bus, will be written to described the 2nd storage area that the 2nd information is used to the information that end points transmits from main frame;
Described the 1st information is the packets of information of command block;
Described the 2nd information is the packets of information according to the data of the indication transmission of described command block.
8. data transmission control device as claimed in claim 7 is characterized in that:
Explain in processing element during the packets of information of described command block, the packets of information of data is written to described the 2nd storage area.
9. data transmission control device as claimed in claim 7 is characterized in that:
Carry out with the specification of USB (universal serial bus) is the data transmission of standard.
10. a data transmission control device is used for transmitting by the data of bus, it is characterized in that, comprising:
Impact damper, under the situation of packets of information as the information that transmits by an end points of the packets of information of assignment commands piece and data, the data storage areas that comes demanded storage zone that the warning order piece uses and data to use corresponding to an end points; And
The buffer management circuit, under the situation of the data phase that switches to the packets of information by bus transmissioning data from the command phase of transmitting the packets of information of command block by bus, the described demanded storage zone that makes piece use of obeying the order, zone that writes of information is switched to the data storage areas that data are used, and the packets of information of the data that will transmit to end points from main frame be written to described data storage areas.
11. the data transmission control device as claim 10 is characterized in that:
Carry out with the specification of USB (universal serial bus) is the data transmission of standard.
12. an electronic installation is characterized in that, comprising:
Any one data transmission control device as claim 1 to 9; And
The output of carrying out the data that transmit by described data transmission control device and bus is handled or is taken into and handles or the device of stores processor.
13. an electronic installation is characterized in that, comprising:
Any one data transmission control device as claim 10 or 11; And
The output of carrying out the data that transmit by described data transmission control device and bus is handled or is taken into and handles or the device of stores processor.
14. a control method for data transfer is used for transmitting by the data of bus, it is characterized in that:
Comprise in distribution under the situation of multiple information as the information that transmits by an end points of the 1st, the 2nd information, the 2nd storage area that the 1st storage area that the 1st information of preparing on impact damper is used and the 2nd information are used comes corresponding to an end points; And
In the 1st stage of transmitting the 1st information by bus, to be written to described the 1st storage area that the 1st information is used to the information that end points transmits from main frame, and in the 2nd stage of transmitting the 2nd information by bus, will be written to described the 2nd storage area that the 2nd information is used to the information that end points transmits from main frame;
To be set in the random-access zone of the information of can carrying out for the 1st information with described the 1st storage area of preparing;
To be set in the zone of the information elder generation output that will import previously for the 2nd information with described the 2nd storage area of preparing.
15. a control method for data transfer is used for transmitting by the data of bus, it is characterized in that:
Comprise in distribution under the situation of multiple information as the information that transmits by an end points of the 1st, the 2nd information, the 2nd storage area that the 1st storage area that the 1st information of preparing on impact damper is used and the 2nd information are used comes corresponding to an end points; And
In the 1st stage of transmitting the 1st information by bus, to be written to described the 1st storage area that the 1st information is used to the information that end points transmits from main frame, and in the 2nd stage of transmitting the 2nd information by bus, will be written to described the 2nd storage area that the 2nd information is used to the information that end points transmits from main frame;
Being returned to main frame with the affirmation that transmits for the data in described the 1st stage is condition, the writing the zone and switch to described the 2nd storage area from described the 1st storage area of the information that will transmit to end points from main frame.
16. a control method for data transfer is used for transmitting by the data of bus, it is characterized in that:
Comprise in distribution under the situation of multiple information as the information that transmits by an end points of the 1st, the 2nd information, the 2nd storage area that the 1st storage area that the 1st information of preparing on impact damper is used and the 2nd information are used comes corresponding to an end points; And
In the 1st stage of transmitting the 1st information by bus, to be written to described the 1st storage area that the 1st information is used to the information that end points transmits from main frame, and in the 2nd stage of transmitting the 2nd information by bus, will be written to described the 2nd storage area that the 2nd information is used to the information that end points transmits from main frame;
Described the 1st information is the packets of information of command block;
Described the 2nd information is the packets of information according to the data of the indication transmission of described command block.
17. a control method for data transfer is used for transmitting by the data of bus, it is characterized in that:
Under the situation of packets of information as the information that transmits by an end points of the packets of information of assignment commands piece and data, the data storage areas that demanded storage zone that the warning order piece is used on impact damper and data are used is next corresponding to an end points; And
Under the situation of the data phase that switches to the packets of information by bus transmissioning data from the command phase of transmitting the packets of information of command block by bus, the described demanded storage zone that makes piece use of obeying the order, zone that writes of information is switched to the data storage areas that data are used, and the packets of information of the data that will transmit to end points from main frame be written to described data storage areas.
CNB021193835A 2001-05-14 2002-05-14 Data transmission controller, electronic device and data transmission method Expired - Lifetime CN100351816C (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2001143429A JP3680762B2 (en) 2001-05-14 2001-05-14 Data transfer control device and electronic device
JP143429/01 2001-05-14

Publications (2)

Publication Number Publication Date
CN1385794A CN1385794A (en) 2002-12-18
CN100351816C true CN100351816C (en) 2007-11-28

Family

ID=18989582

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB021193835A Expired - Lifetime CN100351816C (en) 2001-05-14 2002-05-14 Data transmission controller, electronic device and data transmission method

Country Status (8)

Country Link
US (1) US7051124B2 (en)
EP (1) EP1260909B1 (en)
JP (1) JP3680762B2 (en)
KR (2) KR100474220B1 (en)
CN (1) CN100351816C (en)
AT (1) ATE303632T1 (en)
DE (1) DE60205809T2 (en)
TW (1) TWI256551B (en)

Families Citing this family (26)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3680763B2 (en) * 2001-05-14 2005-08-10 セイコーエプソン株式会社 Data transfer control device and electronic device
JP3955512B2 (en) * 2002-08-27 2007-08-08 富士通株式会社 Data processing apparatus and packet discrimination method
US6993619B2 (en) 2003-03-28 2006-01-31 International Business Machines Corporation Single request data transfer regardless of size and alignment
JP4063200B2 (en) 2003-11-18 2008-03-19 セイコーエプソン株式会社 Data transfer control device and electronic device
JP3979381B2 (en) * 2003-11-18 2007-09-19 セイコーエプソン株式会社 Data transfer control device and electronic device
JP4412191B2 (en) 2005-02-04 2010-02-10 セイコーエプソン株式会社 Data transfer control device and electronic device
US7640378B2 (en) * 2005-03-11 2009-12-29 Icron Technologies Corporation Method and apparatus for improving the performance of USB mass storage devices in the presence of long transmission delays
JP4601467B2 (en) * 2005-03-16 2010-12-22 三洋電機株式会社 Recording apparatus, recording system, and data recording method
JP4404023B2 (en) * 2005-06-30 2010-01-27 セイコーエプソン株式会社 Data transfer control device and electronic device
JP4442523B2 (en) * 2005-06-30 2010-03-31 セイコーエプソン株式会社 Data transfer control device and electronic device
JP4337783B2 (en) 2005-06-30 2009-09-30 セイコーエプソン株式会社 Data transfer control device and electronic device
JP2007172574A (en) 2005-11-25 2007-07-05 Seiko Epson Corp Integrated circuit device and electronic apparatus
JP4391548B2 (en) 2007-04-20 2009-12-24 株式会社メディアロジック Device driver
TW200945052A (en) * 2008-04-21 2009-11-01 Ralink Technology Corp Method for increasing USB transmission rate
KR101012208B1 (en) * 2008-06-17 2011-02-08 주식회사 동부하이텍 How to increase the end point memory efficiency in a USB device
US7818486B2 (en) * 2008-08-15 2010-10-19 Icron Technologies Corporation Method and apparatus for connecting USB devices to a remote computer
US20100306442A1 (en) * 2009-06-02 2010-12-02 International Business Machines Corporation Detecting lost and out of order posted write packets in a peripheral component interconnect (pci) express network
CN102023957B (en) * 2009-09-18 2012-10-17 联芯科技有限公司 Method for stimulating multiple serial ports by a USB interface for transmitting data and USB compound device
TWI450101B (en) * 2010-09-21 2014-08-21 Insyde Software Corp Remote data transmitting method and virtual media system using the method
US8566934B2 (en) 2011-01-21 2013-10-22 Gigavation, Inc. Apparatus and method for enhancing security of data on a host computing device and a peripheral device
WO2013023105A1 (en) 2011-08-10 2013-02-14 Srivastava Gita Apparatus and method for enhancing security of data on a host computing device and a peripheral device
TW201331925A (en) * 2012-01-19 2013-08-01 Sitronix Technology Corp Transmission interface, transmission method, drive circuit, display device and electronic device
JP6065542B2 (en) * 2012-11-26 2017-01-25 ブラザー工業株式会社 Image processing apparatus and communication program
US9244694B2 (en) * 2012-12-27 2016-01-26 Intel Corporation Executing a command within a transport mechanism based on a get and set architecture
CN107544936A (en) * 2017-09-18 2018-01-05 珠海亿智电子科技有限公司 A kind of data transmission method based on USB programmings
CN108062281B (en) * 2017-11-07 2020-06-30 珠海研果科技有限公司 Method for solving disconnection of data copying between mass storage device and PC terminal

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0893755A2 (en) * 1997-07-21 1999-01-27 Siemens Aktiengesellschaft Buffer storage device
DE19900331A1 (en) * 1998-01-07 1999-07-08 Nat Semiconductor Corp Universal data bus endpoint module
DE19900345A1 (en) * 1998-01-07 1999-07-08 Nat Semiconductor Corp Universal serial bus endpoint interface
CN1269550A (en) * 1999-03-31 2000-10-11 国际商业机器公司 Dynamic I/O distribution of zoned computer system

Family Cites Families (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5129072A (en) * 1989-03-08 1992-07-07 Hewlett-Packard Company System for minimizing initiator processor interrupts by protocol controller in a computer bus system
IL100127A0 (en) * 1991-03-11 1992-08-18 Future Domain Corp Scsi controller
JP2868141B2 (en) * 1992-03-16 1999-03-10 株式会社日立製作所 Disk array device
US5708668A (en) * 1992-05-06 1998-01-13 International Business Machines Corporation Method and apparatus for operating an array of storage devices
US5504868A (en) * 1994-03-01 1996-04-02 Adaptec, Incorporated SCSI command descriptor block parsing state machine
US5568443A (en) * 1995-09-08 1996-10-22 Smithills Multimedia Systems, Inc. Combination dual-port random access memory and multiple first-in-first-out (FIFO) buffer memories
US6185641B1 (en) * 1997-05-01 2001-02-06 Standard Microsystems Corp. Dynamically allocating space in RAM shared between multiple USB endpoints and USB host
US5944797A (en) 1997-05-28 1999-08-31 International Business Machines Corporation Data mover hardware controlled processing in a commanding system and in a commanded system for controlling frame communications on a link
US6244762B1 (en) * 1997-11-25 2001-06-12 Seiko Epson Corporation Printing apparatus, method of controlling it and storage medium
KR100290729B1 (en) * 1998-01-07 2001-05-15 클라크 3세 존 엠. Apparatus and method of transmitting and receiving usb isochronous data
KR19990069859A (en) * 1998-02-13 1999-09-06 구본준 Youssef's Pimpo
US6065087A (en) * 1998-05-21 2000-05-16 Hewlett-Packard Company Architecture for a high-performance network/bus multiplexer interconnecting a network and a bus that transport data using multiple protocols
US6192446B1 (en) * 1998-09-03 2001-02-20 Micron Technology, Inc. Memory device with command buffer
US6463498B1 (en) * 1998-10-30 2002-10-08 Agilent Technologies, Inc. Transmission of FCP response in the same loop tenancy as the FCP data with minimization of inter-sequence gap
JP3608441B2 (en) 1999-07-15 2005-01-12 セイコーエプソン株式会社 Data transfer control device and electronic device
US6715055B1 (en) * 2001-10-15 2004-03-30 Advanced Micro Devices, Inc. Apparatus and method for allocating buffer space
US6834319B1 (en) * 2002-03-21 2004-12-21 Advanced Micro Devices, Inc. Tunnel device for an input/output node of a computer system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0893755A2 (en) * 1997-07-21 1999-01-27 Siemens Aktiengesellschaft Buffer storage device
DE19900331A1 (en) * 1998-01-07 1999-07-08 Nat Semiconductor Corp Universal data bus endpoint module
DE19900345A1 (en) * 1998-01-07 1999-07-08 Nat Semiconductor Corp Universal serial bus endpoint interface
CN1269550A (en) * 1999-03-31 2000-10-11 国际商业机器公司 Dynamic I/O distribution of zoned computer system

Also Published As

Publication number Publication date
EP1260909B1 (en) 2005-08-31
TWI256551B (en) 2006-06-11
US7051124B2 (en) 2006-05-23
US20020167851A1 (en) 2002-11-14
DE60205809D1 (en) 2005-10-06
DE60205809T2 (en) 2006-06-22
CN1385794A (en) 2002-12-18
JP2002344537A (en) 2002-11-29
EP1260909A2 (en) 2002-11-27
KR100474220B1 (en) 2005-03-08
JP3680762B2 (en) 2005-08-10
EP1260909A3 (en) 2003-05-07
KR100485294B1 (en) 2005-04-27
KR20020087861A (en) 2002-11-23
ATE303632T1 (en) 2005-09-15
KR20040103831A (en) 2004-12-09

Similar Documents

Publication Publication Date Title
CN100351816C (en) Data transmission controller, electronic device and data transmission method
CN1213372C (en) Data transmission control device, electronic device, and data transmission control method
CN1293410A (en) Data transmission control device and electron device
CN1282094C (en) Data transmission controller, electronic equipment and data transmission control method
CN1237455C (en) Data transmission control device, electronic device, and data transmission control method
CN1149806C (en) High performance communication controller
CN1188998C (en) Data transfer control device and electronic appts.
CN1269049C (en) Data transmission control device and electronic equipment
CN1354425A (en) Serial/parallel change-over circuit, data transmitting control device and electronic equipment
CN1586063A (en) Stream data processing device, stream data processing method, program, and medium
CN1146798C (en) Data transmission control device and electronic equipment
CN1551592A (en) Data transmission control device, electronic device and data transmission control method
CN1873689A (en) Image processing device, method, and storage medium which stores a program
CN1607513A (en) Data transfer control device, electronic instrument, and data transfer control method
CN1119001C (en) Data communication system, data communication method and data communication apparatus
CN101038572A (en) Data transfer device and data transfer system
CN1275164C (en) Liquid crystal display device
CN1146801C (en) Data transmission control device and electron device
CN1214592C (en) Direct internal storage access system and method of multiple path data
CN1819554A (en) Data processing system and data interfacing method thereof
CN1175346C (en) device sending data
CN1179521C (en) Data transmission control devices and electronic instruments
CN1749978A (en) Disk Controller with Logical Partitioning Capabilities
CN1703878A (en) Data processing system
CN1680930A (en) Systems and controllers that reduce bus usage time

Legal Events

Date Code Title Description
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CX01 Expiry of patent term

Granted publication date: 20071128

CX01 Expiry of patent term