Argentina
Offline
Newbie
Karma: 0
Posts: 17
|
 |
« on: June 17, 2012, 09:56:52 am » |
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
Faraday Member
Karma: 33
Posts: 3621
@ssh0le
|
 |
« Reply #1 on: June 17, 2012, 10:06:56 am » |
So, is it possilbe to use that same sketch and AVRdude to directly program any supported microcontroller? yep
|
|
|
|
|
Logged
|
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
|
|
|
|
Argentina
Offline
Newbie
Karma: 0
Posts: 17
|
 |
« Reply #2 on: June 17, 2012, 10:49:11 am » |
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
Faraday Member
Karma: 33
Posts: 3621
@ssh0le
|
 |
« Reply #3 on: June 17, 2012, 10:53:18 am » |
should be fine as long as you have your fuses correct, but yea thats pretty much it for avrdude
|
|
|
|
|
Logged
|
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
|
|
|
|
Dallas, Texas
Offline
God Member
Karma: 1
Posts: 690
Old, decrepit curmugeon
|
 |
« Reply #4 on: June 17, 2012, 11:26:12 am » |
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
|
|
|
|
|
Global Moderator
Dallas
Online
Shannon Member
Karma: 118
Posts: 10154
|
 |
« Reply #5 on: June 17, 2012, 12:46:15 pm » |
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
Newbie
Karma: 0
Posts: 17
|
 |
« Reply #6 on: June 17, 2012, 02:45:00 pm » |
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
Newbie
Karma: 0
Posts: 17
|
 |
« Reply #7 on: June 17, 2012, 02:52:14 pm » |
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. 
|
|
|
|
|
Logged
|
|
|
|
|
SE USA
Offline
Faraday Member
Karma: 33
Posts: 3621
@ssh0le
|
 |
« Reply #8 on: June 17, 2012, 03:17:57 pm » |
I use avrisp as the programming option all the time, works for me, including in your core files CB
|
|
|
|
|
Logged
|
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
|
|
|
|
Global Moderator
Dallas
Online
Shannon Member
Karma: 118
Posts: 10154
|
 |
« Reply #9 on: June 17, 2012, 03:24:14 pm » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Online
Shannon Member
Karma: 118
Posts: 10154
|
 |
« Reply #10 on: June 17, 2012, 03:28:21 pm » |
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. 
|
|
|
|
|
Logged
|
|
|
|
|
SE USA
Offline
Faraday Member
Karma: 33
Posts: 3621
@ssh0le
|
 |
« Reply #11 on: June 17, 2012, 03:33:16 pm » |
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.
|
|
|
|
|
Logged
|
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
|
|
|
|
Argentina
Offline
Newbie
Karma: 0
Posts: 17
|
 |
« Reply #12 on: June 17, 2012, 08:38:54 pm » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
|