1 頁 (共 1 頁)

Using an Arduino to Program an AVR

發表於 : 2012-12-24 00:18:35
yehlu
http://tw.myblog.yahoo.com/bv2ci/articl ... -1&next=85

http://www.sparkfun.com/tutorials/200

http://download.savannah.gnu.org/releas ... -win32.zip

libusb0.dll

圖檔

圖檔

燒錄僅需使用 MISO, SCk, Reset, MOSI pin.
接到 Arduino AVRISP 上的對應:
Target AVRISP
pin 1 MISO -> pin 12
pin 3 SCk -> pin 13
pin 5 Reset -> pin 10
pin 4 MOSI -> pin 11

GND -> GND
5V -> 5V

upload ArduinoISP sketch to Board
Connect the ISP

代碼: 選擇全部

avrdude.exe -p m16u2 -c avrisp -C "avrdude.conf"  -P com5 -U flash:w:"Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex":a -U flash:v:"Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex":a -U lfuse:w:FF -U hfuse:w:D9 -U lock:w:0F -U efuse:w:F4 -b 19200


Re: Using an Arduino to Program an AVR

發表於 : 2012-12-24 06:58:50
yehlu
D:\avrdude-5.11-Patch7610-win32>avrdude.exe -p m16u2 -c avrisp -C "avrdude.conf"
-P com5 -U flash:w:"Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex":a
-U flash:v:"Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex":a -U lfuse:w
:FF -U hfuse:w:D9 -U lock:w:0F -U efuse:w:F4 -b 19200

avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.08s

avrdude.exe: Device signature = 0x1e9489
avrdude.exe: NOTE: FLASH memory has been specified, an erase cycle will be perfo
rmed
To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: reading input file "Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-R
ev3.hex"
avrdude.exe: input file Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex a
uto detected as Intel Hex
avrdude.exe: writing flash (15668 bytes):

Writing | ################################################## | 100% 9.92s

avrdude.exe: 15668 bytes of flash written
avrdude.exe: verifying flash memory against Arduino-COMBINED-dfu-usbserial-atmeg
a16u2-Uno-Rev3.hex:
avrdude.exe: load data flash data from input file Arduino-COMBINED-dfu-usbserial
-atmega16u2-Uno-Rev3.hex:
avrdude.exe: input file Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex a
uto detected as Intel Hex
avrdude.exe: input file Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex c
ontains 15668 bytes
avrdude.exe: reading on-chip flash data:

Reading | ################################################## | 100% 13.65s

avrdude.exe: verifying ...
avrdude.exe: 15668 bytes of flash verified
avrdude.exe: verifying flash memory against Arduino-COMBINED-dfu-usbserial-atmeg
a16u2-Uno-Rev3.hex:
avrdude.exe: load data flash data from input file Arduino-COMBINED-dfu-usbserial
-atmega16u2-Uno-Rev3.hex:
avrdude.exe: input file Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex a
uto detected as Intel Hex
avrdude.exe: input file Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex c
ontains 15668 bytes
avrdude.exe: reading on-chip flash data:

Reading | ################################################## | 100% 13.64s

avrdude.exe: verifying ...
avrdude.exe: 15668 bytes of flash verified
avrdude.exe: reading input file "FF"
avrdude.exe: error opening FF: No such file or directory
avrdude.exe: input file FF auto detected as invalid format
avrdude.exe: can't open input file FF: No such file or directory
avrdude.exe: read from file 'FF' failed

avrdude.exe: safemode: Fuses OK

avrdude.exe done. Thank you.


D:\avrdude-5.11-Patch7610-win32>