This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

C

I was hoping to find on-line manuals that I could print and read on the john. So far no luck. But what I really need is how to declare variables in C.

For example, I have a sample code that has the statement:

unsigned char

and

unsigned long

What do these mean and do they limit the declaration to integers. What do i declare if I want a floating point?

Also, someone told me I cant do floating point with a Keil Compiler because of licensing issues (I got my copy from Silicon Labs and have just registered it). I will eventually need to do trig functions. What do i have to get (buy) to complete my project?

Parents
  • Reinventing an already nicely developed wheel if not absolutely necessary would, frankly, be plain stupid.

    A lookup table & interpolation-type approach to approximating trigonometric functions is fundamentally different from the iterative approximation used by the library functions, and therefore does not qualify as reinventing the wheel when used instead of the latter.

    But since you undoubtedly know that, my explanations must have lacked clarity to make you feel the need to comment on them.

Reply
  • Reinventing an already nicely developed wheel if not absolutely necessary would, frankly, be plain stupid.

    A lookup table & interpolation-type approach to approximating trigonometric functions is fundamentally different from the iterative approximation used by the library functions, and therefore does not qualify as reinventing the wheel when used instead of the latter.

    But since you undoubtedly know that, my explanations must have lacked clarity to make you feel the need to comment on them.

Children
  • A lookup table & interpolation-type approach to approximating trigonometric functions is fundamentally different from the iterative approximation used by the library functions, and therefore does not qualify as reinventing the wheel when used instead of the latter.

    'Reinventing the wheel' was a poor choice. Consider me suitably chastised.

  • Whew! No matter where I go on the web there's always contention.

    I've been doing micro-controllers for 30+ years in assembly language. Sure, my experience is probably limited compared to you guys but give me a break. I admitted ignorance about C and ask for guidance and I create an argument?

    I'd like to think I have the brains to figure out advantages vs disadvantages. Seems to me C was invented to get the job done fast and not efficient. My plans are, if needed, to optimize the code after the feasibility study.

    Geezzzzz.

    But thanks for the clarification concerning the reference material. Furthermore, from what I can tell, there must be better solutions than that offered by Keil, anyhow. I just bought the development package thru Silicon Labs and Keil doesn't want to support it and I am having difficulty ascertaining what I must spend to lift it's 4K limits. What crap.

  • Hey,

    Are you the Lou Rosinski of the fiber optical encoder fame?

    If you are, then I want to say "You Rock!"

  • You were just an unlucky visitor - they like to sharpen their knives on each other :)

  • Yes, I do Fiber Optics. What do you do?

  • "Yes, I do Fiber Optics. What do you do?"

    I'm just a menial who's done 8051 programming for the past umpteen-plus years.

    I don't like to give too much away about myself here because I'd almost certainly be classed as a code monkey :(

    I remember seeing one of your articles a while back. Nothing to do with my field, but it was easy to read and interesting.

  • I've been doing micro-controllers for 30+ years in assembly language. Sure, my experience is probably limited compared to you guys but give me a break. I admitted ignorance about C and ask for guidance and I create an argument?

    That wasn't really an argument, more a lively discussion. The advice you got (get a copy of K&R and H&S) was spot on - it won't take long to get familiar with the basics of 'C' with K&R, H&S will answer any remaining questions you have.

    I'd like to think I have the brains to figure out advantages vs disadvantages. Seems to me C was invented to get the job done fast and not efficient. My plans are, if needed, to optimize the code after the feasibility study.

    I'd have said "C was invented to get the job done faster than assembly language and as efficiently as possible for a high level language".

    Furthermore, from what I can tell, there must be better solutions than that offered by Keil, anyhow.

    I'm not going to offer an opinion, but my impression from what I read is that Keil is probably the tool of choice if you wish to program the 8051 using 'C'.

    I just bought the development package thru Silicon Labs and Keil doesn't want to support it and I am having difficulty ascertaining what I must spend to lift it's 4K limits.

    From the sound of things you really bought a development board from Silicon Labs and it came with the trial version of the toolchain, or possibly a slightly enhanced trial version. You can't really expect to get a few thousand dollars worth of software for a hundred bucks.

  • Sharpening knives...

    I'd like to think of it as Keil's loss. I'm going somewhere else if there is an option. I am sure there is an option. Like assembly language, lookup tables, and not Keil. Who needs to be part of the C community after this?

    Anybody know of other development systems IO can consider to use with the Silicon Labs EVAL Kit? I've heard of http://www.avocetsystems.com.

  • Seems to me C was invented to get the job done fast and not efficient.

    C was designed to be as close to the silicon as you can get without using assembly, actually. Hence, programs in C _can_ be very efficient.

    I just bought the development package thru Silicon Labs and Keil doesn't want to support it and I am having difficulty ascertaining what I must spend to lift it's 4K limits.

    Did you contact your local distributor of Keil products? He should be more than happy to provide you with a quote.

  • Well, how 'bout that. A fan.

    Thanks for your comments. I'll have to put those in my scrapbook.

    I'm at Renco Encoders now doing other strange stuff. Working on a real neat encoder solution. So simple I am surprised no one has thought of it. Well, maybe they have, I just cant uncover it.

    Maybe I'll have one last hurrah before exiting ;)

  • Furthermore, from what I can tell, there must be better solutions than that offered by Keil, anyhow.

    In another forum there was a "which '51 compiler is bast" thread and several SDCC users stated "Keil is best" an IAR user stated "I think Keil is better". NONE stated that another product was better than Keil '51.

    Erik

  • I'd like to think of it as Keil's loss. I'm going somewhere else if there is an option.

    Hmmm. For someone with 30 years of experience in the field you seem to have an awfully light trigger. Running away like a startled deer, just because you witnessed a bit of banter among other users of the tool, and even "liking" that? Get real, mon.

  • I've been doing micro-controllers for 30+ years in assembly language. Sure, my experience is probably limited compared to you guys but give me a break.

    On what basis should we have done that? Read your own OP again, slowly. What in there would make you guess that the author is anything other than a complete newbie on his first microcontroller project ever?

    Seems to me C was invented to get the job done fast and not efficient.

    Calling that conclusion premature would be doing it an unjustified favour.

  • I am having difficulty ascertaining what I must spend to lift it's 4K limits. What crap.

    crap? crap? I believe this is a feature of most commercial tool chains. what did you expect exactly? the source code along with the eval. binaries?
    and another thing: I also have expressed criticism here in the past regarding the tool chain and some of its extentions (FlashFS...) but you would not see me here calling it names like "crap". you give us a break - now often have you used the product to make sure a statement?