Fast start with AVR-GCC In AVRStudio environment
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
Thanx a lot.Wasted a lot of time finding the right tutorial and now Finally found something that makes sense to me !
Add new comment