Upload sketch using another Arduino

Is it possible to upload a sketch to another arduino using just an arduino?

Yes it is. There is software in the IDE sketch list (or libraries list) call ArduinoISP. If you google this you will find lots of instructions on what to do, includng some YouTube videos.

Nick Gammon has good write up

and from an SD card also ...

I'm actually trying to find a way to upload a sketch from arduino to another arduino chip. Like have one arduino upload the blink sketch to another arduino chip (so it can blink too) without using the computer

baligena:
I'm actually trying to find a way to upload a sketch from arduino to another arduino chip. Like have one arduino upload the blink sketch to another arduino chip (so it can blink too) without using the computer

As CrossRoads pointed, the SD Card hex uploader would be the trick.

But is there a way to do it without an SD card?

baligena:
But is there a way to do it without an SD card?

Well certainly there is a way if wants to bad enough. A sketch could be written that knows how to 'talk' the ICSP protocol to the standalone chip (like the arduino as ISP sketch) and have the sketch have the desired hex file data written to the flash memory at compile time for export to external device during run time.

I believe someone here wrote a bootloader writer sketch that includes the different bootloader hex file data in the sketch and transfers the proper data when it determines what kind of chip it's attached to. For burning boot-loaders, that was a real cleaver and useful application.

It's a somewhat limited and awkward method to program a chip, but perhaps it fills a real need in some situations?

Lefty

See westfw's optiloader sketch

installs bootloader without needing a PC

video of it in action in reply #7
http://arduino.cc/forum/index.php/topic,68183.0.html

Could be the starting point for uploading sketches vs bootloaders.

I am curious to know why you want to do this? Looking at creating a self replicating virus?

Virus in an embedded microcontroller? Really?
Hardly self replicating when you have to go around and plug in ICSP cable to load it.

Yep. :slight_smile:

It is a bit of a strange request.

Not really - say you had a bunch of fielded systems that needed revising.
Grab your standalone battery powered programmer and re-load away.
I think having the file on SD card would be more practical, no need to re-burn to your upload tool all the time, just put a new file on the SD card and go.

Maybe put the collection of parts Nick Gammon has working on a little board.