Just something I noticed: I think you don't have to specify the
-P COM7 if you're using an USB programmer like the AVRisp (Arduino). At least I never did when I used the AVRisp to programm my perfboard USBtinyISP (ATtiny2313). Maybe that's why it's reading garbage, because it's trying to access the COM Port 7 somehow and nothing is connected to it?
http://www.ladyada.net/make/usbtinyisp/avrdude.htmlUsing it is simple, just indicate usbtiny as the programmer type. The port option is ignored as it always uses USB.
I think the Arduino AVRisp works the same way. (Might not be true for Linux?)
I managed to fix some AVRs with bad fuse settings this way:
- I set up my Arduino to generate a clock (basically the blinky sketch without delays is what I used here). Any other clock source will probably do, like the calibration output of a scope. If you own one.
- Hooked up the clock output of the toggleing Arduino to the XTAL1 input of the broken AVR. GND of Arduino connected to GND of the AVR (obviously).
Used USBtinyISP to flash fuses with following command:
avrdude.exe -p m168 -c usbtiny -U lfuse:w:0x62:m -U hfuse:w:0xdf:m -U efuse:w:0xf9:m -B 2000
Notes:
Not all AVRs have extended fuses (efuse).
The -B option specifies the ISP clock speed. 2000 is a rather slow value. It didn't work for me without that -B option. You can read some more about the -B option on the link to Lady Ada a bit further up my post.
I put in the default fuse settings for the ATmega168 (m168). You can find out the default fuse settings of many AVRs on this handy homepage:
http://www.engbedded.com/fusecalc/I admit I didn't read the full thread, so if this has been said before, I am sorry.
Cheers,
Florian