09 • Embedded Programming



Assignment: program your board to do something

Microcontroller datasheet
The microcontroller used for the echo hello-world board was an ATtiny44. Here you can find its datasheet with further information:

Microcontroller with 2K/4K/8K Bytes In-System Programmable Flash

From it, I learned that the position of the components matter and this was a step considered during its design in the eletronics design week.

For programming the echo hello-world board, I followed this tutorial:

http://highlowtech.org/?p=1695

Basically, the steps done were:

• Installing ATtiny support in Arduino
• Connecting the board to the computer
• Programming the echo hello-world board

Below, I explain in details each step followed from the tutorial.

Installing ATtiny support in Arduino

I added the ATtiny support URL to the “Additional Boards Manager URLs” from the Preferences of the Arduino software. Then I installed the board package at the “Boards Manager” in the Tools menu - Board.

Connecting the board to the computer

First, I needed to do a cable to connect the FabISP board and the echo hello-world board. With cables and two clips, I created the cable to connect the boards through their 6-pin connector.

Pieces to make a cable to connect the boards
FabISP and echo hello-world board connected



Then, at the Arduino software, in the Tools menu I selected:
Board: “ATtiny24/44/84”
Processor: “ATtiny44”
Clock: “External 20 MHz”
Programmer: “USBtinyISP”
Later, I run the “Burn Bootloader” to apply the changes.

Programming the echo hello-world board

Following the tutorial, I selected a sketch from the example’s library of Arduino, the “Blink” file. To adjust the code for the echo hello-world board, I needed to change the pin number, accordingly to the “translation” of the Arduino pinout info to the ATtiny pinout info.

Pinout correspondence from Arduino to ATtiny



For my echo hello-world board, the pin for the led corresponded to the number 2. After adjusting the code, I compiled it and uploaded. It worked out and the led blinked.

Led blinking



Later, I tested a code to see if the button would turn on the led. For that, a simple code was used, available at Fab Lab Github page:

https://github.com/fablabbcn/arduino-workshops/blob/master/Hello%2044/blink_hello44/blink_hello44.ino

Again, I checked the pinout numbers, adjusted it on the code to make it work. The button successfully turned on the led.

Button turn on the led



Download the files

w09_embedded_programming_blink - ino file
w09_embedded_programming_blink-button - ino file