MyAdvantech Registration

MyAdvantech is a personalized portal for Advantech customers. By becoming an Advantech member, you can receive latest product news, webinar invitations and special eStore offers.

Sign up today to get 24/7 quick access to your account information.

USB Basics

10/21/2018

Imagine a network based on inexpensive, high volume chipsets, with data rates up to 12Mbps, 25 meter distance, designed from the start with plug-and-play in mind. Add 5 Volt power, with up to 500mA current capacity, and compatibility with many consumer products. 

What we just described is “Universal Serial Bus” (USB) — an external connectivity communications technology for linking peripherals such as mice, keyboards, modems, joysticks, video and more to Macintosh and PC computers. It has gained favor commercially and privately since its development in 1994. 

Today, it is a standard feature on most all new PCs as it quickly replaces PC serial ports. This has been driven by some of the largest electronics manufacturers. It was inevitable that USB would also become a factor in the retail, data collection and industrial worlds. 

Where USB Came From 

USB grew from the requirement for a simple, inexpensive expansion bus for PCs. PCI solved many speed and compatibility problems that existed with the ISA bus. But, the need to take the cover off the PC to add a peripheral was a hassle. And, though PCI made Windows plug-n-play possible, we have all experienced the frequent reality of “plug-n-pray” instead. 

USB is serial (less costly than parallel) and allows you to “hot-swap” without rebooting the PC. In USB, the PC is the master of the network and controls all bus traffic. Peripherals are simpler and less costly. 

A USB master does not have to be a PC, but usually is. Today, all versions of Windows and Linux support USB. An embedded device is a computer that does not look like a computer. Only sophisticated embedded devices with full operating systems will be USB masters. 

“Can I add USB to a computer that does not have a USB port?” 

Today, most all new PCs come with USB ports. But other, especially older, computers may not have them. 

You can add USB by installing a PCI add-in card. You may need to upgrade the computer’s O/S and BIOS for it to work. Are you running out of PCI or ISA slots? With USB you can forget about setting COM ports and IRQ’s – just plug in a USB to RS-232, RS-422, RS-485 or parallel converter. 

USB Protocols, Data Rates, Devices

3


 
 

USB Star Topology Diagram

14

USB uses a “star” topology, meaning there is only one device connected at each end of a cable; multiple devices require a hub to re-distribute the signal.

Highlights 

A single USB port can connect up to 127 peripheral devices. 

Plug-and-Play – USB supports Microsoft’s plug-and-play (PnP) specification as well as hot-swapping or hot-plugging (i.e., you can unplug something and plug in something else on the fly, without shutting down the computer). 

It is auto-configuring – the peripheral device and computer figure out how to communicate without disrupting anything else. 

It is a “cross-platform” standard – it will work on either a Macintosh or PC. 

It can support up to 500mA of current to items on the bus. 

Technology & Systems 

Three things comprise USB technology: 

  • Host - master connector or controller, the host computer. 
  • Hub - host’s root node that allows multiple USB devices to be connected. 
  • Function - actual USB devices (mouse, keyboard, etc.). 

Three things comprise a USB system:

  • Host  
  • Device 
  • Physical bus (represented by the cable) 

Data Transfer Methods 

Four data-transfer methods are used with USB devices: 

  • Bulk - used for devices that have large amounts of data to transmit or receive (canners, printers) and need guaranteed delivery, but have no particular bandwidth requirements. 
  • Control, bi-directional - at rates of 8, 16, 32, or 64 bytes [1 byte = 8 bits], depending on device and transfer speed, and used by software to query, configure, and issue generic commands. 
  • Interrupt - used to poll devices (keyboards, mice, joysticks) that sporadically and unpredictably produce small amounts of data, to determine if they have data to transmit.
  •  Isochronous - used for time-critical data streaming or real-time applications requiring constant, steady data transfer rates. 

Interfaces, Endpoints 

USB devices have at least one interface, which is the peripheral’s physical component. 

Each interface has a set of endpoints, which are data producers or consumers. All USB devices have a special endpoint called “endpoint 0” that supports generic USB status and configuration protocol. 

Device drivers establish logical communication channels, called “pipes”, which are software associations between the endpoints and driver. 

Endpoint characteristics determine pipe characteristics (e.g., communication direction, required bandwidth, etc.). 

More on USB 2.0, OTG, 3.0 

Version 2.0 is backward compatible with USB 1.1 and also retains the plug-and-play and hot-swapping capabilities of 1.1. OTG, a supplement to USB 2.0, allows mobile-device interconnectivity when a PC/laptop is not available. 

USB 3.0 “SuperSpeed” adds even higher data rates, more downstream device power, plus smart charging/powering. 

Important to note is that, while each version of USB is backwards compatible with its predecessors, it cannot make earlier version devices go any faster. 

USB Summary 

Origin: USB is a multiple platform serial network standard created by Microsoft, Intel, and various PC vendors for linking low and medium speed computer peripherals. 

Power: 5V, up to 500 mA, for each device or hub on the network. 

Nodes: 127 (maximum) 

Distance: ~4 meters (14 ft) (maximum) without the use of a hub; ~25 meters (82 ft) (maximum) with use of multiple hubs. 

Baud Rate: 1.5 Mbps and 12 Mbps can co-exist on the same bus. However, mixing speeds should be avoided as it substantially slows communication. It is best to split the devices between two host connections. Note that 1.5 Mbps wiring does not require shielding.

Termination: Built in to devices. 

Wiring: Cascading or star topology options; multiple devices supported by extending with multi-port hubs. Cables have a two-conductor, twisted-shielded pair of wires for twodirectional data, plus two heavier wires for 5V power and ground. 

Signal: Low-amplitude signal minimizes EMI/RFI interference: 0.4 Volt differential centered at 1.75 Volts DC. 

Common Hardware: USB hubs expand networks to accommodate up to 127 devices. ISA and PCI cards for USB are popular and adapters are also available for converting serial, parallel and Ethernet ports to USB. 

Typical Applications: Consumer electronics such as digital cameras, speakers, telephones, storage devices, scanners, printers, keyboards and mice. Also beginning to appear in data acquisition systems as alternative to GPIB (General Purpose Interface Bus) and in configuration ports for embedded devices. 

Supporting Organization: The USB Implementers Forum is a not-for-profit organization created to promote, support and market Universal Serial Bus, wireless USB, USB On-The- Go, plus specification and compliance maintenance. www.usb.org

10