Hello,
I'd like to use Arduino as ISP, but it is not working as expect. I have Arduino Uno rev 2, I loaded sketch ArduinoISP from Examples in Arduino IDE v 1.0. Then, I want to program ATMega8U2 on my board (I have my own board with this microcontroller).
I connected pin 10 (Arduino) to reset, 11 to MOSI, 12 to MISO and 13 to clock. Then I connected 5V and GND from Arduino to my board. Now, here is my command I'm using for programming (on Mac):
$ avrdude -p at90usb82 -F -P /dev/tty.usbmodem411 \
> -c arduino \
> -U flash:w:UNO-dfu_and_usbserial_combined.hex \
> -U lfuse:w:0xFF:m \
> -U hfuse:w:0xD9:m \
> -U efuse:w:0xF4:m \
> -U lock:w:0x0F:m
Output from avrdude is long, so I put here just some lines:
This one I expected. I'm programming ATMega8u2 and I select AT90USB82.
avrdude: Device signature = 0x1e950f
avrdude: Expected signature for AT90USB82 is 1E 93 82
Here, avrdude is telling me the flash memory was saved and verified. But it is not true. After programming, I read flash memory (-U flash:r:flshread:i) and it contains old program. So flash was not programmed!
avrdude: verifying ...
avrdude: 7440 bytes of flash verified
Here I get another problem. Avrdude was writing lfuse, but it failed. Why? I don't get it.
avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
0xff != 0x00
avrdude: verification error; content mismatch
avrdude: safemode: lfuse changed! Was ff, and is now 0
Would you like this fuse to be changed back? [y/n] n
avrdude: safemode: Fuses OK
avrdude: stk500_recv(): programmer is not responding
Am I missing something?