+ All Categories
Home > Documents > Compdsp Burk USB Fundamentals

Compdsp Burk USB Fundamentals

Date post: 18-Dec-2015
Category:
Upload: damian-primo
View: 222 times
Download: 4 times
Share this document with a friend
Description:
Compdsp Burk USB Fundamentals
81
1-1 USB Fundamentals and Applications for Digital Signal Processing Greg Burk J. Gordon Electronic Design [email protected] 7/30/2004
Transcript
PowerPoint PresentationGreg Burk
USB 1.0 – The original spec, superseded quickly by USB 1.1
USB 1.1 – Minor enhancements to the USB 1.0 spec, supported Low and Full speed devices
USB 2.0 – The Current Standard, added “high speed’ to USB 1.1
USB OTG – USB On-the-Go, a supplement to the USB 2.0 spec that added a form of device to device communications.
WUSB – Wireless USB, a work in progress -- not a standard yet
lecture 1
Runs 40X faster than USB 1.1
Low speed: 1.5Mb/s
Full speed: 12Mb/s
High speed: 480Mb/s
Forward compatible—plug existing 1.1 devices into new 2.0 hosts
Backward compatible—plug new 2.0 devices into existing 1.1 hosts
Uses the same cables as USB 1.1
lecture 1
Allow peripherals to wake up hosts
Allow two devices to exchange the host role
New OTG devices can tap into the existing 900 million USB devices
lecture 1
“Mini AB” receptacle
Dual-role USB devices:
Must use the new AB connector
Provide limited host capability
lecture 1
Key players are: Intel, Microsoft, HP, NEC, Phillips Semiconductors, Agere Systems, and Samsung Electronics
Based on Ultra-wideband (UWB) standard
Supposed to support USB 2.0 bandwidth (480 Mb/s) at distances of up to 10 meters
Projected Feature Set:
Security at same level as wired USB
Connections up to 127 WUSB device
For More info see: http://www.intel.com/labs/wusb/
(This is NOT the same as Cypress Semiconductors Wireless USB)
lecture 1
USB Basics
USB is a Master/Slave Polled Bus (PC is the “Master”, Devices are the “Slaves”)
USB has a “tiered star” architecture that can USB can support up to 126 devices
7-bit address = 128 – root hub – reserved addr 0 for enumeration
USB is “Hot Pluggable”
USB connections can provide both data and power to the devices
lecture 1
The “rich user experience” requires some inner complexity
Even though it replaces serial and parallel ports, it’s not a drop-in replacement
It’s electrically simple, but a whole protocol layer is added
lecture 1
Device side
Host Controller has integral “Root Hub”
Host Controller Interfaces:
lecture 1
Four wires: Vbus, GND, D+, D–
Cables are 5 meters MAX
Two connector types, “A” and “B”
Prevents illegal topologies
“A” connectors are the ones that goes to the PC or Hub, “B” connectors goes to the device) (OTG adds Miny A and Mini B connectors)
Cables can be either “captive” (like mice) or detachable
Cables can be unshielded (Low speed devices) or shielded (Full Speed and High Speed devices)
USB extension cables are ILLEGAL
lecture 1
Hubs can be:
Self-Powered (<= 500ma to each device)
Bus-Powered (<= 100mA to each device)
Hubs contain most of the “magic” and differences between USB 1.1 and USB 2.0
lecture 1
Batteries
Bus-Powered
High Power Bus Powered >100mA, <=500mA)
Devices are “self describing”
Devices return data (USB descriptors) to host to indicate its capabilities, configurations, and how the device is able to communicate
lecture 1
Compound Device
Collection of separate functions, each with a USB address, connected to an internal hub
Example: Keyboard & Trackball in same package
lecture 1
The Host (PC) initiates all transfers
Devices respond to host requests
Direction: OUT is host-to-device
Direction: IN is device-to-host
lecture 1
High speed is 480 Mb/s
There is a VERY common misconception that say a device is USB 2.0 compliant that it means that it is High Speed device. It does NOT!
lecture 1
A Control Transfer Type endpoint is bi-directional
Others are uni-directional
Four address bits plus a direction bit selects between up to 32 buffers (FIFOs)
Different USB chips support
Various numbers of endpoints
Various buffer sizes
Each device must have 1 Control Type Endpoint (Commonly referred to as Endpoint 0 or the Default Endpoint)
lecture 1
1-*
Pipes
An abstraction used by the USB spec used to indicate that 2 endpoints are joined (one in the PC Host and the other in the device).
CONTROL pipe is bi-directional
Other Speed Configuration Descriptors (USB 2.0)
USB “Classes” can add other class specific Descriptors
lecture 1
USB utilizes differential signaling on the D+ and D- lines.
Data is encoded in “non-return to zero with bit stuffing”
Bit stuffing is used to ensure enough transitions for the clock recovery circuitry.
Most designs use silicon that incorporates an integral Serial Interface Engine (SIE) so you don’t have to worry about the decoding yourself.
PCB layout of D= and D- requires care (especially on High Speed devices).
lecture 1
Token packet tells what’s coming
Data packets deliver bytes
lecture 1
NYET (USB HS)
Handshaking Packets
Used to ensure correct data delivery on Control, Bulk and Interrupt Transfers
ACK – Received with out Error
NAK – Device Busy, has no data
Stall – Unsupported Request, Request Failed
No Response – Request not received or corrupt, will be retried up to 3 times.
lecture 1
Best for “bursty” data
Control
USB Transfers
USB Transfers Occur in 1ms Frames (USB 2.0 adds 125 uS Microframes)
Host sends “SOF” (Start Of Frame) token every 1ms
Host schedules packets inside frames.
lecture 1
Control traffic is “best-effort”
Actual scheduling order depends on host controller
UHCI, OHCI
good
lecture 1
“H” means sent by the host, “D” means sent by the device.
1-*
toggle
lecture 1
good
host sends data anyway
lecture 1
good
O
U
T
A
D
D
R
E
N
D
P
C
R
C
5
good
Interrupt transfers are indistinguishable from BULK transfers. They occur at most once per frame.
lecture 1
H
D
H
H
Class Specific Requests
Specific to a given class, see the class specification for details.
Examples:
The Human Interface Device (HID) Class adds “Get Report and “Set Report” requests
The Hub Class adds a “Get Port Status” request
lecture 1
The hub detects the device.
The host learns of the devices presence from the hub (Get Port Status Request)
The hub detects whether a device is Low speed or Full Speed.
The hub resets the device.
The host learns if a full speed device supports high speed.
The hub establishes a signal path between the device and the bus.
The host sends a Get Descriptor Request to learn the maximum packet size of the default pipe.
The host assigns an address (Set Address Request).
The host learn about a devices abilities (Get Descriptor Request).
The host assigns and loads a device driver.
The host’s device driver selects a configuration (Set Configuration Request).
lecture 1
USB host controllers are PCI devices
What Does it Do?
Handles USB peripheral enumeration
Provides USB services for higher level drivers. All access to USB peripherals is via these services
lecture 1
Pretty much all of them…More and more every day
Windows
MacOS
Linux
Solaris
VxWorks
Only available to OEMs
First Microsoft OS with full USB support
Class drivers for HID and USB speakers
98SE fixed a few minor bugs, enhanced performance, added class drivers for USB modems
lecture 1
Windows Me (Millennium)
Windows 98 was supposed to be the last OS in the Win9x family, but...
Follow on to Windows 98
Adds performance tweaks, bug fixes, USB audio without clicks and pops, USB Mass Storage class driver
lecture 1
3rd party NT 4 USB drivers are available
lecture 1
lecture 1
Based on Windows 2000
Same basic USB support as Windows 2000 with some changes under the hood
Supports USB 2.0 High Speed
lecture 1
Human Interface Devices (HID), USB hubs, speakers, mass storage, modems
Note: Not all USB Classes that are defined by the USB-IF are implemented!!! Check your target OS for support. (i.e. I know of no OS that has implemented the Firmware Update Class)
Custom Drivers
Operating Systems often include vendor specific drivers that have passed certification (e.g. WHQL)
lecture 1
No need to write (or install) a driver!
Used by mice and keyboards, but can be used for custom devices also.
Communicates with devices using reports
Set Report, Get Report
Full Spec at http://www.usb.org
lecture 1
Use a “General Purpose” Device Driver
Write a “Proprietary Custom Device” Driver (or have it written for you by a consultant)
lecture 1
Generic USB Device Drivers (for Windows OS’s)
Check your silicon manufacturer, they may have a general purpose driver you can use with their silicon (Cypress and FTDI both do)
Thesycon USBIO (http://www.thesycon.de)
Jungo (http://www.jungo.com)
lecture 1
Long Learning Curve (i.e. >6months)
Not very well documented
lecture 1
Join the USB-IF or become a non-member Logo Licensee
Attend a “Plug-Fest” or have your device tested for compliance by an independent lab
Windows Hardware Quality Labs (WHQL) Certification
Download the HCT and run the applicable tests (if a self test is permitted for your device) or have your device tested for compliance by an independent lab
lecture 1
lecture 1
Cypress TX2, Phillips, etc.
These are primarily intended for FPGA’s that implement a Serial Interface Engine (SIE)
USB Transciever + SIE
Cypress SX2, Phillips, etc.
This would be a good option for DSP’s without USB support
USB Transciever + SIE + Microprocessor
Cypress EZ-USB, EZ-USB FX, EZ-USB-FX2, Microchip USB PIC, DSP’s that have USB Support
This would also be a good option for DSP’s without USB support
Fixed Function Devices
FTDI USB to Serial Converter Chips (This is a good option for DSP’s)
USB to ATAPI Bridge Chips
lecture 1
USB Transfer Types
Since some applications for Digital Signal Processing are “Stream” operations you might think that “Isochronous” transfers are the most appropriate type to use. Sometimes, but not always…Consider using RAM buffers and a Bulk or Interrupt Transfer Type.
In lower bandwidth applications, consider the FTDI USB to Serial Converter, they are a good shortcut if you can use them.
lecture 1
John Hyde, USB Design By Example, Second Edition
Windows Drivers (including USB)
Chris Cant, Writing Windows WDM Device Drivers
lecture 1
Draft docs
lecture 1
Optical Isolation and USB
lecture 1
1-*
A special thanks to Cypress Semiconductor for allowing use some of the included slides.
lecture 1

Recommended