Full Version : How to write C Code for AVR
avr >>C PROGRAMMING (AVR) >>How to write C Code for AVR


Kullmann- 12-15-2007
Hi all

I've a question to the specialists here:

I use Bascom Basic for AVR's but want also use C / C++ to develop code for the µC.
I'm a little bit confused about the best environment so maybe you can bring light into the dark?

I downloaded WinAVR and installed it and expected an IDE but there is only a Programmers nodepad. I read i have to create a makefile to compile my "hello world " example. Then there are a cpouple of other programs for e.g. debugging etc.
At least i've nothing understood about how this works!

Then i read that i also could use Atmels IDE for writing C code. I thought that this is only for Assembler? What have i to do to "activate" gcc etc in the Atmels IDE??

Now i'm completly confused!!

HEEELLLPPPPP!!!!!

I need some documentation for dummies how Winavr has to be used and maybe how i can use the AVR IDE with gcc and so on.

My try with google to find something easy to understand was not that successfull.

Thanks in advance!!

Uwe

ptm- 12-15-2007
if you already have WinAVR installed and you're not familiar with the gcc tool chain or make files you can just install atmels avr studio, this autodetects the winavr install. when you go to create a new project in avr studio just choose winavr instead of asm. it allows you to compile the program from the studio environment, will list errors and warnings, and is simple enough to use. it auto handles the make files for as well.

some of these might be helpful
http://openservo.com/SoftwareDevTools
http://www.cs.ou.edu/~fagg/classes/general/atmel/

Kullmann- 12-16-2007
Thanks ptm, that has solved some problems!
I've deinstalled both and installed it in the correct order.

But i have another problem:
I've downloaded the AT3221_Butterfly_Logger in c source.
there is already a makefile etc. If i call "make" in the folder, everything will be compiled.

If i load main.c and main.h into AVR Studio and try to compile it there then i get a Error that some variables are unknown.

Can someone help me what i've done wrong?
Do you need the source or something like that?

Cheers
Uwe


Forumer™ is Voted #1 Free Forum Hosting provider
Build your own community today with the largest message board hosting company.