9. Embedded programming¶
Group assignment:¶
The group assignment can be viewed using this link
Individual assignment:¶
I first read the general features od the microprocessor in the datasheet, I learnde that the attiny44 has 12 programmable pins for I/O, operates on voltages from 1,8 V to 5,5 V and in a range of temperatures secure for most uses I can imagine (-40C to 85C).
This week, I learned how to program the ATtiny board using arduino ide uno to make it do something.
First I checked if my laptop registered the board.
Second, to use the Arduino IDE to load the blink example and the button example, I first needed to set the right configuration to burn the boot loader.
Then, I opened arduino blink example to test my board. I needed to change the led pin, and I found that the pin I used corresponds to pin 8.
Afterwards, I uploaded the program to the board to run the program where I encoutered some errors in the board.
I needed to solder a cable to fix the problem in my board. After that the turtle blinked.
After that I tried Niels code in c language for bliking and led.
I used datasheet to find my led pin.
I foun my led pin to be PB2 and changed the corresponding line of code:
#define led_pin (1 << PB5)
Once again the board blinked. So I made another change. On the delay definition I put a bigger number (I put 500), and the blink sequence was now slower.
#define led_delay() _delay_ms(100) // LED delay
To practice coding, I opened arduino button example and again changed the led pin and button pin to 8 and 3.
Now, when I press the button, the led turns on.
Also, I found that the PA3 pin I was using has an internal pullup resistor, which can be used instead of an external one.
Then I mixed the button code with the fading code, so, when I push the button the led fades up.