USB1.1 protocol learning experience 2

Source: Internet
Author: User
First, let's take a look at the connection process of the USB device: When the USB device is connected or removed from the USB device, the host starts a process called busenumeration, to identify and manage changes to the device status. When a USB device is connected to a power-on port, the system performs the following operations: 1. a USB device connects to a host through a hub

First understand the connection process of the USB device: When the USB device is connected or removed from the USB device, the host starts a process called bus enumeration, to identify and manage changes to the device status. When a USB device is connected to a power-on port, the system performs the following operations:

First, let's take a look at the connection process of the USB device:

WhenUSBConnect the device to or fromUSBWhen the device is removed, the host starts a bus ID(Bus enumeration)To identify and manage changes to the device status.USBWhen the device is connected to a power-on port, the system performs the following operations:

1. USBThe Hub connected to the device sends a Report to the host through its status change channel to the host.USBThe device is connected. At this time,USBThe device is in the power-on status and its connected port is invalid.

2.The host queries the hub to determine the exact meaning of the status change.

3.Once the host is notified that the new device is connected, it must wait for at least100 msTo make the insertion Operation complete and the power supply of the device stable. Then the host sends the port enabling function and the reset command to that port.

4.The reset signal of the hub to send the port continues.10 ms. After the reset signal is cleared, the port is valid. ThenUSBThe device is in the default status and can beVBUSLess100mAAll device registers and status have been reset, and the device can respond to the default address.

5.The host assigns a unique address to the device, and the device changes to the addressing status.(Address state).

6.InUSBThe default control channel of a device before it accepts the device address.(Default Control Pipe)The default address is addressable. The Host reads the device description table to determine the actual net data load of the device's default channel.

7.The Host reads configuration information from the device from the configuration0Read ConfigurationN-1, WhereNThe number of configurations. This operation takes several milliseconds.

8.The host sends a configuration value to the device based on the configuration information obtained from the device and how the device is used. At this moment, the device is in the configuration status.(Configured state)All the node nodes related to this configuration are configured according to your requirements,USBThe device can nowVBUSThe power required in the description is obtained. From the device perspective, it is ready.

WhenUBSWhen a device is taken away, the hub will also notify the host. disconnecting a device will invalidate the port connected to the device. After receiving the disconnection notification, the host will update the topology information.

Address Allocation

WhenUSBAfter the device is connected, the host is responsible for assigning a unique address to the device. This operation is performed after the device is reset and port enabling.

Configuration

USBThe device must be configured before it can be used normally. The host is responsible for configuring the device. GenerallyUSBAfter obtaining the configuration information, the device determines which functions the device has.

As part of the configuration operation, the host sets the configuration value of the device, and selects an alternative setting for the appropriate interface if necessary.

Only one simple configuration is required. A device may support multiple interfaces. An interface is a set of end nodes that represent a single feature or feature provided by a device to a host, the protocol used to communicate with this set of related end nodes and the purpose of each end node in the interface can be used as a part of a device category or defined by the vendor.

In addition, the ports in a configuration may have alternative settings. These alternative settings will redefine the number or features of related end nodes. If so, the device must supportGetInterface (Interface request)AndSet Interface (Interface settings)Request to report and select the device selection settings for the specified interface.

Under each device configuration, each interface description table may include the fields used to identify the interface and the alternative settings.0~N-1Id.NThe number of interfaces that can be used at the same time supported by the configuration.0Start. After the device is initialized, the default setting is optional.0.

To support generic device drivers for managing a set of relatedBUSThe device and interface description table contains the class(Class), Subclass(Sub class), And Protocols(Protocol)Domain. These domains are used to identify the features of a device and protocols for communication.

A class value is assigned to a group and dividedUSBClass description. Devices of a class can be further divided into sub-classes. In a class or sub-class, a protocol value can define how the host software communicates with the device.

Data Transmission

Data can be stored inUSBTransmission between the device node and the host.

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.