C-Compiler for megaAVR, recommendation?

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

I was wondering if anyone would care to advice me on which c-compiler to use? I'm considering switching to AVR, from Microchip controllers.

I've done professional development with Microchip using CCS compiler for a number of years. I get requests to do work on AVR platform, so i thought summer downtime would be a good opportunity to get started learning.

What i would like is:
- integrated IDE, or something that integrates with AVR studio. I don't want to switch tools for debugging.

- solid library of functions, also for on-chip resources. Would prefer not to deal with registers directly. I can always write that myself, but i prefer to have a ready-made library to deal with configuring timers, ADC, interrupts, PWM, CCP, etc.

- ANSI C compiler with "decent" code compression

- at least some degree of support available

- wide range of supported devices

- ability to compile for 32 bit devices is a plus, but not required

As I have a company to pay the bills, price is not a huge issue, within reason (say 3-400$ or so).

There seems to be a lot of choice in compilers, so a recommendation from an expert would be much appreciated :)

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

Welcome to AVR Freaks
AVR-GCC (WinAVR) does everything that I need and would tick all your boxes. However being free and your employer not having anyone to sue (should there be a bug in the compiler-heavens forbid) might make your employer uncomfortable.
Not having tried any other compilers to any extent and coming back to AVR-GCC, I am obviously biased (and would not consider myself to be an expert anyway).

AFAIK There is a post somewhere on the Forum regarding this subject.
Edit
Ah yes! https://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=44588

Charles Darwin, Lord Kelvin & Murphy are always lurking about!
Lee -.-
Riddle me this...How did the serpent move around before the fall?

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

We use avr-gcc for commercial work (I've done 4 products with AVR code with more on the way). We've never found (the lack of) commercial support to be an issue.

-- Damien

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

Quote:
price is not a huge issue, within reason (say 3-400$ or so).
Codevision http://www.hpinfotech.ro/ and Imagecraft http://www.imagecraft.com/ fall in that price range.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

ombrastein wrote:

1)- integrated IDE, or something that integrates with AVR studio
2)- solid library of functions, also for on-chip resources. Would prefer not to deal with registers directly. I can always write that myself, but i prefer to have a ready-made library to deal with configuring timers, ADC, interrupts, PWM, CCP, etc.
3)- ANSI C compiler with "decent" code compression
4)- at least some degree of support available
5)- wide range of supported devices
6)- ability to compile for 32 bit devices is a plus, but not required
7)As I have a company to pay the bills, price is not a huge issue, within reason (say 3-400$ or so).

Compilers:
IAR
GCC
Codevision
Imagecraft

1)All have an IDE. GCC Integrates with AVR studio. Imagecraft uses Code Blocks
2)All are ANSI C89 compatible GCC is C99 compatible (long longs, in block variable declarations). Imagecraft and GCC supply library source.
3)You say compression, but I bet you mean optimization.
Imagecraft does have a code compressor that automatically makes little subroutines out of 3 or 4 instruction sequences. Saves about 10-15%.
4)There are a couple of AVRfreaks that support the WinAVR version of GCC utils and libraries, but they don't put changes in the compiler. The Imagecraft guy and the Codevision guy are both reading this. You can ask either one of them a question at 3 in the morning and they'll answer within a half hour. Neither one of em ever sleeps. The Imagecraft guy might release a new minor version revision if you have a good enough suggestion.
5)All AVR compilers support the whole range of AVR devices
6)There is a 32 bit AVR, a UC3, but it is 'sort of' like an ARM with yet another compiler.
7)IAR several thou per seat. GCC free; Imagecraft $700 for pro version with MISRA code checking; CV is 150 euros. New version has big monochrome graphics lcd library.
Other freaks chime in.

Imagecraft compiler user

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

bobgardner wrote:
Imagecraft does have a code compressor that automatically makes little subroutines out of 3 or 4 instruction sequences. Saves about 10-15%.
So does Codevision. I see about 15% saving.

Not a war, just a fact ;)

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

Thanks all for the excellent information :)

Looks like GCC compiler might be a good place to start. As was mentioned here, lack of commercial support shouldn't be an issue with this huge active community of experts willing to help :)

I'm self employed, so I don't have any "employer wanting to sue people" to worry about. :)

I can always switch to/try out one of the other compilers at a later stage. For now tho, I'm mostly concerned with learning-curve of getting into another platform.

PS: Iv'e got a friend who uses ImageCraft for hobby projects. He uses that + AVR Studio and has to switch programs to download and debug. Is that still necessary?

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

Quote:
Is that still necessary?
Unfortunately yes..again.. It was not the case when they had a plugin for Studio4 with the previous version. I don't believe that they have made another one for V8 yet and with the advent of Studio5 everything may be up in the air.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

You should tell the boss how much money you have saved & he might give you a bonus!

Charles Darwin, Lord Kelvin & Murphy are always lurking about!
Lee -.-
Riddle me this...How did the serpent move around before the fall?

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

Hehe :) Since I am self employed that would be a very short conversation. But I can tell you "my boss" is very happy with my work so far. We try to keep an open office environment, and an open-door policy.

It gets a little confusing being the boss, the owner and only employe at times tho. Christmas parties are somewhat dull :)

Anyways: Thanks for all the good advice. Much appreciated!

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

Quote:
Christmas parties are somewhat dull

Well, at least you don't miss out at the buffet! :-)

Einstein was right: "Two things are unlimited: the universe and the human stupidity. But i'm not quite sure about the former..."

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

If your buddy uses imagecraft, seems like you'd try and stand on his shoulders. You wont be able to get him to give you any gcc help unless he's been a unix sysop for a decade. I compile in iccv7avr, then burn in avrstudio. I've never tried to debug anything, might be too stoopid. It seems way quicker to just add a print statement, recompile, burn run. Seconds.

Imagecraft compiler user