2

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?

lmat - Reinstate Monica
  • 7,289
  • 6
  • 48
  • 62

2 Answers2

1

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.

Miles Strombach
  • 308
  • 1
  • 11
  • ouch. Excellent comment. Thanks very much. I'll also read the other three answers you've provided on StackExchange. So you're an USB expert? I see in chapter 17.10.6 (page 190) promising things, especially 17.10.6.1. These aren't what I think they are, though, are they? – lmat - Reinstate Monica Feb 11 '11 at 20:50
  • 1
    Section 17.10 is just to give you a little overview of the USB protocol, kind of a little set of tips about the things you'll need to be on the lookout for. If there was some way to set them for the chip to use, it would almost assuredly tell you there or mention where to look elsewhere in the spec sheet. – Miles Strombach Feb 11 '11 at 21:05
  • 1
    Sorry, what do you mean? Is there a part of your question I haven't addressed? – Miles Strombach Feb 14 '11 at 17:10
-2

An updated list of pairs VID:PID can be found here. Microchip has a bunch of pairs listed and you can grab one for "test & leaning" purposes.

If you're intend to buy your own pair, you can check www.usb.org on how to proceed.

trylimits
  • 2,575
  • 1
  • 22
  • 32
  • This is not an actual answer to the question. The question is how to set the VID/PID on the controller. – trylimits Oct 30 '18 at 18:45
  • Helpful information, but doesn't actually answer the question: "How do I set the VID and PID [and send them]?". This would be better as a comment to the original question. Thanks! – lmat - Reinstate Monica Oct 31 '18 at 22:42