<?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>LogikDevelopment &#187; AVR</title>
	<atom:link href="http://www.logikdev.com/category/avr/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.logikdev.com</link>
	<description>&#34;Il n&#039;y a pas de problème, il n&#039;y a que des solutions. L&#039;esprit de l&#039;homme invente ensuite le problème.&#34; André Gide</description>
	<lastBuildDate>Sun, 06 May 2012 12:29:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Reset clock fuse bits on AVR</title>
		<link>http://www.logikdev.com/2011/02/15/reset-clock-fuse-bits-on-avr/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=reset-clock-fuse-bits-on-avr</link>
		<comments>http://www.logikdev.com/2011/02/15/reset-clock-fuse-bits-on-avr/#comments</comments>
		<pubDate>Tue, 15 Feb 2011 21:39:12 +0000</pubDate>
		<dc:creator>smoreau</dc:creator>
				<category><![CDATA[AVR]]></category>
		<category><![CDATA[ATtiny13A]]></category>
		<category><![CDATA[fuse bytes]]></category>
		<category><![CDATA[low-frequency oscillator]]></category>
		<category><![CDATA[microcontrollers]]></category>

		<guid isPermaLink="false">http://www.logikdev.com/?p=1061</guid>
		<description><![CDATA[I am just starting to learn about AVR programming and I really enjoy myself! Except maybe when I play with the fuse bytes and I screw things up&#8230; Basically, I was using a ATtiny13A microcontroller and I configured the fuse bytes to use the internal low-frequency oscillator running at 128kHz. I thought it would be [...]]]></description>
			<content:encoded><![CDATA[<p>I am just starting to learn about AVR programming and I really enjoy myself! <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
Except maybe when I play with the fuse bytes and I screw things up&#8230;</p>
<p>Basically, I was using a <a href="http://www.atmel.com/dyn/products/product_card.asp?part_id=4347"><strong>ATtiny13A</strong></a> microcontroller and I configured the fuse bytes to use the internal low-frequency oscillator running at 128kHz. I thought it would be a good idea to check if my simple blinking LED program was still working with this internal oscillator.<br />
The good news is the LED was still blinking. But the bad news is I wasn&#8217;t able to reprogram the chip anymore&#8230; <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  After some research, I figure it out: the ISP interface needs to run slower than the microcontroller in order to flash it! And obviously, my ISP interface was running faster than 128kHz&#8230;</p>
<p>These microcontrollers are very cheap so I could just throw it away. But I am not the kind of person to give up without a fight! <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
So I talked to my friend Google and he suggested me to read the following article: <a href="http://www.evilmadscientist.com/article.php?story=avrclockbits">Fixing a bad frequency fuse bit on an AVR</a>.<br />
I followed the instructions and here is the output:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
C:\AVR&gt;avrdude -p attiny13 -P usb -c usbtiny -tuF

avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
avrdude: Expected signature for ATtiny13 is 1E 90 07
avrdude&gt; sck 1000
&gt;&gt;&gt; sck 1000
avrdude: Setting SCK period to 250 usec
avrdude&gt; e
&gt;&gt;&gt; e
avrdude: erasing chip
avrdude&gt; sck 10
&gt;&gt;&gt; sck 10
avrdude: Setting SCK period to 10 usec
avrdude&gt; quit
&gt;&gt;&gt; quit

avrdude done. Thank you.
</pre>
<p>However, there is a missing instruction in this article. Indeed, these instructions erased the chip but didn&#8217;t fix the fuses, so now it&#8217;s blank but the fuses are still wrong!<br />
In order to reprogram the fuses, you need to use the &#8216;-B250&#8242; in the command line:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
avrdude -p attiny13 -P usb -c usbtiny -U lfuse:w:0x6A:m -U hfuse:w:0xFF:m -B250
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.logikdev.com/2011/02/15/reset-clock-fuse-bits-on-avr/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

