This code calls a blink function to make the LED blink when the push button is pressed
In the code, set the pin number according to the pin diagram
The first step is to connect the arduino board and to load select it in Tools, select the port, and upload the ArduinoISP sketch from examples. Then disconnect, connect the hello board to the Arduino board, reconnect to the PC, select Board and processor as Attiny44, select clock, select programmer as ArduinoISP, burn Bootloader, and finally upload the sketch.
To programme your Attiny44 with the Arduino board you'll need to install the Attiny44 plugin in the Arduino software. The steps to do this are:
Once that is done you can use the Arduino Board as a programmer for the Attiny 44. To programme the Hello board using Arduino follow these steps:
This code does the same thing as the Arduino code. It calls a blink function to make the LED blink when the push button is pressed
The code uses the DDRA registers to set the push-button pin as an input and the LED pin as output;
The PORTA register to set the value of the LED pin
The INA register to read the state of the push button pin
The fuses can be calculated with an online calculator as Engbedded. Fuses bits are enable if set at 0 and disabled if set at 1.The Low byte fuse set the clock value. For an external clock all the bytes are disabled.In the High fuse byte SPIEN must be enabled to allow serial programing, and RSTDISBL must be disabled to allow reprograming.The value of the fuses are:
These values must be inserted in the makefile. The extended fuse is left unprogrammed as default
First, connect the ISP programmer to the Hello board; to power the Hello board connect it to a FTDI cable
Write or copy the c code in the text editor and save as main.c; copy the makefile in the same folder; open terminal in the folder containing the c file and the makefile
Create the Hex file with the make Hex command
Burn fuses with the Make fuse command
Upload the firmware with the make flash command
Test the result