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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2013-12-01T09:11:44+02:00</updated>

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

		<entry>
		<author><name><![CDATA[cpldcpu]]></name></author>
		<updated>2013-12-01T09:11:44+02:00</updated>

		<published>2013-12-01T09:11:44+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8738&amp;p=26281#p26281</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8738&amp;p=26281#p26281"/>
		<title type="html"><![CDATA[Re: Entirely polled V-USB? [yes, it works!]]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8738&amp;p=26281#p26281"><![CDATA[
I moved that to the beginning of the interrupt routine to ensure that YL is initialized as well.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20062">cpldcpu</a> — Sun Dec 01, 2013 9:11 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blargg]]></name></author>
		<updated>2013-12-01T03:58:24+02:00</updated>

		<published>2013-12-01T03:58:24+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8738&amp;p=26279#p26279</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8738&amp;p=26279#p26279"/>
		<title type="html"><![CDATA[Re: Entirely polled V-USB? [yes, it works!]]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8738&amp;p=26279#p26279"><![CDATA[
I noticed that you don't clear the interrupt flag before PCINT0_vect(). Did you determine that leaving the flag set won't bother usbdrv? I ask because I have seen places in the interrupt code where it checks the flag and acts on whether it's set.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20076">blargg</a> — Sun Dec 01, 2013 3:58 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cpldcpu]]></name></author>
		<updated>2013-12-01T02:09:11+02:00</updated>

		<published>2013-12-01T02:09:11+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8738&amp;p=26278#p26278</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8738&amp;p=26278#p26278"/>
		<title type="html"><![CDATA[Re: Entirely polled V-USB? [yes, it works!]]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8738&amp;p=26278#p26278"><![CDATA[
meh... just tried it on another machine and it failed all the time. Looks like the only solution is to introduce a more sophisticated algorithm that decides when to do the housekeeping.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20062">cpldcpu</a> — Sun Dec 01, 2013 2:09 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cpldcpu]]></name></author>
		<updated>2013-12-01T01:53:06+02:00</updated>

		<published>2013-12-01T01:53:06+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8738&amp;p=26277#p26277</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8738&amp;p=26277#p26277"/>
		<title type="html"><![CDATA[Re: Entirely polled V-USB? [yes, it works!]]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8738&amp;p=26277#p26277"><![CDATA[
I made a version of micronucleus only using polling, based on your work above. You can find the branch here:<br /><br /><!-- m --><a class="postlink" href="https://github.com/micronucleus/micronucleus/tree/testing-ng/firmware">https://github.com/micronucleus/micronu ... g/firmware</a><!-- m --><br /><br />Getting the polling to work with larger datatransfers as well was not easy. Finding the right timing to call usbPoll() in between transmissions was quite difficult. I had no luck with a blocking wait, so in the end i settled with a 100µs loop and calls to the housekeeping functions in between. The current state seems to work pretty reliably on my machine, even when routed through two cascaded hubs. But even slight changes in the loop timing will cause errors during data transfer.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20062">cpldcpu</a> — Sun Dec 01, 2013 1:53 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cpldcpu]]></name></author>
		<updated>2013-11-30T10:47:50+02:00</updated>

		<published>2013-11-30T10:47:50+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8738&amp;p=26274#p26274</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8738&amp;p=26274#p26274"/>
		<title type="html"><![CDATA[Re: Entirely polled V-USB? [yes, it works!]]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8738&amp;p=26274#p26274"><![CDATA[
Yes, yes and yes <img class="smilies" src="./../../../images/smilies/icon_smile.gif" alt=":)" title="Smile" /><br /><br />My guess is also on status register restoring, but I reviewed the diassembly and found nothing fishy. Looks like I have to dig further.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20062">cpldcpu</a> — Sat Nov 30, 2013 10:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blargg]]></name></author>
		<updated>2013-11-29T21:04:37+02:00</updated>

		<published>2013-11-29T21:04:37+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8738&amp;p=26269#p26269</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8738&amp;p=26269#p26269"/>
		<title type="html"><![CDATA[Re: Entirely polled V-USB? [yes, it works!]]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8738&amp;p=26269#p26269"><![CDATA[
So the .lss (from avr-objdump, not gcc) file doesn't show any occurrences of SEI? I wouldn't trust source code.<br /><br />Anything mis-restoring the status register?<br /><br />Oh, and you've changed RETI to RET in asmcommon.inc, right? <img class="smilies" src="./../../../images/smilies/icon_smile.gif" alt=":)" title="Smile" /><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20076">blargg</a> — Fri Nov 29, 2013 9:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cpldcpu]]></name></author>
		<updated>2013-11-29T20:31:41+02:00</updated>

		<published>2013-11-29T20:31:41+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8738&amp;p=26268#p26268</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8738&amp;p=26268#p26268"/>
		<title type="html"><![CDATA[Re: Entirely polled V-USB? [yes, it works!]]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8738&amp;p=26268#p26268"><![CDATA[
Ok, managed to get it working is well.<br /><br />1) I did not realize your routine was jumping to INT0 and my code used the pin change interrupt PCINT0. One of the most annoying bugs ever! Whenever USB traffic appeared the device reset and I could not figure out why.<br /><br />2) I removed all occurencec of SEI in the code and the first instruction after reset is CLI. Yet the code fails if I the PCINT0 vector is not initialized, meaning that an IRQ is asserted somewhere. Really odd.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20062">cpldcpu</a> — Fri Nov 29, 2013 8:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cpldcpu]]></name></author>
		<updated>2013-11-26T07:09:16+02:00</updated>

		<published>2013-11-26T07:09:16+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8738&amp;p=26255#p26255</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8738&amp;p=26255#p26255"/>
		<title type="html"><![CDATA[Re: Entirely polled V-USB? [yes, it works!]]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8738&amp;p=26255#p26255"><![CDATA[
Thanks for the explanation. I will try to implement this in the bootloader.<br /><br />I like the debugging by oscilloscope. I am using a bitbanged maximum speed SPI implementation as debug output on two unused pins. Then I use a logicanalyzer to capture both the SPI and USB traffic to get realtime debugging information.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20062">cpldcpu</a> — Tue Nov 26, 2013 7:09 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2013-11-25T20:38:17+02:00</updated>

		<published>2013-11-25T20:38:17+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8738&amp;p=26251#p26251</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8738&amp;p=26251#p26251"/>
		<title type="html"><![CDATA[Re: Entirely polled V-USB? [yes, it works!]]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8738&amp;p=26251#p26251"><![CDATA[
Ok, got it! Thx for that summary. Good luck on the 8mhz!<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Mon Nov 25, 2013 8:38 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[blargg]]></name></author>
		<updated>2013-11-25T20:15:16+02:00</updated>

		<published>2013-11-25T20:15:16+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8738&amp;p=26250#p26250</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8738&amp;p=26250#p26250"/>
		<title type="html"><![CDATA[Re: Entirely polled V-USB? [yes, it works!]]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8738&amp;p=26250#p26250"><![CDATA[
Yes, you're way off <img class="smilies" src="./../../../images/smilies/icon_smile.gif" alt=":)" title="Smile" /><br /><br />This doesn't alter USB behavior, rather simply allows one to avoid using hardware interrupts on the AVR side. The main use is in a bootloader on an AVR without a separate vector table, where you want to preserve the user program's vectors and not hijack the INT0 handler (or rather pin change as I believe it is on an attiny).<br /><br />It might also be useful for implementing a USB handler that doesn't have to preserve registers, and can rely on some being preloaded. Perhaps for an 8MHz implementation of V-USB (which I'm going to research today).<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20076">blargg</a> — Mon Nov 25, 2013 8:15 pm</p><hr />
]]></content>
	</entry>
	</feed>
