Working Group

INDIVIDUAL WORK

The week of microcontroller programming. This week I am using the attiny44 microcontroller as my brain. I need to upload a program to my circuit for it to do something.

To do this I need to understand the structure of the component. But in my previous mission in week 7 I did the whole circuit. I had read the data sheet; in this data sheet the component is supplied with 5V max. To upload a program in this component you have to go through 6 pins: the vcc, the gnd, the mosi, the miso, the reset, and sck which correspond respectively to the following pin number: 1; 14; 7; 8; 4; 9. To locate these pins for later I highlighted them by soldering them to Conn 2x3. Here is the component in the datasheet.

Attiny44 PinOUT
...
Attiny44 Pin Programming
...

Identification of pins. Pins of the attiny44 that can be used as output or input are all pins except VCC, GND, RESET.

In my circuit I connected a led to pin 1, i.e. pin number 12; I will design a program that will allow me to flash this led. To design my program I will use the arduino IDE. And when I'm done I'm going to use an arduino uno board as a programmer and upload my program to my designed circuit.

Design of the program on the Arduino IDE. I open the arduino software and I create a new file named blink led. Note that the arduino IDE has three parts: the first part consists of declaring our variables and assigning them to the pins of the microcontroller. The second part, the void setup, allows us to initialize our variables as output or input. In this second part, the instructions therein are executed only once. In the third part, the void loop, the instructions are repeated in a loop.

I first declare a Led variable then I declare the size of the variable which is int. The int variable type has a size between -32,768 and 32,767. Finally I assign pin 1 to my variable. It should be noted that the program does not take into account or does not recognize the pin so I deleted the pin and left the 1. So it takes the numbers into account. Which gives us: int Led=1; the equal means that we affect and the Virgil point allows the program not to read the continuation. The int Led=1; is a variable declaration, if there was a motor connected, we would declare it by saying int Motor=3; also.

Second in the void setup. In this function the instructions are executed only once. What is an instruction? an instruction is a line of code written in a language understandable to the computer that it subsequently executes. We are going to give an instruction to say that our Led is an output, we are going to use the instruction ‘pinMode (variable-name, Output/Input); ‘. We have pinMode (Led, OUTPUT); this is an instruction.

Third in the void loop; in this function the instructions are repeated in a loop. Here I will flash my led. Which amounts to turning it on and turning it off at a given time interval. Then the instruction which will make it possible to light the Led is the digitalWrite (Led, HIGH); the HIGH means high or 1. And that of turning it off, if high is to turn it on, then low is to turn it off. To turn it off, use digitalWrite (Led, LOW); the semicolon is very important, without it the program would detect an error. Finally, the time interval for switching on and off is defined with the delay function (time);

Le programme final :
//Declaration
int Led=1;
void setup () {
// Initializing
void setup () {
pinMode(Led, OUTPUT); }
void loop () {
//the Loop
digitalWrite(Led, HIGH);
delay(500);
digitalWrite(Led, LOW);
delay(500);}
Now follow the two steps to program our card

1/ I proceeded as follows: this program is to prepare the Arduino board to be used as an ISP.

a. If you did not have to install the Arduino software then do it. This is this link to get

b. Then go to the Arduino IDE, connect the Arduino board to your pc via the USB cable then in Tools select the type of board plug. (The Arduino board you had in hand).

c. Then in tools again click on programmer and choose on Arduino as ISP

d. Finally clip on file then example and look for ArduinoIsp. The program will open on another window and upload it.

2/ After part 2 connect your Arduino board to your attiny via the manufacture cable. This part consists of uploading the program to attiny44.

a. Reconnect the USB cable from the card to the computer. Then click on tools then map type and choose attiny44.if in card type it turns out that you do not have Attiny Microccontrollers then click in files---additional---references---and you copy the link inside .

https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json

b. Then click on tools then card type and choose attiny44.si in card type it turns out that you do not have Attiny Microccontrollers type on the internet how to add Attiny Microccontrollers to the Arduino IDE.

c. Then reclicks on tools in processeur choose attiny44,

d. In addition in tool still clip on Clock and chosen internal 8 MHz,

e. The programmer always stays at Arduino as ISP and the port does not change.

f. Finally in tools click on Burn initialization sequence.

g. Chosen in example the blink code modify the LED_BUILTIN in LEDBUILTIN. I declared the LEDBUILTIN=A1 and finally I uploaded