<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Powered by Anime &#187; Hardware</title>
	<atom:link href="http://www.poweredbyanime.com/index.php/cat/hardware/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.poweredbyanime.com</link>
	<description>Things I've discovered while doing what I do</description>
	<lastBuildDate>Thu, 20 Nov 2008 01:42:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The source of the number 13</title>
		<link>http://www.poweredbyanime.com/index.php/2008/11/12/the-source-of-the-number-13/</link>
		<comments>http://www.poweredbyanime.com/index.php/2008/11/12/the-source-of-the-number-13/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 16:56:30 +0000</pubDate>
		<dc:creator>Martin Williams</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://www.poweredbyanime.com/?p=61</guid>
		<description><![CDATA[Thank you Clark for the push &#8211; I had another look around and discovered that both 0&#215;0D (13) and 0&#215;0A (10) were being received by the AVR.  Linux was adding the extra 0&#215;0D in front of my 0&#215;0A, causing all the data in the command buffer to be shifted down one, which resulted in the [...]]]></description>
			<content:encoded><![CDATA[<p>Thank you <a href="http://www.poweredbyanime.com/index.php/2008/11/10/what-does-atmel-have-against-the-number-10/#comment-101" target="_self">Clark</a> for the push &#8211; I had another look around and discovered that <strong>both</strong> 0&#215;0D (13) and 0&#215;0A (10) were being received by the AVR.  Linux was adding the extra 0&#215;0D in front of my 0&#215;0A, causing all the data in the command buffer to be shifted down one, which resulted in the changed numbers, and the strange text output.  After a bit of searching, I found that the <em>stty</em> utility can be used to turn this feature off:</p>
<pre>stty -F /dev/ttyS0 -onlcr</pre>
<p>So that&#8217;s that &#8211; now I can get back to working on a utility to encode some colour bitmaps to store in the remaining 10K on the ATMEGA168 I&#8217;m using <img src='http://www.poweredbyanime.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.poweredbyanime.com/index.php/2008/11/12/the-source-of-the-number-13/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What does Atmel have against the number 10?</title>
		<link>http://www.poweredbyanime.com/index.php/2008/11/10/what-does-atmel-have-against-the-number-10/</link>
		<comments>http://www.poweredbyanime.com/index.php/2008/11/10/what-does-atmel-have-against-the-number-10/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 23:19:13 +0000</pubDate>
		<dc:creator>Martin Williams</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://www.poweredbyanime.com/?p=52</guid>
		<description><![CDATA[Or maybe avr-gcc is the culprit?  Anyway, here&#8217;s the story:  I&#8217;ve been working on building an embedded computer for my motorcycle for some time now.  Recently I&#8217;ve been prototyping a display module for it.  I&#8217;ve got a couple of cell phone screens from SparkFun, and some code to drive them from an AVR.  So far, [...]]]></description>
			<content:encoded><![CDATA[<p>Or maybe avr-gcc is the culprit?  Anyway, here&#8217;s the story:  I&#8217;ve been working on building an embedded computer for my motorcycle for some time now.  Recently I&#8217;ve been prototyping a display module for it.  I&#8217;ve got a couple of <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=8600">cell phone screens</a> from <a href="http://www.sparkfun.com">SparkFun</a>, and some code to drive them from an <a href="http://www.atmel.com/dyn/products/product_card.asp?part_id=3303">AVR</a>.  So far, so good.  I&#8217;ve since added a <a href="http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1068">MAX3232</a> to the mix to allow the actual computer to communicate with the screens.  I devised a simple serial protocol that allows me to have some fonts and simple drawing commands stored on the AVR so that I don&#8217;t need to send each pixel over the serial line.</p>
<p><a href="http://www.poweredbyanime.com/wp-content/uploads/2008/11/img_1181.jpg"><img class="size-full wp-image-55 alignnone" style="border: 0pt none;" title="Prototype display module" src="http://www.poweredbyanime.com/wp-content/uploads/2008/11/img_1181.jpg" alt="Why won\'t it display a 10?" width="480" height="360" /></a></p>
<p>It works great &#8211; <strong>except</strong> &#8211; that whenever I send a command containing the byte 0&#215;0A, the command gets misinterpreted somehow.  If I ask for a large 3 digit display showing the number 10, it displays the number 13.  Every time.  Every other number from 0&#215;00 to 0xFF is unaffected.  If I send a command asking for some text at 10 pixels across, n pixels down, the text appears only as blank spaces, and in a different position.</p>
<p>I&#8217;ve confirmed that the byte is being received by the AVR correctly.  I store it in a buffer, waiting for the whole command to complete, and I&#8217;ve confirmed that it is still stored in the buffer when I go to execute the selected command.  The problem appears when I actually unpack the buffer into the arguments needed for the display function calls.  Inside the function body, the value that should have been 10 is changed.  This happens even if I just pass in the whole command buffer as a uint8_t *.</p>
<p>This makes no sense to me.  Especially since I can hard-code a 10 and have everything work without issue.  The only thing I can think of is that this is somehow related to the call being made from an interrupt handler, although this hardly explains why only calls involving the number 10 are affected&#8230;</p>
<p>I&#8217;m going to try moving the main switch into the main loop and see if that changes anything.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.poweredbyanime.com/index.php/2008/11/10/what-does-atmel-have-against-the-number-10/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
