Keiichi Onishi

MAS.863 How to Make (Almost) Anything

Embedded Programming

This week's assignment was "Read a microcontroller data sheet. Program your board to do something, with as many different programming languages and programming environments as possible." I can code C/C++ but embedded programming was completely thing for me. With being tons of information in ATTINY 44 data sheet and tutorials, I managed to blink LED on my circuit board.

Overall progress

There are mainly 3 steps. 1st step is making 6 pins connector, 2nd step is FabISP programming, 3rd step is echo board programming. In my case, I took some additional step for debugging echo board due to GND shortage issue on my Echo Board. Through entire steps I got great support from peers, tutorials and web information sources.

  • What:Echo Board
  • Components:FabISP; Echo Board; 6 pins connector; FTDI cable
  • Programming tool:TextMate for C/C++ coding; Xcode; CrossPack

EPG 02
Step 1: Making 6 pins connector

We need 6 pins connector cable to connect FabISP and Echo board. Making those connector was pretty straight forward process but you need to make sure that orientation of both connectors are the same, and same pins of two connectors connect same color of cables.

EPG 03
Step 2: FabISP programming

I connected two 2x3 pins, connecting GND on non-programmed FabISP to GND on programmed FabISP. Then I connected programmed FabISP to my laptop using miniUSB-USB connector. To program FabISP, I followed tutorial 1, tutorial 2. I saved hello.ftdi.44.echo.c and hello.ftdi.44.echo.c.make file in a same directory, and run make clean, hex, fuse, and program command. In the beginning it seemed that I couldn't have installed avr properly. When I typed avrdude, I couldn't find avr itself. However, when I closed terminal window and open it again, everything went smoothly without any error messages. Fortunately I didn't have any issue on FabISP circuit itself. I desoldered zero ohm resistor and solder jumper.

EPG 04
Step 3: Echo Board programming

I stuck at this process due to circuit board design failure. After I connected FabISP to my laptop with miniUSB-USB cable and supply power to echo board using FTDI cable, I run make. I refered It was okay, but I encountered “initialization failed rc = -1 something blablabla” error when I run make fuse. It turned out that I shorted GND to MOSI of 2x3 pins. In my circuit design, I didn't pput enough clearance between two wires so Modela didn't mill the part, and I didn't notice it. After I scraped the bridged section, I could have run make, make program-usbtiny-fuses, and make program-usbtiny. To understand C programming, this tutorial helped me a lot.

EPG 01
Step 4: Final product

LED was blinking!!!