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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2015-07-13T23:43:04+02:00</updated>

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

		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2015-07-13T23:43:04+02:00</updated>

		<published>2015-07-13T23:43:04+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9920&amp;p=29965#p29965</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9920&amp;p=29965#p29965"/>
		<title type="html"><![CDATA[Re: Max. allowed delay between interrupts?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9920&amp;p=29965#p29965"><![CDATA[
Key word is &quot;worried&quot;. If the USB is &quot;interrupted&quot;  in any way it will not work, thus if it's working stop worrying <img class="smilies" src="./../../../images/smilies/icon_wink.gif" alt=";)" title="Wink" /><br /><br />BTW: that comment was for an older v-usb build, I believe currently there is no restriction, however if you set the poll rate to 8ms then you need to finish all work with in 8 ms.<br /><br />for a much better approach see Rapheals work <!-- m --><a class="postlink" href="http://www.raphnet.net/electronique/gc_n64_usb/index_en.php">http://www.raphnet.net/electronique/gc_ ... dex_en.php</a><!-- m --><br />Yes this is for GameCube/n64 but read &quot;USB Sync.&quot;<br /><br />PSX code is much less of a concern and very easy to work with. Especially if you use the ISP.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Mon Jul 13, 2015 11:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rsn8887]]></name></author>
		<updated>2015-07-11T00:37:30+02:00</updated>

		<published>2015-07-11T00:37:30+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9920&amp;p=29943#p29943</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9920&amp;p=29943#p29943"/>
		<title type="html"><![CDATA[Max. allowed delay between interrupts?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9920&amp;p=29943#p29943"><![CDATA[
I found conflicting docs about interrupt latency in V-USB. <br /><br />In usbdrv.h is a statement that interrupts should not be disabled for longer 25 us. On the <a href="http://vusb.wikidot.com/troubleshooting" class="postlink">V-USB troubleshooting page</a>, it states that there can be a few milliseconds.<br /><br />In my project <a href="https://github.com/rsn8887/RetroAdapterMod" class="postlink">RetroAdapterMod</a> (a mod of Paul Qureshi's RetroAdapter), I am using some microsecond timing that is crucial to communicate with PSX and Gamecube controllers.<br /><br />I use only interrupt-based USB communication to send the controller data to the host:<br />(the real code is more involved, but this is the basic idea):<br /><br /><div class="codebox"><p>Code: </p><pre><code>for (;;)<br />{<br />   usbPoll();<br />   if (usbInterruptIsReady())<br />   {<br />     cli();<br />     readGCData(); //&lt;--- this is a timing critical assembler routine that can not be disturbed, changes report <br />     sei();<br />     USBSetInterrupt(report,len);<br />   }<br />}<br /></code></pre></div><br /><br />Without the cli() and sei() I was getting random and host-dependent bitflips in the report variable. My guess is that the cycle timing in the readGCData function was disturbed by interrupts. After adding the cli() and sei() it works perfect. But I am worried about stability and compatibility with different hosts, because I disable interrupts for a potentially long time of several ms or more. <br /><br />Is this the correct way to do this?<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=21449">rsn8887</a> — Sat Jul 11, 2015 12:37 am</p><hr />
]]></content>
	</entry>
	</feed>
