Turn Arduino into an ISP programmer

the place where to change the port in load.command is “dserial=$PORT”, right? i just put a number instead of $PORT, right?
to launch load.command with windows xp do i use the command prompt?
thanks and regards.
are you sure about the reset pin on 10? isn't it 1 instead?

Has anyone accomplished this on Mac OS X?

I've got the boards hooked up correctly and the stk500 firmware uploaded correctly to the first Arduino. However when I run the burn command (after the correct (I believe)) modifications I got a constant Device Not Responding type of message.. Actually I think it's Programmer Not Responding.

I don't know if that's because the icsp isn't working or if there is an incompatibility between the stk500 firmware and mac os x?

I would really like to get a atmega168 burned w/ the 168 flavor arduino bootloader... The extra space would be very welcome. However, like I said... it's just not working.

Any insight or anybody being successful at this would be great to hear. It seems clear, but something just isn't meshing.

I've also tried avrdude 5.2 as per a suggestion I found online - as it was supposed to be more compatible w/ os x.. but no dice there either.

Anyway, thanks for any help rendered, I appreciate it.

-Jeremy

I had the same non-result as you - I did get the programmer firmware downloaded, but any time I tried to use it as a programmer I got a "programmer not responding" message. Mac OS X 10.4.8 PPC.

I did talk to the programmer via rs232 and it seemed to go to some sort of prompt when I hit return, but it never really did anything. It looks like this happened when I tried to program with it, judging by the way the TX and RX LEDs blinked.

-j

hmm... Frustrating. I have a project I'd like to pursue that includes both i2c and an LCD which fills the atmega8 just by including libraries.. ergh.

Was the reason for not being able to burn bootloaders w/ the arduino board a monetary or technical decision?

-jf

You may need to remove the built-in LED connected to pin 13 that's on the Arduino board you're using a programmer. I think it interferes with the SPI lines that are used for programming. The next revision of the Arduino board should fix this problem.

I had already worked around the LED problem (I moved a resistor instead of removing the LED). Besides that, I was taking that data off the ICSP header instead of the standard arduino outputs.

-j

What software are you using on the computer? The Arduino environment won't work with it, as it uses uisp which only support stk500, not stk500v2 which is used by the firmware. We should be switching to avrdude soon, which supports stk500v2. In the meantime, you'll need to use it from the command line, along the lines Massimo suggested.

I was using avrdude at the command line. I failed to take notes, so I'm about to try the whole thing over on my desktop machine (was working on the laptop before) and may even switch to an arduino serial that I built if the NG fails.

My errors were avrdude telling me the programmer wasn't responding, so I don't think the NG hardware was the issue. I suspect that I don't have an appropriate avrdude.conf entry, but I can't remember what made me think that (it was late at night, and like I said I failed to take notes).

-j

I've never got it to work myself, so I'm not sure I can help. It's possible that a "programmer not responding" message is a hardware problem; I think it could happen if the SPI between the board and the chip being programmed fails. Maybe Massimo has more ideas what the problem is?

the instructions are not super simple yet, i'm working on writing a better tutorial.

Any progress on this? :slight_smile:

It's probably an obvious oversight on my part, but what should one change the port to in "load.command" for a PC COM port? Also, can one burn the regular Arduino firmware back to the chip after programming others?

Thanks!

hi all -

it would really be great if people could use their arduinos as avr isp programmers! it seems like it should be possible, so i'm very surprised that there doesn't seem to be a working method, since it would be a popular feature of the arduino.

i've tried a few different "how-to's" that claim to be able to do this, but it seems like none of them actually work, at least for what i want (program atmega168, along with fuse bits).

i tried this one out but couldn't get it to work either, same kind of errors as the others reported. it seems (although i'm not sure) that the avrusb500.hex file gets loaded into my arduino diecimila with:

cd /Applications/arduino-0011/hardware/tools/avr/bin
cp ~/Desktop/avrusb500-1.5-arduino/avrusb500.hex .
./avrdude -C ../etc/avrdude.conf -p m168 -c avrisp -b 19200 -P /dev/cu.usbserial-A4001lXM -U flash:w:avrusb500.hex

(need to press the reset button just before hitting enter on the last command).

[edit: does this even work though? i was just reading about the diecimila's reset behaviour, seems it goes to the sketch almost immediately after pressing reset - so maybe i'm not even actually uploading it, even though avrdude says so?]

but then i try to upload a compiled "blink" sketch to my target (atmega168 with internal 8MHz clock, sketch compiled with lillypad arduino settings) using this (without pressing reset):

cp /tmp/build*/Blink.hex .
./avrdude -C ../etc/avrdude.conf -p m168 -c avrisp2 -b 115200 -P /dev/tty.usbserial-A4001lXM -U flash:w:Blink.hex -U lfuse:w:0xE2:m -U hfuse:w:0xDF:m

...all i get is:

avrdude: stk500_2_ReceiveMessage(): timeout
avrdude: stk500_2_ReceiveMessage(): timeout
avrdude: stk500_2_ReceiveMessage(): timeout
avrdude: stk500_2_ReceiveMessage(): timeout
avrdude: stk500_2_ReceiveMessage(): timeout

do i need to recompile the avrusb500.hex for the atmega168? i'm not quite sure of the magic spell needed to do that. or, should i stop wasting my time and buy a real programmer?

thanks... jm

the water runs the easiest way. i've stopped fooling with parallel programmers and turning arduino in isp programmers and bought a avrisp mkII. works on mac, albeit very slow. 10 minutes to completion! but it works. as soon as the deadline i'm in right going to is passed, i will investigate further in the arduino as programmer stuff. i've resoldered the 16Mhz xtal and stored the 3.6468 xtal for later retrieval.

lost a few days fiddling with pc on windows, braking working arduino's and searching the web for clues...

macsimski: if your AVRISP mkII takes 10 minutes to burn a bootloader, it's probably configured to have a very slow communication speed. You can reconfigure it with with AVR Studio on Windows (and possibly some other way as well). Apparently they come from the factory with a random default speed.

done that.
it works. in avrstudio is mentioned that isp speed should be less or equal than 1/4 of the clockspeed. atmega168's are set to 1Mhz clock so 250Khz is ok. i'm still on 125Khz, but will try 250 tomorrow.

anyway, programming is now in 6 secs. in the arduino ide.

keywords: AVRISP MKII speed slow

does someone know a method to change the speed with another (non-windows) tool? apparently avrdude has not the ability, or has it?

I think avrdude can do it, but that's about as much information as I have on the subject. Search the avrdude documentation for the -B (bitclock) command line option. Apparently this affects the ISP clock.

  • Ben

Hi all
Is there any update on this?
I need a programmer and am going to try it from the OS X envrons

Would appreciate any feedback from you brave noble people out there who have had success

/t

If you're looking to burn bootloaders, try Programmer2. I haven't had much luck getting my Mac to recognize it as a programmer because it seems to emulate an odd programmer and because avrdude won't recognize the FT232 interface unless you explicitly tell it where to look on the command line (so no burning from the IDE), but it can autonomously/semi-autonomously burn the 8/168 bootloaders stored in the program and set fuses and whatnot.

I've been playing with the code, and plan on releasing a version updated to add support for the atmega328, but it's taking some cajoling to fit all 3 bootloaders as well as the ISP emulation code in the 168's flash size. The original author seems to have made some strange programming decisions, and I'm having trouble figuring out what might break the ISP functions (which I can't really test) if I replace it with code that appears to do the same thing more efficiently.

Hi,
I think it should be OK to buy the AVRIspMK2. I don't use MaxOS but here
http://www.arduino.cc/playground/Code/OSXISPMKII
is an article about using this programmer on a Mac with libusb. All the problems about being slow seem to be related to the programmer being accessed through a serial-port.
This thing works fast on Linux and Windows, so I don't think it will fail on a Mac.
Eberhard

the avrispmkII works fine on OS X. You can set up an entry in boards.txt and program directly from the arduino IDE via standard upload procedure.

I don't recall if I had to build avrdude, or if the avrdude binary that comes with arduino works out of the box.

There were some speed issues involving the factory default settings of some avrispmkIIs. I think mine was one of those.

-j