AVRA Coding Help  <<--BACK            HOME      UP-^      NEXT-->>   Demo-2
side4linux, a simple integrated development environment!

AVRA Demo-1     Load, Compile and Simulate the 'Sample' project.


Purpose: 
Requirements:

  1. Open  the side4linux IDE and click on 'Project>Open Project' in the Main Menue.
  2. Double click on the 'DEMOS' Product Area,
  3. Double click on the 'SIDEdemos' Product,
  4. In the file dialog double click the 'AVRA' folder, this takes you to where 'AVR' assembler projects are kept.
  5. Double click on 'Sample', this opens the 'Sample' project folder.
  6. 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).
  7. Notice that the left bottom status bar window says 'Project: Sample' which is the Project Name
  8. Notice that the next window says 'Ptype: AVRA' which is the Project Type.
  9. Double click on 'sample.prj', this opens the 'Sample' project.
  10. and the lower left hand 'Status Bar' shows 'P:Sample2/atmega128/16.0000'
  11. This message means Project 'Sample' chip type 'Atmel AVR Mega 128' crystal frequency '16.0 Mega Hertz'
  12. Try clicking on 'Project' on the Main Menue, you will notice that 'Close Project' is now active.
  13. Click on the 'Open-TXT' toolbar button, observe the three files '8535def.inc', 'globals.inc', 'sample.asm'
  14. and double click on 'sample.asm'.
  15. Notice that the 'Save' and 'Save All' buttons are now active.
  16. Notice the highlighted file text in the tabbed file 'Notebook'.
  17. Click on the 'Open-TXT' toolbar button again and open the two 'inc' files also.
  18. Notice that by clicking on the 'tabs' you can change from one file to another.
  19. Keep in mind that these are only copies of the files on disk, if you make changes then you must 'Save' them.
  20. Now click on the 'Build' toolbar button and you should see something like that in the following screenshot,
Screenshot-1

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,


Screenshot-2

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.