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

USB and PIC16F1459

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



Joined: 21 Mar 2014
Posts: 12

View user's profile Send private message

USB and PIC16F1459
PostPosted: Wed May 10, 2023 12:48 pm     Reply with quote

All,
Hey I do USB a lot with PIC32MX/MZ processors and have my own VID.

I built a new board using the PIC16F1459 to do some basic stuff like setup and options for that board. I don't think I will need a bootloader for this as it's really basic.

Anyway I am looking at the HID examples and it seems pretty hard coded to the CCS example board which I have.

So are the basic steps to making an acceptable application like this:
1) rename ex_usb_hid into my own file in my working folder.
2) grab all the include files, rename them into that folder.
3) modify the VID, PID, Strings and so forth.
4) modify the new ex_usb_hid and work out the details for my hardware.

Missing anything?

Thanks,
Gordon
_________________
J. Gordon Rankin
Wavelength Audio, ltd.
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Thu May 11, 2023 1:26 am     Reply with quote

I wouldn't rename things. Just copy them into the local directory. If you
are using the IDE, and make an editing change to any of these files, and
then save this, the IDE will offer to save this locally to the project. Let it
do this, or do the same manually.
Then just make sure where your #include the files in your project, use
"usb_desc_hid.h"
rather than
<usb_desc_hid.h>

The former prioritises searching in the local directory first.

On ex_usb_hid.c, just take the core parts of this, put this into your new
file for your project. Add one thing. At the top of this new file, before
loading ex_usb_common.h, add:

#define USB_HW_CCS_16F1459

Now the other things is working out how you are going to generate the clock?. The above define assumes you are using the 8MHz internal
oscillator, with the active clock tuning to generate the USB clock.
If instead you have a crystal, then you need to modify the clock setup
in ex_usb_common.h
wavelength



Joined: 21 Mar 2014
Posts: 12

View user's profile Send private message

PostPosted: Thu May 11, 2023 9:21 am     Reply with quote

Thanks!

Gordon
_________________
J. Gordon Rankin
Wavelength Audio, ltd.
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