Main Menu
Home
AVR News
Atmel AVR
AVR Development Tools
Valuable Tools
WinAVR toolset
Makefile for WinAVR
AVR Virtual Simulators
Hardware for prototyping
GCC and AVR-GCC
Short introduction to C
AVR-GCC Tutorial
Example AVR Projects
AVR-GCC articles
WinAVR Site Map
Scienceprog FORUM
ScienceProg BLOG
Disclaimer
WinARM Tutorial
Latest comments
Measuring motor speed and...
Dear Administrator The code above...
More...

Programming AVR ADC module...
hi please send me example usart with...
More...

Measuring motor speed and...
main.c: In function...
More...

Running TX433 and RX433 RF...
(Hopefully this is not a re-post). I am...
More...

Running TX433 and RX433 RF...
I just bnought a pair of the RX/TX 433...
More...

Friendly sites

Related Items:

Recommended sites


Fast start with AVR-GCC In AVRStudio environment PDF Print E-mail
Written by Administrator   
Wednesday, 03 January 2007
Last Updated ( Wednesday, 03 January 2007 )
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.

Image  

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.

Image

 

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.

 Image

 

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.

 


Related Items:

   

Users' Comments  
 

Average user rating

 


Add your comment
Only registered users can comment an article. Please login or register.

No comment posted



mXcomment 1.0.6 © 2007-2008 - visualclinic.fr
License Creative Commons - Some rights reserved
< Prev   Next >

© 2008 WinAVR AVR-GCC Tutorial
Joomla! is Free Software released under the GNU/GPL License.