Showing posts with label USB. Show all posts
Showing posts with label USB. Show all posts

01 July 2010

How To Find USB Device Vendor and Product ID Codes

Creating an interface for the Missile Launcher USB device (manufactured by Dream Cheeky, available at ThinkGeek.com $25 USD) is a great way to entice programming students to develop their UI skills.  (I will post links to the .NET 4.0 device command API, when I get it working.)  Because similar devices have been made by several manufacturers, since about 2004 to present, most of the USB human interface device (HID) interface code available on the Web was targeted at older models from other vendors.

When interfacing with a USB HID, you must first locate the device -- the HID could be plugged into any USB port, or could have been moved to another port during use.  We locate the correct HID by iterating through attached USB devices, until we find one that matches the Vendor ID (VID) and Product ID (PID) in which we are interested.

How do I find the USB HID Vendor ID and Product ID?
  1. Open the Windows Device Manager
  2. Expand the Human Interface Devices node
  3. Double-click the device of interest -- the USB Human Interface Device Properties window appears
  4. Click the Details tab
  5. In the Property drop-down box, select Hardware Ids
The USB HID VID and PID are displayed.  My Cheeky USB Missile Launcher displays:
USB\VID_0A81&PID_0701&REV_0001
USB\VID_0A81&PID_0701

The hexadecimal Vendor ID is highlighted in red, Product ID in green, and product revision number in blue.  Other details obtained through a USB monitoring application:

DEVICE DESCRIPTOR
  • USB Version 1.10
  • Device class; 0x0 (defined at interface level)
  • Device subclass: 0x0 (Unknown)
  • Device protocol: 0x0 (Unknown)
  • Control pipe max size: 8 bytes
  • Vendor ID: 0xA81 (Chesen Electronics Corp.)
  • Product ID: 0x701 (USB Missile Launcher)
  • Product version: 0.1
  • Manufacturer: Dream Link
  • Product: USB Missile Launcher v1.0
  • Serial number: not specified
  • Configurations: 1
CONFIGURATION DESCRIPTOR
  • Number of interfaces: 1
  • Configuration value: 0x1
  • Attributes: Remote wakeup, Bus powered
  • Max power: 100 mA
INTERFACE DESCRIPTORL0, ALTERNATE SETTING: 0
  • Number of endpoints: 1
  • Interface class: 0x3 (Human Interface Device)
  • Interface subclass: 0x0 (None)
  • Interface protocol: 0x0 (None)
  • Endpont address 0x1, Input, Interrupt, max packet size: 1 bytes, update interval: 16 1-millisecond frames