I needed some friends and me, but after several hours of searching, trying, and debugging, we were able to fix this problem. I hope this helps other people who got the same problem to solve this problem.
The problem was that the ISP, in my case USB-Prog 3.3, was talking too quickly with my Atmega8, which only worked at 1 MHz. Thus, there are two possible solutions:
- slow down the speed of your ISP
- speed up Atmega8
I am somewhere red that the ISP should not be faster than 1/4 of the speed of the underlying microcontroller.
The following lines saved my day:
He sets Atmega8 to 8 MHz and gives him 64 ms to increase this frequency.
avrdude -p atmega8 -P usb -c avrispv2 -U lfuse:w:0xe4:m -U hfuse:w:0xd9:m -B 22
Here is an excerpt from the avrdude man page:
`-B BITCLOCK' Specify the bit clock period for the JTAG interface or the ISP clock (JTAG ICE only). The value is a floating-point number in microseconds. The default value of the JTAG ICE results in about 1 microsecond bit clock period, suitable for target MCUs running at 4 MHz clock and above. Unlike certain parameters in the STK500, the JTAG ICE resets all its parameters to default values when the programming software signs off from the ICE, so for MCUs running at lower clock speeds, this parameter must be specified on the command-line.
In addition, I want to recommend AVR Fuse Calculator for Android, which is apparently a very useful tool for microcontroller programmers.
source share