PDA

View Full Version : USB descriptor



bill9399
2nd January 2011, 17:35
For those working with USB, and seek to know how to work with USB HID descriptors, you could do worse than check out this web site.

http://helmpcb.com/?p=93

The site gives a full description of how to write/modify source for USB HID descriptor files, with links to other software, such as DT.EXE, which is/are extremely useful for working with HID descriptor files.

As an added bonus, there is a more-or-less complete project given for converting old-style analog joysticks to USB joysticks, using a pic(r) 18F2550. Full pic development code is given for the project, but, unfortunately the source code is for MikroC, not basic. The downloadable archived project file for same also contains a compiled HEX file for direct loading to a pic. Schematics are included. as well as a veroboard layout for DIY.

W4GNS
2nd January 2011, 19:40
Thanks for the link, Bill

bill9399
2nd January 2011, 21:12
You're welcome Gary.

For the more technically minded, there is a more in-depth description of USB HID descriptor requirements here,

http://www.usb.org/developers/hidpage#HID_Usage

There is a wealth of information regarding USB usage on this site.


For those looking for information on joystick descriptor, including force feedback, have a look here in the following section, link located about half way down the page.
Usage Tables for Physical Interface Devices ( Amongst a plethora of other things, this includes joysticks)
There you will find a breakdown of the individual requirements for a PID HID descriptor file construction.

Direct link to complete USB HID descriptor for this joystick is shown below. Descriptor can be found in this document. (Requires cut-and-paste) Look about half way down the document.
http://www.usb.org/developers/devclass_docs/pid1_01.pdf


Regards

Kapitan
3rd January 2011, 10:09
For those working with USB, and seek to know how to work with USB HID descriptors, you could do worse than check out this web site.

http://helmpcb.com/?p=93

The site gives a full description of how to write/modify source for USB HID descriptor files, with links to other software, such as DT.EXE, which is/are extremely useful for working with HID descriptor files.

As an added bonus, there is a more-or-less complete project given for converting old-style analog joysticks to USB joysticks, using a pic(r) 18F2550. Full pic development code is given for the project, but, unfortunately the source code is for MikroC, not basic. The downloadable archived project file for same also contains a compiled HEX file for direct loading to a pic. Schematics are included. as well as a veroboard layout for DIY.

Thanks Bill,
I had already linked to that page, but prior to the new sub forums, so great to have it linked here too.
That's how I hope these new forums will work, giving a central place for great links and ideas etc.

This is also a very useful link for HID http://www.usb.org/developers/devclass_docs/Hut1_12.pdf

Kapitan
3rd January 2011, 11:02
http://frank.circleofcurrent.com/cache/hid_tutorial_1.htm

this is also a great info site.

Unfortunately, there is no 'complete' guide., but the info is out there, albeit in parts...
One needs to mod the standard MOUSDESC.INI to start with, then add the report descriptor, Modding the mousdesc is covered in the main usb forums here. the use of the DT tool is superb. save the generated report as text, then edit it for compliance with PDS, (Convert all values generated to RETLW - ) note, this is only the report part, the main hid descriptor remains the same apart from removing the boot - mouse - parts, setting your END POINTS and sizes, vendor ID, etc etc. to work with PDS in HID, the mousdesc is the way to go... after changing the items above to suit your needs.
The examples on Helm , and the link above, are direct ports from the Hut1_12 pdf, with mods, and certainly a great place to start.
Les has done a super job already on a standard HID descriptor for mouse, it only needs changing in a few parts to allow ANY HID device to work with the appropriate report. and this is the only way to really go with PDS, and no reason why not to.
SOME hid devices will be recognised by the system, in fact, ALL that comply will be 'recognised', however, only a few will have standard features, like mouse, keyboard, gamepad etc, allowing no drivers at all. others will need the appropriate links to your app via the API, even though they are recognised.



Again, thanks for putting the info here.

bill9399
4th January 2011, 11:08
Site listed below provides tools and information on creating or modifying INI files for various OS platforms, including Windows/Linux .

http://www.codeproject.com/KB/files/SimpleIni.aspx



A cross-platform library that provides a simple API to read and write INI-style configuration files. It supports data files in ASCII, MBCS and Unicode. It is designed explicitly to be portable to any platform and has been tested on Windows and Linux. It has been released as open-source and free using the MIT licence.

A working knowlege of how to search the WWW, using Google, or other search engine of choice, with appropriate keywords, opens the door to a great deal of similar information. Probably the greatest problem with same is deciding what, among the mass of information available, is relevant to your personal requirements.

Kapitan
4th January 2011, 12:21
Hello Bill, that looks very interesting.
A question though if I may ?
I am unsure though, how this fits in with the USB et al ? .
Is it not the case that if one wanted an 'ini' for a device config, then the 'ini' would need to be created along the format described in the DDK etc ? .
I dont know, as this is not an area I have explored in depth.
It 'seems' to be an API for actually reading / writing 'ini' files. for use in an app that you have created.
How would that actually assist, in, say, writing an 'ini' for a device driver, or for any aspect of USB , unless one has written the device driver oneself ? - which is a daunting task to say the least.

Joe

bill9399
4th January 2011, 12:42
Hello Bill, that looks very interesting.
A question though if I may ?
I am unsure though, how this fits in with the USB et al ? .
Is it not the case that if one wanted an 'ini' for a device config, then the 'ini' would need to be created along the format described in the DDK etc ? .
I dont know, as this is not an area I have explored in depth.
It 'seems' to be an API for actually reading / writing 'ini' files. for use in an app that you have created.
How would that actually assist, in, say, writing an 'ini' for a device driver, or for any aspect of USB , unless one has written the device driver oneself ? - which is a daunting task to say the least.

Joe

I only introduced this since your own previous post in this thread made mention of some devices requiring an INI file for installation, and since this may also be a requirement for some 'non-standard' USB devices.
Do Proton programs not qualify as applications?
Probably best that you download and test the software yourself. It may or may not meet with your personal requirements. Case of Suck-and-See.

On another note, a good source of information for USB (amongst other things) with problems and solutions from users there, is from the Microchip(tm) forum.

http://www.microchip.com/forums/Default.aspx?

A lot of the sections on that forum mirror a number of the new sections here. Bear in mind that that forum is dedicated to Microchip(tm) in general, while this forum is intended to be specific to Proton+ and PDS, so expect a fair amount of 'C' or assembler code amongst any answers there.

Kapitan
4th January 2011, 12:52
Thanks Bill,
I have dl'd it, and it looks great, but not for INI file for devices unless one writes there own, but, that was a brief scan. Will look more into it later,
When I suggested these new forums for perhipherals it was exactly what you describe that I had in mind. ie - specific to PDS etc.
It's all good stuff !. we can all learn loads from other forums, it is often in converting code from one format to another that people struggle with.
Lets hope it all helps PDS users in general,

Thanks again
Joe.

edit, sorry missed this...
Do Proton programs not qualify as applications?

yes, they certainly can, but I think the link refers to HOST based apps, - an app on the host that would communicate with the PIC in a specific way, but good point. !

bill9399
5th January 2011, 12:05
Microsoft Tool for viewing decriptor files of USB devices attached to a PC, Windows version

ftp://ftp.efo.ru/pub/ftdichip/Utilities/UVCView.x86.exe

Can also be downloaded from Microsoft website as a freebie.

More information here

http://msdn.microsoft.com/en-us/library/ff554257%28v=vs.85%29.aspx

bill9399
5th January 2011, 13:22
Similar to the USBCview program. USBview.exe. Download link at
http://www.ftdichip.com/Support/Utilities.htm (about half way down page)

Works with Windows 7 also.

Kapitan
5th January 2011, 13:27
Nice find Bill.
It is rather neat, but limited in the respect of, unfortunately it doesn't show report_descriptor, which is the devil of the detail, but it is very good for the most basic basic descriptor. (without the report descriptor).

http://www.4shared.com/get/KzNO1XZC/EasyHID.html;jsessionid=FC30CE993A8B0A017F173541AD E4CF7C.dc285
Easyhid will produce the basic descriptor, that will be shown in the program you listed. and supports PDS. or, one could modify the one Les uses. (HID). It still needs the report descriptor adding of course. as that is individual to your use. EasyHid also produces VB code at a basic level to add sopported hid class devices in your own apps.


Many thanks. Very useful.
Joe.

bill9399
5th January 2011, 14:49
Nice find Bill.
It is rather neat, but limited in the respect of, unfortunately it doesn't show report_descriptor, which is the devil of the detail, but it is very good for the most basic basic descriptor. (without the report descriptor).

http://www.4shared.com/get/KzNO1XZC/EasyHID.html;jsessionid=FC30CE993A8B0A017F173541AD E4CF7C.dc285
Easyhid will produce the basic descriptor, that will be shown in the program you listed. and supports PDS. or, one could modify the one Les uses. (HID). It still needs the report descriptor adding of course. as that is individual to your use. EasyHid also produces VB code at a basic level to add sopported hid class devices in your own apps.


Many thanks. Very useful.
Joe.

EasyHID has been discussed on numerous occasions on the forum, over the past couple of years, but users should be made aware that there is no longer support for same. EasyHID apparently also has its own shortcomings in certain areas..
The following is a quote from a post, from as far back as June 2009, by one of the most respected members of this forum.



Easy hid has been abandoned as product. It was original written as tool to sell usb vids but since USB.ORG sent out some nasty letters all vid sales have been stopped so there is no need to provide support for easyhid.

There is actually an issue if you run easyhid delphi code Vista machines.


That said, despite its limitations, it can still be a useful development tool.

bill9399
5th January 2011, 15:31
Of course, if money is no object, you could also try HIDmakerFS.

http://www.tracesystemsinc.com/usb_tools.ivnu

Inexpensive at ~US 599$ (:eek:) .

Supposedly does all that EasyHID doesn't.

Note. Googling "USB HID" produces 3000000 web sites. The truth is out there.
Seek and ye shall find.