Microchip Technology Inc

Getting Started - AVR® Microcontrollers

AVR microcontrollers (MCUs) are very easy to use. In fact, you can begin designing projects in just three easy steps. Here is a quick guide to get you started with AVR devices.

Step 1: Download Atmel Studio 7

All AVR® microcontrollers require some software to be useful. To create and debug this software, you can use an integrated development environment (IDE), such as Atmel Studio. This IDE contains everything you need to create, compile and debug code, and it will let you download your code straight onto the on-chip Flash of the AVR MCU - without any other software components.

Atmel Studio 7 is available free of charge.

Atmel Studio 7 can be used with all Atmel AVR and Atmel® | SMART ARM®-based MCUs.

An IDE for developing and debugging embedded Atmel AVR and Atmel | SMART ARM-based applications.

The Atmel Studio 7 editor simplifies code editing and lets you write code more efficiently. It supports all AVR and Atmel | SMART ARM-based MCUs, and connects seamlessly to Atmel debuggers and development kits.

Commercially supported IDEs are also available from our tool partners, including IAR Systems and ImageCraft.
Step 2: Look at Some Examples

Creating a software program from scratch can be hard, so we provide hundreds of example projects right here on the site. These are called application notes, and they cover various aspects of programming and using AVR microcontrollers. Just visit any device page and click on the "Documents" tab where you can browse all relevant application notes for that particular device. A great place to start is the 8-bit ATmega328PB.

Application Notes for the ATmega328PB (8-bit megaAVR)

Atmel START 
Atmel START is an innovative online tool for intuitive, graphical configuration and deployment of embedded software. It lets you select and configure software components, drivers and middleware, as well as deploy complete example projects tailored to the needs of your application. START is completely platform independent, and is able to generate project files for Atmel Studio, as well as a number of 3rd party IDEs. The configuration engine lets you review dependencies between software components and available hardware resources in the selected MCU, and automatically suggest solutions to any conflicts that in your setup. 

Atmel START is available on the web at http://start.atmel.com. Start can also be accessed from within Atmel studio directly from the file->new menu.

Step 3: Get Some Hardware Tools

In addition to Atmel Studio, you will also need some hardware tools. The two most important categories are the debugger and the development kits.

In-circuit Debugger

The most essential hardware tool for any software developer is the in-circuit debugger. It connects the microcontroller to the PC via a special debug and programming interface, thus opening a window into the internal workings of the MCU. Programming your software into the MCU takes only a few seconds, and there is no need to remove or resolder any components. Once programmed, the debugger can control the CPU to run, stop, or single step, and it will read out real-time data from all the microcontroller memories and I/O registers.

Three in-circuit debuggers are available for AVR devices, ranging from the entry-level AVR Dragon™ to the high-end AVR ONE. Which one you select is mostly a question of what kind of budget you have. They all support basic programming and debugging, but the more expensive versions offer faster programming and additional debug modes.

Atmel-ICE supports:

Programming and on-chip debugging of all AVR 32-bit MCUs on both JTAG and aWire interfaces

Programming and on-chip debugging of all AVR XMEGA® family devices on both JTAG and PDI 2-wire interfaces

JTAG and SPI programming and debugging of all AVR 8-bit MCUs with OCD support on either JTAG or debugWIRE interfaces

Programming and debugging of all SAM ARM Cortex-M based MCUs on both SWD and JTAG interfaces

Programming of all tinyAVR® 8-bit MCUs with support for the TPI interface

Atmel-ICE kit contents:

ATMEL-ICE: Encapsulated main unit, USB cable, 10-lead squid cable, flat cable (10-pin 50mil connector and 6-pin 100mil connector) and adapter board (20-pin 100mil connector, 6-pin 50mil connector and 10-pin 100mil connector)

ATMEL-ICE-BASIC: Encapsulated main unit, USB cable and flat cable (10-pin 50mil connector and 6-pin 100mil connector)

ATMEL-ICE-PCBA: PCB assembly of main unit only, no cables

ATMEL-ICE-ADPT: 10-lead squid cable, flat cable (10-pin 50mil connector and 6-pin 100mil connector) and adapter board (20-pin 100mil connector, 6-pin 50mil connector and 10-pin 100mil connector)

ATMEL-ICE-CABLE: Flat cable (10-pin 50mil connector and 6-pin 100mil connector)


STK600 Starter Kit

In addition to the debugger, many customers choose to start their development work on a development board. Microchip offers a wide selection of development boards, ranging from small evaluation kits to complete turnkey reference designs for selected devices. The most popular development board for beginners is the general-purpose STK600 starter kit.

Starter Kit for 8-bit and 32-bit AVR Microcontrollers

The STK600 is complete starter kit and development system for the 8-bit and 32-bit AVR microcontrollers. It gives designers a quick start to develop code on the AVR architecture, with advanced features for prototyping and testing new designs.

The AVR device connects to the STK600 using an innovative routing and socketcard sandwich system, which routes the signals from the device to the appropriate hardware.

The system consists of a generic socketcard, on which the AVR device is inserted, and a device specific signal routing card that routes the signals from the socket pins to the different functions on the STK600 main board dependent on the device. This design simplifies hardware setup when switching from one AVR device to another, since all connections from the device to the motherboard are determined by the routing card, a custom board for each device. The routing system is purely passive; no electronic components route the signals, so all I/O pins are directly accessible on the connectors with no altering of the electrical behavior.

The kit offers access to all device pins, and several useful hardware functions such as push buttons, LEDs, and Atmel DataFlash to create a complete system for prototyping and testing new designs. Free AVR Studio or AVR32 Studio lets designers write and compile firmware in either assembly or C language, and download the code to the target AVR device.

The board also has an adjustable voltage supply and adjustable clock to the target AVR device. The VCC level and clock frequency can be adjusted on the fly from AVR Studio or AVR32 Studio, giving designers the ability to test the performance at different voltage levels and clock frequencies with just the click of a button.


Evaluation Kits and Reference Designs

For engineers who do not need the flexibility of the STK600 starter kit, any one of the evaluation kits and reference designs offer a good alternative. These are device specific, and come with the AVR microcontroller surrounded by selected components. A great starting point for beginners who are new to AVR are the AVR Xplained PRO evaluation kits. These are available for most AVR product families. These even have an on-board programmer and debugger and therefore contains everything required to get started. A good choice could thus be the ATmega328PB Xplained Mini.

The Atmel ATmega328PB Xplained Mini evalutation kit is a hardware platform for evaluating the Atmel ATmega328PB microcontroller.

Atmel ATmega328P microcontroller (MCU). The evaluation kit comes with a fully integrated debugger that provides seamless integration with Atmel Studio 6.2 or later. The kit provides access to the features of the ATmega328PB MCU enabling easy integration of the device into a custom design

It features four capacitive buttons for easy evaluation of the integrated Atmel QTouch® Peripheral Touch Controller (PTC).

Additional Resources

Knowledge Base with FAQ and Online Tools Help
A comprehensive FAQ database gives answers to many of the questions you may have. The FAQ is organized into product groups and sub-categories for easy browsing.
Online versions of many tools user guides are available for easy browsing.

Application notes and other documentation
Get the most out of your microcontroller with the free application notes and datasheets (search for ATmega, ATtiny or ATxmega) containing detailed and application specific information. Here you can get Quick-Start guides, migration notes, design considerations, peripheral drivers, and other useful code examples.

Another great resource are videos that takes you through the AVR features and the practical aspects of using the development tools:

Discussion Forums
There is no need to re-invent the wheel! Users world-wide are constantly discussing new topics and inventions using Atmel microcontrollers. Be a part of the communities, participate in discussions, and get valuable feedback on any issue you may have.

AVR Freaks Forum

Training and Events
Learn even more! By participating in trainings, seminars, tradeshows, workshops, and conferences worldwide you will learn about the latest news and hottest topics. Atmel visits places all over the world to show you new products and features.

Third Party Support
Atmel AVR products have an extensive Third Party Support from leading companies worldwide. They offer hardware and software development tools and AVR consultancy services. They can help designers efficiently develop their application in a timely manner and provide expertise in projects if needed.

You will find more information and contact details for these companies in this section.

Third Party

Getting Started with AVR

In this series we are introducing a number of AVR peripherals, including GPIO, timer/counter, USART and ADC. In the process, we will work towards building an example application which samples an analog light sensor, then proportion to this ADC sensor reading, updates a PWM duty cycle. An averaged sensor value is then sent over USART to a PC terminal. Watch the videos here.

AVR Insights

AVR Insights is a frequent release of technical videos, diving into different aspects of the AVR MCUs from the core to peripherals with links to actual code examples. Follow and subscribe, you might discover some new aspects of the AVR here.