- Open the side4linux IDE and click on 'Project>Open Project' in the
Main Menue.
- Double click on the 'DEMOS'
Product Area,
- Double click on the 'SIDEdemos'
Product,
- In the file dialog double click the 'AVRA' folder, this takes you to
where 'AVR' assembler projects
are kept.
- Double click on 'Sample',
this opens the 'Sample'
project folder.
- Notice that project names are set to be an upper case
letter followed by lower case letters (easier on the IDE's Project
management routines).
- Notice
that the left bottom status bar window says 'Project: Sample' which is the
Project Name
- Notice that the next window says 'Ptype: AVRA' which is the
Project Type.
- 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
active.
- Notice the highlighted file text in the tabbed file 'Notebook'.
- Click on the 'Open-TXT'
toolbar button again and open the two 'inc'
files also.
- Notice that by clicking on the 'tabs' you can change from one file
to another.
- 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
screenshot,
From the screenshot above you can see that the 'Output window' has the output from
the AVRA assembler and the
'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
follows,
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,
C:000000
c002 Start: rjmp
restart
;start reset interrupt
if it does not then stretch out the Avrsim window some more until it
does.
Now you can click 'Step' and
step each instruction, watch it jump to the subroutine 'addregisters' and back until
it hits,
controlLoop:
C:00000c cfff
rjmp
controlLoop
;program control loop
Relative jumping to the same location automatically causes a 'breakpoint' that ends further
simulation.
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'
develops to
cover AVR programming and integration into a real world machine
controller.