Arduino ISP -> ICSP

Hi guys, just checking if anyone else is using an Arduino as ISP and uploading sketches to other boards via the ICSP header pins?

I've got this situation that two of the Arduino-compatible boards I ordered from DX.com had either a faulty USB header or crappy FTDI, and I ended desoldering the mini-USB connectors out of the boards, leaving me two working boards, but with only the ICSP header pins as a sketch upload possibility. - And now that I've used this method, I kinda like it. Who needs an USB anyway, besides on that one board used as an Arduino ISP. :D

There's just one tiny little problem. When ever I'm uploading a sketch from Arduino IDE via another Arduino as an ISP, the IDE feeds a "-D" parameter to avrdude, which, of course fails (by the specs). Clearing the whole memory region of the target board, one sketch uploads ok, but the next fails - due to how the memory on ATmega328 works - yeah, I've read about that clear bytes to 0xFF blah-blah..

Now, the real question: is there a way to force the Arduino IDE v. 1.0.x feeding parameters "-e -Ulock:w:0x0F:m" to avrdude, instead of that "-D"? In Arduino IDE 1.5.x this should be possible; I read from one of the config files that parameters (and 3rd party tools, etc. etc.) are customizable, but 1.5.x works kinda funky with my ICSP-setup.

(Note: the ISP -> ICSP setup is equal to using pins 10-14, +5V, GND on ISP master, and pins 11-13, RST, +5V, GND on the target board.)

Seems like the Arduino ISP is designed to be used only as a bootloader uploader, but since the hardware setup & Arduino ISP software itself work as a sketch uploader too, couldn't/shouldn't this upload parameter be changed?

Oh yeah, my ISP board is UNO R3, and I've got that small capacitor between reset and ground pins..

Hi,

androidi: just checking if anyone else is using an Arduino as ISP

Yes.

and uploading sketches to other boards via the ICSP header pins?

No. With the bootloader baud rate at 1M, uploading via bootloader is faster.

Now, the real question: is there a way to force the Arduino IDE v. 1.0.x feeding parameters "-e -Ulock:w:0x0F:m" to avrdude, instead of that "-D"?

Yes. Create a boards.txt entry for uploading via ISP. BOARD.upload.using=arduino:arduinoisp is the important value to include. This may help... https://www.google.com/search?q=boards.txt%20standalone

All these entries correctly use ArduinoISP with dash-e... http://code.google.com/p/arduino-tiny/source/browse/Prospective+Boards.txt

Thanks, but I've already got that entry added to boards.txt, otherwise the upload via ISP always did something funny, and reverted to 57600 bps upload, which was way too fast for ICSP. I had to make a custom preset block where I set the upload speed to 19200 bps, and the BOARD.upload.using=arduino:arduinoisp you mentioned, to force the upload to always use ISP & 19200 bps.

But sadly, this doesn't fix the "-D" problem I'm having. I googled this topic some days ago, and a lot of people seem to be having the same problem. Especially when uploading to bare Atmel chips (328, 644, etc.) / bb Arduino.

I recall the -D parameter of avrdude saying something like it only clears the pages where it'll write the new firmware (sketch) to, but 328 and so on, require a clear (-e) and fuse set (-Ulock:w:0x0F:m) to be able to write the new binary successfully.

androidi:
Thanks, but I’ve already got that entry added to boards.txt…

As I stated, I know what you are trying to do works. As I stated, I know the key is to have a correct boards.txt entry. Which leaves just one possibility.

I'm not sure if I'm doing anything wrong. See, this is what I get, when burning a bootloader via ISP -> ICSP:

/Applications/Development/Arduino 1.0.5.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Development/Arduino 1.0.5.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -cstk500v1 -P/dev/cu.usbmodemfa131 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xFF:m

But when uploading a sketch..

/Applications/Development/Arduino 1.0.5.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Development/Arduino 1.0.5.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -carduino -P/dev/cu.usbmodemfa131 -b19200 -D -Uflash:w:/var/folders/ft/9bf78x4d20b7m4bfjfjx4f800000gn/T/build2771031643269764362.tmp/Blink.cpp.hex:i

And this is the block I've got in boards.txt:

at_icsp.name=Arduino ATmega328P (ISP -> ICSP)

at_icsp.upload.protocol=arduino
at_icsp.upload.maximum_size=32768
at_icsp.upload.speed=19200
at_icsp.upload.using=arduino:arduinoisp

at_icsp.bootloader.low_fuses=0xFF
at_icsp.bootloader.high_fuses=0xDA
at_icsp.bootloader.extended_fuses=0x05
at_icsp.bootloader.path=optiboot
at_icsp.bootloader.file=optiboot_atmega328.hex
at_icsp.bootloader.unlock_bits=0x3F
at_icsp.bootloader.lock_bits=0x0F

at_icsp.build.mcu=atmega328p
at_icsp.build.f_cpu=16000000L
at_icsp.build.core=arduino
at_icsp.build.variant=standard

Somehow the IDE decides to use -D when uploading a skatech, but -e & -U when burning a bootloader.

Perhaps I've got to step-debug through Arduino IDE to see what and why happens..

Got it! You’re a genious! :smiley:

It was the BOARD.upload.protocol-parameter. By commenting that out, the IDE doesn’t give -D parameter to avrdude, but also leaves -e & -U out, and upload verification is now ok!

Perhaps I’ll inform a couple of other places where people are having the same kind of problems.

Thanks again for stating, that it’s not the IDE, but the user. :wink: