Re: Microcontroller Project
- From: "David L. Jones" <altzone@xxxxxxxxx>
- Date: 27 Mar 2006 00:10:41 -0800
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.
Is assembler any different? (especially for a beginner?)
All things considered a high level language will get a beginner up and
running much quicker than assembler. Take a look at the popularity of
the PIC-AXE, there is a good reason why it's popular.
I decided to try and implement the Hangman game itself. I have a rough
idea as to what I must do, though I am confused as to how to go about
it. Could you tell some good resources for 8051 programming in C on the
net?
If you are programming in C then your actual program will have little to
do with the 8051.
Again, I disagree. Normally one would assume this, but the 8051 is a
"special" (as in; designed by a "short-bus" architect) case.
So what are you saying? That C compilers for the 8051 are no good?
I find this very hard to believe.
Many people have said that C on a low end PIC (another so-called
"crippled" architechture) is useless, but excellent ANSI C compilers
are available for them, and the low end ones too.
You could write the C program on a PC first, and then port to your 8051.
Instead of writing to the screen you would turn on a LED on a port of
the 8051, so only a small part of your program should change between a
PC version and an 8051 version.
...and watch the stack explode. Good idea!
Once again, what are you saying exactly? Are you saying that no C
compiler for the 8051 can anticipate a stack overflow and give you a
warning?
The advantage of using a high level language like C is that you
shouldn't have to care what micro platform it is used on.
A naieve statement. "shouldn't?" There's a comforting statement. Very
few people can write truely platform independant C. ...I'm certainly not
one, and my bet is that given your statements here that you aren't either.
Ok, I should have said "shouldn't have to care too much" especially for
the OP's case of a simple hangman game.
No C program is ever truely platform independant, but you can go a long
way to making it so. In many cases only minimal changes are required to
the code that accesses the hardware, and depending on the program and
application that can be a tiny percentage of the whole code indeed.
You'd loose your bet BTW :->
It ain't that hard if you try, really.
If you need help with the C code then the 8051 is the least of your
problems.
Granted, but workign C isn't likely to help him either.
Maybe not, he'd probably have oodles of problems with the programmer
settings alone :->
On the other hand, if your subject is the 8051 micro and it's
architecture then you won't learn much by doing your program in C. I am
surprised your teacher is not forcing you to use assembler language.
It's not clear what the issue is here. Perhaps it's to show them what
they *don't* know? ;-)
A smart lecturer indeed then!
Dave :)
.
- Follow-Ups:
- Re: Microcontroller Project
- From: Keith
- 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
- Microcontroller Project
- Prev by Date: Re: for op-amp wizards: subtractor circuit
- Next by Date: Re: PIC or Freescale HC08 ??
- Previous by thread: Re: Microcontroller Project
- Next by thread: Re: Microcontroller Project
- Index(es):
Relevant Pages
|