<?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>KludgeGuru's EEBlog</title>
	<atom:link href="http://ww2.kludgeguru.com/blogs/eeblog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://ww2.kludgeguru.com:8080/blogs/eeblog</link>
	<description>Electronic Engineering Projects Blog</description>
	<lastBuildDate>Fri, 09 Jul 2010 12:47:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Project: 3-Axis Talking Skull &#8211; Post #4 First Singing Test</title>
		<link>http://ww2.kludgeguru.com:8080/blogs/eeblog/?p=583</link>
		<comments>http://ww2.kludgeguru.com:8080/blogs/eeblog/?p=583#comments</comments>
		<pubDate>Mon, 14 Sep 2009 04:44:42 +0000</pubDate>
		<dc:creator>KludgeGuru</dc:creator>
				<category><![CDATA[Project:  3-Axis Talking Skull]]></category>

		<guid isPermaLink="false">http://ww2.kludgeguru.com:8080/blogs/eeblog/?p=583</guid>
		<description><![CDATA[Click here to see the entire 3-Axis Talking Skull Project.
Well after months I finally started working on this project again.  I figured since Halloween is only a month and a half away I&#8217;d better get it done.
Graveyard skulls have put together some good construction instructions here:

Motion Servo Assembly
Jaw Servo Mounting
Skull Plate Mounting
Mounting the Eye Kit
Hooking [...]]]></description>
			<content:encoded><![CDATA[<p>Click here to see the entire <a href="http://www.kludgeguru.com/blogs/eeblog/?cat=5">3-Axis Talking Skull Project.</a></p>
<p>Well after months I finally started working on this project again.  I figured since Halloween is only a month and a half away I&#8217;d better get it done.</p>
<p>Graveyard skulls have put together some good construction instructions here:</p>
<ul>
<li><a href="http://www.graveyardskulls.com/assembly/assembly1.html">Motion Servo Assembly</a></li>
<li><a href="http://www.graveyardskulls.com/assembly/assembly2.html">Jaw Servo Mounting</a></li>
<li><a href="http://www.graveyardskulls.com/assembly/assembly3.html">Skull Plate Mounting</a></li>
<li><a href="http://www.graveyardskulls.com/assembly/assembly5.html">Mounting the Eye Kit</a></li>
<li><a href="http://www.graveyardskulls.com/assembly/Tutorial01.html">Hooking up the SSC-32</a></li>
<li><a href="http://www.graveyardskulls.com/assembly/Tutorial02.html">VSA Programming 101</a></li>
</ul>
<p>They also added a new <a href="http://www.graveyardskulls.com/store/comersus_viewItem.asp?idProduct=65">Eye Kit</a> for the skulls which I may add next year.</p>
<p>OK, now on to my first singing test.  I found a cool pirate song called &#8220;<a href="http://www.archive.org/details/AmateurHour-PirateCopy"> I Once Wend Down to Kingston Town</a>&#8221; by Amateur Hour &#8211; Pirate Copy.  The great thing about this song is that it is Open Source and covered by the <a href="http://creativecommons.org/licenses/by-nc-sa/2.0/uk/"><span>Creative Commons license</span></a>.</p>
<p>As with most of the 3-Axis skull projects on the net I used <a href="http://www.brookshiresoftware.com/vsa_overview.htm">Brookshire Software VSA</a> (Visual Show Automation).  It costs about $60 which isn&#8217;t too bad.  It also has a demo version but it doesn&#8217;t allow you to save all your hard work.  I eventually will write my own program to interface with the Playstation 2 controller but I have slacked off too much this year and will have to do that next year.</p>
<p>Here is a video I posted on YouTube:</p>
<p style="text-align: center;"><br /><img src="http://i.ytimg.com/vi/x2LXfoDjYe4/0.jpg" alt="media" /><br />
</p>
]]></content:encoded>
			<wfw:commentRss>http://ww2.kludgeguru.com:8080/blogs/eeblog/?feed=rss2&amp;p=583</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<enclosure url="http://www.youtube.com/watch?v=x2LXfoDjYe4" length="1" type="application/unknown"/>
	</item>
		<item>
		<title>AVR JTAGICE mkII clone &#8211; Review (Final)</title>
		<link>http://ww2.kludgeguru.com:8080/blogs/eeblog/?p=570</link>
		<comments>http://ww2.kludgeguru.com:8080/blogs/eeblog/?p=570#comments</comments>
		<pubDate>Thu, 16 Apr 2009 12:00:04 +0000</pubDate>
		<dc:creator>KludgeGuru</dc:creator>
				<category><![CDATA[AVR]]></category>

		<guid isPermaLink="false">http://ww2.kludgeguru.com:8080/blogs/eeblog/?p=570</guid>
		<description><![CDATA[This is a followup review post from this one:  AVR JTAGICE mkII clone &#8211; Review which was a followup from this one:  AVR JTAGICE mkII clone
It&#8217;s been pretty quiet on the KludgeGuru front for a month while I impatiently waited for my AVR JTAGICE mkII clone to be returned from china.  If you didn&#8217;t read [...]]]></description>
			<content:encoded><![CDATA[<p>This is a followup review post from this one:  <a href="http://ww2.kludgeguru.com:8080/blogs/eeblog/?p=229">AVR JTAGICE mkII clone &#8211; Review</a> which was a followup from this one:  <a href="http://ww2.kludgeguru.com:8080/blogs/eeblog/?p=43">AVR JTAGICE mkII clone</a></p>
<p>It&#8217;s been pretty quiet on the KludgeGuru front for a month while I impatiently waited for my AVR JTAGICE mkII clone to be returned from china.  If you didn&#8217;t read the two posts linked to above the basic story is I purchased the clone and when I got it the debugging capabilities didn&#8217;t work.  So I returned it where they were able to repeat the error I was getting and instead of sending me a new one they shipped it back to the manufacturer in China and said it would be 3-4 weeks for repair.  11 weeks later I got it back&#8230;now that&#8217;s what you call great service.  <img src='http://ww2.kludgeguru.com:8080/blogs/eeblog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>Here is the timeline of my correspondance:</p>
<p>January 20th &#8211; I shipped the unit back</p>
<blockquote><p><strong>Vendor</strong> (January 23rd) &#8211; Hi, I tested your mkii clone and as you said, the debugging mode doesn&#8217;t work.  I will have to ship it to the manufacturer for a repair.  The whole process can take 3-4 weeks, as they are closed right now because of Chinese New Year celebration.</p>
<p><strong>Me </strong>(February 17th) &#8211; Do you have an update on when I can expect to have my mkII clone back?  It&#8217;s almost been 4 weeks.</p>
<p><strong> </strong><strong>Vendor </strong>(February 17th) &#8211; It was Chinese New Year Holidays and they started working at the end of last week.  It will take another 2-4 weeks.</p>
<p><strong>Me </strong>(March 16th) &#8211; It&#8217;s been another 4 weeks any news on the MKII clone?</p>
<p><strong>Vendor </strong>(March 16th) &#8211; I know&#8230; long delay.  Last week the manufacturer told me that they fixed the MKII clone, and I ordered some additional stuff to ship all together back to the US.  It should be here by the end of this week or beginning of next week.</p>
<p><strong>Me </strong>(March 27th) &#8211; It&#8217;s almost been another two weeks.  Do you have an update on this item?</p>
<p><strong>Vendor </strong>(March 28th) &#8211; I am starting to worry too&#8230; as I said, it was shipped more than 2 weeks ago with other items I purchased to them but I haven&#8217;t received anything yet.  If by the end of next week I don&#8217;t get the unit back from China, I will ship you a new unit.</p>
<p><strong>Vendor </strong>(April 1st) &#8211; I got the device back.</p>
<p><strong>Me </strong>(April 1st) &#8211; Did you happen to test the debugging to see if it works now?</p>
<p><strong>Vendor </strong>(April 1st) &#8211; I tested it and it works.</p>
</blockquote>
<p>April 8th &#8211; I finally received it!</p>
<p>The good news is the guy was nice and responded to my email quickly.  It just was a shame I had to wait 11 weeks to get a mkII clone when I received a defective product.  I still think that if you purchase something that doesn&#8217;t work the store should replace it with a new one that does work.</p>
<p>Also I tested the mkII clone and the debugging does work now.  I was using a friends JTAGICE for awhile but he needed it back so now I can finally continue working on my projects that I started a couple months!</p>
<p>UPDATE:  I can program micocontrollers using the JTAG interface but the SPI interface does not work&#8230;If I could go back I would have spent the extra money and purchased the real thing.</p>
]]></content:encoded>
			<wfw:commentRss>http://ww2.kludgeguru.com:8080/blogs/eeblog/?feed=rss2&amp;p=570</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Server Tips:  Personal FM Radio Station</title>
		<link>http://ww2.kludgeguru.com:8080/blogs/eeblog/?p=552</link>
		<comments>http://ww2.kludgeguru.com:8080/blogs/eeblog/?p=552#comments</comments>
		<pubDate>Wed, 11 Feb 2009 14:31:03 +0000</pubDate>
		<dc:creator>KludgeGuru</dc:creator>
				<category><![CDATA[Server Tips]]></category>

		<guid isPermaLink="false">http://www.kludgeguru.com/blogs/eeblog/?p=552</guid>
		<description><![CDATA[I have a fairly large MP3 collection and I wanted a way to listen to it anywhere in my house.  I thought about installing some sort of house stereo system with speakers in every room but that is a little difficult when the house has already been built.
In my Internet travels I ran across [...]]]></description>
			<content:encoded><![CDATA[<p>I have a fairly large MP3 collection and I wanted a way to listen to it anywhere in my house.  I thought about installing some sort of house stereo system with speakers in every room but that is a little difficult when the house has already been built.</p>
<p>In my Internet travels I ran across this neat little device called the <a href="http://www.wholehousefmtransmitter.com/">WholeHouseFMTransmitter</a>.  It is basically what it&#8217;s name says it is, an FM transmitter for the entire house.  With this device I connect it to my server&#8217;s audio output port and then just shuffle through my MP3 collection.  I then can tune to my own personal radio station using any FM stereo around the house or in the garage.  Actually I can receive my radio station within a block of my house while the transmitter is in my basement next to my big metal furnace.  I&#8217;ve thought about moving the transmitter to the attic to get a greater range but it works just fine where it is.</p>
<p>The transmitter is pretty small.  It&#8217;s measurements are 3 3/8&#8243; x 2 1/2&#8243; x 3/4&#8243;.  The front of the transmitter has a power button and some logo stuff.</p>
<p><a rel="thumbnail" href="http://www.kludgeguru.com/blogs/eeblog/wp-content/uploads/2009/02/wholehousefmtransmitter_front.jpg"><img class="aligncenter size-full wp-image-560" title="wholehousefmtransmitter_front-thumb" src="http://www.kludgeguru.com/blogs/eeblog/wp-content/uploads/2009/02/wholehousefmtransmitter_front-thumb.jpg" alt="wholehousefmtransmitter_front-thumb" width="120" height="157"></a></p>
<p>The power is supplied through a power jack on the side.  It uses 5VDC I couldn&#8217;t see any current rating on their website.  It has four different ways to power it, shown below.  I use the USB power adapter so it is power directly from my server.  The USB power adapter is retractable, I think it is only about 3-4 feet long which I think it should be longer but it works.</p>
<p><a rel="thumbnail" href="http://www.kludgeguru.com/blogs/eeblog/wp-content/uploads/2009/02/wholehousefmtransmitter_power.jpg"><img class="aligncenter size-full wp-image-562" title="wholehousefmtransmitter_power-thumb" src="http://www.kludgeguru.com/blogs/eeblog/wp-content/uploads/2009/02/wholehousefmtransmitter_power-thumb.jpg" alt="wholehousefmtransmitter_power-thumb" width="160" height="114" /></a></p>
<table style="width: 386px; height: 85px;" border="1" width="386" align="center" bordercolor="#ffffff">
<tbody>
<tr>
<td width="92" height="107" bordercolor="#000000">
<p align="center"><img title="Wall Outlet - (110/220V AC Power Supply)" src="http://www.wholehousefmtransmitter.com/product_thumb.php?img=images/110-220-v-ac-power-supply.gif&amp;w=75&amp;h=75" border="0" alt="Wall Outlet - (110/220V AC Power Supply)" hspace="3" vspace="3" width="75" height="75" /><br />
<span class="style189"><span style="font-size: xx-small;">Wall Outlet<br />
(110/220V AC)</span></span></td>
<td width="92" bordercolor="#000000">
<div><img title="Car Adapter - (12/ 24V DC Mobile Power Adapter)" src="http://www.wholehousefmtransmitter.com/product_thumb.php?img=images/12VMobileAdapter400.jpg&amp;w=75&amp;h=75" border="0" alt="Car Adapter - (12/ 24V DC Mobile Power Adapter)" hspace="3" vspace="3" width="75" height="75" /><br />
<span class="style189"><span style="font-size: xx-small;">Car Adapter<br />
(12/24V DC)</span></span></div>
</td>
<td width="92" bordercolor="#000000">
<div><img title="Computer USB Power Cable" src="http://www.wholehousefmtransmitter.com/product_thumb.php?img=images/USBPowerCable400.jpg&amp;w=75&amp;h=75" border="0" alt="Computer USB Power Cable" hspace="3" vspace="3" width="75" height="75" /><br />
<span class="style189"><span style="font-size: xx-small;">Computer USB Adapter</span><br />
</span></div>
</td>
<td width="92">
<div><span class="style189"><span style="font-size: xx-small;">Plus, batteries (takes 3 &#8220;AA&#8221; batteries and will run about 110 hours)</span></span></div>
</td>
</tr>
</tbody>
</table>
<p>The audio input is a 1/8&#8243; (3.5mm) headphone jack.  This is very nice since you can use about any audio source, such as output from computer, ipod or any MP3 player.</p>
<p><a rel="thumbnail" href="http://www.kludgeguru.com/blogs/eeblog/wp-content/uploads/2009/02/wholehousefmtransmitter_audioin.jpg"><img class="aligncenter size-full wp-image-554" title="wholehousefmtransmitter_audioin-thumb" src="http://www.kludgeguru.com/blogs/eeblog/wp-content/uploads/2009/02/wholehousefmtransmitter_audioin-thumb.jpg" alt="wholehousefmtransmitter_audioin-thumb" width="160" height="120" /></a></p>
<p>On the other side there is a set of three dip switches.  These are used to select the frequency or FM radio station the transmitter broadcasts on.  If you set the frequency to the same channel as a nearby radio station you wont get as good of performance.  You should set it to an unused channel between radio stations.</p>
<p><a rel="thumbnail" href="http://www.kludgeguru.com/blogs/eeblog/wp-content/uploads/2009/02/wholehousefmtransmitter_dipswitch.jpg"><img class="aligncenter size-full wp-image-558" title="wholehousefmtransmitter_dipswitch-thumb" src="http://www.kludgeguru.com/blogs/eeblog/wp-content/uploads/2009/02/wholehousefmtransmitter_dipswitch-thumb.jpg" alt="wholehousefmtransmitter_dipswitch-thumb" width="160" height="55" /></a></p>
<p>On the back of the transmitter is the channel selection guide.  This shows the dip switch positions to select the desired FM frequency or channel.</p>
<p><a rel="thumbnail" href="http://www.kludgeguru.com/blogs/eeblog/wp-content/uploads/2009/02/wholehousefmtransmitter_channelselect.jpg"><img class="aligncenter size-full wp-image-556" title="wholehousefmtransmitter_channelselect-thumb" src="http://www.kludgeguru.com/blogs/eeblog/wp-content/uploads/2009/02/wholehousefmtransmitter_channelselect-thumb.jpg" alt="wholehousefmtransmitter_channelselect-thumb" width="160" height="118" /></a></p>
<p>So I&#8217;ve got this hooked up to my server computer.  I&#8217;ve set my server to automatically start my favorite MP3 player software <a href="http://www.winamp.com/">Winamp</a> when windows loads.  The only problem I found was that after running constantly for a couple days Winamp would tend to freeze causing the MP3 currently being played to do a 1 second loop which sounds terrible.  To solve this I decided to restart my computer every night.  Being a big fan of batch files I created a batch file to restart my computer.  My batch file only contains one line:</p>
<blockquote><p>shutdown /r /t 60 /f /c &#8220;Restarting for daily reboot&#8230;&#8221;</p>
</blockquote>
<p>The flags I used are as follows:</p>
<ul>
<li>/r  -  Shutdown and restart the computer</li>
<li>/t xxx  -   Set the time0out period before shutdown to xxx seconds.  The valid range is 0-600, with a default of 30.</li>
<li>/f  -  Force running applications to close without forewarning users.  (The /t flag also implies the /f flag but I put it in anyway just for kicks)</li>
<li>/c &#8220;comment&#8221;  -  Coments on the reason for the restart or shutdown.</li>
</ul>
<p>I use a neat little windows utility called Task Scheduler to schedule my server restart in the middle of the night.</p>
<p><a href="http://support.microsoft.com/kb/308569">How To Schedule Tasks in Windows XP</a></p>
<p>While scheduling tasks you basically just browse for the batch file then set when you want the task to run and how often.</p>
]]></content:encoded>
			<wfw:commentRss>http://ww2.kludgeguru.com:8080/blogs/eeblog/?feed=rss2&amp;p=552</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Server Tips:  Backup Files Using a Batch File</title>
		<link>http://ww2.kludgeguru.com:8080/blogs/eeblog/?p=538</link>
		<comments>http://ww2.kludgeguru.com:8080/blogs/eeblog/?p=538#comments</comments>
		<pubDate>Sat, 07 Feb 2009 15:54:42 +0000</pubDate>
		<dc:creator>KludgeGuru</dc:creator>
				<category><![CDATA[Server Tips]]></category>

		<guid isPermaLink="false">http://www.kludgeguru.com/blogs/eeblog/?p=538</guid>
		<description><![CDATA[In my server I have 4 hard drives and each has a purpose:

Operating system &#8211; WinXP
Personal files such as family pictures, home movies &#38; mp3s
Backup of personal files
Media drive containing ripped DVDs

I used to setup hard drives 2 &#38; 3 in a RAID 1 which is a mirrored raid array.  That way both hard drives [...]]]></description>
			<content:encoded><![CDATA[<p>In my server I have 4 hard drives and each has a purpose:</p>
<ol>
<li>Operating system &#8211; WinXP</li>
<li>Personal files such as family pictures, home movies &amp; mp3s</li>
<li>Backup of personal files</li>
<li>Media drive containing ripped DVDs</li>
</ol>
<p>I used to setup hard drives 2 &amp; 3 in a RAID 1 which is a mirrored raid array.  That way both hard drives contain the exact same data so if one ever failed I would not loose the data.  Since then I&#8217;ve found that sometimes I erase data that I don&#8217;t mean to and sometimes it&#8217;s hard to get it back.  So I came up with a solution.  I use a batch file to backup my data nightly to from hard 2 to hard drive 3.  That way if I delete some data it actually doesn&#8217;t get deleted off my backup drive.  If I overwrite something I didn&#8217;t mean to I have until the nightly backup to retreive it.  The dos utility xcopy works great for that.  Here is a link to an xcopy users guide <a href="http://www.seqsoft.com/xcopy_ug.pdf">http://www.seqsoft.com/xcopy_ug.pdf</a></p>
<p>In the batch file I start off by saving the date and the start time to two variables:</p>
<blockquote><p>SET DATE=%date:~4,2%-%date:~7,2%-%date:~10,4%<br />
SET START=%time:~0,2%%time:~3,2%%time:~6,2%</p>
</blockquote>
<p>I then use xcopy with a bunch of switches to copy any new data to the backup hard drive.  I also create a log file called InProcess.log so I can go back later and check that everything is working alright.</p>
<blockquote><p>xcopy /d /c /e /r /y /f e:\ f:\ &gt;f:\backuplog\InProcess.log</p>
</blockquote>
<p>Here is a list of the switches I use:</p>
<ul>
<li>/d  -  Copies files changed on or after the specified date.  If no date is given, copies only those files whose source time is newer that the destination time.</li>
<li>/c  -  Continues copying even if errors occur.</li>
<li>/e  -  Copies directories and sub-directories, including empty ones.</li>
<li>/r  -  Overwrites read-only files.</li>
<li>/y  -  Suppresses prompting to confirm you want to overwrite an existing destination file.</li>
<li>/f  -  Displays full source and destination file names while copying.</li>
</ul>
<p>I then specify the source drive e:\ which is my personal files drive.</p>
<p>Next the destination drive f:\ which is my backup hard drive is specified.</p>
<p>Then I tell it to white to a log file instead of to the screen using &gt;f:\backuplog\InProcess.log</p>
<p>After the xcopy command I save the end time to a variable:</p>
<blockquote><p>SET END=%time:~0,2%%time:~3,2%%time:~6,2%</p>
</blockquote>
<p>I then rename the InProcess.log file that was created to a date and time stamp that says what time the process was started and what time it ended.</p>
<blockquote><p>rename f:\backuplog\inprocess.log &#8220;%DATE% %START%-%END%.log&#8221;</p>
</blockquote>
<p>So I save all of these lines into a batch file called <em>backup.bat</em>.  Here is what the entire batch file looks like:</p>
<blockquote><p>SET DATE=%date:~4,2%-%date:~7,2%-%date:~10,4%<br />
SET START=%time:~0,2%%time:~3,2%%time:~6,2%</p>
<p>xcopy /d /c /e /r /y /f e:\ f:\ &gt;f:\backuplog\InProcess.log</p>
<p>SET END=%time:~0,2%%time:~3,2%%time:~6,2%</p>
<p>rename f:\backuplog\inprocess.log &#8220;%DATE% %START%-%END%.log&#8221;</p>
</blockquote>
<p>The batch file is great but I need a way to automate it so I don&#8217;t have to remember to run the batch file whenever I want to backup my data.  It&#8217;s also nice to schedule the backup in the middle of the night when I most likely won&#8217;t be using my computer to access the server.  I use a neat little windows utility called Task Scheduler.</p>
<p><a href="http://support.microsoft.com/kb/308569">How To Schedule Tasks in Windows XP</a></p>
<p>While scheduling tasks you basically just browse for the batch file then set when you want the task to run and how often.</p>
<p>There are other solutions for backing up data but I like batch files, it&#8217;s free, easy and I don&#8217;t have to use some third party program.</p>
]]></content:encoded>
			<wfw:commentRss>http://ww2.kludgeguru.com:8080/blogs/eeblog/?feed=rss2&amp;p=538</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Server Tips:  Operating System</title>
		<link>http://ww2.kludgeguru.com:8080/blogs/eeblog/?p=534</link>
		<comments>http://ww2.kludgeguru.com:8080/blogs/eeblog/?p=534#comments</comments>
		<pubDate>Wed, 04 Feb 2009 13:20:21 +0000</pubDate>
		<dc:creator>KludgeGuru</dc:creator>
				<category><![CDATA[Server Tips]]></category>

		<guid isPermaLink="false">http://www.kludgeguru.com/blogs/eeblog/?p=534</guid>
		<description><![CDATA[Normally I&#8217;m all for open source and free software but for operating systems in my experience it&#8217;s hard to beat Windows XP.  I have some experience using Linux but I&#8217;m not a Linux Guru and when there is a problem it might take me a few hours to a few days to figure out how [...]]]></description>
			<content:encoded><![CDATA[<p>Normally I&#8217;m all for open source and free software but for operating systems in my experience it&#8217;s hard to beat Windows XP.  I have some experience using Linux but I&#8217;m not a Linux Guru and when there is a problem it might take me a few hours to a few days to figure out how to fix it.</p>
<p>I prefer to have an operating system that has a Graphical User Interface (GUI) rather than a command line interface.  It&#8217;s my opinion that the command line interface is powerful but it is also very <span id="query" class="query">archaic.  I&#8217;d prefer to have a GUI for my main operating system with a command line utility.</span></p>
<p>I did try installing <a href="http://www.ubuntu.com/">Ubuntu</a> on my server and it took a few days to get it working and configured the way I wanted it.  I have my server in my furnace room and there isn&#8217;t room in there for a monitor or keyboard so I remote into it to manage it.  With the Ubuntu install everything was working fine until the remote desktop stopped working.  I spent a couple days trying to figure out how to fix it and I finally got frustrated and installed Windows XP on it.  It took me a couple hours to get it installed and everything setup and I rarely have problems with it.</p>
<p>My choice of Windows XP to use as my server operating system mostly was decided for my experience with windows.  If I had more experience with another operating system such as Linux then I might have chosen it.  <span id="query" class="query"></span></p>
]]></content:encoded>
			<wfw:commentRss>http://ww2.kludgeguru.com:8080/blogs/eeblog/?feed=rss2&amp;p=534</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Server Tips</title>
		<link>http://ww2.kludgeguru.com:8080/blogs/eeblog/?p=531</link>
		<comments>http://ww2.kludgeguru.com:8080/blogs/eeblog/?p=531#comments</comments>
		<pubDate>Tue, 03 Feb 2009 13:33:40 +0000</pubDate>
		<dc:creator>KludgeGuru</dc:creator>
				<category><![CDATA[Server Tips]]></category>

		<guid isPermaLink="false">http://www.kludgeguru.com/blogs/eeblog/?p=531</guid>
		<description><![CDATA[I decided to create a new category called Server Tips.  I wanted to share my ideas on setting up a home server and I also wanted an easy way to document how I setup my server in case I ever need to reinstall it.  My home server serves a few purposes:

 File Server &#8211; A [...]]]></description>
			<content:encoded><![CDATA[<p>I decided to create a new category called <a href="http://www.kludgeguru.com/blogs/eeblog/?cat=24">Server Tips</a>.  I wanted to share my ideas on setting up a home server and I also wanted an easy way to document how I setup my server in case I ever need to reinstall it.  My home server serves a few purposes:</p>
<ul>
<li> File Server &#8211; A central place that our family pictures, videos &amp; music are stored.</li>
<li>Backup Server &#8211; The server does a nightly backup of our family pictures, videos, music&#8230;etc.</li>
<li>Web Server &#8211; The server also hosts my www.kludgeguru.com website.</li>
<li>Media Server &#8211; I also keep all of my ripped DVD collection on the server that can be access to stream movies to any PC or TV in the house.</li>
<li>Personal FM Radio Station &#8211; I have my favorite MP3 collection transmitted on an FM channel that can be tuned to using any standard radio within a block of my house.</li>
</ul>
<p><strong><span style="text-decoration: underline;">My Server Tips Index:</span></strong></p>
<ol>
<li><a href="http://www.kludgeguru.com/blogs/eeblog/?p=534">02-04-2009  -  Operating System</a></li>
<li><a href="http://www.kludgeguru.com/blogs/eeblog/?p=538">02-07-2009   -   Backup Files Using a Batch File</a></li>
<li><a href="http://www.kludgeguru.com/blogs/eeblog/?p=552">02-11-2009    -  Personal FM Radio Station</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://ww2.kludgeguru.com:8080/blogs/eeblog/?feed=rss2&amp;p=531</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project: 3-Axis Talking Skull &#8211; Post #3 Servo Plate Assembly</title>
		<link>http://ww2.kludgeguru.com:8080/blogs/eeblog/?p=487</link>
		<comments>http://ww2.kludgeguru.com:8080/blogs/eeblog/?p=487#comments</comments>
		<pubDate>Sun, 01 Feb 2009 16:51:55 +0000</pubDate>
		<dc:creator>KludgeGuru</dc:creator>
				<category><![CDATA[Project:  3-Axis Talking Skull]]></category>

		<guid isPermaLink="false">http://www.kludgeguru.com/blogs/eeblog/?p=487</guid>
		<description><![CDATA[Click here to see the entire 3-Axis Talking Skull Project.
I&#8217;ve started building my 3-axis talking skull using the Lindberg Complete Kit from www.graveyardskulls.com.  Unfortunetly GraveYardSkulls has not completed the instructions for this kit so I kind of had to make it up as I go.  The assembly is fairly straight forward but there are some [...]]]></description>
			<content:encoded><![CDATA[<p>Click here to see the entire <a href="http://www.kludgeguru.com/blogs/eeblog/?cat=5">3-Axis Talking Skull Project.</a></p>
<p>I&#8217;ve started building my 3-axis talking skull using the <a href="http://www.kludgeguru.com/blogs/eeblog/?p=132">Lindberg Complete Kit</a> from <a href="http://www.graveyardskulls.com/">www.graveyardskulls.com</a>.  Unfortunetly GraveYardSkulls has not completed the instructions for this kit so I kind of had to make it up as I go.  The assembly is fairly straight forward but there are some parts I&#8217;m not so sure on.  I&#8217;ve started a thread on the <a href="http://www.graveyardskulls.com/forum/index.php">GraveYardSkull forum</a> about the instructions and Joel says he is working on them.  Look for updates <a href="http://www.graveyardskulls.com/forum/viewtopic.php?f=6&amp;t=9">here</a>.</p>
<p style="text-align: left;">I&#8217;ve started the servo plate assembly.  The servos basically just slide through the rectangular cutouts and are secured using screws.  The back servo is also mounted with a bracket that will be connected to the servo rod later.</p>
<p style="text-align: center;">
Here is the servo plate before installing the servos:<br />
<a rel="thumbnail" href="http://www.kludgeguru.com/blogs/eeblog/wp-content/uploads/2009/01/lindbergkit-skull-plate.jpg"><img class="aligncenter" src="http://www.kludgeguru.com/blogs/eeblog/wp-content/uploads/2009/01/lindbergkit-skull-plate-thumb.jpg" alt="" /><br />
</a></p>
<p style="text-align: center;">
Here is the &#8220;bottom&#8221; view of the servos:<br />
<a rel="thumbnail" href="http://www.kludgeguru.com/blogs/eeblog/wp-content/uploads/2009/02/3axisskullbuild-servoplate1.jpg"><img class="size-full wp-image-495 aligncenter" title="3axisskullbuild-servoplate1-thumb" src="http://www.kludgeguru.com/blogs/eeblog/wp-content/uploads/2009/02/3axisskullbuild-servoplate1-thumb.jpg" alt="3axisskullbuild-servoplate1-thumb" width="160" height="120" /><br />
</a></p>
<p style="text-align: center;">
Here is a view that shows how the pivotrod bracket is attached:<br />
<a rel="thumbnail" href="http://www.kludgeguru.com/blogs/eeblog/wp-content/uploads/2009/02/3axisskullbuild-servoplate2.jpg"><img class="size-full wp-image-497 aligncenter" title="3axisskullbuild-servoplate2-thumb" src="http://www.kludgeguru.com/blogs/eeblog/wp-content/uploads/2009/02/3axisskullbuild-servoplate2-thumb.jpg" alt="3axisskullbuild-servoplate2-thumb" width="160" height="120" /><br />
</a></p>
<p style="text-align: center;">
Here is a &#8220;top&#8221; view of the servos on the servo plate:<br />
<a rel="thumbnail" href="http://www.kludgeguru.com/blogs/eeblog/wp-content/uploads/2009/02/3axisskullbuild-servoplate3.jpg"><img class="size-full wp-image-499 aligncenter" title="3axisskullbuild-servoplate3-thumb" src="http://www.kludgeguru.com/blogs/eeblog/wp-content/uploads/2009/02/3axisskullbuild-servoplate3-thumb.jpg" alt="3axisskullbuild-servoplate3-thumb" width="160" height="120" /><br />
</a></p>
<p style="text-align: center;">
Next I attached the pivot rod to the pivot rod bracket.  There are three mounting holes in the bracket so the pivot height can be adjusted.  I think it works best using the middle hole:<br />
<a rel="thumbnail" href="http://www.kludgeguru.com/blogs/eeblog/wp-content/uploads/2009/02/3axisskullbuild-pivotrod1.jpg"><img class="aligncenter size-full wp-image-491" title="3axisskullbuild-pivotrod1-thumb" src="http://www.kludgeguru.com/blogs/eeblog/wp-content/uploads/2009/02/3axisskullbuild-pivotrod1-thumb.jpg" alt="3axisskullbuild-pivotrod1-thumb" width="160" height="120" /><br />
</a></p>
<p style="text-align: center;">
Next I attached the servos to the pivot rod using the pivot joints.  I also replaced the circular servo arms with modified 180º arms.  I basically just cut off half of the arm to make a 90º arm:<br />
<a rel="thumbnail" href="http://www.kludgeguru.com/blogs/eeblog/wp-content/uploads/2009/02/3axisskullbuild-pivotrod2.jpg"><img class="aligncenter size-full wp-image-493" title="3axisskullbuild-pivotrod2-thumb" src="http://www.kludgeguru.com/blogs/eeblog/wp-content/uploads/2009/02/3axisskullbuild-pivotrod2-thumb.jpg" alt="3axisskullbuild-pivotrod2-thumb" width="160" height="120" /><br />
</a></p>
<p style="text-align: center;">
Here is a close-up of one of the pivot joints.  The pivot joint arm is made using a threaded rod pressed into the pivot joint.  The pivot joint is attached to the servo arm using a small pivot ball&#8230;it looks like a small version of a trailer hitch ball.<br />
<a rel="thumbnail" href="http://www.kludgeguru.com/blogs/eeblog/wp-content/uploads/2009/02/3axisskullbuild-pivotjoint1.jpg"><img class="aligncenter size-full wp-image-489" title="3axisskullbuild-pivotjoint1-thumb" src="http://www.kludgeguru.com/blogs/eeblog/wp-content/uploads/2009/02/3axisskullbuild-pivotjoint1-thumb.jpg" alt="3axisskullbuild-pivotjoint1-thumb" width="160" height="120" /><br />
</a></p>
<p style="text-align: left;">
Well, that&#8217;s how I assembled the servo plate.  I&#8217;m sure once GraveYardSkulls finishes their assembly instructions they will have more detailed pictures of the assembly process.  Maybe when I assemble my 2nd skull I&#8217;ll take more detailed pictures as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://ww2.kludgeguru.com:8080/blogs/eeblog/?feed=rss2&amp;p=487</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project: LED Firefly Lights &#8211; Post #5 Real Firefly Test</title>
		<link>http://ww2.kludgeguru.com:8080/blogs/eeblog/?p=470</link>
		<comments>http://ww2.kludgeguru.com:8080/blogs/eeblog/?p=470#comments</comments>
		<pubDate>Fri, 30 Jan 2009 13:00:12 +0000</pubDate>
		<dc:creator>KludgeGuru</dc:creator>
				<category><![CDATA[Project: LED Firefly Lights]]></category>

		<guid isPermaLink="false">http://www.kludgeguru.com/blogs/eeblog/?p=470</guid>
		<description><![CDATA[Click here to see the entire LED FireFly Lights Project.
Now that I&#8217;ve got my firefly test LEDs to fade in and out randomly (Project: LED Firefly Lights &#8211; Post #4 Random Fade Test) I&#8217;ve decided to try to replicate what real fireflies look like when they flash.  I&#8217;ve found this video on youtube that shows [...]]]></description>
			<content:encoded><![CDATA[<p>Click here to see the entire <a href="http://www.kludgeguru.com/blogs/eeblog/?cat=8">LED FireFly Lights Project</a>.</p>
<p>Now that I&#8217;ve got my firefly test LEDs to fade in and out randomly (<a href="http://www.kludgeguru.com/blogs/eeblog/?p=399">Project: LED Firefly Lights &#8211; Post #4 Random Fade Test</a>) I&#8217;ve decided to try to replicate what real fireflies look like when they flash.  I&#8217;ve found this video on youtube that shows how they flash and it also shows a some LED firefly lights a company in California has made called <a href="http://www.fireflymagic.com/">FireFly Magic</a>.<br />
<center><br /><img src="http://i.ytimg.com/vi/o-1A2-0lAjU/0.jpg" alt="media" /><br />
</center></p>
<p>For the code I mostly just inverted the DelayOn and DelayOff.  I did add an extra #define to take the place of the direction 1 or -1 so I could easily change the speed at which I change the LED brightness.  I also changed the name of the fade variable in the LED structure to FadeDelay.  To see the old version of the code check out <a href="http://www.kludgeguru.com/blogs/eeblog/?p=399">Post #4</a>.</p>
<p>Here is what the test fireflies look like now; they don&#8217;t blink as fast as real fireflies my wife prefers them to go a bit slower.  The speed can easily be changed by changing the #define constants.<br />
<center></center>  </p>
<p>Here is the new code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
</pre></td><td class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include &lt;avr/io.h&gt;</span>
<span style="color: #339933;">#include &lt;avr/interrupt.h&gt;</span>
<span style="color: #339933;">#include &lt;stdlib.h&gt;</span>
&nbsp;
<span style="color: #993333;">volatile</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> vCount <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #993333;">volatile</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> vPORTA <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #993333;">volatile</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> vPORTB <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #993333;">volatile</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> vPORTC <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #993333;">volatile</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> vPORTD <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #993333;">volatile</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> vPORTE <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #339933;">#define cLED_CNT 16</span>
<span style="color: #339933;">#define cFADEDELAY 3</span>
<span style="color: #339933;">#define cDELAYOFFMAX 1500</span>
<span style="color: #339933;">#define cDELAYON 1</span>
<span style="color: #339933;">#define cBRIGHTMAX 100</span>
<span style="color: #339933;">#define cFADESPEED 5</span>
&nbsp;
<span style="color: #993333;">struct</span> LED
<span style="color: #009900;">&#123;</span>
  <span style="color: #993333;">char</span> Port<span style="color: #339933;">;</span>
  <span style="color: #993333;">char</span> Bit<span style="color: #339933;">;</span>
  <span style="color: #993333;">int</span> Brightness<span style="color: #339933;">;</span>
  <span style="color: #993333;">int</span> Direction<span style="color: #339933;">;</span>
  <span style="color: #993333;">int</span> DelayOn<span style="color: #339933;">;</span>
  <span style="color: #993333;">int</span> DelayOff<span style="color: #339933;">;</span>
  <span style="color: #993333;">int</span> FadeDelay<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #993333;">volatile</span> <span style="color: #993333;">struct</span> LED LEDArray<span style="color: #009900;">&#91;</span>cLED_CNT<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">/* Main Function */</span>
<span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #993333;">int</span> vI<span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #808080; font-style: italic;">/* Initialize Timer0 */</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// Enable timer0 compare interrupt</span>
  TIMSK0 <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #339933;">&lt;&lt;</span>OCIE0A<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// Sets the compare value</span>
  OCR0A <span style="color: #339933;">=</span> <span style="color: #0000dd;">12</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Set Clear on Timer Compare (CTC) mode, prescaler</span>
  TCCR0A <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #339933;">&lt;&lt;</span>WGM01<span style="color: #009900;">&#41;</span><span style="color: #339933;">|</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #339933;">&lt;&lt;</span>WGM00<span style="color: #009900;">&#41;</span><span style="color: #339933;">|</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">3</span><span style="color: #339933;">&lt;&lt;</span>CS00<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #808080; font-style: italic;">/* Initialize Ports for output */</span>
  DDRA <span style="color: #339933;">=</span> <span style="color: #208080;">0xFF</span><span style="color: #339933;">;</span>
  DDRB <span style="color: #339933;">=</span> <span style="color: #208080;">0xFF</span><span style="color: #339933;">;</span>
  DDRC <span style="color: #339933;">=</span> <span style="color: #208080;">0xFF</span><span style="color: #339933;">;</span>
  DDRD <span style="color: #339933;">=</span> <span style="color: #208080;">0xFF</span><span style="color: #339933;">;</span>
  DDRE <span style="color: #339933;">=</span> <span style="color: #208080;">0xFF</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #808080; font-style: italic;">/* Initialize LED Array */</span>
  <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span>vI <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> vI <span style="color: #339933;">&lt;</span> cLED_CNT<span style="color: #339933;">;</span> vI<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>vI <span style="color: #339933;">&lt;</span> <span style="color: #0000dd;">8</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Port</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'B'</span><span style="color: #339933;">;</span>
      LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Bit</span> <span style="color: #339933;">=</span> vI<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">else</span>
    <span style="color: #009900;">&#123;</span>
      LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Port</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'D'</span><span style="color: #339933;">;</span>
      LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Bit</span> <span style="color: #339933;">=</span> vI <span style="color: #339933;">-</span> <span style="color: #0000dd;">8</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Brightness</span> <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
    LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Direction</span> <span style="color: #339933;">=</span> cFADESPEED<span style="color: #339933;">;</span>
    LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">DelayOff</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>rand<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">%</span> cDELAYOFFMAX<span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
    LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">DelayOn</span> <span style="color: #339933;">=</span> cDELAYON<span style="color: #339933;">;</span>
    LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">FadeDelay</span> <span style="color: #339933;">=</span> cFADEDELAY<span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>   
&nbsp;
  <span style="color: #666666; font-style: italic;">// Enable Interrupts</span>
  sei<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
   <span style="color: #666666; font-style: italic;">// Main program loop</span>
   <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>   <span style="color: #009900;">&#125;</span>
&nbsp;
   <span style="color: #b1b100;">return</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* Handle Timer Interrupt */</span>
ISR <span style="color: #009900;">&#40;</span>TIMER0_COMP_vect<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #993333;">int</span> vI <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
&nbsp;
  vCount<span style="color: #339933;">++;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>vCount <span style="color: #339933;">&gt;=</span> <span style="color: #0000dd;">100</span><span style="color: #009900;">&#41;</span> vCount <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>vCount <span style="color: #339933;">==</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span> 
  <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">//vPORTA = 0xFF;</span>
    vPORTB <span style="color: #339933;">=</span> <span style="color: #208080;">0xFF</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">//vPORTC = 0xFF;</span>
    vPORTD <span style="color: #339933;">=</span> <span style="color: #208080;">0xFF</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">//vPORTE = 0xFF;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span>vI <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> vI <span style="color: #339933;">&lt;</span> cLED_CNT<span style="color: #339933;">;</span> vI<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Brightness</span> <span style="color: #339933;">&lt;=</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">|</span> <span style="color: #009900;">&#40;</span>LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Brightness</span> <span style="color: #339933;">==</span> vCount<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      <span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span>LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Port</span><span style="color: #009900;">&#41;</span>
      <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">case</span> <span style="color: #ff0000;">'A'</span><span style="color: #339933;">:</span> vPORTA <span style="color: #339933;">&amp;=</span> ~<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span> <span style="color: #339933;">&lt;&lt;</span> LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Bit</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>break<span style="color: #339933;">;</span>
        <span style="color: #b1b100;">case</span> <span style="color: #ff0000;">'B'</span><span style="color: #339933;">:</span> vPORTB <span style="color: #339933;">&amp;=</span> ~<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span> <span style="color: #339933;">&lt;&lt;</span> LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Bit</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>break<span style="color: #339933;">;</span>
        <span style="color: #b1b100;">case</span> <span style="color: #ff0000;">'C'</span><span style="color: #339933;">:</span> vPORTC <span style="color: #339933;">&amp;=</span> ~<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span> <span style="color: #339933;">&lt;&lt;</span> LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Bit</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>break<span style="color: #339933;">;</span>
        <span style="color: #b1b100;">case</span> <span style="color: #ff0000;">'D'</span><span style="color: #339933;">:</span> vPORTD <span style="color: #339933;">&amp;=</span> ~<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span> <span style="color: #339933;">&lt;&lt;</span> LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Bit</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>break<span style="color: #339933;">;</span>
        <span style="color: #b1b100;">case</span> <span style="color: #ff0000;">'E'</span><span style="color: #339933;">:</span> vPORTE <span style="color: #339933;">&amp;=</span> ~<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span> <span style="color: #339933;">&lt;&lt;</span> LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Bit</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>break<span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>vCount <span style="color: #339933;">==</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span> 
    <span style="color: #009900;">&#123;</span>
      LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">DelayOff</span><span style="color: #339933;">--;</span>
      <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">DelayOff</span> <span style="color: #339933;">==</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span>
      <span style="color: #009900;">&#123;</span>
        LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">DelayOff</span> <span style="color: #339933;">=</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
        LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">FadeDelay</span><span style="color: #339933;">--;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">FadeDelay</span> <span style="color: #339933;">==</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
          LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">FadeDelay</span> <span style="color: #339933;">=</span> cFADEDELAY<span style="color: #339933;">;</span>
          LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Brightness</span> <span style="color: #339933;">+=</span> LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Direction</span><span style="color: #339933;">;</span>
          <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Brightness</span> <span style="color: #339933;">&gt;=</span> cBRIGHTMAX<span style="color: #009900;">&#41;</span> 
          <span style="color: #009900;">&#123;</span>
            LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Brightness</span> <span style="color: #339933;">=</span> cBRIGHTMAX<span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
            LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">DelayOn</span><span style="color: #339933;">--;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">DelayOn</span> <span style="color: #339933;">==</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span>
            <span style="color: #009900;">&#123;</span>
              LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Direction</span> <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #0000dd;">1</span> <span style="color: #339933;">*</span> cFADESPEED<span style="color: #339933;">;</span>
              LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">DelayOn</span> <span style="color: #339933;">=</span> cDELAYON<span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
          <span style="color: #009900;">&#125;</span>
          <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Brightness</span> <span style="color: #339933;">&lt;=</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span> 
          <span style="color: #009900;">&#123;</span>
            LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Direction</span> <span style="color: #339933;">=</span> cFADESPEED<span style="color: #339933;">;</span>
            LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">DelayOff</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>rand<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">%</span> cDELAYOFFMAX<span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span>  
        <span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #666666; font-style: italic;">//PORTA = vPORTA;</span>
  PORTB <span style="color: #339933;">=</span> vPORTB<span style="color: #339933;">;</span>
  <span style="color: #666666; font-style: italic;">//PORTC = vPORTC;</span>
  PORTD <span style="color: #339933;">=</span> vPORTD<span style="color: #339933;">;</span>
  <span style="color: #666666; font-style: italic;">//PORTE = vPORTE;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://ww2.kludgeguru.com:8080/blogs/eeblog/?feed=rss2&amp;p=470</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<enclosure url="http://www.kludgeguru.com/blogs/eeblog/wp-content/uploads/2009/01/fireflytestrealbugs.flv" length="1" type="video/x-flv"/>
	</item>
		<item>
		<title>Project: LED Firefly Lights &#8211; Post #4 Random Fade Test</title>
		<link>http://ww2.kludgeguru.com:8080/blogs/eeblog/?p=399</link>
		<comments>http://ww2.kludgeguru.com:8080/blogs/eeblog/?p=399#comments</comments>
		<pubDate>Fri, 30 Jan 2009 04:27:53 +0000</pubDate>
		<dc:creator>KludgeGuru</dc:creator>
				<category><![CDATA[Project: LED Firefly Lights]]></category>

		<guid isPermaLink="false">http://www.kludgeguru.com/blogs/eeblog/?p=399</guid>
		<description><![CDATA[Click here to see the entire LED FireFly Lights Project.
In the previous post I showed how I faded an entire bank of LED lights.  Since then I&#8217;ve added another bank of LEDs to make sure my code works with multiple banks.  So the total LED count is 16.  I connected the LEDs [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Click here to see the entire <a href="http://www.kludgeguru.com/blogs/eeblog/?cat=8">LED FireFly Lights Project</a>.</p>
<p style="text-align: left;">In the previous post I showed how I faded an entire bank of LED lights.  Since then I&#8217;ve added another bank of LEDs to make sure my code works with multiple banks.  So the total LED count is 16.  I connected the LEDs through a resistor to Ports B &amp; D on the AVR Butterfly as shown in the picture below.  I had to disconnect the piezo speaker on the back of the Butterfly since it is also connected to pin 5 of Port B.</p>
<p><a rel="thumbnail" href="http://www.kludgeguru.com/blogs/eeblog/wp-content/uploads/2009/01/fireflytestbutterflyportsbd.jpg"><img class="size-full wp-image-413 aligncenter" title="fireflytestbutterflyportsbd-thumb" src="http://www.kludgeguru.com/blogs/eeblog/wp-content/uploads/2009/01/fireflytestbutterflyportsbd-thumb.jpg" alt="fireflytestbutterflyportsbd-thumb" width="160" height="115" /> <a rel="thumbnail" href="http://www.kludgeguru.com/blogs/eeblog/wp-content/uploads/2009/01/fireflytestledbanksbd.jpg"><img class="size-full wp-image-432 aligncenter" title="fireflytestledbanksbd-thumb" src="http://www.kludgeguru.com/blogs/eeblog/wp-content/uploads/2009/01/fireflytestledbanksbd-thumb.jpg" alt="fireflytestledbanksbd-thumb" width="160" height="105" /></p>
<p style="text-align: left;"><a rel="thumbnail" href="http://www.kludgeguru.com/blogs/eeblog/wp-content/uploads/2009/01/fireflytestledbanksbd.jpg"><br />
</a></p>
<p style="text-align: left;">I&#8217;ve been playing around with randomizing the LEDs so they don&#8217;t all turn on and off at the same time.</p>
<p style="text-align: left;">To create a random number in C you can use the <strong>rand( )</strong> function declared in the stdlib.h library.  In my code I use the following statement to generate a random delay for each LED.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">DelayOn</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>rand<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">%</span> cDELAYONMAX<span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span></pre></div></div>

<p style="text-align: left;"><strong>LEDArray[vI].DelayOn</strong> is an integer variable that is part of my LED structure used to store the random number in.</p>
<p style="text-align: left;"><a href="http://www.cplusplus.com/reference/clibrary/cstdlib/rand.html">rand( )</a> function returns a pseudo-random integral number in the range 0 to RAND_MAX where RAND_MAX = 0x7FFF which is declared in the stdlib.h library.</p>
<p style="text-align: left;"><a href="http://www.cprogramming.com/tutorial/modulus.html">% Modulus</a> computes the remainder that results from performing integer division.</p>
<p style="text-align: left;"><strong>cDELAYONMAX</strong> is a constant I declare to give me the maximum random number I want to generate.  Currently I&#8217;ve set this to 1500.</p>
<p>I&#8217;ve created an LED structure to group the variable I need to control the LEDs.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">struct</span> LED
<span style="color: #009900;">&#123;</span>
  <span style="color: #993333;">char</span> Port<span style="color: #339933;">;</span>
  <span style="color: #993333;">char</span> Bit<span style="color: #339933;">;</span>
  <span style="color: #993333;">int</span> Brightness<span style="color: #339933;">;</span>
  <span style="color: #993333;">int</span> Direction<span style="color: #339933;">;</span>
  <span style="color: #993333;">int</span> DelayOn<span style="color: #339933;">;</span> 
  <span style="color: #993333;">int</span> DelayOff<span style="color: #339933;">;</span>
  <span style="color: #993333;">int</span> FadeSpeed<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>Port</strong> variable sets the Port the LED is located on.<br />
<strong>Bit</strong> variable sets which pin the LED is located on.<br />
<strong>Brightness</strong> variable controls the current brightness of the LED in percent 0 to 100.<br />
<strong>Direction</strong> variable controls whether the LED is fading in or out.  1 is in and -1 is out.<br />
<strong>DelayOn</strong> contains a random number that sets how long the LED will stay on.<br />
<strong>DelayOff</strong> contains how long the LED will stay off.<br />
<strong>FadeSpeed</strong> controls how fast the LED will fade on and off.</p>
<p>Here is a video that shows the LEDs randomly fading in and out:<br />
<center></center></p>
<p>Here is my code, it may not be the best way to do it but it works:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
</pre></td><td class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include &lt;avr/io.h&gt;</span>
<span style="color: #339933;">#include &lt;avr/interrupt.h&gt;</span>
<span style="color: #339933;">#include &lt;stdlib.h&gt;</span>
&nbsp;
<span style="color: #993333;">volatile</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> vCount <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #993333;">volatile</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> vPORTA <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #993333;">volatile</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> vPORTB <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #993333;">volatile</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> vPORTC <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #993333;">volatile</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> vPORTD <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #993333;">volatile</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> vPORTE <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #339933;">#define cLED_CNT 16</span>
<span style="color: #339933;">#define cFADESPEED 5</span>
<span style="color: #339933;">#define cDELAYONMAX 1500</span>
<span style="color: #339933;">#define cDELAYOFF 5</span>
<span style="color: #339933;">#define cBRIGHTMAX 100</span>
&nbsp;
<span style="color: #993333;">struct</span> LED
<span style="color: #009900;">&#123;</span>
  <span style="color: #993333;">char</span> Port<span style="color: #339933;">;</span>
  <span style="color: #993333;">char</span> Bit<span style="color: #339933;">;</span>
  <span style="color: #993333;">int</span> Brightness<span style="color: #339933;">;</span>
  <span style="color: #993333;">int</span> Direction<span style="color: #339933;">;</span>
  <span style="color: #993333;">int</span> DelayOn<span style="color: #339933;">;</span> 
  <span style="color: #993333;">int</span> DelayOff<span style="color: #339933;">;</span>
  <span style="color: #993333;">int</span> FadeSpeed<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #993333;">volatile</span> <span style="color: #993333;">struct</span> LED LEDArray<span style="color: #009900;">&#91;</span>cLED_CNT<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* Main Function */</span>
<span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #993333;">int</span> vI<span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #808080; font-style: italic;">/* Initialize Timer0 */</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Enable timer0 compare interrupt</span>
  TIMSK0 <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span> <span style="color: #339933;">&lt;&lt;</span> OCIE0A<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Sets the compare value</span>
  OCR0A <span style="color: #339933;">=</span> <span style="color: #0000dd;">12</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Set Clear on Timer Compare (CTC) mode, prescaler</span>
  TCCR0A <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span> <span style="color: #339933;">&lt;&lt;</span> WGM01<span style="color: #009900;">&#41;</span> <span style="color: #339933;">|</span> <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">0</span> <span style="color: #339933;">&lt;&lt;</span> WGM00<span style="color: #009900;">&#41;</span> <span style="color: #339933;">|</span> <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">3</span> <span style="color: #339933;">&lt;&lt;</span> CS00<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #808080; font-style: italic;">/* Initialize Ports for output */</span>
  DDRA <span style="color: #339933;">=</span> <span style="color: #208080;">0xFF</span><span style="color: #339933;">;</span>
  DDRB <span style="color: #339933;">=</span> <span style="color: #208080;">0xFF</span><span style="color: #339933;">;</span>
  DDRC <span style="color: #339933;">=</span> <span style="color: #208080;">0xFF</span><span style="color: #339933;">;</span>
  DDRD <span style="color: #339933;">=</span> <span style="color: #208080;">0xFF</span><span style="color: #339933;">;</span>
  DDRE <span style="color: #339933;">=</span> <span style="color: #208080;">0xFF</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #808080; font-style: italic;">/* Initialize LED Array */</span>
  <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span>vI <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> vI <span style="color: #339933;">&lt;</span> cLED_CNT<span style="color: #339933;">;</span> vI<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>vI <span style="color: #339933;">&lt;</span> <span style="color: #0000dd;">8</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Port</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'B'</span><span style="color: #339933;">;</span>
      LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Bit</span> <span style="color: #339933;">=</span> vI<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">else</span>
    <span style="color: #009900;">&#123;</span>
      LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Port</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'D'</span><span style="color: #339933;">;</span>
      LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Bit</span> <span style="color: #339933;">=</span> vI <span style="color: #339933;">-</span> <span style="color: #0000dd;">8</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
      LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Brightness</span> <span style="color: #339933;">=</span> cBRIGHTMAX<span style="color: #339933;">;</span>
      LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Direction</span> <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
      LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">DelayOn</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>rand<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">%</span> cDELAYONMAX<span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
      LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">DelayOff</span> <span style="color: #339933;">=</span> cDELAYOFF<span style="color: #339933;">;</span>
      LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">FadeSpeed</span> <span style="color: #339933;">=</span> cFADESPEED<span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Enable Interrupts</span>
  sei<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Main program loop</span>
  <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>   <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #b1b100;">return</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* Handle Timer Interrupt */</span>
ISR <span style="color: #009900;">&#40;</span>TIMER0_COMP_vect<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #993333;">int</span> vI <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
&nbsp;
  vCount<span style="color: #339933;">++;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>vCount <span style="color: #339933;">&gt;=</span> <span style="color: #0000dd;">100</span><span style="color: #009900;">&#41;</span> vCount <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>vCount <span style="color: #339933;">==</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">//vPORTA = 0xFF;</span>
    vPORTB <span style="color: #339933;">=</span> <span style="color: #208080;">0xFF</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">//vPORTC = 0xFF;</span>
    vPORTD <span style="color: #339933;">=</span> <span style="color: #208080;">0xFF</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">//vPORTE = 0xFF;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span>vI <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> vI <span style="color: #339933;">&lt;</span> cLED_CNT<span style="color: #339933;">;</span> vI<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Brightness</span> <span style="color: #339933;">&lt;=</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">|</span> <span style="color: #009900;">&#40;</span>LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Brightness</span> <span style="color: #339933;">==</span> vCount<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      <span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span>LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Port</span><span style="color: #009900;">&#41;</span>
      <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">case</span> <span style="color: #ff0000;">'A'</span><span style="color: #339933;">:</span> vPORTA <span style="color: #339933;">&amp;=</span> ~<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span> <span style="color: #339933;">&lt;&lt;</span> LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Bit</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>break<span style="color: #339933;">;</span>
        <span style="color: #b1b100;">case</span> <span style="color: #ff0000;">'B'</span><span style="color: #339933;">:</span> vPORTB <span style="color: #339933;">&amp;=</span> ~<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span> <span style="color: #339933;">&lt;&lt;</span> LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Bit</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>break<span style="color: #339933;">;</span>
        <span style="color: #b1b100;">case</span> <span style="color: #ff0000;">'C'</span><span style="color: #339933;">:</span> vPORTC <span style="color: #339933;">&amp;=</span> ~<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span> <span style="color: #339933;">&lt;&lt;</span> LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Bit</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>break<span style="color: #339933;">;</span>
        <span style="color: #b1b100;">case</span> <span style="color: #ff0000;">'D'</span><span style="color: #339933;">:</span> vPORTD <span style="color: #339933;">&amp;=</span> ~<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span> <span style="color: #339933;">&lt;&lt;</span> LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Bit</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>break<span style="color: #339933;">;</span>
        <span style="color: #b1b100;">case</span> <span style="color: #ff0000;">'E'</span><span style="color: #339933;">:</span> vPORTE <span style="color: #339933;">&amp;=</span> ~<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span> <span style="color: #339933;">&lt;&lt;</span> LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Bit</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>break<span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>vCount <span style="color: #339933;">==</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">DelayOn</span><span style="color: #339933;">--;</span>
      <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">DelayOn</span> <span style="color: #339933;">==</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span>
      <span style="color: #009900;">&#123;</span>
        LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">DelayOn</span> <span style="color: #339933;">=</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
        LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">FadeSpeed</span><span style="color: #339933;">--;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">FadeSpeed</span> <span style="color: #339933;">==</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
          LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">FadeSpeed</span> <span style="color: #339933;">=</span> cFADESPEED<span style="color: #339933;">;</span>
          LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Brightness</span> <span style="color: #339933;">+=</span> LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Direction</span><span style="color: #339933;">;</span>
          <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Brightness</span> <span style="color: #339933;">&lt;=</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span>
          <span style="color: #009900;">&#123;</span>
            LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Brightness</span> <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
            LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">DelayOff</span><span style="color: #339933;">--;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">DelayOff</span> <span style="color: #339933;">==</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span>
            <span style="color: #009900;">&#123;</span>
              LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Direction</span> <span style="color: #339933;">=</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
              LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">DelayOff</span> <span style="color: #339933;">=</span> cDELAYOFF<span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
          <span style="color: #009900;">&#125;</span>
          <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Brightness</span> <span style="color: #339933;">==</span> cBRIGHTMAX<span style="color: #009900;">&#41;</span>
          <span style="color: #009900;">&#123;</span>
            LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Direction</span> <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
            LEDArray<span style="color: #009900;">&#91;</span>vI<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">DelayOn</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>rand<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">%</span> cDELAYONMAX<span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #666666; font-style: italic;">//PORTA = vPORTA;</span>
  PORTB <span style="color: #339933;">=</span> vPORTB<span style="color: #339933;">;</span>
  <span style="color: #666666; font-style: italic;">//PORTC = vPORTC;</span>
  PORTD <span style="color: #339933;">=</span> vPORTD<span style="color: #339933;">;</span>
  <span style="color: #666666; font-style: italic;">//PORTE = vPORTE;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://ww2.kludgeguru.com:8080/blogs/eeblog/?feed=rss2&amp;p=399</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<enclosure url="http://www.kludgeguru.com/blogs/eeblog/wp-content/uploads/2009/01/ledfireflyrandomtest.flv" length="1" type="video/x-flv"/>
	</item>
		<item>
		<title>AVR JTAGICE mkII clone &#8211; Review</title>
		<link>http://ww2.kludgeguru.com:8080/blogs/eeblog/?p=229</link>
		<comments>http://ww2.kludgeguru.com:8080/blogs/eeblog/?p=229#comments</comments>
		<pubDate>Sat, 24 Jan 2009 16:11:51 +0000</pubDate>
		<dc:creator>KludgeGuru</dc:creator>
				<category><![CDATA[AVR]]></category>

		<guid isPermaLink="false">http://www.kludgeguru.com/blogs/eeblog/?p=229</guid>
		<description><![CDATA[This is a followup review post from this one:  AVR JTAGICE mkII clone
I finally tried out the AVR JTAGICE mkII clone.  AVRSTudio connected to it just like it should.  It downloaded the latest firmware.  I connected to my AVR Butterfly and it read the device signature.  Everything was looking good until I tried to debug [...]]]></description>
			<content:encoded><![CDATA[<p>This is a followup review post from this one:  <a href="http://www.kludgeguru.com/blogs/eeblog/?p=43">AVR JTAGICE mkII clone</a></p>
<p>I finally tried out the AVR JTAGICE mkII clone.  AVRSTudio connected to it just like it should.  It downloaded the latest firmware.  I connected to my AVR Butterfly and it read the device signature.  Everything was looking good until I tried to debug my code.  Whenever I entered debug mode the JTAGICE mkII clone would time out and disconnect from AVRStudio.</p>
<p>I was a bit discouraged and I had to figure out if I was doing something wrong or if I got a bad programmer.  One of my friends had a JTAGICE mkII from atmel that was not a clone so I borrowed it and tried it.  It didn&#8217;t have any problems in debug mode.  So I did get a bad programmer.</p>
<p>I contacted the vendor where I purchased the programmer and he said to ship it back and they will test it.  So I shipped it back to them and a few days later I got this response:</p>
<blockquote><p>Hi, I tested your mkii clone and as you said, the debugging mode doesn&#8217;t work.  I will have to ship it to the manufacturer for a repair.  The whole process can take 3-4 weeks, as they are closed right now because of Chinese New Year celebration.</p>
</blockquote>
<p>So the good news is they had the same problem I was having with it.  The bad news is they will not be sending me a new one, instead they are sending it back to China for repair.  So far I&#8217;m not all that impressed with the clone.  I think if you receive a device that does not work they should replace it with a new one instead of sending it back for repair.  Maybe in a month (hopefully) when I get the clone back it will work as it should.</p>
<p>To see a list of other AVR programmer/debuggers check out my <a href="http://www.kludgeguru.com/blogs/eeblog/?p=40">AVR Programmer/Debugger</a> post.</p>
<p>EDIT:  I finally got it back see here <a href="http://ww2.kludgeguru.com:8080/blogs/eeblog/?p=570">AVR JTAGICE mkII clone &#8211; Review (Final)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ww2.kludgeguru.com:8080/blogs/eeblog/?feed=rss2&amp;p=229</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
