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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2011-09-20T09:52:59+02:00</updated>

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

		<entry>
		<author><name><![CDATA[Daid]]></name></author>
		<updated>2011-09-20T09:52:59+02:00</updated>

		<published>2011-09-20T09:52:59+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5971&amp;p=19658#p19658</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5971&amp;p=19658#p19658"/>
		<title type="html"><![CDATA[Re: [solved] Problems at some modulo 8 byte boundary]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5971&amp;p=19658#p19658"><![CDATA[
Small note, you're better off not using the Arduino libraries if you want to be in control of your AVR.<br /><br />The avr-libc library provides quite a few functions to help you on your way. And using hardware registers is a lot faster then using the Arduino libraries. (avr-libc is included and used by the arduino libraries, so you can just use it from your arduino environment)<br /><br />_delay_ms: <!-- m --><a class="postlink" href="http://www.nongnu.org/avr-libc/user-manual/group__util__delay.html">http://www.nongnu.org/avr-libc/user-man ... delay.html</a><!-- m --><br />Delays a number of milliseconds by busy waiting. Main issue is that you need to give it a static number of milliseconds to wait. So if you want to wait a variable number of milliseconds you need to put it in a loop.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=5154">Daid</a> — Tue Sep 20, 2011 9:52 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[gamut]]></name></author>
		<updated>2011-09-19T23:53:05+02:00</updated>

		<published>2011-09-19T23:53:05+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5971&amp;p=19657#p19657</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5971&amp;p=19657#p19657"/>
		<title type="html"><![CDATA[Hardware problem? Timer!]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5971&amp;p=19657#p19657"><![CDATA[
You were right about the 3v9 zeners are not the problem. I replaced the cut open cable with a B plug and a high speed certified cable, but still no luck. Even tried voltage dividing as seen on <a href="http://forums.obdev.at/viewtopic.php?f=8&amp;t=1352&amp;start=45" class="postlink">http://forums.obdev.at/viewtopic.php?f=8&amp;t=1352&amp;start=45</a>.<br /><br />It turned out not to be a hardware problem at all. Went back to Arduino's serial console and glanced at my code. I spotted that I did not reset the watch dog timer. That did not turn out to be the problem, but it paved the way to investigate timers. Project <a href="http://www.obdev.at/products/vusb/hidkeys.html" class="postlink">http://www.obdev.at/products/vusb/hidkeys.html</a> sets TCCR0 to 5. Not yet knowing what it does, I just inserted it into my code, but the compiler hit me on the head. Googling led me to <a href="http://arduino.cc/forum/index.php/topic,3356.0.html" class="postlink">http://arduino.cc/forum/index.php/topic,3356.0.html</a> and the quote <blockquote class="uncited"><div>Timer0 is used for the Arduino millis and delay functions defined in wiring.c. Try timer1 or timer2. </div></blockquote> More googling lead me to <a href="http://code.google.com/p/vusb-for-arduino/source/browse/libraries/UsbKeyboard/examples/UsbKeyboardDemo1/UsbKeyboardDemo1.pde" class="postlink">http://code.google.com/p/vusb-for-arduino/source/browse/libraries/UsbKeyboard/examples/UsbKeyboardDemo1/UsbKeyboardDemo1.pde</a> about BYPASS_TIMER_ISR. Rewrote my existing use of delay() with a custom delayMs(), et voila.<br /><br />Conclusion: my problem was timer related. I do not have much of a clue why and how, but that is not an issue for this thread. Case closed. Thanks for your time.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=5519">gamut</a> — Mon Sep 19, 2011 11:53 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Daid]]></name></author>
		<updated>2011-09-19T16:28:23+02:00</updated>

		<published>2011-09-19T16:28:23+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5971&amp;p=19645#p19645</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5971&amp;p=19645#p19645"/>
		<title type="html"><![CDATA[Re: Problems at some modulo 8 byte boundary]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5971&amp;p=19645#p19645"><![CDATA[
<blockquote class="uncited"><div>My USB cable is somewhat homebrew; abused an old standard cable (fullspeed max), soldered wires to pins for breadboarding. Could this be the problem? If there is too much interference (because of unshielded pins), the &quot;illegal byte sequence&quot; reported by wireshark makes sense.<br /></div></blockquote>I had an old mouse cable soldered to a board, which caused a lot of problems. I had a broken A-B cable soldered to another board, same problem. I shortened the cables, which solved the issue (10cm). But now I'm  just always putting B connectors on my boards. So I can use A-B cables.<br /><br />I've been using the 5V variant (without zeners, just a bit beefier resistors) without problems. So I don't think you'll run into problems because of the 3v9 zeners.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=5154">Daid</a> — Mon Sep 19, 2011 4:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[gamut]]></name></author>
		<updated>2011-09-19T13:47:54+02:00</updated>

		<published>2011-09-19T13:47:54+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5971&amp;p=19642#p19642</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5971&amp;p=19642#p19642"/>
		<title type="html"><![CDATA[Re: Problems at some modulo 8 byte boundary]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5971&amp;p=19642#p19642"><![CDATA[
I though I bought <strong class="text-strong">3v6</strong> zeners, but the zeners are labeld <strong class="text-strong">3v9</strong>. This might be the source of my problem. Am I outside the specs with 3v9 zeners? Can anyone confirm the wrong zeners would explain my errors?<br /><br /><br />* FWIW 1: I built &quot;Solution B: Level conversion on D+ and D-&quot; as per <a href="http://vusb.wikidot.com/hardware" class="postlink">http://vusb.wikidot.com/hardware</a>.<br />* FWIW 2: Without the USB Host Shield I still run into problems; the USB Host Shield is not the problem.<br />* FWIW 3: I am using the Arduino Uno rev2, which is powered by an ATmega328p.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=5519">gamut</a> — Mon Sep 19, 2011 1:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[gamut]]></name></author>
		<updated>2011-09-19T23:53:22+02:00 </updated>

		<published>2011-08-22T22:39:54+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5971&amp;p=19426#p19426</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5971&amp;p=19426#p19426"/>
		<title type="html"><![CDATA[[solved] Problems at some modulo 8 byte boundary]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5971&amp;p=19426#p19426"><![CDATA[
In short:<br />* My hardware: Arduino, runs at 16MHz, with USB Host Shield, and with VUSB<br />* My intention: create an USB proxy<br />* My problem: My response to GET DESCRIPTOR from VUSB to laptop fails.<br /><br />If my laptop asks for either the device descriptor of configuration descriptor (haven't tested other descriptors), wireshark reports<br />  URB status: Illegal byte sequence (-EILSEQ) (-84)<br /><br />But is it not always the case. Also, the &quot;URB length&quot; and &quot;Data length&quot; that wireshark reports, have all been 0 modulo 8: I have seen 8, 16, 48, 80, 104 bytes.<br /><br />I believe my debugging output it not taken up too much time. The USB 2.0 spec in 9.2.6.4 &quot;Standard Device Requests&quot; allows for 500ms to complete the configuration descriptor (if I read incorrectly it is 50ms). Wireshark timing example (for a 104 byte one):<br />  Time delta from previous captured frame: 0.180987000 seconds<br /><br />My USB cable is somewhat homebrew; abused an old standard cable (fullspeed max), soldered wires to pins for breadboarding. Could this be the problem? If there is too much interference (because of unshielded pins), the &quot;illegal byte sequence&quot; reported by wireshark makes sense.<br /><br />The Arduino runs at 16MHz which is not that suitable for VUSB (according to the assembly and readmes). If VUSB runs out of sync, the &quot;illegal byte sequence&quot; reported by wireshark makes sense. Could this be the problem.<br /><br />VUSB is connected to Arduino pins 2, 4 and 5. If I read correctly, it uses the interrupt with highest precendence; I do not expect errors because of servicing other interrupts.<br /><br />FWIW #1: I use custom USB_CFG_DESCR_PROPS_* in usbconfig.h [(USB_PROP_IS_DYNAMIC | USB_PROP_IS_RAM)]<br />FWIW #2: I already replaced the code asking for the configuration descriptor via the USB Host Shield with a static configuration descriptor (but still via USB_PROP_DYNAMIC and _RAM). This does not solve the problem. It seems that the USB Host Shield is not failing me.<br /><br />Can USB_CFG_HAVE_MEASURE_FRAME_LENGTH=1 and usage of usbMeasureFrameLength(void) be of any help?<br /><br />My biggest problem is that I do not know what would be a good starting place for debugging and I am not sure what the foremost suspect is. Just some pointers would probably help a lot.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=5519">gamut</a> — Mon Aug 22, 2011 10:39 pm</p><hr />
]]></content>
	</entry>
	</feed>
