Path: Home =>
AVR-english =>
Beginner => Studio 4
First steps with Studio 4
This page introduces you to edit, simulate and program an AVR in assembler using
ATMEL-Studio 4 free software. This software is
available for download on ATMEL's homepage.
The screenshots provided here are © ATMEL. Please note that the screenshots might be different
from those of other versions of Studio.
This introduction is not a handbook on Studio 4, it just demonstrates some basic ideas on how to use the
software to do the first steps. Installation of the software also is not included.
To the top of that page
To start a new project
After starting studio 4 a new project will be created, like the screen in the following picture.
Following the selection of a project name and selecting a folder to store the project files in, we will
be forced to select an AVR type.
The built-in editor opens a text file, in which we type in the assembler source code.
That's it with the editor.
To the top of that page
Simulation is a matter of the point of view
To test this program in the simulator, we select Build-and-run from the studio menue. In the lower window,
called output window, the output of the assembler is shown (hopefully, without any error messages).
A yellow arrow points on the next instruction to be simulated. To see what is going on, we close the
output window, and open up a register view for the registers R16..R31 in the left window.
By using the view menue, we can open up additional views, e.g. a view on the content of all registers.
By pressing F11 we step through the program, instruction by instruction. After two steps in that
program the register window looks like this.
After execution of the EOR instruction the register content of R17 has changed, the colour changes
to red.
The flags of the status register SREG can be viewed in the left window by selecting I/O, CPU and
SREG.
The same window shows the content of the ports, here: Port B.
To the top of that page
Programing the AVR
In order to transfer the program to the AVR, the Studio provides an interface to the programmer board
STK500 (and to some other boards). This is selected in the menue Tools. The studio then communicates
with the STK500 board.
With that interface, either the currently edited, assembled and simulatede program or an external
.hex file can be transferred to the AVR.
If you have other programming equipment, you can use the .hex- and .eep-files generated by the
studio to feed them to the AVR with your own transfer routines.
To the top of that page
©2002 by http://www.avr-asm-tutorial.net