Re: Moving from 8051 to AVR
- From: Ian Bell <ruffrecords@xxxxxxxxx>
- Date: Wed, 08 Feb 2006 15:55:37 +0000
David Brown wrote:
Ian Bell wrote:
Here we go again, the tail wagging the dog. A micro 'designed' to use C
is not a recommendation its a good reason not to use it.
Ian
Why do you say that? If you want to complain that C is a badly designed
language, that's fair enough - you'll get plenty of agreement there.
I don't know if C is badly designed - that's not my point. A microcontroller
'designed for C' wrongly encourages people to think that C will produce the
most efficient/effective code on that device which is plainly not true.
But generally speaking, being "designed for C" means the cpu must have
support for accessing data on a stack through some sort of index, and it
should have fast access to data through a pointer or two.
I disagree on two counts. First I do not think that that is all 'designed
for C means, is meant to mean by those saying so and is assumed to mean by
those reading the phrase. At a minimum it is a recipe for a whole host of
erroneous assumptions. Secondly, the 8051 has the characteristics you
mention but noone would say it was 'designed for C'
Where is the
disadvantage in that?
There is no disadvantage in being able to access data on a stack through a
pointer or two. Why not say just that?
Some high level languages could benefit from
other features (Forth would benefit from direct stack operations, Pascal
would benefit from a frame pointer, etc.). Some types of code cannot be
conveniently expressed in C (bit variables, rotation, dsp-type
operations), but being designed for C doesn't mean non-C operations not
supported.
Precisely, and because C does not support those operations, suggesting that
a microcontroller is 'designed for C' is not a plus because it could mean
that the micro does not even support those operations at an assembler
level. In my book that makes it a waste of time as a microcontroller.
And from experience writing assembly code on "C-friendly"
and "non-C-friendly" architectures, I have no doubt that being
C-friendly is a big plus.
Depends on the processor and the application. Here we are specifically
considering 8 microcontrollers where the emphasis is on control. IME non C
friendly microcontrollers make better controllers and are best programmed
in assembler.
The AVR is not actually very C-friendly - it is merely somewhat
IAR-C-friendly (although far better than the 8051). The msp430 is
probably the best example of a C-friendly cpu.
As I said, to me C friendly is not an asset.
Ian
.
- Follow-Ups:
- Re: Moving from 8051 to AVR
- From: diggerdo
- Re: Moving from 8051 to AVR
- From: David Brown
- Re: Moving from 8051 to AVR
- From: Grant Edwards
- Re: Moving from 8051 to AVR
- References:
- Moving from 8051 to AVR
- From: ziggy
- Re: Moving from 8051 to AVR
- From: Jim Granville
- Re: Moving from 8051 to AVR
- From: Ulf Samuelsson
- Re: Moving from 8051 to AVR
- From: diggerdo
- Re: Moving from 8051 to AVR
- From: Isaac Bosompem
- Re: Moving from 8051 to AVR
- From: diggerdo
- Re: Moving from 8051 to AVR
- From: Ian Bell
- Re: Moving from 8051 to AVR
- From: David Brown
- Moving from 8051 to AVR
- Prev by Date: Re: creating an embedded server
- Next by Date: Input device for signature capture?
- Previous by thread: Re: Moving from 8051 to AVR
- Next by thread: Re: Moving from 8051 to AVR
- Index(es):
Relevant Pages
|