CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

P18F4550 Changing USB PID and VID

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Nicce



Joined: 14 Sep 2010
Posts: 5

View user's profile Send private message

P18F4550 Changing USB PID and VID
PostPosted: Tue Sep 14, 2010 3:35 am     Reply with quote

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
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Tue Sep 14, 2010 4:04 am     Reply with quote

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
Nicce



Joined: 14 Sep 2010
Posts: 5

View user's profile Send private message

PostPosted: Tue Sep 14, 2010 4:09 am     Reply with quote

Excellent thanks!
Wayne_



Joined: 10 Oct 2007
Posts: 681

View user's profile Send private message

PostPosted: Tue Sep 14, 2010 4:31 am     Reply with quote

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
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Tue Sep 14, 2010 6:48 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group