Best C Compiler for AVR

Go To Last Post
33 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi there,
I want to upgrade from asm to C , so which is the best C compiler for the purpose ,

Bye
AP

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

charlezapc wrote:
...so which is the best C compiler for the purpose

That is a loaded question and, the answer strictly depends on what your personal preferences might be. As many AVRFreaks as there are that use C, there will be that many different opinions on the matter.

I use the ImageCraft ICCAVR C compiler, I love it and, I wouldn't trade it for another. Yet, for all of the other compilers out there, we all have our own bias, for what ever particular reason and, most just won't give up their preference.

In the end, you will have to do your own research and decide your own particular needs and preference.

It's a loaded question, for sure...

You can avoid reality, for a while.  But you can't avoid the consequences of reality! - C.W. Livingston

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What do you value? Time or money?

If money is no object then go ahead and buy IAR for a few thousand dollars.

If you're on a budget, then CodeVision has a loyal following, who appreciate its automatic code generating wizards which can help speed up the development of peripheral hardware drivers.

ImageCraft is another popular option in a similar price range, with similar feature sets. For fans of the traditional C->compile->obj->library->link->application development model, ImageCraft works this way.

If you have no cash at all, or if you have plenty of time to learn new skills, or if you're already familiar with makefile-based compiler toolchains, then WinAVR is totally free based on the AVR target of GCC.

You can also get free evaluation copies of IAR, CodeVision, and ImageCraft, which have either time-limited functionality, or else limit the total size of the programs they can process.

The fact that you can evaluate all of the popular compiler offerings without any outlay of cash means that you have the unique opportunity to try all of them before-you-buy, and decide on your own which one you're most comfortable working with, and which one seems to be best capable of converting your personal coding style into the most optimal machine code.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks a lot for the reply , I want to ask the MOST optimum and flexible compiler with lots of help libraries , ImageCraft I am just going to this site and have a look . More options welcome...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AP,

I see you haven't learned how to search the forums yet as this is the most overdiscussed topic here and sparks a compiler wars thread about once a month. Carl has got it about right. You will find very good arguments for every compiler out there and much of it is religious. Since I worship free, I use the WinAVR toolset and have had no problems with it.

Anybody keeping count? What number 'Compiler War' thread is this?

Smiley

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry no war , I just ask for the amount of help libraries the compiler has . most supported, Ill evaluate all the names that I am encountring in this thread .

Like for example Keil is to 8051 .

AP

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What do you mean by "help libraries"? Are you talking about compiler documentation?

If so then there can be no argument that GCC is the most talked about compiler on the planet. A Google for "GCC" alone hits 42.5 million pages! ;-)

But you really should learn to use forum searches before you contemplate learning to use C compilers. If you did that you'd find that this is probably the most asked question here on Freaks and it's also the question which has had the most differing answers presented.

About the only person who can tell you which C compiler is "optimum and flexible" is the person who has used every AVR compiler there is to compile every AVR program that has ever existed. (such a person does NOT exist!)

Cliff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Wasn't there someone who wrote up an entry that could serve as a "sticky"
posting on top? If so, please speak up, and start a new thread about that.
I'll then lock that thread, and make it sticky (with my moderator hat on).

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

http://www.codevision.be/ FREE up to 2 kb code size.

and VMLAB for debuging. www.amctools.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In the Article section is a topic called "Which C-compiler should I choose". Don't know if it is still up to date. Maybe it is worth to risk a look.
Which C-compiler should I choose

Regards
Sebastian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

charlezapc wrote:
I want to ask the MOST optimum and flexible compiler with lots of help libraries

CodeVisionAVR and ImageCraft have a nice tool - CodeWizard ! You can build startup code fo your apps with few clicks of mouse.

It's very usefull for beginners IMHO.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If 'best' means:
lowest price... winavr
highest price... IAR (some folks like the most expensive models of cars, clothes, compilers)
smallest generated code... supply your test code, we'll all compile it and choose the smallest
fastest generated code... same as above... lets see your test code
nicest IDE.... very subjective. Do you like CUA editor like windows? etc etc
easiest to install... you only do this once, so theoretically, this shouldnt have much weight....
get to ask the compiler writer for help.... CV and ICCAVR
C++..... winavr and IAR
C99 stuff like stdint.h, 64 bit ints.... ICCAVR, IAR winavr
fastest fp... show us your test code...
relocatable assembler... iccavr & winavr & iar
linkable object files....iccavr & winavr & iar
most responsive to adding new avr types... any of the commercial compilers.. thats what you are paying for!
There's also Rowley, but are there any avrfreaks using it to report on it?

Imagecraft compiler user

Last Edited: Mon. Dec 11, 2006 - 10:41 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Codevision is the best and everyone else is wrong. (Tongue firmly in cheek....)

Go electric!
Happy electric car owner / builder

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Wasn't there someone who wrote up an entry that could serve as a "sticky"
posting on top?

That was me, Jörg, and the thread you requested is here: https://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=274532

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ahem, ImageCraft is the BEST :-)

Besides, I am asserting for a fact that no other compiler writer can beat this calligraphy I did a couple days ago:
http://www.dragonsgate.net/pub/r...

It's the word for... dragon, and man, I was inspired

// richard

Richard Man http://imagecraft.com

Beyond Arduino - When you're ready to get serious...
JumpStart C Tools, The Better Alternative.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Noooooooo...not the dreaded "Which C compiler is the best" thread...

Oh well, if you insist, IMHO:
CodeVision: Newbie compatible, code generator...
WinAVR: Final state of evolution in AVR C compilers, a bit strange to learn, but powerful. And expect some evolution (cbi/sbi removed, SIGNAL renamed to ISR...grrrrrrrrrrr)

Mix one AVRstudio with one WinAVR ,add a wee bit documentation (lots included in WinAVR basic install), and walla: The perfect IDE.

Teh end.

PS: It would look like everyone says that, which he had told a hundred times and still says that poeple shouldnt ask this question. If the admins made a script to locate threads like which c compiler is the best, and autoreplied with one of the statements from the more qualified people here (JohanEkdahl,bobgardner,gwen,dean...) it would simplify stuff ;-)

There are pointy haired bald people.
Time flies when you have a bad prescaler selected.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

daqq wrote:

CodeVision: Newbie compatible, code generator...

I like this definition!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

daqq wrote:

Oh well, if you insist, IMHO:
CodeVision: Newbie compatible, code generator...
WinAVR: Final state of evolution in AVR C compilers, a bit strange to learn, but powerful. And expect some evolution (cbi/sbi removed, SIGNAL renamed to ISR...grrrrrrrrrrr)
...
Mix one AVRstudio with one WinAVR ,add a wee bit documentation (lots included in WinAVR basic install), and walla: The perfect IDE.

I, among others, disagree!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello forum ,

I have a Reservation here .

I need a compiler that is most supported and used .A compiler which has lot of example codes such that , I wouldnt have to invent the wheel if I select some thing which only few people uses ,and I have to start writing everything from scratch .

PS: I already have hands on C compilers for other MCUS , now I want to incorporate AVR also to my family.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

try them all.
Read about them all.
Make your own decision.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't know much about the other compilers but the support for the GCC is great through this forum. Because so many people daily take a look at this forum, you'll get very fast response to any good question.

When you buy a compiler licence you'll often get support only for a limited time, so you have to buy an other licence to renew the support.

Since GCC is free, you'll find many free examples and applications in the web. The greatest source for free GCC stuff is of course this site.

And if you think about to program an ARM chip in the future, you can still use GCC because of the free available WinARM tool chain.

Other compilers might be more comfortable through code wizards and other reasonable features.

Regards
Sebastian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you want good value with ongoing support do not opt for IAR unless you enjoy spending money like it is going out of fashion and even then support is very patchy.
Other, paid for compilers, would seem to offer very good, very fast responses by the people who write and maintain the compilers.

Do not worry about the makefile with the GCC there is a sample file that will suffice for most of your needs as it stands with only a little tweeking.

On the 'front end' topic you can drive the GCC using Atmel Studio. Not done it but many others have.
What ever your end choice is, the bad news is, you will have to read the manuals.

Keep it simple it will not bite as hard

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

>> Wasn't there someone who wrote up an entry that could serve as a
>> "sticky" posting on top?

> That was me, Jörg, and the thread you requested is here:

Yes, and I'd like you to *repost* just that article as a new thread,
Johan. That's the only way I could make just that article "sticky",
without ripping it off that original thread. (There's no moderator
action like "Duplicate this article, and start a new thread with it.")
I'd like you to do it (rather than me reposting it) so your name will
be shown as the author. Credit where credit is due.

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ah OK, I just saw you already reposted it. Mange tak!
(Sorry, don't know Swedish, only a bit Danish.)

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jörg wrote:
Sorry, don't know Swedish, only a bit Danish

That's OK with me. I'm in the Swedish province Scania, just half an hour from Copenhagen. We've only been swedes for a couple of hundred years so we havent forgotten our Danish yet :-)

charlezapc wrote:
a compiler that is most supported and used

I'm sorry, but your question is in vain. The people that you want the answer from will most certainly not agree on any "most supported" and "most used" compiler.

Ask specific questions about the different compilers and you will get better answers.

[Paraphrased from my posting mentionend above:] At least threee compilers can be gotten for free (some of them in evaluation versions with limited functionality and/or time). Try them out yourself and form your own opinion. Browse the libraries that they come with to assess their respective "support". The names I am thinking of are: CodeVision, ImageCraft, AVR-GCC (often installed through the WinAVR package).

Specific questions about the functionality of any of those compilers will get good answers here.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

To be fair, I think you can install a limited version of IAR
for free as well.

Something that hasn't been mentioned before (albeit it doesn't appear
to be of much interest to the OP): if you are looking for a compiler
that does *not* require you also paying royalties to a company
located in the Northwest of the USA, your possible choices reduce
dramatically...

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

To be fair, I think you can install a limited version of IAR
for free as well.

Rowley offers 30-day evaluation of the full version.

IIRC IAR also does if you jump through the sign-up hoops, endure the calles from sales, and justify your existence.

Imagecraft offers a combination: time-limited full eval, and limited hobby version:

Quote:
All V7 demos (~6-7 megabytes) are equivalent to a Standard version for 45 days, then become code sized limit (normally 4K bytes) for an unlimited time for non-commercial use.

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

theusch wrote:
Imagecraft offers a combination: time-limited full eval, and limited hobby version:
Quote:
All V7 demos (~6-7 megabytes) are equivalent to a Standard version for 45 days, then become code sized limit (normally 4K bytes) for an unlimited time for non-commercial use.

Lee


As I said in the beginning of this thread, I use the ImageCraft ICCAVR v7.xx compiler. I had an issue when I got my new Dell notebook several months ago. I contacted ImageCraft via e-mail and their response was quite fast.

They didn't come back with the typical "Oh, that's not our problem, You'll have to contact Dell..." type response. Rather, they looked into the problem and fixed it. I was also asked to install v7.xx on my other Dell machines to ensure that the problem was fixed with some reasonable assurance.

They have their own user forum and you can get daily postings via e-mail on subject threads relating to ongoing topics.

While the standard v7.xx version is about $375.00, for me, it was worth every penney I paid. It's probably a bit expensive for a lot of hobbiest, but then too, if you are serious about your hobby, spending a reasonable amount of money on a good compiler is really no different then buying a good Fluke meter over that of a cheap RadioShack offering.

But as most all of us have pointed out, you have to decide what compiler is best for you based on your wants, needs, and budget.

You can avoid reality, for a while.  But you can't avoid the consequences of reality! - C.W. Livingston

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

From reading the above all posts I have come to a conclusion that GCC though not easy in handeling ,but is the most LOVED compiler ,Am I right

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You're certainly wrong, as once a decision has been made, everybody
loves the compiler of their choice most.

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How about we agree on leaving this troll on his own now?

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jörg Wunsch , I said the Most ! , I know most of us are very religious regarding their MCUS and compilers ;)

AP