Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

AVR Compiler: which is the best

AVR Compiler: which is the best

2004-03-14 by markevans_1

Ok, I hope this message isnt the start of a huge thread, but I would 
like biased/unbiased opinions on what you guys recon is the best 
compiler for the AVR microcontroller.

Basically I want something that is cheap, ideally comes with a 
fuctional IDE and is quick to code with ( has built in libraries, 
language maps easily to AVR, and is as high level as possible) and 
at the same time has the abilty to do low level stuff when speed is 
required ie: inline assembly. It needs to compile fast and generate 
small code and needs to support AVRs which have no RAM.

Not too fussed about language as long as it meets all my above 
criteria, but I suppose I have some preference to C.

Hope you can help
Mark.

Re: [AVR-Chat] AVR Compiler: which is the best

2004-03-14 by David VanHorn

At 03:14 PM 3/14/2004 +0000, markevans_1 wrote:

>Ok, I hope this message isnt the start of a huge thread, but I would 
>like biased/unbiased opinions on what you guys recon is the best 
>compiler for the AVR microcontroller.

Is there a bad one?

The AVR was designed for C, but there's Basic, Forth, and probably others out there.

Re: [AVR-Chat] AVR Compiler: which is the best

2004-03-14 by VA3TO

I never took to C and I usually prefer assembler but when it comes to 
the AVR,
I am partial to Bascom.  Todays Basic compilers are much more structured
& efficient and have come a long way since the days of GOTO 100.
"This is not your father's Basic" :)
Bascom has a lot of built-in functions, it's quick and easy to get 
something
up and running and there are lots of samples and support for it. You can 
also
do inline assembler code anywhere you need it. It's inexpensive yet 
powerful.
You can get it for US$59 from Rhombus (www.rhombus-tek.com) in the US
or directly from the author (www.mselec.com) in Europe.

(No commercial interest, just my biased opinion :)

Hugh


markevans_1 wrote:
Show quoted textHide quoted text
>Ok, I hope this message isnt the start of a huge thread, but I would 
>like biased/unbiased opinions on what you guys recon is the best 
>compiler for the AVR microcontroller.
>
>Basically I want something that is cheap, ideally comes with a 
>fuctional IDE and is quick to code with ( has built in libraries, 
>language maps easily to AVR, and is as high level as possible) and 
>at the same time has the abilty to do low level stuff when speed is 
>required ie: inline assembly. It needs to compile fast and generate 
>small code and needs to support AVRs which have no RAM.
>
>Not too fussed about language as long as it meets all my above 
>criteria, but I suppose I have some preference to C.
>
>Hope you can help
>Mark.
>
>
>
> 
>Yahoo! Groups Links
>
>
>
> 
>
>
>  
>

Re: AVR Compiler: Bascom

2004-03-14 by VA3TO

Sorry...Bascom is $85 ($59 if you're a student or cross upgrading
from Bascom-8051).  Still a deal !

Hugh

RE: [AVR-Chat] AVR Compiler: which is the best

2004-03-14 by Larry Barello

I second BASCOM as easy and quick.  It is terrible for large or complex as
the code generation is mediocre at best.  But if you use mainly the library
support (e.g. keyboard input, LCD output, one wire interface, etc), those
are all written in assembly and are generally very tight.  So for simple
projects with little BASIC and mostly calls to library functions it actually
makes very small code.  You can try it out for free: a 2k limited version is
available for download at www.mcselec.com

I wrote a FSM multi-tasking robot control code with something like 7 tasks
and five sensors and two motors all in about 180 lines of code that fit in
the 2k limit.  So it is pretty usable for small projects.  Look here for the
sample code: http://www.barello.net/ARC

If you want cheap (free): GCC C compiler (www.winavr.net) but no tightly
integrated IDE.  But, probably the best code generation around.  You do have
to learn about makefiles and become familiar with how the compiler works to
get the best code.  So you pay for the free price with the learning curve.

Imagecraft and Codevision both have tight IDEs, but I can't vouch for their
quality over large projects.  I believe they are adequate.  Imagecraft is
more traditional with libraries & linkers and that probably supports large
projects better than CV which has only one file (but uses includes to
simulate libraries).  IAR has the expensive industrial strength compiler,
but at $1800/seat it is out of my pocket book.
Show quoted textHide quoted text
-----Original Message-----
From: VA3TO

I never took to C and I usually prefer assembler but when it comes to
the AVR,
I am partial to Bascom.  Todays Basic compilers are much more structured
& efficient and have come a long way since the days of GOTO 100.
"This is not your father's Basic" :)
Bascom has a lot of built-in functions, it's quick and easy to get
something
up and running and there are lots of samples and support for it. You can
also

Re: [AVR-Chat] AVR Compiler: which is the best

2004-03-14 by John Johnson

BASCOM is great for getting results in a hurry. One of my reservations 
with it is it's strange behavior when you mix a keyword into a variable 
name. Off the top of my head:

support = &h12

Might get misinterpreted because support contains the word port. Again, 
that's just an example off the top of my head. Another reservation is 
it's inability to handle complex arithmetic in an expression, for 
example:

day = whatser / 12 * questo + 2

Again, just an example off the top of my head. I think both problems 
stem from the fact that it is a code generator (for lack of a better 
term), rather than a compiler.

I generally use WinAVR. When in doubt about whether there is a problem 
with my C or my hardware, I sometimes use BASCOM to verify the hardware.

WinAVR supports devices without RAM using assembly code. Not sure about 
BASCOM.

There are a lot of good resources and opinions at the avrfreaks web 
site.

Regards,
   JJ
Show quoted textHide quoted text
On Sunday, Mar 14, 2004, at 12:24 US/Eastern, VA3TO wrote:

> I never took to C and I usually prefer assembler but when it comes to
> the AVR,
> I am partial to Bascom.  Todays Basic compilers are much more 
> structured
> & efficient and have come a long way since the days of GOTO 100.
> "This is not your father's Basic" :)
> Bascom has a lot of built-in functions, it's quick and easy to get
> something
> up and running and there are lots of samples and support for it. You 
> can
> also
> do inline assembler code anywhere you need it. It's inexpensive yet
> powerful.
> You can get it for US$59 from Rhombus (www.rhombus-tek.com) in the US
> or directly from the author (www.mselec.com) in Europe.
>
> (No commercial interest, just my biased opinion :)
>
> Hugh
>
>
> markevans_1 wrote:
>
>> Ok, I hope this message isnt the start of a huge thread, but I would
>> like biased/unbiased opinions on what you guys recon is the best
>> compiler for the AVR microcontroller.
>>
>> Basically I want something that is cheap, ideally comes with a
>> fuctional IDE and is quick to code with ( has built in libraries,
>> language maps easily to AVR, and is as high level as possible) and
>> at the same time has the abilty to do low level stuff when speed is
>> required ie: inline assembly. It needs to compile fast and generate
>> small code and needs to support AVRs which have no RAM.
>>
>> Not too fussed about language as long as it meets all my above
>> criteria, but I suppose I have some preference to C.
>>
>> Hope you can help
>> Mark.
>>
>>
>>
>>
>> Yahoo! Groups Links
>>
>>
>>
>>
>>
>>
>>
>>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>

RE: [AVR-Chat] AVR Compiler: which is the best

2004-03-14 by stevech

there are two free IDEs and one low cost IDE to work with WinAVR (GCC), so
you don't have to muck with makefiles.
Show quoted textHide quoted text
-----Original Message-----
From: Larry Barello [mailto:yahoo@barello.net]
Sent: Sunday, March 14, 2004 9:51 AM
To: AVR-Chat@yahoogroups.com
Subject: RE: [AVR-Chat] AVR Compiler: which is the best


I second BASCOM as easy and quick.  It is terrible for large or complex as
the code generation is mediocre at best.  But if you use mainly the library
support (e.g. keyboard input, LCD output, one wire interface, etc), those
are all written in assembly and are generally very tight.  So for simple
projects with little BASIC and mostly calls to library functions it actually
makes very small code.  You can try it out for free: a 2k limited version is
available for download at www.mcselec.com

I wrote a FSM multi-tasking robot control code with something like 7 tasks
and five sensors and two motors all in about 180 lines of code that fit in
the 2k limit.  So it is pretty usable for small projects.  Look here for the
sample code: http://www.barello.net/ARC

If you want cheap (free): GCC C compiler (www.winavr.net) but no tightly
integrated IDE.  But, probably the best code generation around.  You do have
to learn about makefiles and become familiar with how the compiler works to
get the best code.  So you pay for the free price with the learning curve.

Imagecraft and Codevision both have tight IDEs, but I can't vouch for their
quality over large projects.  I believe they are adequate.  Imagecraft is
more traditional with libraries & linkers and that probably supports large
projects better than CV which has only one file (but uses includes to
simulate libraries).  IAR has the expensive industrial strength compiler,
but at $1800/seat it is out of my pocket book.

-----Original Message-----
From: VA3TO

I never took to C and I usually prefer assembler but when it comes to
the AVR,
I am partial to Bascom.  Todays Basic compilers are much more structured
& efficient and have come a long way since the days of GOTO 100.
"This is not your father's Basic" :)
Bascom has a lot of built-in functions, it's quick and easy to get
something
up and running and there are lots of samples and support for it. You can
also




Yahoo! Groups Links

Re: [AVR-Chat] AVR Compiler: which is the best

2004-03-14 by Wagner Lipnharski

> BASCOM is great for getting results in a hurry.

[snip]

That's the thing. In a hurry you can also get a BigMac at the street corner,
but it is good for you?

One should pay very much attention if the word "hurry" is not substituting
"lazy" and "scary" in learning assembly.

I would like to ask around, how many times someone needed to write a code
"in a hurry".  Once I get the answer I would ask how long it can take to
learn assembly also "in a hurry".

In short and forever, pity those who run away from learning how to talk to a
machine in its own native language.

rjmp pc-1



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.600 / Virus Database: 381 - Release Date: 2/28/2004

RE: [AVR-Chat] AVR Compiler: which is the best

2004-03-15 by LightYearCS

Assembly is great but in this day and age I would suggest learning
C/C++.  Some C/C++ compilers are very efficient at optimizing code.  So
much so, that in some cases, the compiler can optimize code better than
even the most seasoned assembly programmer.

This is primarily true with DSP type processors which can execute
multiple instructions at once.

C/C++ pretty much seems to be the standard now.

Knowing assembly isn't necessary but it's a very good thing to know of
course.  These days, I only seem to use assembly to write software ports
for Real-Time Operating Systems.  The one I use mostly is uC/OS-II from
Micrium.

Barry
Show quoted textHide quoted text
-----Original Message-----
From: Wagner Lipnharski [mailto:wagner@ustr.net] 
Sent: Sunday, March 14, 2004 2:02 PM
Subject: Re: [AVR-Chat] AVR Compiler: which is the best

> BASCOM is great for getting results in a hurry.

[snip]

That's the thing. In a hurry you can also get a BigMac at the street
corner,
but it is good for you?

One should pay very much attention if the word "hurry" is not
substituting
"lazy" and "scary" in learning assembly.

I would like to ask around, how many times someone needed to write a
code
"in a hurry".  Once I get the answer I would ask how long it can take to
learn assembly also "in a hurry".

In short and forever, pity those who run away from learning how to talk
to a
machine in its own native language.

rjmp pc-1

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.600 / Virus Database: 381 - Release Date: 2/28/2004

 
Yahoo! Groups Links

RE: [AVR-Chat] AVR Compiler: which is the best

2004-03-15 by David VanHorn

At 08:37 AM 3/15/2004 -0800, LightYearCS wrote:

>Assembly is great but in this day and age I would suggest learning
>C/C++.  Some C/C++ compilers are very efficient at optimizing code.  So
>much so, that in some cases, the compiler can optimize code better than
>even the most seasoned assembly programmer.

We should have a challenge, like Kasparov and Deep thought..
I don't think the machine's going to win anytime soon though.

Re: [AVR-Chat] AVR Compiler: which is the best

2004-03-15 by Wagner Lipnharski

LightYearCS wrote:
> Assembly is great but in this day and age I would suggest learning
> C/C++.  Some C/C++ compilers are very efficient at optimizing code.
> So much so, that in some cases, the compiler can optimize code better
> than even the most seasoned assembly programmer.
>
> This is primarily true with DSP type processors which can execute
> multiple instructions at once.
>
> C/C++ pretty much seems to be the standard now.
>
> Knowing assembly isn't necessary but it's a very good thing to know of
> course.  These days, I only seem to use assembly to write software
> ports for Real-Time Operating Systems.  The one I use mostly is
> uC/OS-II from Micrium.
>
> Barry


Perhaps and most certainly we live in different kind of industry. In
industrial application, such as controllers, calibrators, indicators, etc,
it is very difficult to accept the unknown risk based on C software
development.  Assembly has always a great appeal decision for such type of
devices.

Based on several research made around AVR, including Atmel statements, C can
only start to make sense, even with optimization code, when the code is
higher than 6k instructions or more.  Optimization process needs a bunch of
ready routines to be able to reuse them.  It is nearly impossible for a 2k
instructions C code being better (smaller and faster) than one written in
assembly.

In our company we use several assembly math functions that were polished
along the years, impossible to the same with C, that literally triples the
size and speed goes compromised.

Most end user small uC for small appliances and devices simply can not be
programmed in C, memory and speed cost money and when multiplied by millions
of devices it makes a huge cost difference.

Of course that there are programmers and programmers.  I personally know
some that can do a bunch of gross programming even in basic. Those will
never program well in C, much less in assembly, it really requires a great
use of gray matter.  Thanks God it works this way, so we can explain why our
programmers make 20k/year more than a non-assembly programmer, and better
than that, make the money to pay them. :)

When hiring programmers or developers at our company, one of the first
questions at the questionnaire is;

How many lines of assembly programming during the last 5 years (in
thousands): ___






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.600 / Virus Database: 381 - Release Date: 2/28/2004

Re: [AVR-Chat] AVR Compiler: which is the best

2004-03-15 by Mike Bronosky

It depends on your situation.

If one of your major criteria is spending less time learning the language,
less time writing the progam code, and your programs won't be too big, then
BASCOM is probably your best choice.

If you want to get a little more into it, C, using CodeVision or GCC
versions are more likely your better choice. With the CodeWizard in
CodeVisionAVR you can set the base of your code by menu selections.

For the really heavy stuff assembly language may be needed.

Personally, as a last resort,  I use assembly. CodeVision is what I use
because its hand-holding makes it much easier for me to write programs in.
I'm looking a BASCOM as a language to turn out projects faster and with less
programming know-how.

What is BEST for you depends on your situation. Just because a professional
programmer swears up an down by a certain language does not make it the
right one for you.

Back in my younger days I use to change my own oil. Several reasons, one - I
knew how to do it, two - save money. Now days I just take the car to a XX
minute oil change and pay $25 to have it done. One - I have more disposable
income then in my younger years, Two - Time, I would rather be working at my
profession, electronics tech, than mechanic work. Oh, I don't mind working
on cars but if I had a choice... This save me time, time that I can spend
golfing, fishing, playing with my grandchildren, time I can spend setting
under a shade tree in the backyard drinking a homebrew, a homebrew I make
with the time I saved having the oil changed by someone else.
So you see my criteria for changing my oil has changed over the years.

So use your judgement concerning your own situation,
Mike

---
[This E-mail scanned for viruses by Declude Virus]

RE: [AVR-Chat] AVR Compiler: which is the best

2004-03-16 by stevech

my opinion, and nothing more...

These non-standard BASIC dialects like BASCOM and FASTAVR and the like are
- fine for hobby activities, so long as the compiler's author remains
comitted;
- a really imprudent idea for students - what company wants to see a resume'
for an "engineer" who cose a  one-of-a-kind compiler for professional
endeavors where life-cycle-costs dominate?

Re: AVR Compiler: which is the best

2004-03-16 by upand_at_them

> Now days I just take the car to a XX
> minute oil change and pay $25 to have it done. One - I have more
> disposable income then in my younger years, Two - Time, I would
> rather be working at my profession, electronics tech, than mechanic 
> work. Oh, I don't mind working on cars but if I had a choice...
> This save me time, time that I can spend golfing, fishing, playing 
> with my grandchildren

Sure, the argument makes sense.

But do you really save time doing it this way?  I sure don't.  The 
amount of time I would spend taking my car somewhere, waiting for it 
to be worked on, and then driving it home is at least twice the 
amount it takes for me to do it myself.

Mike

Re: [AVR-Chat] AVR Compiler: which is the best

2004-03-16 by Wagner Lipnharski

Mike Bronosky wrote:
> It depends on your situation.

[snip]

> Back in my younger days I use to change my own oil. Several reasons,
> one - I knew how to do it, two - save money. Now days I just take the
> car to a XX minute oil change and pay $25 to have it done. One - I
> have more disposable income then in my younger years, Two - Time, I
> would rather be working at my profession, electronics tech, than
> mechanic work. Oh, I don't mind working on cars but if I had a
> choice... This save me time, time that I can spend golfing, fishing,
> playing with my grandchildren, time I can spend setting under a shade
> tree in the backyard drinking a homebrew, a homebrew I make with the
> time I saved having the oil changed by someone else.
> So you see my criteria for changing my oil has changed over the years.
>
> So use your judgement concerning your own situation,
> Mike

You are 100% right Mike, the great point here is that IF YOU NEED, you WILL
change the car's oil by yourself, by the same way if you need, you will
write assembly code.

That is an important point to call the attention to.  I personally know few
programmers that can die trying to convince everybody that C is better than
Assembly, without knowing even how to start an assembly coding.  You should
be wise enough to choose what is better, but to start with, you need TO KNOW
about the options, and not only have ideas about it.

If not, you can ending up in this situation:
Airline flight attendant to passenger:
   "Sir, dinner will be served, what do you choose?"
Passenger:
   "What are the options?"
Steward:
   "Yes or No".

:)




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.600 / Virus Database: 381 - Release Date: 2/28/2004

RE: [AVR-Chat] Re: AVR Compiler: which is the best

2004-03-23 by LightYearCS

I work on my notebook computer, writing programs while I wait for my oil
to be changed...   Seems to save a LOT of time :)
Show quoted textHide quoted text
-----Original Message-----
From: upand_at_them [mailto:upand_at_them@yahoo.com] 
Sent: Tuesday, March 16, 2004 12:51 PM
Subject: [AVR-Chat] Re: AVR Compiler: which is the best

> Now days I just take the car to a XX
> minute oil change and pay $25 to have it done. One - I have more
> disposable income then in my younger years, Two - Time, I would
> rather be working at my profession, electronics tech, than mechanic 
> work. Oh, I don't mind working on cars but if I had a choice...
> This save me time, time that I can spend golfing, fishing, playing 
> with my grandchildren

Sure, the argument makes sense.

But do you really save time doing it this way?  I sure don't.  The 
amount of time I would spend taking my car somewhere, waiting for it 
to be worked on, and then driving it home is at least twice the 
amount it takes for me to do it myself.

Mike

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.