Go Down

Topic: ArduinoISP [closed] (Read 1 time) previous topic - next topic

anv

Jan 21, 2012, 09:00 pm Last Edit: Jan 22, 2012, 01:06 pm by anv Reason: 1
Hello. I am trying to program a new atmega238 chip.

I've got an Arduino Decimilia board and and an Arduino mega. I replaced the decimilia's chip with the new atmega328, written the program ArduinoISP from the examples. I selected "Arduino as ISP" in programmer, and selected Arduino Duemilanove with Atmega328 as board.

The connections are like in the tutorial: http://arduino.cc/en/Tutorial/ArduinoISP

When I lounchs "burn bootloader" from the menu, the response is

avrdude: stk500_recv(): programmer is not responding

I tried this from Linux and From Windows. To use the arduino as programmer under Linux I added a 10uF capacitor between reset and gnd pin to avoid resetting when the port is openned.

May be the Arduino ISP program does not work correctly in a the Arduino Mega (Atmega 1280)? Any ideas on how to find the problem?

Edit: I connected the heartbeat led and it does not blink. Then, I decided to use the decimilia as programmer, but connecting the new chip in a breadboard.

With the decimilia the heartbeat does blink OK. But When I try to burn the bootloader I receive this error:

avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.

Coding Badly

Quote
To use the arduino as programmer under Linux I added a 10uF capacitor between reset and gnd pin to avoid resetting when the port is openned.


Immediately after uploading the ArduinoISP sketch?

anv


Quote
To use the arduino as programmer under Linux I added a 10uF capacitor between reset and gnd pin to avoid resetting when the port is openned.


Immediately after uploading the ArduinoISP sketch?



I write the program as usual. Then I add the capacitor and from this moment, the chip cannot be reset. If I try to upload a new program without unplug the capacitor, the writting fails.

Coding Badly

Quote
May be the Arduino ISP program does not work correctly in a the Arduino Mega (Atmega 1280)?


That is a possibility.  Try the latest version from here...
http://code.google.com/p/mega-isp/

anv

#4
Jan 21, 2012, 10:20 pm Last Edit: Jan 21, 2012, 11:29 pm by anv Reason: 1

Quote
May be the Arduino ISP program does not work correctly in a the Arduino Mega (Atmega 1280)?


That is a possibility.  Try the latest version from here...
http://code.google.com/p/mega-isp/



Can't compile this program (arduino 1.0)

The error is this:

In file included from /usr/lib/arduino/hardware/arduino/cores/arduino/Arduino.h:212,
                 from ArduinoISP.cpp:56:
/usr/lib/arduino/hardware/arduino/variants/mega/pins_arduino.h:36: error: expected unqualified-id before numeric constant
/usr/lib/arduino/hardware/arduino/variants/mega/pins_arduino.h:37: error: expected unqualified-id before numeric constant
/usr/lib/arduino/hardware/arduino/variants/mega/pins_arduino.h:38: error: expected unqualified-id before numeric constant


Edit: resolved the problem: Arduino 1.0 defines the names for SCK, MOSI, MISO, etc. I replaced the constants on the program and it compiled ok but with the same result.

Calling avrisp in command-line, the response is this:


# /usr/lib/arduino/hardware/tools/avrdude -C/usr/lib/arduino/hardware/tools/avrdude.conf  -patmega328p -carduino -P/dev/ttyUSB0 -b19200 -Uflash:w:/usr/lib/arduino/hardware/arduino/bootloaders/atmega/ATmegaBOOT_168_atmega328.hex:i -Ulock:w:0x0F:m

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.04s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

GoForSmoke

I checked that tutorial link and see

Quote
NOTE: Currently, you cannot use an Arduino Uno as an ISP programmer because the optiboot bootloader does not support this sketch. A revision for this is in progress.


Is this optiboot bootloader on the ATmega on the board being used as ISP?

Maybe my UNO is older than that, 0022 was the current IDE when I got it.



I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Coding Badly

Quote
avrdude: Device signature = 0x000000


Usually an indication that the target is not powered, the wiring between the programmer and the target is not correct, or that the target is not correctly clocked.

How are you powering the Decimilia?  Do you have GND connected between the Decimilia and the Mega?

anv


Quote
avrdude: Device signature = 0x000000


Usually an indication that the target is not powered, the wiring between the programmer and the target is not correct, or that the target is not correctly clocked.

How are you powering the Decimilia?  Do you have GND connected between the Decimilia and the Mega?



The heartbeat blinks, the I think the gnd is connected.


anv

Semi solved the problem.

The problem was a bad crystal. The arduino ide programmed the fuses to use crystal oscilator, but the crystal was broken. I replaced it and it started detecting the chip, but the write process aborts. I tried also with a 8Mhz crystal-less setup with exactly the same result.

# /usr/lib/arduino/hardware/tools/avrdude -C/usr/lib/arduino/hardware/tools/avrdude.conf  -patmega328p -cstk500v1 -P/dev/ttyUSB0 -b19200 -Uflash:w:/usr/lib/arduino/hardware/arduino/bootloaders/atmega/ATmegaBOOT_168_atmega328.hex:i -Ulock:w:0x0F:m

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.12s

avrdude: Device signature = 0x1e950f
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "/usr/lib/arduino/hardware/arduino/bootloaders/atmega/ATmegaBOOT_168_atmega328.hex"
avrdude: writing flash (32670 bytes):

Writing | ###############################################    | 94% 0.01savrdude: stk500_recv(): programmer is not responding


I think it is better to start a new thread with this issue.

Go Up