Re: Microcontroller Project
- From: "David L. Jones" <altzone@xxxxxxxxx>
- Date: 27 Mar 2006 20:39:55 -0800
Keith wrote:
On Mon, 27 Mar 2006 14:33:03 -0800, David L. Jones wrote:
Keith wrote:
In article <1143494228.117311.162780@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
altzone@xxxxxxxxx says...
Keith wrote:
In article <1143447041.276029.172680@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
altzone@xxxxxxxxx says...
Keith wrote:
On Sun, 26 Mar 2006 17:28:03 -0800, David L. Jones wrote:
akshaychander@xxxxxxxxx wrote:
Sorry for the late reply.
Yes, I have to do the project in 8051. I have studied the theory of
8051, but have very little practical experience.
As far as languages are concerned, there is no restriction. I am
planning on using C.
In that case a good C compiler will take care of most of the low level
8051 stuff for you.
I disagree! A C compiler will just mask the nonsense underneath. It
*will* come back to bite you (think "stack").
Ok, I'm not an 8051 guy, so I'll take your word there is a potential
issue here.
I looked into various compilers when I did a major (~25kloc) 8051
project a decade ago. The only one that didn't mask the
limitations (and even advantages) of of the 8051 was PL/M51.
I'd then suggst you take a look at some more modern compilers perhaps.
Countless people use C on the 8051, I'm sure it's not that bad.
The point is that one is *necessarily* doing bit-banging on the
hardware (the whole point of a uC). C doesn't give much advantage
and a _lot_ of headaches.
*snip*
I see no advantage in using C. Portability isn't an issue since
hardware is the name of the game with uCs. Any abstraction will
lead to resource conflicts. No, actually, I haven't been bitten by
stack issues because I've used assembler. I don't let the compiler
assign *anything*; not even what byte the bits go in.
*snip*
I disagree. C has no advantage over a half-decent macro assembler
and a MAKE utility. Abstraction has a *lot* of disadvantages when
you're severely hardware constrained. Sure, people use C on 8051s,
but I suspect for many C is the only tool in their shed.
Why do you snip anything you've said? Are you trying to be cute, or win
an argument without posting your thoughts?
The argument was (and is) going nowhere.
Ok, it looks like this one could never end. You are pro-assmebler, I'm
pro-C.
For microcontrollers, you bet! C is a waste of resuorces, kinda like
WinBlows.
Your choice, and that's fine. I'd rather halve my development time than
save a few bytes of RAM.
A heck of a lot of poeple will use C on micros because it provides many
advantages.
I used to do all my work in assembler unless I started using C and then
never looked back. I still do some inline assembler where it's called
for, but that's it.
It *is* called for with these tinker-toys. If you're embedding a real
processor, I might have a different opinion.
Assembler is NOT required for a microcontroller.
Thousands of embedded engineers who use C almost exclusively will tell
you the same thing.
There are *massive* advanatges to using C (or another high level
language) on a micro - speed of development, platform portability (which
is a BIG requirement for some people), ease of peer review, ease of
maintenance, easier code-reuse, easier model migration, better code
visibility to name a few. This is why C compilers are immensely popular
these days.
Ok, you say there are "*massive* advantages", I don't buy it. I've told
you why I don't buy C for an 8051 for anyone other than a one-trick-pony.
Pony up!
If you cannot see how C can potentially offer the improvements I have
listed (plus many others), then you are either not familiar enough with
it to comment, or you simply don't know much about real practical
embedded programming meeting tight deadlines and providing maintainable
and peer reviewable code, or you are simply one of those
stuck-in-your-ways assembler guys. I suspect the later, it's a
relatively common affliction.
LOTS of embedded engineers use C on 8 bit micros and there ARE very
good reasons for it as I've listed. That might not be the case for you
and your situtation, and that's understandable. Just don't try and push
that one-sided view on others who are able to gain these big
advantages.
Yes, there are advantages to assembler as well (and disadvantages to C),You've not offered one, other than some assinine statement
that's why I like many others use the best of both worlds. Making a
blanket statement like there are *no* advantages to using C is just
plain rubbish.
about "portability". Please! Even you don't believe this.
I've listed many advantages. I didn't just make these up, they are well
known advantages of using a high level language on embdedd micros.
I don't know about you, but every project I've ever worked on is maybe
5% low level I/O and register stuff (which assembler does well, but so
does C too), and 95% procesing and control (floating point, long int
math, string control etc) stuff which assembler sucks at and C does
well. Pretty obvious why I choose to use C.
Dave :)
.
- Follow-Ups:
- Re: Microcontroller Project
- From: Spehro Pefhany
- Re: Microcontroller Project
- References:
- Microcontroller Project
- From: akshaychander
- Re: Microcontroller Project
- From: David L. Jones
- Re: Microcontroller Project
- From: akshaychander
- Re: Microcontroller Project
- From: David L. Jones
- Re: Microcontroller Project
- From: akshaychander
- Re: Microcontroller Project
- From: David L. Jones
- Re: Microcontroller Project
- From: Keith
- Re: Microcontroller Project
- From: David L. Jones
- Re: Microcontroller Project
- From: Keith
- Re: Microcontroller Project
- From: David L. Jones
- Re: Microcontroller Project
- From: Keith
- Re: Microcontroller Project
- From: David L. Jones
- Re: Microcontroller Project
- From: Keith
- Microcontroller Project
- Prev by Date: Re: Microcontroller Project
- Next by Date: Re: Circuit for converter AC 50Hz to 60Hz
- Previous by thread: Re: Microcontroller Project
- Next by thread: Re: Microcontroller Project
- Index(es):
Relevant Pages
|