View previous topic :: View next topic |
Author |
Message |
nando88
Joined: 25 Aug 2013 Posts: 28
|
USB HID PIC18F4550 |
Posted: Tue Nov 11, 2014 2:37 pm |
|
|
I want to use ccs to make an HID circuit, in which I can turn on/off a led by sending 1 or 0. I already have this circuit working, but through serial port, now I want to make it HID, and I want it to work under windows and linux.
Please let me know if this is possible and please give me some code, because I'm a beginner and I don't know where to start.
Thanks!
I want to know if It's possible to code an application in ccs, that uses the com port, and sends a 1 to turn on a led and a 0 to turn it off, and that it also works on linux?
Please give me some code.
Thanks! |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Tue Nov 11, 2014 2:45 pm |
|
|
Try using the 'search' feature of this forum !!
You will find code others have created both in this forum and the 'code library'.
As well, CCS does supply several USB examples, located in the 'examples' folder.
note: Hopefully you know the difference between a binary '0' and an ASCII '0'.
hth
jay |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Wed Nov 12, 2014 2:19 am |
|
|
Seriously just use the serial port code.
This works well under Linux, and Windows, so why try to go HID if you don't have to?. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Nov 12, 2014 1:09 pm |
|
|
nando88,
You have a huge thread in the forum archives which is all about turning
an LED on/off with USB. Here it is (this is a 4-page thread):
http://www.ccsinfo.com/forum/viewtopic.php?t=52722
That's about CDC.
I see you want HID. This post has a walkthrough of CCS's ex_usb_hid.c
demo program:
http://www.ccsinfo.com/forum/viewtopic.php?t=38897
The hiddemo.exe program (and other files required for it) used to be
freely downloadable on the CCS website. I don't know why they took it
off. But you can find it with a web search. |
|
|
ezflyr
Joined: 25 Oct 2010 Posts: 1019 Location: Tewksbury, MA
|
|
Posted: Wed Nov 12, 2014 5:48 pm |
|
|
Hi,
If you are familiar with Visual Basic, I have a demo program I wrote to exercise the HID USB interface. You could use it as a starting point for the PC side of things.
I'm traveling now, however, and won't be back in the office until Monday.
John |
|
|
|