KR100563418B1 - Communication controller and method - Google Patents
Communication controller and method Download PDFInfo
- Publication number
- KR100563418B1 KR100563418B1 KR1020030030947A KR20030030947A KR100563418B1 KR 100563418 B1 KR100563418 B1 KR 100563418B1 KR 1020030030947 A KR1020030030947 A KR 1020030030947A KR 20030030947 A KR20030030947 A KR 20030030947A KR 100563418 B1 KR100563418 B1 KR 100563418B1
- Authority
- KR
- South Korea
- Prior art keywords
- packet
- buffer
- data
- packets
- communication
- Prior art date
Links
- 238000004891 communication Methods 0.000 title claims abstract description 129
- 238000000034 method Methods 0.000 title claims abstract description 18
- 230000005540 biological transmission Effects 0.000 claims description 55
- 230000007704 transition Effects 0.000 claims description 21
- 239000000872 buffer Substances 0.000 description 364
- 230000015654 memory Effects 0.000 description 125
- 230000004044 response Effects 0.000 description 11
- 238000010586 diagram Methods 0.000 description 9
- 238000013500 data storage Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 230000002093 peripheral effect Effects 0.000 description 3
- 101000941170 Homo sapiens U6 snRNA phosphodiesterase 1 Proteins 0.000 description 1
- 102100031314 U6 snRNA phosphodiesterase 1 Human genes 0.000 description 1
- 230000003139 buffering effect Effects 0.000 description 1
- 230000015556 catabolic process Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000006731 degradation reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/54—Store-and-forward switching systems
- H04L12/56—Packet switching systems
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L49/00—Packet switching elements
- H04L49/90—Buffering arrangements
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2213/00—Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F2213/0042—Universal serial bus [USB]
Abstract
패킷 단위로 정보를 통신할 때, 통신하고 있는 호스트와의 사이에서 수신거부의 상태가 발생하는 것을 억제할 수 있는 통신 컨트롤러 및 통신방법을 제공한다. 본 발명의 통신 컨트롤러는, 1 패킷에 포함되는 정보량이 상이한 복수의 통신 모드에 대응한 정보를 패킷 단위로 수신하여, 일시적으로 저장한 후에 송신하는 통신 컨트롤러로, 수신된 정보를 일시적으로 저장하는 기억수단과, 통신 모드에 따라 기억수단에 저장하는 패킷 수를 제어하는 제어수단을 구비하고, 제어수단은, 기억수단에 복수의 패킷을 저장할 수 있는 통신 모드의 경우에는 기억수단에 복수 패킷의 저장장소를 설정하여 복수의 패킷을 기억수단에 일시적으로 저장시키는 것이다.Provided are a communication controller and a communication method capable of suppressing occurrence of a state of rejection between a communicating host and communicating information on a packet basis. The communication controller according to the present invention is a communication controller that receives, in a packet unit, information corresponding to a plurality of communication modes having different amounts of information contained in one packet, and temporarily stores and stores the received information temporarily. Means and control means for controlling the number of packets to be stored in the storage means in accordance with the communication mode, wherein the control means stores a plurality of packets in the storage means in a communication mode in which a plurality of packets can be stored in the storage means. To temporarily store a plurality of packets in the storage means.
패킷, 컨트롤러, USB 인터페이스Packet, Controller, USB Interface
Description
도1은 본 발명의 실시형태에서의 통신 시스템의 개략 블록도.1 is a schematic block diagram of a communication system in an embodiment of the present invention;
도2는 본 발명의 실시형태에서의 데이터를 나타낸 모식도.2 is a schematic diagram showing data in an embodiment of the present invention.
도3은 본 발명의 실시형태에서의 통신 시스템의 통신형식을 나타낸 차트도.Fig. 3 is a chart showing a communication format of a communication system in the embodiment of the present invention.
도4는 본 발명의 실시형태에서의 통신 시스템의 패킷 버퍼의 저장상태를 나타낸 모식도.Fig. 4 is a schematic diagram showing a storage state of a packet buffer of a communication system in the embodiment of the present invention.
도5는 본 발명의 실시형태에서의 통신 시스템의 패킷 버퍼의 저장상태를 나타낸 모식도.Fig. 5 is a schematic diagram showing a storage state of a packet buffer of a communication system in the embodiment of the present invention.
도6는 본 발명의 실시형태에서의 통신 시스템의 패킷 버퍼의 저장상태를 나타낸 모식도.Fig. 6 is a schematic diagram showing a storage state of a packet buffer of a communication system in the embodiment of the present invention.
도7은 본 발명의 실시형태에서의 통신 시스템의 패킷 버퍼의 저장상태의 제어를 나타낸 차트도.Fig. 7 is a chart showing control of the storage state of the packet buffer of the communication system in the embodiment of the present invention.
(도면의 주요 부호에 대한 설명)(Description of Major Symbols in the Drawing)
10 : 디바이스 컨트롤러 11 : USB 인터페이스부10: device controller 11: USB interface unit
12 : 엔드 포인트 컨트롤러 13 : 외부 버스 인터페이스부12: endpoint controller 13: external bus interface unit
14 : 송신 컨트롤러 15 : 송신용 PHY측 제어부14: Transmission controller 15: PHY side control unit for transmission
16 : 송신용 토글 플러그부 17 ; 송신용 BCU측 제어부16:
18 : 송신용 버퍼 인터페이스부 19 : 수신 컨트롤부18: transmission buffer interface unit 19: reception control unit
20 : 수신용 PHY측 제어부 21 : 수신용 토글 플러그부20: reception PHY side control unit 21: reception toggle plug section
22 : 수신용 BCU측 제어부 23 : 수신용 버퍼 인터페이스부22: control unit for reception BCU 23: buffer interface unit for reception
24 : 버퍼 제어부 25 : 메모리24: buffer control unit 25: memory
38 : 트랜잭션 데이터 38a : 토큰 패킷38:
38b : 데이터 패킷 38c : 핸드쉐이크 패킷38b:
42a1, 42a2, 42a3, 42a4, 42a5, 42a6, 42a7, 42a8 : 패킷42a1, 42a2, 42a3, 42a4, 42a5, 42a6, 42a7, 42a8: Packet
42a1, 42a2, 42a3, 42a4, 42a5, 42a6, 42a7, 42a8, 42a9, 42a10, 42a11, 42a12, 42a13, 42a14, 42a15, 42a16 : 패킷 버퍼42a1, 42a2, 42a3, 42a4, 42a5, 42a6, 42a7, 42a8, 42a9, 42a10, 42a11, 42a12, 42a13, 42a14, 42a15, 42a16: Packet Buffer
본 발명은 통신 컨트롤러 및 통신방법에 관한 것으로, 특히 패킷 형식으로 정보를 통신하는 통신 컨트롤러 및 통신방법에 관한 것이다.The present invention relates to a communication controller and a communication method, and more particularly, to a communication controller and a communication method for communicating information in the form of a packet.
종래에, 컴퓨터 본체와 주변기기를 접속할 때, 시리얼 인터페이스 (Serial Interface) 나 패러렐 인터페이스 (Parallel Interface) 등의 주변기기용 인터페이스를 사용하여 접속한다. 또한, 복수의 각종 주변기기를 하나로 연결하는 인터페이스로서 USB (Universal Serial Bus) 나 IEEE1394 등의 시리얼 인터페이스가 등장하여 인터페이스를 통일화시켜 공통화하는 방향으로 가고 있다.Conventionally, when connecting a computer main body and a peripheral device, it connects using a peripheral device interface, such as a serial interface and a parallel interface. In addition, a serial interface such as USB (Universal Serial Bus) or IEEE1394 has emerged as an interface for connecting a plurality of peripheral devices into one, and has been moving toward a unified interface and commonization.
최근의 정보화 사회에 있어서, 대용량의 데이터를 고속으로 통신할 필요성으 로부터, 종래의 USB1.0규격 (USB-1F:USB Implements Forum 에 의한 규격) 등의 USB1.x 규격에 비하여 데이터 전송 레이트가 큰 USB2.0 규격이 개발되고 있다. 종래의 USB1.x 규격에서는 접속모드에 최대 데이터 전송 레이트가 12Mbps의 풀스피드 (Full Speed) 모드 (이하, 이것을 FS 모드로 표기함) 와 1.5Mbps의 로우 스피드 (Low Speed) 모드 (이하, 이것을 LS 모드라 표기함) 가 있으나, USB2.0 규격에서는 이들 모드를 유지한 상태에서, 새로 최대 데이터 전송 레이트가 480Mbps의 하이 스피드 (High Speed) 모드 (이하, 이것을 HS 모드라 표기함) 가 추가되어, 보다 대용량의 데이터를 고속으로 통신할 수 있게 한다.In today's information society, the data transfer rate is higher than the USB1.x standard, such as the USB1.0 standard (USB-1F: USB Implements Forum), due to the necessity of communicating a large amount of data at high speed. The USB2.0 specification is being developed. In the conventional USB 1.x standard, the maximum data transfer rate is 12 Mbps in full speed mode (hereinafter referred to as FS mode) and 1.5 Mbps in low speed mode (hereinafter referred to as LS). In the state of maintaining these modes in the USB 2.0 standard, a new High Speed mode (hereinafter referred to as HS mode) with a maximum data transfer rate of 480 Mbps is added. Enables the communication of large amounts of data at high speed.
이와 같은 USB2.0 규격을 사용하여 펑션 디바이스에서는, 예를 들어 HS 모드로 512 바이트 메모리를 접속한 경우, 512 바이트 메모리를 1 패킷 버퍼 구성으로 사용할 수 있다. 또한, FS 모드로 512 바이트 메모리를 접속한 경우에는 64 바이트를 1 패킷 버퍼 구성으로 사용할 수 있고, HS 모드에 의한 접속에서도 그리고 FS 모드에 의한 접속에서도 512 바이트 메모리를 1 패킷 버퍼로 취급할 수 있으나, FS 모드에서는 벌크 전송 (bulk transfer) 의 최대 패킷 사이즈인 64 바이트를 사용하고 나머지 448 바이트를 사용하지 않는다.In a function device using such a USB 2.0 standard, for example, when 512 byte memory is connected in HS mode, 512 byte memory can be used in a 1 packet buffer configuration. In addition, when 512 bytes of memory are connected in FS mode, 64 bytes can be used in a 1 packet buffer configuration. 512 bytes of memory can be treated as 1 packet buffer in HS mode connection or FS mode connection. In FS mode, the maximum packet size for bulk transfers is 64 bytes and the remaining 448 bytes are not used.
FS 모드로 접속한 경우에는, 펑션 디바이스로 구성되는 시스템의 버퍼는, 64 바이트가 사용되고 나머지 448 바이트는 사용되지 않으나, 512 바이트 메모리의 1 패킷 버퍼로서 취급되고, 1 패킷 버퍼의 512 바이트 전체를 이용하여 데이터를 기록하거나 데이터가 판독되기도 한다. 따라서, 버퍼에 데이터를 기록하거나 버퍼로부터 데이터를 판독하는 동안은, 버퍼에 대해 외부로부터 액세스할 수 없어, 호스트에 대해 IN 요구나 OUT 요구를 하여 완전한 NAK (Negative Acknowledge) 응답 (부정응답) 이 발생한다. NAK 응답이 발생하면, USB 접속을 하고 있는 호스트에 대해 패킷의 재송신을 요구하여, 호스트로부터의 재송신을 기다리는 송신대기가 발생하게 된다. 또한, USB 버퍼를 외부로부터 액세스할 수 없는 경우에는, USB 접속되어 있는 호스트에 대해 IN 요구나 OUT 요구를 실행하는 동안에, 패킷 손상이나 패킷 손실이 발생하고 또한 NAK 응답이 발생한다.When connected in FS mode, the buffer of the system configured with the function device is treated as one packet buffer of 512 byte memory, but 64 bytes are used and the remaining 448 bytes are not used, and the entire 512 bytes of one packet buffer are used. Data may be recorded or data may be read. Therefore, while writing data to or reading data from the buffer, the buffer cannot be accessed from the outside, resulting in a complete NAK (Negative Response) response by making an IN or OUT request to the host. do. When a NAK response occurs, a request for retransmission of the packet is requested to the host making a USB connection, and a transmission wait for retransmission from the host occurs. In addition, when the USB buffer cannot be accessed from the outside, packet corruption or packet loss occurs and a NAK response occurs while executing an IN request or an OUT request to a host to which a USB connection is made.
이와 같이 패킷 단위로 실행하는 종래의 정보 통신에서는, 통신 모드에 따라 패킷 단위의 정보를 저장하는 패킷 수에 변화가 없기 때문에 빈 상태임에도 불구하고 정보를 저장할 수 없는 부분이 발생하여, 통신중일 때에 외부로부터 액세스할 수 없어 정보를 통신하고 있는 호스트에 대한 수신거부의 상태가 발생하는 문제가 있었다.In the conventional information communication executed in the packet unit as described above, since there is no change in the number of packets storing the packet information according to the communication mode, a portion where the information cannot be stored despite the empty state is generated. There was a problem that a condition of rejection to a host communicating information could not be accessed due to inaccessibility.
본 발명은 이와 같은 문제점을 해결하기 위해 이루어진 것으로, 패킷 단위로 정보를 통신할 때, 통신하고 있는 호스트와의 사이에서 수신거부의 상태가 발생하는 것을 억제할 수 있는 통신 컨트롤러 및 통신 방법을 제공하는 것을 목적으로 한다.SUMMARY OF THE INVENTION The present invention has been made to solve such a problem, and provides a communication controller and a communication method capable of suppressing occurrence of a rejection state with a communicating host when communicating information on a packet basis. For the purpose of
본 발명의 통신 컨트롤러서는, 1 패킷에 포함되는 정보량이 상이한 복수의 통신 모드에 대응한 정보를 패킷 단위로 수신하여, 일시적으로 저장한 후에 송신하는 통신 컨트롤러로, 수신된 정보를 일시적으로 저장하는 기억수단 (예를 들어 본 실시형태에서의 메모리 (25)) 과, 통신 모드에 따라 기억수단에 저장하는 패킷 수를 제어하는 제어수단 (예를 들어, 본 실시형태에서의 버퍼 제어부 (24)) 을 구비하고, 제어수단은 기억수단에 복수의 패킷을 저장할 수 있는 통신 모드의 경우에는, 기억수단에 복수 패킷의 저장장소를 설정하여 복수 패킷을 기억수단에 일시적으로 저장시킨 것이다. 이와 같은 구성에 의해, 통신 모드에 따라 패킷 단위로 수신하는 정보를 저장하는 기억수단의 패킷 수를 제어하여 변화시킴으로써 수신거부의 상태가 발생하는 것을 억제할 수 있다.The communication controller according to the present invention is a communication controller that receives, in a packet unit, information corresponding to a plurality of communication modes having different amounts of information contained in one packet, temporarily stores the information, and stores the received information temporarily. Means (for example, the
또한 제어수단은 기억수단에 복수의 패킷을 저장할 수 있는 통신 모드의 경우에, 기억수단에서의 패킷의 저장장소를 변경함으로써 패킷의 저장상태를 천이시키도록 하는 것이 바람직하다. 이에 의해 통신 모드에 따라 기억수단에 패킷 단위로 수신하는 정보를 저장하는 저장장소를 적정하게 조정하여 정보를 효율적으로 저장할 수 있다.Further, in the case of a communication mode in which a plurality of packets can be stored in the storage means, the control means preferably changes the storage state of the packets by changing the storage location of the packets in the storage means. This makes it possible to efficiently store the information by appropriately adjusting the storage location for storing the information received in the packet unit in the storage means according to the communication mode.
상술한 송수신되는 정보는, 유니버설 시리얼 버스를 통해 통신되고, 유니버설 시리얼 버스는 USB2.0 규격 또는 그 이상의 상위 규격인 것이 바람직하다. 이에 의해, USB2.0 규격 또는 그 이상의 상위 규격의 유니버설 시리얼 버스를 사용하는 경우에, 통신 모드에 따라 패킷 단위로 수신하는 정보를 저장하는 기억수단의 패킷 수를 제어하여 변화시킴으로써 통신할 수 있다.The above-mentioned information transmitted and received is communicated via a universal serial bus, and the universal serial bus is preferably a USB2.0 standard or higher. Thus, when using the universal serial bus of the USB2.0 standard or higher standard, it is possible to communicate by controlling and changing the number of packets of the storage means for storing the information received in units of packets according to the communication mode.
본 발명의 통신방법은, 1패킷에 포함되는 정보량이 상이한 복수의 통신 모드에 대응한 정보를 패킷 단위로 수신하여, 일시적으로 기억수단 (예를 들어 본 실시형태에서의 메모리 (25)) 에 저장한 후에 송신하는 통신방법으로서, 통신 모드를 특정하는 모드 특정 스텝과, 특정된 통신 모드에 따라 기억수단에 저장하는 패킷 수를 제어하는 제어 스텝을 구비하고, 모드 특정 스텝에서는, 기억수단에 복수의 패킷을 저장할 수 있는 통신 모드인 것으로 특정한 경우에는, 기억수단에 복수 패킷의 저장장소를 설정하고, 제어 스텝에서는, 기억수단에 복수의 패킷을 저장할 수 있는 통신 모드의 경우에는, 복수의 패킷을 기억수단의 패킷 저장장소에 일시적으로 저장하는 것이다. 이와 같은 방법에 의해, 통신 모드에 따라 패킷 단위로 수신하는 정보를 저장하는 기억수단의 패킷 수를 제어하고 변화시킴으로써 수신거부의 상태가 발생하는 것을 억제할 수 있다.According to the communication method of the present invention, information corresponding to a plurality of communication modes having different amounts of information contained in one packet is received in packet units and temporarily stored in a storage means (for example, the
또한, 기억수단에 복수의 패킷을 저장할 수 있는 통신 모드의 경우에, 기억수단내에서의 패킷의 저장장소를 변경함으로써 패킷의 저장상태를 천이시키면 된다. 이에 의해 패킷 단위로 수신하는 정보를 통신 모드에 따라 기억수단에서 효율적으로 저장할 수 있다.In the communication mode in which a plurality of packets can be stored in the storage means, the storage state of the packet may be changed by changing the storage location of the packet in the storage means. As a result, the information received in units of packets can be efficiently stored in the storage means in accordance with the communication mode.
발명의 실시형태Embodiment of the invention
이하, 본 발명의 바람직한 실시형태에 대해 도면을 참조하여 상세하게 설명한다. 또한, 이하의 설명은 본 발명의 실시예를 나타낸 것으로, 본 발명이 이하의 설명에 한정되어 해석되어서는 안된다.EMBODIMENT OF THE INVENTION Hereinafter, preferred embodiment of this invention is described in detail with reference to drawings. In addition, the following description shows the Example of this invention, and this invention is limited to the following description and should not be interpreted.
본 실시형태에서의 통신 컨트롤러의 일 실시예에 대해 설명한다. 도1은 단말장치에 형성되는 디바이스 컨트롤러를 나타낸 블록도이다. 여기에서 통신 컨트롤러인 디바이스 컨트롤러는 프린터 등의 단말장치에 형성되는데, 단말장치는 호스트 컴퓨터 (이하, 이것을 호스트라고 줄임) 와 접속되고, 디바이스 컨트롤러를 통해 호스트의 중앙처리장치 (CPU:Central Processing Unit) 와 단말장치의 중앙처리장치 (CPU) 가 통신한다. 또한, 단말장치와 호스트는 USB 케이블에 의해 접속되어 통신하는데, 예를 들어 ISDN (Integrated Service Digital Network) 에 의한 통신 네트워크와 같은 패킷 형식으로 통신하는 경우이더라도, 동일하게 통신 컨트롤러에 패킷 단위로 정보를 저장하여 통신할 수 있다. 또한, 도1에서는, 호스트 및 단말장치의 CPU 를 생략하고 있다. 도1에 나타낸 바와 같이 USB 디바이스 컨트롤러 (10) 에는, USB 인터페이스부 (이하 이것을 PHY로 줄여서 기재함 ; 11) 와 USB 엔드포인트 컨트롤러 (12) 와 외부 버스인터페이스부 (BCU:Bus Control Unit ;13) 가 설치되어 있다. USB 인터페이스부 (11) 는, 아날로그 트랜시버나 시리얼 인터페이스 엔진 등에 의해 구성되고, 호스트로부터 송신되는 데이터의 시리얼 패러렐 변환, 또는 USB 프로토콜에 의거한 패킷의 해석이나 생성 등을 실행하여, USB 버스와의 인터페이스를 제어하여 데이터를 통신한다. 외부 버스 인터페이스부 (13) 는, 단말장치의 CPU 등의 처리장치나 DMA (Direct Memory Access) 컨트롤러에 접속된 버스를 제어하여 데이터를 통신한다. USB 엔드포인트 컨트롤러 (12) 는, 호스트로부터 단말장치측의 데이터의 수신부가 되는 수신 엔드포인트 및 송신부가 되는 송신 엔드포인트의 2종류의 엔드포인트를 구성하고 있고, 호스트에 대해 송수신하는 데이터를 버퍼링하는 부분이다. 또한, 본 실시형태에서는 USB 엔드포인트 컨트롤러 (12) 가 송신용 엔드 포인트와 수신용 엔드포인트를 각각 1개씩 갖는 경우에 대해 설명하는데, 복수의 송신용 엔드포인트와 수신용 엔드포인트를 가질 수도 있다. 또한, USB 엔드포인트 컨트롤러 (12) 는 복수의 메모리를 형성하여 송신 엔드포인트를 수신 엔드포인트 중 어느 하나 일방 또는 양자를 더블 버퍼 구성으로 해도 된다.An example of the communication controller in the present embodiment will be described. 1 is a block diagram illustrating a device controller formed in a terminal device. Here, the device controller, which is a communication controller, is formed in a terminal device such as a printer. The terminal device is connected to a host computer (hereinafter, referred to as a host), and a central processing unit (CPU) of the host through the device controller. And the central processing unit (CPU) of the terminal equipment communicate. In addition, the terminal device and the host are connected and communicated by a USB cable, for example, even if the communication in the form of a packet such as a communication network by ISDN (Integrated Service Digital Network), the information is sent to the communication controller in the same packet unit. Store and communicate. 1, the CPU of the host and the terminal device is omitted. As shown in Fig. 1, the
USB 엔드포인트 컨트롤러 (12) 에는 송신 컨트롤러부 (14) 와 수신 컨트롤러부 (19) 와 버퍼 제어부 (24) 와 메모리 (25) 가 설치되어 있다. 버퍼 제어부 (24) 는, 송신 컨트롤부 (14) 및 수신 컨트롤부 (19) 에 지시하여 메모리 (25) 를 송신 버퍼 또는 수신 버퍼로 하여 할당한다. 버퍼 제어부 (24) 는 후술하는 바와 같이 호스트와 단말장치의 통신 모드에 따라 메모리 (25) 의 버퍼 구성을 결정하고, 버퍼에 저장되는 데이터의 저장상태가 천이되도록 제어한다. 메모리 (25) 에 저장하는 패킷 수를 제어하여 송신 엔드포인트 및 수신 엔드포인트의 버퍼 구성을 결정함과 동시에, 버퍼에 저장되는 데이터 저장상태의 천이를 제어한다. 예를 들어, 캐시 메모리 (Cache Memory) 와 같은 버퍼에 할당되는 주기억장치를 메모리 (25) 로서 사용할 수 있다. 또한, 후술하는 바와 같이 IDE (Integrated Device Electronics) 방식의 하드디스크 (Hard Disk) 등의 보조기억장치와의 사이에서 데이터를 통신하는 경우에는, 디스크 캐시 (Disk Cache) 등의 버퍼에 할당되는 주기억장치를 메모리 (25) 로서 사용할 수 있다. 메모리 (25) 는, 송신 엔드포인트와 수신 엔드포인트에서 공용되고, 송신 엔드포인트 또는 수신 엔드포인트에 따라 버퍼가 할당되는 공용 버퍼로 할 수 있다. 또한 상술한 바와 같이 메모리를 더블 버퍼 구성의 메모리로 하는 경우에는, 공용 버퍼, 송신 버퍼, 수신 버퍼 등을 조합하여 사용할 수 있다.The
송신 컨트롤부 (14) 에는 송신용 PHY측 제어부 (15) 와 송신용 토글 플러그 부 (16) 와 송신용 BCU측 제어부 (17) 와 송신용 버퍼 인터페이스부 (18) 가 설치된다. 송신용 PHY측 제어부 (15) 는, 호스트로의 데이터 송신을 제어하고, 송신 버퍼로서 사용된 버퍼로부터 데이터를 판독하여 출력한다. 송신용 PHY측 제어부 (15) 는, 메모리 (25) 에 대응하는 리드 카운터를 갖고 있고, 메모리 (25) 의 리드 어드레스를 출력하고 있다. 송신용 BCU측 제어부 (17) 는, 외부 버스 인터페이스부 (13) 로부터의 데이터를 송신 버퍼로서 사용된 버퍼에 할당된 메모리 (25) 에 기록한다. 송신용 BCU측 제어부 (17) 는 메모리 (25) 에 대응하는 라이트 카운터를 갖고, 메모리 (25) 의 라이트 어드레스를 출력한다. 송신용 토글 플러그부 (16) 는, 메모리 (25) 의 BCU측 버퍼 또는 PHY측 버퍼로의 할당을 관리하고, PHY측 버퍼의 데이터 송신이 완료되어 메모리 (25) 가 빈 상태로 되었을 때에 BCU측 버퍼에 기록된 데이터가 있으면 송신용 토글 플러그를 토글시켜 전환한다. 송신용 버퍼 인터페이스부 (18) 는, 송신용 토글 플러그의 상태에 의거하여, BCU측 버퍼로 되어 있는 메모리 (25) 에, 그 메모리 (25) 에 대응한 라이트 어드레스를 부여하여 송신용 BCU측 제어부 (17) 로부터의 데이터를 기록한다. 또한, 송신용 버퍼 인터페이스부 (18) 는 PHY측 버퍼로 되어 있는 메모리 (25) 에, 그 메모리 (25) 에 대응한 리드 어드레스를 부여하여 데이터를 판독하고, 송신용 PHY측 제어부 (15) 에 출력한다.The
수신 컨트롤부 (19) 에는, 수신용 PHY측 제어부 (20) 와 수신용 토글 플러그부 (21) 와 수신용 BCU측 제어부 (22) 와 수신용 버퍼 인터페이스부 (25) 가 설치된다. 수신용 PHY측 제어부 (20) 는, 호스트로부터의 데이터를 수신 버퍼로서 사용된 버퍼에 기록한다. 수신용 PHY측 제어부 (20) 는, 메모리 (25) 에 대응하는 라이트 카운터를 갖고 있고, 메모리 (25) 의 라이트 어드레스를 출력하고 있다. 수신용 BCU측 제어부 (22) 는, 수신 버퍼로서 사용된 공용 버퍼에 할당된 메모리 (25) 로부터의 데이터를 판독하여 출력한다. 수신용 BCU측 제어부 (22) 는 메모리 (25) 에 대응하는 리드 카운터를 갖고, 메모리 (25) 의 리드 어드레스를 출력한다. 수신용 토글 플러그부 (21) 는, 메모리 (25) 의 BCU측 버퍼 또는 PHY측 버퍼로의 할당을 관리하고, BCU측 버퍼의 데이터 송신이 완료되어 메모리 (25) 가 빈 상태로 되었을 때에 PHY측 버퍼에 기록된 데이터가 있으면 수신용 토글 플러그를 토글시켜 BCU측 버퍼와 PHY측 버퍼를 전환한다. 수신용 버퍼 인터페이스부 (23) 는, 수신용 토글 플러그의 상태에 의거하여, PHY측 버퍼로 되어 있는 메모리 (25) 에, 그 메모리 (25) 에 대응한 라이트 카운터로부터의 라이트 어드레스를 부여하여 수신용 PHY측 제어부 (20) 로부터의 데이터를 기록한다. 또한, 수신용 버퍼 인터페이스부 (23) 는, BCU측 버퍼로 되어 있는 메모리 (25) 에, 그 메모리 (25) 에 대응한 리드 카운터로부터의 리드 어드레스를 부여하여 데이터를 판독하고, 수신용 BCU측 제어부 (22) 에 출력한다.The
본 실시형태에서의 USB 엔드포인트 컨트롤러 (12) 는, 버퍼 제어부 (24) 에 의해 메모리 (25) 를 송신 엔드포인트의 버퍼에 할당됨과 동시에 호스트와 단말장치의 통신 모드에 따라 메모리 (25) 의 버퍼 구성을 결정하고, 버퍼에 저장되는 데이터의 저장상태가 천이되도록 제어한다. USB 엔드포인트 컨트롤러 (12) 는, 버퍼를 구성하는 메모리 (25) 로부터 BCU측 버퍼 및 PHY 측 버퍼를 송신용 토글 플 러그부 (16) 로부터의 지시에 따라 송신용 버퍼 인터페이스부 (18) 로 전환하여, 외부 버스 인터페이스부 (13) 로부터 송신용 BCU측 제어부 (17) 에 입력한 데이터 버퍼에서의 저장상태를 천이시키면서 BCU측 버퍼가 되는 메모리에 기록한다. 또한, USB 엔드포인트 컨트롤러 (12) 는, 송신용 PHY측 제어부 (15) 에 의해 PHY측 버퍼가 되는 메모리 (25) 로부터 데이터를 판독하여 데이터 버퍼에서의 저장상태를 천이시키면서 USB 인터페이스부 (11) 에 출력한다.The
또한, 본 실시형태에서의 USB 엔드포인트 컨트롤러 (12) 는, 버퍼 제어부 (24) 에 의해, 메모리 (25) 를 수신 엔드포인트의 버퍼에 할당함과 동시에 호스트와 단말장치의 통신 모드에 따라 메모리 (25) 의 버퍼 구성을 결정하고, 버퍼에 저장되는 데이터의 저장상태가 천이되도록 제어한다. USB 엔드포인트 컨트롤러 (12) 는, 버퍼를 구성하는 메모리 (25) 로부터 BCU측 버퍼 및 PHY측 버퍼를 수신용 토글 플러그부 (21) 로부터의 지시에 따라 수신용 버퍼 인터페이스부 (23) 에서 전환하여, USB 인터페이스부 (11)로부터 수신용 PHY측 제어부 (20) 에 입력한 데이터 버퍼에서의 저장상태를 천이시키면서 BCU측 버퍼가 되는 메모리 (25) 에 기록한다. 또한, USB 엔드포인트 컨트롤러 (12) 는, 수신용 BCU측 제어부 (22) 에 의해 BCU측 버퍼가 되는 메모리 (25) 로부터 데이터를 판독하여 데이터의 버퍼에서의 저장상태를 천이시키면서 외부 버스 인터페이스부 (13) 에 출력한다.In addition, the
USB 전송 동작의 일 형태예에 대해 설명한다. USB 전송 처리는 복수의 전송단위 (트랜잭션 데이터) 로 구성되고, 예를 들어 프린터 인쇄의 경우와 같이 호스트로부터 단말장치 (프린터) 에 데이터를 전송하는 경우에는 USB 전송 처리는 복수의 OUT 트랜잭션 데이터로 구성되고, 스캐너에 의해 화상 데이터를 읽어들이는 것과 같이 단말장치 (스캐너 ; 2) 로부터 호스트에 대해 데이터를 전송하는 경우에는 USB 전송 처리는 복수의 IN 트랜잭션 데이터로 구성되어 있다.An example of one embodiment of the USB transfer operation will be described. The USB transfer process consists of a plurality of transfer units (transaction data), and when transferring data from the host to a terminal device (printer), for example, in the case of printer printing, the USB transfer process consists of a plurality of OUT transaction data. In the case where data is transferred from the terminal apparatus (scanner) 2 to the host such as to read image data by the scanner, the USB transfer process is composed of a plurality of IN transaction data.
도2는 트랜잭션 데이터의 일 구성예를 나타낸 모식도이고, 도2에 나타낸 바와 같이 트랜잭션 데이터 (38) 는 토큰 패킷 (38a), 데이터 패킷 (38b) 및 핸드쉐이크 패킷 (38c) 의 3종류의 패킷으로 구성된다. 처음에 호스트로부터 단말장치에 대해 디바이스 어드레스 및 엔드포인트 정보를 갖는 토큰 패킷 (38a) 이 송신된다. 토큰 패킷 (38a) 은 USB 인터페이스부 (11) 에서 디코드되고, 디코드에 의해 검출된 토큰이 단말장치가 받는 토큰인 것으로 인식되면, 데이터전송에 할당하는 엔드포인트가 결정된다. 데이터 전송에 할당하는 엔드포인트가 결정되면, 데이터 전송에 할당되는 엔드포인트 번호와 토큰 종류가 USB 엔드포인트 컨트롤러 (12) 에 전달된다. USB 엔드포인트 컨트롤러 (12) 에서는 데이터 전송에 할당되는 엔드포인트 번호와 토큰 종류에 따라 데이터 패킷 (38b) 을 송신 또는 수신하기 위한 준비가 실행된다. 예를 들어, 트랜잭션 데이터 (38) 가 OUT 트랜잭션 데이터 (수신) 인 경우에는, 최초의 OUT 토큰 패킷 (38a) 에 의해, 어느 수신 엔드포인트에서 데이터를 수신해야 하는지가 결정되고, 호스트로부터 송신되는 데이터 패킷 (38b) 을 그 결정된 수신 엔드포인트에서 수신한다. 도1에 나타낸 USB 디바이스 컨트롤러 (10) 의 경우, USB 인터페이스부 (11) 에서 시리얼 패러렐 변환된 데이터가 수신용 버퍼에 할당된 메모리 (25) 에 저장되게 된다. 호스트로부터 보내지는 데이터 패킷 (38b) 을 결정된 수신 엔드포인트에서 수신하면, 데이터가 정상으로 수신되어 메모리에 저장되었는지 여부를 핸드쉐이크 패킷 (38c) 에서 호스트에 통지한다. USB 엔드포인트 컨트롤러 (12) 가 USB 인터페이스부 (11) 에 헨드쉐이크의 정보를 건네 주고, USB 인터페이스부 (11) 가 핸드쉐이크의 정보에 따라 핸드쉐이크 패킷 (38c) 을 생성하여 USB 버스에 출력한다.Fig. 2 is a schematic diagram showing an example of the configuration of transaction data. As shown in Fig. 2, the transaction data 38 is composed of three types of packets:
호스트로부터 단말장치에 대해 전송되는 데이터는 연속되는 복수의 트랜잭션 데이터 (38) 로 구성되고, 예를 들어 데이터 수신의 경우에는 복수의 OUT 트랜잭션 데이터로 구성되기 때문에, 수신 엔드포인트를 사용할 때에 버퍼의 저장상태를 천이시켜, 버퍼에서의 데이터의 저장상태를 최적한 상태로 천이시킴으로써, 메모리 (25 ; BCU측 버퍼) 로부터 단말장치 (2) 에 데이터를 판독함에 따라 데이터를 저장하는 빈 공간을 버퍼에 만들 수 있어, 메모리 (25 ; PHY측 버퍼) 에서 다음 데이터를 수신할 수 있다.Since the data transmitted from the host to the terminal device is composed of a plurality of consecutive transaction data 38, for example, in the case of data reception, it is composed of a plurality of OUT transaction data, so that the buffer is stored when the receiving endpoint is used. By shifting the state and shifting the storage state of the data in the buffer to an optimal state, an empty space for storing data is created in the buffer as data is read from the memory 25 (BCU side buffer) to the terminal device 2. Can receive the next data from memory (25; PHY side buffer).
스캐너에 의해 화상 데이터를 읽어들이는 것과 같이 단말장치 (스캐너) 로부터 호스트에 데이터를 전송하는 경우에는, 최초의 IN 토큰 패킷에 의해, 어느 송신 엔드포인트로부터 데이터를 송신해야 되는지가 결정되고, 데이터 패킷 (38b) 에서 그 결정된 송신 엔드포인트로부터 데이터를 송신한다. 도1에 나타낸 USB 디바이스 컨트롤러 (10) 의 경우, 송신 버퍼에 저장되어 있는 데이터를 USB 인터페이스부 (11) 에서 패러렐 시리얼 변환하여 데이터 패킷 (38b) 으로서 호스트에 송신한다. USB 엔드포인트 컨트롤러 (12) 는 데이터의 송신이 성공되었는지 여부를 호스트로부터 반송되는 핸드쉐이커 패킷 (38c) 에 의해 인식한다. 또한, 통상적으로 데이터의 송신 처리는, 복수의 IN 트랜잭션 데이터 (38) 로 구성되기 때문 에, 송신 엔드포인트를 사용할 때에 버퍼의 저장상태를 천이시킬 수 있으면, 버퍼에서의 데이터의 저장상태를 최적한 상태로 천이시킴으로써, 메모리 (25 ; PHY측 버퍼) 로부터 데이터를 송신함에 따라 데이터를 저장하는 공간을 버퍼에 만들 수 있어, 메모리 (25 ; BCU측 버퍼) 에 단말장치로부터의 다음 데이터를 기록할 수 있다.When transmitting data from a terminal device (scanner) to a host such as reading image data by a scanner, the first IN token packet determines from which transmission endpoint the data should be transmitted. Send data from the determined transmitting endpoint at 38b. In the case of the
상술한 바와 같이 USB 디바이스 컨트롤러 (10) 를 구성하는 경우, 버퍼 제어부 (24) 는, 메모리 (25) 를 송신 엔드포인트 또는 수신 엔드포인트의 버퍼에 할당하고, 호스트와 단말장치의 접속 모드에 따라 메모리 (25) 에 저장하는 패킷 수를 제어하여 메모리 (25) 의 버퍼 구성을 결정할 수 있다. 따라서, 버퍼 제어부 (24) 는, 메모리 (25) 에 저장하는 패킷 수를 변화시킴으로써, 통신모드에 따라 패킷 단위로 수신하는 데이터를 메모리 (25) 에 저장시킬 수 있다. 예를 들어, 512 바이트의 메모리 (25) 를 사용하여 HS 모드나 HS 모드에 비해 통신용량이 적은 FS 모드에 의해 통신하는 경우, 버퍼 제어부 (24) 는 HS모드에서는 1 패킷의 용량이 512 바이트인 1 패킷 버퍼 구성이 되도록 메모리 (25) 에 저장하는 패킷 수를 제어하고, FS 모드에서는 1 패킷의 용량이 벌크 전송 (bulk transfer) 의 최대 패킷 사이즈인 64 바이트이므로 이것을 8 패킷을 포함하는 구성이 되도록 메모리 (25) 에 저장하는 패킷 수를 제어할 수 있다. 또한, 후술하는 바와 같이 버퍼 제어부 (24) 는, 메모리 (25) 에 저장하는 패킷 수를 제어함과 동시에, 송수신에 의해 빈 상태로 되는 버퍼를 이용하여 데이터 저장상태의 천이를 실행하고, 호스트와 단말장치 사이에서 NAK 응답의 발생을 회피하고, 송신대기나 수신대기를 방지할 수 있다. 또한 본 실시형태에서는 도1에 나타낸 바와 같이 USB 디바이스 컨트롤러 (10) 를 구성하였으나, 요컨대 접속 모드에 의해 메모리 (25) 의 버퍼 구성이 결정되고, 버퍼 제어부 (24) 에 의해 데이터를 저장하는 버퍼의 저장상태가 천이되도록 구성하면 된다.When configuring the
USB 전송의 통신형식 및 통신형식에 따라 저장상태를 천이시키는 메모리에 대해 설명한다. 도3은 단말장치와 호스트 사이에서 실행되는 데이터를 저장하는 버퍼의 저장상태의 일례를 나타낸 차트도이다. 여기에서 도3에서는, USB 전송은 USB2.0 규격의 USB 펑션 디바이스를 사용하여 프린터 등의 단말장치와 호스트인 컴퓨터 본체가 통신형식인 HS 모드 또는 FS 모드의 접속 모드에 의해 접속되고, 512 바이트의 데이터를 통신한다. 또한, 도3을 이용하여 HS 모드 및 FS 모드의 접속 모드에 의해 데이터가 송신되는 경우를 설명하는데, 예를 들어 LS 모드와 같은 하위 모드이어도 되고, HS 모드보다도 상위의 모드이어도 된다. 그 경우, 단말장치와 호스트를 접속하는 접속 모드에 의해 USB 펑션 디바이스가 선택된다. 또한 본 실시형태에서는 호스트와 단말장치 사이에서 통신되는 데이터는 512 바이트의 버퍼에 할당되는 메모리 (25) 에 일시적으로 저장되지만, 예를 들어 1024 바이트와 같은 512 바이트보다도 상위의 사이즈를 갖는 버퍼이어도 된다.The following describes the memory for transitioning the storage state according to the communication format and communication format of the USB transfer. 3 is a chart showing an example of a storage state of a buffer for storing data executed between the terminal apparatus and the host. Here, in Fig. 3, USB transmission is performed by using a USB function device of USB 2.0 standard, and a terminal device such as a printer and a computer main body which is a host are connected by a communication mode HS mode or FS mode connection mode. Communicate data. In addition, the case where data is transmitted by the connection mode of HS mode and FS mode is demonstrated using FIG. 3, For example, it may be a lower mode like LS mode, or a mode higher than HS mode. In that case, a USB function device is selected by the connection mode which connects a terminal apparatus and a host. In the present embodiment, the data communicated between the host and the terminal device is temporarily stored in the
도3에 나타낸 바와 같이 호스트로부터 단말장치에 대해 패킷을 단위로 하여 복수의 트랜잭션 데이터가 송신된다 (S41). 이 때, 단말장치와 호스트는 USB 인터페이스를 통해 접속되고, USB가 예를 들어 USB2.0 규격인 경우에는, FS 모드나 HS 모드와 같은 접속모드로 접속되어 데이터를 통신한다. 접속모드가 HS 모드 인 경우, 데이터의 사이즈가 512 바이트인 데이터를 저장하기 위해 512 바이트의 메모리 (25) 가 1개의 버퍼 구성으로 되고, 1 패킷 버퍼에 512 바이트의 데이터가 저장된다 (S42a). 접속 모드가 HS 모드가 아니라 FS 모드인 경우, FS 모드의 벌크 전송의 최대 패킷 사이즈가 64 바이트로 규정되어 있기 때문에, 512 바이트의 메모리 (25) 는, 1개의 용량이 64 바이트인 8개의 버퍼 구성으로 되고, 8개의 패킷 버퍼의 각각에 64 바이트의 데이터가 저장된다 (S42b). 이와 같이 512 바이트인 메모리 (25) 의 패킷 구성은, 접속모드에 따라 최대 패킷 사이즈가 다르기 때문에, HS 모드와 FS 모드는 다르다. 따라서 접속모드에 따라 메모리 (25) 의 버퍼 구성을 결정하고, 각 버퍼에 데이터를 저장한다. 또한, 1 패킷 버퍼란 패킷 단위로 수신하는 데이터가 저장되는 분할된 1개의 버퍼를 의미하고, 1 패킷 버퍼에는 1 패킷의 데이터가 저장된다.As shown in Fig. 3, a plurality of transaction data is transmitted from the host to the terminal apparatus in units of packets (S41). At this time, the terminal device and the host are connected via a USB interface, and when the USB is, for example, USB2.0 standard, the terminal device and the host are connected in a connection mode such as FS mode or HS mode to communicate data. When the connection mode is the HS mode, in order to store data having a size of 512 bytes, the
최대 패킷 사이즈가 다른 HS 모드나 FS 모드에 의해 단말장치와 호스트를 접속하는 경우에는 메모리에 할당되는 버퍼의 구성을 다양한 구성으로 할 수 있다. 도4를 이용하여 패킷을 단위로 한 복수의 트랜잭션 데이터에 기초한 버퍼 구성의 구성예에 대해 설명한다. 여기서 도4에서는 512 바이트의 버퍼에 관한 구성예에 대해 설명하지만, 예를 들어 1024 바이트 같이 512 바이트보다도 상위 사이즈의 버퍼이어도 된다. 도4(a)는 512 바이트의 메모리 (25) 를 싱글 버퍼 구성으로 형성하여 HS 모드에 의해 접속한 경우의 버퍼 (41) 의 구성을 나타내고, 이 경우에는 상술한 것과 동일하게 1 패킷 버퍼로 구성하고 있다. 도4(b) 에 나타낸 바와 같이 HS 모드에서는 버퍼가 1 패킷 버퍼로 구성되는 것에 비해, FS 모드에서는 최대 패킷 사이즈가 64 바이트로 규정되어 있기 때문에, 버퍼 (42) 는, 1개의 용량이 64 바이트인 8개의 패킷 버퍼 (패킷 버퍼 (42a1) 내지 패킷 버퍼 (42a8))로 구성된다. 동일하게, 도4(c) 및 도4(e) 를 이용하여, HS 모드 및 FS 모드에 의해 접속한 경우의 버퍼 구성에 대해 설명할 수 있다. 이 경우에는 1개의 메모리가 512 바이트인 더블 버퍼구성의 경우이고, 도4(c) 에 나타낸 바와 같이 HS 모드로 접속될 때에는 버퍼 (43) 는 1개의 용량이 512 바이트인 2개의 패킷 버퍼 (패킷 버퍼 (43a1) 및 패킷 버퍼 (43a2)) 의 구성이 된다. 도4(d)에 나타낸 바와 같이, FS 모드에서는 최대 패킷 사이즈가 64 바이트로 규정되어 있기 때문에, HS 모드에 있어서의 패킷 버퍼의 각각이 64 바이트 용량의 8개의 패킷 버퍼로 분할되고, 버퍼 (44) 는 전체 16의 패킷 버퍼 (패킷 버퍼 (44a1 내지 44a16)) 의 구성이 된다. 또한, 도4(e) 에 나타낸 바와 같이, 1개의 메모리가 512 바이트인 더블 버퍼 구성의 경우에는, 버퍼 (51) 는 패킷 버퍼가 64 바이트인 2개의 패킷 버퍼의 구성이 된다.When connecting the terminal apparatus and the host in the HS mode or the FS mode having a different maximum packet size, the configuration of the buffer allocated to the memory can be various configurations. A configuration example of a buffer structure based on a plurality of transaction data in units of packets will be described with reference to FIG. In FIG. 4, a configuration example of a 512-byte buffer will be described. However, a buffer having a size higher than 512 bytes may be used, for example, 1024 bytes. Fig. 4A shows the configuration of the
도5를 이용하여 버퍼에 할당된 메모리에서 실행되는 데이터의 저장상태의 천이에 관한 일례에 대해 설명한다. 도5는 버퍼의 저장상태의 천이를 나타내는 모식도이다. 여기서, 도5에서는 호스트로부터 프린터 등의 단말장치에 대해 데이터를 송신하는 경우에 대해 설명하는데, 스캐너 등의 단말장치로부터 호스트에 대해 데이터를 송신하는 경우도 동일하게 프린터 버퍼와 같은 버퍼에서는 저장상태가 천이된다. 도5에서는 상술한 도4(b) 에 나타낸 바와 같은 512 바이트의 메모리 (25) 를 싱글 버퍼 구성으로 설치하여 FS 모드로 접속하는 경우이지만, 도4(d) 에 나타낸 바와 같은 1개가 512 바이트의 메모리를 더블 버퍼 구성으로 형성하여 FS 모드로 접속하는 경우에 대해서도 동일하게 데이터의 저장상태를 천이시킬 수 있다.An example of the transition of the storage state of data executed in the memory allocated to the buffer will be described with reference to FIG. 5 is a schematic diagram showing the transition of the storage state of the buffer. 5 illustrates a case where data is transmitted from a host to a terminal device such as a printer. In the case of transmitting data to the host from a terminal device such as a scanner, the storage state is not the same in a buffer such as a printer buffer. Transition. In FIG. 5, when the
도4(b) 에 나타낸 버퍼의 구성형태에서는, FS 모드로 접속하면, 512 바이트의 메모리에서 버퍼 1개의 사이즈가 64 바이트인 8 패킷 버퍼 구성이 된다. 8 패킷 버퍼인 버퍼는 호스트로부터 데이터를 수신하고 있지 않을 때에는 비어 있는 상태이지만, 호스트로부터 사이즈가 64 바이트인 1 패킷분의 데이터를 수신하면 수신된 1 패킷분의 데이터는 패킷 버퍼 (42a1) 에 저장된다 (도5(a)). 이 때, 패킷 버퍼 (42a1) 에 저장되는 패킷은, 예를 들어 디바이스 어드레스나 엔드포인트 정보를 갖는 OUT 토큰 패킷 등이다. 호스트로부터 1개 패킷의 사이즈가 64 바이트인 데이터 패킷 등의 패킷을 3 패킷 수신하면, 도5(b)에 나타낸 바와 같이 3 패킷 데이터는 순서대로 패킷 버퍼 (42a2 내지 42a4) 에 저장된다. 호스트로부터 각 패킷을 수신한 후에 버퍼에 저장하면, 도5(c) 에 나타낸 바와 같이 패킷 버퍼 (42a5) 에 저장되고, 합계 5 패킷의 데이터를 패킷 단위로 수신한 것으로 되어, 패킷 버퍼 (42a1) 내지 패킷 버퍼 (42a5) 가 매립된 상태로 된다. 도5(d) 는 단말장치의 CPU가 1 패킷째인 패킷 버퍼 (42a1) 에 저장된 데이터를 판독하는 도중의 상태를 나타내고 있다. 패킷 버퍼 (42a1) 의 데이터의 판독이 완료된 경우, 도5(e) 에 나타낸 바와 같이 패킷 버퍼 (42a1) 가 빈 상태로 된다. 도5(e)에 나타낸 바와 같이 CPU가 패킷 버퍼 (42a1) 에 저장된 데이터를 판독할 때, 패킷 버퍼 (42a6) 에는 호스트로부터 수신된 핸드쉐이크 패킷 등의 1 패킷의 데이터가 저 장된다. 이 때, CPU가 패킷 버퍼 (42a1) 에 저장된 데이터를 판독하고 있는 동안, 일시적으로 버퍼를 64 바이트의 6 패킷분의 패킷 버퍼를 사용하고 있는 상태로 된다.In the buffer configuration shown in Fig. 4B, when connected in the FS mode, an 8 packet buffer configuration in which the size of one buffer is 64 bytes in a 512-byte memory is obtained. The buffer, which is an 8 packet buffer, is empty when no data is received from the host. However, when receiving 1 packet of data having a size of 64 bytes from the host, the received 1 packet of data is stored in the packet buffer 42a1. (Fig. 5 (a)). At this time, the packet stored in the packet buffer 42a1 is an OUT token packet etc. which have a device address or endpoint information, for example. When three packets of a data packet or the like whose size of one packet are 64 bytes are received from the host, as shown in Fig. 5B, the three packet data are stored in the packet buffers 42a2 to 42a4 in order. When each packet is received from the host and stored in the buffer, it is stored in the packet buffer 42a5 as shown in Fig. 5 (c), and data of 5 packets in total are received in packet units, and the packet buffer 42a1 is received. To the packet buffer 42a5 is embedded. Fig. 5D shows a state in which the CPU of the terminal apparatus is reading data stored in the packet buffer 42a1 which is the first packet. When the data reading of the packet buffer 42a1 is completed, the packet buffer 42a1 becomes empty as shown in Fig. 5E. As shown in Fig. 5E, when the CPU reads data stored in the packet buffer 42a1, one packet of data such as a handshake packet received from the host is stored in the packet buffer 42a6. At this time, while the CPU reads the data stored in the packet buffer 42a1, the buffer is temporarily in a state of using a packet buffer for 64 packets of 6 bytes.
버퍼 (42) 의 패킷 버퍼 (42a1) 가 빈 상태로 되고, 일시적으로 6 패킷분의 패킷 버퍼를 사용하고 있는 상태로부터, 버퍼 (42) 에서의 데이터의 저장상태를 천이시킨다. 도5(f) 에 나타낸 바와 같이 패킷 버퍼 (42a2) 내지 패킷 버퍼 (42a6) 의 5 패킷 버퍼에 저장되는 데이터를 패킷 버퍼 (42a1) 내지 패킷 버퍼 (42a5) 에 이동시키고, 상술한 도5(c) 와 동일하게, 패킷 버퍼 (42a1) 내지 패킷 버퍼 (42a5) 의 5 패킷 버퍼에 데이터를 저장한 상태로 버퍼 (42) 에서의 데이터의 저장상태를 천이시킨다. 버퍼 (42) 의 5 패킷 버퍼에 저장되는 데이터를 이동함으로써 패킷 버퍼 (42a6) 내지 패킷 버퍼 (42a8) 는 빈 상태로 되고, 또 빈 상태로 되는 패킷 버퍼 (42a6) 내지 패킷 버퍼 (42a8) 는 사용되고 있지 않은 상태로 된다. 도5(g) 에 나타낸 바와 같이 버퍼 (42) 가 빈 상태로 되어 사용되고 있지 않는 패킷 버퍼 (42a6) 에는, 호스트로부터 수신하는 1 패킷분의 데이터가 저장된다. 그 후, 다시 패킷 버퍼 (42a1) 에 저장되는 데이터는 단말장치의 CPU에 판독되고, 패킷 버퍼 (42a1) 가 빈 상태로 되면, 패킷 버퍼 (42a2) 이하에 저장되는 데이터가 이동하고, 데이터를 판독할 때마다 데이터가 저장되는 패킷 버퍼가 변경된다. 데이터의 저장상태의 천이는, 버퍼 제어부 (24) 에 의해 실행되지만, 버퍼에 저장되는 데이터의 어드레스 등을 근거로 하여 실행할 수 있다. 예를 들어 도5에 나타낸 바와 같이 각 패킷의 데이터를 이동시키는 경우에는, 버퍼 제어 부 (24) 는 패킷 버퍼 (42a2) 에 저장되는 데이터의 어드레스가 패킷 버퍼 (42a1) 가 되도록 패킷 버퍼 (42a2) 의 데이터의 어드레스를 산출하고, 패킷 버퍼 (42a2) 에 저장되는 데이터에 산출된 어드레스를 할당하고, 패킷 버퍼 (42a2) 의 데이터를 패킷 버퍼 (42a1) 에 시프트시킨다. 또한, 버퍼 제어부 (24) 는, 패킷 버퍼 (42a2) 에 저장되는 데이터와 동일하게 패킷 버퍼 (42a3) 내지 패킷 버퍼 (42a6) 의 4 패킷에 저장되는 데이터의 어드레스를 새로 할당하여 패킷 버퍼 (42a2) 내지 패킷 버퍼 (42a5) 에 시프트시키고, 데이터의 저장상태를 천이시킨다.The packet buffer 42a1 of the
이와 같이, HS 모드나 FS 모드 같은 통신 모드에 따라 메모리 (25) 에 저장하는 패킷 수를 제어하여 메모리 (25) 의 버퍼 구성을 결정함과 동시에, 버퍼의 저장상태를 천이시킴으로써, 각각의 통신 모드에 따라 수신하는 데이터를 효율적으로 메모리 (25) 에 저장할 수 있다. 따라서, 통신 모드에 따라 메모리 (25) 에 복수의 패킷을 효율적으로 저장할 수 있어, 호스트와 단말장치 사이의 NAK 응답의 발생을 회피하고, 송신대기나 수신대기를 방지하여 통신 스피드의 저하를 방지할 수 있다. 예를 들어, 도5에 나타낸 바와 같이 빈 상태의 버퍼에 잔류하는 패킷 데이터를 이동시키는 경우에는, 잔류하는 패킷 데이터가 저장되었던 저장장소에 새로 데이터를 저장할 수 있고, 수신하는 패킷 단위의 데이터를 확실하게 저장할 수 있다. 따라서, 버퍼에 패킷 데이터가 송신되었을 때에 효율적으로 또한 확실하게 버퍼에 패킷 데이터를 저장할 수 있고, 데이터를 송신하는 호스트는 송신대기가 발생시키지 않고 데이터를 송신할 수 있다. 이와 같이, 통신 모드에 따라 메모리 (25) 에 저장하는 패킷의 패킷 수를 제어하여 효율적으로 데이터를 메모리 (25) 에 저장하여 데이터의 통신 스피드의 저하를 방지할 뿐만 아니라, 버퍼의 저장상태를 천이시킴으로써 데이터 통신속도의 향상을 도모할 수 있다.In this way, by controlling the number of packets to be stored in the
또한, 도5에 나타낸 바와 같이 버퍼의 저장상태를 천이시키고, 빈 상태의 버퍼에 잔류되는 패킷 데이터를 이동시키는 경우, 패킷 버퍼 (42a1) 에 송신하는 데이터를 이동시켜 패킷 버퍼 (42a1) 로부터 단말장치의 CPU에 대해 패킷을 송신할 수 있다. 따라서, 패킷의 송신에 의해 빈 상태로 되는 버퍼 (42) 의 저장장소를 이용하여 효율적으로 데이터를 송신할 수 있어, 데이터의 통신 스피드를 저하시키지 않고 데이터를 송신할 수 있다. 또한, 데이터의 통신 스피드의 저하를 방지할 수 있기 때문에, 단말장치의 CPU는 판독 대기가 발생하지 않고 데이터를 취득하여 판독할 수 있다.In addition, as shown in Fig. 5, in the case where the storage state of the buffer is changed and the packet data remaining in the empty buffer is moved, the data transmitted to the packet buffer 42a1 is moved and the terminal device is moved from the packet buffer 42a1. Packets can be sent to the CPU. Therefore, data can be transmitted efficiently by using the storage location of the
또한, 버퍼의 저장상태를 천이시킬 때, 패킷 단위의 데이터를 송신시키는 순서에 의거하여 저장상태를 천이시킴으로써, 메모리 (25) 로부터 송신하는 데이터의 순서를 제어할 수 있다. 예를 들어, 도5에 나타낸 바와 같이 패킷 (42a1) 에는 최초에 수신하는 데이터가 저장된 후에 최초로 메모리 (25) 로부터 송신되지만, 패킷 버퍼 (42a1) 로 패킷 버퍼 (42a2) 에 저장되어 있던 데이터를 이동시켜 메모리 (25) 로부터 데이터를 송신함으로써, 메모리 (25) 에 저장되는 데이터의 순서로 데이터를 송신할 수 있다. 이와 같이, 메모리 (25) 로부터 송신하는 데이터의 순서를 제어함으로써, 수신하는 패킷을 메모리 (25) 에 확실하게 저장하면서, 수신한 패킷으로부터 순서대로 효율적으로 송신할 수 있다.Further, when the storage state of the buffer is shifted, the order of the data transmitted from the
도6을 이용하여 버퍼에서 실행되는 저장상태의 천이에 관한 다른 일례에 대 해 설명한다. 도6은 버퍼의 저장상태의 천이를 나타내는 모식도이다. 여기에서 도6에서는 호스트의 CPU로부터 IDE (Integrated Device Electronics) 방식의 하드디스크 (Hard Disk) 등의 보조기억장치에 대해 데이터를 송신하는 경우에 대해 설명하는데, 보조기억장치로부터 호스트의 CPU에 대해 데이터를 송신하는 경우도 동일하게 디스크 캐시 (Disk Cashe) 와 같은 버퍼에서는 저장상태가 천이된다. 도6은 상술한 도4(d)에 나타낸 바와 같은 2개의 512 바이트의 메모리를 더블 버퍼 구성으로 형성하여 HS 모드로 접속하는 경우이지만, 도4(b) 에 나타낸 바와 같은 512 바이트의 메모리를 싱글 버퍼 구성으로 형성하여 FS 모드로 접속하는 경우에 대해서도 동일하게 데이터의 저장상태를 천이시킬 수 있다. 또한, 보조기억장치에 송신되는 데이터의 단위가 1 섹터 512 바이트인 경우에 대해 설명하는데, 1 섹터의 사이즈는 512 이외의 사이즈이어도 된다.Another example of the transition of the storage state executed in the buffer will be described with reference to FIG. 6 is a schematic diagram showing the transition of the storage state of the buffer. 6 illustrates a case where data is transmitted from a host CPU to an auxiliary storage device such as a hard disk of an IDE (Integrated Device Electronics) system, and the data is transmitted from the auxiliary memory device to the CPU of the host. Similarly, the storage state is shifted in a buffer such as a disk cache. Fig. 6 is a case where two 512-byte memories as shown in Fig. 4 (d) are formed in a double buffer configuration and connected in HS mode, but a single 512-byte memory as shown in Fig. 4 (b) is used. The storage state of data can be changed similarly to the case of forming in a buffer configuration and connecting in the FS mode. In addition, the case where the unit of data transmitted to the auxiliary storage device is one sector of 512 bytes is described, but the size of one sector may be other than 512.
도4(d) 에 나타낸 버퍼의 구성형태에서는, FS 모드로 접속하면, 버퍼 (44) 는 2개의 512 바이트의 메모리로 버퍼의 1개의 사이즈가 64 바이트인 16의 패킷 버퍼 (패킷 버퍼 (44a1) 내지 패킷 버퍼 (44a16)) 로서 구성된다. 16의 패킷 버퍼는 호스트의 CPU로부터 데이터를 수신하고 있지 않을 때에는 빈 상태이지만, 호스트의 CPU로부터 사이즈가 64 바이트인 패킷을 3 패킷분 수신하면, 수신한 3패킷분의 데이터는 패킷 버퍼 (44a1) 내지 패킷 버퍼 (44a3) 에 저장되고, 보조기억장치에는 3 패킷분의 데이터가 기록된다 (도6(a)). 이 때, 패킷 버퍼 (44a1) 내지 패킷 버퍼 (44a3) 에 저장되는 패킷은, 예를 들어 토큰 패킷이나 데이터 패킷 등이다. 호스트의 CPU로부터 1개 패킷의 데이터 사이즈가 64 바이트인 데이터 패킷 등의 패킷을 5 패킷분 수신하면, 도6(b)에 나타낸 바와 같이 3 패킷분의 데이터는 순서대로 패킷 버퍼 (44a4) 내지 패킷 버퍼 (44a8) 에 저장되고, 보조기억장치에 3 패킷분의 데이터가 기록된다. 이와 같이 호스트의 CPU로부터 각 패킷을 수신한 후에 버퍼에 저장하고, 도6(b) 에 나타낸 바와 같이 합계 8 패킷의 데이터를 패킷 단위로 수신하고, 버퍼 (44) 의 패킷 버퍼 (44a1) 내지 패킷 버퍼 (44a8) 가 매립된 상태로 된다. 이 때, 보조기억장치는 1 섹터분의 데이터를 호스트의 CPU에 의해 기록 대기하지 않고 기록된다. 그 후, 예를 들어 호스트의 CPU로부터의 송신요구에 의해 송신하거나, 송신하는 상황에서 자동적으로 송신하는 모드로 되는 경우, 예를 들어 도6(c)에 나타낸 바와 같이 2 패킷분의 데이터를 호스트의 CPU에 송신하고, 패킷 버퍼 (44a1) 및 패킷 버퍼 (44a2) 가 빈 상태로 된다. 또한, 도 6(c) 에서 보조기억장치는 호스트의 CPU에 데이터를 판독함과 동시에 빈 상태의 패킷 버퍼 (44a9) 내지 패킷 버퍼 (44a11) 에 3 패킷분의 데이터를 수신하여 저장한다. 또한, 도6(d) 에 나타낸 바와 같이, 호스트의 CPU에 대해 패킷 버퍼 (44a3) 내지 패킷 버퍼 (44a8) 의 5 패킷분의 데이터를 송신한다. 이 때, 호스트의 CPU에 대해 데이터를 송신함과 동시에, 패킷 버퍼 (44a12) 내지 패킷 버퍼 (44a16) 에는 호스트의 CPU로부터 수신한 데이터 패킷 등의 5 패킷분의 데이터가 저장되고, 보조기억장치에는 5 패킷분의 데이터가 기록된다. 이 때, 호스트의 CPU에 대해 패킷 버퍼 (44a1) 내지 패킷 버퍼 (44a8) 의 데이터를 송신하고 있는 동안, 일시적으로 버퍼를 64 바이트의 16 패킷분의 버퍼 (44) 를 사용하고 있는 상태로 된다.In the buffer configuration shown in Fig. 4 (d), when connected in the FS mode, the
버퍼 (44) 의 패킷 버퍼 (44a1) 내지 패킷 버퍼 (44a8) 가 빈 상태로 되어, 일시적으로 16 패킷분의 버퍼를 사용하고 있는 상태로부터, 버퍼 (44) 에서의 데이터의 저장상태를 천이시킨다. 도6(e) 에 나타낸 바와 같이 패킷 버퍼 (44a9) 내지 패킷 버퍼 (44a16) 의 8 패킷 버퍼에 저장되는 데이터를 패킷 버퍼 (44a1) 내지 패킷 버퍼 (44a8) 에 이동시키고, 상술한 도6(b)와 동일하게 패킷 버퍼 (44a1) 내지 패킷 버퍼 (44a8) 의 8 패킷 버퍼에 데이터를 저장한 상태로 버퍼 (44) 에서의 데이터의 저장상태를 천이시킨다. 이에 의해, 보조기억장치에서의 1 섹터분인 8 패킷분의 데이터를 송신시 기록 대기가 발생하지 않고 기록할 수 있다. 버퍼의 5 패킷에 저장되는 데이터를 이동함으로써 패킷 버퍼 (44a9) 내지 패킷 버퍼 (44a16) 는 빈 상태로 되고, 또한 빈 상태가 되는 패킷 버퍼 (44a5) 내지 패킷 버퍼 (44a8) 는 사용되고 있지 않은 상태로 된다. 그 후, 다시 패킷 버퍼 (44a1) 내지 패킷 버퍼 (44a8) 에 저장되는 데이터는 호스트의 CPU에 대해 송신되며, 또한 패킷 버퍼 (44a9) 내지 패킷 버퍼 (44a16) 에는 호스트의 CPU로부터 수신한 패킷 데이터가 저장되고, 패킷 버퍼 (44a1) 내지 패킷 버퍼 (44a8) 가 빈 상태로 되면, 보조기억장치의 1 섹터분인 8 패킷분의 데이터를 이동시킨다. 데이터의 저장상태의 천이는, 버퍼 제어부에 실행되지만, 버퍼에 저장되는 데이터의 어드레스 등을 근거로 하여 실행할 수 있다. 예를 들어, 도6에 나타낸 바와 같이 각 패킷 버퍼의 데이터를 이동시키는 경우에는, 버퍼 제어부는 패킷 버퍼 (44a9) 에 저장되는 데이터의 어드레스가 패킷 버퍼 (44a1) 가 되도록 패킷 버퍼 (44a9) 의 데이터의 어드레스를 산출하고, 패킷 버퍼 (44a9) 에 저장되는 데이터에 산출한 어드레스를 할당하고, 패킷 버퍼 (44a9) 의 데이터를 패킷 버퍼 (44a1) 에 시프트시킨다. 또한, 버퍼 제어부는, 패킷 버퍼 (44a9) 의 데이터와 동일하게 패킷 버퍼 (44a10) 내지 패킷 버퍼 (44a16) 의 7 패킷 버퍼에 저장되는 데이터의 어드레스를 새로 할당하여 패킷 버퍼 (44a1) 내지 패킷 버퍼 (44a8) 에 시프트시키고, 데이터의 저장상태를 천이시킨다.The packet buffers 44a1 to 44a8 of the
이와 같이, HS 모드나 FS 모드와 같은 통신 모드에 따라 메모리 (25) 에 저장하는 패킷 수를 제어하여 메모리 (25) 의 버퍼 구성을 결정함과 동시에, 버퍼의 저장상태를 천이시킴으로써, 각각의 통신 모드에 따라 수신하는 데이터를 효율적으로 메모리 (25) 에 저장할 수 있다. 따라서, 통신 모드에 따라 메모리 (25) 에 복수의 패킷을 효율적으로 저장할 수 있어, 호스트의 CPU와 보조기억장치 사이의 NAK 응답의 발생을 회피하고 송신대기나 수신대기를 방지하여 통신 스피드의 저하를 방지할 수 있다. 예를 들어 도6에 나타낸 바와 같이 빈 상태의 버퍼에 보조기억장치의 1 섹터분에 해당하는 데이터를 이동시키는 경우에는, 1 섹터분의 데이터가 저장되어 있었던 저장장소에 새로 버퍼를 저장할 수 있어, 수신하는 버퍼 단위의 데이터를 확실하게 저장하여 보조기억장치에 데이터를 기록할 수 있다. 따라서 버퍼에 패킷 데이터가 송신되었을 때에 효율적으로 확실하게 버퍼에 패킷 데이터를 저장할 수 있고, 데이터를 송신하는 호스트는 송신대기가 발생하지 않고 데이터를 송신할 수 있다. 이와 같이 통신 모드에 따라 메모리 (25) 에 저장하는 패킷의 패킷 수를 제어하여 효율적으로 데이터를 메모리 (25) 에 저장하여 데이터의 통신 스피드의 저하를 방지할 뿐만 아니라, 버퍼의 저장상태를 천이시킴으로 써 데이터의 통신 속도의 향상을 도모할 수 있다.As described above, by controlling the number of packets to be stored in the
또한 도6에 나타낸 바와 같이 버퍼의 저장상태를 천이시키고, 빈 상태의 버퍼에 잔류하는 패킷 데이터를 보조기억장치의 1 섹터분을 이동시키는 경우, 패킷 버퍼 (44a1) 내지 패킷 버퍼 (44a8) 로부터 호스트의 CPU에 대해 1 섹터분의 데이터를 송신할 수 있다. 따라서 패킷의 송신에 의해 빈 상태가 되는 버퍼 (44) 의 저장장소를 이용하여 효율적으로 데이터를 송신할 수 있어, 데이터의 통신 스피드를 저하시키지 않고 데이터를 송신할 수 있다. 또한, 데이터의 통신 스피드의 저하를 방지할 수 있기 때문에, 호스트의 CPU는 판독 대기가 발생하지 않고 데이터를 취득하여 보조기억장치의 1 섹터분의 데이터를 함께 판독할 수 있다.As shown in Fig. 6, when the storage state of the buffer is shifted and packet data remaining in the empty buffer is shifted by one sector of the auxiliary storage device, the host is transferred from the packet buffer 44a1 to the packet buffer 44a8. One sector of data can be transmitted to the CPU. Therefore, data can be transmitted efficiently using the storage location of the
또한, 버퍼의 저장상태를 천이시킬 때, 버퍼 단위의 데이터를 송신시키는 순서에 근거하여 저장상태를 천이시킴으로써, 메모리 (25) 로부터 송신하는 데이터의 순서를 제어할 수 있다. 예를 들어, 도6에 나타낸 바와 같이 1 섹터분에 해당하는 패킷 버퍼 (44a1) 내지 패킷 버퍼 (44a8) 에는 최초로 수신하는 데이터가 저장된 후에 최초로 메모리 (25) 로부터 송신되지만, 보조기억장치의 1섹터에 해당하는 패킷 버퍼 (44a9) 내지 패킷 버퍼 (44a16) 를 패킷 버퍼 (44a1) 내지 패킷 버퍼 (44a8) 로 이동하여 메모리 (25) 로부터 데이터를 송신함으로써, 메모리 (25) 에 저장되는 데이터의 순서로 1 섹터분의 데이터를 송신할 수 있다. 이와 같이, 메모리 (25) 로부터 송신하는 데이터의 순서를 제어함으로써, 수신하는 패킷을 메모리 (25) 에 확실하게 저장하면서, 수신한 패킷으로부터 순서대로 보조기억장치에 1 섹터분의 데이터를 함께 효율적으로 기록할 수 있다.In addition, when the storage state of the buffer is shifted, the order of data transmitted from the
USB 전송의 통신형식에 따라 메모리의 저장상태를 천이시키는 버퍼 제어부에 대해 설명한다. 도7은 메모리의 저장상태를 천이시키는 제어부의 동작의 일례를 나타낸 차트이다. 먼저, 버퍼 제어부 (24) 는 이미 도3에서 설명한 플로우에 따라 호스트와 단말장치 사이의 통신모드를 특정하고, 메모리 (25) 의 버퍼 구성을 결정한다 (S50). 여기에서 도4(b) 에 나타낸 바와 같은 512 바이트의 메모리 (25) 를 싱글 버퍼 구성으로 형성하여 FS 모드로 접속하는 경우를 사용하여 설명하였으나, 도4(d) 에 나타내는 바와 같은 1개가 512 바이트의 메모리를 더블 버퍼 구성으로 형성하여 FS 모드로 접속하는 경우에 대해서도 동일하게, 버퍼 제어부는 제어를 실행할 수 있다. 먼저 버퍼 제어부 (24) 는, FS 모드로 통신하는 경우, HS 모드로 접속했을 때에는 1 패킷 버퍼 구성으로 되는 512 바이트의 메모리를 각 패킷 버퍼의 용량이 64 바이트가 되도록 8개로 분할한다. 그 후, S51 에 나타낸 바와 같이 버퍼 제어부 (24) 는 저장되는 패킷에 대해 인식한다. 이 때, 버퍼 제어부 (24) 는, 예를 들어 토큰 패킷 등으로부터 패킷이 저장되는 메모리의 어드레스를 근거로 패킷이 저장되는 저장장소를 인식한다. 패킷이 저장되는 패킷 버퍼를 인식한 버퍼 제어부 (24) 는, 예를 들어 호스트로부터 수신하는 패킷이 있는지를 확인하고, 수신하는 패킷이 있는 경우에는 수신한 패킷을 저장한다 (S53b). 버퍼 제어부는 수신한 패킷을 저장한 상태에서 다시 저장되는 패킷에 대해 인식한다. S52에 나타낸 바와 같이 패킷을 수신하지 않은 경우에는, 버퍼 제어부는, 예를 들어 단말장치의 CPU에 판독되어 송신되는 패킷이 있는지를 인식하고 (S53a), 송신되는 패킷이 존재하는 경우에는 빈 상태의 패킷 버퍼가 발생되므 로, 빈 상태의 패킷 버퍼를 인식하고 (S54a), 버퍼 전체의 저장상태를 천이시킨다 (S55). 버퍼의 저장상태의 천이는, 예를 들어 도5에 나타낸 바와 같은 패킷 전체의 이동 등이다. S53a에 나타낸 바와 같이 송신하는 패킷이 없는 경우에는, 버퍼 제어부는 패킷을 송신하지 않은 상태에서 빈 상태의 버퍼가 존재하는지를 확인하고 (S54), 빈 상태의 패킷 버퍼가 존재하지 않는 경우에는 수신하는 패킷이 있는지를 확인하는 스텝 S52로 되돌아가, 상술한 스텝을 다시 실행한다. 송신되는 패킷이 없는 경우에 빈 상태의 패킷 버퍼가 존재하는 경우에는, 상술한 바와 동일하게 S54a에 나타낸 바와 같이 빈 상태의 패킷 버퍼를 인식하여 버퍼 전체의 저장상태를 천이시킨다 (S55). 버퍼 제어부는 버퍼의 저장상태를 천이시킨 후, S51에 나타낸 스텝으로 되돌아가고, 다시 버퍼의 저장상태에 대해 인식하고, 저장상태의 천이를 제어한다.The buffer control unit for transitioning the storage state of the memory in accordance with the communication format of the USB transfer will be described. 7 is a chart showing an example of an operation of a control unit for transitioning a storage state of a memory. First, the
이와 같이 버퍼 제어부가 동작을 실행함으로써, 상술한 바와 같이 FS 모드나 HS 모드 등의 접속 모드에 대응하여 버퍼의 구성을 변경하고, 버퍼의 저장상태의 천이를 실현할 수 있다. 버퍼 제어부가 버퍼의 저장상태의 천이를 제어함으로써, 잔류하는 패킷 데이터가 저장되어 있었던 저장장소에 새로 패킷을 저장할 수 있어, 효율적으로 버퍼에 패킷을 저장할 수 있다. 또한, 데이터를 송신하는 호스트 등의 데이터 송신측 장치는 송신대기가 발생하지 않고 데이터를 송신할 수 있어, 데이터의 통신 스피드가 저하되는 것을 방지할 수 있다.As described above, when the buffer control unit executes the operation, the configuration of the buffer can be changed in correspondence with the connection mode such as the FS mode or the HS mode, and the transition of the storage state of the buffer can be realized. By controlling the transition of the storage state of the buffer, the buffer controller can store the packet newly in a storage place where the remaining packet data is stored, and can efficiently store the packet in the buffer. In addition, a data transmission side apparatus such as a host that transmits data can transmit data without transmitting waiting, and can prevent the communication speed of data from being lowered.
또한, 버퍼 제어부는 접속 모드에 따라 버퍼를 구성하여 효율적으로 버퍼 단위의 데이터를 메모리 (25) 에 저장함과 동시에, 버퍼의 저장상태를 천이시켜 보다 더 효율적으로 데이터를 메모리 (25) 에 저장시킬 수 있다. 따라서, 통신 모드에 따라 메모리 (25) 에 저장하는 패킷 수를 제어하여 효율적으로 데이터를 메모리 (25) 에 저장하여 데이터의 통신 스피드의 저하를 방지할 뿐만 아니라. 버퍼의 저장상태를 천이시킴으로써 데이터의 통신속도의 향상을 도모할 수 있다.In addition, the buffer control unit configures the buffer according to the connection mode to efficiently store the data in the buffer unit in the
이상과 같이 예를 들어 USB2.0 규격의 USB 케이블을 사용하여 호스트와 단말장치를 USB 접속을 실행하는 경우, FS 모드에 의해 통신할 때. 버퍼 제어부에 의해 메모리에 할당되는 버퍼의 저장상태를 천이시킴으로써, 메모리에는 다수의 패킷 버퍼를 할당할 수 있고, 송신된 후의 상태가 되는 패킷 버퍼에 새로 데이터를 저장할 수 있다. 따라서, FS 모드에 의해 통신하는 경우이더라도, 효율적으로 버퍼에 패킷을 저장하여 통신할 수 있고, 데이터를 송신하는 호스트에 송신대기가 발생하지 않고, 또한 호스트에 대한 NAK 응답이 발생하지 않고, 호스트는 데이터를 송신할 수 있다. 이와 같이 호스트가 송신대기나 NAK 응답이 발생하지 않고 데이터를 송신할 수 있기 때문에, FS 모드에 의해 통신하는 경우이더라도 데이터의 통신 스피드를 저하시키지 않고 데이터의 통신을 실행할 수 있다.As described above, for example, when a USB connection of a host and a terminal device is performed using a USB 2.0 standard USB cable, communication is performed in the FS mode. By shifting the storage state of the buffer allocated to the memory by the buffer control unit, a plurality of packet buffers can be allocated to the memory, and data can be newly stored in the packet buffer which is in a state after being transmitted. Therefore, even in the case of the communication by the FS mode, it is possible to efficiently store the packet in the buffer to communicate, and there is no waiting for transmission to the host transmitting data, and no NAK response to the host occurs. Data can be sent. In this way, since the host can transmit data without generating a transmission standby or NAK response, even when communicating in the FS mode, data can be communicated without reducing the communication speed of the data.
또한 예를 들어 USB2.0규격의 USB 케이블을 사용하여 단말장치로부터 호스트에 대해 데이터를 송신하는 경우, FS 모드로 통신할 때, 버퍼 제어부에 의해 메모리에 할당되는 버퍼의 저장상태를 천이시키고, 빈 상태로 되는 버퍼에 데이터를 다시 저장함으로써, 다시 데이터를 저장한 버퍼로부터 효율적으로 데이터를 송신할 수 있다. 따라서, FS 모드에 의해 통신하는 경우이더라도, 데이터를 수신하는 호스트에 수신대기가 발생하지 않고, 또한 단말장치에 대한 NAK 응답이 발생하지 않고, 호스트는 데이터를 수신할 수 있다. 이와 같이 호스트가 수신대기나 NAK응답이 발생하지 않고 데이터를 수신할 수 있기 때문에, FS 모드에 의해 통신하는 경우이더라도, 데이터의 통신 스피드를 저하시키지 않고 데이터의 통신을 실행할 수 있다.In addition, when data is transmitted from the terminal device to the host using a USB 2.0 standard USB cable, for example, when communicating in the FS mode, the storage state of the buffer allocated to the memory is changed by the buffer controller, By storing the data again in the buffer to be in the state, it is possible to efficiently transmit data from the buffer in which the data is stored again. Therefore, even in the case of communicating in the FS mode, no reception wait occurs in the host that receives the data, and no NAK response occurs to the terminal device, and the host can receive the data. As described above, since the host can receive data without receiving reception or NAK response, even when communicating in the FS mode, data can be communicated without reducing the communication speed of the data.
또한, 호스트의 CPU가 보조기억장치에 데이터를 기록하는 데이터의 통신의 경우, 버퍼의 저장상태의 천이를 제어함으로써, 1 섹터를 동시에 기록할 수 있다. 따라서 호스트의 CPU는 데이터를 효율적으로 보조기억장치에 기록할 수 있고, 보조기억장치에 대한 데이터의 기록속도를 향상시킬 수 있다. 그리고, 호스트의 CPU가 보조기억장치로부터 데이터를 판독하는 데이터 통신의 경우도 동일하게, 버퍼의 저장상태의 천이를 제어함으로써, 1 섹터를 동시에 판독하여 데이터를 효율적으로 보조기억장치에 판독할 수 있어, 호스트의 CPU와 보조기억장치 사이의 데이터 통신의 통신 스피드를 향상시킬 수 있다.Further, in the case of data communication in which the CPU of the host writes data to the auxiliary memory device, one sector can be recorded simultaneously by controlling the transition of the storage state of the buffer. Therefore, the CPU of the host can efficiently write data to the auxiliary storage device, and can increase the recording speed of the data to the auxiliary storage device. In the case of data communication in which the CPU of the host reads data from the auxiliary storage device, the control of the transition of the storage state of the buffer can be controlled so that one sector can be read simultaneously and the data can be efficiently read into the auxiliary storage device. Therefore, the communication speed of data communication between the CPU of the host and the auxiliary storage device can be improved.
본 발명은 패킷 단위로 정보를 통신할 때, 통신하고 있는 호스트와의 사이에서 수신거부의 상태가 발생하는 것을 억제할 수 있는 통신 컨트롤러 및 통신방법을 제공할 수 있다.
The present invention can provide a communication controller and a communication method capable of suppressing occurrence of a condition of rejection between communicating hosts when communicating information in packet units.
Claims (12)
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2002142265A JP2003333108A (en) | 2002-05-17 | 2002-05-17 | Communication controller and communication method |
JPJP-P-2002-00142265 | 2002-05-17 |
Publications (2)
Publication Number | Publication Date |
---|---|
KR20030089480A KR20030089480A (en) | 2003-11-21 |
KR100563418B1 true KR100563418B1 (en) | 2006-03-22 |
Family
ID=29702598
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020030030947A KR100563418B1 (en) | 2002-05-17 | 2003-05-15 | Communication controller and method |
Country Status (4)
Country | Link |
---|---|
JP (1) | JP2003333108A (en) |
KR (1) | KR100563418B1 (en) |
CN (1) | CN1252602C (en) |
TW (1) | TWI227979B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7701898B2 (en) | 2004-09-15 | 2010-04-20 | Research In Motion Limited | Switch-in of centralised infrastructure for management for wireless communications |
JP4761888B2 (en) | 2005-08-23 | 2011-08-31 | 株式会社エヌ・ティ・ティ・ドコモ | Transmission rate control method, mobile station and radio network controller |
CN108366129B (en) * | 2018-03-08 | 2019-05-07 | 北京淳中科技股份有限公司 | USB data transmission method, device and USB are from device adapter |
-
2002
- 2002-05-17 JP JP2002142265A patent/JP2003333108A/en active Pending
-
2003
- 2003-05-14 TW TW092113116A patent/TWI227979B/en not_active IP Right Cessation
- 2003-05-15 KR KR1020030030947A patent/KR100563418B1/en not_active IP Right Cessation
- 2003-05-15 CN CNB031364241A patent/CN1252602C/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
CN1252602C (en) | 2006-04-19 |
KR20030089480A (en) | 2003-11-21 |
TWI227979B (en) | 2005-02-11 |
TW200308157A (en) | 2003-12-16 |
CN1460951A (en) | 2003-12-10 |
JP2003333108A (en) | 2003-11-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3415567B2 (en) | USB transfer control method and USB controller | |
JP5044254B2 (en) | Architecture for PC flash disk based on universal serial bus | |
KR100485294B1 (en) | Data transfer control device, electronic equipment, and data transfer control method | |
US7237047B2 (en) | Data transfer control device, electronic equipment, and data transfer control method | |
KR100460650B1 (en) | Data transfer control device, electronic equipment, and data transfer control method | |
US20110289243A1 (en) | Communication control device, data communication method and program | |
JP4555902B2 (en) | Bus system and bus interface to connect to the bus | |
EP0772831B1 (en) | Bidirectional parallel signal interface | |
KR20040041623A (en) | Bus system and bus interface for connection to a bus | |
KR20020079536A (en) | Usb interface device of peripheral device | |
EP1253520B1 (en) | Apparatus for issuing command for high-speed serial interface | |
KR100563418B1 (en) | Communication controller and method | |
KR100487199B1 (en) | Apparatus and method for data transmission in dma | |
JP2004070423A (en) | Usb controller and method of controlling data transfer thereof | |
KR101345437B1 (en) | Interfacing apparatus and method for communication between chips | |
JP2001306482A (en) | Input-output control method and input-output controller | |
AU2006200756B2 (en) | A USB flash memory device for connecting to a USB-defined BUS | |
JP3442099B2 (en) | Data transfer storage device | |
JP2004078877A (en) | Data communication system | |
JP2002057726A (en) | Data receiver and data receiving method, and image forming device | |
JP2003242096A (en) | Usb controller |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A201 | Request for examination | ||
E902 | Notification of reason for refusal | ||
E701 | Decision to grant or registration of patent right | ||
GRNT | Written decision to grant | ||
FPAY | Annual fee payment |
Payment date: 20090311 Year of fee payment: 4 |
|
LAPS | Lapse due to unpaid annual fee |