CrazyEngineers
  • Embedded C and ANSI C

    Jeffrey Arulraj

    Jeffrey Arulraj

    @jeffrey-xA7lUP
    Updated: Oct 24, 2024
    Views: 1.2K
    Are these two similar in any nature?

    I heard they are not But they are having almost similar coding blocks

    I know that Embedded C is used predeterministically for Configuring your FPGAs and PLAsand ANSI for a hell lot of stuff that I am not aware at all

    So pls differentiate the two and also If possible do point out the similarities between them
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • Sindhu Chowdary

    MemberJul 2, 2013

    C and embedded C have more similarities than differences.Embedded C is nothing but simply we are using C in embedded systems.

    First difference is that the C can use all the memory while running on a desktop , but in case of embedded C it has to use the limited memory available in RAM , ROM on a processor.It means while writing a code or program in embedded C we have to keep in mind about the memory.Otherwise the program will crash.

    Secondly,C is most likely a platform dependent since its executable code cannot be run in other OS.But the program written in embedded C is directly stored into the processor and hence it is platform independent.

    All the other programming etc., is done using the same variables ,syntaxes we normally use in C.

    SO simply,I think, we can say embedded C as a part of C.

    P.S. Another difference is embedded C does not a console which is available in case of desktop.(I cant understand it myself , but may be useful to you)
    Are you sure? This action cannot be undone.
    Cancel
  • Vishal Sharma

    MemberJul 3, 2013

    Umm.. I don't think we use C in embedded systems.. As far as I know, Embedded C was developed using C mainly for hardware communication and control. It uses same compiler as C.. I've used MicroC pro for embedded programming. in that, if you make a project it creates a large number of supporting files so these files on compilation are linked to the code you write and a .hex file is created..

    So, it uses the header files developed in C to implement in embedded C
    Are you sure? This action cannot be undone.
    Cancel
  • Abhishek Rawal

    MemberJul 3, 2013

    Vishal0203
    Umm.. I don't think we use C in embedded systems..
    We use C in Embedded systems. Infact, C language is the most preferred language for Embedded systems.
    In simple words : Embedded C is subset of C language.
    Only thing in C is that we have to take care about size of program, because the microcontroller has limited memory.
    Are you sure? This action cannot be undone.
    Cancel
  • Harshad Italiya

    MemberJul 3, 2013

    Vishal0203
    Umm.. I don't think we use C in embedded systems.. As far as I know, Embedded C was developed using C mainly for hardware communication and control. It uses same compiler as C.. I've used MicroC pro for embedded programming. in that, if you make a project it creates a large number of supporting files so these files on compilation are linked to the code you write and a .hex file is created..

    So, it uses the header files developed in C to implement in embedded C
    I second you Vishal. I can see embedded C is using most of C part but it has some additional features.

    Vishal, Generating hex file is part of assembler. Isn't it.
    Are you sure? This action cannot be undone.
    Cancel
  • Vishal Sharma

    MemberJul 3, 2013

    Harshad Italiya
    I second you Vishal. I can see embedded C is using most of C part but it has some additional features.

    Vishal, Generating hex file is part of assembler. Isn't it.
    Yeah I agree with the additional features because it provides hardware communication and In built libraries make it much easier..
    I think it depends on the environment in which you are programming in! In my college labs they use assemblers where as mikroC uses a compiler..
    Are you sure? This action cannot be undone.
    Cancel
  • Vishal Sharma

    MemberJul 3, 2013

    Abhishek Rawal
    We use C in Embedded systems. Infact, C language is the most preferred language for Embedded systems.
    In simple words : Embedded C is subset of C language.
    Only thing in C is that we have to take care about size of program, because the microcontroller has limited memory.

    Okay you can call my first line a "brain fart" 😛 because I myself disagreed to it in the further lines!
    More important than size, I feel that remembering and coding according to the clock pulses is more important.
    Most of the tasks on a M-controller are threaded so its important.
    Are you sure? This action cannot be undone.
    Cancel
  • Anand Tamariya

    MemberJul 3, 2013

    Embedded C (XC8) compiler allows constructs like
    a = b = c;

    While the same is not allowed in ANSI C.
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register