Hi, Habr!
This small topic will show you how to use the popular IDE Code :: Blocks 10.5 to write programs for ATMEL AVR microcontrollers.

')
And so, it all begins with the download of the free GCC compiler C for AVR, which under Windows is called WinAVR, respectively.
Now the newest version is version WinAVR-20100110.
Download this file from SourceForge.
Install WinAVR
The package is simply installed where it is convenient, but, of course, Russian letters should not be on the way. After installation, the path to the compiler must be added to the PATH, so that all programs know that we are now the proud owners of WinAVR.
That's all.
Code :: Blocks
Code :: Blocks is installed,
Run, create a new project, select the AVR Project.

As you can see, there are many target platforms here, and this is a positive quality of Code :: Blocks.
Select the type of processor that interests us, set the clocking frequency,
check the file types we need for debugging.

We write a simple program
We blink beautifully with the LEDs connected to the PORTD.
#include <avr/io.h>
#include <avr/delay.h>
int main (void)
{
int i=0;
// set PORTD for output
DDRD = 0xFF;
while(1){
for(i = 1; i <= 128; i = i*2)
{
PORTD = i;
_delay_loop_2(30000);
}
for(i = 128; i > 1; i -= i/2)
{ PORTD = i;
_delay_loop_2(30000);
}
}
return 1;
}

click build - no errors, 2 warnings.
In the working directory of the project in the BIN folder we find the hex-file, this is the program for our microcontroller, which can be loaded into it and run.
To work with the compiler from the console, you need a special makefile file that contains information about the type of processor, clock speed and other important things.
When working with Code :: Blocks, the need to manually fill in the makefile file disappears. Because everything can be configured in the compilation settings window.
It also edited the optimization and so on.

Code :: Blocks is a very flexible environment that suits many.
She came up to me, now I am constantly writing code for the AVR in it, which is convenient.
I hope the information was helpful.