Time:2024-07-25
USB, short for Universal Serial Bus, is an external Bus standard used to regulate the connection and communication between computers and external devices. It is the interface technology applied in PC field.
Since its launch, universal serial bus (USB) has successfully replaced serial and parallel ports as one of the standard extension interfaces and must-have interfaces for a large number of 21st century computers and smart devices. USB has the advantages of fast transmission speed, easy to use, hot plug support, flexible connection, independent power supply and so on. It can connect a keyboard, mouse, large-capacity storage device and other peripherals. The interface is also widely used in smart phones. Intelligent devices such as computers interact with external data mainly through network and USB interface.
Each USB has only one host, which includes the following layers:
The USB bus interface handles the interconnection between the electrical layer and the protocol layer. From an interconnection point of view, a similar bus interface is given by both the device and the host, such as a serial interface machine (SIE). The USB bus interface is implemented by the main controller. The USB system USES the master controller to manage the data transfer between the host and the USB device. The interface between it and the master controller depends on the hardware definition of the master controller. The USB system is also responsible for managing USB resources, such as bandwidth and bus power, making it possible for customers to access USB. USB system also has three basic components:
Master controller driver (HCD) this maps the different master controller devices to the USB system. The interface between HCD and USB is called HCDI. Specific HCDI is defined by operating systems that support different master controllers. The universal master controller drive (UHCD) is at the bottom of the soft structure and manages and controls the master controller. The UHCD implements communication with the USB master controller and controls the USB master controller, and it is hidden from the rest of the system software. The highest level in the system software communicates with the master controller through the UHCD's software interface.
USB driver (USBD) it is on top of the UHCD drive, it provides a drive level interface, to meet the requirements of the existing device drive design. USBD provides the data transfer architecture in the form of I/O request packets (IRPs), which consists of the need to transfer data through specific pipes. In addition, USBD enables the client to present an abstraction of the device for ease of abstraction and management. As part of the abstraction, USBD has default pipes. It provides access to all USB devices for standard USB control. The default channel describes a logical channel for communication between USBD and USB devices.
In some operating systems, USB system software is not provided. The software is intended to provide configuration information and load structure to device drivers. In these operating systems, the device driver applies the provided interface instead of accessing the USBDI junction directly
It sits at the top of the software architecture and is responsible for handling specific USB device drives. The client layer describes all software portals that act directly on the device. When the device is detected by the system, these clients apply directly to the peripheral hardware. This Shared feature places the USB system software between the customer and its device, which is handled by the client based on the device image that the USBD forms on the client.
The HCD provides an abstraction of the master controller and an abstraction of the master controller perspective of the data transferred over USB. USBD provides an abstraction of USB devices and data transfer between USBD customers and USB features. USB systems facilitate data transfer between customers and functions and act as a control point for the canonical interface of USB devices. USB systems provide buffer management capabilities and allow data transfers to be synchronized with customer and functional requirements.
USB USES a four-wire cable, two of which are serial channels for transmitting data, and the other two provide power for downstream devices. For any peripherals that have been successfully connected and identified by each other, data will be transmitted at the highest rate that can be supported by both devices. The USB bus automatically switches dynamically from high speed to low speed in the compatible transport mode based on the peripherals and the match is locked at the appropriate rate. USB is a token-based bus. Similar to token ring networks or FDDI token-based buses. The USB master controller broadcasts the token, and the device on the bus detects whether the address in the token matches itself and responds by receiving or sending data to the host. USB manages the USB bus power supply by supporting suspension/recovery operations. USB system adopts a cascading star topology, which consists of three basic parts: host, hub and functional device.
Host, also known as the root, the root knot or the root Hub, it do on the motherboard or as adapter card is installed on the computer, the host contains a main controller and root Hub, controls the USB bus data and control the flow of information, each USB system can have only one root Hub, it is connected on the main controller, a computer may have multiple root Hub.
Hubs are specific components of the USB architecture that provide points called ports to connect devices to the USB bus, detect devices connected to the bus, and provide power management for these devices, responsible for fault detection and recovery of the bus. The hub line can be used to power the bus as well as itself .
The functional device is connected to the bus through the port. USB can also be used as a Hub.
The master controller is responsible for the transfer of data streams between the host and USB devices. The transmitted data is treated as a continuous bitstream. Each device provides one or more interfaces to communicate with the client, each consisting of 0 or more channels that independently transmit data between the client and the device's specific terminals. USBD establishes the interface and pipeline for the actual requirements of host software. When the configuration request is made, the main controller provides services according to the parameters provided by host software.
USB supports four basic data transfer modes: control transfer, isochronous transfer, interrupt transfer, and block transfer. Each transport mode applied to a terminal with the same name has different properties.
Supports the transmission of control, status, configuration and other information between the peripheral and the host, providing a control channel between the peripheral and the host. Each peripheral supports the control transport type so that configuration and command/status information can be passed between the host and the peripheral.
Supports data transfer between peripherals and hosts with periodicity, limited delay and bandwidth and constant data transfer rate. This type of error-free checking does not guarantee correct data transmission, and supports data transmission between systems such as the computer-to-phone integration system and the audio system to the host computer.
Support for input devices such as gamepads, mice, and keyboards, which transmit small amounts of data to and from the host, are not periodic, but are sensitive to response times and require immediate response.
Support printer, scanner, digital camera and other peripherals, these peripherals and host transmission of large amount of data, USB in the case of bandwidth to carry out this type of data transmission.
USB adopts block bandwidth allocation scheme. If the peripheral exceeds the current bandwidth allocation or potential requirements, it cannot enter the device. Terminals of synchronous and interrupt transmission types retain bandwidth and ensure that data is transmitted at a certain rate. Centralized and controlled terminals transmit transmitted data at the best available bandwidth.
USB's pci experience: USB1.1 - supports low rate of 1.5mbps and full rate of 12Mbps; USB2.0 - supports high speeds of 480Mbps; USB3.0 - supports 5Gbps at very high rates. With the continuous improvement of standards, its essence is the improvement of signal transmission rate. Such a high transmission rate requires a higher signal quality. Therefore, how to ensure the signal quality in the complicated circuit board is the top priority in USB design.