labview -usb

21
LabView - USB

Upload: jabez-winston

Post on 13-Feb-2017

111 views

Category:

Devices & Hardware


0 download

TRANSCRIPT

Page 1: Labview -USB

LabView - USB

Page 2: 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

Page 3: Labview -USB

Overview of USB Universal Serial Bus

Designed to standardize connection of peripherals to PC

Almost replaced Serial Port , Parallel Port ,PS/2 port,etc.,

Page 4: Labview -USB

USB 2.0 pinout

Page 5: Labview -USB

USB 3.0 pinout

Page 6: Labview -USB

List of USB peripheralsKeyboardMouseStorage DevicesPrintersScannersWebcamsInternet donglesetc.,

And the list is endless

Page 7: Labview -USB

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

Page 8: Labview -USB

05/01/2023

USB Version HistoryRelease 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+ (10 Gbit/s)

Page 9: Labview -USB

05/01/2023

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

Page 10: Labview -USB

Types of Transfers Control transfers Interrupt transfers

USB Mouse ,USB keyboard,etc., Bulk transfers

USB Mass Storage devices , USB printers,etc.,

Isochronous transfers All USB based video/audio devices USB speakers ,USB webcams,etc.,

Page 11: Labview -USB

Identifying a USB Device

Vendor ID (VID) - 16-bit integer

Product ID (PID) - 16-bit integer

Generally written in hexadecimal

Page 12: Labview -USB

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)

Page 13: Labview -USB

Endpoints

Communication in USB happens via Endpoints

Types of Endpoints Control Endpoints Interrupt Endpoints Bulk Endpoints Isochronous Endpoints

Page 14: Labview -USB

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

Page 15: Labview -USB

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

Page 16: Labview -USB

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

Page 17: Labview -USB

Data packet

DATA SCROLL LOCK

CAPS LOCK

NUM LOCK

0x00 0 0 00x01 0 0 10x02 0 1 00x03 0 1 10x04 1 0 00x05 1 0 10x06 1 1 00x07 1 1 1

0-OFF1-ON

Page 18: Labview -USB

Labview can perform the following USB transfers…. Control transfers

Interrupt transfers Bulk transfers

Isochronous transfers are not supported in LABVIEW

Page 19: Labview -USB

LabView Block diagram- Control Keyboard LEDs

Page 20: Labview -USB

LabView Front panel- Control Keyboard LEDs

Page 21: Labview -USB

References

National Instruments-USB Instrument Control Tutorial http://www.ni.com/tutorial/4478/en/

USB Implementers Forum http://www.usb.org/