SlideShare a Scribd company logo
Consider the following interrupting system. The active-edge inputs on PJ7 and PP7 can occur at
any time, including at the same time. The object is to count the number of each type of interrupt.
How would you best describe the usage of Count in this system? a) This is a perfectly
appropriate usage of Count, because there are two permanently allocated variables with private
scope, such that each variable counts the number of interrupts for each ISR. b) There is a critical
section bug because of the read/modify/write access to a shared global. c) Because both ISRs
share the same Count, the system can not distinguish between a PJ7 and a PP7 interrupt. d)
Count is initialized each interrupt, so its value is not the total number. e) The acknowledge
statements in the two ISRs are not friendly because they affect all 8 bits of the flag register. f)
None of the above is true. void interrupt 24 KeyHanJ (void) ( unsigned short static Count-0; PIFJ
= 0x80; // acknowledge Countt count the number of PU7 edges void interrupt 56 KeyHanP
(void) ( unsigned short static count=0; PIFP = 0x80; // acknowledge Count++count the number
of PP7 edges
Solution
Looking around, we find ourselves to be surrounded by various types of embedded systems. Be
it a digital camera or a mobile phone or a washing machine, all of them has some kind of
processor functioning inside it. Associated with each processor is the embedded software. If
hardware forms the body of an embedded system, embedded processor acts as the brain, and
embedded software forms its soul. It is the embedded software which primarily governs the
functioning of embedded systems.
During infancy years of microprocessor based systems, programs were developed using
assemblers and fused into the EPROMs. There used to be no mechanism to find what the
program was doing. LEDs, switches, etc. were used to check correct execution of the program.
Some ‘very fortunate’ developers had In-circuit Simulators (ICEs), but they were too costly and
were not quite reliable as well.
As time progressed, use of microprocessor-specific assembly-only as the programming language
reduced and embedded systems moved onto C as the embedded programming language of
choice. C is the most widely used programming language for embedded processors/controllers.
Assembly is also used but mainly to implement those portions of the code where very high
timing accuracy, code size efficiency, etc. are prime requirements.
Initially C was developed by Kernighan and Ritchie to fit into the space of 8K and to write
(portable) operating systems. Originally it was implemented on UNIX operating systems. As it
was intended for operating systems development, it can manipulate memory addresses. Also, it
allowed programmers to write very compact codes. This has given it the reputation as the
language of choice for hackers too.
As assembly language programs are specific to a processor, assembly language didn’t offer
portability across systems. To overcome this disadvantage, several high level languages,
including C, came up. Some other languages like PLM, Modula-2, Pascal, etc. also came but
couldn’t find wide acceptance. Amongst those, C got wide acceptance for not only embedded
systems, but also for desktop applications. Even though C might have lost its sheen as
mainstream language for general purpose applications, it still is having a strong-hold in
embedded programming. Due to the wide acceptance of C in the embedded systems, various
kinds of support tools like compilers & cross-compilers, ICE, etc. came up and all this facilitated
development of embedded systems using C.
Subsequent sections will discuss what is Embedded C, features of C language, similarities and
difference between C and embedded C, andfeatures of embedded C programming.
EMBEDDED SYSTEMS PROGRAMMING
Embedded systems programming is different from developing applications on a desktop
computers. Key characteristics of an embedded system, when compared to PCs, are as follows:
· Embedded devices have resource constraints(limited ROM, limited RAM, limited stack
space, less processing power)
· Components used in embedded system and PCs are different; embedded systems typically
uses smaller, less power consuming components.· Embedded systems are more tied to the
hardware.
Two salient features of Embedded Programming are code speed and code size. Code speed is
governed by the processing power, timing constraints, whereas code size is governed by
available program memory and use of programming language. Goal of embedded system
programming is to get maximum features in minimum space and minimum time.
Embedded systems are programmed using different type of languages:
· Machine Code
· Low level language, i.e., assembly
· High level language like C, C++, Java, Ada, etc.
· Application level language like Visual Basic, scripts, Access, etc.
Assembly language maps mnemonic words with the binary machine codes that the processor
uses to code the instructions. Assembly language seems to be an obvious choice for
programming embedded devices. However, use of assembly language is restricted to developing
efficient codes in terms of size and speed. Also, assembly codes lead to higher software
development costs and code portability is not there. Developing small codes are not much of a
problem, but large programs/projects become increasingly difficult to manage in assembly
language. Finding good assembly programmers has also become difficult nowadays. Hence high
level languages are preferred for embedded systems programming.
Use of C in embedded systems is driven by following advantages
· It is small and reasonably simpler to learn, understand, program and debug.
· 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.
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.
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.
Compared to assembly language, C Code written is more reliable and scalable, more portable
between different platforms (with some changes). Moreover, programs developed in C are much
easier to understand, maintain and debug. Also, as they can be developed more quickly, codes
written in C offers better productivity. 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.
Objected oriented language, C++ is not apt for developing efficient programs in resource
constrained environments like embedded devices. Virtual functions & exception handling of
C++ are some specific features that are not efficient in terms of space and speed in embedded
systems. Sometimes C++ is used only with very few features, very much as C.
Ada, also an object-oriented language, is different than C++. Originally designed by the U.S.
DOD, it didn’t gain popularity despite being accepted as an international standard twice (Ada83
and Ada95). However, Ada language has many features that would simplify embedded software
development.
Java is another language used for embedded systems programming. It primarily finds usage in
high-end mobile phones as it offers portability across systems and is also useful for browsing
applications. Java programs require Java Virtual Machine (JVM), which consume lot of
resources. Hence it is not used for smaller embedded devices.
Dynamic C and B# are some proprietary languages which are also being used in embedded
applications.
Efficient embedded C programs must be kept small and efficient; they must be optimized for
code speed and code size. Good understanding of processor architecture embedded C
programming and debugging tools facilitate this.
DIFFERENCE BETWEEN C AND EMBEDDED C
Though C andembedded C appear different and are used in different contexts, they have more
similarities than the differences. Most of the constructs are same; the difference lies in their
applications.
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. Thus, program
code must fit into the available program memory. If code exceeds the limit, the system is likely
to crash.
Compilers for C (ANSI C) typically generate OS dependant executables. Embedded C requires
compilers to create files to be downloaded to the microcontrollers/microprocessors where it
needs to run. Embedded compilers give access to all resources which is not provided in
compilers for desktop computer applications.
Embedded systems often have the real-time constraints, which is usually not there with desktop
computer applications.
Embedded systems often do not have a console, which is available in case of desktop
applications.
So, what basically is different while programming with embedded C is the mindset; for
embedded applications, we need to optimally use the resources, make the program code efficient,
and satisfy real time constraints, if any. All this is done using the basic constructs, syntaxes, and
function libraries of ‘C’.

More Related Content

Similar to Consider the following interrupting system. The active-edge inputs o.pdf (20)

PPT
Module-3 Embedded syatem firmware design.ppt
BEVARAVASUDEVAAP1813
 
PPT
Embedded firmware
Joel P
 
PPT
Compilers programmingembedded
Manish Pandey
 
PDF
Embedded_C-explanation of pointers C.pdf
RammohanBasavaraju1
 
PPTX
Introduction to embedded systems
Apurva Zope
 
PDF
embeddedsystems-100429081552-phpapp01.pdf
Ashwin180668
 
PPT
Embedded systems
kondalarao7
 
PPT
BWU_BTE_21_030_OE_EE702A.ppthhgggggggggg
tusharjana065
 
PPTX
Embedded system
Vinod Srivastava
 
PPTX
Embedded c c++ programming fundamentals master
Hossam Hassan
 
PPTX
M.Tech Internet of Things Embeed Systems
AvinashAvuthu2
 
PPTX
Embedded Systems design by using micro controller and micro processor
saideepthi596
 
PPTX
Introduction to Embedded Systems
Sandeep Reddy
 
PDF
es1-150721100817-lva1-app6891.pdf
Ashwin180668
 
PPTX
Ppt on embedded system
Pankaj joshi
 
PDF
2e062d07-4a72-4792-af77-5e53147d4c81.pdf
kimavathmukeshnaik
 
PDF
C programming session9 -
Keroles karam khalil
 
PPTX
1334420 634648164164717500
sumit tiwari
 
PPT
embededsystemfinal1-170130182030 (1).ppt
kimavathmukeshnaik
 
PPTX
Lecture 1 Introduction.pptx
Orchestra2
 
Module-3 Embedded syatem firmware design.ppt
BEVARAVASUDEVAAP1813
 
Embedded firmware
Joel P
 
Compilers programmingembedded
Manish Pandey
 
Embedded_C-explanation of pointers C.pdf
RammohanBasavaraju1
 
Introduction to embedded systems
Apurva Zope
 
embeddedsystems-100429081552-phpapp01.pdf
Ashwin180668
 
Embedded systems
kondalarao7
 
BWU_BTE_21_030_OE_EE702A.ppthhgggggggggg
tusharjana065
 
Embedded system
Vinod Srivastava
 
Embedded c c++ programming fundamentals master
Hossam Hassan
 
M.Tech Internet of Things Embeed Systems
AvinashAvuthu2
 
Embedded Systems design by using micro controller and micro processor
saideepthi596
 
Introduction to Embedded Systems
Sandeep Reddy
 
es1-150721100817-lva1-app6891.pdf
Ashwin180668
 
Ppt on embedded system
Pankaj joshi
 
2e062d07-4a72-4792-af77-5e53147d4c81.pdf
kimavathmukeshnaik
 
C programming session9 -
Keroles karam khalil
 
1334420 634648164164717500
sumit tiwari
 
embededsystemfinal1-170130182030 (1).ppt
kimavathmukeshnaik
 
Lecture 1 Introduction.pptx
Orchestra2
 

More from fasttrackscardecors (20)

PDF
On a Sunday in April, dog bite victims arrive at Carver Memorial Hos.pdf
fasttrackscardecors
 
PDF
Molecules like glucose usually need a special transporter protein to.pdf
fasttrackscardecors
 
PDF
Missy Crane opened a public relations firm called Goth on August 1, 2.pdf
fasttrackscardecors
 
PDF
Justify that the following circuit represents the functionality of a .pdf
fasttrackscardecors
 
PDF
Inventor classwhat is the purpose of using assemply constraints.pdf
fasttrackscardecors
 
PDF
IncompressibilityI cant understand some parts in a book.The .pdf
fasttrackscardecors
 
PDF
If you were to illuminate an Elodea leaf with light at 550 nm, would.pdf
fasttrackscardecors
 
PDF
Identify the three major types of controls that organizations can us.pdf
fasttrackscardecors
 
PDF
I have C++ question that I do not know how to do, Can you teach me t.pdf
fasttrackscardecors
 
PDF
I need proper and details explanation for this case study Financial .pdf
fasttrackscardecors
 
PDF
How is Vietas contribution to mathematics distinctly modern in spi.pdf
fasttrackscardecors
 
PDF
Fungal associations with plants Examine a type of fungal association .pdf
fasttrackscardecors
 
PDF
For each problem in this homework, your assignment is to determine .pdf
fasttrackscardecors
 
PDF
For each story problem, identofy the opertaion and the interpretatio.pdf
fasttrackscardecors
 
PDF
Explain a. casting b. overloading c. sentinel d. echoSolution.pdf
fasttrackscardecors
 
PDF
Find all the square roots of the complex number 14i. Write the squar.pdf
fasttrackscardecors
 
PDF
Describe the flow of oxygenated blood from the placenta to the fe.pdf
fasttrackscardecors
 
PDF
describe two different forms of bindingSolutionTwo forms Co.pdf
fasttrackscardecors
 
PDF
Connect onnect mheducation.co.pdf
fasttrackscardecors
 
PDF
Case History- An 11-month old Boy whos blue and short of breathC.pdf
fasttrackscardecors
 
On a Sunday in April, dog bite victims arrive at Carver Memorial Hos.pdf
fasttrackscardecors
 
Molecules like glucose usually need a special transporter protein to.pdf
fasttrackscardecors
 
Missy Crane opened a public relations firm called Goth on August 1, 2.pdf
fasttrackscardecors
 
Justify that the following circuit represents the functionality of a .pdf
fasttrackscardecors
 
Inventor classwhat is the purpose of using assemply constraints.pdf
fasttrackscardecors
 
IncompressibilityI cant understand some parts in a book.The .pdf
fasttrackscardecors
 
If you were to illuminate an Elodea leaf with light at 550 nm, would.pdf
fasttrackscardecors
 
Identify the three major types of controls that organizations can us.pdf
fasttrackscardecors
 
I have C++ question that I do not know how to do, Can you teach me t.pdf
fasttrackscardecors
 
I need proper and details explanation for this case study Financial .pdf
fasttrackscardecors
 
How is Vietas contribution to mathematics distinctly modern in spi.pdf
fasttrackscardecors
 
Fungal associations with plants Examine a type of fungal association .pdf
fasttrackscardecors
 
For each problem in this homework, your assignment is to determine .pdf
fasttrackscardecors
 
For each story problem, identofy the opertaion and the interpretatio.pdf
fasttrackscardecors
 
Explain a. casting b. overloading c. sentinel d. echoSolution.pdf
fasttrackscardecors
 
Find all the square roots of the complex number 14i. Write the squar.pdf
fasttrackscardecors
 
Describe the flow of oxygenated blood from the placenta to the fe.pdf
fasttrackscardecors
 
describe two different forms of bindingSolutionTwo forms Co.pdf
fasttrackscardecors
 
Connect onnect mheducation.co.pdf
fasttrackscardecors
 
Case History- An 11-month old Boy whos blue and short of breathC.pdf
fasttrackscardecors
 
Ad

Recently uploaded (20)

PDF
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
PPTX
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
PPTX
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
PPTX
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
PDF
Dimensions of Societal Planning in Commonism
StefanMz
 
PPTX
GRADE-3-PPT-EVE-2025-ENG-Q1-LESSON-1.pptx
EveOdrapngimapNarido
 
PPTX
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
PDF
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
PPTX
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
PDF
Horarios de distribución de agua en julio
pegazohn1978
 
PDF
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
PPTX
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
PPTX
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
PPT
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
PDF
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
PPTX
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
PDF
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
PPTX
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PPTX
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
PPTX
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
Dimensions of Societal Planning in Commonism
StefanMz
 
GRADE-3-PPT-EVE-2025-ENG-Q1-LESSON-1.pptx
EveOdrapngimapNarido
 
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
Horarios de distribución de agua en julio
pegazohn1978
 
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
Ad

Consider the following interrupting system. The active-edge inputs o.pdf

  • 1. Consider the following interrupting system. The active-edge inputs on PJ7 and PP7 can occur at any time, including at the same time. The object is to count the number of each type of interrupt. How would you best describe the usage of Count in this system? a) This is a perfectly appropriate usage of Count, because there are two permanently allocated variables with private scope, such that each variable counts the number of interrupts for each ISR. b) There is a critical section bug because of the read/modify/write access to a shared global. c) Because both ISRs share the same Count, the system can not distinguish between a PJ7 and a PP7 interrupt. d) Count is initialized each interrupt, so its value is not the total number. e) The acknowledge statements in the two ISRs are not friendly because they affect all 8 bits of the flag register. f) None of the above is true. void interrupt 24 KeyHanJ (void) ( unsigned short static Count-0; PIFJ = 0x80; // acknowledge Countt count the number of PU7 edges void interrupt 56 KeyHanP (void) ( unsigned short static count=0; PIFP = 0x80; // acknowledge Count++count the number of PP7 edges Solution Looking around, we find ourselves to be surrounded by various types of embedded systems. Be it a digital camera or a mobile phone or a washing machine, all of them has some kind of processor functioning inside it. Associated with each processor is the embedded software. If hardware forms the body of an embedded system, embedded processor acts as the brain, and embedded software forms its soul. It is the embedded software which primarily governs the functioning of embedded systems. During infancy years of microprocessor based systems, programs were developed using assemblers and fused into the EPROMs. There used to be no mechanism to find what the program was doing. LEDs, switches, etc. were used to check correct execution of the program. Some ‘very fortunate’ developers had In-circuit Simulators (ICEs), but they were too costly and were not quite reliable as well. As time progressed, use of microprocessor-specific assembly-only as the programming language reduced and embedded systems moved onto C as the embedded programming language of choice. C is the most widely used programming language for embedded processors/controllers. Assembly is also used but mainly to implement those portions of the code where very high timing accuracy, code size efficiency, etc. are prime requirements. Initially C was developed by Kernighan and Ritchie to fit into the space of 8K and to write (portable) operating systems. Originally it was implemented on UNIX operating systems. As it was intended for operating systems development, it can manipulate memory addresses. Also, it
  • 2. allowed programmers to write very compact codes. This has given it the reputation as the language of choice for hackers too. As assembly language programs are specific to a processor, assembly language didn’t offer portability across systems. To overcome this disadvantage, several high level languages, including C, came up. Some other languages like PLM, Modula-2, Pascal, etc. also came but couldn’t find wide acceptance. Amongst those, C got wide acceptance for not only embedded systems, but also for desktop applications. Even though C might have lost its sheen as mainstream language for general purpose applications, it still is having a strong-hold in embedded programming. Due to the wide acceptance of C in the embedded systems, various kinds of support tools like compilers & cross-compilers, ICE, etc. came up and all this facilitated development of embedded systems using C. Subsequent sections will discuss what is Embedded C, features of C language, similarities and difference between C and embedded C, andfeatures of embedded C programming. EMBEDDED SYSTEMS PROGRAMMING Embedded systems programming is different from developing applications on a desktop computers. Key characteristics of an embedded system, when compared to PCs, are as follows: · Embedded devices have resource constraints(limited ROM, limited RAM, limited stack space, less processing power) · Components used in embedded system and PCs are different; embedded systems typically uses smaller, less power consuming components.· Embedded systems are more tied to the hardware. Two salient features of Embedded Programming are code speed and code size. Code speed is governed by the processing power, timing constraints, whereas code size is governed by available program memory and use of programming language. Goal of embedded system programming is to get maximum features in minimum space and minimum time. Embedded systems are programmed using different type of languages: · Machine Code · Low level language, i.e., assembly · High level language like C, C++, Java, Ada, etc. · Application level language like Visual Basic, scripts, Access, etc. Assembly language maps mnemonic words with the binary machine codes that the processor uses to code the instructions. Assembly language seems to be an obvious choice for programming embedded devices. However, use of assembly language is restricted to developing efficient codes in terms of size and speed. Also, assembly codes lead to higher software development costs and code portability is not there. Developing small codes are not much of a problem, but large programs/projects become increasingly difficult to manage in assembly
  • 3. language. Finding good assembly programmers has also become difficult nowadays. Hence high level languages are preferred for embedded systems programming. Use of C in embedded systems is driven by following advantages · It is small and reasonably simpler to learn, understand, program and debug. · 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. 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. 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. Compared to assembly language, C Code written is more reliable and scalable, more portable between different platforms (with some changes). Moreover, programs developed in C are much easier to understand, maintain and debug. Also, as they can be developed more quickly, codes written in C offers better productivity. 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. Objected oriented language, C++ is not apt for developing efficient programs in resource constrained environments like embedded devices. Virtual functions & exception handling of C++ are some specific features that are not efficient in terms of space and speed in embedded systems. Sometimes C++ is used only with very few features, very much as C. Ada, also an object-oriented language, is different than C++. Originally designed by the U.S. DOD, it didn’t gain popularity despite being accepted as an international standard twice (Ada83 and Ada95). However, Ada language has many features that would simplify embedded software development. Java is another language used for embedded systems programming. It primarily finds usage in high-end mobile phones as it offers portability across systems and is also useful for browsing
  • 4. applications. Java programs require Java Virtual Machine (JVM), which consume lot of resources. Hence it is not used for smaller embedded devices. Dynamic C and B# are some proprietary languages which are also being used in embedded applications. Efficient embedded C programs must be kept small and efficient; they must be optimized for code speed and code size. Good understanding of processor architecture embedded C programming and debugging tools facilitate this. DIFFERENCE BETWEEN C AND EMBEDDED C Though C andembedded C appear different and are used in different contexts, they have more similarities than the differences. Most of the constructs are same; the difference lies in their applications. 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. Thus, program code must fit into the available program memory. If code exceeds the limit, the system is likely to crash. Compilers for C (ANSI C) typically generate OS dependant executables. Embedded C requires compilers to create files to be downloaded to the microcontrollers/microprocessors where it needs to run. Embedded compilers give access to all resources which is not provided in compilers for desktop computer applications. Embedded systems often have the real-time constraints, which is usually not there with desktop computer applications. Embedded systems often do not have a console, which is available in case of desktop applications. So, what basically is different while programming with embedded C is the mindset; for embedded applications, we need to optimally use the resources, make the program code efficient, and satisfy real time constraints, if any. All this is done using the basic constructs, syntaxes, and function libraries of ‘C’.