Discuss the advantages of using C language for programming

- Discuss the advantages of using C- language for programming a controller

-Observe the delay function in the code and discuss how this function was formulated
and how do we verify its functioning; discuss as many techniques as you can find.

Solution

   C is used for desktop computers, while embedded C is for microcontroller based applications. Accordingly, C has the luxury to use resources of a desktop PC like memory, OS, etc. While programming on desktop systems, we need not bother about memory. However, embedded C has to use with the limited resources (RAM, ROM, I/Os) on an embedded processor.
   I can tell that C syntax is a lot easier to learn than Assembler syntax. There are obvious reasons not worth rehashing. Being easier to use, C allows you to write programs faster. C is easier to use for making more complex programs. Learning C is somehow more productive than learning assembler cause there is more developing stuff around C than Assembler. Often times, code generated by a compiler is equally as good (in terms of speed and efficiency) as hand-written assembler - if not better. C is pretty darn low-level, and it\'s rare that you\'ll want to go much lower.
   C Compilers are available for almost all embedded devices in use today, and there is a large pool of experienced C programmers. Unlike assembly, C has advantage of processor-independence and is not specific to any particular microprocessor/ microcontroller or any system. This makes it convenient for a user to develop programs that can run on most of the systems. As C combines functionality of assembly language and features of high level languages, C is treated as a ‘middle-level computer language’ or ‘high level assembly language’. It is fairly efficient. It supports access to I/O and provides ease of management of large embedded projects.
   C is based on the philosophy ‘programmers know what they are doing’; only the intentions are to be stated explicitly. It is easier to write good code in C & convert it to an efficient assembly code (using high quality compilers) rather than writing an efficient code in assembly itself. Benefits of assembly language programming over C are negligible when we compare the ease with which C programs are developed by programmers.


Compared to other high level languages, C offers more flexibility because C is relatively small, structured language; it supports low-level bit-wise data manipulation.


We wouldn\'t need to make any library calls, so the extent of the impact of using C would be:
Extra RAM usage associated with more frequent function calls (my program would be more structured than the assembly version), if any. Extra ROM usage associated with the C startup code, compiler-supplied routines (for example, the PIC16 family doesn\'t have a multiply instruction), and overhead introduced by the compiler, if any. Any performance impact associated with extra instructions that can\'t be avoided when generalizing at the compiler level.
   Many of these advantages are offered by other languages also, but what sets C apart from others like Pascal, FORTRAN, etc. is the fact that it is a middle level language; it provides direct hardware control without sacrificing benefits of high level languages.

- Discuss the advantages of using C- language for programming a controller -Observe the delay function in the code and discuss how this function was formulated

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site