BACK

Embeded Programming

Long and painful road
Here's our assignment:

x read a microcontroller data sheet
x program your board to do something, with as many different programming languages and programming environments as possible
x extra credit: experiment with other architectures
Back to the basics
HTML tutorial

This week project lasted 3 weeks in total. Not being able to get a propper workflow and stuck trying so many various methods. I have a functional FabISP module and began with a not so functional HelloBoard. The Hello board was to be debugged. It took me at least 10 hours of steady debugging. The only solution was to start over again and make a new one. Resolder everything and reprogram the hell out of it. Now let's introduce our topic...
Understanding the AVR



This is the official Atmel ATTINY44 Datasheet. A very instructive and boring read. I was just impressed by data volatility. 20 Years! Awesome. Seriously that quite a feat for humans. Just a century ago rubber tires did not exist! So that datasheet is a great place to start when you use that chip.
There is 238 pages in that datasheet. I'm used to somewhat 3 pages DS. I counted 74 pages of diagrams that my math level or IQ do not allow me to understand. Hence I was mostly parsing through it more than reading it. Even with a qualified Electrical engeenier by my side, a coworker, I was getting it all. As I plan to mostyl follow tutorial and have my sh*t checked by someone qualified, it should be enough.
Git error
Now I did find that diagram lifesaving. I actually printed the pinout and kept it with my electronic kit.

Git error
Maybe I'm a very visual person but this is a quite clear explanation of how things works in that little blackish part.

Git error
Memory adressing (chapter 5) is also a must read.


Programmingthe AVR
Crosspack the IDE I will be using on my Mac.
I also installed AVRDUDE, AVR-GCC and did that through Homebrew. While doing this. I also did the same on my linux machine. While it download, I can admire the red led blinking on my AVR Programmer. You can see in my System Profiler that the the AVR Programmer is recognized properly:
HTML tutorial
The most important line in the installation manual is : please restart Terminal after installation to make sure that it inherits the new PATH environment variable. Doing so, I get this when I try $avrdude:
HTML tutorial
HTML tutorial
You can get the manual for AVRdude by typing $man avrdude in your terminal. It's a very long and comprehensive manual but I also read LadyAda page on avrdude.
After that intense reading. It's time to program that chip. So I headed to FabISP programming tutorial and followed the instructions. You can get the firmware here. Now following the tutorial was quite straightforward. Here's some screenshots of my terminal output. Git errorOutput of make clean make hex
Git errorOups, editing the Makefile to include my programmer would be a good idea.
Git errordoing so
Git solutionsTrying it...Damn
Git error
So I had not only to change my Makefile but also to specify the port with -P /dev/tty.usbmodem00143251 for it to be uploaded correctly
Git solutionsChecking with lsusb



Toughts
Doing my research trying to program that damn chip, I found this really nice FabISP. I will try to make it if I have time. I'm glad I was able to complete that project within a few days. I will probably make a second AVR programmer just in case. Might add the pictures here.