Microcontroller For Beginners

AVR microcontroller for beginner......

AVR Assembler

Download the tutorial AVR ASSEMBLER for Beginner  (click)........its really cool for beginner..


Starting AVR Studio

Start the AVR Studio program by clicking on:
Start->Programs->ATMEL AVR Tools->AVR Studio 4
Once the program has started, you will be looking at a screen like this:


Creating a New Project

To create a new project, click on "New Project" on the Welcome Screen or go to the "Project" menu and select "New". The dialog box shown in the next figure appears.



In this dialog box you should select "Atmel AVR Assembler" and enter the project name. We choose the name "led" here, but this could of course be an arbitrary name. Next you'll have to select the project location. This is the location where AVR Studio will store all files associated with the project. We have used the location H:\csse1000\pracs\ as the folder. If the folder does not exist, AVR Studio will ask you whether to create it or not. Click "Next >>" and you will see a window like the following:




All the things are similar to GCC except the writing language, so I am skipping these. Write code in the code section......






See the code below...


             .include "8515def.inc"          ; for Atmega32 the file will be "m32def.inc"

        .def rmp = R16

         ldi rmp, 0b11111111
         out DDRB,rmp                 ; B port is output....


         ldi rmp,0b10101010
         out PORTB,rmp                                
ldi rmp,0b01010101
         out PORTB,rmp        
       rjmp label1


I suggest to read the Tutorial. You will understand easily. Assembly is not tough actually, if you are familiar too much with high level language, it will take some time to attain.

Assembler directives always start with a dot. Instructions or labels do NEVER start with a dot. Note that assembler directives like this are only meaningful for the assembler but do not produce any code that is executable in the AVR target chip. The name “MyPreferredRegister” will not show up in the assembled hex code, and therefore this name cannot be derived from that hex code.










Recent Videos

5208 views - 13 comments
1516 views - 1 comment
1201 views - 1 comment
1229 views - 1 comment

Recent Blog Entries

No recent entries