Usb Protocol Sum
Usb Protocol Sum
A Comprehensive Guide
Contents
1. Introduction .............................................................................................................. 3
2. History of USB ........................................................................................................... 3
How Many Versions of USB Generations Are There? ..................................................... 3
What Do the Different Colors of USB Generations Mean? ............................................. 5
3. USB Architecture ....................................................................................................... 5
Overview of USB Architecture ..................................................................................... 5
4. USB Protocol Operations ........................................................................................... 7
Data Transfer Types ................................................................................................... 7
Packet Structure ........................................................................................................ 8
USB Protocol Architecture .......................................................................................... 8
How Does The USB Protocol Work? ............................................................................. 8
USB Protocol Features ............................................................................................... 9
USB Standards and Specifications ............................................................................ 10
5. How USB Works ...................................................................................................... 14
USB Data Packets Explained..................................................................................... 14
What Are USB Data Packets? .................................................................................... 14
Why Are USB Data Packets so Important? ................................................................. 15
What Are the Types of USB Data Packets?.................................................................. 16
6. USB Pinout and Connectors ..................................................................................... 17
USB Connector Types .............................................................................................. 17
Pin Definitions ......................................................................................................... 17
7. Generations of USB ................................................................................................. 19
8. Applications of USB ................................................................................................. 20
9. Future of USB .......................................................................................................... 23
10. Conclusion ........................................................................................................... 23
11. References ............................................................................................................ 23
FAQ (Frequently Asked Questions): .............................................................................. 24
1. Introduction
Universal Serial Bus (USB) is a widely adopted standard for connecting a variety of devices.
It has revolutionized the way we communicate and transfer data between computers and
peripheral devices. This book aims to provide an in-depth understanding of the USB
protocol, covering its architecture, operation, generations, applications, and future
prospects.
2. History of USB
The USB protocol or universal serial bus was first developed and launched by Ajay V.Bhatt
from Intel in the year 1996 later became part of consortium of companies including Intel,
Microsoft, and Compaq. The primary goal was to create a universal standard that could
simplify connections between computers and peripherals, replacing the complex array of
ports that existed at the time.
This USB is replaced with different kinds of serial & parallel ports for transferring data in
between a computer as well as different peripheral devices like scanners, printers,
keyboards, gamepads, digital cameras, joysticks, etc.
USB 1.0 was introduced in January 1996, which came later the USB 1.1 in September 1998.
These versions have a maximum speed of up to 12 Mbps and were initially made to ease the
speedy connection between 2 simple devices, for example, mouse and keyboard, to the
computer. But the problem was that USB 1.0 did not allow for extension cables and power
delivery which made it difficult to go to the market. As a result, USB 1.1 is the updated version
of USB 1.0 and has initiated the universal adoption of USB for data interface.
USB 2.0
The fact that USB is the universal standard for many modern-day devices, it has encouraged
the development of USB to keep up with user’s demands for faster and more reliable speed.
As a result, USB 2.0 was released in April 2000, offering increased speed at up to 480 Mbps,
and is believed to be 40 times faster than the USB 1.1 version. Additionally, USB 2.0 is
backward-compatible, allowing users to use previous USB versions to connect to their newly
adopted USB 2.0 computer and vice versa. Finally, USB 2.0 has succeeded in replacing the
last version of USB with its more reliable data transfer speed and power delivery of 2.5W, 5V,
and a maximum of 500mA current.
Compatibility: USB Type A, Type B, Mini A, Mini B, Mini AB, Micro A, Micro B, Micro AB.
Technology advancement has further pushed the adoption of IoT devices, especially in
industrial applications. Therefore, there is a vast increase in bandwidth demand to enable
more reliable and smooth data transfer speed. USB 3.2 Gen 1, also known as the
SuperSpeed USB 5Gbps, offers up to 5Gbps of data transfer speed. Most importantly, USB
3.2 versions have adopted the full-duplex mode that allows two connected devices to
transfer and receive data at the same time simultaneously. As a result, this USB version has
managed to attract many industries due to its significantly boosted data transfer speed,
especially now in full-duplex mode.
USB 3.2 Gen 2, formerly known as the USB 3.1, now offers up to 10 Gigabit/second of data
transfer speed. To avoid confusion, USB 3.2 Gen 2 is often called “SuperSpeed USB 10
Gbps”. This specific upgrade doubled the maximum transfer rate of the last USB version
delivering a significant performance boost to meet computing requirements for storage and
display applications. In addition, both USB 3.2 Gen 1 and Gen 2 have adopted the USB PD
offering up to 20V of power at 5A for a potential of 100 watts through supported hardware.
USB 3.2 Gen 2x2 was released in August 2017; this time the most significant update with its
compatibility was made on the type-C connector. This version of USB offers up to 20Gbps of
data transfer speed, also called the SuperSpeed USB 20Gbps. In addition, the type-c port
supports reverse insertion that simplifies its applications. Although USB 3.2 Gen 2 and USB4
have shown a significant increase in data transfer speeds, it supports this at shorter
distances. As a result, especially in industrial applications, the previous USB versions are
preferred and still widely used for current industrial applications.
3. USB Architecture
Overview of USB Architecture
The USB architecture consists of a master-slave configuration with a host controller at the
center managing communication between various devices.
Key Components:
- Device: Any peripheral that communicates with the host (e.g., keyboards, mice).
- Hub: A device that allows multiple USB devices to connect to a single port.
Host and Device Relationship
The host initiates all communication with the devices, which respond as slaves. This model
allows for efficient management of data flow and power distribution.
USB Hub
USB hubs expand the number of devices that can be connected to a single USB port. They
can be either powered or unpowered, distributing power to connected devices as needed.
2. Bulk Transfer: For large data transfers where timing is less critical.
4. Interrupt Transfer: For devices requiring guaranteed data delivery, like mice and
keyboards.
Packet Structure
USB communication occurs in packets, which include:
In this architecture, I/O devices are connected to the computer through USB which is called
as a hub. The Hub within the architecture is the connecting point between both the I/O
devices as well as the computer. The root hub in this architecture is used to connect the
whole structure to the hosting computer. The I/O devices in this architecture are a keyboard,
mouse, speaker, camera, etc.
Once the host becomes responsive to the new device then it knows the device capacities by
reading the available data within the particular memory of the USB interface of the device.
So that the host uses a suitable driver to communicate with devices. After that, the host
allocates an address to the new device which is written to the device register. With this
device, USB provides plug-and-play features.
This feature simply allows the host to identify the new available I/O device automatically
once the device is connected. The I/O capacities of the devices will be determined by host
software.
Another feature of the USB protocol is “hot-pluggable” which means, the I/O device is
connected or removed from the host system without doing any shutdown or restart. So your
system runs continuously when the I/O device is connected or detached.
USB protocol can also support the isochronous traffic wherever the data is transmitted at a
preset interval of time. The transmission of isochronous data is very faster as compared to
synchronous & asynchronous data transfer.
To hold the traffic isochronous, the root hub transmits a series of bits over the USB that
specifies the start of isochronous data & the actual data can be transmitted after this series
of bits.
USB supports three types of speed low speed -1.5 Mbps, Full speed -12 Mbps & High speed
– 480 Mbps.
It is a high-speed USB with 480Mbps of maximum data transfer speed. This USB supports all
connectors.
USB 3.2 (Generation1) is a super speed USB with 5Gbps of maximum data transfer speed.
It supports different connectors like USB 3 USB-A, USB 3 USB-B & USB-C.
USB 3.2 (Generation2) is also a super speed USB with 10Gbps of maximum data transfer
speed.
It also supports different connectors like USB 3 USB-A, USB 3 USB-B & USB-C.
USB 3.2 Generation 2×2 is a super speed USB with 20Gbps of maximum data transfer speed.
Thunderbolt 3 Standard
This USB is also called thunderbolt including up to 40Gbps of maximum data transfer speed.
The maximum length of cable for this USB is 2 meters for active and 0.8meters for passive
cables.
USB 4 Standard
This USB is also known as Thunderbolt 4 with up to 40Gbps of maximum data transfer speed.
The maximum length of cable for this USB is 2m for active & 0.8m for passive cables.
The timing diagram of the USB protocol is shown below which is mainly used in the
engineering field to explain the ON/OFF values of USB wires along a timeline.
A ‘1’ specifies no charge and a ‘0’ specifies active. As time grows you can observe the on/off
progression. The below system shows Non-Return to Zero Invert (NRZI) encoding which is a
more efficient method to transmit data.
In the above diagram, bit stuffing is happening which means that logic 1s are added for
allowing synchronization. If the data includes several 1s, then the USB cannot synchronize
the data. So in this manner, the hardware notices an additional bit & ignores it. It includes
overhead to the USB although ensures consistent transfer also.
In USB protocol, master devices are known as USB hosts which start all the communication
that happens above the USB bus. Here, a computer otherwise other controller is usually
considered as the master device, so if they request any information they only respond to
other devices. The slave device or peripheral is connected simply to the host device which
is programmed to provide the host device with the information it requires to operate. In
general, slave or peripheral devices mainly include keyboards, mouse of computers, USB
flash drives, cameras, etc.
It is very essential for host devices to communicate effectively with each other. Once the
peripheral device is connected to the computer through USB, then the computer will notice
what type of device it is & load a driver automatically that permits the device to function.
The small amount of data transmitted between the two devices is called as ‘packets’ where
a unit of digital information is transferred with every packet. The data transfer that can be
occurred within the USB protocol is discussed below.
Message Format
The data of the USB protocol is transmitted within packets LSB first. There are mainly four
types of USB packets Token, Data, Handshake & Start of the Frame. Every packet is designed
from various field types which are shown in the following message format diagram.
SYNC
In USB protocol, every USB packet will begin with a SYNC field which is normally utilized to
synchronize the transmitter & the receiver to transmit the data precisely. In a slow or high-
speed USB system, the field like SYNC includes 3 KJ pairs which are followed through 2 K’s
to frame 8-bits of data.
In a Hi-Speed USB system, the synchronization needs 15 KJ pairs followed through 2 K’s to
frame 32-bits of data. This field is long with 8 bits at high &low speed otherwise 32-bits long
for maximum speed & it is utilized to synchronize the CLK of the transmitter & receiver. The
final 2-bits will indicate wherever the PID field begins.
Packet Identifier Field or PID
The packer identifier field within the USB protocol is mainly used to recognize the packet
type that is being transmitted and thus the packet data format. The length of this field is 8
bits long where the upper 4- bits recognize the kind of packet & lower 4- bits are the bit-wise
complement of the upper 4- bits.
Address Field
The address field of the USB protocol indicates which packet device is mainly designated for.
The 7-bits length simply allows support of 127 devices. The address zero is invalid because
any device which is not yet allocated an address should be reacted to transmitted packets
to the zero address.
Endpoint Field
The endpoint field within the USB protocol is 4-bits long & allows for extra flexibility within
addressing. Usually, these are divided for the data moving IN/OUT. Endpoint ‘0’ is a special
case called as the CONTROL endpoint & each device includes an endpoint 0.
Data Field
The length of the data field is not fixed, so it ranges from 0 to 8192 bits long & always an
integral the number of bytes.
CRC Field
The Cyclic Redundancy Checks (CRC) are executed on the data in the packet payload where
all the token packets include 5-bit CRC & the data packets include a 16-bit CRC. The CRC-5
is five bits long & used by the token packet as well as the start of the frame packet.
EOP Field
Every packet is terminated by an EOP (End of the Packet) field which includes an SE0 or
single-ended zero for 2-bit times followed through the J for 1-bit time.
Synchronized Issues
The commonly faced synchronized issues within USB protocol include the following.
Whenever USB devices are developing then USB developer’s experiences commonly face
many synchronized issues which are also called communication errors of USB. Some of
these errors will cause failures of the system. The following examples are some of the issues
with USB bus that can happen:
USB data packets play an intrinsic role in USB communication protocols. When a device is
attached via a USB port, whether that be a mouse, keyboard or indeed a USB flash drive, the
host device is able to detect what kind of device it is and therefore automatically load the
corresponding driver to allow the peripheral device to run.
Data is transferred between these two entities in small amounts known as ‘data packets’. A
predetermined number of bytes is transmitted with each of these packets.
Each of these contain crucial information such as data, commands, and status updates
which are shared between the two devices.
The USB protocol specifies the format and structure of each packet, including the number
bits in each field, the order in which the fields appear, and the correct values used to identify
each type of packet.
Each packet is transmitted using a process known as ‘token passing’, this means the host
device sends a token packet to the device it needs to communicate with, and the device then
responds with what’s known as a ‘handshake packet’ to indicate whether it is ready to
receive data.
The handshake packet is one of many different kinds of data packet, but we’ll cover the most
common of these in more detail later in the article.
USB data packets are absolutely crucial giving both host and peripheral devices the ability
to communicate with each other. Without this fundamental data, even the most basic
communication wouldn’t be possible, and the USB protocol couldn’t function.
The structure and format of data packets are carefully designed to ensure reliable and
efficient communication between devices. Each packet contains several elements to enable
both devices to synchronise with each other to allow this seamless communication to occur.
Each packet contains sync, PID, data and CRC fields, each of these fields serves a different
purpose:
Sync Field – this is an 8-bit field that marks the beginning of the packet. The bit pattern can
be specifically recognised by host devices as the beginning of the communication process
to await further instruction.
PID Field – another 8-bit field that will identify the type of packet.
Data Field – this is a variable field that contains the data transferred from one device to the
other. The length of this field will vary depending on the type of packet that is being
transmitted.
CRC Field – this 16-bit field contains a checksum value used to verify the integrity of the
packet. In other words, the host device uses this field to check that the packet and its data
haven’t been corrupted in transit.
USB protocols will also specify the max packet size, transfer size and transfer rate to ensure
that each device can openly communicate with the other without creating sync errors or
other data management problems.
There are four different types of USB data packet, each with a different role and transaction
to follow, these are:
In – this informs the USB device that the host device is trying to read the information it has
stored on it.
Out – this informs the USB device that the host is trying to send information.
• Data Packets – there are two different types of data packets, each of which can
transmit up to 1024 bytes of data, these are simple named
Data0
Data1
• Handshake Packets – there are three kinds of handshake packets, which all consist
of PID fields.
ACK – this acknowledges that that packet has been successfully received.
NAK – this reports that the device temporarily cannot send or receive data. It is also used
when there is no data to send and will interrupt the transaction with the host.
Stall – this is used when the host finds that the peripheral device is in a state that requires
intervention.
• State of Frame Packets – this packet consists of an 11-bit frame that is sent by the
host every 500 nanoseconds on a full speed bus or every 0.0625 on a high speed bus.
5. USB Type-C: Reversible and supports higher data rates and power delivery.
Pin Definitions
USB Type-A Pinout
The typical Type-A USB connector is used in various applications. These USBs include 4 pins
that are given below. This type of USB is observed mostly in connecting various devices to
PC because it is the typical four-pin USB connector. This connector is taller and narrower
including 4-pins arranged within a box.
Type-A USB Connector Pin Configuration
The pins of Type A USB are indicated with color wires to perform a particular function.
Pin1 (VBUS): It is a red color wire, used for providing power supply.
Pin2 (D-): It is a differential pair pin available in white color, used for connectivity of USB.
Pin3 (D+): It is a differential pair pin available in green color, used for connectivity of USB.
In the above pins, both the D+ & D- pins indicate the transfer of data. When a ‘1’ is sent across
the wires, then the D+ line will have positive flow, and if ‘0’ is sent then the reverse happens.
USB operates at a nominal voltage of +5V for power delivery, with variations in current
capabilities depending on the USB version (up to 100W with USB Power Delivery).
7. Generations of USB
USB 1.0 and 1.1 (1996-1998)
- Speed: Up to 20 Gbps.
USB4 (2019)
- Speed: Up to 40 Gbps.
USB is extensively used for data transfers between computers and storage devices, making
file sharing simple and efficient.
Device Charging
USB has revolutionized how we charge devices, especially with the introduction of USB
Power Delivery, which allows for faster charging of smartphones and laptops.
Peripheral Connectivity
From printers to game controllers, USB provides a versatile connection interface for a wide
range of peripherals.
Audio/Video Integration
USB supports a variety of audio and video devices, making it essential for multimedia
applications like streaming and conferencing.
Industrial Applications
In industrial settings, USB connects machinery and devices for data collection and
monitoring, enhancing operational efficiency.
The USB standard has been widely used to connect machine components, programmable
logic controllers (PLCs), and sensors in industrial applications. In addition, USB usually acts
as the link in which it helps transfer raw data from the sensors to the computer for data
analysis and acquisitions. Here are some industrial applications that require USB port
connections:
Production line: USB has the ability to power and transfer data from cameras and sensors
make the USB interface a great asset for production line infrastructure setups.
Robot Automation: goals are to transfer data to the computers, make predictions, and
transfer actionable commands to the robots.
City and Surveillance: to monitor the situation in the city, computers usually require
computers to connect to different cameras and sensors throughout the city.
Agricultural Monitoring: ensure all the plants are in good conditions, enable the connection
between the computers to the sensors and switches to take specific actions when needed.
Kiosk and Vending Management: gateways and computers communicate with various USB
peripheral devices such as camera, printer, NFC/RFID, input keyboard, and more.
Advantages
• Easy to use.
• For multiple devices, a single interface is used.
• Its size is compact.
• Its connector system is robust.
• These are not expensive.
• These are available in different sizes with different connectors.
• Auto configuration.
• Its expanding is easy.
• High speed.
• Reliable and low cost.
• Power consumption is low.
• Compatible and durable.
Disadvantages
Future USB standards will likely push beyond current speeds to accommodate emerging
technologies like high-resolution video and virtual reality.
USB will likely support even greater power delivery, reducing the need for multiple chargers
and allowing for more powerful devices to charge via USB.
Adoption of USB-C
USB-C is expected to become the standard connector for most devices due to its versatility
and ease of use.
As data privacy concerns grow, future USB developments may include enhanced security
features to protect data integrity.
10. Conclusion
USB has transformed the way we connect and interact with technology. Its robust
architecture, various operational protocols, and continual evolution make it a vital
component of modern digital communication. As we move forward, USB will remain at the
forefront of connectivity innovations.
11. References
1. USB Implementers Forum. (2023). "USB Specifications." [USB.org]
(https://www.usb.org/documents).
3. Kuo, M. (2020). "Understanding USB and Its Generations." Journal of Technology and
Engineering.
USB is a standard digital data interface that acts as the bridge to connect computers to other
peripheral devices. USB was first introduced in 1996 and had been growing rapidly from the
first USB 1.0, 1.1, 2.0, 3.2 Gen 1, 3.2 Gen 2, 3.2 Gen 2x2, to USB4. As a result, USB has now
been the universal standard for data interface and power delivery.
USB is a standard digital data interface that acts as the bridge to connect computers to other
peripheral devices. USB was first introduced in 1996 and has been growing rapidly ever since
its inception. As a result, USB has now been the universal standard for data interface and
power delivery.
The USB standard has been evolving ever since it was first established. Last 2019, they
introduced the USB4, the 7th version of the four USB generations. These seven versions
include USB1.0, 1.1, 2.0, 3.2 Gen 1, 3.2 Gen 2, 3.2 Gen 2x2, and USB4.
Yes, key USB features in hot-swappability, backward compatibility, and expandability have
made it the right choice for industrial applications. Especially with the widespread adoption
of USB standards, it's even easier for industries to connect to machine-to-machine devices
and peripherals.
Thunderbolt cables are compatible with the USB4 Type-C devices and cables, but they are
not entirely the same. Thunderbolt was developed by the collaboration between Intel and
Apple, while USB4 was developed by the USB Implementers Forum (USB-IF). USB-C refers
to the connection that thunderbolt and USB4 use. In addition, Thunderbolt 3 and USB4 have
a very identical feature in which they can transfer data for up to 20 to 40Gbps. In comparison,
the thunderbolt4 reaches a maximum of 40Gbps data transfer rate and can also connect
external 4K displays, making it stands out when compared to USB4.