Juan Ranera
Fab Academy 2013 Participant
Embedded programming
The assignment for this week is to read a microcontroller datasheet and to program the Hello Button + LED board
Electronics design to do something,
with many different programming languages and programming environments as much as possible.
I've followed the tutorial Kaziunas Anna and
this page.
ATtiny Embedded Programming with the Arduino IDE
I've downloaded the Arduino IDE software version 1.0.3 and the ATtiny support file for Arduino. I've installed the Arduino environment with Attiny complement to the following steps.Installing ATtiny support in Arduino:
- If you haven’t already, download the Arduino software, version 1.0.3 (or 1.0.1 but not 1.0.2). Install the Arduino software, following the instructions for Windows or for Mac OS X.
- Download the ATiny master.zip file from the link above.
- Unzip the attiny master.zip file. It should contain an “attiny-master” folder that contains an “attiny” folder.
- Locate your Arduino sketchbook folder (you can find its location in the preferences dialog in the Arduino software)
- Create a new sub-folder called “hardware” in the sketchbook folder, if it doesn’t exist already.
- Copy the “attiny” folder (not the attiny-master folder) from the unzipped ATtiny master.zip to the “hardware” folder. You should end up with folder structure like Documents > Arduino > hardware > attiny that contains the file boards.txt and another folder called variants.
- Restart the Arduino development environment.
- You should see ATtiny entries in the Tools > Board menu.
and the programmer that I've used.
The program I have done is very simple. When you start the power the LED flashes three times to verify that the program is correctly loaded. Every time we make a pulse, the LED goes on and off and then it blinks again the number of pulses you have made until the moment, actually it counts five times and starts again.
In my board's layout I've used PA3 as input to connect the button and to connect the LED I've used PA7 as output. I've followed this table.
ATtiny 44A vs. Arduino Pin-Out Numbering
ATtiny 44A Pin Number |
Corresponding Arduino Pin Number |
Details |
1 | No number, no access? | VCC (+) |
2 | Pin 10 | PB0 |
3 | Pin 9 | PB1 |
4 | No number, no access? | PB3,Reset |
5 | Pin 8 | PB2, PWM |
6 | Pin 7 | PA7, PWM, Analog Input 7 |
7 | Pin 6 | PA6, MOSI, PWM, Analog Input 6 |
8 | Pin 5 | PA5, Analog Input 5, PWM, MISO |
9 | Pin 4 | PA4, Analog Input 4, SCK |
10 | Pin 3 | PA3, Analog Input 3 |
11 | Pin 2 | PA2, Analog Input 2 |
12 | Pin 1 | PA1, Analog Input 1 |
13 | Pin 0 | PA0, Analog Input 0, AREF |
14 | No number, no access? | GND (-) |