USB2.0 Chinese protocol (Lite version)-Introduction to the USB2.0 System

Source: Internet
Author: User
USB System Overview

USB is a high-speed serial transmission bus that supports hot swapping. It uses differential signals to transmit data, up to 480 Mb/s. USB
Supports "Bus-powered" and "self-powered" power supply modes. In Bus Power Supply Mode, the device can obtain a maximum of 500mA of the current. USB2.0
Designed to be backward compatible when a full speed (USB 1.1) or low speed (USB 1.0) device is connected to high speed (USB)
2.0) The host can support them through separated transmission. One USB
The maximum transmission speed on the bus is determined by the slowest "device" on the bus. The device includes host, hub, and USB functional devices.

USB
The system consists of three parts: Host, device, and physical connection. The host is a combination of hardware, software, and firmware that provides USB interface and interface management capabilities. It can be either a PC or
OTG device. A usb system has only one USB host. The device includes a USB function device and a USB hub. A maximum of 127 devices are supported.
Transmission Line. In the USB 2.0 system, shielded twisted pair wires are required.


A usb host can support up to 128 IP addresses at the same time. The address is 0.
As the default address, it is only used temporarily during device enumeration and cannot be assigned to any device. Therefore, a USB host can support a maximum of 127
Addresses. If a device occupies only one address, a maximum of 127 USB devices are supported. In the actual USB system, to connect 127
USB hub must be used for USB devices, while USB Hub also occupies the address. Therefore, the number of actually supported USB function devices is less than 127.

The USB system uses a hierarchical star topology to connect all USB devices, as shown in:

 

Starting from host-root hub, a maximum of seven layers (Tier) are supported. That is to say, a maximum of five USB hub cascade is allowed in any USB system. A compound device occupies two or more layers at the same time.

Root hub is a special USB hub, which is integrated into the host controller without occupying the address. Root hub not only implements Common USB hub functions, but also includes other functions. The specifications of the enhanced host controller are described in detail.

"Compound device" can occupy multiple addresses. A compound device is a device that combines multiple functional devices with a built-in USB hub, such as a USB camera with a recording microphone.

USBRound-Robin Broadcast
Data transmission mechanism. All data transmission is initiated by the host. At any time, only one data packet can be transmitted in the USB system. That is, the data packets seen on different physical transmission lines are the same broadcast data packets. This article is from www.eenote.com
, All rights reserved. For more information, see.

USB uses the transfer mechanism of "token packet"-"data packet"-"handshake packet" to specify the device address and endpoint (endpoint) of the destination or source of the data packet in the token packet ), this ensures that only one device responds to the broadcast packet/token package. The handshake packet indicates whether the transmission is successful or not.


Data Packet: The minimum unit for data transmission on the USB bus, including sync, data, and EOP. The data format varies with packages. However
PID. PID specifies the data packet type (16 in total ). The token Package refers to the package whose PID is in/out/setup.

Endpoint: USB
The smallest unit in the device that can send and receive data. It supports one-way or two-way data transmission. The number of endpoints supported by devices is limited. A low-speed device supports up to two groups of endpoints (2
(Input, 2 output), high-speed and full-speed devices support up to 15 groups of endpoints.

Pipe is a data transmission model between the host and the device endpoint. There are two types of pipelines:
PIPE) and message pipe ). Any USB device has an information pipe once powered on, that is, the default Control Pipe
The default control pipe is the default control pipe. The USB host uses this channel to obtain the description, configuration, and status of the device and configure the device.

When a USB device is connected to a host, the host must be enumerated by the default control channel, you can obtain the device description, Address Allocation, configuration description, and other operations before using the device. The plug-and-play feature of USB devices depends on this.


Enumeration: a very important activity in the USB system, which consists of a series of standard requests (if a device belongs to a subclass, it also contains special requests defined by this subclass ). Enumerate hosts
You can obtain basic device descriptions, such as the supported USB
Version, PID, vid, device category (class), power supply mode, maximum current consumption, quantity of configurations, number of various types of endpoints, and transmission capacity (maximum package length ). Host
PID and vid load the device driver and configure the device properly. Only the enumerated devices can be used properly. For bus power supply devices, you can obtain a maximum
100mA of the current.

The USB system defines four types of transmission:
Control Transmission: it is mainly used to enumerate devices during device connection and other specific operations due to devices.
Interrupted transmission: used for reliable transmission of small amounts of data with strict latency requirements, such as keyboards and game controllers.
Batch transmission: used for reliable transmission of large amounts of data, such as USB flash disks, with loose latency requirements.
Synchronous transmission: used for real-time data transmission with low reliability requirements, such as cameras and USB audio.
Note: interruption of transmission does not mean that during the transmission, the device will interrupt the host and then notify the host to start the transmission. The interrupted transmission is also initiated by the host. The polling method is used to ask whether the device has sent data. If yes, the data is transmitted; otherwise, the Nak host.

There is not much physical difference between different transmission types, but there are some differences in the transmission mechanism, the transmission Task Arrangement on the host, the restrictions on the occupied USB bandwidth, and the maximum package length. The USB device communicates with the host through a pipe and receives and processes the following three types of requests on the default control pipe:

1. Standard requests: a total of 11 standard requests, such as device descriptions, address settings, and configuration descriptions. All USB devices must support these requests. Host identifies and configures devices through standard requests.

2. Class requests: USB also defines several sub-classes, such as the hub class and large-capacity storage class. Different Classes define several types of requests, which must support these requests. The class to which the device belongs can be obtained in the device descriptor.

3. Vendor requests: these requests are not defined in the USB specification, but are defined by the device manufacturer to implement certain functions.

USB hub provides a low-cost and low-complexity USB interface extension method. The Hub upstream port is for host and downstream ports.
Applicable to devices (hubs or functional devices ). On the downstream port, hub provides the capabilities of device connection detection and device removal detection, and provides power to downstream ports.
The hub can enable different downstream ports separately, and different ports can work at different speed levels (high speed/full speed/low speed ).
Hub is composed of hub repeater, transaction translator, and hub
The Hub controller is composed of three parts. Hub repeater is the upstream Port
And downstream port between a Protocol control switch, it is responsible for the rebirth of high-speed data packets and distribution of rebirth and distribution. The Hub Controller is responsible
Host communication. The host communicates with the hub controller through the hub request to obtain the Hub
Descriptor to monitor and manage the hub and downstream ports. The forwarder can switch from high-speed to full-speed/low-speed communication.
Match with the full speed/low speed device. The Hub supports reset, resume, and suspend on the hardware.

Regeneration and distribution: The Hub repeater needs to identify the data received from the upstream (downstream) port and distribute it to the downstream (upstream) port. The so-called distribution mainly refers to the packet sent from the upstream port to all enable high-speed downstream ports, that is, broadcast.

In the USB system, USB host is responsible for device connection/removal detection, control flow and data flow management between hosts and devices, transmission status collection, and bus power supply.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.