Using C to program the 8051 family

0Xfffe 3.1415926 0xAAAA >> 1

to name a few.

Bob

Reply to
Bob Stephens
Loading thread data ...

snipped-for-privacy@aol.com (CBarn24050) wrote in news: snipped-for-privacy@mb-m06.aol.com:

There's your problem. Keil or Amrai in the last 5 years are wonderful to use. I use assy. only when instruction level determinancy is required (rare).

--
- Mark ->
--
Reply to
Mark A. Odell

And, since all of the decent compilers support inline assembly ...

Reply to
Bob Stephens

Bob Stephens wrote in news:1ofrjos732ylo.5rzirx3t1bof$. snipped-for-privacy@40tude.net:

Well actually, Keil C51 is a bit unfriendly in this regard do to the fact that it is difficult to keep the optimizer in the loop when you go off on your own (into assy).

--
- Mark ->
--
Reply to
Mark A. Odell

Uh Oh. I wish you hadn't told me that. I just bought the Keil tool suite. Can you elaborate a bit on the problem?

Thanks,

Bob

Reply to
Bob Stephens

back

I haven't used the 2500AD C compiler for the 8051, but if it's anything like their 68hc11 C compiler, it's not worth using. The difference in generated code going from the 2500AD 68hc11 compiler to the Introl one was surprising.

Try the Keil compiler, I don't see how you wouldn't like it. I used it in a product where an 8051 core was in an ASIC, and I wrote an interpeter in C for it which controlled the OSD. Commands were received from an external MCU. Here's a bit of info on it:

formatting link

Mark

Reply to
Mark

Bob Stephens wrote in news:1cjbq8jnevj8v.bviqkjmwrlqo$. snipped-for-privacy@40tude.net:

See this:

formatting link

--
- Mark ->
--
Reply to
Mark A. Odell

so thats a no then is it?

Reply to
CBarn24050

Well Mark when I got it it was supposed to be state of the art I imagine in another 5 years you'll be saying the same thing about the current Kiel package. For the sort of things I do I can't see me going back to the 8051.

Reply to
CBarn24050

:) ROTFL

Reply to
Bryan Hackney

No, it is a resounding yes. He actually supplied the numbers (and quite good numbers too). What I did here was supply some of the missing quotations and attributions which CBarn24050 totally omitted from all his messages. Obviously he expects all readers to be clairvoyant and/or willing/able to look up previous messages in the thread to save him the trouble of quoting properly.

--
Chuck F (cbfalconer@yahoo.com) (cbfalconer@worldnet.att.net)
   Available for consulting/temporary embedded and systems.
     USE worldnet address!
Reply to
CBFalconer

It's a joke, I say it's a _joke_ son. Pay attention when I'm talking to you, boy!

[That boy's about as sharp as a bag of wet mice.]

(No, he probably won't catch that one either -- I keep pitching 'em and he keeps missing 'em.)

--
Grant Edwards                   grante             Yow!  I want the presidency
                                  at               so bad I can already taste
                               visi.com            the hors d'oeuvres.
Reply to
Grant Edwards

What sort of things would those be then?

Ian

Reply to
Ian Bell

Hi Ian, at the moment I am doing a controller for single phase induction motors. The unit controls the startup and optimises the power factor to save energy under light load.

Reply to
CBarn24050

What microcontroller are you using and why would you not consider an 8051 for this job?

Ian

Reply to
Ian Bell

I couldn't disagree more. C may be fine for larger platforms but it's not just a pain in the Bush for an 8051 but can actually be dangerous if you forget to turn the optimizer off.

Additionally C is a compiled language which leaves the programmer open to a number of dangers. You must either trust the compiler or learn to use a disassembler, have the deductive powers of Mycroft Holms or use an ICE, and beat yourself with a rubber hose instead of using an interpreted language to debug by.

-- Regards, Albert

---------------------------------------------------------------------- AM Research, Inc. The Embedded Systems Experts

formatting link
916.780.7623

----------------------------------------------------------------------

Reply to
Albert Lee Mitchell

Please don't turn this newsgroup into another flaming IRC session. Implying negative attributes to someone you disagree with is poor debating practice and precludes a respectful response.

While I think CBarn24050 may have been too terse I agree with his fundamental position, C is inappropriate for 8-bit micros in general. Be aware that C and assembler are not the only two choices. In some applications Basic is even appropriate while we use Forth for it's inherent debuggability. If that's a word.

-- Regards, Albert

---------------------------------------------------------------------- AM Research, Inc. The Embedded Systems Experts

formatting link
916.780.7623

----------------------------------------------------------------------

Reply to
Albert Lee Mitchell

best

C

While I am not a embedded guy by far, but I have done my share of 8051 projects.

Could you elaborate on why you don't think C is appropriate for this family?

I have used Assembler, but that was happily only a short time before I came to know the Keil compiler. I would anytime pay a price in a little faster microcontroller with more memory in order to get the project done instead of using my time on Assembler programming

Mind you my projects have predominately included control systems that needed textoutput (nice and easy with sprintf) and floating point calculus...

Cheers

Klaus

Cheers

Klaus

Reply to
Klaus Vestergaard Kragelund

None of these comments is 8051 or 8bit micro specific.

Ian

Reply to
Ian Bell

Hi Klaus, you could pay less money on say Hitachi H8 or Fujutsu 16lx processors, still write in C and have your program run an order of magnitude quicker, maybe several orders quicker if you want to do fp calculus.

Reply to
CBarn24050

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.