<?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/"
	 xmlns:friends="wordpress-plugin-friends:feed-additions:1" >

<channel>
	<title>annoyances &#8211; Scott&#039;s Blog</title>
	<atom:link href="https://alfter.us/category/annoyances/feed/" rel="self" type="application/rss+xml" />
	<link>https://alfter.us</link>
	<description>Things that interest me</description>
	<lastBuildDate>Wed, 14 Apr 2021 06:20:22 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.5</generator>
<site xmlns="com-wordpress:feed-additions:1">230089306</site>	<item>
		<title>Hooray for old firmware in shipping hardware :-P</title>
		<link>https://alfter.us/2021/04/13/hooray-for-old-firmware-in-shipping-hardware-p/</link>
		
		<dc:creator><![CDATA[Scott Alfter]]></dc:creator>
		<pubDate>Wed, 14 Apr 2021 06:20:22 +0000</pubDate>
				<category><![CDATA[annoyances]]></category>
		<category><![CDATA[electronics]]></category>
		<guid isPermaLink="false">https://alfter.us/?p=8554</guid>

					<description><![CDATA[A while back, I picked up a cheap Chinese knockoff of a usbASP programmer from Amazon&#8230;originally, it was to replace the crummy factory-installed firmware on the Anet A8 motherboard with Marlin. The programmer did its job at the time and was forgotten about for a while. (The A8&#8217;s motherboard, meanwhile, crapped the bed after I [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>A while back, I picked up a cheap Chinese knockoff of a usbASP programmer from Amazon&#8230;originally, it was to replace the crummy factory-installed firmware on the Anet A8 motherboard with Marlin.  The programmer did its job at the time and was forgotten about for a while.  (The A8&#8217;s motherboard, meanwhile, crapped the bed after I had only had the printer up and running for maybe a month.  It&#8217;s long since been rebuilt into an AM8 and the electronics have likewise been through several upgrades, most recently to an SKR 1.4 Turbo with TMC5160 drivers just this past weekend&#8230;but that&#8217;s getting offtopic.)</p>



<p>I pulled the programmer out again to try configuring some ATMEGA328s for a project.  They&#8217;re empty chips ordered from DigiKey a while back, and I figured I&#8217;d try throwing Optiboot onto them.  This should be a simple matter of popping the ATMEGA328 off of an Arduino Uno, plugging in one of the empty chips, plugging the usbASP into the Arduino&#8217;s ICSP header, and invoking avrdude with the right options&#8230;right?</p>



<p>The programmer wasn&#8217;t having any of that.  With the preprogrammed chip in the Arduino, avrdude identified the chip, read out the fuses, etc.  With an empty chip, it wouldn&#8217;t read out the chip ID properly.  It said something about not being able to set the clock speed and that an upgrade might fix it.</p>



<p>The <a href="https://fischl.de/usbasp/">homepage</a> for the usbASP had some firmware images, so I grabbed the newest and flashed it according to <a href="https://www.instructables.com/How-to-Update-the-Firmware-on-a-Cheap-USBasp-Clone/">these instructions</a>.  The clock-speed error was gone, but it still wouldn&#8217;t work.  I tried swapping in other Arduinos and still had no luck.</p>



<p>A bit of poking around led me to <a href="https://github.com/nerdralph/usbasp">this fork</a> of the usbASP firmware, last updated just nine days ago.  (By comparison, the &#8220;update&#8221; I had previously applied was already ten years old!)  I burned that to the usbASP, popped an empty chip back into the Arduino Uno, and fired up avrdude.  Success!  I burned Optiboot, set the fuses, and switched cabling on the Arduino so it was connected with just a USB cable (as usual) instead of the usbASP.  The Arduino IDE saw it; I was able to send the &#8220;blinky&#8221; example to it and get the onboard LED blinking.</p>



<p>I was also able to diddle the fuse settings to change speeds from 16 MHz down to as low as 1 MHz and to run off the internal oscillator instead of an external crystal.  I have a stepper-motor tester I started building a while back that was stalled when I think I misprogrammed the fuses and switched it to crystal operation in a circuit with no crystal.  Now that the programmer is properly sorted out, I think it&#8217;s time to dig up the parts and finish this project.</p>
]]></content:encoded>
					
		
		
		<friends:post-format>standard</friends:post-format>
<post-id xmlns="com-wordpress:feed-additions:1">8554</post-id>	</item>
	</channel>
</rss>
