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

Using c++ with ceibo

does anyone have an experience with c++ using ceibo?
are there any known bugs/optimization problems?

Parents
  • my company wants to try using C++ on 8051 because most of our programmers are familiar with C++ and not with C.
    We don't have a lot of experience in embedded systems and we're not sure if it's a good or bad idea using C++.
    BTW, the code (small) size is very important to us.

Reply
  • my company wants to try using C++ on 8051 because most of our programmers are familiar with C++ and not with C.
    We don't have a lot of experience in embedded systems and we're not sure if it's a good or bad idea using C++.
    BTW, the code (small) size is very important to us.

Children
  • If those guys know C++, but not C, odds are high the kind of C++ code they're writing would be a bad mismatch for the 8051 architecture, and in particular will be the exact opposite of size-efficient.

    If you really want to write C++ code (as opposed to C with some C++ extras), 8051s are not the kind of CPU to do it on. The 8051 already has to cut a few corners to support C. For true C++, it's essentially hopeless.

    Summing it up: you need either new programmers or a different CPU class.

  • I just googled the Ceibo web site. They have a free download eval copy of the EC++ for 8051. Just from the reading, it appears to be a pre-compiler front end to the Keil tools???
    Keil has a EC++ compiler for the C166/St family of 16 bit chips. They also have a down load eval for the PK166.
    Maybe, this is something to consider. The XC16x chip have a lot of power in small low cost devices that will better support C++ than the C51 family.
    Bradford

  • my company wants to try using C++ on 8051 because most of our programmers are familiar with C++ and not with C.
    We don't have a lot of experience in embedded systems and we're not sure if it's a good or bad idea using C++.
    BTW, the code (small) size is very important to us.


    as Hans-Bernhard said
    "If those guys know C++, but not C, odds are high the kind of C++ code they're writing would be a bad mismatch for the 8051 architecture, and in particular will be the exact opposite of size-efficient."

    You have all things against you
    * familiar with C++ and not with C
    * don't have a lot of experience in embedded systems

    If you do no "retrain" your "programmers" I will give you 10% chance of success.

    Succesful programming the '51 as opposed to e.g. the PC is not just "using another processor" it is "using another philosophy".

    What do you get using PC types for a '51 job
    * bloat from using an OS.
    * slow code and bloat (e.g. using int and func ptr).
    * errors because of recursion.
    * constant bitching about data memory overrun.
    * finally having to call in a consultant to even make it work.

    So, if you do not retrain the PC type(s) that is/are to program this, get a consultant. The very fact that you even ask about C++ makes the need for retraining crystal clear.

    Erik

    PS The above does not state that "PC types" can not code the '51, it states that, in order to do so, they need to change their philosophy. Unfortunately only a small percentage of PC types seems capable of doing so.

  • thanks a lot for all of your responses.
    we do need to do some serious homework...

  • Memory allocation on the C51 is difficult at best. With constructor/destructors allocations, aren't you asking for more problems than gains from using C++?


    Construction/destruction of objects does not necessarily require any dynamic memory allocation. It's up to the programmer. Constructing might be initialization, or it might be allocation from a fixed table of entries with no heap involved. In any language, you have to make your your objects (records/structs/table entries/variables) are initialized before they're used.

    "C++" is a language, not a style or method of programming. It's perfectly possible to use C++ to write 8051 code, at least if you had a good 8051 C++ compiler. You might well want to avoid any number of implemention techniques or designs due to architectural limitations of the microcontroller. But then, that statement is true of programming in C, or even in assembler.

  • "I just googled the Ceibo web site. They have a free download eval copy of the EC++ for 8051. Just from the reading, it appears to be a pre-compiler front end to the Keil tools???"

    For reference, here's the links - make of them what you will:

    Ceibo News page:
    http://www.ceibo.com/eng/general/newsltr.shtml#cpl

    Ceibo C++ "compiler" datasheet:
    http://www.ceibo.com/eng/pdf/cpp.pdf

    Demo download:
    http://www.ceibo.com/ftp-site/update/8051cpp.zip

  • That may be the first data sheet that's actually less informative than the press release.

    The Ceibo product is actually only a EC++ compiler. EC++ is a subset of ANSI C++ with some significant limitations and feature removal.