<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forums.obdev.at/app.php/feed/topic/863" />

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2007-11-02T16:58:51+02:00</updated>

	<author><name><![CDATA[Objective Development Forums]]></name></author>
	<id>https://forums.obdev.at/app.php/feed/topic/863</id>

		<entry>
		<author><name><![CDATA[sprhawk]]></name></author>
		<updated>2007-11-02T16:58:51+02:00</updated>

		<published>2007-11-02T16:58:51+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=863&amp;p=2855#p2855</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=863&amp;p=2855#p2855"/>
		<title type="html"><![CDATA[OK, the bug is fixed, but I don't know why]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=863&amp;p=2855#p2855"><![CDATA[
The bug has been fixed, I used a Mega16 board that is connected as MJoy16, the descriptior  works. I don't know why.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=517">sprhawk</a> — Fri Nov 02, 2007 4:58 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2007-10-28T05:50:14+02:00</updated>

		<published>2007-10-28T05:50:14+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=863&amp;p=2781#p2781</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=863&amp;p=2781#p2781"/>
		<title type="html"><![CDATA[Who can help me with AVR-USB for HID?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=863&amp;p=2781#p2781"><![CDATA[
I'm working with AVR-USB to make a customized Joystick with USB HID device.<br /><br />Following many codes form Internet, I have made a code that can support only 1 (X/y/Z) axis, with the descriptor below:<br /><div class="codebox"><p>Code: </p><pre><code>PROGMEM char usbHidReportDescriptor&#91;26&#93; = &#123; /* USB report descriptor */<br />    0x05, 0x01,  // USAGE_PAGE &#40;Generic Desktop&#41;<br />    0x15, 0x00,  // LOGICAL_MINIMUM &#40;0&#41;<br />    0x09, 0x04,  // USAGE &#40;Joystick&#41;<br />    0xa1, 0x01,  // COLLECTION &#40;Application&#41;<br />    0x09, 0x01,  //   USAGE &#40;Pointer&#41;<br />    0xa1, 0x00,  //   COLLECTION &#40;Physical&#41;<br />    0x95, 0x01, //     REPORT_COUNT &#40;1&#41;<br />    0x75, 0x08, //     REPORT_SIZE &#40;8&#41;<br />    0x15, 0x0, //     LOGICAL_MINIMUM &#40;-128&#41;<br />    0x25, 0x7f, //     LOGICAL_MAXIMUM &#40;127&#41;<br />    0x09, 0x30,  //     USAGE &#40;X&#41;<br />//    0x09, 0x31,  //     USAGE &#40;Y&#41;<br />    0x81, 0x02,   //     INPUT &#40;Data,Var,Abs&#41;<br />    0xc0,  //     END_COLLECTION<br />    0xc0   // END_COLLECTION<br /><br />&#125;;</code></pre></div><br /><br /><br />When I try to add another axis, it fails(when programmed to Mega8, the USB detecting sound in Windows is quick three notes, and an Unkown Device is Identified):<br /><br /><div class="codebox"><p>Code: </p><pre><code>PROGMEM char usbHidReportDescriptor&#91;28&#93; = &#123; /* USB report descriptor */<br />    0x05, 0x01, // USAGE_PAGE &#40;Generic Desktop&#41;<br />    0x09, 0x04,// USAGE &#40;Joystick&#41;<br />    0xa1, 0x01,  // COLLECTION &#40;Application&#41;<br />    0x05, 0x01, // USAGE_PAGE &#40;Generic Desktop&#41;<br />    0x09, 0x01,  //   USAGE &#40;Pointer&#41;<br />    0xa1, 0x00, //   COLLECTION &#40;Physical&#41;<br />    0x15, 0x81, //     LOGICAL_MINIMUM &#40;-128&#41;<br />    0x25, 0x7f, //     LOGICAL_MAXIMUM &#40;127&#41;<br />    0x75, 0x08,  //     REPORT_SIZE &#40;8&#41;<br />    0x95, 0x02,//     REPORT_COUNT &#40;2&#41;<br />    0x09, 0x30, //     USAGE &#40;X&#41;<br />    0x09, 0x31,  //     USAGE &#40;Y&#41;<br />    0x81, 0x02,  //     INPUT &#40;Data,Var,Abs&#41;<br />    0xc0,       //     END_COLLECTION<br />    0xc0   // END_COLLECTION<br /> &#125;;<br /></code></pre></div><br /><br />I think the problem is on the descriptor, but i can't find the error.<br /><br />I have changed the<br />Code:<br /><div class="codebox"><p>Code: </p><pre><code>USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH</code></pre></div><br /><br />accordingly, and the right data buffer.<br /><br />Who can tell me how to fix it?<br /><br />When I changed the descriptor to 2 axes, I found the USB can't send correct data to PC, but why?<br /><br />I found if i extend the X axis to 16bits ,the code can't workly properly too-- I mean it is indentified as Unknown Device.<br /><br /><div class="codebox"><p>Code: </p><pre><code>PROGMEM char usbHidReportDescriptor&#91;29&#93; = &#123;<br />    0x05, 0x01,// USAGE_PAGE &#40;Generic Desktop&#41;<br />   0x15, 0x00,  // LOGICAL_MINIMUM &#40;0&#41;<br />    0x09, 0x04,// USAGE &#40;Joystick&#41;<br />    0xa1, 0x01,// COLLECTION &#40;Application&#41;<br />    0x05, 0x01,  // USAGE_PAGE &#40;Generic Desktop&#41;<br />    0x09, 0x01, //   USAGE &#40;Pointer&#41;<br />    0xa1, 0x00,//   COLLECTION &#40;Physical&#41;<br />    0x15, 0x0,//     LOGICAL_MINIMUM &#40;0&#41;<br />    0x26, 0xff,0x03, //     LOGICAL_MAXIMUM &#40;1023&#41;<br />    0x75, 0x10,  //     REPORT_SIZE &#40;16&#41;<br />   0x95, 0x01, //     REPORT_COUNT &#40;1&#41;<br />    0x09, 0x30,  //     USAGE &#40;X&#41;<br />    0x81, 0x02, //     INPUT &#40;Data,Var,Abs&#41;<br />   0xc0,  //     END_COLLECTION<br />    0xc0  // END_COLLECTION<br />&#125;; </code></pre></div><p>Statistics: Posted by Guest — Sun Oct 28, 2007 5:50 am</p><hr />
]]></content>
	</entry>
	</feed>
