Atmel StudioでArduino UnoをライタとしてブレッドボードのAVRマイコンにプログラム(スケッチ)の書き込み

Arduino IDEの代わりに、Atmel Studioを使用する。

Arduino Unoを書き込み器として設定します。以下の1から3の設定をしてください。

ツール-外部ツール

タイトル ArduinoISP

コマンド C:\arduino-1.8.15\hardware\tools\avr\bin\avrdude.exe

引数

-c avrisp -P COM5 -b 19200 -p m168p

-U flash:w:$(ProjectDir)Release\$(TargetName).hex:i

-U lfuse:w:0xFD:m -U hfuse:w:0xDE:m -U efuse:w:0xFF:m

-c

avrisp Atmel AVR ISP・ArduinoISP
avrisp2 Atmel AVR ISP mkII

atmelice_isp Atmel-ICE

-P

COM○ インターフェイスはcomポート経由

usb インターフェイスはUSB経由

-pはデバイスの指定

C:\arduino-1.8.15\hardware\tools\avr\etc\avrdude.conf 参照

m168pはATmega168P

m328PはATmega328P

t44はATtiny44

t45 ATtiny45
t84 ATtiny84
t85 ATtiny85

-vはメッセージのレベル

省略

C:\arduino-1.8.15\hardware\arduino\avr\boards.txt

Arduino Uno
extended_fuses=0xFD
high_fuses=0xDE
low_fuses=0xFF
unlock_bits=0x3F
lock_bits=0x0F

Use Output windowにチェック

Tools →ArduinoISP

以下のエラーが出たので

avrdude.exe: can’t open config file “”: Invalid argument
avrdude.exe: error reading system wide configuration file “”

C:\arduino-1.8.15\hardware\tools\avr\bin\avrdude.conf

をC:\arduino-1.8.15\hardware\tools\avr\bin以下にコピーを置いた。

44はATtiny44の引数は以下

–c avrisp -P COM3 -b 19200 -p t44 -U flash:w:$(ProjectDir)Debug\$(TargetName).hex:i -U lfuse:w:0xff:m -U hfuse:w:0xde:m -U efuse:w:0x05:m

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

Reading | ################################################## | 100% 0.02s

avrdude.exe: Device signature = 0x1e9207 (probably t44)
avrdude.exe: NOTE: “flash” memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: reading input file “C:\S26\LCD1602\Debug\LCD1602.hex”
avrdude.exe: writing flash (0 bytes):

Writing | ################################################## | 100% 0.00s

avrdude.exe: 0 bytes of flash written
avrdude.exe: verifying flash memory against C:\S26\LCD1602\Debug\LCD1602.hex:
avrdude.exe: load data flash data from input file C:\S26\LCD1602\Debug\LCD1602.hex:
avrdude.exe: input file C:\S26\LCD1602\Debug\LCD1602.hex contains 0 bytes
avrdude.exe: reading on-chip flash data:

Reading | ################################################## | 100% 0.00s

avrdude.exe: verifying …
avrdude.exe: 0 bytes of flash verified
avrdude.exe: reading input file “0xff”
avrdude.exe: writing lfuse (1 bytes):

Writing | ################################################## | 100% 0.02s

avrdude.exe: 1 bytes of lfuse written
avrdude.exe: verifying lfuse memory against 0xff:
avrdude.exe: load data lfuse data from input file 0xff:
avrdude.exe: input file 0xff contains 1 bytes
avrdude.exe: reading on-chip lfuse data:

Reading | ################################################## | 100% 0.01s

avrdude.exe: verifying …
avrdude.exe: 1 bytes of lfuse verified
avrdude.exe: reading input file “0xde”
avrdude.exe: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.02s

avrdude.exe: 1 bytes of hfuse written
avrdude.exe: verifying hfuse memory against 0xde:
avrdude.exe: load data hfuse data from input file 0xde:
avrdude.exe: input file 0xde contains 1 bytes
avrdude.exe: reading on-chip hfuse data:

コメントはまだありません

No comments yet.

RSS feed for comments on this post. TrackBack URL

Sorry, the comment form is closed at this time.