| Author |
Message |
yawijaya
Joined: 18 Aug 2009 Posts: 29 Location: New Freedom, PA-USA
|
20 Oct 2009 22:18 USB HID host application |
|
|
|
|
Hi there,
I'm working on a USB HID project, using the demo board of pic18f4550. I managed to get the firmware to work. Now i'm about to create a windows application-GUI to communicate with the board....I am using borland C++ builder to do it. Does anybody has the example code that i can refer to?I read from several sources that I have to utilizes Windows API in order to communicate to the board, but i don't understand how to do it in BCB. I already have an example software, but it is not for HID compliant device, so it still puzzles me.... Any help please??Thanks in Advance
|
|
| Back to top |
|
 |
Kabanga
Joined: 04 Oct 2007 Posts: 69 Helped: 5
|
21 Oct 2009 13:49 Re: USB HID host application |
|
|
|
|
Hi
I assume you have installed the Microchip USB Framework.
You'll find many HID examples here: C:\Microchip Solutions\USB Device - HID - Custom Demos\Generic HID - PnP Demo - PC Software
Regards
Kabanga
|
|
| Back to top |
|
 |
Google AdSense

|
21 Oct 2009 13:49 Ads |
|
|
|
|
|
|
| Back to top |
|
 |
yawijaya
Joined: 18 Aug 2009 Posts: 29 Location: New Freedom, PA-USA
|
21 Oct 2009 14:22 Re: USB HID host application |
|
|
|
|
| yeah i do have it, but they can't really be recompiled using borland so I cannot tweak the code to see which line of code is doing which command...Anybody has an advice on how to create a USB HID host sotware?a link on the web may be?
|
|
| Back to top |
|
 |
FvM
Joined: 22 Jan 2008 Posts: 5161 Helped: 767 Location: Bochum, Germany
|
21 Oct 2009 16:26 USB HID host application - Borland C++ |
|
|
|
|
Check Generic HID - Simple Demo - PC Software. It's pretty easy, all accesses are through generic Windows API functions: Identify the device name from the registry, open the device, read and write to it.
You may want to install the free Microsoft Visual C++ Standard Version, if you want to watch it in operation.
|
|
| Back to top |
|
 |
yawijaya
Joined: 18 Aug 2009 Posts: 29 Location: New Freedom, PA-USA
|
23 Oct 2009 19:12 Re: USB HID host application - Borland C++ |
|
|
|
|
| Thanks for all the advice. I managed to get several sample code from several websites. My biggest problem now is that my code would go error whenever I compile and run it. It happened after i inserted the code that calls the function from setupapi.h and hidsdi.h. I am on the stage of detecting whether a device is connected or not. I even try to just run the sample code I found online, but it is still error. When I press the run button, a debug window will pop up. And when I press run again this message appears--->Project C:\[...........] faulted with message : 'Access violation at 0x0000871f: read of address 0x0000871f'. Process stopped. Use step or run to continue. It happens on EVERY single project I tried to compile and run. I thought my compiler (Borland C++ 6) is probably too old, but the code that was designed for Borland C++ 6 never worked too!I am really desperate now, any advice?any clu why the error happened?some mistake in the compiler setting may be?
|
|
| Back to top |
|
 |
tomeko
Joined: 01 May 2008 Posts: 17
|
24 Oct 2009 10:16 USB HID host application - Borland C++ |
|
|
|
|
Learn how to use debugger, you won't go far without it. Call stack will guide you to error location.
For hid related headers and libraries you need to download DDK from MS page. It's free but huge download. Personally I would use MinGW as it comes with part of DDK, wrap required functions in single dll and import this dll to BCB.
There are also some components available, see topic http://www.edaboard.com/ftopic44089.html.
|
|
| Back to top |
|
 |