Go Down

Topic: Arduino as an AVR ISP (Read 1 time) previous topic - next topic

Luciano_Carcagno

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.

Osgeld

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


yep
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

Luciano_Carcagno

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!

Osgeld

should be fine as long as you have your fuses correct, but yea thats pretty much it for avrdude
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

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.
New true random number library available at: http://code.google.com/p/avr-hardware-random-number-generation/

Current version 1.0.1

Coding Badly

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

Luciano_Carcagno


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.

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


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.  :~

Osgeld

I use avrisp as the programming option all the time, works for me, including in your core files CB
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

Coding Badly

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.

Coding Badly

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.   ;)

Osgeld

Quote

The best advice: Whatever works is the correct option.   ;)


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.
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

Luciano_Carcagno


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.   ;)



Great advice! Thanks for all the tips.

Go Up