<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Multitasking in the AVR Microcontroller</title>
	<atom:link href="http://www.friday.com/bbum/2008/03/16/multitasking-in-the-avr-microcontroller/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.friday.com/bbum/2008/03/16/multitasking-in-the-avr-microcontroller/</link>
	<description>...so google can organize my head.</description>
	<pubDate>Fri, 21 Nov 2008 19:00:42 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: Jeremy</title>
		<link>http://www.friday.com/bbum/2008/03/16/multitasking-in-the-avr-microcontroller/#comment-186126</link>
		<dc:creator>Jeremy</dc:creator>
		<pubDate>Wed, 02 Apr 2008 15:45:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.friday.com/bbum/2008/03/16/multitasking-in-the-avr-microcontroller/#comment-186126</guid>
		<description>Have you checked out the MakeController from Makingthings?  It's also an Atmel (ARM7 in this case), includes a crapload of I/O, and runs a true RTOS?  Did I also mention it uses g++ and has a ROM bootloader?

I admit, it's quite a step up from the AVR, but Makingthings has made it reasonably easy to use.  For the project you've selected, your AVR should be more than enough; but it is quite easy to do SAM7X code on the Mac, and the MakeController is a great place to start.</description>
		<content:encoded><![CDATA[<p>Have you checked out the MakeController from Makingthings?  It&#8217;s also an Atmel (ARM7 in this case), includes a crapload of I/O, and runs a true RTOS?  Did I also mention it uses g++ and has a ROM bootloader?</p>
<p>I admit, it&#8217;s quite a step up from the AVR, but Makingthings has made it reasonably easy to use.  For the project you&#8217;ve selected, your AVR should be more than enough; but it is quite easy to do SAM7X code on the Mac, and the MakeController is a great place to start.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://www.friday.com/bbum/2008/03/16/multitasking-in-the-avr-microcontroller/#comment-186052</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Mon, 31 Mar 2008 03:57:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.friday.com/bbum/2008/03/16/multitasking-in-the-avr-microcontroller/#comment-186052</guid>
		<description>I would stick with whatever is more readable.  As long as you are just dealing with constant powers of two, compiler optimization should be able to convert the modulo operation into the bit-wise AND operation, so there should be no performance difference.  I'm pretty sure this is true for the gcc versions I use for embedded ppc development;  I'm not sure about this platform.  Premature optimization is no more justified in the embedded space than it is anywhere else.</description>
		<content:encoded><![CDATA[<p>I would stick with whatever is more readable.  As long as you are just dealing with constant powers of two, compiler optimization should be able to convert the modulo operation into the bit-wise AND operation, so there should be no performance difference.  I&#8217;m pretty sure this is true for the gcc versions I use for embedded ppc development;  I&#8217;m not sure about this platform.  Premature optimization is no more justified in the embedded space than it is anywhere else.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wes</title>
		<link>http://www.friday.com/bbum/2008/03/16/multitasking-in-the-avr-microcontroller/#comment-185841</link>
		<dc:creator>Wes</dc:creator>
		<pubDate>Mon, 17 Mar 2008 21:50:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.friday.com/bbum/2008/03/16/multitasking-in-the-avr-microcontroller/#comment-185841</guid>
		<description>&lt;blockquote&gt;I’m gradually dragging my mindset into embedded programming and, as you can tell, I’m not entirely there yet.&lt;/blockquote&gt;Its certainly a different mindset and its great fun to be working at such a low level, especially when it gets to the point where every cycle counts.</description>
		<content:encoded><![CDATA[<blockquote><p>I’m gradually dragging my mindset into embedded programming and, as you can tell, I’m not entirely there yet.</p></blockquote>
<p>Its certainly a different mindset and its great fun to be working at such a low level, especially when it gets to the point where every cycle counts.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bbum</title>
		<link>http://www.friday.com/bbum/2008/03/16/multitasking-in-the-avr-microcontroller/#comment-185837</link>
		<dc:creator>bbum</dc:creator>
		<pubDate>Mon, 17 Mar 2008 17:09:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.friday.com/bbum/2008/03/16/multitasking-in-the-avr-microcontroller/#comment-185837</guid>
		<description>Oh, duh!  Of course!

Thanks, Aaron &#038; Wes.

I'm gradually dragging my mindset into embedded programming and, as you can tell, I'm not entirely there yet.</description>
		<content:encoded><![CDATA[<p>Oh, duh!  Of course!</p>
<p>Thanks, Aaron &#038; Wes.</p>
<p>I&#8217;m gradually dragging my mindset into embedded programming and, as you can tell, I&#8217;m not entirely there yet.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron</title>
		<link>http://www.friday.com/bbum/2008/03/16/multitasking-in-the-avr-microcontroller/#comment-185834</link>
		<dc:creator>Aaron</dc:creator>
		<pubDate>Mon, 17 Mar 2008 14:36:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.friday.com/bbum/2008/03/16/multitasking-in-the-avr-microcontroller/#comment-185834</guid>
		<description>I think his point was that "ledState = ledState &#38; 3;" is equivalent to "ledState = ledState % 4;" and just requires a logical and op whereas modulo requires a division which will end up being done in software on something like the AVR as it doesn't have a divide op. Using "ledState = (ledState==3)?0:(ledState+1);" would let you do something other than a power of 2 and is probably slower than the logical and.

Sure, you may have cycles to burn now, but just keep this in mind for when you don't.</description>
		<content:encoded><![CDATA[<p>I think his point was that &#8220;ledState = ledState &amp; 3;&#8221; is equivalent to &#8220;ledState = ledState % 4;&#8221; and just requires a logical and op whereas modulo requires a division which will end up being done in software on something like the AVR as it doesn&#8217;t have a divide op. Using &#8220;ledState = (ledState==3)?0:(ledState+1);&#8221; would let you do something other than a power of 2 and is probably slower than the logical and.</p>
<p>Sure, you may have cycles to burn now, but just keep this in mind for when you don&#8217;t.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bbum</title>
		<link>http://www.friday.com/bbum/2008/03/16/multitasking-in-the-avr-microcontroller/#comment-185828</link>
		<dc:creator>bbum</dc:creator>
		<pubDate>Mon, 17 Mar 2008 03:05:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.friday.com/bbum/2008/03/16/multitasking-in-the-avr-microcontroller/#comment-185828</guid>
		<description>Nope -- the modulus is there to bound the values between 0 and 3.   Whether a conditional + assignment would be more efficient, I know not (haven't looked at the assembly).

In this case, the CPU is running at 1mhz and I have cycles to burn.

[I am, of course, completely wrong.   Wes's suggestion is dead on.]</description>
		<content:encoded><![CDATA[<p>Nope &#8212; the modulus is there to bound the values between 0 and 3.   Whether a conditional + assignment would be more efficient, I know not (haven&#8217;t looked at the assembly).</p>
<p>In this case, the CPU is running at 1mhz and I have cycles to burn.</p>
<p>[I am, of course, completely wrong.   Wes's suggestion is dead on.]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wes</title>
		<link>http://www.friday.com/bbum/2008/03/16/multitasking-in-the-avr-microcontroller/#comment-185827</link>
		<dc:creator>Wes</dc:creator>
		<pubDate>Mon, 17 Mar 2008 03:01:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.friday.com/bbum/2008/03/16/multitasking-in-the-avr-microcontroller/#comment-185827</guid>
		<description>&lt;blockquote&gt;ledState = ledState % 4;&lt;/blockquote&gt;
Wouldn't ledState &#38;= 0b11 be vastly more efficient than a modulus operation?</description>
		<content:encoded><![CDATA[<blockquote><p>ledState = ledState % 4;</p></blockquote>
<p>Wouldn&#8217;t ledState &amp;= 0b11 be vastly more efficient than a modulus operation?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
