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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2007-11-07T22:49:09+02:00</updated>

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

		<entry>
		<author><name><![CDATA[christian]]></name></author>
		<updated>2007-11-07T22:49:09+02:00</updated>

		<published>2007-11-07T22:49:09+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=893&amp;p=2960#p2960</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=893&amp;p=2960#p2960"/>
		<title type="html"><![CDATA[AVR USB stops responding]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=893&amp;p=2960#p2960"><![CDATA[
If you do the same thing in the main loop, usbPoll() is not called frequently enough.<br /><br />You CAN and SHOULD poll in the main loop, but you MUST NOT hang waiting for an event. If the UART is busy, just continue with the main loop and try again during the next cycle. Do this for every byte you send and for every byte you receive.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=8">christian</a> — Wed Nov 07, 2007 10:49 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2007-11-07T20:44:50+02:00</updated>

		<published>2007-11-07T20:44:50+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=893&amp;p=2959#p2959</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=893&amp;p=2959#p2959"/>
		<title type="html"><![CDATA[AVR-USB stops responding]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=893&amp;p=2959#p2959"><![CDATA[
Hi christian ,<br />         I am having problems using this AVR-USB code as a USB to serial converter. The function txChar_poll() sends a char by polling on the UART , the moment it finishes sending a character , i have a function rxChar_poll() which receives a character through polling. Once that is done i transmit 4 character bytes through UART. Now i wanted to know why this just spoils the USB connection , this process doesn't take much time , i think it would be less than 50ms always. But when i store these bytes to be sent and then do this process ( sending one char and receive one char and then send 4 char ) in the main programs , it hangs too. The connection is lost , it sometimes say that device not found or timer expired at other times. I want to use only polling, is there any way out ?<br /><br />Thanks<p>Statistics: Posted by Guest — Wed Nov 07, 2007 8:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[christian]]></name></author>
		<updated>2007-11-06T17:20:32+02:00</updated>

		<published>2007-11-06T17:20:32+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=893&amp;p=2929#p2929</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=893&amp;p=2929#p2929"/>
		<title type="html"><![CDATA[AVR USB stops responding]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=893&amp;p=2929#p2929"><![CDATA[
I see that you send some data with txChar_poll() and then wait for a reply with rxChar_poll(). I don't have the USB spec in front of me, but I remember that there is a time limit for processing messages. This time limit might be 50 ms.<br /><br />Please also note that the host polls the USB aggressively while it waits for a reply. This means that the AVR spends most of its time in the USB interrupt.<br /><br />As a general guideline, you should just store away all data in usbFunctionSetup and process it later in background. If a response must be sent, you can either poll for it or use an interrupt-in endpoint.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=8">christian</a> — Tue Nov 06, 2007 5:20 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[gert]]></name></author>
		<updated>2007-11-06T00:58:38+02:00</updated>

		<published>2007-11-06T00:58:38+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=893&amp;p=2916#p2916</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=893&amp;p=2916#p2916"/>
		<title type="html"><![CDATA[AVR USB stops responding]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=893&amp;p=2916#p2916"><![CDATA[
Do you have any idea how long your procedure occupies the CPU?<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=509">gert</a> — Tue Nov 06, 2007 12:58 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2007-11-05T14:49:56+02:00</updated>

		<published>2007-11-05T14:49:56+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=893&amp;p=2902#p2902</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=893&amp;p=2902#p2902"/>
		<title type="html"><![CDATA[AVR USB stops responding]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=893&amp;p=2902#p2902"><![CDATA[
hi , <br />     i  have written this code snippet in the <div class="codebox"><p>Code: </p><pre><code>USB_PUBLIC uchar usbFunctionSetup&#40;uchar data&#91;8&#93;&#41;<br /></code></pre></div> function and i am continuously invoking this function through host . The code snippet in this function is <div class="codebox"><p>Code: </p><pre><code>   if &#40; data&#91;1&#93; == SERIAL_SET_ROBOT_VEL_PC &#41;  /* SETTING THE ROBOT VELOCITY FROM PC*/<br />    &#123;<br />        PORTD = 0 ;<br />        usbMsgPtr = replyBuf;<br /><br />        lsb_fbVel = data&#91;2&#93; ;<br />        msb_fbVel = data&#91;3&#93; ;<br /><br />        lsb_rlVel = data&#91;4&#93; ;<br />        msb_rlVel = data&#91;5&#93; ;<br /><br />        replyBuf&#91;0&#93; = data&#91;4&#93;  ;<br />        replyBuf&#91;1&#93; = data&#91;5&#93;  ;<br /><br />        //currentState = SERIAL_SET_ROBOT_VEL_PC ;<br />        txChar_poll&#40;SERIAL_SET_ROBOT_VEL_PC&#41;;<br />        rec  = rxChar_poll&#40;&#41;;<br /><br />        txChar_poll&#40;lsb_fbVel&#41;;<br />        txChar_poll&#40;msb_fbVel&#41;;<br /><br />        for &#40; rec = 0 ; rec &lt; 255 ; rec ++  &#41;;<br />        txChar_poll&#40;lsb_rlVel&#41;;<br />        txChar_poll&#40;msb_rlVel&#41;;<br /><br />        rec = rxChar_poll&#40;&#41;;<br /><br />        currentState = IDLE ;<br />        return 2 ;<br />    &#125;<br /></code></pre></div><br /><br />the host gets message : No such device after some invocations. What is that is ending the connection ?<p>Statistics: Posted by Guest — Mon Nov 05, 2007 2:49 pm</p><hr />
]]></content>
	</entry>
	</feed>
