<?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>Half-Byte &#187; fuse</title>
	<atom:link href="http://half-byte.com/tag/fuse/feed/" rel="self" type="application/rss+xml" />
	<link>http://half-byte.com</link>
	<description>Doing more with less.</description>
	<lastBuildDate>Fri, 23 Sep 2011 17:57:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Bricking an ATTiny2313 and getting LED&#8217;s to flicker with a 12MHz external clock</title>
		<link>http://half-byte.com/2008/06/30/bricking-an-attiny2313-and-getting-leds-to-flicker-with-a-12mhz-external-clock/</link>
		<comments>http://half-byte.com/2008/06/30/bricking-an-attiny2313-and-getting-leds-to-flicker-with-a-12mhz-external-clock/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 08:32:46 +0000</pubDate>
		<dc:creator>nibble</dc:creator>
				<category><![CDATA[Project]]></category>
		<category><![CDATA[attiny2313]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[brick]]></category>
		<category><![CDATA[ceramic resonator]]></category>
		<category><![CDATA[fuse]]></category>
		<category><![CDATA[LED]]></category>

		<guid isPermaLink="false">http://www.half-byte.com/2008/06/30/bricking-an-attiny2313-and-getting-leds-to-flicker-with-a-12mhz-external-clock/</guid>
		<description><![CDATA[<p>A while ago I was doing some mindless fiddling with project&#8217;s makefiles and happened upon some fuse code. I gave it a shot and immediately found it to have destroyed my ATTiny2313 chip; &#8220;bricked&#8221; it if you will. A few more attempts at trying restore the fuse bytes failed and even reading the signature [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago I was doing some mindless fiddling with project&#8217;s makefiles and happened upon some fuse code.  I gave it a shot and immediately found it to have destroyed my ATTiny2313 chip; &#8220;bricked&#8221; it if you will.  A few more attempts at trying restore the fuse bytes failed and even reading the signature of the chip failed.  It appeared as though I wiped the chip.  I got a little worried after looking over my inventory of hardware and only found one more AVR microprocessor.  So, I sent off another order with <a href="http://www.mouser.com/">Mouser Electronics</a> for a batch of spares.  They got the mailing and billing addresses mixed up, but I forgive them since they aren&#8217;t far from where I grew up.</p>
<p>I then spent some time with a very basic circuit and code just trying to get my bearings with the toolchain.  It is basically an ATTiny2313 hooked up to a USB cable for power (@5V) and a couple of LED&#8217;s and resistors.  The LED&#8217;s alternate blinking to indicate the clock speed.  Figuring out how to code a delay was a bit of a hassle, since I was working with pre-existing code for the USBTinyISP and it was using a variable that was initialized by data received over the bus.  I ended up using a simple loop to delay the LED state change.</p>
<p>Since I&#8217;m hoping to mess with USB, I need to get my microprocessor running at 12MHz.  So, I did some more in depth research on clock sources and decided to make an attempt at using an external 12MHz ceramic resonator clock.  The ATTiny2313 by default runs at 8MHz with the internal clock.  So, changing it requires mucking with the fuse bytes, which I already had a negative experience with before.  This time I was a little more informed an careful.  I used this <a href="http://palmavr.sourceforge.net/cgi-bin/fc.cgi">AVR Fuse Calculator</a> web page and made the bare minimum changes necessary.  The default low and high fuse bytes for the ATTiny2313 are: 0&#215;64 0xDF.  Since the external clock only requires the low byte to change I ended up using: 0xEF.  Here&#8217;s the command line:<br />
<code><br />
&gt; avrdude -c usbtiny -pt2313 -U lfuse:w:0xef:m<br />
</code></p>
<p>Before running the above command I took out the 3 pronged ceramic resonator (3 pronged because it has the capacitors included in its housing).  I didn&#8217;t want any more variables affecting my fusing.  Also, I recommend you read the fuse bytes before writing them.  You may want to write it down just in case you decide you want to return the chip back to the initial state.   Immediately after running the command, the LED&#8217;s stopped blinking and it looked like I busted it.  But I knew better.  Once the resonator was plugged into the proto board, the LED light up again, and with a break neck pace&#8230; 50 percent quicker.</p>
<p>This was pretty damn cool.  Doing these simple projects are small steps to getting to where I want to be.  In the process I&#8217;ve been able to learn the basics of programming an AVR chip.  Even now, I think I can plug my previous &#8220;bricked&#8221; chip in with an external clock and get it to work.  The microprocessor is just waiting for a clock source to tell it to drive.  So, an &#8220;un-broken&#8221; chip is icing on top of what I&#8217;ve learned.</p>
]]></content:encoded>
			<wfw:commentRss>http://half-byte.com/2008/06/30/bricking-an-attiny2313-and-getting-leds-to-flicker-with-a-12mhz-external-clock/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

