side4linux, a simple integrated development
Compile and Simulate the 'Sample' project.
provide a basic introduction to programming an Atmel AVR micro in
- Run the simulation of the binary code in the
simulator provided (Avrsim).
From the screenshot above you can see that the 'Output window' has the output from
the AVRA assembler and the
- Open the side4linux IDE and click on 'Project>Open Project' in the
- Double click on the 'DEMOS'
- Double click on the 'SIDEdemos'
- In the file dialog double click the 'AVRA' folder, this takes you to
where 'AVR' assembler projects
- Double click on 'Sample',
this opens the 'Sample'
- Notice that project names are set to be an upper case
letter followed by lower case letters (easier on the IDE's Project
that the left bottom status bar window says 'Project: Sample' which is the
- Notice that the next window says 'Ptype: AVRA' which is the
- Double click on 'sample.prj',
this opens the 'Sample' project.
- and the lower left hand 'Status
Bar' shows 'P:Sample2/atmega128/16.0000'
- This message means Project
'Sample' chip type 'Atmel AVR
Mega 128' crystal frequency
'16.0 Mega Hertz'
- Try clicking on 'Project'
on the Main Menue, you will notice that 'Close Project' is now active.
- Click on the 'Open-TXT'
toolbar button, observe the three files '8535def.inc', 'globals.inc', 'sample.asm'
- and double click on 'sample.asm'.
- Notice that the 'Save'
and 'Save All' buttons are now
- Notice the highlighted file text in the tabbed file 'Notebook'.
- Click on the 'Open-TXT'
toolbar button again and open the two 'inc'
- Notice that by clicking on the 'tabs' you can change from one file
- Keep in mind that these are only copies of the files on
disk, if you make changes then you must 'Save' them.
- Now click on the 'Build'
toolbar button and you should see something like that in the following
'Status bar' says 'Build OK!'.
Now let us simulate the assembly binary by opening the assembly 'List' file in the 'Avrsim' AVR core simulator as
From the Main Menue click on 'Tools>AVRA>AVRSIM'
and once the simulator has launched then stretch it out so that it
looks something like the following screenshot,
Now click on 'Restart' on the
Main Menue of Avrsim and the code will show a red line as follows,
c002 Start: rjmp
;start reset interrupt
if it does not then stretch out the Avrsim window some more until it
Now you can click 'Step' and
step each instruction, watch it jump to the subroutine 'addregisters' and back until
;program control loop
Relative jumping to the same location automatically causes a 'breakpoint' that ends further
Now try clicking 'Restart'
again and this time alter the value of R16 by clicking in the R16
register box and entering
'99' and click on 'Run'. The
program should now automatically run through to the 'breakpoint' and again leave the
value of '3C' hexadecimal in
the R16 register box.
Try hovering the mouse pointer over the other buttons and read the 'Tool tips' provided to get some
insight on how they
work and try them out. Check out the Useful
Links Page for links to AVR projects.
Now close Avrsim which will return you to the IDE.
Click on 'Project>Close Project'
from the Main Menue and now close down the IDE by clicking the 'X' in the top right corner.
We will provide other demos as 'side4linux'
cover AVR programming and integration into a real world machine