Fast start with AVR-GCC In AVRStudio environment

AVRStudio4 is capable to integrate AVR-GCC compiler by using built in plug-in. AVRstudio is a powerful tool which has assembler compiler- debugger, programmer, etc. Integration of AVR-GCC to it makes this tool much more powerful and more complete playground for developer. Integration of AVR-GCC is done by plug-in automatically. Plugin detects AVR-GCC - you don’t have to care about it. After this wee get FREE convenient user interface, automatic makefile generation, visual debugging with processors register view, and chip flasher.

 

Setting up working environment is simple. First of all download WinAVR20060421 and install in your PC. Then download AVRStudio latest Version 4.12 and latest service pack Service Pack 3 and install it in your PC.

You are set. Lets create sample project. Open AVR Studio and select menu->Project Wizard->New project.

 

In a Welcome Screen select Project Type AVR GCC and enter Project name, and type in Initial filename. Select Create Folder to put project files in separate folder. Browse to Location where you want your project to be saved. Press Next and select debugging platform - Usually AVR simulator for computer software simulation and select device – Atmega8.

 

After finish finish is pressed start writing project code. Write a simple program in code window, for instance:

#include <avr/io.h>
#include <avr/delay.h>
int main (void)
{
unsigned char counter;
DDRB = 0xFF;
while(1)
{
PORTB |=1<<2;
counter=0;
while (counter !=5)
{
_delay_loop_2(30000);
counter++;
}
PORTB &=~(1<<2);
counter=0;
while(counter !=5)
{
_delay_loop_2(30000);
counter++;
}
return 1;
}
}

Then in AVRStudio Project menu->Configuration->General tab. There you can configure makefile settings or you can use external makefile instead of automatically generated.

 

 

After settings are saved Press Build Active Configuration. Project will be compiled if there is no errors. Debugging can be done in same way as it is done with AVR assembler.

About AVR GCC Plugin look in AVRStudio Help system.

 

Comments

Thanx a lot.Wasted a lot of time finding the right tutorial and now Finally found something that makes sense to me !

I am certainly amazing something in this nice step and could not find this site more appreciated andinteresting .That can be a good thing - sort of. i mean its ridiculous to force visitors to learn a completely different navigation for every site they visit. Cheap Reverbnation Services