<?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>Bret Kuhns &#187; sparkfun</title>
	<atom:link href="http://www.bretkuhns.com/blog/tag/sparkfun/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bretkuhns.com/blog</link>
	<description>Programming, Cars, and Life</description>
	<lastBuildDate>Sun, 19 Dec 2010 19:05:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Flashing OpenLog Firmware in Ubuntu Linux</title>
		<link>http://www.bretkuhns.com/blog/2010/03/flashing-openlog-firmware-in-ubuntu-linux/</link>
		<comments>http://www.bretkuhns.com/blog/2010/03/flashing-openlog-firmware-in-ubuntu-linux/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 18:36:37 +0000</pubDate>
		<dc:creator>Bret Kuhns</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[OpenLog]]></category>
		<category><![CDATA[sparkfun]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.bretkuhns.com/blog/?p=85</guid>
		<description><![CDATA[I recently hit a bug in the Sparkfun OpenLog v1.1 firmware that left the device useless. I found out the hard way that version 1.1 only supports up to 255 log files. Once it hits this limit the firmware doesn&#8217;t know what to do with itself and loops endlessly. This even prevents you from entering command [...]]]></description>
			<content:encoded><![CDATA[<p>I recently hit a bug in the Sparkfun <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=9530">OpenLog </a>v1.1 firmware that left the device useless. I found out the hard way that version 1.1 only supports up to 255 log files. Once it hits this limit the firmware doesn&#8217;t know what to do with itself and loops endlessly. This even prevents you from entering command mode where you could otherwise reset the log number. <a href="http://github.com/nseidle">Nate Seidle</a> at SparkFun quickly released an update, v1.2, to correct this problem I was having. But now I had to figure out how to flash the firmware on my OpenLog. It turns out the process is extremely easy in Ubuntu, but the GitHub documentation targets mostly Windows, so I decided to document the process for Ubuntu users from start to finish here.<span id="more-85"></span></p>
<p>I expect that you have the Arduino IDE <a href="http://www.arduino.cc/playground/Learning/Linux">installed and running properly</a>. This means the avrdude and avr-gcc libraries necessary to flash OpenLog will already be installed. Next step is to pull the firmware source code from the <a href="http://github.com/nseidle/OpenLog">GitHub repository</a>. If you don&#8217;t have git installed, run the following command:</p>
<pre class="brush: plain; gutter: false;">$ sudo apt-get install git-core</pre>
<p>Now you can run the git command to pull the source code over the read-only HTTP path. This is generally the easiest path to use to avoid issues with proxies or closed/blocked ports on your network.</p>
<pre class="brush: plain; gutter: false;">$ git clone http://github.com/nseidle/OpenLog.git</pre>
<p>Once the command has completed, you&#8217;ll have an OpenLog directory in your currently active directory. Time to compile the source code to make the required hex file that we&#8217;ll write to OpenLog.</p>
<pre class="brush: plain; gutter: false;">$ cd OpenLog/Code/</pre>
<pre class="brush: plain; gutter: false;">$ make</pre>
<p style="text-align: left;">You should see several notices about compiling various .c files, linking main.elf, and most importantly loading main.hex. Now we need to get that hex file onto OpenLog. Grab your trusty <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=8772">FTDI breakout board</a> (you should never leave home without it) and wire it to OpenLog as shown below.</p>
<p style="text-align: left; padding-top: 0;"><a href="http://www.bretkuhns.com/blog/wp-content/uploads/2010/03/FTDI-Connections.jpg"><img class="aligncenter size-medium wp-image-86" title="FTDI to OpenLog connection diagram." src="http://www.bretkuhns.com/blog/wp-content/uploads/2010/03/FTDI-Connections-300x96.jpg" alt="" width="300" height="96" /></a></p>
<p style="text-align: left; padding-top: 0;">Before connecting the FTDI to your computer, we want to make sure we have the correct device path for the next step. Look at the list of all tty-capable USB devices. It&#8217;s okay if none show up right now.</p>
<p style="text-align: left; padding-top: 0;">
<pre class="brush: plain; gutter: false;">$ ls /dev/ttyUSB*</pre>
<p style="text-align: left; padding-top: 0;">Now connect the FTDI board and run the command again. The new ttyUSB# device listed is your FTDI board. I&#8217;ll use ttyUSB0 in the command below, so you will need to change the zero if your # is different.</p>
<p style="text-align: left; padding-top: 0;">I hope you have an extra wire at hand. The Linux build of avrdude unfortunately doesn&#8217;t have the &#8220;DTR wiggle&#8221; necessary to automatically reset OpenLog&#8217;s ATMega328p, so we have to do it ourselves. Grab a wire and connect one end to ground. If necessary, the microSD socket&#8217;s case can be used as a ground if you don&#8217;t have OpenLog on a breadboard. You&#8217;ll need to tap the other end of the wire onto the GPIO pin 6 on OpenLog. This is the square pin pad near the &#8220;O&#8221; in &#8220;OpenLog&#8221; on the silkscreen (the bottom-left most pin in the image featured above). Timing here is of the essence; run the command below, hit enter on your keyboard, then immediately tap the other end of your grounded wire to pin 6. Don&#8217;t leave the wire sitting on pin 6, it&#8217;s just a quick tap to momentarily ground it and force a reset.</p>
<p style="text-align: left; padding-top: 0;">
<div id="_mcePaste">
<pre class="brush: plain; gutter: false;">$ avrdude -p atmega328p -P /dev/ttyUSB0 -c stk500v1 -b 57600 -U flash:w:main.hex</pre>
</div>
<p>Don&#8217;t forget to change the ttyUSB# number if necessary. If your timing was good enough, you should see avrdude show a progress bar as it flashes the hex firmware onto OpenLog. If not, you&#8217;ll likely see errors like &#8220;programmer not responding&#8221; or &#8220;out of sync&#8221;. Try try again. Tapping enter and grounding pin 6 should be almost instantaneous, with the enter key coming ever so slightly first.</p>
<p>After a few seconds, the updated firmware will now be on your OpenLog chip and you&#8217;ll be on your merry way. I hope this helps someone out there.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bretkuhns.com/blog/2010/03/flashing-openlog-firmware-in-ubuntu-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Free Day For All!</title>
		<link>http://www.bretkuhns.com/blog/2010/01/free-day-for-all/</link>
		<comments>http://www.bretkuhns.com/blog/2010/01/free-day-for-all/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 14:13:07 +0000</pubDate>
		<dc:creator>Bret Kuhns</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[freeday]]></category>
		<category><![CDATA[sparkfun]]></category>

		<guid isPermaLink="false">http://www.bretkuhns.com/blog/?p=34</guid>
		<description><![CDATA[SparkFun Electronics held their Free Day event on January 7th, 2010 at 11am EST. I had a few parts that I wanted to order for my senior design project this semester (more coming on that in another post) and was really excited to be able to get those parts for free during the event!
Or maybe [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sparkfun.com/">SparkFun Electronics</a> held their <a href="http://www.sparkfun.com/commerce/news.php?id=321">Free Day</a> event on January 7th, 2010 at 11am EST. I had a few parts that I wanted to order for my senior design project this semester (more coming on that in another post) and was really excited to be able to get those parts for free during the event!</p>
<p>Or maybe not. I hopped into the #Sparkfun chatroom on irc.freenode.net the morning of Free Day to check out what people were chatting about. To my dismay, hours before the event started, there were already almost 700 people in the chatroom. According to Sparkfun&#8217;s limitations on the event, only 1,000 $100 orders would be awarded. The numbers were already daunting. I pulled up the Sparkfun website to find their recently updated web servers were already buckling under the load of people preparing their shopping carts. Uh oh. As time neared 11am, the chatroom hit the 1,400 user mark and my hopes of free electronics started to dwindle.<span id="more-34"></span></p>
<p>Minutes before the event, I went to my shopping cart, and prepared to click the Checkout button on the hour. 11am struck, my finger punctually tapped the mouse button, and my order request was on it&#8217;s way across the &#8216;tubes to Sparkfun&#8217;s datacenter in Colorado&#8230; Minutes later, the page timed out and I sent the request again, and again. As the minutes went by, so did the time outs and blank white pages across my screen. Scanning the chatroom, I saw reports of people successfully reaching the shipping page, ready to submit their Free Day order; still nothing on my screen. After an hour of failed attempts, I finally reached the log-in screen. Gah, I logged in just before the event started to avoid this! After providing my account info, I waited another 10 minutes and reached the shipping page. The taste of success was on my tongue as many before me reported their completed orders shortly after reaching the shipping page. I gleefully submitted my shipping information.</p>
<p style="text-align: center;"><a rel="lightbox" href="http://www.bretkuhns.com/blog/wp-content/uploads/2010/01/sparkfun_free_day.png"><img class="size-medium wp-image-36 aligncenter" title="SparkFun Free Day" src="http://www.bretkuhns.com/blog/wp-content/uploads/2010/01/sparkfun_free_day-300x229.png" alt="" width="300" height="229" /></a></p>
<p>And that was the last I saw of Sparkfun.com. As I watched the Firefox throbber spin away, my heart dropped as people reported the giveaway totals nearing dangerously to the $100,000 limit. Before I could reach the billing page, SparkFun <a href="http://twitter.com/sparkfun/status/7486293215">announced on Twitter</a> that Free Day was officially over. And so were lost my dreams of free electronics. Sulked, I returned to the chatroom to read the flurry of exuberant posts from those who had successfully received their Free Day orders.</p>
<p>This story ends happily, however. Once the rush of traffic to Sparkfun&#8217;s site died down after the event, I was able to trim my bloated cart of electronic goodies to only that which I needed for my project, and proudly submitted my non-free order.</p>
<p>Thanks for the experience, Sparkfun.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bretkuhns.com/blog/2010/01/free-day-for-all/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

