Pages

Wednesday, April 18, 2012

Fixing bad fuse settings on Atmega328 with AVR Dragon

Once in a blue moon as I try to program an ATmega328 with an AVR Dragon, I will get an 'ISP Mode Error' message. Somehow, clock select fuse (SUT_CKSEL) changes from internal 8MHz oscillator to an external crystal (which my prototype circuit does not have), hence making ISP not work. I said somehow because I am not sure what is going on since I did not change the fuses intentionally. Guessing the circuit and the mess of jumper wires on the breadboard cause havoc.

Luckly, it is easy to 'un-brick' the chip by using Dragon's parallel programming. It's just annoying to get the ISP Mode Error and having to set up jumpers for the parallel programming. I should just make a little board with headers - but not now! In order to parallel program ATmega328, wire the chip to Dragon as shown on the Dragon Online Help:
After setting it up for parallel programming, connect to AVR Dragon with AVR Studio (I am using version 4.18) select 'PP/HVSP  Mode' from 'Programming Mode and Target Settings under Main tab. Then click on the fuses tab and set the fuses accordingly, and click program.



You can program a variety of AVR microcontrollers with Dragon and you can find default values of the fuses for your chip here.

If you don't have a dragon but an Arduino, you can use High Voltage Programmer shield. I don't know how good it is since I don't have one and haven't played with Arduino that much yet. But sounds like a cool project to mess around with.