PDA

View Full Version : Usb hid



yatyas72
- 18th November 2010, 19:27
Was wondering if anyone had a working example of USB HID using a single axis and buttons? I understand the code side of things it's just all of the set-up in the HID headers, Inc. files etc.

I have a USB CDC example that talks to a VB program to switch on and off LED's so I understand the USB side of things and have a working example. But someone can spend days/weeks (I have) trying to find out what needs to be done in order to get HID/CDC/USB to work.

I am very willing to share my PBP 2.6/USB/VB6 program with everyone. I just don't have a lot of time to pour through tons of documentation and spend days and days troubleshooting. I'm not lazy just a new dad :cool: and don't have near enough free-time. Not complaining just letting you know I'm not trying to find someone else to do it for me. Just get a little boost I'll finish it on my own.

The build I plan to do will need 2 axis and atleast 6 buttons but I figure I can edit from a similar example.

Thanks in advance for your help
Larry

Darrel Taylor
- 19th November 2010, 14:20
Check out this thread ...

USB HID Joystick for Dummies (Squibcakes)
http://www.picbasic.co.uk/forum/showthread.php?t=11950

bedmonson85
- 19th November 2010, 15:20
Check out this thread ...

USB HID Joystick for Dummies (Squibcakes)
http://www.picbasic.co.uk/forum/showthread.php?t=11950

Yes, that thread is really helpful. I also saw a page a few days ago that may be what you're looking for as well. It explains how this guy converted an old analog joystick to USB. It was almost exactly as you described:
# 2-axis joystick
# Throttle
# 4 direction POV hat
# 6 buttons

Here's the link: http://www.helmpcb.com/Electronics/USBJoystick/USBJoystick.aspx

His code is written in mikroC, but he does a really decent job describing the descriptors used and how to modify them.

yatyas72
- 19th November 2010, 17:07
I have frequented this forum for the last year and I can't tell you how helpful it has been. I followed the USB CDC tutorial step by step when I created my board and interface to VB. As soon as I get a little free-time I will post the details of that project here.

Thanks very much for pointing me to those links they are exactly what i am looking for.

One last question....have any good suggestions for a bootloader? I will be using the 18F2550 and 4550 chip as I have a boatload of samples (Thank you Microchip!)

I have considered writing my own.....but as a famous actor once said...."A man's gotta know his limits" and I just don't have the knowledge about writing to program memory. I have dissected the Sparkfun version and have figured everything out to the programming of the memory. I'm a little GRAY in that area. If anyone is willing to help with the writing I'd gladly pitch in. It's actually very simple just need to understand the bits that confuse me.

Would be a great group project I think...hint...hint :D

Thanks,
Larry

Squibcakes
- 3rd December 2010, 03:02
It's actually very simple just need to understand the bits that confuse me.


:D Don't we all !! Hehehe that's made my day. :D

ardhuru
- 3rd December 2010, 15:45
About the bootloader; have you tried Microchip's HIDBootloader? I've found it to be fairly easy to use. Thats if you meant a USB bootloader.

Otherwise, I have been happy with the one thats part of Microcode Studio.

The Tiny bootloader is nice as well.

The above 2 are serial port based.

Regards,

Anand