最近在玩ATTINY85,最快入門的方式就是使用ARDUINO

但是ARDUINO寫好的程式,再不給對方原始碼的狀況該怎麼燒入呢??

我使用的是USBTINY作為我的ISP燒入器,

首先要先將寫好的程式碼匯出,選擇ARDUINO上面的匯出已編譯的二進位檔

image

HEX程式會在跟ARDUINO的*.ino檔案同一個資料夾下

接下來就需要採用,內建的程式avrdude透過 command line進行燒入

在此,我學習Xloader的方式,建立一個資料夾將我會用的程式放進去

image

並且建立一個指令集 run.bat

內容如下

@echo on
avrdude -c usbtiny -p attiny85 -U flash:w:tiny85_7.ino.tiny8.hex:i

成功後就可以看到如下的畫面

===========================================================

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e930b
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 "tiny85_7.ino.tiny8.hex"
avrdude: writing flash (1856 bytes):

Writing | ################################################## | 100% 2.30s

avrdude: 1856 bytes of flash written
avrdude: verifying flash memory against tiny85_7.ino.tiny8.hex:
avrdude: load data flash data from input file tiny85_7.ino.tiny8.hex:
avrdude: input file tiny85_7.ino.tiny8.hex contains 1856 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 1.86s

avrdude: verifying ...
avrdude: 1856 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

===========================================================


 

    全站熱搜

    Mamason 發表在 痞客邦 留言(0) 人氣()