Week 8
Embedded Programming
Assignment
Group
• compare the performance and development workflows for other architectures.
Individual• read a microcontroller data sheet program your board to do something, with as many different programming languages and programming environments as possible.
ATtiny24A/44A
For the button and led assignment from electronics design I used an Attiny44 so I went trough the datasheet where I familirized myself with the pin configurations, memory and how to program and refer to pins.
Features
Pin configuration
ATtiny24A/44A are low-power CMOS 8-bit microcontrollers based on the AVR enhanced RISC architecture. By executing powerful instructions in a single clock cycle, the ATtiny24A/44A achieves throughputs approaching 1 MIPS per MHz allowing the system designer to optimize power consumption versus processing speed.
Reference:http://academy.cba.mit.edu/classes/embedded_programming/doc8183.pdf
Programming in different ways
Using avrdude on Linux
The ProgramsWhile I was programming it on my windows it kept giving me errors so I decided to use linux to program the board.
Ist program
The program was written in c language in a text editor software i.e.Notepad++. The first program was to test the board by blinking the Led with a delay of one second and is as seen below.
2nd program
The second program makes the LED to blink faster when the button is pressed and slower when the button is not pressed as shown below.
Programming the board
To program the board I put both the makefile from the archives and my file saved as button.c. I entered the directory using the command. Cd button.
Editing the makefile
To edit the makefile I used the nano makefile command and displayed the makefile as shown
I then changed the name of the project and the F_cpu which is the clock speed. To compile the file I entered the directory where the folder was using the command Make
This command generated a file called button.out and button.c.hex. I then proceeded to upload the code using the command avrdude -c usbtiny -p t44 -u -U flash:w:blink.c.hex:i. Which gave the following feedback.
The program was successfully uploaded I follwed the same step for the 1st program.
1st program
A video of the led blinking
2nd program
A video of the button pressed and led blinking faster.