Pages: [1]   Go Down
Author Topic: Using Arduino as ISP — Not able to programme anything  (Read 512 times)
0 Members and 1 Guest are viewing this topic.
Czech Republic
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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):

Code:
$ 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.

Code:
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!

Code:
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.

Code:
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?

Logged

South Texas
Offline Offline
Edison Member
*
Karma: 8
Posts: 1024
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

THis line right here has teh problem -

avrdude: Device signature = 0x1e950f
avrdude: Expected signature for AT90USB82 is 1E 93 82

AVR is expecting to get an ID response back of 1E 93 82 and your chip is responding 1E 95 0F.

If you are sure you have everything setup correctly and this is just a newer version of the chip you could add -F to your command telling AVRDudue to ignore the signature and program anyway. It looks like its there...

What version of Arduino IDE did you use to load the ArduinoISP sketch? if you did it with 1.0 there is a bug. Load the ArduinoISP sketch using 0.22 or 0.23. With Arduino-1.0 the ArduinoISP sketch only works at 9600 baud.
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 224
Posts: 6593
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

As stated in the previous post, ArduinoISP shipped with Arduino 1.0 doesn't work under Arduino 1.0. Either ask Crossroads for a copy of TinyISP (which I can confirm works under Arduino 1.0), or get a copy of the latest ArduinoISP which I am told works under 1.0.

However, it looks like the device signature needs to be patched too.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Pages: [1]   Go Up
Jump to: