This post originated from an RSS feed registered with Python Buzz
by Aaron Brady.
Original Post: 11
Feed Title: insom.me.uk
Feed URL: http://feeds2.feedburner.com/insommeuk
Feed Description: Posts related to using Python. Some tricks and tips, observations, hacks, and the Brand New Things.
I was playing with one of my left-over populated Radio 1 boards. I’ve
recently gotten a USBasp (knock-off) from eBay and back when I was designing
the board I actually thought ahead. I put a standard 6-pin programming header
on the board, even though I was just using a Bus Pirate to flash them.
I wasn’t sure what state the fuses and firmware were in, so I read them with
avrdude and plugged them into an online fuse calculator. That’s when I saw
you can actually clock these down to 128KHz on the internal RC oscillator.
Interesting! The board was running a version of the Arduino blink sketch
anyway - how slow is 128KHz? So, I set the fuses to find out:
% avrdude -c usbasp-clone -p m328p -U lfuse:w:0xe3:m
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: AVR device initialized and ready to accept instructions
avrdude: writing lfuse (1 bytes)
(Check out that warning: it’s going to be relevant in a minute).
Cool, so at this rate it takes an age to flash the LED. I’m not sure what I
was expecting. I’ll just put it back how it was:
% avrdude -c usbasp-clone -p m328p -U lfuse:w:0xe2:m
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: error: program enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
Ruh-roh.
The 328 is now clocked too slow to speak SPI at the default rate, so I can’t
flash it back. The USBasp is running too old a firmware to slow down its clock.
Now to begin “a game of programmers”.
I need to use the USBasp to program a Boarduino with the Arduino firmware (it
previously had its Arduino bootloader wiped):