3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

How to use Arduino Mega 2560 as Arduino isp

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 1Uploading 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 !)
« Previous StepDownload PDFView All StepsNext Step »
8 comments
Mar 18, 2012. 4:27 PMLentrave says:
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.
Nov 4, 2011. 10:12 AMlifeforce4 says:
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
}
Oct 1, 2011. 7:31 AMmbrown42 says:
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
Jul 23, 2011. 10:09 AMvishalapr says:
Cool! I don't have an arduino mega but I am getting one soon! I am sooo gonna try this once I get it!!!
Jul 23, 2011. 10:40 AMvishalapr says:
Ok!
I only have one instructable using the arduino...probably have more soon...
why not have a look at my ibles?!
Jul 23, 2011. 11:23 AMvishalapr says:
cool!

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
4
Followers
1
Author:tsillen