LabView USB
LabView and USB
Has support for USB Measurement Instruments
like Oscilloscopes,etc.,
Can help prototype USB device drivers
Can you help to learn about the USB protocol
Overview of USB
Universal
Serial Bus
Designed
to standardize connection of
peripherals to PC
Almost
replaced Serial Port , Parallel
Port ,PS/2 port,etc.,
USB 2.0 pinout
USB 3.0 pinout
List of USB peripherals
Keyboard
Mouse
Storage
Devices
Printers
Scanners
Webcams
Internet
dongles
etc.,
And
the list is endless
History of USB
Companies behind USB development
Compaq, DEC, IBM, Intel, Microsoft, NEC and
Nortel
Development start year : 1994
Entry of USB hardware into market : May
1996
USB Version History
12/11/16
Release name
Release date
Maximum transfer rate
USB 0.8
December 1994
USB 0.9
April 1995
USB 0.99
August 1995
USB 1.0 Release
Candidate
November 1995
USB 1.0
January 1996
Low Speed (1.5 Mbit/s),
Full Speed (12 Mbit/s)
USB 1.1
August 1998
Low Speed (1.5 Mbit/s),
Full Speed (12 Mbit/s)
USB 2.0
April 2000
High Speed (480 Mbit/s)
USB 3.0
November 2008
SuperSpeed (5 Gbit/s)
USB 3.1
July 2013
SuperSpeed+ (10Gbit/s)
USB roles
USB host
More responsibility in establishing communication
Complex hardware and software
Eg:PC
USB device
Simple,Eg:USB Mouse,USB keyboard,USB Mass Storage
device,etc.,
USB OTG (On The Go)
Can act as device and host. Eg: Recent Android mobile
phones
12/11/16
Types of Transfers
Control transfers
Interrupt transfers
Bulk transfers
USB Mouse ,USB keyboard,etc.,
USB Mass Storage devices , USB
printers,etc.,
Isochronous transfers
All USB based video/audio devices
USB speakers ,USB webcams,etc.,
Identifying a USB Device
Vendor ID (VID) - 16-bit integer
Product ID (PID) - 16-bit integer
Generally written in hexadecimal
Examples for VIDs & PIDs
Sandisk Cruzer Blade
0x0781(VID) and 0x5567(PID)
Sandisk Cruzer Ultra
0x0781(VID) and 0x556B (PID)
Dell USB Entry Level Keyboard
0x413C (VID) and 0x2107(PID)
Dell Multimedia Pro Keyboard
0x413C (VID) and 0x2011(PID)
Endpoints
Communication in USB happens via
Endpoints
Types of Endpoints
Control Endpoints
Interrupt Endpoints
Bulk Endpoints
Isochronous Endpoints
Every device should have a control endpoint
(EP0)
Control Endpoint 0 is bi-directional
A device can have upto 31 Endpoints
All Endpoints except Control Endpoint is
unidirectional
Endpoint Addresses
0x00
(Bidirectional Control Endpoint)
0x01-0x0F (OUT Endpoints)
0x81-0x8F (IN Endpoints)
OUT stands for Data flow from Host to Device
IN stands for Data flow from Device to Host
USB Keyboard LEDs
The LEDs CAPS LOCK ,NUM LOCK ,SCROLL LOCK
can be controlled by means of initiating a CONTROL
Transfer (OUT)
Control transfer consists of
Setup Packet
Data Packet
Setup Packet for controlling LEDs
bmRequest - 0x21
bRequest
0x09
wValue
0x0200
wIndex
- 0x0000
wLength
- 0x0001
Data packet
DATA
SCROLL
LOCK
CAPS
LOCK
NUM LOCK
0x00
0x01
0x02
0x03
0x04
0x05
0x06
0x07
0-OFF
1-ON
Labview can perform the
following USB
transfers.
Control transfers
Interrupt transfers
Bulk transfers
Isochronous transfers are not
supported in LABVIEW
LabView Block diagram- Control
Keyboard LEDs
LabView Front panel- Control
Keyboard LEDs
References
National Instruments-USB Instrument
Control Tutorial
http://www.ni.com/tutorial/4478/en/
USB Implementers Forum
http://www.usb.org/