如何在Arduino環境使用ATtiny13/44/45/84/85
本帖最后由 eddiewwm 于 2014-5-10 12:13 编辑基本概念:
甲) 事前準備和硬件連接
乙) 編寫程序代碼和經ArduinoISP上載至ATtiny
操作流程:
A) 事前準備 - Arduino IDE(參考:1& 2)
這是為使原來的Arduino IDE能支持ATtiny13/44/45/84/85的一次性步驟:
a) 下載檔案 https://github.com/tekstop/attiny/tree/Arduino1
b) 解壓下載檔,把當中的 "ATtiny" 放在Arduino 檔案夾hardware 內
c) 修改attiny檔案夾內的boards文字檔,把當中的 "attiny13.build.f_cpu=9600000L" 改為 "attiny13.build.f_cpu=10000000L"
d) 修改hardware/arduino/cores/arduino/wiring.c
修改前:
#if defined(__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)
修改後:
#if defined(__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny13__)
B) 事前準備 – .ArduinoISP (參考:1 & 3)
這是使Arduino板用作ArduinoISP上載燒寫其它AVR芯片的步驟,若Arduino板之前已為ArduinoISP,則不用再做。
a) 運行Arduino IDE
b) 打開ArduinoISP範例文件
c) 正確選擇所使用的Arduino板及串口
d) 上載至Arduino板
e) 退出Arduino IDE
C) 硬件連接
這是ArduinoISP 與ATtiny13的硬件連接
D) 編寫程序代碼和經ArduinoISP上載至ATtiny
a) 運行Arduino IDE
b) 正確選擇所使用的ATtiny13
c) 編寫程序代碼
int led = 4;
void setup() {
pinMode(led, OUTPUT);
}
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
d) 經ArduinoISP上載燒寫ATtiny13
e) 若板上的LED以1秒亮1秒滅的閃動,表示以上操作成功。
參考:
1) Programming an ATTiny13A using Arduino & servo interpreter
http://www.instructables.com/id/ ... servo-int/?ALLSTEPS
2) https://github.com/tekstop/attiny/tree/Arduino1
3) Using an Arduino as an AVR ISP (In-System Programmer) http://arduino.cc/en/Tutorial/ArduinoISP
完全按照这个做了,提示:
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny13
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny13
偶汗呀!:'(:'(:'( 本帖最后由 eddiewwm 于 2014-5-10 12:15 编辑
河山 发表于 2014-5-10 11:32 static/image/common/back.gif
完全按照这个做了,提示:
avrdude: please define PAGEL and BS2 signals in the configuration file for ...
很有意思,可否給你的硬件連接拍個照?是使用文中的測試代碼嗎?Arduino .IDE 版本? 这样子就可以批量制作芯片了吧? 哈哈!做完这个A) -d) 步骤就可以了, 出错不管它的,等一会就开始闪灯了,谢谢大神们。只是有些不明白,这个ATtiny13A不用先写这个引导bootloader的吗?如你上次回我的这个步骤chttps://www.slanla.com/?blog&item=764246517446743944724173526B4268467361344C413D3D 河山 发表于 2014-5-10 11:32 static/image/common/back.gif
完全按照这个做了,提示:
avrdude: please define PAGEL and BS2 signals in the configuration file for ...
解决了吗?求助 zi_yang 发表于 2015-1-16 14:57 static/image/common/back.gif
解决了吗?求助
解决了,不用理会这个提示就可以了. 河山 发表于 2015-1-16 20:36 static/image/common/back.gif
解决了,不用理会这个提示就可以了.
嗯~我也可以了~ 一次完成:P :lol 本论坛leo大神在某杂志发表了一系列的TINY13的文章,据说过段时间转到论坛来 完全按提示做
提示"output"was not declared in this scope
求解~~~:'( crbgz 发表于 2016-7-18 15:53 static/image/common/back.gif
完全按提示做
提示"output"was not declared in this scope
求解~~~
壇內有很多高手也發過這方面的貼,若這個跟著做也做不到,可做做其他高手的,待成功了再回頭看,這樣就能更易找到問題的所在,千萬不要死力鑽牛角尖啊!努力! eddiewwm 发表于 2016-7-19 09:20 static/image/common/back.gif
壇內有很多高手也發過這方面的貼,若這個跟著做也做不到,可做做其他高手的,待成功了再回頭看,這樣就能 ...
可以用了!直接把boards.txt替换。把cores里面的文件直接复制到arduino里。就可以了! zi_yang 发表于 2015-1-19 18:15
**** 作者被禁止或删除 内容自动屏蔽 ****
我没由成功,开发板要用原装的吗?
页:
[1]