<?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>Adi&#039;s</title>
	<atom:link href="http://adis.ca/feed/" rel="self" type="application/rss+xml" />
	<link>http://adis.ca</link>
	<description>Reflections of a Wandering Mind</description>
	<lastBuildDate>Mon, 20 Feb 2012 23:05:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>They are Alive&#8230;!</title>
		<link>http://adis.ca/post/uino-32u4-uino-1284p-alive/</link>
		<comments>http://adis.ca/post/uino-32u4-uino-1284p-alive/#comments</comments>
		<pubDate>Mon, 20 Feb 2012 22:54:20 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[AVR]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[OpenSource]]></category>

		<guid isPermaLink="false">http://adis.ca/?p=665</guid>
		<description><![CDATA[<p><p class="wp-caption-text">The *uino-1284p assembled</p>Over the past few days I assembled one each of the *uino-1284p and *uino-32u4. Things went very well and few issues were encountered.</p> <p>The *uino-32u4 went together flawless. For initial testing I used the Arduino Leonardo bootloader and core files. Since my pinout differs from the Arduino Leonardo this required some translating <p><a href="http://adis.ca/post/uino-32u4-uino-1284p-alive/">Read more ... &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_671" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-uino-32u4-uino-1284p-alive" href="http://adis.ca/wp-live/wp-content/uploads/2012/02/uino-1284p_v0.3_assembled_b.jpg"><img src="http://adis.ca/wp-live/wp-content/uploads/2012/02/uino-1284p_v0.3_assembled_b-150x150.jpg" alt="The *uino-1284p assembled" title="uino-1284p_v0.3_assembled_b" width="150" height="150" class="size-thumbnail wp-image-671" /></a><p class="wp-caption-text">The *uino-1284p assembled</p></div>Over the past few days I assembled one each of the <a href="http://adis.ca/post/uino-1284p-arrived/" title="The *uino-1284p Has Arrived" target="_blank">*uino-1284p</a> and <a href="http://adis.ca/post/uino-32u4-arrived/" title="The *uino-32u4 Has Arrived" target="_blank">*uino-32u4</a>. Things went very well and few issues were encountered.</p>
<p>The *uino-32u4 went together flawless. For initial testing I used the Arduino Leonardo bootloader and core files. Since my pinout differs from the Arduino Leonardo this required some translating of digital pins to get the lights to blink. But blink they do. I am so glad to see this actually working. Loading the Leonardo bootloader onto the board using the Arduino 1.0 IDE was trivial and worked without a flaw.</p>
<p>The *uino-1284p went together with minor issues. On the hardware side I noticed that the polarity of the reverse polarity protection diode is marked wrong. To be exact, the schematic is correct, the schematic symbol is in the proper orientation. However, I did add a little &#8220;plus&#8221; sign to the circuit board to where the anode should be. I erroneously placed the little &#8220;plus&#8221; by the cathode. When it tried to place the reset tact switch on the board it would not fit. I don&#8217;t know if there is a &#8220;standard&#8221; tact switch, but i picked a different footprint for the switch on the *uino-1284p. I had to make something work by shoehorning a through hole switch into submission. It works and I will have to see what Digi-Key part is appropriate for this purpose.<span id="more-665"></span></p>
<p>I was a little concerned about loading the firmware onto the ATmega8U2. It isn&#8217;t done via the Arduino IDE and I have yet to find a standalone method to use the AVR ISP MKII on the Mac. Fortunately the Arduino IDE includes everything needed to program with the AVR ISP MKII. While the avrdude executable is not in the default path, it is easily accessed by specifying the full path. Also, the avrdude command line required to get the ATmega8U4 code loaded is well documented in the Arduino distribution. This is the command line I used:</p>
<pre class="brush: bash; title: ; notranslate">
cd /Applications/Arduino 1.0.app/Contents/Resources/Java/hardware/arduino/firmwares
../../tools/avr/bin/avrdude -C ../../tools/avr/etc/avrdude.conf \
    -p at90usb82 -F -P usb -c avrispmkii -U flash:w:UNO-dfu_and_usbserial_combined.hex \
    -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xF4:m -U lock:w:0x0F:m
</pre>
<p>I used the <a href="https://github.com/maniacbug/mighty-1284p" title="Mighty 1284P Platform Files" target="_blank">Mighty 1284P Platform Files</a> to load the bootloader onto the ATmega1284P chip and to build the blinky sketch. I also had to translate from the Mighty 1284P pinout to the *uino-1284p pinout in order to get lights to blink. But all went flawless and now I have blinky lights.</p>
<p>What&#8217;s next?</p>
<ul>
<li>Create pins_arduino.h for each board to reflect the proper pinout</li>
<li>Create the hardware support files and documentation for each board</li>
<li>Create a shield to put each board through its paces to verify digital I/O, analog inputs and PWM outputs.</li>
</ul>
<p>If you have some spare ATmega8U2, ATmega1284P, or ATmega32U4 itching to be put to use, and are willing to experiment with an unproven board, I am now comfortable making blank boards available.<br />
<div id="attachment_670" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-uino-32u4-uino-1284p-alive" href="http://adis.ca/wp-live/wp-content/uploads/2012/02/uino-1284p_v0.3_assembled_a.jpg"><img src="http://adis.ca/wp-live/wp-content/uploads/2012/02/uino-1284p_v0.3_assembled_a-150x150.jpg" alt="The *uino-1284p assembled" title="uino-1284p_v0.3_assembled_a" width="150" height="150" class="size-thumbnail wp-image-670" /></a><p class="wp-caption-text">The *uino-1284p assembled</p></div><br />
<br clear="all" /><br />
<div id="attachment_669" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-uino-32u4-uino-1284p-alive" href="http://adis.ca/wp-live/wp-content/uploads/2012/02/uino-32u4_v0.8a_assembled.jpg"><img src="http://adis.ca/wp-live/wp-content/uploads/2012/02/uino-32u4_v0.8a_assembled-150x150.jpg" alt="The *uino-32u4 assembled" title="uino-32u4_v0.8a_assembled" width="150" height="150" class="size-thumbnail wp-image-669" /></a><p class="wp-caption-text">The *uino-32u4 assembled</p></div></p>
]]></content:encoded>
			<wfw:commentRss>http://adis.ca/post/uino-32u4-uino-1284p-alive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add a Filetype to &#8220;Open With&#8221;</title>
		<link>http://adis.ca/post/add-filetype-open-with/</link>
		<comments>http://adis.ca/post/add-filetype-open-with/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 18:23:14 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Vim]]></category>

		<guid isPermaLink="false">http://adis.ca/?p=634</guid>
		<description><![CDATA[<p>The problem: I like MacVim with syntax highlighting for all major programming tasks. MacVim is pretty good at adding itself as an application to most filetypes I would use it for &#8211; until I installed Arduino and MPIDE. Since MPIDE is based on Arduino pre-1.0 it used the .pde file extension. Arduino 1.0 uses the <p><a href="http://adis.ca/post/add-filetype-open-with/">Read more ... &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p><strong>The problem:</strong> I like <a href="http://macvim.org/OSX/index.php" title="MacVim" target="_blank">MacVim</a> with syntax highlighting for all major programming tasks. MacVim is pretty good at adding itself as an application to most filetypes I would use it for &#8211; until I installed <a href="http://arduino.cc" title="Arduino" target="_blank">Arduino</a> and <a href="http://www.chipkit.cc/wiki/index.php?title=MPIDE_Installation" title="MPIDE" target="_blank">MPIDE</a>. Since <a href="http://www.chipkit.cc/wiki/index.php?title=MPIDE_Installation" title="MPIDE" target="_blank">MPIDE</a> is based on Arduino pre-1.0 it used the .pde file extension. <a href="http://arduino.cc" title="Arduino" target="_blank">Arduino</a> 1.0 uses the .ino file extension. <img src="http://adis.ca/wp-live/wp-content/uploads/2012/01/vim.gif" alt="vim" title="vim" width="125" height="60" class="alignleft size-full wp-image-637" /> While MacVim has no issues opening either file, it knows nothing about the file extensions. To open .ino and .pde files using MacVim I had to right-click (or CTRL-click), select &#8220;Open With&#8221;, then &#8220;Others&#8230;&#8221; and scroll down the long list of apps until finally arriving at MacVim. I did not want MacVim to be the default app for these files, just a quick and convenient way to open the files using the &#8220;Open With&#8221; menu, but without scrolling down the list. I made MacVim the default app, hoping it would populate the preferred list, then removed it. No such luck, but read on for the solution <span id="more-634"></span></p>
<p><strong>The quest:</strong> The list of extensions associated with an application are defined in the info.plist file in the applications package. At first I thought the easy way would have been to add the .ino and .pde file extensions to the info.plist file of the MacVim application. Just add it to the same &#8220;CFBundleTypeExtensions&#8221; container as other like file extensions. I did this by adding .ino and .pde extensions wherever .cpp was referenced. But this accomplished nothing. Searching on Google I discovered that one must reset the Launch Services Database using the &#8220;lsregister&#8221; utility. Even that did not cause MacVim to be visible in the &#8220;Open With&#8221; menu for .pde and .ino files. I then looked at how .ino was defined in the Arduino apps info.plist file. I noticed some very significant differences between the statements for MacVim and Arduino. Looking up terms such a &#8220;LSItemContentTypes&#8221; and &#8220;CFBundleTypeMIMETypes&#8221; in Google I discovered that there are different methods by which filetypes are registered with the system. I came across this <a href="http://lists.apple.com/archives/Carbon-dev/2005/Oct/msg00184.html" title="Re: UTI declarations vs. CFBundleDocumentTypes" target="_blank">post</a> in a Google search result for &#8220;LSItemContentTypes&#8221;. Convinced I did it wrong, I restored my modified info.plist for MacVim to virgin condition.</p>
<p><strong>The solution:</strong> I copied the &#8220;CFBundleTypeExtensions&#8221; container for the .ino extension from the info.plist file of the Arduino application. I then modified it for .ino and .pde and nothing else.</p>
<pre class="brush: xml; title: ; notranslate">
		&lt;dict&gt;
			&lt;key&gt;CFBundleTypeExtensions&lt;/key&gt;
			&lt;array&gt;
				&lt;string&gt;ino&lt;/string&gt;
				&lt;string&gt;pde&lt;/string&gt;
			&lt;/array&gt;
			&lt;key&gt;CFBundleTypeIconFile&lt;/key&gt;
			&lt;string&gt;pde.icns&lt;/string&gt;
			&lt;key&gt;CFBundleTypeName&lt;/key&gt;
			&lt;string&gt;Arduino Source File&lt;/string&gt;
			&lt;key&gt;CFBundleTypeMIMETypes&lt;/key&gt;
			&lt;array&gt;
				&lt;string&gt;text/plain&lt;/string&gt;
			&lt;/array&gt;
			&lt;key&gt;CFBundleTypeOSTypes&lt;/key&gt;
			&lt;array&gt;
				&lt;string&gt;TEXT&lt;/string&gt;
			&lt;/array&gt;
			&lt;key&gt;CFBundleTypeRole&lt;/key&gt;
			&lt;string&gt;Editor&lt;/string&gt;
		&lt;/dict&gt;
</pre>
<p>I opened the info.plist file for the MacVim application and inserted the above code right below:</p>
<pre class="brush: xml; title: ; notranslate">
  	&lt;key&gt;CFBundleDocumentTypes&lt;/key&gt;
	&lt;array&gt;
</pre>
<p>Upon saving the file I then reset the Launch Services Database.</p>
<pre class="brush: plain; title: ; notranslate">
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -seed -r</pre>
<p><a rel="lightbox" href="http://adis.ca/wp-live/wp-content/uploads/2012/01/Open-With.png"><img src="http://adis.ca/wp-live/wp-content/uploads/2012/01/Open-With-300x209.png" alt="" title="Open-With" width="300" height="209" class="alignright size-medium wp-image-649" /></a>Voila! We have MacVim as a preferred application in the &#8220;Open With&#8221; menu&#8230;</p>
<p>Just one last note, this has all been done on OS X Snow Leopard, 10.6.8.</p>
]]></content:encoded>
			<wfw:commentRss>http://adis.ca/post/add-filetype-open-with/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yet Another *uino-1284p</title>
		<link>http://adis.ca/post/another-uio-1284p/</link>
		<comments>http://adis.ca/post/another-uio-1284p/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 05:42:16 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[AVR]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[OpenSource]]></category>

		<guid isPermaLink="false">http://adis.ca/?p=623</guid>
		<description><![CDATA[<p><p class="wp-caption-text">The *uino-1284p v0.2 PCB Top</p> Today I received more *uino-1284p boards. The other day I already received *uino-1284p boards. Those boards were version 0.3 boards. The boards received today are the predecessor, version 0.2. I have been discussing my ATmega1284p ideas on the Arduino Forum. I had thought that what I accomplished with this <p><a href="http://adis.ca/post/another-uio-1284p/">Read more ... &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_626" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-another-uino-1284p" href="http://adis.ca/wp-live/wp-content/uploads/2012/01/uino-1284p-v0.2-top.jpg"><img src="http://adis.ca/wp-live/wp-content/uploads/2012/01/uino-1284p-v0.2-top-150x150.jpg" alt="The *uino-1284p v0.2 PCB Top" title="The *uino-1284p v0.2 PCB Top" width="150" height="150" class="size-thumbnail wp-image-626" /></a><p class="wp-caption-text">The *uino-1284p v0.2 PCB Top</p></div><br />
Today I received more *uino-1284p boards. The other day I already received <a href="http://adis.ca/post/uino-1284p-arrived/" title="The *uino-1284p Has Arrived">*uino-1284p</a> boards. Those boards were version 0.3 boards. The boards received today are the predecessor, version 0.2. I have been discussing my ATmega1284p ideas on the <a href="http://arduino.cc/forum/index.php/topic,61126.msg638416.html#msg638416" title="Arduino Forum">Arduino Forum</a>. I had thought that what I accomplished with this board would be sufficient. But then a forum member pointed out that it would be really nice if the additional ATmega1284p I/O pins not mapped to Arduino compatible headers would also be available. While I had this version already committed to being made, I decided to revise the board. The revision went rather easy and I took that chance to order it as well. So now I have two different sets of these boards on hand.<br />
<span id="more-623"></span><br />
Today I also received a small box of parts from DigiKey. The arrival of some ATmega1284p, ATmega8U2 and also ATmega32U4. Next step is to get some boards assembled. At least one of each to make sure things actually work. And if I am sufficiently satisfied that there are no gross errors I will pass some on to adventurous souls willing to sacrifice their parts on these creations&#8230;<br />
<br clear="all" /><br />
<div id="attachment_624" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-another-uino-1284p" href="http://adis.ca/wp-live/wp-content/uploads/2012/01/uino-1284p-v0.2-bottom.jpg"><img src="http://adis.ca/wp-live/wp-content/uploads/2012/01/uino-1284p-v0.2-bottom-150x150.jpg" alt="The *uino-1284p v0.2 PCB Bottom" title="The *uino-1284p v0.2 PCB Bottom" width="150" height="150" class="size-thumbnail wp-image-624" /></a><p class="wp-caption-text">The *uino-1284p v0.2 PCB Bottom</p></div><br />
<br clear="all" /><br />
<div id="attachment_625" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-another-uino-1284p" href="http://adis.ca/wp-live/wp-content/uploads/2012/01/uino-1284p-v0.2-brd.gif"><img src="http://adis.ca/wp-live/wp-content/uploads/2012/01/uino-1284p-v0.2-brd-150x150.gif" alt="The *uino-1284p v0.2 Board" title="The *uino-1284p v0.2 Board" width="150" height="150" class="size-thumbnail wp-image-625" /></a><p class="wp-caption-text">The *uino-1284p v0.2 Board</p></div></p>
]]></content:encoded>
			<wfw:commentRss>http://adis.ca/post/another-uio-1284p/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The *uino-1284p Has Arrived</title>
		<link>http://adis.ca/post/uino-1284p-arrived/</link>
		<comments>http://adis.ca/post/uino-1284p-arrived/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 01:15:10 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[AVR]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[OpenSource]]></category>

		<guid isPermaLink="false">http://adis.ca/?p=607</guid>
		<description><![CDATA[<p><p class="wp-caption-text">The *uino-1284p v0.3 PCB Top</p> Here it is! The *uino-1284p has arrived. It is an Arduino compatible platform based on the ATmega1284P-AU. The *uino-1284p board utilizes the ATmega1284P microcontroller. The primary goal of this project is to be able to access more memory, FLASH and RAM, while keeping the Arduino UNO compatible board size <p><a href="http://adis.ca/post/uino-1284p-arrived/">Read more ... &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_614" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-uino-1284p-arrived" href="http://adis.ca/wp-live/wp-content/uploads/2012/01/uino-1284p-v0.3-top.jpg"><img src="http://adis.ca/wp-live/wp-content/uploads/2012/01/uino-1284p-v0.3-top-150x150.jpg" alt="The *uino-1284p v0.3 PCB Top" title="The *uino-1284p v0.3 PCB Top" width="150" height="150" class="size-thumbnail wp-image-614" /></a><p class="wp-caption-text">The *uino-1284p v0.3 PCB Top</p></div> Here it is! The *uino-1284p has arrived. It is an Arduino compatible platform based on the ATmega1284P-AU. The *uino-1284p board utilizes the ATmega1284P microcontroller. The primary goal of this project is to be able to access more memory, FLASH and RAM, while keeping the Arduino UNO compatible board size and I/O assignments.</p>
<p>The ATmega1284P provides 128k of FLASH and 16k of RAM. It has 10 more I/O pins then the ATmega328P. The additional I/O pins are brought out to a 5&#215;2 header in a non-standard Arduino position. All other I/O headers are in the locations one would expect from an Arduino compatible form factor. The design features a dedicated ATmega8U2 for USB connectivity. The circuit has been taken from the Arduino UNO but the TQFP-32 package was chosen for easy solderability. Power supply input for the board is selected via a jumper. Power supply options are USB bus powered or unregulated DC input. An onboard LDO regulator will accept an unregulated input voltage between 6.4V and 15V.<br />
<span id="more-607"></span><br />
The source files for this project are on <a href="https://github.com/adilinden/uino-1284p" title="Github - adilinden / uino-1284p " target="_blank">Github</a>.</p>
<p>A note on the licensing of the hardware design, this work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License, CC BY-SA. You are free to copy, distribute and transmit the work. You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work). you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.  </p>
<p>Please refer to <a href="http://creativecommons.org/licenses/by-sa/3.0/" title="BY SA 3.0" target="_blank">http://creativecommons.org/licenses/by-sa/3.0/</a> for the license.<br />

<a href='http://adis.ca/post/uino-1284p-arrived/uino-1284p-v0-3-bottom/' title='The *uino-1284p v0.3 PCB Bottom'><img width="150" height="150" src="http://adis.ca/wp-live/wp-content/uploads/2012/01/uino-1284p-v0.3-bottom-150x150.jpg" class="attachment-thumbnail" alt="The *uino-1284p v0.3 PCB Bottom" title="The *uino-1284p v0.3 PCB Bottom" /></a>
<a href='http://adis.ca/post/uino-1284p-arrived/uino-1284p-v0-3-brd/' title='The *uino-1284p v0.3 Board'><img width="150" height="150" src="http://adis.ca/wp-live/wp-content/uploads/2012/01/uino-1284p-v0.3-brd-150x150.png" class="attachment-thumbnail" alt="The *uino-1284p v0.3 Board" title="The *uino-1284p v0.3 Board" /></a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://adis.ca/post/uino-1284p-arrived/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>The *uino-32u4 Has Arrived</title>
		<link>http://adis.ca/post/uino-32u4-arrived/</link>
		<comments>http://adis.ca/post/uino-32u4-arrived/#comments</comments>
		<pubDate>Sat, 14 Jan 2012 03:59:06 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[AVR]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[OpenSource]]></category>

		<guid isPermaLink="false">http://adis.ca/?p=502</guid>
		<description><![CDATA[<p class="wp-caption-text">The *uino-32u4 Circuit Board Order</p> <p>I have already written about the ATmega32U4 based *uino-32u4 I&#8217;ve created. Today I received the circuit board order. The order was placed with Seeed Studio&#8217;s Fusion PCB Service on December 24, 2011 and arrived at my door on January 13, 2012. I am impressed, at the speedy service and <p><a href="http://adis.ca/post/uino-32u4-arrived/">Read more ... &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<div id="attachment_532" class="wp-caption alignleft" style="width: 160px"><a href="http://adis.ca/wp-live/wp-content/uploads/2012/01/uino-32u4-0.8.a-deck.jpg" rel="lightbox-uino32u4-arrived"><img src="http://adis.ca/wp-live/wp-content/uploads/2012/01/uino-32u4-0.8.a-deck-150x150.jpg" alt="*uino-32u4 PCB Order" title="uino-32u4-0.8.a-deck" width="150" height="150" class="size-thumbnail wp-image-532" /></a><p class="wp-caption-text">The *uino-32u4 Circuit Board Order</p></div>
<p>I have already written about the ATmega32U4 based <a href="http://adis.ca/post/uino-32u4-born/" title="The *uino-32u4 Is Born">*uino-32u4</a> I&#8217;ve created. Today I received the circuit board order. The order was placed with <a href="http://seeedstudio.com/" title="Seeed Studio" target="_blank">Seeed Studio&#8217;s</a> <a href="http://www.seeedstudio.com/depot/fusion-pcb-service-p-835.html?cPath=185" title="Fusion PCB Service" target="_blank">Fusion PCB Service</a> on December 24, 2011 and arrived at my door on January 13, 2012. I am impressed, at the speedy service and the quality of the boards. So far this has been an all round awesome exerperience!</p>
<p>Unfortunately I do not have any ATmega32U4-AU on hand. Soldering things to the board, getting it fired up and programming it will have to wait a little while longer. But I am excited and happy for this to have become a real physical thing, not just a figment of my imagination.</p>
<p>And just in case anyone wonders, I should have used a better camera to take these pictures. There are some significant distortions present caused by the camera. The boards are true and square.<br />
<span id="more-502"></span><br />
<br style="clear:both;" /><br />
<div id="attachment_506" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-uino32u4-arrived" href="http://adis.ca/wp-live/wp-content/uploads/2012/01/uino-32u4-0.8.a-top.jpg"><img src="http://adis.ca/wp-live/wp-content/uploads/2012/01/uino-32u4-0.8.a-top-150x150.jpg" alt="*uino-32u4 PCB Top" title="uino-32u4-0.8.a-top" width="150" height="150" class="size-thumbnail wp-image-506" /></a><p class="wp-caption-text">The *uino-32u4 Circuit Board Top</p></div></p>
<div id="attachment_504" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-uino32u4-arrived" href="http://adis.ca/wp-live/wp-content/uploads/2012/01/uino-32u4-0.8.a-bot.jpg"><img src="http://adis.ca/wp-live/wp-content/uploads/2012/01/uino-32u4-0.8.a-bot-150x150.jpg" alt="*uino-32u4 PCB Bottom" title="uino-32u4-0.8.a-bot" width="150" height="150" class="size-thumbnail wp-image-504" /></a><p class="wp-caption-text">The *uino-32u4 Circuit Board Bottom</p></div>
<div id="attachment_344" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-uino32u4-arrived" href="http://adis.ca/wp-live/wp-content/uploads/2012/01/uino-32u4-brd.png"><img src="http://adis.ca/wp-live/wp-content/uploads/2012/01/uino-32u4-brd-150x150.png" alt="*uino-32u4" title="uino-32u4-brd" width="150" height="150" class="size-thumbnail wp-image-344" /></a><p class="wp-caption-text">*uino-32u4</p></div>
]]></content:encoded>
			<wfw:commentRss>http://adis.ca/post/uino-32u4-arrived/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Search engine optimization (SEO) and Permalinks</title>
		<link>http://adis.ca/post/seo-and-permalinks/</link>
		<comments>http://adis.ca/post/seo-and-permalinks/#comments</comments>
		<pubDate>Sat, 14 Jan 2012 02:50:30 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Sysadmin]]></category>

		<guid isPermaLink="false">http://adis.ca/?p=489</guid>
		<description><![CDATA[<p>When I first setup WordPress (many years ago) I immediately turned on permalinks. Having a pretty URL is important. But I did not give it much consideration at the the time and the /year%/%month%/%day%/%postname%/ format seemed quite reasonable. After a short time I realized that a hierarchy nested this deep is way overkill. But by <p><a href="http://adis.ca/post/seo-and-permalinks/">Read more ... &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>When I first setup WordPress (many years ago) I immediately turned on permalinks. Having a pretty URL is important. But I did not give it much consideration at the the time and the <code>/year%/%month%/%day%/%postname%/</code> format seemed quite reasonable. After a short time I realized that a hierarchy nested this deep is way overkill. But by that time Google had indexed the site and I didn&#8217;t want to mess that up. With all the renovations I have been doing the permalink configuration once again grabbed my attention. To make matters worse I also began reading about search engine optimization (SEO) and the significance of the URL.<br />
<span id="more-489"></span><br />
The most prominent recommendation I&#8217;ve come across is to not use a hierarchy at all but to simply use <code>/%postname%/</code> and nothing else. But this configuration comes with potential performance issues (that apparently have been resolved as of WordPress 3.3) and potential for duplicates. While the performance issue are probably not going to be much of a concern for my small site, the issue of duplicate posts and pages sure is. I decided to settle on a happy medium. I have replaced the <code>/%year%/%month%/%day%/%postname%/</code> hierarchy with <code>/post/%postname%/</code>. I also decided to replace the category archive with a topic archive.</p>
<p>While this is really easy to do in the permalinks settings in WordPress, it still left me with a site of essentially stale links. Anyone that linked to my site prior to day will get 404 errors. That is certainly not desirable. To deal with the issue, here comes mod_rewrite to the rescue. I added the following rewrite rules to the <code>.htaccess</code> file.<br />
<pre>
&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteBase /

# Allow short URL using /post/%post-id%
#RewriteRule ^post/([0-9]+)/?$ index.php?p=$1 [L]

# Rewite legacy /%year%/%month%/%day%/%postname%/ to new format
RewriteRule ^[0-9]+/[0-9]+/[0-9]+/([^/]+)/? post/$1/ [R=301,L]

# Rewrite legacy /category/%category-name%/ to new format
RewriteRule ^category/([^/]+)/? topic/$1/ [R=301,L]

&lt;/IfModule&gt;
</pre></p>
<p>I purposely did not add these statements to the existing WordPress permalinks rewrite block. WordPress is kind enough to only alter the portions of <code>.htaccess</code> that it created. It will not alter any statements outside of the <code># BEGIN WordPress</code> and <code># END WordPress</code> block.</p>
<p>I also tested a rewrite rule that allows accessing posts by their numeric post ID. I am not sure what I could do with it just yet. Maybe a link to be able to copy really short URL to emails and forum posts? I don&#8217;t know, but it works&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://adis.ca/post/seo-and-permalinks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding AddIt Buttons to Atahualpa</title>
		<link>http://adis.ca/post/adding-addit-buttons-to-atahualpa/</link>
		<comments>http://adis.ca/post/adding-addit-buttons-to-atahualpa/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 07:29:12 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://adis.ca/?p=480</guid>
		<description><![CDATA[<p>I am using the Atahualpa theme for WordPress. It is just amazing how easy it is to customize anything. My latest adventure in WordPress has been the quest to add social networking buttons. I tried several WordPress plugins, such as Sociable, ShareThis, and AddThis, none of which I really liked. The feature I missed the <p><a href="http://adis.ca/post/adding-addit-buttons-to-atahualpa/">Read more ... &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I am using the <a href="http://wordpress.bytesforall.com/category/wordpress-themes/atahualpa-wordpress-themes/" title="Atahualpa" target="_blank">Atahualpa</a> theme for WordPress. It is just amazing how easy it is to customize anything. My latest adventure in WordPress has been the quest to add social networking buttons. I tried several WordPress plugins, such as <a href="http://wordpress.org/extend/plugins/sociable/" title="WordPress Sociable Plugin" target="_blank">Sociable</a>, <a href="http://wordpress.org/extend/plugins/share-this/" title="WordPress ShareThis Plugin" target="_blank">ShareThis</a>, and <a href="http://wordpress.org/extend/plugins/addthis/" title="WordPress AddThis Plugin" target="_blank">AddThis</a>, none of which I really liked. The feature I missed the most was being able to have more then one style in different areas of the site. Instead I signed up with <a href="http://www.addthis.com" title="AddThis" target="_blank">AddThis</a> direct and used their custom code directly in the theme.<br />
<span id="more-480"></span><br />
The first task is to get the java portion of the AddThis code loaded only once. Since the buttons will appear multiple times on pages with multiple posts it would be rather inefficient to call the java script 10 or more time in a single page. Navigate to <em>Appearance &gt; Atahualpa Theme Options &gt; Add HTML/CSS Inserts</em> and place the AddIt java code in the <em>HTML Inserts: Header</em> field.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot; src=&quot;http://s7.addthis.com/js/250/addthis_widget.js#pubid=[your addthis id]&quot;&gt;&lt;/script&gt;
</pre>
<p>To have the AddIt buttons show in the post footers of the homepage and multi post pages navigate to the <em>Appearance &gt; Atahualpa Theme Options &gt; Edit POST/PAGE INFO ITEMS</em> area and add the AddIt buttons to the <em>FOOTER: Homepage</em> and <em>FOOTER: Multi Post Pages</em> boxes.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div class=&quot;addthis_toolbox addthis_default_style &quot; style=&quot;float: right;&quot;&gt;
&lt;a class=&quot;addthis_button_facebook&quot; addthis:url=&quot;%permalink%&quot;&gt;&lt;/a&gt;
&lt;a class=&quot;addthis_button_twitter&quot; addthis:url=&quot;%permalink%&quot;&gt;&lt;/a&gt;
&lt;a class=&quot;addthis_button_linkedin&quot; addthis:url=&quot;%permalink%&quot;&gt;&lt;/a&gt;
&lt;a class=&quot;addthis_button_compact&quot; addthis:url=&quot;%permalink%&quot;&gt;&lt;/a&gt;
&lt;/div&gt;
</pre>
<p>My desire was to have larger and more functional buttons on the single post pages. Unfortunately this requires altering the <em>index.php</em> file of the Atahualpa theme. Rather then place the AddIt code directly into the php file I choose to create a widget area between the post content and the post footer. This is the patch for the Atahualpa themes <em>index.php</em>:</p>
<pre class="brush: php; highlight: [7]; title: ; notranslate">
--- index.php.orig	2012-01-13 00:55:37.000000000 -0600
+++ index.php	2012-01-13 00:55:49.000000000 -0600
@@ -29,6 +29,7 @@
 		&lt;?php bfa_post_byline('&lt;div class=&quot;post-byline&quot;&gt;','&lt;/div&gt;'); ?&gt;
 		&lt;?php bfa_post_bodycopy('&lt;div class=&quot;post-bodycopy clearfix&quot;&gt;','&lt;/div&gt;'); ?&gt;
 		&lt;?php bfa_post_pagination('&lt;p class=&quot;post-pagination&quot;&gt;&lt;strong&gt;'.__('Pages:','atahualpa').'&lt;/strong&gt;','&lt;/p&gt;'); ?&gt;
+		&lt;?php if (is_single()) bfa_widget_area('name=Single Post Socialize'); ?&gt;
 		&lt;?php bfa_post_footer('&lt;div class=&quot;post-footer&quot;&gt;','&lt;/div&gt;'); ?&gt;
 		&lt;/div&gt;&lt;!-- / Post --&gt;
</pre>
<p>This will result in a widget becoming available in the <em>Appearance &gt; Widgets</em> configuration section. Place a new <emText</em> widget in the <em>Single Post Socialize</em> widget are and populate it with AddIt buttons:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div class=&quot;addthis_toolbox addthis_default_style addthis_32x32_style&quot; style=&quot;padding-bottom: 10px !important;&quot;&gt;
&lt;a class=&quot;addthis_button_facebook&quot;&gt;&lt;/a&gt;
&lt;a class=&quot;addthis_button_twitter&quot;&gt;&lt;/a&gt;
&lt;a class=&quot;addthis_button_preferred_1&quot;&gt;&lt;/a&gt;
&lt;a class=&quot;addthis_button_compact&quot;&gt;&lt;/a&gt;
&lt;a class=&quot;addthis_counter addthis_bubble_style&quot;&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;addthis_toolbox addthis_default_style &quot;&gt;
&lt;a class=&quot;addthis_button_facebook_like&quot; fb:like:layout=&quot;button_count&quot;&gt;&lt;/a&gt;
&lt;a class=&quot;addthis_button_google_plusone&quot; g:plusone:size=&quot;medium&quot;&gt;&lt;/a&gt;
&lt;/div&gt;
</pre>
<p>The results of all of this you can examine right on this site&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://adis.ca/post/adding-addit-buttons-to-atahualpa/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bulk Change WordPress Posts</title>
		<link>http://adis.ca/post/bulk-change-wordpress-posts/</link>
		<comments>http://adis.ca/post/bulk-change-wordpress-posts/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 03:02:11 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://adis.ca/?p=471</guid>
		<description><![CDATA[<p>I found myself in a predicament. I wanted to improve the way code is displayed here and went searching for something with line numbering and syntax highlighting. The SyntaxHighlighter Evolved plugin seemed perfect. I liked it but it really messed with my existing content wrapped in &#60;code&#62; tags. Trying to fix the issue I discovered <p><a href="http://adis.ca/post/bulk-change-wordpress-posts/">Read more ... &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I found myself in a predicament. I wanted to improve the way code is displayed here and went searching for something with line numbering and syntax highlighting. The <a href="http://wordpress.org/extend/plugins/syntaxhighlighter/" title="SyntaxHighlighter Evolved" target="_blank">SyntaxHighlighter Evolved</a> plugin seemed perfect. I liked it but it really messed with my existing content wrapped in &lt;code&gt; tags. Trying to fix the issue I discovered that my <a href="http://adis.ca/2011/02/18/pretty-code-block-in-css/" title="Pretty Code Block in CSS" target="_blank">stylesheet</a> did not play nice with the plugin. In addition, all multiline &lt;code&gt; really should have been wrapped in &lt;pre&gt; instead.</p>
<p>I was faced with the daunting task of a search and replace mission. I wanted to replace all &lt;code&gt; tage with &lt;pre&gt; tags and all &lt;/code&gt; tage with &lt;/pre&gt; tags. Not all that fond of mundane slave labor I figured out how to run some sql command on the WordPress tables. I strongly recommend backing up ones database before manually manipulating the WordPress database. It doesn&#8217;t take much of a typo to really mess up the content. In fact, I tried all of it on test installation just to be sure all will work well.</p>
<p>Here are the two statements that did the trick for me, it did the search and replace quite swiftly.</p>
<pre class="brush: sql; title: ; notranslate">
update wp_posts set post_content = replace (post_content,'&lt;code&gt;','&lt;pre&gt;');
update wp_posts set post_content = replace (post_content,'&lt;/code&gt;','&lt;/pre&gt;');
</pre>
]]></content:encoded>
			<wfw:commentRss>http://adis.ca/post/bulk-change-wordpress-posts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bulk Modifying of Static HTML</title>
		<link>http://adis.ca/post/bulk-modifying-of-static-html/</link>
		<comments>http://adis.ca/post/bulk-modifying-of-static-html/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 16:26:36 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Shell]]></category>

		<guid isPermaLink="false">http://adis.ca/?p=451</guid>
		<description><![CDATA[<p>While relocating the PeeWeeLinux web site I found myself needing to make bulk changes to a some 1800 static HTML pages. I had to insert a new HTML tag before the &#8220;head&#8221; tag on each page.</p> <p>The search and replace workhorse in this method is &#8220;sed&#8221;, the Unix stream editor. I created the following shell <p><a href="http://adis.ca/post/bulk-modifying-of-static-html/">Read more ... &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>While relocating the <a href="http://peeweelinux.adis.ca/" title="PeeWeeLinux" target="_blank">PeeWeeLinux web site</a> I found myself needing to make bulk changes to a some 1800 static HTML pages. I had to insert a new HTML tag before the &#8220;head&#8221; tag on each page.</p>
<p>The search and replace workhorse in this method is &#8220;sed&#8221;, the Unix stream editor. <span id="more-451"></span>I created the following shell script &#8220;sed.sh&#8221; in the root directory of the HTML content:</p>
<pre class="brush: bash; title: ; notranslate">
sed '/&lt;\/HEAD/ i\
        &lt;!-- Inserted_before_closing_head_tag --&gt;
        ' $1 &gt; tmp.txt
cat tmp.txt &gt; $1
</pre>
<p>In order to apply these changes to each and every HTML file the following &#8220;find&#8221; command was executed:</p>
<pre class="brush: bash; title: ; notranslate">
find . -name '*.html' -exec sh sed.sh {} \;
</pre>
<p>And &#8220;voilà&#8221;, all HTML files in the web directory now have a shiny new line with a HTML comment. A final step is to cleanup the temporary files created:</p>
<pre class="brush: bash; title: ; notranslate">
rm sed.sh tmp.txt
</pre>
<p>On a side note, PeeWeeLinux is pretty outdated and has not seen any development in a long long time. However, I do still want to keep the web site and files alive, even if just for historic purposes. Not so long ago I have used <a href="http://www.emdebian.org" title="Embedded Debian" target="_blank">Embedded Debian</a> for a Compact Flash based system. It works quite well.</p>
]]></content:encoded>
			<wfw:commentRss>http://adis.ca/post/bulk-modifying-of-static-html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino Duemilanove</title>
		<link>http://adis.ca/post/arduino-duemilanove/</link>
		<comments>http://adis.ca/post/arduino-duemilanove/#comments</comments>
		<pubDate>Sun, 08 Jan 2012 05:53:19 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[AVR]]></category>

		<guid isPermaLink="false">http://www.adis.ca/?p=403</guid>
		<description><![CDATA[<p> For some reason I had an ATmega168 and an ATmega328 sitting in my parts bins. To put them to use a couple bare PCB were ordered from a Chinese vendor on eBay. The boards I received were in superb condition. Most surface mount components were 0805 size, except for the FDTI chip of course.</p> <p><a href="http://adis.ca/post/arduino-duemilanove/">Read more ... &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="/wp-live/wp-content/uploads/2012/01/Duemilanove_1.jpg" rel="lightbox-yik8Aefo"><img src="/wp-live/wp-content/uploads/2012/01/Duemilanove_1-150x150.jpg" alt="Assembled Arduino Duemilanove" title="Assembled Arduino Duemilanove" width="150" height="150" class="alignright size-thumbnail wp-image-404" /></a><br />
For some reason I had an ATmega168 and an ATmega328 sitting in my parts bins. To put them to use a couple bare PCB were ordered from a Chinese vendor on eBay. The boards I received were in superb condition. Most surface mount components were 0805 size, except for the FDTI chip of course.</p>
<p>The first component placed was the FTDI chip. It was soldered using the drag and wick method using my old rosin core solder. Since placing these I have received some new tips for my trusty Weller WTCP. I also acquired some no clean flux and solder. I am hoping to eliminate the wick when soldering SMD. The remainder of the SMD components were easily placed using the magnifier I received for Christmas. I can place 0805 components without magnifier but having the light and magnifications is much less strain on the eyes. The magnifier lamp also helps to place components accurately and nicely lined up. I choose to power the board strictly via USB. Therefore none of the regulator parts or power switching parts were populated. Just a small wire to permanently connect VUSB to VCC was needed to always power via USB.<br />
<span id="more-403"></span><br />
I used the AVRISP mkII to burn the bootloader into the ATmega168 and ATmega328. I thought performing this function via the Arduino environment would be easy. The first attempt with the ATmega168 went flawless. However, when I went to program the ATmega328 some errors were printed and the programming aborted. After some digging around the <a href="http://arduino.cc/forum/" title="Arduino Forum" target="_blank">Arduino Forum</a> I discovered that the Arduino Duemilanove used the ATmega328P, not the ATmega328. When attempting to program the chip I had reported a device ID that differed from what was expected. Fortunately I found the instruction to modify the Arduino environment to allow using the ATmega328. Unfortunately I did not make any notes on the process.</p>
<p>I do not like having bare boards laying around. Especially not once an Arduino has some shields stacked on it. The quest for an enclosure began. It didn&#8217;t take long and I realized that these board could fit nicely into small Lock&#8217;n'Lock containers. They are in plenty supply in the Walmart food storage container isle. The plastic is very easily drilled or cut. Perfect to keep these boards safe from children and pets.</p>

<a href='http://adis.ca/post/arduino-duemilanove/duemilanove_2/' title='Duemilanove USB Access'><img width="150" height="150" src="http://adis.ca/wp-live/wp-content/uploads/2012/01/Duemilanove_2-150x150.jpg" class="attachment-thumbnail" alt="Duemilanove USB Access" title="Duemilanove USB Access" /></a>
<a href='http://adis.ca/post/arduino-duemilanove/duemilanove_3/' title='Duemilanove in Lock&#039;n&#039;Lock'><img width="150" height="150" src="http://adis.ca/wp-live/wp-content/uploads/2012/01/Duemilanove_3-150x150.jpg" class="attachment-thumbnail" alt="Duemilanove in Lock&#039;n&#039;Lock" title="Duemilanove in Lock&#039;n&#039;Lock" /></a>
<a href='http://adis.ca/post/arduino-duemilanove/locknlock/' title='Lock&#039;n&#039;Lock'><img width="150" height="150" src="http://adis.ca/wp-live/wp-content/uploads/2012/01/LocknLock-150x150.jpg" class="attachment-thumbnail" alt="Lock&#039;n&#039;Lock" title="Lock&#039;n&#039;Lock" /></a>

]]></content:encoded>
			<wfw:commentRss>http://adis.ca/post/arduino-duemilanove/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

