Atmel AVR studio is an integrated development environment used for developing and debugging embedded AVR applications. In this tutorial we will learn getting started with AVR Studio IDE platform with the help of basics program on ATMEGA series microcontroller in C language.

Getting Started with AVR STUDIO Steps for new project:

STEP 1: Open AVR Studio software → Click on ‘New Project’ from dialogue box. 

AVR Studio 1STEP 2: Click on ‘AVR GCC’ → Write the project name → Browse and select the location to be stored → Click ‘Finish’.

AVR Studio 2

STEP 3: Write the code in appeared Work space.

AVR Studio 3

 STEP 4: Compile the code. Click on ‘Build’ button.

AVR Studio 4

  • If the written code gets successfully compiled the following gets displayed on message box.
  • AVR Studio 5After getting compiled, a ‘.hex’ and ‘.c’ files gets created in the folder at the location of storage.
  • Further, to program the microcontroller, the hex file has to be burned/booted in the microcontroller.

 Methods to write the program Code:

  • Firstly, ‘avr/io.h’ is included to include the input and output files in the program. And some other header files can also be used according to the necessity.
  • Then ‘Main’ function is declared as void (or any other type).
  • Then comes the body of the program where input ports are initialized as high (1) and outputs as low (0) [wherever required].
  • After this, a ‘While’ loop is applied in which instructions are written as per the requirement.
  • Unlike usual C language program, the input and output functions are not required, instead, directly the pins of ports can be assigned the ouput values.