Arduino as an AVR ISP

Hi there!

I´ve read the tutorial explaining how to use an Arduino board to burn the bootloader onto an AVR using the Arduino IDE. I´ve also read that it is based on the mega-isp code written by someone else and had a look at it too.

So, is it possilbe to use that same sketch and AVRdude to directly program any supported microcontroller? Should I make any changes?

Any tip or help is most welcomed!

Thanks.

So, is it possilbe to use that same sketch and AVRdude to directly program any supported microcontroller?

yep

Thanks for the straightforward answer!

As far as I´ve read it also supports burning fuses, lock bits, etc...

Would this be OK?

avrdude -p m328p -P comX -c avrisp -b 19200 -U flash:w:file.hex -U lock:w:0xFF:m

m328p : ATmega328p micro
comX: my com port
file.hex: my program
-U lock:w:0xFF:m -> for the lock bits ( all unprogrammed )

Thanks!

should be fine as long as you have your fuses correct, but yea thats pretty much it for avrdude

I would recommend that you add two (-v -v) verbose output specifiers to the avrdude command line, at least while testing. It adds very useful output that can help diagnose problems.

Luciano_Carcagno:
Would this be OK?

avrdude -p m328p -P comX -c avrisp -b 19200 -U flash:w:file.hex -U lock:w:0xFF:m

Almost...

avrdude -p m328p -P comX -c stk500 -b 19200 -U flash:w:file.hex -U lock:w:0xFF:m

  • OR -

avrdude -p m328p -P comX -c arduino -b 19200 -U flash:w:file.hex -U lock:w:0xFF:m

wanderson:
I would recommend that you add two (-v -v) verbose output specifiers to the avrdude command line, at least while testing. It adds very useful output that can help diagnose problems.

Thanks! I´ll take a look at that.

I got a bit confused with this. I thought that the idea of using an Arduino board with the ArduinoISP example was to work as AVRISP. :~

I use avrisp as the programming option all the time, works for me, including in your core files CB

Luciano_Carcagno:
I got a bit confused with this. I thought that the idea of using an Arduino board with the ArduinoISP example was to work as AVRISP. :~

...a programmer. "AVRISP" is a specific kind of programmer. It is also a protocol. The -c option tells avrdude which protocol to use. For an Arduino running the ArduinoISP sketch, the correct protocol is stk500 or arduino.

Osgeld:
I use avrisp as the programming option all the time, works for me, including in your core files CB

I've had problems using avrisp as the protocol. Unfortunately, I can't remember the details.

The best advice: Whatever works is the correct option. :wink:

The best advice: Whatever works is the correct option. :wink:

Agreed, cause STK500 is just an error generator for me, have yet to get it to do anything though an arduino as an ISP, I dont remember what arduino did, its been awhile.

Great advice! Thanks for all the tips.