Exp 1 Introduction To AVR Studio
Exp 1 Introduction To AVR Studio
AVR Studio 4 is the new professional Integrated Development Environment (IDE) for writing
and debugging AVR applications in Windows 9x/NT/2000/XP environments. AVR Studio 4
supports the following development tools: ICE50, JTAGICE, ICE200, STK500, and AVRISP.
AVR Studio 4 was created by the Atmel Corporation and can be downloaded for free from
http://www.atmel.com/atmel/products/prod203.htm.
First, download and install the software (as administrator) in the order listed in the
COMPONENTS section above onto your PC. Reboot the PC afterward if you're prompted to do
so for the installation to complete properly. Once you have the software loaded on your
machine, you should be able to go ahead and run AVR Studio. If it didn't create a desktop icon
when it was installed, you'll just have to rough it and find it in the Windows Start menu.
Creating a Project
Once AVR Studio is running you should be prompted for a project to work with, either by
creating a new one, or by using an existing project. In this case, click New Project. Select
Project type AVR GCC, enter Project name, select both Create initial file and Create folder and
select (and remember the location of !) a directory in which to put the new project directory,
then click Next.
Select Project type AVR GCC, enter Project name, select both Create initial file and Create
folder and select (and remember the location of !) a directory in which to put the new project
directory, then click Next.
Select Debug Platform AVR Simulator, and Device ATmega16, then click Finish.
Project Simulation
Now that the project has been created, it needs to be tested. Running the program on a simulated
chip built into AVR Studio 4 does this. AVR Studio 4 has the capability to simulate almost
every AVR microcontroller offered by Atmel.
1. Before the program can be simulated, the program must first be compiled. There are three
ways to do this:
1.1. Follow the menu Project->Build.
1.2. Click on the build icon, .
1.3. Or use the F7 key.
2. If the code was successfully compiled, a message in the message box at the bottom should
read “Assembly complete with no errors”. If it does not say this, then there were some errors in
the code. Clicking on the errors in the message box will highlight the error in the code in the
editor window.
3. Once the code has been successfully compiled, simulation can begin. There are two ways to
simulate the chip, debugging mode that allows a line-by-line simulation and run mode that
continuously runs the program.
3.1. There are a couple of ways to run in debug mode:
3.1.1. Follow the menu Debug->Start Debugging.
3.1.2. Or click on the Start Debugging Icon.
3.2. To start the run mode: 3.2.1. Follow the menu Debug->Run.
3.2.2. Click on the Run icon.
3.2.3. Or use the F5 key. 4. To stop the simulation at any point:
4.1. Follow the menu Debug->Stop Debugging.
4.2. Or click on the Stop Debugging Icon.
One of the most powerful features of the debugger is the ability to view the current states of any
of the registers. You can view the current value of any register in the “I/O view” tab.