<?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>Jesse Peterson &#187; avr</title>
	<atom:link href="http://www.jpeterson.com/tag/avr/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jpeterson.com</link>
	<description>Personal ramblings of a computer geek in Iowa</description>
	<lastBuildDate>Thu, 26 Jan 2012 04:16:38 +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>My first Butterfly program&#8230; success!</title>
		<link>http://www.jpeterson.com/2008/04/07/my-first-butterfly-program-success/</link>
		<comments>http://www.jpeterson.com/2008/04/07/my-first-butterfly-program-success/#comments</comments>
		<pubDate>Tue, 08 Apr 2008 04:35:32 +0000</pubDate>
		<dc:creator>cubeinhabitant</dc:creator>
				<category><![CDATA[Project]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[butterfly]]></category>
		<category><![CDATA[microcontroller]]></category>

		<guid isPermaLink="false">http://www.jpeterson.com/2008/04/07/my-first-butterfly-program-success/</guid>
		<description><![CDATA[My first program, Blinky, from the &#8220;C Programming for Microcontrollers&#8221; book has been downloaded to my Butterfly ATMega169 and works. The program cycles through 8 LEDs, turning one LED on at a time. It looks like the Cylon robots (old school &#8211; or the newer Cylon Centurions from the new series) robots. (Or the original [...]]]></description>
			<content:encoded><![CDATA[<p>My first program, Blinky, from the &#8220;<a href="http://www.smileymicros.com/index.php?module=pagemaster&amp;PAGE_user_op=view_page&amp;PAGE_id=26">C Programming for Microcontrollers</a>&#8221; book has been downloaded to my Butterfly ATMega169 and works. The program cycles through 8 LEDs, turning one LED on at a time. It looks like the <a href="http://en.wikipedia.org/wiki/Cylon_(Battlestar_Galactica)">Cylon</a> robots (old school &#8211; or the newer <a href="http://en.wikipedia.org/wiki/Cylon_(re-imagining)">Cylon Centurions</a> from the new series) robots. (Or the original <a href="http://en.wikipedia.org/wiki/KITT">KITT</a> from &#8220;Knight Rider&#8221;.)</p>
<p>I had a problem initially with downloading the &#8220;hex&#8221; file to the Butterfly. It appeared to be the serial port&#8230; ahhhh, serial ports. So, if you get the <a href="http://www.smileymicros.com/index.php?module=pagemaster&amp;PAGE_user_op=view_page&amp;PAGE_id=35&amp;MMN_position=67:67">Butterfly++ Mini-Kit</a>, you get a DB-9 female connector and some wire. The <a href="http://www.smileymicros.com/Butterfly++.pdf">&#8220;Butterfly++ Mini-Kit Assembly Instructions&#8221;</a>, and the book, instruct that you are to wire the DB-9 connector to certain holes on the Butterfly. The instructions indicate that you cross the transmit and receive lines from the Butterfly to the connector.  Okay, all is good&#8230; so far.</p>
<p>It is very hard to find a serial cable now: USB rules. But I did find a <a href="http://www.bestbuy.com/site/olspage.jsp?skuId=7135664&amp;st=serial+cable&amp;lp=5&amp;type=product&amp;cp=1&amp;id=1110263657278">USB-Serial adapter</a> at Best Buy. One end is a USB connector and the other end is a DB-9 male connector. I installed the driver, for Windows XP, and installed the cable. It installed like a charm as &#8220;COM5&#8243;. I was able to use the terminal program provided on the CD with the book and use &#8220;COM5&#8243; and communicate with the built-in Butterfly program to set my name for the &#8220;name tag&#8221; function of the factory-programmed Butterfly.</p>
<p>But then when I used the provided <a href="http://">AVR Studio</a> to try and download the Blinky program to the Butterfly, AVR Studio couldn&#8217;t find a suitable device. Hmm. It appeared the AVR Studio provided on the book&#8217;s CD wasn&#8217;t working with the USB serial device. I even tried upgrading to the latest AVR Studio downloaded from the <a href="http://www.atmel.com">Atmel site</a>. It still wouldn&#8217;t program.</p>
<p>I did have a &#8220;real&#8221; serial port on my computer, which is a DB-9 male connector. But I couldn&#8217;t find a DB-9 M-F connector in my collection of cables. I had <a href="http://en.wikipedia.org/wiki/Null_modem">null modem</a> DB-9 F-F and DB-9 M-M (null modem cables have the transmit and receive links cross-linked). Then I thought, wait! The Butterfly has a DB-9 female connection and the computer has a DB-9 male connector; just hook them together. The problem is the Butterly DB-9 female connector is connected to the Butterfly with about 2.5 inches of wire. So it took a bunch of rearranging to get the Butterfly close enough to the serial port on the computer, which is in the back of the computer. But I was able to get the Butterfly, the power supply, and the breadboard with the LEDs for the Blinky project close enough. Now, with the Butterfly directly connected to &#8220;COM1&#8243;, the AVR Studio found the device. I was able to download and program the Blinky.hex file. After successfully downloading to the Butterfly and cycling the power to the Butterfly (and moving the joystick &#8220;up&#8221;), Blinky started up and blinked the LEDs, sweeping back and forth.</p>
<p>So it appears that I need a DB-9 M-F &#8220;straight through&#8221; serial cable. (I have seen this type of cable referred to as an &#8220;extension&#8221; serial cable too. No wonder everyone likes USB better-it just seems to work, but it is more complex at the signal and component level.) I was able to find at <a href="http://www.cablesforless.com">Cables for Less</a> a six foot DB-9 male to female cable for $1.89. I ordered it. With shipping the total came to $8.48. Hopefully it will come soon so that I can get the Butterfly out from behind my computer. But at least I have successfully tested the ability to program the Butterfly.</p>
<p>(I think that there is some way to download the hex file using <a href="http://www.bsdhome.com/avrdude/">avrdude</a> instead of the AVR Studio. This may allow the USB-Serial adapter cable to work on &#8220;COM5&#8243;. But I haven&#8217;t had a chance to try that yet.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jpeterson.com/2008/04/07/my-first-butterfly-program-success/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Butterfly++ WORKS!</title>
		<link>http://www.jpeterson.com/2008/04/05/butterfly-works/</link>
		<comments>http://www.jpeterson.com/2008/04/05/butterfly-works/#comments</comments>
		<pubDate>Sun, 06 Apr 2008 03:32:18 +0000</pubDate>
		<dc:creator>cubeinhabitant</dc:creator>
				<category><![CDATA[Project]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[atmel]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[butterfly]]></category>
		<category><![CDATA[microcontroller]]></category>

		<guid isPermaLink="false">http://www.jpeterson.com/2008/04/05/butterfly-works/</guid>
		<description><![CDATA[I had purchased a &#8220;Book + Butterfly + Projects Kit&#8221; from Smiley Micros some time ago. The AVR Butterfly is a demonstration board for a Atmel AVR ATmega169PV microcontroller. The package that I purchased included, in addition to the Butterfly, a book and some components in the &#8220;project kit&#8221; to execute the samples from the [...]]]></description>
			<content:encoded><![CDATA[<p align="left"><a href="http://www.jpeterson.com/wordpress/wp-content/uploads/2008/04/butterfly.jpg" title="AVR Butterfly"><img src="http://www.jpeterson.com/wordpress/wp-content/uploads/2008/04/butterfly.thumbnail.jpg" alt="AVR Butterfly" align="right" hspace="10" /></a>I had purchased a &#8220;<a href="http://">Book + Butterfly + Projects Kit</a>&#8221; from <a href="http://www.smileymicros.com">Smiley Micros</a> some time ago. The <a href="http://en.wikipedia.org/wiki/AVR_Butterfly">AVR Butterfly</a> is a demonstration board for a <a href="http://www.atmel.com/">Atmel</a> <a href="http://www.atmel.com/dyn/products/devices.asp?family_id=607">AVR</a> <a href="http://www.atmel.com/dyn/products/product_card.asp?part_id=3895">ATmega169PV</a> microcontroller. The package that I purchased included, in addition to the Butterfly, a book and some components in the &#8220;project kit&#8221; to execute the samples from the book. The first thing that you have to do is add a connector it the board so that you can add a serial port connection. The serial port connection is used to download code to the microcontroller. The kit includes some wires and a female DB-9 connector which you get to solder together. I did it (successfully). The kit also includes a battery pack that you get to mod to add an LED as a power indicator and some headers to solder to the Butterfly to make it easier to attach and reconfigure wires to the device.</p>
<p align="left">After performing this preliminary soldering, I followed the test procedures to make sure that it works. I was able to power the Butterfly from the external battery source and download my name via the serial port to the Butterfly. (The Butterfly has a sample program that will display your name on its LCD display.)</p>
<p align="left">Now that the preliminary work is done, I can try the samples from the book&#8230; (I am finally putting my EE degree to use!) and maybe write my own code. (Yeah, I do write code, like web applications, for a living. Not usually something as cool as making blinking LEDs!)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jpeterson.com/2008/04/05/butterfly-works/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

