Take the 2-minute tour ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

Can you use the Arduino as an AVR programmer?

share|improve this question
add comment

5 Answers

up vote 6 down vote accepted

I use the mega-isp solution mentioned above - the Arduino avrisp sketch is here

http://code.google.com/p/mega-isp/downloads/list

I do not use the shield they have - I made up a simple cable using two 6 pin dual-in-line header sockets to fit the programming ISP connector on your Arduino. (I did not have two dil sockets so I used standard single in line and superglued two 3 pin sockets together.

You then need a piece of ribbon cable or some wire.

Arduino 6 pin ISP

Connect each pin on one socket the the corresponding one on the other, with the exception of pin 5 = Reset. Connect one end of the cable to pin 5 - this is the end that will connect to the target AVR that you wish to program. Connect the other end of the pin 5 wire to a floating pin connector.

To use connect the cable to the arduino by placing over the ISP programming connector and connecting the floating lead to digital 10, connect the other end to the target ISP connector. You need to ensure that the pin 1's match up.

Cable overview cable detail

Program with avrdude using

avrdude -P com7 -p t2313 -c avrisp -b 19200 -U flash:w:fred.hex

where
com7 - the com port that the Arduino based programmer is on
t2313 - the type of AVR you wish to program (m328 for ATMega328).
fred.hex - the name of the hex file you wish to progam into the target.

I have used this to program Tiny2313 with no problems.

Note: The cable will carry 5v to power the target - if the target is already powered then do not connect pin 2 of the cable.

share|improve this answer
    
FYI: The mega-isp sketch is now included with the Arduino software as of version 0018 and no longer needs to be downloaded separately; it's located under File|Examples, named ArduinoISP. –  esm Mar 3 '10 at 4:20
add comment

This solution works great too: Kimio Kosaka avrdude-serjtag method

If you have assembled you own computers you may have spare case mounted USB cables/connectors that often come with new moherboards. Just wack off the USB end and you can use the motherboard connector as the ISP connector.

A batch file like this can be used: (This is for the 328 chips, will set the fuses for high speed transfer and then upload the bootloader, and setting the lock bits when finished.

avrdude -c diecimila -P ft0 -p m328p -B 4800 -U lock:w:0x3F:m -U efuse:w:0x05:m
-U hfuse:w:0xDA:m -U lfuse:w:0xFF:m

avrdude -c diecimila -P ft0 -p m328p -U flash:w:ATmegaBOOT_168_atmega328.hex -U
efuse:w:0x05:m -U hfuse:w:0xDA:m -U lfuse:w:0xFF:m -U lock:w:0x0F:m
share|improve this answer
add comment

Yes, you can use the Arduino as a AVR programmer!

Take a look at the mega-isp project.

share|improve this answer
add comment

If you need hi-voltage programming (you have an otherwise dead chip) you can try this solution http://www.mightyohm.com/blog/2008/09/arduino-based-avr-high-voltage-programmer/

share|improve this answer
add comment

The answers from 2009 are a bit outdated now that the standard Arduino IDE includes ArduinoISP which was based on Mega-ISP but is now officially supported by Arduino.cc.

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.