Global Sources
EE Times-Asia
Stay in touch with EE Times Asia
EE Times-Asia > Interface

FAQs: USB design

Posted: 14 Nov 2008 ?? ?Print Version ?Bookmark and Share

Keywords:FAQ? USB? high speed 2.0?

What are the differences between USB 1.1 and USB 2.0?
Finalized in 2001, USB 2.0 is an external bus that supports data rates up to 480Mbps. USB 2.0 is an extension of USB 1.1. USB 2.0 is compatible with USB 1.1. USB 2.0 cables and connectors will work with USB 1.1 devices. Not all USB 1.1 cables may work with USB 2.0 devices.

Is there a difference between Hi-Speed USB and USB 2.0? Which is the correct nomenclature?
There is a difference between the terms Hi-Speed USB and USB 2.0. The difference is that USB 2.0 is the specification. "Hi-Speed USB" refers to just the 480 Mbps portion of the USB 2.0 specification. A device can still be USB 2.0 compliant and be full speed or low speed.

How fast an USB device can communicate with a computer using USB?
USB 2.0 supports 1.5Mb/S,12Mb/S, and 480Mb/S speeds which are known as Low Speed, Full Speed, and High Speed respectively.

What is a USB Host?
The Host is the root of the USB tiered star network. It controls the bus and communication is initiated by USB Host. The USB protocol mandates a single Host in any USB system.

I have heard the terms USB Device, peripheral, and Function. What are the differences and what is the correct usage of terms?
The definition found in the USB specification for device notes the ambiguity in the word. The specification details that a "USB device" is either a hub or a function. When using the term "USB Device" should be used in place of "device" to help reduce the ambiguity. Even with the clarification of "USB Device", some publications use the term "USB Device" when they are referring to any USB enabled device. Because of this inconsistency of term usage, peripheral may be a less ambiguous wording option.

The USB specification does not define the term peripheral in its definitions list but uses it throughout the specification interchangeably for USB device. The USB certification checklists for USB devices are also called the peripheral checklists.

The definition for Function in the USB specification says that a function is a USB device that provides some type of capability to the host.

How many devices can be connected to one host?
Each host controller can support up to 127 devices. A host may contain multiple host controllers. The presence of root hubs and/or compound devices may change, based on their implementation, the total available physical devices. Hubs also count as a device on the bus so each hub will also reduce the number of available USB device/peripheral slots.

What is USB Hub?
A USB Hub is a USB device that allows other devices to attach to it, thus expanding the size of the network. Hubs can be either bus or self powered. A bus powered HUB cannot provide maximum power to all connected USB device but a self powered USB HUB can provide maximum power to each connected USB device. Since an USB device can expect minimum 100mAmp from USB Hub and maximum of 500mAmp per USB port, the bus powered USB hub can have maximum four down stream devices.

How many hubs can be chained together?
You can connect a maximum 5 hubs in a single chain.

Is there body that owns and controls the USB specification?
Yes, USB implementers forum also known as USB-IF. Their official website is from where you can download latest specification for USB which is freely downloadable.

How is data transferred in USB protocol?
USB Specification defines four different types of data transfers mechanisms.

Control Transfer
The USB Host sends commands & query to USB device using Control transfer. The Control transfer uses End point 0(EP0) while USB device is being enumerated and thus it is mandatory to support EP0 by all USB device irrespective of supported speed. The maximum size for a Control packet is 8, 16, 32 or 64 bytes. The packet length of Control transfer in Low-speed USB device must be 8Bytes, for Full-speed USB device must be 64Bytes and for High-speed USB device allows 8, 16, 32 or 64Bytes.

Interrupt Transfer
Interrupt transfers are a method for a USB device to request a certain polling rate from the USB host. The polling time is requested to USB Host by USB device during enumeration process. The maximum polling rate for a full-speed device is once per millisecond and once per every 10 milliseconds on low speed devices. The maximum data payload size for Low-speed USB device is 8Bytes, for Full-speed USB device is 64Bytes. This results in a maximum throughput of 64KB/Sec and 800B/Sec is for Low-speed USB device. Interrupt transfers are acknowledged so they guarantee the delivery. If a packet fails to arrive it is retried.

Bulk Transfer
Bulk transfers are a way for devices to transfers large amounts of data but as a consequence do not guarantee timely delivery. Bulk transfers have the lowest priority when it comes to scheduling on the bus. After all other transfers are complete the reset of the remaining bandwidth is given to bulk transfers.

Just like interrupt transfers, bulk transfers are acknowledged to guarantee their delivery. Bulk transfers are only supported by Full-speed and High-speed devices. For Full-speed USB device endpoints, the maximum packet size can either be 8, 16, 32 or 64 bytes long. For High-speed USB device endpoints, the maximum packet size can be up to 512 bytes long.

Isochronous Transfer
It provides guarantee of transfer rate. A Full-speed isochronous transaction can send 1023 bytes per frame. Isochronous transfers are not acknowledged. It is possible that isochronous packets will not arrive. A typical application for isochronous transfers is audio/video streaming where it is more important to keep the video and audio up to date at the expense of dropping packets. The maximum transfer rate can be 1023KB/Sec for Full-speed USB device.

What is a token packet?
USB protocol defines four types of packets:

  1. Start of Frame

  2. Token

  3. Data

  4. Handshake

There are three different types of Token packets.

  1. INInforms the USB device that the host wants to read information

  2. OUTInforms the USB device that the host wants to send the information

  3. SetupUsed to indicate to the device that a control transfer is about to occur.

How does USB protocol detect an error in communication?
USB protocol detects error using CRC (Cyclic Redundancy Check). This is done by the SIE (Serial Interface Engine), thus eliminating the need of CRC check in software and reduces the software overhead. For token packet CRC is 5 bit & data packet CRC is 16 bits.

What happens if the SIE receives data that is corrupted?
The SIE discards the corrupt packet if the packet fails the CRC checks. No software intervention is required. An error flag is set indicating that a corrupted packet was received. The SIE will not ACK packets that have incorrect CRC values. For interrupt, bulk, and control transfers the host will try to retransmit the packet if it fails to receive the ACK. In this way these transmissions will not have data loss due to a corrupted packet but may suffer from lower application bandwidth.

What is difference between transfer & transaction in USB protocol?
Transfers are groups of transactions and transactions are groups of packets.

What is the largest data packet that I can send?
It depends on type of transferred used. Interrupt & Bulk transfers have a maximum payload size of 64 bytes for full-speed USB devices. Isochronous transfers can send up to 1023 bytes for full-speed USB devices.

What is Enumeration process?
It is the process by which USB host learns about a USB device that has just been connected to the bus. Before the application is able to start running, the host queries the device for various information to determine what type of device it is, what device driver it needs to load for the device, what power requirements the device has, etc.

During the enumeration process the USB host also assigns an address to the connected device. After the address is set the USB host will communicate to the device at that address from that point forward.

On of the final tasks of the enumeration process is to set the device into a specific operational configuration. A detailed enumeration process is given in section 9.1.2 of USB specification.

How does USB host identify speed of USB device?
The USB host has weak pull down resistors on both of the communication lines (D+ and D-). A device will pull up D+ with a stronger pull-up resistor if it wishes to run in full-speed. If a device wishes to run in low-speed then D- is pulled up instead. The value of pull up resistor in each case is nominally 1K5.

How does the USB host reset the USB device?
The USB host sends a reset to the device by setting D+ and D- low for at least 10 milliseconds. A USB device is allowed to determine that reset has occurred if it sees that D+ and D- are low for more than 2.5 microseconds. Once the USB device detects the reset, it goes into default state as soon as the USB host removes the reset. This reset is a USB reset only and does not reset the controller.

If the USB host issues a reset command for a particular USB device, will it also reset other connected USB devices?
No. The USB host will request that a hub reset the particular connected USB device and only that device will be reset. If the USB host resets the hub itself then all of the devices attached to the hub will be reset.

How does USB host find out the name of connected USB device?
There are several strings located in the device descriptor of the USB device, one of which being the manufacturer string. These strings, if implemented, can be read by the USB host during the enumeration process.

What is device descriptor?
The device descriptor is data table that describes various information about the attached device, such as the vender ID (VID) and product ID (PID) of the manufacturer. The complete contents of the device descriptor can be found in Table 9-8 of the USB specification.

What is VID & PID?
VID stands for Vendor ID & PID stands for Product ID. The VID is issued by USB-IF by paying a required fee. USB-IF mandates each vender have their own VID in order to market their product. There are possibly both legal and technical complications involved when using a VID/PID that is not unique.

VID can be obtained from

Once a VID has been purchased, how the PIDs are used within that VID are determined by the manufacturer.

Do I need a new PID for each device that I produce?
A new PID is required for each product line produced. Each identical product in that product line should have the same PID. If each device in a product line requires a unique identifier then the iSerialNumber field of the device descriptor can be used to uniquely identify each device.

Can there be contention when two USB devices are connected simultaneously to USB Host?
No. The host resets one device at a time and then completes the enumeration of one device before it starts investigating the next device.

Source: Microchip Technology Inc.

Article Comments - FAQs: USB design
*? You can enter [0] more charecters.
*Verify code:


Visit Asia Webinars to learn about the latest in technology and get practical design tips.

Back to Top