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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2014-07-03T13:29:45+02:00</updated>

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

		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2014-07-03T13:29:45+02:00</updated>

		<published>2014-07-03T13:29:45+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9128&amp;p=27469#p27469</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9128&amp;p=27469#p27469"/>
		<title type="html"><![CDATA[Re: What is needed for usb stability.]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9128&amp;p=27469#p27469"><![CDATA[
They didn't reply to me, they replied to the above user, I dont retain every post I comment in. <br /><br />Anyways I think I jumped the gun on that one .The longest wait I have seen is 4 ms in testing. So I take that back, its not a time out issue. <br /><blockquote class="uncited"><div> What's your code doing for 8ms between calls?</div></blockquote> I just meant that the usb interrupt is every 8 ms like it should be and my code is well under 8ms.<br /><br /><br />Did some testing tonight and it turns out the usb device works on all my 7 systems but the two that have the avr isp usb burner and avr studio  installed. To make it  see my symptoms.<br /><br />avr studio open<br />1) if I unplug the avr burn my usb device drops out. Same if I plug it in<br />2) the usb device works when the avr burner is plugged in but as described above.<br />3) the usb device will not enumerate if the usb burner in unplugged.<br />4) unplugging or plugging in the avr causes the device to reset.<br /><br />avr studio closed<br />1) if I unplug the avr burn my usb device drops out.Same if I plug it in<br />2) the usb device works when the avr burner is plugged correctly<br />3) the usb device works when the avr burner is not plugged correctly<br /><br />If avr stuio is not running and the device is working well I can run avr studio and use the isp. Until I burn to the chip and my device is back to crap again.<br /><br />This is the same on my two system both win7 64 but. Both have the latest 6.2 avr studio.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Thu Jul 03, 2014 1:29 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blargg]]></name></author>
		<updated>2014-07-03T00:10:25+02:00</updated>

		<published>2014-07-03T00:10:25+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9128&amp;p=27460#p27460</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9128&amp;p=27460#p27460"/>
		<title type="html"><![CDATA[Re: What is needed for usb stability.]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9128&amp;p=27460#p27460"><![CDATA[
In a thread a while back someone replied to you that it was <a href="http://forums.obdev.com/viewtopic.php?p=19963&amp;sid=f781186ce0eac9c6fe9613fd7f9f85bf#p19963" class="postlink">50ms</a>. What's your code doing for 8ms between calls? usbPoll() is generally quick as it has nothing to do.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20076">blargg</a> — Thu Jul 03, 2014 12:10 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2014-07-02T22:03:48+02:00</updated>

		<published>2014-07-02T22:03:48+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9128&amp;p=27457#p27457</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9128&amp;p=27457#p27457"/>
		<title type="html"><![CDATA[Re: What is needed for usb stability.]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9128&amp;p=27457#p27457"><![CDATA[
ok found my issue, too long of a wait in-between polls. What it the max with the current v-usb version?<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Wed Jul 02, 2014 10:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2014-07-02T13:36:53+02:00</updated>

		<published>2014-07-02T13:36:53+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9128&amp;p=27440#p27440</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9128&amp;p=27440#p27440"/>
		<title type="html"><![CDATA[Re: What is needed for usb stability.]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9128&amp;p=27440#p27440"><![CDATA[
blargg, that was helpful thx. I finally got the init down to the point I'm happy with it but in my poll loop the usb is constantly drops out. AS you suggested I dont want to watch dog it. I'd rather find the error. My build report is well under 8 ms, and my polls occurs every 8 ms on time, each time. Aside from time, what else would make the usb drop out? By that I mean the usb device stop reporting data (seen from my analyzer) than comes back. <br /><br />If the usb gave up wouldn't it need to re-enumerate? If so that is not my problem. Though for some reason the usb does not communicate with the host at some length of time and then starts to talk again.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Wed Jul 02, 2014 1:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blargg]]></name></author>
		<updated>2014-07-01T21:48:03+02:00</updated>

		<published>2014-07-01T21:48:03+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9128&amp;p=27433#p27433</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9128&amp;p=27433#p27433"/>
		<title type="html"><![CDATA[Re: What is needed for usb stability.]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9128&amp;p=27433#p27433"><![CDATA[
Those provide additional features. Watchdog can reset device if it hangs (though I think these are a bad idea during development as they can hide bugs if you don't notice the reset). Timers provide a timebase for other things you're doing. Sometimes people put a USB reset on the bus in the beginning so when developing and the device has just been reflashed, the host will re-enumerate and see the new device. Also <a href="http://en.wikipedia.org/wiki/Copypasta" class="postlink">copypasta</a> explains unnecessary things. And of course I may be incorrect in some way.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20076">blargg</a> — Tue Jul 01, 2014 9:48 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2014-07-01T14:10:00+02:00</updated>

		<published>2014-07-01T14:10:00+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9128&amp;p=27431#p27431</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9128&amp;p=27431#p27431"/>
		<title type="html"><![CDATA[Re: What is needed for usb stability.]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9128&amp;p=27431#p27431"><![CDATA[
So why do so many people full with timers, watch dogs, status registers,  and resets?<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Tue Jul 01, 2014 2:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blargg]]></name></author>
		<updated>2014-07-01T08:23:31+02:00</updated>

		<published>2014-07-01T08:23:31+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9128&amp;p=27430#p27430</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9128&amp;p=27430#p27430"/>
		<title type="html"><![CDATA[Re: What is needed for usb stability.]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9128&amp;p=27430#p27430"><![CDATA[
This is about the most minimal I come up with for an USBasp board (atmega8).<br /><br /><div class="codebox"><p>Code: </p><pre><code>#include &lt;avr/interrupt.h&gt;<br />#include &quot;usbdrv/usbdrv.h&quot;<br /><br />int main( void )<br />{<br />    usbInit();<br />    sei();<br /><br />    for ( ;; )<br />    {<br />        usbPoll();<br />    }<br />}<br /><br />uchar usbFunctionSetup( uchar data &#91;&#93; )<br />{<br />    (void) data;<br />    return 0;<br />}<br /></code></pre></div><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20076">blargg</a> — Tue Jul 01, 2014 8:23 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2014-06-28T20:58:19+02:00</updated>

		<published>2014-06-28T20:58:19+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9128&amp;p=27396#p27396</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9128&amp;p=27396#p27396"/>
		<title type="html"><![CDATA[What is needed for usb stability.]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9128&amp;p=27396#p27396"><![CDATA[
Ok I have been using v-usb for 7 years and all I do is this...<br /><br />//init<br /><div class="codebox"><p>Code: </p><pre><code>static void usbReset(void)<br />{<br />    usbDeviceDisconnect();  /* enforce re-enumeration, do this while interrupts are disabled! */<br />   uchar i = 0;<br />    while(--i)<br />   {   // USB disconnect for &gt;250ms <br />        _delay_ms(1);<br />    };<br />    usbDeviceConnect();<br />}<br /><br />cli();<br />sreg = SREG;<br />usbInit();<br />usbReset();<br />SREG = sreg;<br />sei();<br /><br />//main loop<br />makeReport();<br />while (!usbInterruptIsReady()){usbPoll(); } usbSetInterrupt( reportBuffer, 8); </code></pre></div><br /><br />Now I have noticed there is a bit of a rocky start, usb reset kinda bumpy, and even ( very seldom ) the usb drops out during use.  It has not been a big deal but I'd like to clean it up. I have seen people use the timers and the watch dog but what is really needed here. Can anyone give me a very minimal basic usb init and loop? I'm not using the mega8 but instead the 328 so the timers are not the same.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Sat Jun 28, 2014 8:58 pm</p><hr />
]]></content>
	</entry>
	</feed>
