One a more serious note, I really think this assignment is one of the hardest I m stuck because of this datasheet.
Will jump to programing and use it to consult only. While I do will detach important sections bellow:
Because I was a bit confuse on how to do it I decided to list all steps in detail and have some sort of template for my next projects. With what is applicable I fill the gaps after each step and do while documenting it, and that is what follows bellow:
- avrdude or Atmel Studio 7 (windows only)
- for that I start by pointing I want to program a ATTINY44A
- Download makefile
- Bootloader is not going to be used here since there is no USB
- not applicable
- nope
- nope
- There is this code from Prof. Neil
- with all files prior downloaded on one directory, in linux I rename the file to makefile and run the script to create the firmware (this step I will repeat every time I want to modify the code:
mv hello.ftdi.44.echo.c.make makefile make
- done in previous step
run:
make program-usbtiny
- that was done already in the makefile
run:
make program-usbasp-fuses
I decided to try Arduino IDE as well to program my board.
In order to do it there are a few steps that should work regardless of the os
Paste the following into (Preferences)-(Additional Boards Manage URLs:)
https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json
Here instead of using terminal and avrdude, I used the Arduino IDE as it has a built-in serial monitor.
The results are as follows in the video
Now I will try to program it to blink as I press the button.
after looking into the PCB schematics I determined the button is connected to pin 10
after looking into the PCB schematics I determined the LED is connected to pin 6
In human language I want something like this:
the problem is I never really coded from scratch only changed code, so that will be a challenge...
I Tried first to customise the blink code from Arduino IDE with my pin numbers, That did not work
I realise after trial and error that the pin number on the data sheet does not correspond to the arduino pin number.
So after empirically finding the right pin number I programmed the board and got it to blink!
Next I wanted the LED to react when pressing the button, so I searched for attiny44 arduino pin. With the right pin number in hand I replaced the pins in the code and it worked!
now I inverted when the LED turns on and off.
I was a bit annoyed my board would not advise me when powered so I decide to solder a red LED and a 22 Ohms resistor and a resistor so if I got the connections wrong I would know and switch it.
Thats the before and after