KR100563418B1 - Communication controller and method - Google Patents

Communication controller and method Download PDF

Info

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
Application number
KR1020030030947A
Other languages
Korean (ko)
Other versions
KR20030089480A (en
Inventor
오쯔도모히꼬
다까나시쯔요시
Original Assignee
엔이씨 일렉트로닉스 가부시키가이샤
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 엔이씨 일렉트로닉스 가부시키가이샤 filed Critical 엔이씨 일렉트로닉스 가부시키가이샤
Publication of KR20030089480A publication Critical patent/KR20030089480A/en
Application granted granted Critical
Publication of KR100563418B1 publication Critical patent/KR100563418B1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/54Store-and-forward switching systems 
    • H04L12/56Packet switching systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/90Buffering arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0042Universal 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

통신 컨트롤러 및 통신 방법 {COMMUNICATION CONTROLLER AND METHOD}Communication controllers and communication methods {COMMUNICATION CONTROLLER AND METHOD}

도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: toggle plug portion 17 for transmission; BCU side control unit for transmission

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: transaction data 38a: token packet

38b : 데이터 패킷 38c : 핸드쉐이크 패킷38b: data packet 38c: handshake packet

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 memory 25 in the present embodiment) and control means (for example, the buffer control unit 24 in the present embodiment) for controlling the number of packets to be stored in the storage means in accordance with the communication mode. In the communication mode in which the plurality of packets can be stored in the storage means, the control means sets a storage location of the plurality of packets in the storage means and temporarily stores the plurality of packets in the storage means. With such a configuration, it is possible to suppress the occurrence of the rejection state by controlling and changing the number of packets of the storage means for storing the information received in units of packets in accordance with the communication mode.

또한 제어수단은 기억수단에 복수의 패킷을 저장할 수 있는 통신 모드의 경우에, 기억수단에서의 패킷의 저장장소를 변경함으로써 패킷의 저장상태를 천이시키도록 하는 것이 바람직하다. 이에 의해 통신 모드에 따라 기억수단에 패킷 단위로 수신하는 정보를 저장하는 저장장소를 적정하게 조정하여 정보를 효율적으로 저장할 수 있다.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 memory 25 in the present embodiment). A communication method to be transmitted later, comprising: a mode specifying step for specifying a communication mode, and a control step for controlling the number of packets to be stored in the storage means in accordance with the specified communication mode. In the case of a communication mode capable of storing packets, a storage location of a plurality of packets is set in the storage means, and in the control step, in the communication mode in which a plurality of packets can be stored in the storage means, the plurality of packets are stored. It is stored temporarily in the packet storage of the means. In this way, it is possible to suppress the occurrence of the rejection state by controlling and changing the number of packets of the storage means for storing the information received in units of packets in accordance with the communication mode.

또한, 기억수단에 복수의 패킷을 저장할 수 있는 통신 모드의 경우에, 기억수단내에서의 패킷의 저장장소를 변경함으로써 패킷의 저장상태를 천이시키면 된다. 이에 의해 패킷 단위로 수신하는 정보를 통신 모드에 따라 기억수단에서 효율적으로 저장할 수 있다.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 device controller 10 includes a USB interface unit (hereinafter, abbreviated to PHY; 11), a USB endpoint controller 12, and an external bus interface unit (BCU: Bus Control Unit; 13). Is installed. The USB interface unit 11 is configured by an analog transceiver, a serial interface engine, or the like, and performs serial parallel conversion of data transmitted from the host, or analyzes or generates a packet based on the USB protocol to interface with the USB bus. Communicate data by controlling it. The external bus interface unit 13 communicates data by controlling a bus connected to a processing device such as a CPU of a terminal device or a DMA (Direct Memory Access) controller. The USB endpoint controller 12 constitutes two types of endpoints, a receiving endpoint serving as a receiving unit of data on the terminal device side from a host and a transmitting endpoint serving as a transmitting unit, and buffering data transmitted and received to and from the host. Part. In addition, in this embodiment, the case where the USB endpoint controller 12 has one transmission end point and one reception end point respectively is demonstrated, You may have several transmission endpoints and a reception endpoint. In addition, the USB endpoint controller 12 may form a plurality of memories so that one or both of the reception endpoints may be configured as a double buffer configuration.

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 USB endpoint controller 12 is provided with a transmission controller section 14, a reception controller section 19, a buffer control section 24, and a memory 25. The buffer control unit 24 instructs the transmission control unit 14 and the reception control unit 19 to allocate the memory 25 as a transmission buffer or a reception buffer. As described later, the buffer control unit 24 determines the buffer configuration of the memory 25 according to the communication mode between the host and the terminal device, and controls the storage state of the data stored in the buffer to transition. The number of packets to be stored in the memory 25 is controlled to determine the buffer configurations of the transmitting endpoint and the receiving endpoint, and the transition of the data storage state stored in the buffer is controlled. For example, a main memory allocated to a buffer such as cache memory can be used as the memory 25. As described later, when data is communicated with an auxiliary storage device such as an IDE (Hard Disk) of an IDE (Integrated Device Electronics) system, the main memory is allocated to a buffer such as a disk cache. Can be used as the memory 25. The memory 25 may be a shared buffer shared between the transmitting endpoint and the receiving endpoint, and assigned with a buffer in accordance with the transmitting endpoint or the receiving endpoint. As described above, when the memory is a double buffered memory, a common buffer, a transmit buffer, a receive buffer, or the like can be used in combination.

송신 컨트롤부 (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 transmission control unit 14 is provided with a transmission PHY side control unit 15, a transmission toggle plug unit 16, a transmission BCU side control unit 17, and a transmission buffer interface unit 18. The PHY side control part 15 for transmission controls data transmission to a host, reads out data from the buffer used as a transmission buffer, and outputs it. The transmission PHY side control unit 15 has a read counter corresponding to the memory 25, and outputs a read address of the memory 25. The transmission BCU side control unit 17 writes data from the external bus interface unit 13 to the memory 25 allocated to the buffer used as the transmission buffer. The transmission BCU side control unit 17 has a write counter corresponding to the memory 25, and outputs a write address of the memory 25. The transmission toggle plug section 16 manages the allocation of the memory 25 to the BCU side buffer or the PHY side buffer, and when the data transmission of the PHY side buffer is completed and the memory 25 becomes empty, the BCU side If there is data written to the buffer, the toggle toggle plug for transmission is toggled. The transmission buffer interface unit 18 assigns a write address corresponding to the memory 25 to the memory 25 serving as the BCU-side buffer based on the state of the transmission toggle plug, and transmits the BCU side control unit. Record the data from (17). In addition, the transmission buffer interface unit 18 reads the data by giving a read address corresponding to the memory 25 to the memory 25 serving as the PHY side buffer and reads the data to the transmission PHY side control unit 15. Output

수신 컨트롤부 (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 reception control unit 19 is provided with a reception PHY side control unit 20, a reception toggle plug unit 21, a reception BCU side control unit 22, and a reception buffer interface unit 25. The reception PHY side control unit 20 writes data from the host to a buffer used as a reception buffer. The reception PHY side control unit 20 has a write counter corresponding to the memory 25, and outputs a write address of the memory 25. The receiving BCU side control unit 22 reads and outputs data from the memory 25 allocated to the shared buffer used as the receiving buffer. The receiving BCU side control unit 22 has a read counter corresponding to the memory 25, and outputs a read address of the memory 25. The receiving toggle plug section 21 manages the allocation of the memory 25 to the BCU side buffer or the PHY side buffer, and when the data transmission of the BCU side buffer is completed and the memory 25 becomes empty, the PHY side If there is data recorded in the buffer, the receiving toggle plug is toggled to switch between the BCU side buffer and the PHY side buffer. The receiving buffer interface unit 23 assigns a write address from the write counter corresponding to the memory 25 to the memory 25 serving as the PHY side buffer based on the state of the receiving toggle plug. Data from the credit PHY side control unit 20 is recorded. In addition, the receiving buffer interface unit 23 reads the data by giving a read address from the read counter corresponding to the memory 25 to the memory 25 serving as the BCU side buffer, and reads the data. It outputs to the control part 22.

본 실시형태에서의 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 endpoint controller 12 in the present embodiment allocates the memory 25 to the buffer of the transmitting endpoint by the buffer control unit 24 and simultaneously buffers the memory 25 according to the communication mode between the host and the terminal device. The configuration is determined, and the storage state of the data stored in the buffer is controlled to transition. The USB endpoint controller 12 switches the BCU side buffer and the PHY side buffer from the memory 25 constituting the buffer to the transmission buffer interface unit 18 according to an instruction from the transmission toggle plug section 16. Then, the data is written to the memory serving as the BCU side buffer while the storage state in the data buffer inputted from the external bus interface unit 13 to the transmission BCU side control unit 17 is changed. In addition, the USB endpoint controller 12 reads data from the memory 25, which becomes the PHY side buffer, by the transmitting PHY side control unit 15, and shifts the storage state in the data buffer. Output to.

또한, 본 실시형태에서의 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 endpoint controller 12 according to the present embodiment allocates the memory 25 to the buffer of the receiving endpoint by the buffer control unit 24 and at the same time the memory (in accordance with the communication mode between the host and the terminal device). 25) determine the buffer configuration, and control to transition the storage state of the data stored in the buffer. The USB endpoint controller 12 switches the BCU side buffer and the PHY side buffer from the memory 25 constituting the buffer to the receiving buffer interface unit 23 according to the instructions from the receiving toggle plug section 21. The data is recorded in the memory 25 serving as the BCU side buffer while the storage state in the data buffer inputted from the USB interface unit 11 to the reception PHY side control unit 20 is changed. In addition, the USB endpoint controller 12 reads data from the memory 25 serving as the BCU side buffer by the receiving BCU side control unit 22 and shifts the storage state of the data buffer to the external bus interface unit ( 13)

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: token packet 38a, data packet 38b, and handshake packet 38c. It is composed. Initially, a token packet 38a having device address and endpoint information is transmitted from the host to the terminal apparatus. The token packet 38a is decoded by the USB interface unit 11, and when it is recognized that the token detected by the decode is a token received by the terminal device, an endpoint to be allocated for data transmission is determined. Once the endpoint assigned to the data transfer is determined, the endpoint number and token type assigned to the data transfer are passed to the USB endpoint controller 12. In the USB endpoint controller 12, preparation for sending or receiving the data packet 38b is performed in accordance with the endpoint number and token type assigned to the data transfer. For example, if transaction data 38 is OUT transaction data (receive), the first OUT token packet 38a determines at which receiving endpoint the data should be received, and the data sent from the host. Receive packet 38b at its determined receiving endpoint. In the case of the USB device controller 10 shown in Fig. 1, the serial parallel converted data in the USB interface unit 11 is stored in the memory 25 allocated to the receiving buffer. Upon receipt of the data packet 38b sent from the host at the determined receiving endpoint, the handshake packet 38c notifies the host whether the data has been successfully received and stored in memory. The USB endpoint controller 12 passes the handshake information to the USB interface unit 11, and the USB interface unit 11 generates a handshake packet 38c according to the handshake information and outputs it to the USB bus. .

호스트로부터 단말장치에 대해 전송되는 데이터는 연속되는 복수의 트랜잭션 데이터 (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 device controller 10 shown in Fig. 1, the data stored in the transmission buffer is parallel serially converted by the USB interface unit 11 and transmitted to the host as a data packet 38b. The USB endpoint controller 12 recognizes by the shaker packet 38c returned from the host whether the transmission of the data was successful. In general, since the data transmission process is composed of a plurality of IN transaction data 38, if the storage state of the buffer can be changed when using the transmission endpoint, the data storage state of the buffer is optimal. By transitioning to the state, as data is transmitted from the memory 25 (PHY side buffer), a space for storing data can be created in the buffer, and the next data from the terminal apparatus can be recorded in the memory 25 (BCU side buffer). have.

상술한 바와 같이 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 device controller 10 as described above, the buffer control unit 24 allocates the memory 25 to the buffer of the transmitting endpoint or the receiving endpoint, and the memory in accordance with the connection mode of the host and the terminal device. The buffer configuration of the memory 25 can be determined by controlling the number of packets to be stored in the 25. Therefore, by changing the number of packets stored in the memory 25, the buffer control unit 24 can store the data received in packet units in the memory 25 in accordance with the communication mode. For example, in the case of using the 512-byte memory 25 to communicate in the HS mode or the FS mode with less communication capacity than the HS mode, the buffer control unit 24 has a capacity of 1 packet in the HS mode of 512 bytes. The number of packets to be stored in the memory 25 is controlled to have a one packet buffer configuration. In the FS mode, since the capacity of one packet is 64 bytes, which is the maximum packet size of the bulk transfer, this is configured to include eight packets. The number of packets stored in the memory 25 can be controlled. In addition, as will be described later, the buffer control unit 24 controls the number of packets to be stored in the memory 25 and executes the transition of the data storage state by using the buffer which becomes empty by transmission and reception. The occurrence of the NAK response can be avoided between the terminal apparatuses, and transmission waiting or reception waiting can be prevented. In addition, in this embodiment, although the USB device controller 10 was comprised as shown in FIG. 1, in short, the buffer structure of the memory 25 is determined by the connection mode, and the buffer control part 24 of the buffer which stores data is carried out. You can configure the storage state to transition.

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 memory 25 allocated to the 512-byte buffer, but may be a buffer having a size higher than 512 bytes such as 1024 bytes, for example. .

도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 memory 25 having 512 bytes has one buffer structure, and 512 bytes of data are stored in one packet buffer (S42a). When the connection mode is FS mode instead of HS mode, since the maximum packet size for bulk transfer in FS mode is defined as 64 bytes, the 512-byte memory 25 has eight buffer configurations with one capacity of 64 bytes. 64 bytes of data are stored in each of the eight packet buffers (S42b). As described above, the packet configuration of the memory 25 having 512 bytes differs in the HS mode and the FS mode because the maximum packet size varies depending on the connection mode. Therefore, the buffer configuration of the memory 25 is determined according to the connection mode, and data is stored in each buffer. In addition, one packet buffer means one divided buffer in which data received in units of packets is stored, and one packet of data is stored in one packet buffer.

최대 패킷 사이즈가 다른 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 buffer 41 in the case where the 512-byte memory 25 is formed in a single buffer configuration and connected in HS mode. In this case, the configuration of one packet buffer is the same as described above. Doing. As shown in Fig. 4 (b), since the maximum packet size is defined as 64 bytes in the FS mode, the buffer 42 has one capacity of 64 bytes, whereas the buffer consists of one packet buffer in the HS mode. 8 packet buffers (packet buffer 42a1 to packet buffer 42a8). Similarly, the buffer structure in the case of connecting by HS mode and FS mode can be described using Figs. 4 (c) and 4 (e). In this case, the case of a double buffer configuration in which one memory is 512 bytes, and when connected in HS mode as shown in Fig. 4 (c), the buffer 43 has two packet buffers (packets of one capacity of 512 bytes). The buffer 43a1 and the packet buffer 43a2 are configured. As shown in Fig. 4D, since the maximum packet size is defined as 64 bytes in the FS mode, each of the packet buffers in the HS mode is divided into eight packet buffers having a capacity of 64 bytes, and the buffer 44 ) Constitutes a total of 16 packet buffers (packet buffers 44a1 to 44a16). In addition, as shown in Fig. 4E, in the case of the double buffer configuration in which one memory is 512 bytes, the buffer 51 has the configuration of two packet buffers in which the packet buffer is 64 bytes.

도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 memory 25 of 512 bytes as shown in FIG. 4 (b) is installed in a single buffer configuration and connected in the FS mode, one as shown in FIG. 4 (d) is 512 bytes. Similarly, when the memory is formed in a double buffer configuration and connected in the FS mode, the data storage state can be changed.

도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 buffer 42 becomes empty, and the state of storing the data in the buffer 42 is shifted from the state in which the packet buffer for 6 packets is temporarily used. As shown in Fig. 5 (f), the data stored in the five packet buffers of the packet buffer 42a2 to the packet buffer 42a6 are moved to the packet buffer 42a1 to the packet buffer 42a5, and Fig. 5c described above. The storage state of the data in the buffer 42 is shifted in the state of storing the data in the five packet buffers of the packet buffer 42a1 to the packet buffer 42a5. By moving the data stored in the five packet buffers of the buffer 42, the packet buffers 42a6 to 42a8 become empty, and the packet buffers 42a6 to 42a8 that become empty are used. It does not exist. As shown in Fig. 5 (g), data for one packet received from the host is stored in the packet buffer 42a6 which is not used because the buffer 42 is empty. After that, the data stored in the packet buffer 42a1 is read into the CPU of the terminal device again. When the packet buffer 42a1 becomes empty, the data stored in the packet buffer 42a2 or less moves to read the data. Each time the packet buffer where data is stored is changed. The transition of the data storage state is executed by the buffer control unit 24, but can be executed based on the address of the data stored in the buffer and the like. For example, when moving the data of each packet as shown in FIG. 5, the buffer control part 24 performs the packet buffer 42a2 so that the address of the data stored in the packet buffer 42a2 may become the packet buffer 42a1. The address of the data is calculated, the calculated address is assigned to the data stored in the packet buffer 42a2, and the data of the packet buffer 42a2 is shifted to the packet buffer 42a1. In addition, the buffer control section 24 assigns a new address of the data stored in four packets of the packet buffer 42a3 to the packet buffer 42a6 in the same way as the data stored in the packet buffer 42a2, and the packet buffer 42a2. To the packet buffer 42a5 to shift the storage state of the data.

이와 같이, HS 모드나 FS 모드 같은 통신 모드에 따라 메모리 (25) 에 저장하는 패킷 수를 제어하여 메모리 (25) 의 버퍼 구성을 결정함과 동시에, 버퍼의 저장상태를 천이시킴으로써, 각각의 통신 모드에 따라 수신하는 데이터를 효율적으로 메모리 (25) 에 저장할 수 있다. 따라서, 통신 모드에 따라 메모리 (25) 에 복수의 패킷을 효율적으로 저장할 수 있어, 호스트와 단말장치 사이의 NAK 응답의 발생을 회피하고, 송신대기나 수신대기를 방지하여 통신 스피드의 저하를 방지할 수 있다. 예를 들어, 도5에 나타낸 바와 같이 빈 상태의 버퍼에 잔류하는 패킷 데이터를 이동시키는 경우에는, 잔류하는 패킷 데이터가 저장되었던 저장장소에 새로 데이터를 저장할 수 있고, 수신하는 패킷 단위의 데이터를 확실하게 저장할 수 있다. 따라서, 버퍼에 패킷 데이터가 송신되었을 때에 효율적으로 또한 확실하게 버퍼에 패킷 데이터를 저장할 수 있고, 데이터를 송신하는 호스트는 송신대기가 발생시키지 않고 데이터를 송신할 수 있다. 이와 같이, 통신 모드에 따라 메모리 (25) 에 저장하는 패킷의 패킷 수를 제어하여 효율적으로 데이터를 메모리 (25) 에 저장하여 데이터의 통신 스피드의 저하를 방지할 뿐만 아니라, 버퍼의 저장상태를 천이시킴으로써 데이터 통신속도의 향상을 도모할 수 있다.In this way, by controlling the number of packets to be stored in the memory 25 in accordance with a communication mode such as the HS mode or the FS mode, the buffer configuration of the memory 25 is determined and the storage state of the buffer is shifted, thereby making each communication mode possible. In accordance with this, data to be received can be efficiently stored in the memory 25. Therefore, according to the communication mode, a plurality of packets can be efficiently stored in the memory 25, and the occurrence of NAK response between the host and the terminal device can be avoided, and transmission and reception waiting can be prevented to reduce the communication speed. Can be. For example, when moving the packet data remaining in the empty buffer as shown in Fig. 5, the data can be newly stored in the storage location where the remaining packet data has been stored, and the data of the received packet unit can be assured. Can be stored. Therefore, when packet data is transmitted to the buffer, the packet data can be efficiently and reliably stored in the buffer, and the host transmitting the data can transmit the data without generating a transmission wait. In this way, the number of packets of packets stored in the memory 25 is controlled in accordance with the communication mode to efficiently store the data in the memory 25 to prevent a decrease in the communication speed of the data, and also to shift the storage state of the buffer. By doing so, the data communication speed can be improved.

또한, 도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 buffer 42 which becomes empty by packet transmission, and data can be transmitted without reducing the communication speed of data. In addition, since the decrease in the communication speed of data can be prevented, the CPU of the terminal apparatus can acquire and read data without generating a read wait.

또한, 버퍼의 저장상태를 천이시킬 때, 패킷 단위의 데이터를 송신시키는 순서에 의거하여 저장상태를 천이시킴으로써, 메모리 (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 memory 25 can be controlled by shifting the storage state based on the order of transmitting data in units of packets. For example, as shown in Fig. 5, the first received data is stored in the packet 42a1 and then transmitted from the memory 25 first, but the data stored in the packet buffer 42a2 is moved to the packet buffer 42a1. By transmitting the data from the memory 25, the data can be transmitted in the order of the data stored in the memory 25. In this way, by controlling the order of the data to be transmitted from the memory 25, it is possible to efficiently transmit the received packets in order from the received packets while reliably storing the received packets in the memory 25.

도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 buffer 44 is two 512 bytes of memory and 16 packet buffers each having a size of 64 bytes (packet buffer 44a1). To packet buffer 44a16). The packet buffer of 16 is empty when no data is received from the CPU of the host. However, when three packets of a packet having a size of 64 bytes are received from the CPU of the host, the received three packets of data are stored in the packet buffer 44a1. To the packet buffer 44a3, and three packets of data are recorded in the auxiliary memory device (Fig. 6 (a)). At this time, the packet stored in the packet buffer 44a1 to the packet buffer 44a3 is a token packet, a data packet, etc., for example. When five packets of data packets, such as a data packet having a data size of 64 bytes, are received from the CPU of the host for five packets, as shown in Fig. 6B, the data for three packets are sequentially processed from the packet buffer 44a4 to the packet. It is stored in the buffer 44a8, and data for three packets is recorded in the auxiliary memory device. Thus, after receiving each packet from the CPU of the host, the packet is stored in a buffer, and as shown in Fig. 6B, a total of 8 packets of data are received in packet units, and the packet buffers 44a1 to packets of the buffer 44 are received. The buffer 44a8 is brought into a buried state. At this time, the auxiliary memory device is recorded without waiting to write data for one sector by the host CPU. After that, for example, when a transmission request is made from a host CPU, or when the transmission mode is set to the automatic transmission mode, as shown in FIG. Is sent to the CPU, and the packet buffer 44a1 and the packet buffer 44a2 become empty. In addition, in Fig. 6C, the auxiliary memory device reads data into the CPU of the host and simultaneously receives and stores three packets of data in the empty packet buffers 44a9 to 44a11. As shown in Fig. 6D, data for five packets of the packet buffer 44a3 to the packet buffer 44a8 is transmitted to the CPU of the host. At this time, the data is transmitted to the CPU of the host, and at the same time, data for 5 packets such as data packets received from the CPU of the host are stored in the packet buffers 44a12 to 44a16. Five packets of data are recorded. At this time, while the data of the packet buffer 44a1 to the packet buffer 44a8 is transmitted to the CPU of the host, the buffer 44 for 64 packets of 64 bytes is temporarily used.

버퍼 (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 buffer 44 become empty, and the storage state of the data in the buffer 44 is shifted from the state in which the buffer for 16 packets is temporarily used. As shown in Fig. 6E, the data stored in the 8 packet buffers of the packet buffers 44a9 to 44a16 are moved to the packet buffers 44a1 to 44a8, and Fig. 6B described above. In the same manner as in Fig. 2), the data storage state of the data in the buffer 44 is shifted while data is stored in the 8 packet buffers of the packet buffers 44a1 to 44a8. As a result, data for 8 packets, which is one sector for the auxiliary storage device, can be recorded without causing a recording wait. By moving data stored in five packets of the buffer, the packet buffers 44a9 to 44a16 become empty, and the packet buffers 44a5 to 44a8 which become empty are not used. do. After that, data stored in the packet buffer 44a1 to the packet buffer 44a8 is transmitted to the CPU of the host, and the packet data received from the CPU of the host is stored in the packet buffer 44a9 to the packet buffer 44a16. When the packet buffers 44a1 to 44a8 become empty, data for 8 packets, which is one sector of the auxiliary storage device, is moved. The transition of the data storage state is executed by the buffer control unit, but can be executed based on the address of the data stored in the buffer or the like. For example, as shown in Fig. 6, when moving the data of each packet buffer, the buffer control unit controls the data of the packet buffer 44a9 so that the address of the data stored in the packet buffer 44a9 becomes the packet buffer 44a1. Is calculated, the calculated address is assigned to the data stored in the packet buffer 44a9, and the data of the packet buffer 44a9 is shifted to the packet buffer 44a1. In addition, the buffer control unit allocates a new address of data stored in the seven packet buffers of the packet buffer 44a10 to the packet buffer 44a16 in the same manner as the data of the packet buffer 44a9, and thus the packet buffer 44a1 to the packet buffer ( 44a8) to shift the data storage state.

이와 같이, 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 memory 25 in accordance with a communication mode such as the HS mode or the FS mode, the buffer configuration of the memory 25 is determined, and the storage state of the buffer is shifted, thereby communicating each communication. Depending on the mode, data to be received can be efficiently stored in the memory 25. Therefore, according to the communication mode, a plurality of packets can be efficiently stored in the memory 25, thereby avoiding the occurrence of NAK response between the CPU of the host and the auxiliary storage device, and preventing transmission waiting or reception waiting, thereby reducing the communication speed. It can prevent. For example, as shown in Fig. 6, when data corresponding to one sector of the auxiliary storage device is moved to an empty buffer, the buffer can be newly stored in a storage place where data for one sector is stored. It is possible to reliably store data in a buffer unit to receive the data and to record the data in the auxiliary memory device. Therefore, when packet data is transmitted to the buffer, the packet data can be efficiently and reliably stored in the buffer, and the host which transmits the data can transmit the data without transmitting waiting. By controlling the number of packets of the packets stored in the memory 25 in accordance with the communication mode as described above, the data can be efficiently stored in the memory 25 to prevent the communication speed of the data from being lowered, and the state of the buffer is shifted. The data communication speed can be improved.

또한 도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 buffer 44 which becomes empty by packet transmission, and data can be transmitted without reducing the communication speed of data. In addition, since the decrease in the communication speed of data can be prevented, the CPU of the host can acquire data without reading waiting and read data for one sector of the auxiliary storage device together.

또한, 버퍼의 저장상태를 천이시킬 때, 버퍼 단위의 데이터를 송신시키는 순서에 근거하여 저장상태를 천이시킴으로써, 메모리 (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 memory 25 can be controlled by shifting the storage state based on the order of transmitting data in units of buffers. For example, as shown in Fig. 6, in the packet buffer 44a1 to the packet buffer 44a8 corresponding to one sector, the first received data is stored and then transmitted from the memory 25 first, but one sector of the auxiliary memory device. By moving the packet buffer 44a9 to the packet buffer 44a16 corresponding to the packet buffer 44a1 to the packet buffer 44a8 and transmitting data from the memory 25, the data is stored in the memory 25 in the order of the data. One sector of data can be transmitted. In this way, by controlling the order of the data transmitted from the memory 25, the received packet is reliably stored in the memory 25 while efficiently storing the data for one sector from the received packet to the auxiliary storage device in order. Can record

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 buffer control unit 24 specifies the communication mode between the host and the terminal apparatus according to the flow already described with reference to Fig. 3, and determines the buffer configuration of the memory 25 (S50). Here, description has been made using a case in which a 512-byte memory 25 as shown in Fig. 4B is formed in a single buffer configuration and connected in the FS mode, but one as shown in Fig. 4D is 512 bytes. Similarly, in the case where the memory is formed in the double buffer configuration and connected in the FS mode, the buffer control unit can execute the control. First, when communicating in the FS mode, the buffer control unit 24 divides the 512-byte memory having one packet buffer structure into eight pieces so that the capacity of each packet buffer becomes 64 bytes when connected in the HS mode. Thereafter, as shown in S51, the buffer control unit 24 recognizes the stored packet. At this time, the buffer control unit 24 recognizes the storage location where the packet is stored, for example, from the token packet or the like based on the address of the memory in which the packet is stored. Recognizing the packet buffer in which the packet is stored, the buffer control unit 24 checks whether there is a packet to be received from the host, for example, and if there is a packet to receive, stores the received packet (S53b). The buffer controller recognizes a packet to be stored again while storing the received packet. When not receiving a packet as shown in S52, the buffer control section recognizes, for example, whether or not a packet is read and transmitted to the CPU of the terminal apparatus (S53a). Since the packet buffer is generated, an empty packet buffer is recognized (S54a), and the storage state of the entire buffer is shifted (S55). The transition of the stored state of the buffer is, for example, movement of the entire packet as shown in FIG. If there is no packet to transmit as shown in S53a, the buffer controller checks whether there is an empty buffer without transmitting the packet (S54), and if there is no packet buffer in the empty state, the received packet The process returns to step S52 for checking whether there is any error, and executes the above-described steps again. If there is an empty packet buffer when there is no packet to be transmitted, as shown in S54a as described above, the empty packet buffer is recognized and the storage state of the entire buffer is shifted (S55). After shifting the storage state of the buffer, the buffer control unit returns to the step shown in S51, recognizes again the storage state of the buffer, and controls the transition of the storage state.

이와 같이 버퍼 제어부가 동작을 실행함으로써, 상술한 바와 같이 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 memory 25, and simultaneously changes the storage state of the buffer to store the data in the memory 25 more efficiently. have. Therefore, the number of packets to be stored in the memory 25 is controlled in accordance with the communication mode to efficiently store the data in the memory 25 to prevent the degradation of the communication speed of the data. By changing the storage state of the buffer, it is possible to improve the data communication speed.

이상과 같이 예를 들어 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)

1 패킷에 포함되는 정보량이 상이한 복수의 통신 모드에 대응하는 정보를 패킷 단위로 수신하여, 일시적으로 저장한 후에 송신하는 통신 컨트롤러로서, A communication controller for receiving, corresponding to a packet unit, information corresponding to a plurality of communication modes having different amounts of information contained in one packet, temporarily storing the information, and transmitting the information. 상기 수신된 정보를 일시적으로 저장하는 기억수단과,Storage means for temporarily storing the received information; 상기 통신 모드에 따라 상기 기억수단에 저장하는 패킷 수를 제어하는 제어수단을 구비하고, Control means for controlling the number of packets to be stored in the storage means according to the communication mode; 이 제어수단은 상기 기억수단에 복수의 패킷을 저장할 수 있는 통신 모드의 경우에는, 상기 기억수단에 복수 패킷의 저장장소를 설정하여 복수의 패킷을 상기 기억수단에 일시적으로 저장시키는, 통신 컨트롤러.In the communication mode in which the plurality of packets can be stored in the storage means, the control means sets a storage location of the plurality of packets in the storage means and temporarily stores the plurality of packets in the storage means. 제 1 항에 있어서, 상기 제어수단은 상기 기억수단에 복수의 패킷을 저장할 수 있는 통신 모드의 경우에, 당해 기억수단에서의 패킷의 저장장소를 변경함으로써 패킷의 저장상태를 천이시키는, 통신 컨트롤러.The communication controller according to claim 1, wherein said control means transitions the storage state of the packet by changing the storage location of the packet in said storage means in a communication mode in which a plurality of packets can be stored in said storage means. 제 2 항에 있어서, 상기 제어수단은 패킷이 송신됨으로써 빈 상태로 된 저장장소에, 다른 저장된 패킷을 이동시킴으로써 패킷의 저장상태를 천이시키는, 통신 컨트롤러.The communication controller according to claim 2, wherein said control means makes a transition to a storage state of a packet by moving another stored packet to a storage place that is empty due to transmission of the packet. 제 2 항에 있어서, 상기 제어수단은 상기 패킷을 기억수단에 저장된 순서로 송신하고, 송신됨으로써 빈 상태로 된 저장장소에 다음에 송신되는 패킷을 이동시킴으로써 패킷의 저장상태를 천이시키는, 통신 컨트롤러.The communication controller according to claim 2, wherein the control means transmits the packets in the order stored in the storage means, and shifts the storage state of the packets by moving the next transmitted packet to a storage place which is empty by being transmitted. 제 1 항에 있어서, 상기 복수의 통신모드는, 제 1 통신모드와, 당해 제 1 통신모드보다도 1 패킷에 포함되는 정보량이 적은 제 2 통신모드를 포함하고,2. The communication apparatus according to claim 1, wherein the plurality of communication modes include a first communication mode and a second communication mode in which the amount of information included in one packet is smaller than the first communication mode, 상기 기억수단은, 상기 제 1 통신모드에 대응하는 정보량의 패킷에 상당하는 기억용량을 갖고,The storage means has a storage capacity corresponding to a packet of information amount corresponding to the first communication mode, 상기 제어수단은, 상기 제 1 통신모드의 패킷을 수신한 경우에는, 상기 기억수단에 1 개의 패킷을 일시적으로 저장시키고, 상기 제 2 통신모드의 패킷을 수신한 경우에는, 상기 기억수단에 복수의 패킷을 일시적으로 저장시키는, 통신 컨트롤러.The control means temporarily stores one packet in the storage means when the packet in the first communication mode is received, and stores a plurality of packets in the storage means when receiving the packet in the second communication mode. A communication controller that temporarily stores packets. 제 1 항에 있어서, 상기 정보는, 유니버설 시리얼 버스를 통해 통신되고, 당해 유니버설 시리얼 버스는 USB 2.0 규격인, 통신 컨트롤러.The communication controller according to claim 1, wherein the information is communicated via a universal serial bus, and the universal serial bus is a USB 2.0 standard. 1 패킷에 포함되는 정보량이 상이한 복수의 통신 모드에 대응하는 정보를 패킷 단위로 수신하여, 일시적으로 기억수단에 저장한 후에 송신하는 통신방법으로서, A communication method for receiving information corresponding to a plurality of communication modes having different amounts of information contained in one packet in packet units, temporarily storing the information in a storage means, and then transmitting the information. 상기 통신 모드를 특정하는 모드 특정 스텝과, A mode specifying step of specifying the communication mode; 특정된 통신 모드에 따라 기억수단에 저장하는 패킷 수를 제어하는 제어 스텝을 포함하고, A control step of controlling the number of packets to be stored in the storage means according to the specified communication mode, 상기 모드 특정 스텝에서는, 상기 기억수단에 복수의 패킷을 저장할 수 있는 통신 모드인 것으로 특정한 경우에는, 상기 기억수단에 복수 패킷의 저장장소를 설정하고, In the mode specifying step, when it is specified that the communication mode is capable of storing a plurality of packets in the storage means, a storage location of the plurality of packets is set in the storage means, 상기 제어 스텝에서는, 상기 기억수단에 복수의 패킷을 저장할 수 있는 통신 모드의 경우에는, 복수의 패킷을 상기 기억수단의 패킷 저장장소에 일시적으로 저장하는, 통신방법.In the control step, in the communication mode in which a plurality of packets can be stored in the storage means, the plurality of packets are temporarily stored in a packet storage location of the storage means. 제 7 항에 있어서, 상기 기억수단에 복수의 패킷을 저장할 수 있는 통신 모드의 경우에, 당해 기억수단내에서의 패킷의 저장장소를 변경함으로써 패킷의 저장상태를 천이시키는, 통신방법.8. The communication method according to claim 7, wherein in the case of a communication mode in which a plurality of packets can be stored in the storage means, the storage state of the packets is changed by changing the storage location of the packets in the storage means. 제 8 항에 있어서, 패킷이 송신됨으로써 빈 상태로 된 저장장소에, 다른 저장된 패킷을 이동시킴으로써 패킷의 저장상태를 천이시키는, 통신방법.The communication method according to claim 8, wherein the storage state of the packet is shifted by moving another stored packet to a storage place which is empty by transmitting the packet. 제 8 항에 있어서, 상기 패킷을 상기 기억수단에 저장된 순서로 송신하고, 송신됨으로써 빈 상태로 된 저장장소에, 다음에 송신되는 패킷을 이동시킴으로써 패킷의 저장상태를 천이시키는, 통신방법.9. The communication method according to claim 8, wherein said packet is transmitted in the order stored in said storage means, and said packet is shifted to a storage place which is empty by being transmitted, thereby transferring a packet to be transmitted next. 제 7 항에 있어서, 상기 복수의 통신모드는, 제 1 통신모드와, 당해 제 1 통신모드보다도 1 패킷에 포함되는 정보량이 적은 제 2 통신모드를 포함하고,8. The communication apparatus according to claim 7, wherein the plurality of communication modes include a first communication mode and a second communication mode in which a smaller amount of information is included in one packet than the first communication mode, 상기 모드 특정 스텝에서는, 상기 제 2 통신모드인 것으로 특정한 경우에는, 상기 기억수단에 복수 패킷의 저장장소를 설정하고,In the mode specifying step, when it is specified that the communication mode is the second communication mode, a storage location for a plurality of packets is set in the storage means, 상기 제어 스텝에서는, 상기 제 1 통신모드의 패킷을 수신한 경우에는 상기 기억수단에 1 개의 패킷을 일시적으로 저장시키고, 상기 제 2 통신모드의 패킷을 수신한 경우에는, 상기 기억수단에 복수 패킷을 일시적으로 저장시키는, 통신방법.In the control step, when a packet of the first communication mode is received, one packet is temporarily stored in the storage means, and when a packet of the second communication mode is received, a plurality of packets are stored in the storage means. A communication method that is temporarily stored. 제 7 항에 있어서, 상기 정보는, 유니버설 시리얼 버스를 통해 통신되고, 당해 유니버설 시리얼 버스는 USB 2.0 규격인, 통신방법.8. The communication method according to claim 7, wherein the information is communicated via a universal serial bus, and the universal serial bus is a USB 2.0 standard.
KR1020030030947A 2002-05-17 2003-05-15 Communication controller and method KR100563418B1 (en)

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)

* Cited by examiner, † Cited by third party
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

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