View previous topic :: View next topic |
Author |
Message |
Nicce
Joined: 14 Sep 2010 Posts: 5
|
P18F4550 Changing USB PID and VID |
Posted: Tue Sep 14, 2010 3:35 am |
|
|
Hi Guys,
Simple question. Where are the PID and VID defined? I need to change them to a custom PID and VID that our project is using.
Regards,
Nicce |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19369
|
|
Posted: Tue Sep 14, 2010 4:04 am |
|
|
In the descriptor file.
In the early USB drivers, they were just 'hard coded' in the descriptor structure, but on the later compilers, there are defines early on the descriptor file, that set these. If (for example), you are using the CDC descriptor, then immediately after the remarks, there is a test for the define __USB_DESCRIPTORS__, and then the PID, VID, BUS_POWER options, and version number are loaded.
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
Nicce
Joined: 14 Sep 2010 Posts: 5
|
|
Posted: Tue Sep 14, 2010 4:09 am |
|
|
Excellent thanks! |
|
![](templates/subSilver/images/spacer.gif) |
Wayne_
Joined: 10 Oct 2007 Posts: 681
|
|
Posted: Tue Sep 14, 2010 4:31 am |
|
|
Just a word of warning, If you are using the files in the drivers folder I would sugest you make a copy of them in a local folder for your project. if you upgrade the compiler there is a chance you will overwrite the drivers and examples with new versions losing all your changes ![Smile](images/smiles/icon_smile.gif) |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19369
|
|
Posted: Tue Sep 14, 2010 6:48 am |
|
|
Yes.
In fact I think the files are written, so if you setup all the descriptors yourself, and define 'USB_DESCRIPTORS', then the CCS defines won't load. This way, you can put all the descriptors in your own file, then include the CCS stuff, and your values override the ones in the CCS files. Downside, is that you have to fill out the entire descriptor entry, not just the VID/PID.
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
|