Last Updated on 2020年8月19日 by kabekin
yuyamaさんに教えていただいたavrdude.exeでATtiny85にソフト書込みをしてみました。
ArduinoIDEを使いArduinoUNO経由でATtiny85の書込みは成功しているのでLチカのソフトを
使いavrdudeに渡す引数を見てみました。
C:\Users\fe\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude -CC:\Users\fe\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.4.1/avrdude.conf -v -pattiny85 -cstk500v1 -PCOM5 -b19200 -Uflash:w:C:\Users\fe\AppData\Local\Temp\arduino_build_37463/Blink.ino.hex:i
転送したいhexファイル名を-Uflash:w:ファイル名.hex:i で指定するようです。
ツール名が stk500v1 になっているようですが、ArduinoIDEからの引数はstk500vなのでそのままいきます。
作業フォルダにavrdude.exeとavrdude.conf、 HEXファイルをコピーして、Atmel Studio7でビルドしたFDDステップ2倍化のhexファイルをWindows10のコマンドプロンプトから書込みました。
avrdude -C avrdude.conf -v -pattiny85 -cstk500v1 -PCOM5 -b19200 -Uflash:w:StepDub.hex:i
実行結果は
avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "avrdude.conf"
Using Port : COM5
Using Programmer : stk500v1
Overriding Baud Rate : 19200
AVR Part : ATtiny85
Chip Erase delay : 400000 us
PAGEL : P00
BS2 : P00
RESET disposition : possible i/o
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 12 4 0 no 512 4 0 4000 4500 0xff 0xff
flash 65 6 32 0 yes 8192 64 128 30000 30000 0xff 0xff
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
Programmer Type : STK500
Description : Atmel STK500 Version 1.x firmware
Hardware Version: 2
Firmware Version: 1.18
Topcard : Unknown
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.04s
avrdude: Device signature = 0x1e930b (probably t85)
avrdude: safemode: lfuse reads as E2
avrdude: safemode: hfuse reads as D7
avrdude: safemode: efuse reads as FF
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "StepDub.hex"
avrdude: writing flash (242 bytes):
Writing | ################################################## | 100% 0.39s
avrdude: 242 bytes of flash written
avrdude: verifying flash memory against StepDub.hex:
avrdude: load data flash data from input file StepDub.hex:
avrdude: input file StepDub.hex contains 242 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.21s
avrdude: verifying ...
avrdude: 242 bytes of flash verified
avrdude: safemode: lfuse reads as E2
avrdude: safemode: hfuse reads as D7
avrdude: safemode: efuse reads as FF
avrdude: safemode: Fuses OK (E:FF, H:D7, L:E2)
avrdude done. Thank you.と、特にエラーも出ず正常終了しました^^
マイコンに書き込んだソフトが正常に動作しているかチェックしてみます。
ステップ信号2倍化基板はまだ組み立てていないのでロジアナで確認しました。![]()
7番ピンの入力立下りに対して6msで3番ピンの出力パルスが2個出ています。![]()
無事に書込み成功のようです。
次回はold68funさんのブログのAtmel Studioからマイコンへ書き込んでみたいと思います^^
そんなATtiny85ソフト書込みの記録・・・