SlideShare a Scribd company logo
Embedded Systems
By Abebe B.
Embedded programming
Definition of Embedded Systems
Programming
• Embedded systems programming involves
designing and developing software for
embedded systems.
• This software is typically written in low-level
languages such as C and assembly
language and is optimized for the specific
hardware and application requirements of
the system.
Embedded Systems Programming
• Embedded systems programming refers to the
development of software for embedded
systems, which are computer systems that are
integrated into other devices or products.
• These systems are designed to perform specific
functions, and they often have limited
resources, including memory, processing
power, and energy.
• Embedded systems programming is essential
for developing systems that are reliable,
efficient, and cost-effective.
Embedded Languages
 Some of the most commonly used programming languages
for embedded systems programming include:
 C:
• C Programming is a widely used programming language for
embedded systems programming.
• It provides direct access to system resources and is well-suited for
systems with limited resources.
 Assembly language:
• Assembly language is a low-level programming language that
provides direct access to system resources.
• It is often used for systems with very limited resources or for
performance-critical applications.
 C++:
• C++ is a high-level programming language that is often used for
embedded systems programming.
• It provides object-oriented programming features and can be used
to develop complex systems.
Embedded Languages
• More than any other, C has become the
language of embedded programmers.
• This has not always been the case, and it will
not continue to be so forever.
• However, at this time, C is the closest thing
there is to a standard in the embedded world.
– Explain why C ?
Embedded Languages
• It is surprising to find that one language has
proven itself appropriate for both 8-bit and
64-bit processors; in systems with bytes,
kilobytes, and megabytes of memory;
• Of course, C is not without advantages.
Embedded Languages
• C is
– small and fairly simple to learn,
– compilers are available for almost every processor in use today,
and
– there is a very large body of experienced C programmers.
• In addition, it has the benefit of processor-
independence, which allows programmers to
concentrate on algorithms and applications, rather than
on the details of a particular processor architecture.
• However, many of these advantages apply equally to
other high-level languages.
– So why has C succeeded where so many other languages
have largely failed?
Embedded Languages
• Perhaps the greatest strength of C-and the thing that
sets it apart from languages like Pascal and FORTRAN-
is that it is a very "low-level" high-level language.
• C gives embedded programmers an extraordinary
degree of direct hardware control without sacrificing
the benefits of high-level languages.
• The "low-level“ nature of C was a clear intention of the
language's creators.
Embedded Systems Programming
Tools
• Embedded systems programming requires specialized tools to
develop, test, and debug software for these systems.
• These tools include:
– Integrated development environments (IDEs):
• IDEs provide a comprehensive development environment for
embedded systems programming.
• They typically include a code editor, compiler, debugger, and other
tools for developing and testing software.
– Cross-compilers:
• Cross-compilers are used to compile code for a different platform
than the one on which the compiler is running.
– Emulators and simulators:
• Emulators and simulators are used to test software on a virtual
environment that emulates the hardware and software of the target
system.
• They are often used for testing software before it is deployed to the
target system.
Embedded Systems Programming Best
Practices
• Embedded systems programming requires careful attention to
detail and a focus on writing efficient and reliable code.
• To develop software for embedded systems effectively,
developers should follow best practices, including:
– Writing Efficient Code
• Writing efficient code is critical for embedded systems, as these systems
often have limited resources.
• Developers should focus on writing code that is optimized for the specific
hardware and application requirements of the system and should avoid
using unnecessary resources.
Arduino UNO Board
• The Arduino UNO is a standard board of Arduino.
• Arduino UNO is based on an ATmega328P microcontroller. It is easy to use
compared to other boards, such as the Arduino Mega board, etc.
• The board consists of digital and analog Input/Output pins (I/O), shields,
and other circuits.
• The Arduino UNO includes 6 analog pin inputs, 14 digital pins, a USB
connector, a power jack, and an ICSP (In-Circuit Serial Programming)
header.
• The IDE is common to all available boards of Arduino.
Arduino UNO Board
• The Arduino board is shown below:
Arduino UNO Board
• The components of Arduino UNO board are shown below:
Arduino UNO Pinout
• The Arduino UNO Board, with the specification of pins, is shown below:
Your First Embedded Program
• Embedded programmers must be self-reliant. They
must always begin each new project with the
assumption that nothing works-that all they can rely
on is the basic syntax of their programming language.
• Even the standard library routines might not be
available to them. These are the auxiliary functions-
like printf and scanf -that most other programmers
take for granted.
Your First Embedded Program
“Hello, World”
• Every embedded system has at least one LED that
could be controlled by software.
• So my substitute for the "Hello, World!" program has
been one that blinks an LED at a rate of 1 Hz (one
complete on-off cycle per second).
• Typically, the code required to turn an LED on and off
is limited to a few lines of C or assembly, so there is
very little room for programming errors to occur.
Coding Screen
setup()
• The setup() function is called when a sketch
starts. Use it to initialize variables, pin modes,
start using libraries, etc.
• The setup() function will only run once, after
each powerup or reset of the Arduino board.
Example Code
void setup()
{
// initialize digital pin LED_BUILTIN OR PIN13 as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {.......}
loop()
• After creating a setup() function, which
initializes and sets the initial values, the loop()
function does precisely what its name
suggests, and loops consecutively, allowing
your program to change and respond.
• Use it to actively control the Arduino board.
Example Code
void setup() {………..}
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
delay(1000);
digitalWrite(LED_BUILTIN, LOW);
delay(1000); }
Your First Embedded Program
“turn an LED on and off”
// the setup function runs once when you press reset or power the board
void setup()
{
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
// the loop function runs over and over again forever
void loop()
{
digitalWrite(LED_BUILTIN, HIGH); // turn the LED ON (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn LED OFF (LOW is the voltage level)
delay(1000); // wait for a second
}
The Role of the Infinite Loop
• One of the most fundamental differences between
programs developed for embedded systems and those
written for other computer platforms is that the
embedded programs almost always end with an
infinite loop.
• Typically, this loop surrounds a significant part of the
program’s functionality-as it does in the Blinking LED
program.
• The infinite loop is necessary because the embedded
software's job is never done. It is intended to be run
until either the world comes to an end or the board is
reset, whichever happens first.
Compiling, Linking, and Locating
The Build Process
The Build Process
• The process of converting the source code
representation of your embedded software into an
executable binary image involves three distinct steps.
– First, each of the source files must be compiled or
assembled into an object file.
– Second, all of the object files that result from the first step
must be linked together to produce a single object file,
called the relocatable program.
– Finally, physical memory addresses must be assigned to the
relative offsets within the relocatable program in a process
called relocation.
– The result of this third step is a file that contains an
executable binary image that is ready to be run on the
embedded system.
The embedded software development
process
The embedded software development
process
• Object file:-
– It is a specially formatted binary file that contains the set
of instructions and data resulting from the language
translation process. Although parts of this file contain
executable code, the object file is not intended to be
executed directly.
– There is also usually a symbol table somewhere in the
object file that contains the names and locations of all the
variables and functions referenced within the source file.
– Parts of this table may be incomplete, however, because
not all of the variables and functions are always defined in
the same file.
– These are the symbols that refer to variables and functions
defined in other source files. And it is up to the linker to
resolve such unresolved references.
The embedded software development
process
The embedded software development
process
• Each of the steps of the embedded software build
process is a transformation performed by software
running on a general-purpose computer.
• The compiler, assembler, linker, and locator are all
pieces of software that run on a host computer, rather
than on the embedded system itself.
• Yet, despite the fact that they run on some other
computer platform, these tools combine their efforts
to produce an executable binary image that will
execute properly only on the target embedded
system.
The split between host and target
Compiling
• The job of a compiler is mainly to translate
programs written in some human-readable
language into an equivalent set of opcodes for
a particular processor.
• Of course, each processor has its own unique
machine language, so you need to choose a
compiler that is capable of producing
programs for your specific target processor.
Compiling
• In the embedded systems case, this compiler
almost always runs on the host computer. It simply
doesn't make sense to execute the compiler on
the embedded system itself.
• A compiler such as this-that runs on one computer
platform and produces code for another-is called a
cross-compiler.
• The use of a cross-compiler is one of the defining
features of embedded software development.
Linking
• All of the object files resulting from step one
must be combined in a special way before the
program can be executed.
• The object files themselves are individually
incomplete, most notably in that some of the
internal variable and function references have not
yet been resolved.
• The job of the linker is to combine these object
files and, in the process, to resolve all of the
unresolved symbols.
Linking
• The output of the linker is a new object file
that contains all of the code and data from the
input object files and is in the same object file
format.
• It does this by merging the text, data, and bss
sections of the input files.
Locating
• The tool that performs the conversion from relocatable
program to executable binary image is called a locator.
• It takes responsibility for the easiest step of the three.
In fact, you will have to do most of the work in this step
yourself, by providing information about the memory
on the target board as input to the locator.
• The locator will use this information to assign physical
memory addresses to each of the code and data
sections within the relocatable program.
• It will then produce an output file that contains a
binary memory image that can be loaded into the
target ROM.
Getting to Know the Hardware
• Before writing software for an embedded
system, you must first be familiar with the
hardware on which it will run.
• At first, you just need to understand the general
operation of the system.
• Whenever you receive a new board, you should
take some time to read whatever documents
have been provided with it.
• If the board is an off-the-shelf product, it might
arrive with a "User's Guide" or "Programmer's
Manual" that has been written with the
software developer in mind.
Arduino Uno
https://www.electronicshub.org/arduino-uno-pinout/
Importance of Embedded
Systems Programming
• Embedded systems are used in a wide range of
products, including automobiles, medical
devices, consumer electronics, and industrial
equipment.
• These systems must be reliable, efficient, and
cost-effective, and embedded systems
programming plays a critical role in achieving
these goals.
• By optimizing software for the specific hardware
and application requirements of the system,
developers can improve system performance,
reduce energy consumption, and minimize costs.
https://www.arduino.cc/reference/en/
Ad

More Related Content

What's hot (20)

Computer programing 111 lecture 1
Computer programing 111 lecture 1 Computer programing 111 lecture 1
Computer programing 111 lecture 1
ITNet
 
arm
armarm
arm
Pratik Gohel
 
8086 MICROPROCESSOR
8086 MICROPROCESSOR8086 MICROPROCESSOR
8086 MICROPROCESSOR
Akhila Rahul
 
Assembly language
Assembly languageAssembly language
Assembly language
gaurav jain
 
Compiler gate question key
Compiler gate question keyCompiler gate question key
Compiler gate question key
ArthyR3
 
catia presentation.pptx
catia presentation.pptxcatia presentation.pptx
catia presentation.pptx
AnkitRaj562761
 
OpenWrt From Top to Bottom
OpenWrt From Top to BottomOpenWrt From Top to Bottom
OpenWrt From Top to Bottom
Kernel TLV
 
What is Bootloader???
What is Bootloader???What is Bootloader???
What is Bootloader???
Dinesh Damodar
 
Unit2 arm
Unit2 armUnit2 arm
Unit2 arm
Karthik Vivek
 
Loader and Its types
Loader and Its typesLoader and Its types
Loader and Its types
Parth Dodiya
 
from Source to Binary: How GNU Toolchain Works
from Source to Binary: How GNU Toolchain Worksfrom Source to Binary: How GNU Toolchain Works
from Source to Binary: How GNU Toolchain Works
National Cheng Kung University
 
Programming language
Programming languageProgramming language
Programming language
Shuja Qais
 
Embedded system.pptx
Embedded system.pptxEmbedded system.pptx
Embedded system.pptx
Saransh Garg
 
C Programming - Refresher - Part III
C Programming - Refresher - Part IIIC Programming - Refresher - Part III
C Programming - Refresher - Part III
Emertxe Information Technologies Pvt Ltd
 
PART-2 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-2 : Mastering RTOS FreeRTOS and STM32Fx with DebuggingPART-2 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-2 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
FastBit Embedded Brain Academy
 
Coa INTERUPT
Coa INTERUPTCoa INTERUPT
Coa INTERUPT
Piyush Rochwani
 
Bootloaders (U-Boot)
Bootloaders (U-Boot) Bootloaders (U-Boot)
Bootloaders (U-Boot)
Omkar Rane
 
Programming languages,compiler,interpreter,softwares
Programming languages,compiler,interpreter,softwaresProgramming languages,compiler,interpreter,softwares
Programming languages,compiler,interpreter,softwares
Nisarg Amin
 
Embedded systems basics
Embedded systems basicsEmbedded systems basics
Embedded systems basics
Mathivanan Natarajan
 
Introduction to Simplified instruction computer or SIC/XE
Introduction to Simplified instruction computer or SIC/XEIntroduction to Simplified instruction computer or SIC/XE
Introduction to Simplified instruction computer or SIC/XE
Temesgen Molla
 
Computer programing 111 lecture 1
Computer programing 111 lecture 1 Computer programing 111 lecture 1
Computer programing 111 lecture 1
ITNet
 
8086 MICROPROCESSOR
8086 MICROPROCESSOR8086 MICROPROCESSOR
8086 MICROPROCESSOR
Akhila Rahul
 
Assembly language
Assembly languageAssembly language
Assembly language
gaurav jain
 
Compiler gate question key
Compiler gate question keyCompiler gate question key
Compiler gate question key
ArthyR3
 
catia presentation.pptx
catia presentation.pptxcatia presentation.pptx
catia presentation.pptx
AnkitRaj562761
 
OpenWrt From Top to Bottom
OpenWrt From Top to BottomOpenWrt From Top to Bottom
OpenWrt From Top to Bottom
Kernel TLV
 
Loader and Its types
Loader and Its typesLoader and Its types
Loader and Its types
Parth Dodiya
 
Programming language
Programming languageProgramming language
Programming language
Shuja Qais
 
Embedded system.pptx
Embedded system.pptxEmbedded system.pptx
Embedded system.pptx
Saransh Garg
 
PART-2 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-2 : Mastering RTOS FreeRTOS and STM32Fx with DebuggingPART-2 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-2 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
FastBit Embedded Brain Academy
 
Bootloaders (U-Boot)
Bootloaders (U-Boot) Bootloaders (U-Boot)
Bootloaders (U-Boot)
Omkar Rane
 
Programming languages,compiler,interpreter,softwares
Programming languages,compiler,interpreter,softwaresProgramming languages,compiler,interpreter,softwares
Programming languages,compiler,interpreter,softwares
Nisarg Amin
 
Introduction to Simplified instruction computer or SIC/XE
Introduction to Simplified instruction computer or SIC/XEIntroduction to Simplified instruction computer or SIC/XE
Introduction to Simplified instruction computer or SIC/XE
Temesgen Molla
 

Similar to Embedded programming Embedded programming (1).pptx (20)

Embedded Programming..pnsnsjsejejwwjjwptx
Embedded Programming..pnsnsjsejejwwjjwptxEmbedded Programming..pnsnsjsejejwwjjwptx
Embedded Programming..pnsnsjsejejwwjjwptx
JayPatil347597
 
E.s unit 6
E.s unit 6E.s unit 6
E.s unit 6
Sneha Chopra
 
Module4.pdf ,...................................
Module4.pdf ,...................................Module4.pdf ,...................................
Module4.pdf ,...................................
chetanreddy2212
 
Embedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals masterEmbedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals master
Hossam Hassan
 
ECE-3567-Lecture-1-Spring-2025 for beginner
ECE-3567-Lecture-1-Spring-2025 for beginnerECE-3567-Lecture-1-Spring-2025 for beginner
ECE-3567-Lecture-1-Spring-2025 for beginner
MahmoudElsamanty
 
embeddedsystems-100429081552-phpapp01.pdf
embeddedsystems-100429081552-phpapp01.pdfembeddedsystems-100429081552-phpapp01.pdf
embeddedsystems-100429081552-phpapp01.pdf
Ashwin180668
 
Introduction to Computer Softwares
Introduction to Computer SoftwaresIntroduction to Computer Softwares
Introduction to Computer Softwares
Naresh Dubey
 
EMBEDDED SYSTEMS SYBSC IT SEM IV UNIT V Embedded Systems Integrated Developme...
EMBEDDED SYSTEMS SYBSC IT SEM IV UNIT V Embedded Systems Integrated Developme...EMBEDDED SYSTEMS SYBSC IT SEM IV UNIT V Embedded Systems Integrated Developme...
EMBEDDED SYSTEMS SYBSC IT SEM IV UNIT V Embedded Systems Integrated Developme...
Arti Parab Academics
 
Introductions to Design Logic.pptx IT level
Introductions to Design Logic.pptx IT levelIntroductions to Design Logic.pptx IT level
Introductions to Design Logic.pptx IT level
gadisaadamu101
 
UNIT - 1jhjhjbkjhkjhkjhkjhkjhhkkhhh.pptx
UNIT - 1jhjhjbkjhkjhkjhkjhkjhhkkhhh.pptxUNIT - 1jhjhjbkjhkjhkjhkjhkjhhkkhhh.pptx
UNIT - 1jhjhjbkjhkjhkjhkjhkjhhkkhhh.pptx
RoselinLourd
 
Compilers and interpreters
Compilers and interpretersCompilers and interpreters
Compilers and interpreters
RAJU KATHI
 
01 Computer Basics (Ch1.1).pptx
01 Computer Basics (Ch1.1).pptx01 Computer Basics (Ch1.1).pptx
01 Computer Basics (Ch1.1).pptx
sarah380333
 
Assembly language programming implemenation
Assembly language programming implemenationAssembly language programming implemenation
Assembly language programming implemenation
FazalHameed14
 
Computer Programming In C.pptx
Computer Programming In C.pptxComputer Programming In C.pptx
Computer Programming In C.pptx
chouguleamruta24
 
Namdeo Kapale Sanjivani College of Engineering KopaCFP_UNIT1_24-25.pdf
Namdeo Kapale Sanjivani College of Engineering KopaCFP_UNIT1_24-25.pdfNamdeo Kapale Sanjivani College of Engineering KopaCFP_UNIT1_24-25.pdf
Namdeo Kapale Sanjivani College of Engineering KopaCFP_UNIT1_24-25.pdf
NAMDEO5
 
Python-unit -I.pptx
Python-unit -I.pptxPython-unit -I.pptx
Python-unit -I.pptx
crAmth
 
Introduction to Computer, Programming languages , Networks and Internet.pptx
Introduction to Computer, Programming languages , Networks and Internet.pptxIntroduction to Computer, Programming languages , Networks and Internet.pptx
Introduction to Computer, Programming languages , Networks and Internet.pptx
SheharBano86
 
Compilers.pptx
Compilers.pptxCompilers.pptx
Compilers.pptx
MohammedMohammed578197
 
4_5802928814682016556.pptx
4_5802928814682016556.pptx4_5802928814682016556.pptx
4_5802928814682016556.pptx
AshenafiGirma5
 
CD - CH1 - Introduction to compiler design.pptx
CD - CH1 - Introduction to compiler design.pptxCD - CH1 - Introduction to compiler design.pptx
CD - CH1 - Introduction to compiler design.pptx
ZiyadMohammed17
 
Embedded Programming..pnsnsjsejejwwjjwptx
Embedded Programming..pnsnsjsejejwwjjwptxEmbedded Programming..pnsnsjsejejwwjjwptx
Embedded Programming..pnsnsjsejejwwjjwptx
JayPatil347597
 
Module4.pdf ,...................................
Module4.pdf ,...................................Module4.pdf ,...................................
Module4.pdf ,...................................
chetanreddy2212
 
Embedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals masterEmbedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals master
Hossam Hassan
 
ECE-3567-Lecture-1-Spring-2025 for beginner
ECE-3567-Lecture-1-Spring-2025 for beginnerECE-3567-Lecture-1-Spring-2025 for beginner
ECE-3567-Lecture-1-Spring-2025 for beginner
MahmoudElsamanty
 
embeddedsystems-100429081552-phpapp01.pdf
embeddedsystems-100429081552-phpapp01.pdfembeddedsystems-100429081552-phpapp01.pdf
embeddedsystems-100429081552-phpapp01.pdf
Ashwin180668
 
Introduction to Computer Softwares
Introduction to Computer SoftwaresIntroduction to Computer Softwares
Introduction to Computer Softwares
Naresh Dubey
 
EMBEDDED SYSTEMS SYBSC IT SEM IV UNIT V Embedded Systems Integrated Developme...
EMBEDDED SYSTEMS SYBSC IT SEM IV UNIT V Embedded Systems Integrated Developme...EMBEDDED SYSTEMS SYBSC IT SEM IV UNIT V Embedded Systems Integrated Developme...
EMBEDDED SYSTEMS SYBSC IT SEM IV UNIT V Embedded Systems Integrated Developme...
Arti Parab Academics
 
Introductions to Design Logic.pptx IT level
Introductions to Design Logic.pptx IT levelIntroductions to Design Logic.pptx IT level
Introductions to Design Logic.pptx IT level
gadisaadamu101
 
UNIT - 1jhjhjbkjhkjhkjhkjhkjhhkkhhh.pptx
UNIT - 1jhjhjbkjhkjhkjhkjhkjhhkkhhh.pptxUNIT - 1jhjhjbkjhkjhkjhkjhkjhhkkhhh.pptx
UNIT - 1jhjhjbkjhkjhkjhkjhkjhhkkhhh.pptx
RoselinLourd
 
Compilers and interpreters
Compilers and interpretersCompilers and interpreters
Compilers and interpreters
RAJU KATHI
 
01 Computer Basics (Ch1.1).pptx
01 Computer Basics (Ch1.1).pptx01 Computer Basics (Ch1.1).pptx
01 Computer Basics (Ch1.1).pptx
sarah380333
 
Assembly language programming implemenation
Assembly language programming implemenationAssembly language programming implemenation
Assembly language programming implemenation
FazalHameed14
 
Computer Programming In C.pptx
Computer Programming In C.pptxComputer Programming In C.pptx
Computer Programming In C.pptx
chouguleamruta24
 
Namdeo Kapale Sanjivani College of Engineering KopaCFP_UNIT1_24-25.pdf
Namdeo Kapale Sanjivani College of Engineering KopaCFP_UNIT1_24-25.pdfNamdeo Kapale Sanjivani College of Engineering KopaCFP_UNIT1_24-25.pdf
Namdeo Kapale Sanjivani College of Engineering KopaCFP_UNIT1_24-25.pdf
NAMDEO5
 
Python-unit -I.pptx
Python-unit -I.pptxPython-unit -I.pptx
Python-unit -I.pptx
crAmth
 
Introduction to Computer, Programming languages , Networks and Internet.pptx
Introduction to Computer, Programming languages , Networks and Internet.pptxIntroduction to Computer, Programming languages , Networks and Internet.pptx
Introduction to Computer, Programming languages , Networks and Internet.pptx
SheharBano86
 
4_5802928814682016556.pptx
4_5802928814682016556.pptx4_5802928814682016556.pptx
4_5802928814682016556.pptx
AshenafiGirma5
 
CD - CH1 - Introduction to compiler design.pptx
CD - CH1 - Introduction to compiler design.pptxCD - CH1 - Introduction to compiler design.pptx
CD - CH1 - Introduction to compiler design.pptx
ZiyadMohammed17
 
Ad

Recently uploaded (20)

How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
Engage Donors Through Powerful Storytelling.pdf
Engage Donors Through Powerful Storytelling.pdfEngage Donors Through Powerful Storytelling.pdf
Engage Donors Through Powerful Storytelling.pdf
TechSoup
 
Introduction-to-Communication-and-Media-Studies-1736283331.pdf
Introduction-to-Communication-and-Media-Studies-1736283331.pdfIntroduction-to-Communication-and-Media-Studies-1736283331.pdf
Introduction-to-Communication-and-Media-Studies-1736283331.pdf
james5028
 
THE STG QUIZ GROUP D.pptx quiz by Ridip Hazarika
THE STG QUIZ GROUP D.pptx   quiz by Ridip HazarikaTHE STG QUIZ GROUP D.pptx   quiz by Ridip Hazarika
THE STG QUIZ GROUP D.pptx quiz by Ridip Hazarika
Ridip Hazarika
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
APM Midlands Region April 2025 Sacha Hind Circulated.pdf
APM Midlands Region April 2025 Sacha Hind Circulated.pdfAPM Midlands Region April 2025 Sacha Hind Circulated.pdf
APM Midlands Region April 2025 Sacha Hind Circulated.pdf
Association for Project Management
 
Operations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdfOperations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdf
Arab Academy for Science, Technology and Maritime Transport
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
Exercise Physiology MCQS By DR. NASIR MUSTAFA
Exercise Physiology MCQS By DR. NASIR MUSTAFAExercise Physiology MCQS By DR. NASIR MUSTAFA
Exercise Physiology MCQS By DR. NASIR MUSTAFA
Dr. Nasir Mustafa
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Grade 2 - Mathematics - Printable Worksheet
Grade 2 - Mathematics - Printable WorksheetGrade 2 - Mathematics - Printable Worksheet
Grade 2 - Mathematics - Printable Worksheet
Sritoma Majumder
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
"Basics of Heterocyclic Compounds and Their Naming Rules"
"Basics of Heterocyclic Compounds and Their Naming Rules""Basics of Heterocyclic Compounds and Their Naming Rules"
"Basics of Heterocyclic Compounds and Their Naming Rules"
rupalinirmalbpharm
 
dynastic art of the Pallava dynasty south India
dynastic art of the Pallava dynasty south Indiadynastic art of the Pallava dynasty south India
dynastic art of the Pallava dynasty south India
PrachiSontakke5
 
SPRING FESTIVITIES - UK AND USA -
SPRING FESTIVITIES - UK AND USA            -SPRING FESTIVITIES - UK AND USA            -
SPRING FESTIVITIES - UK AND USA -
Colégio Santa Teresinha
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
Engage Donors Through Powerful Storytelling.pdf
Engage Donors Through Powerful Storytelling.pdfEngage Donors Through Powerful Storytelling.pdf
Engage Donors Through Powerful Storytelling.pdf
TechSoup
 
Introduction-to-Communication-and-Media-Studies-1736283331.pdf
Introduction-to-Communication-and-Media-Studies-1736283331.pdfIntroduction-to-Communication-and-Media-Studies-1736283331.pdf
Introduction-to-Communication-and-Media-Studies-1736283331.pdf
james5028
 
THE STG QUIZ GROUP D.pptx quiz by Ridip Hazarika
THE STG QUIZ GROUP D.pptx   quiz by Ridip HazarikaTHE STG QUIZ GROUP D.pptx   quiz by Ridip Hazarika
THE STG QUIZ GROUP D.pptx quiz by Ridip Hazarika
Ridip Hazarika
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
Exercise Physiology MCQS By DR. NASIR MUSTAFA
Exercise Physiology MCQS By DR. NASIR MUSTAFAExercise Physiology MCQS By DR. NASIR MUSTAFA
Exercise Physiology MCQS By DR. NASIR MUSTAFA
Dr. Nasir Mustafa
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Grade 2 - Mathematics - Printable Worksheet
Grade 2 - Mathematics - Printable WorksheetGrade 2 - Mathematics - Printable Worksheet
Grade 2 - Mathematics - Printable Worksheet
Sritoma Majumder
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
"Basics of Heterocyclic Compounds and Their Naming Rules"
"Basics of Heterocyclic Compounds and Their Naming Rules""Basics of Heterocyclic Compounds and Their Naming Rules"
"Basics of Heterocyclic Compounds and Their Naming Rules"
rupalinirmalbpharm
 
dynastic art of the Pallava dynasty south India
dynastic art of the Pallava dynasty south Indiadynastic art of the Pallava dynasty south India
dynastic art of the Pallava dynasty south India
PrachiSontakke5
 
Ad

Embedded programming Embedded programming (1).pptx

  • 1. Embedded Systems By Abebe B. Embedded programming
  • 2. Definition of Embedded Systems Programming • Embedded systems programming involves designing and developing software for embedded systems. • This software is typically written in low-level languages such as C and assembly language and is optimized for the specific hardware and application requirements of the system.
  • 3. Embedded Systems Programming • Embedded systems programming refers to the development of software for embedded systems, which are computer systems that are integrated into other devices or products. • These systems are designed to perform specific functions, and they often have limited resources, including memory, processing power, and energy. • Embedded systems programming is essential for developing systems that are reliable, efficient, and cost-effective.
  • 4. Embedded Languages  Some of the most commonly used programming languages for embedded systems programming include:  C: • C Programming is a widely used programming language for embedded systems programming. • It provides direct access to system resources and is well-suited for systems with limited resources.  Assembly language: • Assembly language is a low-level programming language that provides direct access to system resources. • It is often used for systems with very limited resources or for performance-critical applications.  C++: • C++ is a high-level programming language that is often used for embedded systems programming. • It provides object-oriented programming features and can be used to develop complex systems.
  • 5. Embedded Languages • More than any other, C has become the language of embedded programmers. • This has not always been the case, and it will not continue to be so forever. • However, at this time, C is the closest thing there is to a standard in the embedded world. – Explain why C ?
  • 6. Embedded Languages • It is surprising to find that one language has proven itself appropriate for both 8-bit and 64-bit processors; in systems with bytes, kilobytes, and megabytes of memory; • Of course, C is not without advantages.
  • 7. Embedded Languages • C is – small and fairly simple to learn, – compilers are available for almost every processor in use today, and – there is a very large body of experienced C programmers. • In addition, it has the benefit of processor- independence, which allows programmers to concentrate on algorithms and applications, rather than on the details of a particular processor architecture. • However, many of these advantages apply equally to other high-level languages. – So why has C succeeded where so many other languages have largely failed?
  • 8. Embedded Languages • Perhaps the greatest strength of C-and the thing that sets it apart from languages like Pascal and FORTRAN- is that it is a very "low-level" high-level language. • C gives embedded programmers an extraordinary degree of direct hardware control without sacrificing the benefits of high-level languages. • The "low-level“ nature of C was a clear intention of the language's creators.
  • 9. Embedded Systems Programming Tools • Embedded systems programming requires specialized tools to develop, test, and debug software for these systems. • These tools include: – Integrated development environments (IDEs): • IDEs provide a comprehensive development environment for embedded systems programming. • They typically include a code editor, compiler, debugger, and other tools for developing and testing software. – Cross-compilers: • Cross-compilers are used to compile code for a different platform than the one on which the compiler is running. – Emulators and simulators: • Emulators and simulators are used to test software on a virtual environment that emulates the hardware and software of the target system. • They are often used for testing software before it is deployed to the target system.
  • 10. Embedded Systems Programming Best Practices • Embedded systems programming requires careful attention to detail and a focus on writing efficient and reliable code. • To develop software for embedded systems effectively, developers should follow best practices, including: – Writing Efficient Code • Writing efficient code is critical for embedded systems, as these systems often have limited resources. • Developers should focus on writing code that is optimized for the specific hardware and application requirements of the system and should avoid using unnecessary resources.
  • 11. Arduino UNO Board • The Arduino UNO is a standard board of Arduino. • Arduino UNO is based on an ATmega328P microcontroller. It is easy to use compared to other boards, such as the Arduino Mega board, etc. • The board consists of digital and analog Input/Output pins (I/O), shields, and other circuits. • The Arduino UNO includes 6 analog pin inputs, 14 digital pins, a USB connector, a power jack, and an ICSP (In-Circuit Serial Programming) header. • The IDE is common to all available boards of Arduino.
  • 12. Arduino UNO Board • The Arduino board is shown below:
  • 13. Arduino UNO Board • The components of Arduino UNO board are shown below:
  • 14. Arduino UNO Pinout • The Arduino UNO Board, with the specification of pins, is shown below:
  • 15. Your First Embedded Program • Embedded programmers must be self-reliant. They must always begin each new project with the assumption that nothing works-that all they can rely on is the basic syntax of their programming language. • Even the standard library routines might not be available to them. These are the auxiliary functions- like printf and scanf -that most other programmers take for granted.
  • 16. Your First Embedded Program “Hello, World” • Every embedded system has at least one LED that could be controlled by software. • So my substitute for the "Hello, World!" program has been one that blinks an LED at a rate of 1 Hz (one complete on-off cycle per second). • Typically, the code required to turn an LED on and off is limited to a few lines of C or assembly, so there is very little room for programming errors to occur.
  • 18. setup() • The setup() function is called when a sketch starts. Use it to initialize variables, pin modes, start using libraries, etc. • The setup() function will only run once, after each powerup or reset of the Arduino board. Example Code void setup() { // initialize digital pin LED_BUILTIN OR PIN13 as an output. pinMode(LED_BUILTIN, OUTPUT); } void loop() {.......}
  • 19. loop() • After creating a setup() function, which initializes and sets the initial values, the loop() function does precisely what its name suggests, and loops consecutively, allowing your program to change and respond. • Use it to actively control the Arduino board. Example Code void setup() {………..} void loop() { digitalWrite(LED_BUILTIN, HIGH); delay(1000); digitalWrite(LED_BUILTIN, LOW); delay(1000); }
  • 20. Your First Embedded Program “turn an LED on and off” // the setup function runs once when you press reset or power the board void setup() { // initialize digital pin LED_BUILTIN as an output. pinMode(LED_BUILTIN, OUTPUT); } // the loop function runs over and over again forever void loop() { digitalWrite(LED_BUILTIN, HIGH); // turn the LED ON (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(LED_BUILTIN, LOW); // turn LED OFF (LOW is the voltage level) delay(1000); // wait for a second }
  • 21. The Role of the Infinite Loop • One of the most fundamental differences between programs developed for embedded systems and those written for other computer platforms is that the embedded programs almost always end with an infinite loop. • Typically, this loop surrounds a significant part of the program’s functionality-as it does in the Blinking LED program. • The infinite loop is necessary because the embedded software's job is never done. It is intended to be run until either the world comes to an end or the board is reset, whichever happens first.
  • 22. Compiling, Linking, and Locating The Build Process
  • 23. The Build Process • The process of converting the source code representation of your embedded software into an executable binary image involves three distinct steps. – First, each of the source files must be compiled or assembled into an object file. – Second, all of the object files that result from the first step must be linked together to produce a single object file, called the relocatable program. – Finally, physical memory addresses must be assigned to the relative offsets within the relocatable program in a process called relocation. – The result of this third step is a file that contains an executable binary image that is ready to be run on the embedded system.
  • 24. The embedded software development process
  • 25. The embedded software development process • Object file:- – It is a specially formatted binary file that contains the set of instructions and data resulting from the language translation process. Although parts of this file contain executable code, the object file is not intended to be executed directly. – There is also usually a symbol table somewhere in the object file that contains the names and locations of all the variables and functions referenced within the source file. – Parts of this table may be incomplete, however, because not all of the variables and functions are always defined in the same file. – These are the symbols that refer to variables and functions defined in other source files. And it is up to the linker to resolve such unresolved references.
  • 26. The embedded software development process
  • 27. The embedded software development process • Each of the steps of the embedded software build process is a transformation performed by software running on a general-purpose computer. • The compiler, assembler, linker, and locator are all pieces of software that run on a host computer, rather than on the embedded system itself. • Yet, despite the fact that they run on some other computer platform, these tools combine their efforts to produce an executable binary image that will execute properly only on the target embedded system.
  • 28. The split between host and target
  • 29. Compiling • The job of a compiler is mainly to translate programs written in some human-readable language into an equivalent set of opcodes for a particular processor. • Of course, each processor has its own unique machine language, so you need to choose a compiler that is capable of producing programs for your specific target processor.
  • 30. Compiling • In the embedded systems case, this compiler almost always runs on the host computer. It simply doesn't make sense to execute the compiler on the embedded system itself. • A compiler such as this-that runs on one computer platform and produces code for another-is called a cross-compiler. • The use of a cross-compiler is one of the defining features of embedded software development.
  • 31. Linking • All of the object files resulting from step one must be combined in a special way before the program can be executed. • The object files themselves are individually incomplete, most notably in that some of the internal variable and function references have not yet been resolved. • The job of the linker is to combine these object files and, in the process, to resolve all of the unresolved symbols.
  • 32. Linking • The output of the linker is a new object file that contains all of the code and data from the input object files and is in the same object file format. • It does this by merging the text, data, and bss sections of the input files.
  • 33. Locating • The tool that performs the conversion from relocatable program to executable binary image is called a locator. • It takes responsibility for the easiest step of the three. In fact, you will have to do most of the work in this step yourself, by providing information about the memory on the target board as input to the locator. • The locator will use this information to assign physical memory addresses to each of the code and data sections within the relocatable program. • It will then produce an output file that contains a binary memory image that can be loaded into the target ROM.
  • 34. Getting to Know the Hardware • Before writing software for an embedded system, you must first be familiar with the hardware on which it will run. • At first, you just need to understand the general operation of the system. • Whenever you receive a new board, you should take some time to read whatever documents have been provided with it. • If the board is an off-the-shelf product, it might arrive with a "User's Guide" or "Programmer's Manual" that has been written with the software developer in mind.
  • 36. Importance of Embedded Systems Programming • Embedded systems are used in a wide range of products, including automobiles, medical devices, consumer electronics, and industrial equipment. • These systems must be reliable, efficient, and cost-effective, and embedded systems programming plays a critical role in achieving these goals. • By optimizing software for the specific hardware and application requirements of the system, developers can improve system performance, reduce energy consumption, and minimize costs.