choosing_(and_implem
TRANSCRIPT
Choosing (and Implementing)the Correct USB Connectivityfor Your Embedded System
Steve Wetterling, MSEEEmail = [email protected]
Pat Barrett, BSEE, P.E.Email = [email protected]
USB Basics from the User’s Point of View
Easy to use – all configuration is automatic Fast data transfer Reliable data transfer Adaptable to different applications Wide range of devices and peripherals available Cheap to buy Fully supported by Windows™ and Linux The USB development community keeps
improving it
Where Did USB Come from ?
A joint-effort by a group of manufacturers (Compaq,HP, Intel, Lucent, Microsoft, NEC and Philips)
Replaces the aging Parallel Printer Port andSerial Port PC interfaces.
Supported by the USB Implementers Forum, Inc.(USB-IF, www.usb.org), in Beaverton
USB-IF Member companies get access to Vendor Ids, specifications, testing, and use of the USB logos.
Describing USB
Universal Serial Bus Serial data transfer @ 1.5M, 12M or 480M bits / sec. Short distances (16 ft), with Hubs to 96 ft max Asynchronous (not slaved to a common clock) Master to Slaves = Host to Peripherals A 1 to N network, where N = 1 to 127 Peripherals can be powered by Host (500mA limit)
Provides data error detection with retransmission
How USB Works
A single Host communicates with each/all Peripherals The Host recognizes a newly attached Peripheral and
“Enumerates” to establish communication The Host assigns an address to each Peripheral Transfer speed is established during Enumeration:
Low Speed 1.5 M/ bits per sec
Full Speed 12 M/ bits per sec
High Speed 480 M/ bits per sec
More How USB Works
Each Peripheral can contain 1 or more “Endpoints” Successful Enumeration establishes a logical “Pipe”
between the Host and each Endpoint. Data transfers between the Host & Peripheral through
established Pipe, at the agreed-upon speed Pipes are automatically terminated when the peripheral
is disconnected or fails to respond.
More How USB Works
Four “Data Transfer types” are available, to fitspecific applications:
Control – For short messages used during Enumeration,Identification and Control
Bulk – Good for moving big files to/from Printers,scanners, and disk drives
Interrupt – Used for Mice & Keyboards (small amounts ofdata that must be delivered to a PC quickly and predictably)
Isochronous – For unidirectional streaming of audio & video,no error correction.
More How USB Works
Host sends & receives data in “time slices”called Frames:
For Low Speed & Full Speed – Frames are 1 msec
For High Speed – Microframes are 125 μsec
Data transfers are organized as “Transactions” consisting of:
Token Packet (destination ID bytes)
Data Packet (variable length)
And / Or
Handshake Packet (message acknowledgement)
More How USB Works
Different transfer types use Frames differently:
For High Speed:
Control: 31 64-byte Transactions / microframe
Bulk: 13 512-byte Transactions / microframe
Interrupt: 3 1024-byte Transactions / microframe, with error correction
Isochronous: 3 1024-byte Transactions / microframe,without error correction
USB technology continues to evolve
Basic USBIncludes Low Speed & Full Speed
High Speed USBIncludes Low Speed, Full Speed & Hi-Speed
USB On-The-GoEnables direct Camera to Printers
Certified Wireless USBNew wireless standard (later than planned)
Implementing a USB Product
Many Choices to Make:
Will this be a Host, a Hub or a Peripheral ?
Implementing USB Host
More Choices: General Purpose (full feature set)Or
Specific Purpose (application specific feature set)
Windows based: Use existing Microsoft standardsand PC hardware
Or
Non-Windows based: Use existing open sourcestandards and Linux kernels - customize to application.
Implementing USB Hub
Chipsets from Asian sources are now available
The decision is often:
Make? - copy a reference designOr
Buy? - re-label / re-package existing product
Implementing USB Peripheral
Determinea selected sub-set of USB features for your product.
Listthe USB functions to include and exclude This is an essential step for the project!
Locate chipset and software solutions that come close
Ex: FTDI chipsets (www.ftdichip.com) enable rapid USB Peripheral development on a reasonable schedule and budget
USB Limitations
Consider speed, distance & latency USB is not “peer to peer” (USB On-the-Go is a partial fix) New products must work with legacy hardware Complex Protocol
Software is available from hardware & OS vendors Not free – Pay fees to USB-IF Inc. for
– Access to official USB committees, website and meetings– USB Vendor ID and Product ID
Compliance te$ting required (to use the USB logo)
USB Limitations
Not a good choice for real time controls: Software in the Host controller cannot predict or
control the exact time to make something happen (Synchronous USB attempts to address this)
Peripherals cannot demand service No Host-to-All-Peripherals “Broadcast” capability
...Better choices would be CAN BUS, Field Bus, etc.
Overcoming USB Limitations
However, really interesting USB based products are being created every day.
Using USB-controlled stepper motors, actuators, valves, sensors, displays and digital radio links.
Example: Googling “USB motor control” produces 119 hits
Using Windows™ or embedded Linux for the control software.
Using new FTDI “Vinculum” chipset to simplify the implementation of the USB Host function.
References
USB COMPLETE, Third Edition, Jan Axelson, ©2005 Microchip Technology (www.microchip.com):
Drill down to Design Center > Connectivity > USB for Devices, Application Notes, Development Tools, and free Firmware.
FTDI Inc (www.ftdichip.com)for their Serial-Data-over-USB products and new USB Host chipset (the FTDI U.S. design center is in Hillsboro)
Cypress Semiconductoroffers a broad line of 8-bit processor-based USB interface devices
ARM9-based processors with USB interfacesare available from Cirrus Logic, Atmel, NXP and other vendors.
More References
Microsoft:Drill down to Windows Hardware Developer Central > USB Architecture plus their extensive .NET software products.
The Open Source Initiative (www.opensource.org)
Linux and variantsProviders now support many USB standardsMany are active in Oregon, including:
Linux.comOpen Source Development Labs
Even More References
HIDmaker USBsoftware development tools fromTraceSystems (www.tracesystemsinc.com)
“HID” means “Human Interface Device” - the most simple implementation for USB peripherals.
What We Do
New Product Definition and Development:30 years in the New Product Development business.Have completed successful development projects resulting in more than $1 Billion in revenue.
Circuit Board design, prototype, test, and introduction to manufacturing (locally or Asia)
Problem Solving Project Management
Who We Are
Steve Wetterling, [email protected]
503-860-5594
Pat Barrett, [email protected]
503-245-0325
Email specific to this presentation = [email protected]