Black_line

08. EMBEDDED PROGRAMMING

INTRODUCTION

The goal of this assignment is read the microcontroller data sheet and program the board to do something, with as many different programming languages as possible.

Students should have:

	
Documented what you learned from reading a microcontroller datasheet
	
What questions do you have? What would you like to learn more about?
	
Programmed your board
	
Described the programming process/es you used
	
Included your code

MICROCONTROLLER

After read the datasheet of the microcontroller, I think that the most important things are:
Memory of microcontroller: 2k, 4k or 8k. It is very important, we have to check previously our porgram and the libraries to know which have to chose.
Clock: It is possble to use the internal clock of the microcontroller, or put an external clock. Pins: There are some pins which have a specific position in the microcontroller (as CLK, RESET, MISO, MOSI, SCL, VCC and GND).

PIN CONFIGURATION

First of all we have to know that the pinout of the ATtiny 44A microcontroller are different number in the Arduino code. We can see at the image below.

Pin configuration ATtiny 44A

SOFTWARE

Before to begin, we need the Aruino's software, it is possible to donwload in the Arduino's web.

To install the Attiny on Arduino we need:
1. In the menu select: 'File' -> 'Preferences' and add "https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json" on the line where it put 'Additional Boards Manager URLs'.

Preferences

2. In the menu select 'Tools' -> 'Boards' -> 'Boards Manager' and search attiny. Insall it.

Attiny boards manager

To install the drivers for the FTDI wire i found this web which explain how to do it.

1. Search the Arduino's folder.
2. Create a new folder inside it called "hardware" and copy in it the folder inside the .zip you download before.
3. Restart the Arduino.
4. Now, go to the Tools -> Board, you can see the ATtiny.

board ATtiny on Arduino

CONNECTING BOARDS

We have to supply the ATtiny and connect it to the FabISP, the programmer (with the VCC, GND, MISO, MOSI, SCK and RESET pins) and connect the programmer to the ISP connector of the hello-wold board. Also it is necessary to supply the hello-world board with the FTDI wire.

CHOSE BOARD AND PROGRAMMER

As we see in the picture before, we have to chose the ATtiny44 (external 20 MHz clock) on the Tools -> Board. We also have to chose the programmer USBtinyISP on the Tools -> Programmer.

programmer USBtinyISP on Arduino

PROGRAM ATtiny

To upload the program, fisrt verify that the program is correct with the first buttons that we can see at the image below, this is to compile, if everithing it is right, click the next button to upload the prgram to the ATtiny.

Compile and upload button on Arduino

First I tried the Neil's program. I upload the program but it didn't work, it is for that reason that I repeated the board and I weld the components again. In this new board I had any problems, everythikg was good.

Hello world program Neil

Later I did another program, modifying it, I changed the button, in this case act as a switch.

Hello world program

DOWNLOAD FILE:
week 8 (RAR)



Previous assigment Home Next assigment