HOW TO MAKE (ALMOST) ANYTHING MAS.863.12 |
|
PROJECTS | ABOUT | CONTACT | ||||||||
|
|
|||||||||||
EMBEDDED PROGRAMMING - week7 | ||||||||||||
In week 5, I covered using Fab ISP to program the ATtiny44 through Arduino. This week I programmed my board in C to echo back keyboard input. I went through tutorials from previous years. As mentioned in week 3, you will first need to download a firmware from Fab Acadey Electronics Production page to program the board in C using the Fab ISP. Here is a simple instruction on how to prepare for programming which I should have covered in week 3: After unzipping to firmware open the terminal and Navigate to the folder where I saved it. (cd ~/Downloads/firmware) Make sure you connected the Fab ISP to the laptop using USB connector. In terminal, first type: (make clean) Then type: (make hex) Then type: (make fuse) Then type: (make program) Initially, I encountered an error indicating I had no such file such as avr-gcc in terminal. To fix this issue, I needed crosspack for AVR development which is a development enviornment for ATmel's AVR microcontrollers for Mac OS X. You can download the crosspack-AVR from this link. On mac OS X, the FabISP work from the avrdude. | ||||||||||||
Programming the ATtiiny with the Echo C Code | ||||||||||||
This tutorial is based on several Fab archives. I used Neil's C code for the programming. You can find the source codes under host communication section from How To Make (Almost) Anything 2012 class's week 7 lesson page. Download the hello.ftdi.44.echo.c and hello.ftdi.44.echo.c.make files. I connected the Fab ISP with the board I made last time to blink LED. I powered the LED board through ftdi cable. First, in terminal the following line is used for setting up the fuses. After navigating to the folder where the files are saved, type:(sudo make -f hello.ftdi.44.echo.c.make program-usbtiny-fuses) Note that if you burned boot loader through Arduino you can skip this first step. Then type: (sudo make -f hello.ftdi.44.echo.c.make program-usbtiny) Open Arduino, go to Tools menu and select Serial Monitor. If you type and press select, the board will echo back your input. | ||||||||||||
Copyright © 2012 by AUSTIN S. LEE | ||||||||||||