Embedded C and ANSI C

Jeffrey Arulraj

Jeffrey Arulraj

@jeffrey-xA7lUP • Oct 24, 2024

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

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • Sindhu Chowdary

    Sindhu Chowdary

    @sindhu-chowdary-tDAv1D Jul 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)

  • Vishal Sharma

    Vishal Sharma

    @vishal-pysGmK Jul 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

  • Abhishek Rawal

    Abhishek Rawal

    @abhishek-fg9tRh Jul 3, 2013

    Vishal0203Umm.. 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.

  • Harshad Italiya

    Harshad Italiya

    @harshad-ukH5ww Jul 3, 2013

    Vishal0203Umm.. 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.

  • Vishal Sharma

    Vishal Sharma

    @vishal-pysGmK Jul 3, 2013

    Harshad ItaliyaI 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..

  • Vishal Sharma

    Vishal Sharma

    @vishal-pysGmK Jul 3, 2013

    Abhishek RawalWe 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.

  • Anand Tamariya

    Anand Tamariya

    @anand-tamariya-DnfjEX Jul 3, 2013

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

    While the same is not allowed in ANSI C.