Hi, there are differences between C and embedded C, some of them are:
C is for desktop computers, embedded C usually is for microcontroller based applications.
C use the resources of desktop computers (memory, OS, etc)
Embbeded C use only limited resources available in chip (limited RAM, ROM, ports, etc).
Embbed C could be a subset of C.
You can see the book from Tom Schults, Embedded C.
I think u are aware about C very much, embedded C is also same with some diffrent environment. Here u have to take care about memory. In embedded environment memory is available very less than desktop computers, where u can't bother about memory. In your program u have to see that in an instant of time your program is not using more than available memory of the microcontroller. If it is trying to use then the program 'll crash.
An embedded system is an application that contains at least one programmable
computer (typically in the form of a microcontroller, a microprocessor or digital
signal processor chip) and which is used by individuals who are, in the main,
unaware that the system is computer-based.
Beside this, also timing constraint also a mesure though optinal but mostly wanted in embedded C. You have to check the code in real time environment with the help of emulators and debuggers.
in usual C what we develop would have headers like stdio.h, using which the system yeilds a output file feasible to that particular OS(windows, linux etc)
now when it comes to embedded C, everythings same except, u'll get a output file which could directly loaded in to the controller and requirement for a supporting platform (OS, which abstracts the hardware and provides a virtual environment) is eliminated.
next comes embedded OS which is simple enough, if u've understood the above points
Something important that the other posters haven't mentioned is that embedded C can be non-ANSI for some micros (e.g., PICs). This is because the instruction set of the micro is designed more for ASM programming, and not all C functions are supported. So if you're programming C on a micro and it won't work right, take this into consideration. And if you're a hobbyist, like me, then use the AVR--it's designed to be programmed in C.
ANSI C try to handle IO as streams and handles to keep it generic as possible. THis works alright in a command line based computer system. But it falls apart when using a GUI interface or using a microcontroller with very speciic features.
what makes embedded c so differnt from the regular c is
*abscence of console
*restriction on code size
*and the compiler
regular compilers create os dependent executable file where as embedded c
compilers create a file which are downloaded to controllers to realize
the required task
regular compilers don't give abstraction for all the resources of the system
where as in embedded c compiler give access to all the resources directly so
code efficient
code written in embedded c are though not cross compatible but they are
series compatible
exactly the environment on which they are used differentiate them...
after analyzing critically we can say embedded c is subset(primitive set) of regular c
There's not a difference, the language is still C (probably ANSI C). What makes it Embedded is the features that you use and mindset when writing the application:
- Try to limit used resources (number of used variables and arrays, optimized code...)
- Excellent knowledge how to configure build tools to use every bit of HW power and memory.
- Good knowledge how to estimate needed resources.