<?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/3256" />

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2009-09-14T13:20:53+02:00</updated>

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

		<entry>
		<author><name><![CDATA[teschi]]></name></author>
		<updated>2009-09-14T13:19:20+02:00</updated>

		<published>2009-09-14T13:19:20+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3256&amp;p=10945#p10945</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3256&amp;p=10945#p10945"/>
		<title type="html"><![CDATA[[Solved] HID doesn't work if reportbuffer exceeds 8 bytes]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3256&amp;p=10945#p10945"><![CDATA[
Thanks very much!<br /><br />Sorry for the RTFM-Question (probably I shouldn't write code that late).<br />And thanks for the hint about the Report_IDs, that's exactly what I need.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=2807">teschi</a> — Mon Sep 14, 2009 1:19 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Grendel]]></name></author>
		<updated>2009-09-14T02:51:05+02:00</updated>

		<published>2009-09-14T02:51:05+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3256&amp;p=10939#p10939</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3256&amp;p=10939#p10939"/>
		<title type="html"><![CDATA[Re: HID doesn't work if reportbuffer exceeds 8 bytes]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3256&amp;p=10939#p10939"><![CDATA[
Welp, from usbdrv.h:<br /><br /><div class="codebox"><p>Code: </p><pre><code>USB_PUBLIC void usbSetInterrupt(uchar *data, uchar len);<br />/* This function sets the message which will be sent during the next interrupt<br /> * IN transfer. The message is copied to an internal buffer and must not exceed<br /> * a length of 8 bytes. The message may be 0 bytes long just to indicate the<br /> * interrupt status to the host.<br /> * If you need to transfer more bytes, use a control read after the interrupt.<br /> */</code></pre></div><br />Or define multiple reports in the report descriptor (ie. collect the buttons in one report, the axis in a 2nd) and send them alternating. You will lose one byte per report for the report id tho.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=101">Grendel</a> — Mon Sep 14, 2009 2:51 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[teschi]]></name></author>
		<updated>2009-09-14T13:20:53+02:00 </updated>

		<published>2009-09-13T22:49:52+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3256&amp;p=10934#p10934</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3256&amp;p=10934#p10934"/>
		<title type="html"><![CDATA[[Solved] HID doesn't work if reportbuffer exceeds 8 bytes]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3256&amp;p=10934#p10934"><![CDATA[
Hi there,<br /><br />I currently have problems with my attempt to build a custom game controller.<br />I'm using an Atmega16 at 12MHz and vusb-20090822.<br />I started with the hid-mouse example, changed the descriptors to be a gamepad, and everything worked fine as long as the descriptor defined a report buffer of 8 bytes.<br /><br /><br />But when I add another axis (or another 8 buttons) and therefore define a report buffer of 9 bytes no data is transferred anymore.<br />The device is recognized fine by windows, but windows doesnt react on any controller movements.<br /><br />I ran SnoopyPro on both report-buffer-lengths.<br />- the 8-byte version shows a series of interrupt-transfers<br />- the 9-byte version shows mainly empty interrupt-transfers and a lot of ABORT_PIPEs and RESET_PIPEs<br /><br />Does someone know if this is a given limit of the V-USB, a given limit of my configuration (atmega16+12MHz) or if i just did something wrong.<br /><br />Thanks a lot for any hints<br />   Teschi<br /><br />------------------------<br /><br />hmmm... can't add attachments here, but it's very easy to reproduce using the hid-mouse example, by:<br />- changing the VID/PID so it doesn't reflect a mouse<br />- defining the reportBuffer to be an uchar[8]<br />- defining a HID-Descriptor for  7 axis an 8 buttons<br /><div class="codebox"><p>Code: </p><pre><code>PROGMEM char usbHidReportDescriptor&#91;53&#93;  = {<br />    0x05, 0x01,                    // USAGE_PAGE (Generic Desktop)<br />    0x09, 0x04,                    // USAGE (Joystick)<br />    0xa1, 0x01,                    // COLLECTION (Application)<br />    0x09, 0x01,                    //   USAGE (Pointer)<br />    0xa1, 0x00,                    //   COLLECTION (Physical)<br />    0x09, 0x30,                    //    X<br />    0x09, 0x31,                    //    Y<br />    0x09, 0x32,                  //    Z<br />    0x09, 0x33,                  //    Rx<br />    0x09, 0x34,                  //    Ry<br />    0x09, 0x35,                  //    Rz<br />    0x09, 0x36,                  //    Slider<br />    0x15, 0x00,                    //   LOGICAL_MINIMUM (0)<br />    0x26, 0xff, 0x00,              //   LOGICAL_MAXIMUM (255)<br />    0x75, 0x08,                    //   REPORT_SIZE (8)<br />    0x95, 0x07,                    //   REPORT_COUNT (7)<br />    0x81, 0x02,                    //   INPUT (Data,Var,Abs)<br />    0xc0,                          // END_COLLECTION<br />    0x05, 0x09,                    // USAGE_PAGE (Button)<br />    0x19, 0x01,                    //   USAGE_MINIMUM (Button 1)<br />    0x29, 0x08,                    //   USAGE_MAXIMUM (Button 8)<br />    0x15, 0x00,                    //   LOGICAL_MINIMUM (0)<br />    0x25, 0x01,                    //   LOGICAL_MAXIMUM (1)<br />    0x75, 0x01,                    // REPORT_SIZE (1)<br />    0x95, 0x08,                    // REPORT_COUNT (8)<br />    0x81, 0x42,                    // INPUT (Data,Var,Abs, null state)<br />    0xc0                           // END_COLLECTION<br />};<br /></code></pre></div><br /><br />and changing advanceCircleByFixedAngle to change the array, e.g. (reportBuffer[0] = 0x80 + (d*16);)<br /><br /><strong class="text-strong">This works fine.</strong><br /><br />But if you change the HID-Descriptor to define 16-buttons instead of 8, and increasing the reportBuffer to 9 bytes:<br /><br /><strong class="text-strong">interrupt transfer fails.</strong><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=2807">teschi</a> — Sun Sep 13, 2009 10:49 pm</p><hr />
]]></content>
	</entry>
	</feed>
