C Development is generally done for deeply embedded systems with C++ being used in larger systems. The reasons for this are:
- ● The language representation maps very well onto peripheral hardware control registers.
- ● Interrupt handlers are well represented using pointers to functions.
- ● Bit manupulations required for control registers are fast and clearly defined.
- ● Weak typing so that it is easy to use one type as another to deal with hardware issues.
- ● Run time polymorphism via function pointers.
- ● ANSI standardization and portability - move it to a processor of your choice.
- ● Conditional compilation - an excellent feature for debugging as well as developing product variants.
- ● Low level memory access - arrays accessed as pointers plus offset for example.
- ● A small set of keywords and relative simplicity.
- ● A large number of compound operators for compact code.
- ● Elimination of checking for faster performance.
- ● Implementation of string manipulation, math functions and I/O as library calls allowing the addition of these.
- ● Complex structure support. for C development.
Through years of experience, it is clear that C is the correct mix for implementation of deeply embedded systems. Add on libraries for embedded operating systems are the norm as are the use of cross development tools to deal with it.
The limitations are mainly related to the lack of language support for abstract data types or object orientation. Originally C++ was intended to overcome this as was Objective C. The additional complexity of C++ made it unsuitable for many embedded jobs while Objective C fell by the wayside due to the early popularity of C++ until it was revived by Apple.
C Development is here to stay for MCUs, MPUs, DSCs, FPGAs and DSPs.
You don`t have permission to comment here!