Week 8

According to Attiny 44 datasheet, it is a AVR Micro-controller which contains 4K Bytes of In-System Programmable Program Memory Flash.
It can be applied with analogy, digital I/O. Referring to the chart below, I can use Arduino IDE to edit the program and upload. (Note: it cannot support to the instruction of Arduino IDE completely)
閱讀Attiny 44 datasheet ,其為一AVR 的微控制器,具有4K Bytes of In-System Programmable Program Memory Flash。
具有多個類比/數位 I/O可運用。參考下圖,可以使用Arduino IDE編輯程式並上傳。(Note:不支援全部arduino IDE 指令)


To configure Arduino IDE to upload the program to attiny series IC, I am refer to THIS page.
Arduino is open source electronics platform based on easy-to-use hardware and software. C is the common language to program the board.
設定Arduino IDE,使其具有編譯attiny系列IC功能。參考此篇設定library。Arduino IDE主要用途為arduino系列控制版開發軟體,使用的為C語言,並簡化許多語法,使入門使用者能快速學習與上手。

In this weeks' assignment, I modified the "Blink" sample code, change the pin value to trigger LED.

  • Define the variable.
  • Define INPUT/OUTPUT mode.
  • Use loop function check the status of button, if user click it, led will light up.

  • 以Arduino IDE編寫程式。參考範例Blink程式,改寫成attiny44腳位以及功能。第一段設置按鈕及LED參數;第二段setup()區則設定按鈕接腳唯輸入/LED接腳唯輸出;第三段loop()則唯不斷迴圈執行的主程式。當按鈕式按下時,LED燈亮起;其他狀態(亦即放開按鈕),按鈕腳位感應到為低電位,LED輸出低電位,LED熄滅。


    Connect the board to the ISP.
    以ISP燒錄前,配接好ICSP腳位電線。可使用前幾周所做的FabISP,或其他燒錄器。


    Arduino can also configure as ISP, just open the sample code "ArduinoISP", upload to the Arduino board, add a 10uf capacitance at the reset pin and GND, That it.
    Then, connect the ArduinoISP board pin10~pin13 to RESET, MOSI, MISO and SCK.
    Don't forget connect Vcc and GND.最簡易的燒錄器可以使用Arduino uno作為燒錄器。開啟範例中的"ArduinoISP",進行編譯及上傳至你的arduino。Reset接腳須加上一個10uf的電容,注意電容的負級要接到GND。如此一來,Pin10~Pin13分別就具有RESET、MOSI、MISO、SCK功能。再接上Vcc與GND就是一個完整的AVR-ICSP了。


    When upload the code through the ArduinoISP, need to set the "Programmer" to " Arduino as ISP".
    當要由Arduino IDE上傳草稿碼時,先選擇"Arduino as ISP。第二步為使用燒錄器上傳。將寫好的程式上傳。


    Select ATtiny board, processor "ATtiny44", clock "20MHz (external)", then click "Upload Using Programmer".
    選擇正確的MCU Attiny 44,以及外部震盪器時脈20Mhz。


    The complete code attatched in the end of this page.
    下圖為程式碼,網頁底部附上檔案。

    Need to burn the "Bootloader" first, then click "Upload Using Programmer" will show "Upload done".
    先進行燒錄bool(Bootloader),再使用"Upload Using Programmer",會顯示上傳完畢"Upload done"。And have fun!

    Troubleshooting:

  • After check the hello led board made on week6, I found the switch button welding in the wrong direction, after de-wolding it and put into the right directioin and the led blinks.
    Week 6所製作的電路板,按鈕方向弄錯。接到同電位腳位。程式沒有問題,LED卻無法正確執行動作。檢查並解焊換按鈕後回復正常。
  • Some of Attiny series software tool kit didn't support 1MHz, 8 MHz internal crystal oscillator, the compile process will show error message. After trying several version of tool kit, the final result is success and the process document above.
    部分下載的Attiny tool不支援1MHz,8MHz內部震盪器頻率,Library在進行編譯時會出現錯誤。嘗試幾種版本後,最穩定版本如主文內所述。
  • Tools:

  • Arduino IDE
  • File:

  • attiny44_Button.ino
  • Reference:

  • Programming an ATtiny w/ Arduino 1.6
  • arduino-tiny
  • ATTiny Core
    • Fab Academy

      The Fab Academy is a Digital Fabrication Program directed by Neil Gershenfeld of MIT's Center For Bits and Atoms and based on MIT's rapid prototyping course, MAS 863: How to Make (Almost) Anything. The Fab Academy began as an outreach project from the CBA, and has since spread to Fab Labsaround the world. The program provides advanced digital fabrication instruction for students through an unique, hands-on curriculum and access to technological tools and resources.
    • Fablab Tainan

      Fab Lab Tainan was founded at Dec. 2013 at Tainan, Taiwan. It is the first Fab Lab at Southern Taiwan. Supported by Tainan City Government, this Lab hope could open for local citizen. The background photo of web page is the roundabout in front of Tainan train station.
    • Who Am I

      I'm Jia-Hao Chang from Fablab Tainan.I'm senior staff of Association of Digital Culture, Taiwan (ADCT).In this years, I have participated the project of digital curriculum.My career is to empower people employing digital manufacturing technology or tools toimprove their problem.