Instructables

How to use Arduino Mega 2560 as Arduino isp

Picture of How to use Arduino Mega 2560 as Arduino isp
When i build my Atmega328p-pu on a circuit board for my moped i needed to bootload it.
Because i have none external programming equipment i needed to use my Arduino Mega 2560 as ArduinoISP ( http://arduino.cc/en/Tutorial/ArduinoISP  ) . 


You need:
-Arduino mega
-Breadboard or pcb made atmega chip arduino
-100nF capacitor
-usb cable for arduino mega 2560 -> pc
-arduino IDE ( http://arduino.cc )
-some wires to connect the arduino mega 250 to your homemade arduino.

One of the difficulties of the mega board is that all the pins are different so most tutorials who are aimed at the UNO board or the Duemilanove or Diecimila are useless because the Mega board pinout is different.

To know which pinout is needed for the Arduino Mega 2560 the arduino.cc website has a special webpage : ( http://arduino.cc/en/Main/ArduinoBoardMega2560  ) .

This is how you need to wire up your arduino mega 2560 to an Atmega 168/328 (same pinout)  microchip : See picture above

PS. For the exact pinout of an Atmega 168/328 chip look : http://softsolder.files.wordpress.com/2009/09/arduino-vs-atmega168-chip-pinouts.png?w=640&h=302

The High resolution picture of how to hook the arduino up : http://i54.tinypic.com/k55pb9.png
 
Remove these adsRemove these ads by Signing Up

Step 1: Uploading the ArduinoISP sketch

Now open the latest version of the Arduino IDE (currently 0022) .
Goto Tools
                     -> Board
                                      ->  Arduino Mega 2560

Now choose the correct Com port via Tools -> Serial port -> select the port used by you're arduino mega 2560.

Goto File 
                -> Examples
                                       -> ArduinoISP

The ArduinoISP sketch will open up and now click upload to upload the sketch to the Arduino Mega 2560.

When the sketch is fully uploaded  Put a 100nF Capacitor Between +5V and RESET pin on the Arduino Mega 2560 to disable auto reset. (whitout this tutorial wont work !)
By the way, the bootloader also seems to be hardcoded to 16MHz - and this now allows me to upload my scripts via the serial interface as well.
I just tell it to upload, hit the reset, and away it goes. This never worked at the 14.7456MHz frequency either and gave the errors mentioned in my other post.
I have run into the avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51 (or resp=0x68 or resp=0x?? where ?? can be any number of different numbers) and the one thing that nobody seems to mention, which I finally figured out on my own is that serial is VERY timing dependant - and as such, if your serial library derives it's timing from the processor's clock, then your clock must be running at the same frequency.
I had a project where the serial communications simply wouldn't work after I moved the project off the Arduino board.
The problem? When I moved the project, I used a 14.7456MHz oscillator. I used that frequency because it usually makes writing serial timing easier since the baud rates are even divisions of this frequency. Unfortunately since I was using a standard library when developing it on the Arduino, it was all made for a 16MHz clock.
Once I changed the standalone circuit crystal to 16MHz, suddenly everything worked!
I hope this helps someone in the future !!! I know I was stumped for quite a while with this!
EpicLazer1 year ago
This project is great
Thanks for the tutorial
Daniello1 year ago
I had some problems with burning the bootloader.
I used Arduino MEGA 2560 and tried to burn bootloader in Arduino Duemilanove 326P.
Everything was connected according to the tutorial, but It resulted in error messages "out of sync".
I solved it by changing the heartbeat from 40 to 20.
leeseibert1 year ago
Thanks for the tutorial. Most of the documentation out there assumes you are using an Uno or a Due. I made a video to illustrate the differences for the Mega type boards.

Check it out here:
https://www.youtube.com/watch?v=DebJ1s5I3QM
tsillen (author) 1 year ago
If you keep having problems and want to fix them just buy an programmer from Atmel , they are only like 30 USD and are really easy to use whit AVR studio and you can burn the Arduino firmware whit it.
hi sir,
I am bharat i am using Arduino mega 2560 while uploading i getting this error what to do next sir to overcome this problem please help me
thanking you



C:\arduino-1.0.1\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=101 -IC:\arduino-1.0.1\hardware\arduino\cores\arduino -IC:\arduino-1.0.1\hardware\arduino\variants\mega C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\ReadAnalogVoltage.cpp -o C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\ReadAnalogVoltage.cpp.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=101 -IC:\arduino-1.0.1\hardware\arduino\cores\arduino -IC:\arduino-1.0.1\hardware\arduino\variants\mega C:\arduino-1.0.1\hardware\arduino\cores\arduino\WInterrupts.c -o C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\WInterrupts.c.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=101 -IC:\arduino-1.0.1\hardware\arduino\cores\arduino -IC:\arduino-1.0.1\hardware\arduino\variants\mega C:\arduino-1.0.1\hardware\arduino\cores\arduino\wiring.c -o C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\wiring.c.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=101 -IC:\arduino-1.0.1\hardware\arduino\cores\arduino -IC:\arduino-1.0.1\hardware\arduino\variants\mega C:\arduino-1.0.1\hardware\arduino\cores\arduino\wiring_analog.c -o C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\wiring_analog.c.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=101 -IC:\arduino-1.0.1\hardware\arduino\cores\arduino -IC:\arduino-1.0.1\hardware\arduino\variants\mega C:\arduino-1.0.1\hardware\arduino\cores\arduino\wiring_digital.c -o C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\wiring_digital.c.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=101 -IC:\arduino-1.0.1\hardware\arduino\cores\arduino -IC:\arduino-1.0.1\hardware\arduino\variants\mega C:\arduino-1.0.1\hardware\arduino\cores\arduino\wiring_pulse.c -o C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\wiring_pulse.c.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=101 -IC:\arduino-1.0.1\hardware\arduino\cores\arduino -IC:\arduino-1.0.1\hardware\arduino\variants\mega C:\arduino-1.0.1\hardware\arduino\cores\arduino\wiring_shift.c -o C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\wiring_shift.c.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=101 -IC:\arduino-1.0.1\hardware\arduino\cores\arduino -IC:\arduino-1.0.1\hardware\arduino\variants\mega C:\arduino-1.0.1\hardware\arduino\cores\arduino\CDC.cpp -o C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\CDC.cpp.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=101 -IC:\arduino-1.0.1\hardware\arduino\cores\arduino -IC:\arduino-1.0.1\hardware\arduino\variants\mega C:\arduino-1.0.1\hardware\arduino\cores\arduino\HardwareSerial.cpp -o C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\HardwareSerial.cpp.o
C:\arduino-1.0.1\hardware\arduino\cores\arduino\HardwareSerial.cpp: In function 'void store_char(unsigned char, ring_buffer*)':
C:\arduino-1.0.1\hardware\arduino\cores\arduino\HardwareSerial.cpp:82: warning: comparison between signed and unsigned integer expressions
C:\arduino-1.0.1\hardware\arduino\cores\arduino\HardwareSerial.cpp: In member function 'virtual size_t HardwareSerial::write(uint8_t)':
C:\arduino-1.0.1\hardware\arduino\cores\arduino\HardwareSerial.cpp:390: warning: comparison between signed and unsigned integer expressions
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=101 -IC:\arduino-1.0.1\hardware\arduino\cores\arduino -IC:\arduino-1.0.1\hardware\arduino\variants\mega C:\arduino-1.0.1\hardware\arduino\cores\arduino\HID.cpp -o C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\HID.cpp.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=101 -IC:\arduino-1.0.1\hardware\arduino\cores\arduino -IC:\arduino-1.0.1\hardware\arduino\variants\mega C:\arduino-1.0.1\hardware\arduino\cores\arduino\IPAddress.cpp -o C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\IPAddress.cpp.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=101 -IC:\arduino-1.0.1\hardware\arduino\cores\arduino -IC:\arduino-1.0.1\hardware\arduino\variants\mega C:\arduino-1.0.1\hardware\arduino\cores\arduino\main.cpp -o C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\main.cpp.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=101 -IC:\arduino-1.0.1\hardware\arduino\cores\arduino -IC:\arduino-1.0.1\hardware\arduino\variants\mega C:\arduino-1.0.1\hardware\arduino\cores\arduino\new.cpp -o C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\new.cpp.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=101 -IC:\arduino-1.0.1\hardware\arduino\cores\arduino -IC:\arduino-1.0.1\hardware\arduino\variants\mega C:\arduino-1.0.1\hardware\arduino\cores\arduino\Print.cpp -o C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\Print.cpp.o
C:\arduino-1.0.1\hardware\arduino\cores\arduino\Print.cpp: In member function 'size_t Print::print(const __FlashStringHelper*)':
C:\arduino-1.0.1\hardware\arduino\cores\arduino\Print.cpp:44: warning: '__progmem__' attribute ignored
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=101 -IC:\arduino-1.0.1\hardware\arduino\cores\arduino -IC:\arduino-1.0.1\hardware\arduino\variants\mega C:\arduino-1.0.1\hardware\arduino\cores\arduino\Stream.cpp -o C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\Stream.cpp.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=101 -IC:\arduino-1.0.1\hardware\arduino\cores\arduino -IC:\arduino-1.0.1\hardware\arduino\variants\mega C:\arduino-1.0.1\hardware\arduino\cores\arduino\Tone.cpp -o C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\Tone.cpp.o
C:\arduino-1.0.1\hardware\arduino\cores\arduino\Tone.cpp:93: warning: only initialized variables can be placed into program memory area
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=101 -IC:\arduino-1.0.1\hardware\arduino\cores\arduino -IC:\arduino-1.0.1\hardware\arduino\variants\mega C:\arduino-1.0.1\hardware\arduino\cores\arduino\USBCore.cpp -o C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\USBCore.cpp.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=101 -IC:\arduino-1.0.1\hardware\arduino\cores\arduino -IC:\arduino-1.0.1\hardware\arduino\variants\mega C:\arduino-1.0.1\hardware\arduino\cores\arduino\WMath.cpp -o C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\WMath.cpp.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=101 -IC:\arduino-1.0.1\hardware\arduino\cores\arduino -IC:\arduino-1.0.1\hardware\arduino\variants\mega C:\arduino-1.0.1\hardware\arduino\cores\arduino\WString.cpp -o C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\WString.cpp.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-ar rcs C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\core.a C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\WInterrupts.c.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-ar rcs C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\core.a C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\wiring.c.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-ar rcs C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\core.a C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\wiring_analog.c.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-ar rcs C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\core.a C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\wiring_digital.c.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-ar rcs C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\core.a C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\wiring_pulse.c.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-ar rcs C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\core.a C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\wiring_shift.c.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-ar rcs C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\core.a C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\CDC.cpp.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-ar rcs C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\core.a C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\HardwareSerial.cpp.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-ar rcs C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\core.a C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\HID.cpp.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-ar rcs C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\core.a C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\IPAddress.cpp.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-ar rcs C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\core.a C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\main.cpp.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-ar rcs C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\core.a C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\new.cpp.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-ar rcs C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\core.a C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\Print.cpp.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-ar rcs C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\core.a C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\Stream.cpp.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-ar rcs C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\core.a C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\Tone.cpp.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-ar rcs C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\core.a C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\USBCore.cpp.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-ar rcs C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\core.a C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\WMath.cpp.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-ar rcs C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\core.a C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\WString.cpp.o
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-gcc -Os -Wl,--gc-sections,--relax -mmcu=atmega2560 -o C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\ReadAnalogVoltage.cpp.elf C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\ReadAnalogVoltage.cpp.o C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\core.a -LC:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp -lm
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\ReadAnalogVoltage.cpp.elf C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\ReadAnalogVoltage.cpp.eep
C:\arduino-1.0.1\hardware\tools\avr\bin\avr-objcopy -O ihex -R .eeprom C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\ReadAnalogVoltage.cpp.elf C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\ReadAnalogVoltage.cpp.hex
Binary sketch size: 5,198 bytes (of a 258,048 byte maximum)
C:\arduino-1.0.1\hardware/tools/avr/bin/avrdude -CC:\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega2560 -cwiring -P\\.\COM3 -b115200 -D -Uflash:w:C:\DOCUME~1\SH\LOCALS~1\Temp\build8476703640344052643.tmp\ReadAnalogVoltage.cpp.hex:i

avrdude: Version 5.11, compiled on Sep 2 2011 at 19:38:36
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "C:\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf"

Using Port : \\.\COM3
Using Programmer : wiring
Overriding Baud Rate : 115200
avrdude: wiring_open(): releasing DTR/RTS
avrdude: wiring_open(): asserting DTR/RTS
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer

avrdude done. Thank you.

AptPupil1 year ago
So, my question is...You can't actually upload a sketch to a breadboarded Arduino with a Mega 2560 as a programmer, only the bootloader? Is this correct? Unfortunately, I'm not a programmer (yet), but can't a sketch be written to board #1, an Arduino board (Uno, Mega 2560, BBB, etc.) that contains a sketch inside of it that is output , as data would be sent to any other device (motor, LCD, etc.),  to board #2, an Arduino board (Uno, Mega 2560, BBB, etc.)? I suppose that the sketch on board #1 would cause it to be uploaded to board #2. Essentially, board #1 would be acting as a PC (or Mac) that is uploading a sketch to an Arduino. Would the sketch end up being too large, or is it just not feasible?

Just a thought,
Apt (or am I??) 
Lentrave2 years ago
Hi ... i try your tutorial but it doesn't work i always have this error :
avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.
tsillen (author)  Lentrave2 years ago
That means it cannot read the device id of the micro controller.
The software or you messed up something. Retry a couple of times, that will probably fix it.

arduinofish2 years ago
Hello,

i used a 100uF Cap and get "avrdude: stk500_getsync(): not in sync: resp=0x00"
DO i really need a 100nF?

tsillen (author)  arduinofish2 years ago
you can try a value like 1/2uF like posted below.
The error means that it cannot synchronize correctly.
lifeforce42 years ago
Maybe add that a 0.1µF Cap is the same as 100nF for people that are new to electronics and don't understand u/n/pF.

A more simple idea would be to absorb the ground pulse from the auto reset capacitor with a larger cap 2uf+. I had a 2.2uf 50v cap lying around and use that to prevent the board from auto resetting. yet the reset button will work fine. :)

Simple modification of the blink code to test the 2.2uf cap connection from GND and RESET. The image shows the counter was not reset no matter how many times I connected/disconnected from the serial line but pressing the button caused a reset back to 1.

/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.

This example code is in the public domain.
*/

// a simple counter to show the number and it betting reset when the reset button is pressed but not when you connect or disconnect from the serial.
int counter = 0;

void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);
// create a serial connection with a speed of 9600
Serial.begin(9600);
}

void loop() {
// increment the counter to show it's working
counter++;
// print the counter to the serial connection
Serial.println(counter, DEC);

digitalWrite(13, HIGH); // set the LED on
delay(1000); // wait for a second
digitalWrite(13, LOW); // set the LED off
delay(1000); // wait for a second
}
2.2uF_Cap_GND-to-RESET.jpg
mbrown422 years ago
I had to make one modification to the sketch to get it to work. I had to change the pin definitions at the beginning to this:


#define SCK 52
#define MISO 50
#define MOSI 51
#define RESET 53
vishalapr3 years ago
Cool! I don't have an arduino mega but I am getting one soon! I am sooo gonna try this once I get it!!!
tsillen (author)  vishalapr3 years ago
I found out it was difficult because nobody posted on the arduino forum how to ArduinoISP using Mega 2560 so i had to look it up myself.
Now i found it i wanted to help other people that are also struggling.

I also posted a the high resolution version of the picture how to hook up the arduino. Please post ur experiences when you try this whit you're mega.

Gr. Spike
Ok!
I only have one instructable using the arduino...probably have more soon...
why not have a look at my ibles?!
tsillen (author)  vishalapr3 years ago
I just added an new page to my instructions and went to look at yours.
Nice guitar hero mod , i jut got guitar hero on pc but the keyboard sux.
I need to look for some buttons so i can make me an arduino guitar hero controller.
cool!