USB Protocol Specification Classification and Traffic Error Guide
Welcome to our comprehensive USB Protocol Guide! As technology continues to advance, understanding the intricacies of USB protocols is crucial for seamless connectivity. This guide will walk you through the various USB Protocols, their applications, and the common mistakes of USB technology. Whether you’re a tech enthusiast or a professional in the field, this guide aims to demystify USB protocols and empower you with knowledge.
What is USB Protocol?
The USB protocol refers to the communication protocol of the universal serial bus interface standard. It defines the rules and standards for transferring data between different peripherals (such as mice, keyboards, digital cameras, printers, media devices, scanners, and external hard drives) and host controllers (such as smartphones, iPads, or PCs). The Universal Serial Bus protocol was designed to institutionalize a wider range of uniform cables and connectors that can be used on a variety of different devices and are hot-swappable for plug-and-play effects. It helps to ensure the compatibility and interoperability of devices, thus promoting the popularization and development of modern computers and consumer electronic devices.
The USB architecture was a concept jointly proposed by companies such as Intel, Compaq, IBM, Microsoft, Digital Equipment, and Northern Telecom in 1996. Currently maintained and managed by USB-IF, USB-IF enforces USB standards and specifications that manufacturers of USB devices or cables must follow in order to be verified as a trusted USB source during the device connection process. Devices that comply with the USB transfer protocol are approved to use the USB logo to inform consumers that the cable or device is safe to use.
How does usb protocol work?
The working principle of the USB communication protocol is very simple and cost-effective. It uses a polling principle that dictates how USB cables and devices work. In a normal USB transaction, host and peripherals send and receive data, acknowledging (ACK) or denying (NAK) certain transactions, allowing for effective communication. In one example of effective USB transmission, the host will send an IN token to the peripheral, and the peripheral will respond with a data packet. A USB host is usually a computer or other controller that actively initiates communications on the USB bus, constantly checking to see if the external device is ready to transfer data. Peripherals include flash drives, mice, keyboards, cameras, and more. They connect to the host and provide the necessary information to the host to perform its operations. Each packet transmits an integral number of bytes at the current transmission rate. Packets start with a synchronization pattern, followed by the data bytes of the packet, and concluded with an End-of-Packet (EOP) signal. All USB packet patterns are transmitted least significant bit first. Effectiveness of communication is critical for host and peripheral devices.
The active checking action of the host makes it unnecessary for the external device to notify the host actively. Therefore, this approach makes USB cheap and easy to implement. When a new device is connected to the USB bus, the host will first address it as “0”. The host then periodically polls each connected device for their status, such as whether they are connected or disconnected. Once the host detects a new device and responds, it reads the memory inside the device’s USB interface to obtain information about the characteristics of the device so that it can communicate with the appropriate driver needed. Next, the host assigns a unique address to the new device and writes this address into the device registers. This is the plug and play function of USB, so that the host can automatically identify and communicate with new I/O devices.
PLEASE NOTE: If either party is unable to perform its duties, there will be a problem with communication. For example, if there is no response after inserting a flash device, this may indicate a problem with bus communication. To understand how USB data is transmitted and received, we also need to understand the fields of USB packets, packet types, and the different types of USB data transfer methods. This helps to better understand how USB communication works. Let’s go and learn more about it with APPHONE.
What are the types of USB protocol specifications?
The USB protocols specification has evolved from the original 1.0 to today’s 4.0 Gen 3 dual-channel version. In the past nearly 30 years, many USB-related specifications and sub-standards have been derived. Let’s get to know them below.
The basis of the USB protocol is from the initial version 1.0 to today’s version 4, which define the basic architecture of the USB interface, the physical standards of the USB connector and the basic data transmission specifications. It is the basis for data transmission of all USB devices. Click to learn about the detailed development history of the USB transmission standard.
The full name of UVC is USB video class, and it supports three versions, namely UVC1.0, UVC1.1 and UVC1.5. Mainly used in the field of USB video transmission, common UVC devices are USB cameras and monitors.
The full name of the UAC specification is USB AUDIO class, which supports 3 versions, UAC1.0, UAC2.O and UAC3.0. UAC1.0 is commonly used in older devices, and UAC2.0 is only supported in the Windows 10 operating system. Common USB audio devices include: USB microphone, USB speaker and USB headset, etc.
HID full name: human input device, mainly used to realize the USB device of human-computer interaction. Such as our commonly used USB keyboard, USB mouse, etc.
Full name of CCID: Integrated Circuits Cards Interface Device. It provides a smart card reading and writing device to communicate with a host or other embedded hosts.
The full name of CDC is Communication Device Class, which is a USB subclass specially used by the USB organization for various telecommunications communication equipment and medium-speed network communication equipment. The USB to serial port we usually use is the CDC protocol used. According to the different communication devices targeted by the CDC class, the CDC class is divided into the following different models: USB POTS model, USB ISDN model and USB network model. Among them, the USB traditional pure telephone business model can be divided into Direct Line Control Model, Abstract Control Model and USB Telephone Model.
The full name of BOT: Bulk-Only Transport, was designed and formed in 1999 when the USB 1.1 version was released. So far, the fastest USB 3.1 can be backward compatible with this basic BOT transmission protocol. BOT transfers were often used in the past for USB mass storage.
The full name of UASP: USB Attached SCSI Protocol, was born in 2008 together with USB 3.0. UASP transmission is used for USB mass storage, and with the development of electronic data transmission efficiency requirements, UASP plays the role of replacing BOT.
The full name of MTP: MediaTransferProtocol, is a custom extension protocol based on the Picture Transfer Protocol (PTP).
The MTP protocol was defined as a mature USB class by the USB Developers Forum in May 2008. Since then, MTP has become an official extension of the PTP protocol, and both have the same class code.
What other extension protocols does USB communication support?
In addition to the above basic specifications, USB also supports many extension protocols to facilitate the realization of communication performance requirements between modern high-speed electronic devices:
- USB On-The-Go (USB OTG):This protocol allows mobile devices (such as smartphones and tablets) to be positioned as hosts, directly connected and communicated without a computer, in order to exchange files and connect external devices.
- USB Power Delivery (USB PD): The USB PD specification expands the power transmission capability of USB, enabling it to transmit higher power power. This greatly improves the charging efficiency of the USB interface, not only for charging low-power devices, but also for charging laptops and other high-power devices.
- USB Mass Storage: This protocol defines a common communication method for USB storage devices, such as USB flash drives and external hard drives.
- USB Video: This protocol allows digital video signals to be transmitted via USB, and is usually used to connect cameras and video capture devices.
- USB Printer: This protocol defines the protocol required to communicate with the printer, allowing the computer to connect and control the printer.
- USB Wireless USB: This is a wireless USB protocol that allows devices to connect to USB through wireless communication without physically connecting cables.
These protocols extend the functionality of USB to a variety of different types of devices and uses. Different USB connector ports support different USB protocols by communicating in a standardized way, thereby improving interoperability between devices.
What are the traffic errors when developing USB devices?
When developing new USB devices, developers will inevitably encounter bus problems with USB communication errors. These errors may lead to unstable operation of the system, and serious ones may directly lead to system failure and failure to operate. Here are some common traffic problems during development:
USB packets contain error checking mechanisms to ensure data validity and proper ordering. Sometimes, these mechanisms can go wrong, causing errors in USB data transfers or data corruption. This can result in packet loss or a slowdown in transfer speed.
For example, if a packet is corrupted, the receiver will notify of the error and ask to resend the data. However, multiple retransmissions may result in packet loss, as the receiver may mistake this for duplicate data.
Another problem could be data misordering, i.e. data not being transmitted in the correct order. This may result in data not being passed correctly to the application.
In the normal USB communication protocol, the host and peripheral send data, and confirm or reject certain transactions to ensure that the communication is valid. But sometimes the transfer can go wrong, causing the data to need to be retransmitted.
For example, if a packet is corrupted, the host might reject it and ask for a resend. The peripheral will resend the same data to ensure it was received correctly. This is called data retransmission. However, if data retransmissions occur frequently, performance degradation and packet loss may occur.
Another common USB problem involves power and VBUS (power delivery).
VBUS is a wire in the USB connector that is used to provide power to the device. Both the host and the peripherals have upper limits on current supplementation and consumption to ensure system stability. If a device draws too much current, the system may shut it down. There can also be current problems due to misconnections or enumeration issues, which can cause connections to drop or fail to complete.
In the USB system, enumeration is a process of detecting a device, determining its type and communication speed, just like a handshake between devices. The host resets the device and then reads the device’s descriptive information to identify it. If there is a problem with the device description information, such as the wrong length, it may cause enumeration failure and make the device unable to connect normally.
High-speed USB devices can be compatible with low-speed and full-speed devices, so USB 3.1 supports backward compatibility. When a device is first connected, full speed mode is used until the device confirms that it supports high speed mode. For high-speed negotiation, a protocol called chirp needs to be implemented. The host sends a specific signal, waits for the device to respond, and if the response is correct, a high-speed connection is established. If there is a problem, it can cause miscommunication between devices because they did not negotiate the communication speed properly.
In USB communication, the occurrence of certain events is important for successful communication. A reset event allows the device to reinitialize so that communication can begin. The suspend event allows the device to enter a power-saving mode when not in use, but needs to be able to respond correctly to the resume signal. Halt conditions (in which data flow stops prematurely) and unending transfers (in which data flow is formally not acknowledged (NAK’d) by the device). If problems occur during these events, the device may not enumerate properly, hang, or wake up, affecting communication.
Application field of USB protocol.
USB was originally designed to replace various interfaces such as serial ports, parallel ports, game ports, and ADB ports and standardize the connection between peripherals and computers. Currently, the USB protocol is commonly used in connection systems between computer hosts and peripheral mobile devices. The specific application devices are as follows (not limited to the following devices):
Keyboards, mice, game consoles, joysticks, printers, scanners, webcams, cameras, storage devices, audio devices, flight controllers, hub adapters, cell phones, computers and data collectors, etc.
Features of USB.
The USB transfer protocol has many advantages and some disadvantages, the following are some characteristics of the USB protocol:
Adaptability: Since USB supports a variety of data communication protocols, almost all computers, consumer electronics devices and peripheral devices support USB interfaces. This makes the interconnection between devices easy, and users don’t have to worry about connecting different devices.
Hot-plug support: USB supports hot-plug, which means you can plug or unplug a USB device while the device is running without restarting the computer. This reduces operational inconvenience.
Power supply: The USB interface is not only used for data transmission, but also can provide power. This means you can charge mobile devices, keyboards, mice, etc. via the USB port, making USB the ideal way to charge and connect portable devices.
Data Transfer Speed: As the USB standard has evolved, data transfer speeds have continued to increase. The current highest USB 4 supports data transmission speeds up to 40 Gbps, making it suitable for high-speed data transmission needs.
Multi-device support: The USB protocol supports a variety of everyday devices making USB a versatile connectivity standard.
A variety of USB connector options: USB has a variety of different connectors to choose from, and people can choose the appropriate USB connector according to their own application scenarios. Click for detailed USB port information.
Reliable and cost-effective: Now the related cable manufacturing process for the USB protocol is very mature, especially APPHONE can provide very reliable USB cables and the cost is not high.
Transmission distance: The USB connection distance is limited, usually within 5 meters. This may not be sufficient for scenarios requiring long-distance connections.
No broadcast function: The USB protocol only supports point-to-point communication between the host and external devices, and does not have the communication characteristics of DisplayPort daisy chain function. Multiple display devices cannot be connected at the same time.
Power supply limitation: The power supply of ordinary USB interface is limited, which cannot meet the needs of high-power devices. This requires other charging standards, such as USB Power Delivery (USB PD).
Complexity: As the USB standard evolves, so does the complexity involving protocols and compatibility. Compatibility issues may arise when dealing with USB devices of different versions.
Counterfeiting: Due to the high market demand for USB, some small workshops will manufacture low-quality USB cables at very low cost to disrupt the market and user confidence.
Overall, the USB protocol is known for its ubiquity, convenience, and versatility, but there are some limitations. Users need to choose the appropriate USB connection method according to their specific needs and device types. In APPHONE, the USB cable manufacturing process is very mature, and we have rich production experience from cable inner core, port structure to wiring principle. The ability to turn your ideas on electronic cables into solid and reliable reality. Come on, contact us to start your customized USB cable journey.
USB signals are transmitted via differential signaling on twisted pair data cables with a characteristic impedance of 90 Ω ± 15%. Low Speed (LS) and Full Speed (FS) modes use a single data pair of half-duplex, labeled D+ and D−.
UART devices were created to be compatible with RS-232 serial data communications. However, USB has almost completely replaced these outdated cables and connectors that used UART communication to operate. The USB protocol also follows the RS-232 standard, but is more advanced.
USB4 2.0, the USB4 2.0 specification was released by the USB Implementers Forum in September 2022. USB4 is based on the Thunderbolt 3 protocol. It supports 40 Gbit/s throughput, is Thunderbolt 3 compatible, and is backwards compatible with USB 3.2 and USB 2.0.
Chir is the protocol used to negotiate high-speed mode with the host or hub during reset. High-speed capable devices first connect to the host as full-speed devices. If both the host and the device have high-speed capabilities and the negotiation is successful, they can both operate in high-speed mode.
Fastest delivery within 22 days
Fastest 3-day proofing cycle
24-month long warranty
Professional customer service follow-up