Getting Started With The Atmel AVR Processor
It has been a while since I worked on the Atmel AVR line of microcontrollers. Things have changed since I last played around with them. I did some digging to figure out how to start up again so here is a quick guide for those that are looking.
Pick a Atmel AVR MCU that fits your requirements. I’m doing a simple project so I picked the ATtiny26.
Buy, beg, borrow, or steal a AVR ISP a.k.a as the AVR In-System Programmer. There are schematics for home made programmers out there, I’ve had problems with bad solder joints and messed up connections with home made programmers so I avoid them. Debugging is hard enough, a bad programmer is a problem you really don’t want to debug.
Wire up your AVR processor to the AVR ISP using the documentation provided with the ISP. It is a matter of wiring up the MISO, MOSI, SCK, Reset, Vcc, and Ground pins and should take only a few minutes on a breadboard.
Now, on to the software. Download and install WinAVR. WinAVR is a set of utilities that includes a port of GCC to the AVR family, AVR-GCC, and several helpful Unix utilities.
The last step is to to download and install AVR Studio 4. Get the latest version. AVR Studio 4 has been updated to integrate with AVR GCC, you type your code in using C. It generates the makefile needed to compile your code with AVR GCC and, if you are using the AVR ISP, will let you upload your code directly to your microcontroller.
To get started, start up AVR Studio and select ‘New Project.’ Select ‘AVR GCC’ as the project type and click Next.
Then, select your microcontroller and the debug platform.
The debugger is pretty cool, besides stepping through the code, you can also view register states and modify variables on the fly.