AVRs From Scratch: A Guide

When I first started using the Atmel AVR family of microcontrollers, it was very difficult to find useful information on how to complete basic tasks with the device. Arduinos didn't exist back then and the DIY electronics movement, although it was definitely around, was nowhere near as large as it is now. Luckily, I had a friend who helped me out a great deal and who let me annoy him on a regular basis (I still do!) with questions about these microcontrollers. I understand that lots of people may not be so lucky, so I have written this guide in the hope that you too can discover the amazing flexibility and power of AVR microcontrollers.

The chapters contained in this guide have been designed to be read in order; feel free to skip around but know that if I explain a topic in a previous section I may jump straight into using it in later sections. Also, if you see a highlighted block like this:

This is a block of important text! Watch out for these in the document. They contain tips, tricks and information on common pitfalls that could save you hours of time in the future!

then make sure you read it very carefully!

I am assuming a limited amount of electronics knowledge. I have included a basic refresher chapter that is designed to jog your memory of certain concepts. I very much suggest that if you don't understand anything in it that you consult with other sources (several books and websites are mentioned at the end of the chapter). I am also assuming some general programming experience, not neccessarily with any particular language, just with general programming constructs such as: variables, if/for/while blocks, etc.

This guide and all associated works are licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 Australia License.

Please note that this guide is still a work in progress.

Section 1: Setting everything up

Section 2: Let's get going!

Section 3: AVR Interrupts and Special Features

Section 4: Serial Communication (UART)

Section 5: Timers and Pulse Width Modulation

Section 6: Analog to Digital Conversion

Section 7: Using the Internal EEPROM

Section 8: Advanced Serial Communication (SPI, I2C/TWI)