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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2011-04-28T23:32:04+02:00</updated>

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

		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2011-04-28T23:32:04+02:00</updated>

		<published>2011-04-28T23:32:04+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5634&amp;p=18333#p18333</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5634&amp;p=18333#p18333"/>
		<title type="html"><![CDATA[Re: resetting my device]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5634&amp;p=18333#p18333"><![CDATA[
Wow, ok so apparently its in the while (!usbInterruptIsReady()) loop at this time. So I have to run a checkAlive in there to test for a low condition over time. <br /><br /><br />This does work, but damn its ugly! During this loop I see the usb data on that pin, but if its held low for the entire loop it returns all checks false, resulting in 245. Anyone have a better solution to offer?<br /><br /><div class="codebox"><p>Code: </p><pre><code>static void checkAlive(void)<br />{ if (!checkAliveEnabled) return;<br />   unsigned char i=0;<br />   DDRD &amp;= ~0x02;<br />   for( ; i &lt; 254 ; i++) <br />   {<br />      if (PIND &amp; 0x02) break;<br />   }<br />   DDRD |= 0x02;<br /><br />   if (i==254)  //do something...<br /><br />}</code></pre></div><br /><br />I did try<div class="codebox"><p>Code: </p><pre><code>WDTCSR = ((1&lt;&lt;WDCE) | (1&lt;&lt;WDE)); while(1);</code></pre></div> but it didnt work. I did find a working reset option for now.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Thu Apr 28, 2011 11:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2011-04-28T20:30:48+02:00</updated>

		<published>2011-04-28T20:30:48+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5634&amp;p=18331#p18331</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5634&amp;p=18331#p18331"/>
		<title type="html"><![CDATA[Re: resetting my device]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5634&amp;p=18331#p18331"><![CDATA[
Could some one please explain to me why this does not work?<br /><br /><br />I added the cli/sei and usb dropping in hopes it woudl help.<br /><div class="codebox"><p>Code: </p><pre><code>cli();<br />usbDeviceDisconnect();<br />      DDRD &amp;= ~0x02;_delay_us(.1);<br />      if (! (PIND &amp; 0x02) ) blinkLed(1);//{   WDTCSR = ((1&lt;&lt;WDCE) | (1&lt;&lt;WDE)); while(1) {} }<br />      <br />      DDRD |= 0x02;<br />usbDeviceConnect();<br />sei()</code></pre></div><br /><br />I need to be able to detect when the PD1 or PD2 gets pulled low. PD1 has my usb - lead. and PD3 has my usb + lead. PD2 has my pull up operated via usb connect/disconnect. I'm able to watch any other pin on another port. For some reason I can not watch for a low on these pins.<br /><br />My guess here is that the pulling of lead + is releasing the power to the mcu ( effectively not running the code above ) but the entire reason for this is because the mcu is retaining its last state? So its like the memory in the mcu is intact but its not capable of running the clock.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Thu Apr 28, 2011 8:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2011-04-25T22:13:13+02:00</updated>

		<published>2011-04-25T22:13:13+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5634&amp;p=18304#p18304</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5634&amp;p=18304#p18304"/>
		<title type="html"><![CDATA[Re: resetting my device]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5634&amp;p=18304#p18304"><![CDATA[
could be the answer I'm looking for, thx.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Mon Apr 25, 2011 10:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2011-04-25T22:05:28+02:00</updated>

		<published>2011-04-25T22:05:28+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5634&amp;p=18303#p18303</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5634&amp;p=18303#p18303"/>
		<title type="html"><![CDATA[Re: resetting my device]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5634&amp;p=18303#p18303"><![CDATA[
how about you detect the pulling, and then use the watchdog timer to perform the reset?<p>Statistics: Posted by Guest — Mon Apr 25, 2011 10:05 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2011-04-24T18:38:00+02:00</updated>

		<published>2011-04-24T18:38:00+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5634&amp;p=18299#p18299</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5634&amp;p=18299#p18299"/>
		<title type="html"><![CDATA[resetting my device]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5634&amp;p=18299#p18299"><![CDATA[
Normally this works rather well by pulling the reset line low to my avr, however I'm now forced to use pc6 ( my reset line ) and I'm looking for another way to reset my device. I always though pulling the white usb lead low would do it, but that just &quot;pauses&quot; the usb, it does not do a thing to the avr code. Another way is simple pulling +5 low, but is that bright? It works, just seems a bit chancy. Any ideas? I need a one lead solution as my design has a 1 poll switch.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Sun Apr 24, 2011 6:38 pm</p><hr />
]]></content>
	</entry>
	</feed>
