Pages: [1]   Go Down
Author Topic: Arduino as an AVR ISP  (Read 978 times)
0 Members and 1 Guest are viewing this topic.
Argentina
Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

SE USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

yep
Logged


Argentina
Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

SE USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Dallas, Texas
Offline Offline
God Member
*****
Karma: 31
Posts: 887
Old, decrepit curmugeon
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

New true random number library available at: http://code.google.com/p/avr-hardware-random-number-generation/

Current version 1.0.1

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 209
Posts: 13027
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Argentina
Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Argentina
Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.  smiley-confuse
Logged

SE USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 209
Posts: 13027
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 AVRISPsmiley-confuse

...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.
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 209
Posts: 13027
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.   smiley-wink
Logged

SE USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The best advice: Whatever works is the correct option.   smiley-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.
Logged


Argentina
Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.   smiley-wink


Great advice! Thanks for all the tips.
Logged

Pages: [1]   Go Up
Jump to: