Self-ISP on an Uno

Here's something fun: it's an Arduino Uno doing ISP on itself!

The 8U2 USB chip is running modified software - essentially the standard USBserial code, merged with a heavily modified version of the ArduinoISP sketch. The nice thing is that it can switch between normal operation and ISP just by adding or removing a jumper.

If anybody is interested in trying out this code, let me know and I'll tidy it up and write some instructions. You'll need an Uno R2 (R1 will not work; R3 is probably ok but I don't have one to test) and either an ISP programmer or another Arduino. Some soldering is required (to add the extra header pins). You'll also need to be fairly confident about reprogramming the 8U2 - as always with ISP, there's potential for bricking the device if anything goes wrong.

That's pretty glorious, I love it.

Looks like a slick mod to the Arduino - What ISP do you tell AVRDude you are using?

I could see making a cable that when plugged in puts the 8U2 in ISP mode and when removed it works in normal Arduino mode.A 10 pin connector on the one end witht he 2 pins shorted. A six pin connector on the other end.

This might be a good addition to the Arduino design. And it could be used without having to load a sketch in your Arduino chip.

Will you post your code and the procedure for loading it in the 8U2?

This is comparable to what you could do with a duemilanove.

http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html

Early rev Uno's did not support, it is nice that the later ones finally broke out the pins to support this.

Kick ass! Dunno if I'd use it, since I tend to use ICSP only for naked chips, but that gets +10 clever points for sure.

Great idea!

Tim7 - Could you also reverse this? Could you download a program to the 328 that could then reprogram the 8U2? Are the signals available on pins to do this?
This would be something like what the optiLoader does?

Mmm, yes that should work. Give me a little more time to tidy up the code & I'll post it here.

tim7:
Mmm, yes that should work. Give me a little more time to tidy up the code & I'll post it here.

Please post this procedure in the Playground!

Nice work Tim7! You deserve a round of applause for your innovation.

Yes please, id love to see how you did it
I actually posted not to long ago I had this same idea, but no idea how to do it lol

OK, here it is: http://timgiles.free.fr/arduino-usbisp.zip
The zip-file contains the hex file, instructions, some useful pictures, and some bat files which should make the whole procedure relatively painless.

Note that this is a first version, and may contain bugs. Read the warnings and caveats in readme.txt.

Please report your successes or failures here. Once a few people have got it working I'll post a proper write-up on the Playground.

The version I posted 2 days ago might not have worked with the normal Uno USB driver. If anybody actually tried it and ran into this problem, I apologize! I have corrected the problem, and added the source code. The link is the same as before.

http://timgiles.free.fr/arduino-usbisp.zip

The compilation procedure is the same as for the standard Arduino USB code, and requires LUFA v100807 and WinAVR v20100100.

...and the silence was deafening. Instructions unclear? Installation too difficult? Or just everybody that needs an ISP programmer already has one?

Lol im waiting for my r3 off ebay, ill let you know as soon as I get it

Just not quite ready to zap my only working Arduino.... I guess I am wearing my chicken suit...

OK, I just checked the binaries and fuse settings for the 16U2 chip on the Uno-R3, and they're all the same as for the 8U2. So to upload to the Uno R3 all you need to do is modify line 11 of program_usbisp.bat to read

  -p [color=red]atmega16U2[/color] -P com%PORT% -b %BAUD% -c stk500v1 -v -e -u ^

Cool,
One ques. The jumper, does it need to be held constant? Or can I like put a pushbutton there and just hold it while I first plug it in, or just when uploading?

To stay in ISP mode the jumper needs to be constantly in-place. As soon as the jumper is removed it reverts to "normal" mode (or after a few seconds timeout, if in the middle of executing a programming command).

I had a go at converting Adaloader to write the 8U2 firmware, but it seems to get its flash pages in a muddle. If I can get it to work you won't need the second Arduino: updating the 8U2 would be as simple as loading a sketch, connecting a few wires, and hitting reset.

I think that im gonna put a mini dipswitch when I get my board, a jumper I think is more prone to get lost lol

So with this setup is it possible to bootload a chip without having a bootloaded chip already and with only 1 arduino uno?

I fried my chip and accidentally bought blank chips...

I have an Uno R3 and I can't get this setup to work.

Forgive me if I'm being stupid.