usbdriverpidpic18

PIC18F4550 customize USB VID and PID


I'm new to PIC programming, and I'm ready to make a USB program so that I can send it motor control commands from my program on a (Windows XP) PC.

How do I set the VID and PID for PIC18F4550? I read over the datasheet, but it doesn't seem to say anything useful. Does the datasheet use different words to discuss these parameters? I saw a DEVID (p 294); how does this relate?


Solution

  • Reading the data sheet, I get the impression that those things are not set in hardware, in fact, the chip has no concept of them at all. The PIC understands USB in the sense that it will handle things like even/odd PIDs and CRCs, it doesn't handle USB on the transaction level. You are responsible for all of the data that goes across the wire; you must be able to understand the requests the host is making and respond appropriately. If it requests a device descriptor, you must generate the series of bits that is your device descriptor (not to be confused with "buffer descriptors" mentioned in the datasheet, which are a concept internal to the chip) and put it in the appropriate buffer for the chip to send.

    You'll want to read up on the USB protocol. I found this to be a good starting place.

    The DEVID listed in the spec sheet is to indicate to software which model PIC it is being run on.