0% found this document useful (0 votes)
8 views

ES Notes Complete

A system is defined as an arrangement of components working together under a set of rules, while an embedded system is a microcontroller-based system designed for specific tasks, consisting of hardware, application software, and often a real-time operating system. Embedded systems are characterized by their single-functionality, tight constraints, and real-time responsiveness, and they can be classified based on performance requirements or microcontroller types. The embedded system lifecycle includes phases from product specification to maintenance, and various types of embedded processors exist, including general-purpose processors, microprocessors, and microcontrollers.

Uploaded by

Drishti Rani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

ES Notes Complete

A system is defined as an arrangement of components working together under a set of rules, while an embedded system is a microcontroller-based system designed for specific tasks, consisting of hardware, application software, and often a real-time operating system. Embedded systems are characterized by their single-functionality, tight constraints, and real-time responsiveness, and they can be classified based on performance requirements or microcontroller types. The embedded system lifecycle includes phases from product specification to maintenance, and various types of embedded processors exist, including general-purpose processors, microprocessors, and microcontrollers.

Uploaded by

Drishti Rani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

System

A system is an arrangement in which all its unit assemble work together according to a set of
rules. It can also be defined as a way of working, organizing or doing one or many tasks
according to a fixed plan. For example, a watch is a time displaying system. Its components
follow a set of rules to show time. If one of its parts fails, the watch will stop working. So we
can say, in a system, all its subcomponents depend on each other.

Embedded System

As its name suggests, Embedded means something that is attached to another thing. An
embedded system can be thought of as a computer hardware system having software embedded
in it. An embedded system can be an independent system or it can be a part of a large system.
An embedded system is a microcontroller or microprocessor based system which is designed
to perform a specific task. For example, a fire alarm is an embedded system; it will sense only
smoke.

An embedded system has three components −

 It has hardware.
 It has application software.
 It has Real Time Operating system (RTOS) that supervises the application software and
provide mechanism to let the processor run a process as per scheduling by following a
plan to control the latencies. RTOS defines the way the system works. It sets the rules
during the execution of application program. A small scale embedded system may not
have RTOS.

So we can define an embedded system as a Microcontroller based, software driven, reliable,


real-time control system.

Characteristics of an Embedded System

 Single-functioned − An embedded system usually performs a specialized operation


and does the same repeatedly. For example: A pager always functions as a pager.
 Tightly constrained − All computing systems have constraints on design metrics, but
those on an embedded system can be especially tight. Design metrics is a measure of
an implementation's features such as its cost, size, power, and performance. It must be
of a size to fit on a single chip, must perform fast enough to process data in real time
and consume minimum power to extend battery life.
 Reactive and Real time − Many embedded systems must continually react to changes
in the system's environment and must compute certain results in real time without any
delay. Consider an example of a car cruise controller; it continually monitors and reacts
to speed and brake sensors. It must compute acceleration or de-accelerations repeatedly
within a limited time; a delayed computation can result in failure to control of the car.
 Microprocessors based − It must be microprocessor or microcontroller based.
 Memory − It must have a memory, as its software usually embeds in ROM. It does not
need any secondary memories in the computer.
 Connected − It must have connected peripherals to connect input and output devices.
 HW-SW systems − Software is used for more features and flexibility. Hardware is used
for performance and security.
Embedded Systems are classified based on the two factors i.e.

1. Based on Performance and Functional Requirements it is divided into 4 types as follows


a. Real-Time Embedded Systems :
A Real-Time Embedded System is strictly time specific which means these embedded systems
provides output in a particular/defined time interval. These type of embedded systems provide
quick response in critical situations which gives most priority to time based task performance
and generation of output. That’s why real time embedded systems are used in defense sector,
medical and health care sector, and some other industrial applications where output in the right
time is given more importance.
Further this Real-Time Embedded System is divided into two types i.e.
 Soft Real Time Embedded Systems –
In these types of embedded systems time/deadline is not so strictly followed. If deadline
of the task is passed (means the system didn’t give result in the defined time) still result
or output is accepted.
 Hard Real-Time Embedded Systems –
In these types of embedded systems time/deadline of task is strictly followed. Task must
be completed in between time frame (defined time interval) otherwise result/output may
not be accepted.
Examples : Traffic control system, Military usage in defence sector, Medical usage in health
sector

b. Stand Alone Embedded Systems :


Stand Alone Embedded Systems are independent systems which can work by
themselves they don’t depend on a host system. It takes input in digital or analog form
and provides the output.
Examples : MP3 players, Microwave ovens, calculator

c. Networked Embedded Systems :


Networked Embedded Systems are connected to a network which may be wired or
wireless to provide output to the attached device. They communicate with embedded
web server through network.
Examples :Home security systems, ATM machine, Card swipe machine

d. Mobile Embedded Systems :


Mobile embedded systems are small and easy to use and requires less resources. They
are the most preferred embedded systems. In portability point of view mobile embedded
systems are also best.
Examples : MP3 player, Mobile phones, Digital Camera

2. Based on Performance and micro-controller it is divided into 3 types as follows :


a. Small Scale Embedded Systems :
Small Scale Embedded Systems are designed using an 8-bit or 16-bit micro-controller.
They can be powered by a battery. The processor uses very less/limited resources of
memory and processing speed. Mainly these systems does not act as an independent
system they act as any component of computer system but they did not compute and
dedicated for a specific task.
b. Medium Scale Embedded Systems :
Medium Scale Embedded Systems are designed using an 16-bit or 32-bit micro-
controller. These medium Scale Embedded Systems are faster than that of small Scale
Embedded Systems. Integration of hardware and software is complex in these
systems. Java, C, C++ are the programming languages are used to develop medium
scale embedded systems. Different type of software tools like compiler, debugger,
simulator etc are used to develop these type of systems.

c. Sophisticated or Complex Embedded Systems :


Sophisticated or Complex Embedded Systems are designed using multiple 32-bit or 64-
bit micro-controller. These systems are developed to perform large scale complex
functions. These systems have high hardware and software complexities. We use both
hardware and software components to design final systems or hardware products.

General Purpose VS Embedded System

Category Computer Embedded device


Description A computer is a combination An embedded device is a part of an
of hardware and software integrated system thatAn embedded is
resources which integrate formed as an combination of computer
together and provides various hardware and software for a specific
functionalities to the user. function and which can operate without
human interaction.
Human A computer needs Human Embedded device does not need Human
Interaction Interaction to perform tasks. Interaction to perform tasks.
Types based Analog computer, Digital Small Scale Embedded System,
on architecture computer, Hybrid computer, Medium Scale Embedded Systems,
Harvard architecture, Von Sophisticated or Complex Embedded
Neumann architecture, Systems
Reduced instruction set
computer
Parts It has 2 parts: Hardware and It has 3 parts: Hardware, Firmware and
Software. Software.
Tasks It can perform many tasks. It performs limited tasks.
Cost to user The user has to pay more for The user incurs lesser cost for an
a computer. embedded system.
Peripherals Computers have peripherals Embedded Devices have peripherals
such as keyboard and mouse, such as Serial Communication
display, printer, Hard disk Interfaces (SCI), Synchronous Serial
drives, floppy disk drives, Communication Interface, Universal
optical disc drives etc. Serial Bus (USB), Multi Media Cards
(SD cards, Compact Flash) etc.
Purpose Computers can be Embedded Devices are made only for a
reprogrammed to for a new specific set of purposes.
purpose.
Power Computer needs more Embedded Device needs lesser
Consumption operational power than operational power than a Computer.
Embedded Devices.
Complexity Computers are more complex Embedded Devices are less complex
devices than Embedded devices than Computers.
Devices.
Need of Computers may be installed Embedded Devices only exist inside
another device in other devices but are self- other Systems.
sufficient to exist.
Usage Computers are more Difficult Embedded are easier to use than
Difficulty when used, compared to an Computers.
Embedded System.
User Interfaces It requires more user It requires lesser to no user interface
interface than Embedded than Computers.
Devices.
Time Computers are not time Embedded Devices are time specific.
Specificity specific. They may need to The tasks assigned to them need to be
perform tasks which are not performed within a specific time frame.
time bound and take days to
perform as well.
Size Computers are usually bigger Embedded Devices are smaller in size
in size with larger hardware than Computers, with limited hardware.
and input output devices
attached to it.
Developed in 1833 A.D. 1965 A.D.
Developer Charles Babbage Charles Stark Draper
Memory Computers have larger Embedded Devices need lesser
Requirement memory requirement due to a Memory.
lot of storage of data.

Embedded System Lifecycle


Time flows from left and proceeds through seven phases:
•Product specification
•Partitioning of design into its software and hardware components
•Iteration and refinement of the partitioning
•Independent hardware and software design tasks
•Integration of the hardware and software components
•Product testing and release
•On going maintenance upgrading

The embedded design process is not as simple as figure depicts. A considerable amount of
iteration and optimization occurs within phases and between phases. Defects found in later
stages often cause us to “go back”. For example, when product testing reveals performance
deficiencies that render the design noncompetitive, we might have to
rewrite algorithms, redesign custom hardware such as application specific integrated circuits
(ASIC) for better performance - speed up the processor, choose a new processor and so on.

Product specifications:
Design of any system starts at its specifications, specifications uses a language, which may be
simple English, some programming languages like C, or it may be some formal techniques
using petri nets, state chart and so on.
The choice of the microprocessor and some other key elements of a design are important

Hardware/software partitioning:
Embedded design involve both hardware and software components, we have to decide which
portion of the problem will be solved in hardware and which in software. This choice is called
the “partitioning decision”. A general purpose processor will have software implementation of
the task, while a dedicated processor can be implemented on FPGA (field programmable gate
array) or ASIC (application specific integrated circuit), to have better performance.
The partitioning decision is a complex optimization problem. Many embedded designs are
required to be
•Price sensitive
•Leading edge performers
•Non standard
•Market competitive
•Proprietary

Iteration and implementation:


The iteration and implementation part of the process
represents a somewhat blurred area between implementation and hardware/software partitioni
ng in which the hardware and software paths diverge. This phase represents the early design
work before the hardware and software teams built “the wall” between them.
The hardware designers might be using simulation tools such as architectural
simulators, to model the performance of the processor and memory systems. The software
designers are probably running code bench marks on self-contain single board computers that
use the target microprocessors.

Detailed hardware and software design:


Hardware design involves
•Selection of the processor: micro-controller, microprocessor, digital signal processor
•Calculation of memory requirements and the type of memory such as RAM (SRAM, DRAM),
EPROM, flash memory
•Identification of input devices such as sensors, keyboard and keypad
•Identification of output devices such as LED and LCD
•Identification of communication interfaces such as RS232, Ethernet, USB
•Identification of test points
•Identification of supply voltages and current requirements for designing the power supply unit.

Software design involves


•Working out of the details of the processing to be done by the embedded system
•Decomposition of the processing into different task
•Deciding on the use of an embedded operating system

Hardware/Software integration:
The hardware/software integration phase of the development cycle must have
special tools and methods to manage the complexity. The process of integrating embedded
software and hardware is exercise in debugging and discovery
Debugging an embedded system:
Debugging an embedded system is similar to debugging a host based applications. If the target
system contains an available communication channel to the host computer, the debugger can
exist as two pieces: a debug kernel in the target system and a host application that
communicates with it and manages the source database and symbol tables. Many embedded
systems are impossible to debug unless they are operating at full speed. Running an embedded
program under a debugger can slow the program down by one or more orders of magnitude.
In general, there are three requirements for debugging an embedded or real-time system:
•Run control- the ability to start, stop, peak, and poke the processor and memory.
•Memory substitution- replacing ROM-based memory with RAM for rapid and easy
code download, debug, and repair cycles.
•Real-time analysis- following code flow in real time with real-time trace analysis

Product testing and release:


Testing is the most difficult and time consuming process and important process. “Testing is
the process to reduce the risk associated with the residual defects”. There are different types of
testing:
Black box testing: Functionality of the product is tested
White box testing: each and every line of code is tested
Performance testing: checks whether the system is meeting the time constraints as per the
requirements

Maintenance and upgrading:


Reliability: The measure of how much percentage the system can rely upon the proper
functionality of the system.
MTBF(Mean time between failures) and MTTR (mean time to reapair) are the terms used in
defining system reliability
Maintainability: It deals with support maintenance in case of technical issues and product
failure.
As the reliability of the system increases the chances of failure reduces, then the maintainability
also reduces.
The ideal value of availability of any embedded system design is Ai=MTBF+MTTR
Processor Selection

Types of Embedded Processors


Below are the different types of embedded processors:
1. General Purpose Processors (GPPs)
General purpose processors, also known as central processing units (CPUs), are processors that
are designed to be capable of executing a wide range of tasks. They are used in computers and
other devices that require high-performance processing capabilities. Some features of general-
purpose processors include:
Instruction set: General purpose processors have a large and complex instruction set, which
allows them to perform a wide range of tasks.
Multi-core: Many general-purpose processors are multi-core, which means they have multiple
processors on a single chip. This allows them to perform multiple tasks concurrently,
improving performance.
Clock speed: The clock speed of a processor determines how fast it can execute instructions.
General-purpose processors typically have high clock speeds, which allows them to perform
tasks quickly.
Cache: General-purpose processors have one or more levels of cache, which is a small amount
of high-speed memory that is used to store frequently accessed data. This helps to improve the
performance of the processor.
Compatibility: General-purpose processors are typically compatible with a wide range of
operating systems and software applications.
Virtualization: Many general-purpose processors support virtualization, which allows them
to run multiple virtual machines on a single physical machine.
Power consumption: General-purpose processors can have high power consumption, which
can be a concern in devices where power is limited.

2. Microprocessors
A microprocessor is a processor that is contained on a microchip, or integrated circuit (IC). It
is a central processing unit (CPU) that executes the instructions of a computer program. Some
features of microprocessors include:
Instruction set: Microprocessors have a specific instruction set that defines the operations that
they can perform.
Clock speed: The clock speed of a microprocessor determines how fast it can execute
instructions. Microprocessors typically have high clock speeds, which allows them to perform
tasks quickly.
Data bus: The data bus is a communication pathway that is used to transfer data between the
microprocessor and other components in a system.
Address bus: The address bus is a communication pathway that is used to transfer the address
of a memory location between the microprocessor and other components in a system.
Cache: Many microprocessors have one or more levels of cache, which is a small amount of
high-speed memory that is used to store frequently accessed data. This helps to improve the
performance of the microprocessor.
Power consumption: Microprocessors can have relatively high power consumption, which
can be a concern in devices where power is limited.
Size: Microprocessors are designed to be small, as they are typically used in devices where
space is at a premium.
Cost: Microprocessors can vary in cost depending on their capabilities and features.

3. Microcontrollers
A microcontroller is a small, low-power computer that is contained in a single integrated circuit
(IC). It is a type of embedded processor that is used in a wide range of devices, including
consumer electronics, industrial control systems, and automotive systems. Some features of
microcontrollers include:
On-chip peripherals: Many microcontrollers have a variety of on-chip peripherals, such as
timers, serial ports, and analog-to-digital converters, which allow them to interface with
external devices.
Memory: Microcontrollers have both program memory, which stores the instructions that are
executed by the processor, and data memory, which is used to store variables and other data.
Input/output (I/O) pins: Microcontrollers have a set of I/O pins that can be used to interface
with external devices, such as sensors or actuators.
Low power consumption: Microcontrollers are designed to be low-power, which makes them
suitable for use in battery-powered devices.
Cost: Microcontrollers are typically less expensive than general-purpose processors, as they
are designed for specific tasks and do not have as many capabilities.
Size: Microcontrollers are small, which makes them suitable for use in compact devices.
Flexibility: Microcontrollers are highly flexible and can be programmed to perform a wide
range of tasks.

4. Digital Signal Processor (DSP)


Digital signal processors (DSPs) are specialized microprocessors that are designed to process
digital signals. They are used in a wide range of applications, including audio and video
processing, telecommunications, and control systems. Some key features of DSPs include:
High-speed processing: DSPs are designed to process large amounts of data quickly, making
them well-suited for real-time applications.
Parallel processing: Many DSPs are designed to perform multiple operations simultaneously,
which can increase their processing speed and efficiency.
Hardware support for common operations: DSPs often include specialized hardware to
support common operations, such as filtering and FFTs (Fast Fourier Transforms), which can
reduce the processing overhead and improve performance.
Low power consumption: DSPs are often designed to be energy-efficient, making them well-
suited for battery-powered applications.
Programmability: Most DSPs are programmable, which means that they can be customized
to perform specific tasks. This allows them to be used in a wide range of applications.

5. Single-Purpose Embedded Processor


Single-purpose embedded processors, also known as application-specific embedded
processors, are microprocessors that are designed to perform a specific task or set of tasks.
They are used in a wide range of applications, including automotive systems, industrial control
systems, and consumer electronics. Some key features of single-purpose embedded processors
include:
Specialized functionality: Single-purpose embedded processors are designed to perform a
specific task or set of tasks, making them well-suited for applications that require highly
specialized functionality.
Low power consumption: Single-purpose embedded processors are often designed to be
energy-efficient, making them well-suited for battery-powered applications.
Compact size: Single-purpose embedded processors are often designed to be small and
lightweight, making them well-suited for applications where space is limited.
High reliability: Single-purpose embedded processors are often designed to be highly reliable,
as they are typically used in mission-critical applications where downtime is not an option.
Low cost: Single-purpose embedded processors are often less expensive than general-purpose
processors, as they are designed to perform a specific set of tasks and do not require the same
level of flexibility and programmability.
6. System-on-Chip (SoC)
System-on-Chip (SoC) is an integrated circuit that integrates all components of a computer or
other electronic system onto a single chip. Some key features of SoCs include:
Integration: SoCs integrate all or most of the components of a system onto a single chip, which
can reduce the size and complexity of the system.
Low power consumption: SoCs can be designed to be highly power efficient, which can be
useful in battery-powered or energy-sensitive applications.
High performance: SoCs can be designed for high performance, making them suitable for
applications that require a lot of processing power.
Customization: SoCs can be customized for specific applications, allowing them to be
optimized for the specific requirements of those applications.
Reduced component count: Because many components are integrated onto a single chip,
SoCs can reduce the component count of a system, which can make the system simpler and
easier to manufacture.

Hardware/ Software Co-Design


Memory Organization
Interfaces and peripherals
In order to communicate with peripherals and other microcontrollers, a number of de
facto standards are well established in the embedded world. Some of the external pins of the
microcontroller can be programmed to carry out communication with external peripherals
using specific protocols. A few of the common interfaces available on most architectures are:
 Asynchronous UART-based serial communication
 Serial Peripheral Interface (SPI) bus
 Inter-integrated circuit (I2C) bus
 Universal Serial Bus (USB)

Asynchronous UART-based serial communication


Asynchronous communication is provided by the Universal Asynchronous Receiver-
Transmitter (UART). These kind of interfaces, commonly simply known as serial ports, are
called asynchronous because they do not need to share a clock signal to synchronize the sender
and the receiver, but rather work on pre-defined clock rates that can be aligned while the
communication is ongoing. Microcontrollers may contain multiple UARTs that can be attached
to a specific set of pins upon request. Asynchronous communication is provided by UART as
a full-duplex channel, through two independent wires, connecting the RX pin of each endpoint
to the TX pin on the opposite side.
To properly understand each other, the systems at the two endpoints must set up the UART
using the same parameters. This includes the framing of the bytes on the wire, and the frame
rate. All of these parameters have to be known in advance by both endpoints in order to
correctly establish a communication channel. Despite being simpler than the other types of
serial communication, UART-based serial communication is still widely used in electronic
devices, particularly as an interface toward modems and GPS receivers. Furthermore, using
TTL-to-USB serial converters, it is easy to connect a UART to a console on the host machine,
which is often handy for providing log messages.

SPI
A different approach is SPI. Introduced in the late 1980s, this technology aimed to replace
asynchronous serial communication towards peripherals, by introducing a number of
improvements:
 Serial clock line to synchronize the endpoints
 Master-slave protocol
 One-to-many communication over the same three-wire bus
The master device, usually the microcontroller, shares the bus with one or more slaves. To
trigger the communication, a separate slave select (SS) signal is used to address each slave
connected to the bus. The bus uses two independent signals for data transfer, one per direction,
and a shared clock line that synchronizes the two ends of the communication. Due to the clock
line being generated by the master, the data transfer is more reliable, making it possible to
achieve higher bitrates than ordinary UART. One of the keys for the continued success of SPI
over multiple generations of microcontrollers is the low complexity required for the design of
slaves, which can be as simple as a single shift register. SPI is commonly used in sensor
devices, LCD displays, flash memory controllers, and network interfaces.

I2C
I2C is slightly more complex, and that is because it is designed with a different purpose in
mind: interconnecting multiple microcontrollers, as well as multiple slave devices, on the same
two-wire bus. The two signals are serial clock (SCL) and serial data (SDA). Unlike SPI or
UART, the bus is half-duplex, as the two directions of the flow share the same signal. Thanks
to a 7-bit slave-addressing mechanism incorporated in the protocol, it does not require
additional signals dedicated to the selection of the slaves. Multiple masters are allowed on the
same line, given that all the masters in the system follow the arbitration logic in the case of bus
contention.

USB
The USB protocol, originally designed to replace UART and include many protocols in the
same hardware connector, is very popular in personal computers, portable devices, and a huge
number of peripherals.
This protocol works in host-device mode, with one side of communication, the device,
exposing services that can be used by the controller, on the host side. USB transceivers present
in many microcontrollers can work in both modes. By implementing the upper layer of the
USB standards, different types of devices can be emulated by the microcontroller, such as serial
ports, storage devices, and point-to-point Ethernet interfaces, creating microcontroller-based
USB devices that can be connected to a host system.
If the transceiver supports host mode, the embedded system can act as a USB host and devices
can be connected to it. In this case, the system should implement device drivers and
applications to access the functionality provided by the device.
When both modes are implemented on the same USB controller, the transceiver works in on-
the-go (OTG) mode, and the selection and configuration of the desired mode can be done at
runtime.

IDE SELECTION

You can find many modern integrated development environments (IDEs) on the market with a
range of features and different price points. Many IDEs are open source, or free to use and
configure. The following are some criteria to consider when choosing an IDE:

 The programming language


The programming language you want to code in often dictates the choice of an IDE. Dedicated
IDEs have automation features that particularly suit the syntax of specific languages. On the
other hand, multi-language IDEs support multiple languages.

 The operating system


While most IDEs have multiple versions for different operating systems, they might work
better on specific platforms. For example, some IDEs can perform optimally on the Linux
platform but might be slow or difficult to use on other platforms.

 Automation features
The three common features in most IDES are the source code editor, build automation, and
debugger. Additional features may vary and can include the following:
Code editor UI enhancements
Automated testing features
Code deployment support via plugin integration
Code refactoring support
Application packaging support

 IDE customization
Some IDEs include the ability to customize workflows to match a developer's needs and
preferences. You can download and use plugins, extensions, and add-ons to customize your
programming experience.

Toolchain
A toolchain is the set of tools that compiles source code into executables that can run on your
target device, and includes a compiler, a linker, and run-time libraries. Initially, you need one
to build the other three elements of an embedded Linux system: the bootloader, the kernel, and
the root filesystem. It has to be able to compile code written in assembly, C, and C++ since
these are the languages used in the base open source packages.

Embedded Systems Programming


Embedded systems programming is the process of developing software for embedded systems.
This type of programming is different from traditional programming because it requires a deep
understanding of the hardware that the software will be running on. Applications for embedded
systems programming range from consumer electronics to industrial automation.

 C
The most widely used programming language for embedded devices is C. It is a low-level
language made to be quick and effective. C is used to develop software for microcontrollers,
which are small computers that are embedded in a wide range of devices. C is a powerful
language that allows developers to write code that is close to the hardware, which makes it
ideal for embedded systems programming.
C is a procedural language that provides low-level access to memory and hardware. It is a
language that is widely used in the development of operating systems, embedded systems, and
real-time systems. C is a language that is highly portable and can be used on a wide range of
hardware platforms.

 C++
C++ is a high-level programming language that is used in a wide range of applications,
including embedded systems programming. C++ is an extension of the C programming
language, and it includes features such as object-oriented programming and templates. C++ is
a popular choice for embedded systems programming because it is a powerful language that
allows developers to write efficient code.
C++ is a language that provides high-level abstractions that make it easier to write complex
software. It is a language that is widely used in the development of video games, operating
systems, and embedded systems. C++ is a language that is highly portable and can be used on
a wide range of hardware platforms.

 Assembly Language
Assembly language is a low-level programming language that is used to develop software for
microcontrollers. Assembly language is used to write code that is specific to the hardware that
it is running on. Assembly language is a powerful language that allows developers to write
code that is highly efficient and fast.
Assembly language is a language that provides low-level access to memory and hardware. It is
a language that is widely used in the development of operating systems, embedded systems,
and real-time systems. Assembly language is a language that is highly specific to the hardware
platform that it is running on.

 Python
Python is a high-level programming language that is used in a wide range of applications,
including embedded systems programming. Python is a popular choice for embedded systems
programming because it is easy to learn and use. Python is a powerful language that allows
developers to write code that is efficient and fast.
Python is a language that provides high-level abstractions that make it easier to write complex
software. It is a language that is widely used in the development of web applications, scientific
computing, and embedded systems. Python is a language that is highly portable and can be
used on a wide range of hardware platforms.

 Java
Java is a high-level programming language that is used in a wide range of applications,
including embedded systems programming. Java is a popular choice for embedded systems
programming because it is a powerful language that allows developers to write code that is
efficient and fast. Java is also a portable language, which means that it can run on a wide range
of hardware platforms.
Java is a language that provides high-level abstractions that make it easier to write complex
software. It is a language that is widely used in the development of web applications, enterprise
applications, and embedded systems. Java is a language that is highly portable and can be used
on a wide range of hardware platforms.
UNIT 2

General Purpose Processors (GPPs)


General purpose processors, also known as central processing units (CPUs), are processors that
are designed to be capable of executing a wide range of tasks. They are used in computers and
other devices that require high-performance processing capabilities. Some features of general-
purpose processors include:
Instruction set: General purpose processors have a large and complex instruction set, which
allows them to perform a wide range of tasks.
Multi-core: Many general-purpose processors are multi-core, which means they have multiple
processors on a single chip. This allows them to perform multiple tasks concurrently,
improving performance.
Clock speed: The clock speed of a processor determines how fast it can execute instructions.
General-purpose processors typically have high clock speeds, which allows them to perform
tasks quickly.
Cache: General-purpose processors have one or more levels of cache, which is a small amount
of high-speed memory that is used to store frequently accessed data. This helps to improve the
performance of the processor.
Compatibility: General-purpose processors are typically compatible with a wide range of
operating systems and software applications.
Virtualization: Many general-purpose processors support virtualization, which allows them
to run multiple virtual machines on a single physical machine.
Power consumption: General-purpose processors can have high power consumption, which
can be a concern in devices where power is limited.

Domain specific processor


A domain-specific processor efficiently executes tasks or applications within a particular
domain or application area.
It is optimized for a particular set of computations, workloads, or algorithms typically found in
a specialized domain, such as digital signal processing, graphics rendering, networking,
artificial intelligence or embedded systems.
Unlike general-purpose processors (GPPs) or central processing units (CPUs) that are designed
to handle a wide range of applications, domain-specific processors contain features,
instructions, and hardware components optimized for the specific computational requirements
and characteristics of that domain, enabling high-performance and/or energy-efficient
processing.
Domain-specific processors often incorporate specialized instruction sets, functional units, or
co-processors that accelerate that types of operations commonly found in their target domain.
For example, a domain-specific processor used for digital signal processing might have
dedicated hardware for performing multiply-accumulate (MAC) operations, SIMD (Single
Instruction, Multiple Data) instructions for parallel processing, or specialized instruction
extensions for efficient handling of audio or video data.

Why do we need domain specific processors?


Benefits of domain-specific processors include performance optimization, energy efficiency,
and reduced complexity. Indeed, domain-specific processors are designed to deliver high
performance for the specific tasks or algorithms within their domain. By focusing on specific
workloads and eliminating unnecessary overhead, they can achieve higher energy efficiency.
This is particularly useful for battery-powered or energy-constrained devices where
minimizing power consumption is crucial. Finally, by providing specialized instructions,
libraries, and tools tailored to the specific domain, it can be easier for developers to optimize
their applications and achieve the desired performance levels.

ASIC stands for Application Specific Integrated Circuit

It is specially built for a specific application or purpose. If compared to any other device, ASIC
has improved speed. Basically, it is an integrated circuit that’s been specified for one specific
purpose and is not software programmable to perform a wide variety of different tasks. These
are widely used in applications, including auto emission control, environmental monitoring,
and personal digital assistants. It often has an embedded CPU to manage suitable tasks.
ASIC Categories
 Programmable: These are not custom made, and can be run in the data center, campus,
or in a metro Ethernet environment. It is further subdivided into two categories.
FPGAs: These are complex and larger reconfigurable devices, which include programming
logic cells and interconnect. For Example Xilinx, Altera, QuikLogic, etc are some of the FPGA
companies
PLDs: These are the electronic devices used to build reconfigurable circuits. For
Example- GAL ROM, PROM, EPROM, EEPROM, etc.
 Full Custom: These are custom-made from scratch for a specific application. It is a
design methodology useful for integrated circuits. There are the resistors, transistors,
digital logic, capacitors, and analog circuits are positioned in the circuit layout. For
Example Microprocessor. It takes a minimum time of 8 weeks for normal
manufacturing and is quite expensive. Features- Maximum performance, minimized
area, and the highest degree of flexibility.
 Semi-Custom: These are customized partially so that they can perform the different
functions within the area of their general application. Basically, it is an alternative to
full-custom designs. It is further subdivided into two categories:
Gate Array Based: These have pre-defined transistors on the silicon wafer.
Standard Cell Based: Some logic gates such as AND gates, OR gates, multiplexers, flip-flops
are pre-designed by designers by using different configurations, standardized, and stored in the
form of a library, this is known as a standard cell library. The cell area or flexible block is made
up of standard cells arranged in the form of rows, with these flexible blocks mega cells like
microcontrollers or even microprocessors are used on-chip.

Processor Selection

There are a number of different factors that should be taken into consideration when assessing
a CPU to use in your embedded system. This criteria includes elements such as CPU
performance, power consumption, memory, supporting peripherals, industry requirements, and
overall costs. Performance, power consumption, and functionality of the unit should be the
primary parameters that guide your final decision.

Performance
The most important parameter to judge a CPU system is its performance. While you may be
bombarded with loads of values, comparisons, and benchmarks that show just how well
performing a processor is, you need to determine for yourself whether or not the unit will be
able to successfully address the particular needs of your application. You want the processor
to be fast and skillful enough to fulfil your requirements. A good way to select a CPU is to
shortlist a few options and run trial simulations with your code to formulate your own
benchmarks.

Memory
You will have to go for a processor that is able to support the entirety of your software program
on its onboard memory. Remember: most microcontrollers have a limited amount of onboard
address space, which is why you need to actively search for a solution that can accommodate
your program.

Power
Keep in mind that if you are investing in a processor with great performance, it is also going to
increase the power consumption. If you search around, you will be able to find solutions that
offer high performance with low power consumption.

Peripherals
The supporting peripherals that accompany your CPU are just as important as the unit itself.
Since you are paying an additional cost for them, you will want to maximize their potential.
Ideally, you will want to go with a processor whose peripherals overlap with the technology
your application requires for execution. This results in cost savings, which is a welcome bonus.

Costs
The costs associated with the CPU are very important to take into consideration. Not only
should the price of the unit itself fall within your budget, but you also need to think about the
training costs, supporting development tools, and peripherals you will need to maximize the
use of the processor. Make sure to check all the peripherals beforehand and determine whether
or not the system as a whole is worth the price.

RISC Processor
RISC stands for Reduced Instruction Set Computer Processor, a microprocessor
architecture with a simple collection and highly customized set of instructions. It is built to
minimize the instruction execution time by optimizing and limiting the number of instructions.
It means each instruction cycle requires only one clock cycle, and each cycle contains three
parameters: fetch, decode and execute. The RISC processor is also used to perform various
complex instructions by combining them into simpler ones. RISC chips require several
transistors, making it cheaper to design and reduce the execution time for instruction.
Examples of RISC processors are SUN's SPARC, PowerPC, Microchip PIC processors, RISC-
V.
Advantages of RISC Processor
 The RISC processor's performance is better due to the simple and limited number of
the instruction set.
 It requires several transistors that make it cheaper to design.
 RISC allows the instruction to use free space on a microprocessor because of its
simplicity.
 RISC processor is simpler than a CISC processor because of its simple and quick
design, and it can complete its work in one clock cycle.
Disadvantages of RISC Processor
 The RISC processor's performance may vary according to the code executed because
subsequent instructions may depend on the previous instruction for their execution in a
cycle.
 Programmers and compilers often use complex instructions.
 RISC processors require very fast memory to save various instructions that require a
large collection of cache memory to respond to the instruction in a short time.
 RISC Architecture
 It is a highly customized set of instructions used in portable devices due to system
reliability such as Apple iPod, mobiles/smartphones, Nintendo DS

Features of RISC Processor


 One cycle execution time: For executing each instruction in a computer, the RISC
processors require one CPI (Clock per cycle). And each CPI includes the fetch, decode
and execute method applied in computer instruction.
 Pipelining technique: The pipelining technique is used in the RISC processors to
execute multiple parts or stages of instructions to perform more efficiently.
 A large number of registers: RISC processors are optimized with multiple registers
that can be used to store instruction and quickly respond to the computer and minimize
interaction with computer memory.
 It supports a simple addressing mode and fixed length of instruction for executing the
pipeline.
 It uses LOAD and STORE instruction to access the memory location.
 Simple and limited instruction reduces the execution time of a process in a RISC.

CISC Processor
The CISC Stands for Complex Instruction Set Computer, developed by the Intel. It has a
large collection of complex instructions that range from simple to very complex and specialized
in the assembly language level, which takes a long time to execute the instructions. So, CISC
approaches reducing the number of instruction on each program and ignoring the number of
cycles per instruction. It emphasizes to build complex instructions directly in the hardware
because the hardware is always faster than software. However, CISC chips are relatively slower
as compared to RISC chips but use little instruction than RISC. Examples of CISC processors
are VAX, AMD, Intel x86 and the System/360.

Characteristics of CISC Processor


 The length of the code is shorts, so it requires very little RAM.
 CISC or complex instructions may take longer than a single clock cycle to execute the
code.
 Less instruction is needed to write an application.
 It provides easier programming in assembly language.
 Support for complex data structure and easy compilation of high-level languages.
 It is composed of fewer registers and more addressing nodes, typically 5 to 20.
 Instructions can be larger than a single word.
 It emphasizes the building of instruction on hardware because it is faster to create than
the software.

CISC Processors Architecture


The CISC architecture helps reduce program code by embedding multiple operations on each
program instruction, which makes the CISC processor more complex. The CISC architecture-
based computer is designed to decrease memory costs because large programs or instruction
required large memory space to store the data, thus increasing the memory requirement, and a
large collection of memory increases the memory cost, which makes them more expensive.

Advantages of CISC Processors


 The compiler requires little effort to translate high-level programs or statement
languages into assembly or machine language in CISC processors.
 The code length is quite short, which minimizes the memory requirement.
 To store the instruction on each CISC, it requires very less RAM.
 Execution of a single instruction requires several low-level tasks.
 CISC creates a process to manage power usage that adjusts clock speed and voltage.
 It uses fewer instructions set to perform the same instruction as the RISC.

Disadvantages of CISC Processors


 CISC chips are slower than RSIC chips to execute per instruction cycle on each
program.
 The performance of the machine decreases due to the slowness of the clock speed.
 Executing the pipeline in the CISC processor makes it complicated to use.
 The CISC chips require more transistors as compared to RISC design.
 In CISC it uses only 20% of existing instructions in a programming event.
Difference between the RISC and CISC Processors
RISC CISC
It is a Reduced Instruction Set Computer. It is a Complex Instruction Set Computer.
It emphasizes on software to optimize the It emphasizes on hardware to optimize the
instruction set. instruction set.
It is a hard wired unit of programming in Microprogramming unit in CISC
the RISC Processor. Processor.
It requires multiple register sets to store It requires a single register set to store the
the instruction. instruction.
RISC has simple decoding of instruction. CISC has complex decoding of
instruction.
Uses of the pipeline are simple in RISC. Uses of the pipeline are difficult in CISC.
It uses a limited number of instruction that It uses a large number of instruction that
requires less time to execute the requires more time to execute the
instructions. instructions.
It uses LOAD and STORE that are It uses LOAD and STORE instruction in
independent instructions in the register-to- the memory-to-memory interaction of a
register a program's interaction. program.
RISC has more transistors on memory CISC has transistors to store complex
registers. instructions.
The execution time of RISC is very short. The execution time of CISC is longer.
RISC architecture can be used with high- CISC architecture can be used with low-
end applications like telecommunication, end applications like home automation,
image processing, video processing, etc. security system, etc.
It has fixed format instruction. It has variable format instruction.
The program written for RISC architecture Program written for CISC architecture
needs to take more space in memory. tends to take less space in memory.
Example of RISC: ARM, PA-RISC, Examples of CISC: VAX, Motorola
Power Architecture, Alpha, AVR, ARC 68000 family, System/360, AMD and the
and the SPARC. Intel x86 CPUs.
UNIT 3

Real-time operating systems (RTOS) are used in environments where a large number of
events, mostly external to the computer system, must be accepted and processed in a short time
or within certain deadlines. such applications are industrial control, telephone switching
equipment, flight control, and real-time simulations. With an RTOS, the processing time is
measured in tenths of seconds. This system is time-bound and has a fixed deadline. The
processing in this type of system must occur within the specified constraints. Otherwise, This
will lead to system failure.
Examples of real-time operating systems are airline traffic control systems, Command Control
Systems, airline reservation systems, Heart pacemakers, Network Multimedia Systems, robots,
etc.

Types of RTOS

The real-time operating systems can be of 3 types –

1. Hard Real-Time Operating System: These operating systems guarantee that critical
tasks are completed within a range of time.
For example, a robot is hired to weld a car body. If the robot welds too early or too late, the
car cannot be sold, so it is a hard real-time system that requires complete car welding by the
robot hardly on time., scientific experiments, medical imaging systems, industrial control
systems, weapon systems, robots, air traffic control systems, etc.

2. Soft real-time operating system: This operating system provides some relaxation in the
time limit.
For example – Multimedia systems, digital audio systems, etc. Explicit, programmer-defined,
and controlled processes are encountered in real-time systems. A separate process is changed
by handling a single external event. The process is activated upon the occurrence of the related
event signaled by an interrupt.
Multitasking operation is accomplished by scheduling processes for execution independently
of each other. Each process is assigned a certain level of priority that corresponds to the relative
importance of the event that it services. The processor is allocated to the highest-priority
processes. This type of schedule, called, priority-based preemptive scheduling is used by real-
time systems.

3. Firm Real-time Operating System: RTOS of this type have to follow deadlines as well.
In spite of its small impact, missing a deadline can have unintended consequences,
including a reduction in the quality of the product. Example: Multimedia applications.

4. Deterministic Real-time operating System: Consistency is the main key in this type of
real-time operating system. It ensures that all the task and processes execute with
predictable timing all the time,which make it more suitable for applications in which timing
accuracy is very important. Examples: INTEGRITY, PikeOS.

Advantages:
The advantages of real-time operating systems are as follows-
 Maximum consumption: Maximum utilization of devices and systems. Thus more
output from all the resources.
 Task Shifting: Time assigned for shifting tasks in these systems is very less. For
example, in older systems, it takes about 10 microseconds. Shifting one task to another
and in the latest systems, it takes 3 microseconds.
 Focus On Application: Focus on running applications and less importance to
applications that are in the queue.
 Real-Time Operating System In Embedded System: Since the size of programs is
small, RTOS can also be embedded systems like in transport and others.
 Error Free: These types of systems are error-free.
 Memory Allocation: Memory allocation is best managed in these types of systems.

Disadvantages:
The disadvantages of real-time operating systems are as follows-
 Limited Tasks: Very few tasks run simultaneously, and their concentration is very less
on few applications to avoid errors.
 Use Heavy System Resources: Sometimes the system resources are not so good and
they are expensive as well.
 Complex Algorithms: The algorithms are very complex and difficult for the designer
to write on.
 Device Driver And Interrupt signals: It needs specific device drivers and interrupts
signals to respond earliest to interrupts.
 Thread Priority: It is not good to set thread priority as these systems are very less
prone to switching tasks.
 Minimum Switching: RTOS performs minimal task switching.
Comparison of Regular and Real-Time operating systems:
Regular OS Real-Time OS (RTOS)

Complex Simple

Best effort Guaranteed response

Fairness Strict Timing constraints

Average Bandwidth Minimum and maximum limits

Unknown components Components are known

Unpredictable behavior Predictable behavior

Plug and play RTOS is upgradeable

What is Kernel | Relevance of Kernel in RTOS Architecture


The core component of an operating system is called Kernel. Micro-Kernel Architecture is
implemented in Real Time Operating System with configurable functionalities.
Abstraction Layer is provided by the Kernel which offers six main types of common services
to the Application software. They are:
 Task Management
The application is divided into small, schedulable, and sequential program units known as
‘Thread‘ or ‘Task‘. This is done to achieve concurrency in Real Time Application. Task
Management by Kernel includes Real Time Task Creation, termination, changing priorities etc.
Task creation involves creating a Task Control Block (TCB) which has information about Task
id, priority, Task states i.e. if the task is in (idle, running, ready, terminated) state etc.
 Task Scheduling
It records the state of each task and determines the task of highest priority, to be executed. The
task which is already running is suspended and the processor executes the high priority task.
 Task Synchronization
It is necessary for the information to be transmitted safely from one Task or Thread to another
Task. Task Synchronization enables the tasks to mutually share the resources like buffers, I/O
devices etc.
 Memory management
It allocates the memory for each program. There are two types of Memory Management for
RTOS. They are:
Stack Management
Heap Management
Time Management
To schedule the tasks that need to be executed during specified duration, there is need for a
periodical interrupt. Hence hardware Timer is programmed to interrupt the processor. Time
interrupt is called System Tick.
 Interrupt Handling
CPU is informed about any asynchronous event through an Interrupt. It is a hardware
mechanism which handles an event by providing functions like defining Interrupt Handler,
creation and deletion of Interrupt service routine etc.
 Device I/O Management
Device I/O Management helps in providing uniform framework ( API – Application
Programmers Interface). It also helps in accessing specific hardware device drivers i.e. it
locates the right device for I/O request.

Real Time Scheduling (Separate PDF file is given)

Interrupt Service Routines Interrupt routine in RTOS environment and handling of


interrupt service calls

https://prezi.com/p/oqfzyoqtfko0/interrupt-handling-in-rtos/

Watchdog Timer
Watchdog timer is a piece of hardware in micro-controller. Watchdog timer is used to generates
system reset if system gets stuck somewhere i.e. if system goes into endless loop of execution
watchdog timer will reset the system to come out of endless loop. Watchdog is safety
mechanism in embedded system which makes your system reliable, but it depends on how you
make use of watchdog timer.

How does watchdog works :


Watchdog is basically a counter, which starts from counting zero and reaches to a certain
value. If counter reaches to certain value then watchdog hardware will generates a watchdog
reset. To avoid system reset, software needs to kick the watchdog i.e. need to reset the counter
to zero. In case software stuck into endless loop it system will not able to kick the watchdog
hence counter reaches to certain value and resets the system.
Watchdog is initially loaded with certain value. This value is calculated based on timeout time
of watchdog (Further section it is been shown how to calculate counter value based on timeout
value). Before timeout time, system should reset the counter.
e.g. If your system if performing 3 tasks periodically and to perform 3 tasks is takes 500 ms.
Then timeout time is considered as 600 ms (considering worst case scenario), counter value is
calculated with respect to 600 ms and loaded into watchdog.
Following figures shows watchdog hardware. Input to watchdog hardware is clock. Based on
every clock tick watchdog internal counter increments. Then there is comparator which
compares count value with loaded count value (timeout value) and if count matches watchdog
hardware generates and reset signal.
Flash Memory
 memory is secondary memory and so it is not volatile which means it persists the data
Flash
even if there is not an electrical supply provided. This flash memory works on the principle of
EEPROM. EEPROM stands for Electrical Erasable Programmable Read-Only Memory. ROM
operation can only one time write and many times read and we can’t erase it. But Flash Memory
can be erased multiple times and update the data or program integrated into it. So it gives
flexibility to the updation of the program but ROM has no such type of feature.

Features of Flash Memory


Non-volatile: There is no loss of date when there is no electricity supply.
Solid-state: It is SS technology so it is faster than HDD type storage.
Fast access times: It supports solid-state technology so it has faster access time.
Large storage capacity: Flash memory devices can store large amounts of data, from a few
GB (Gigabytes) to several TB(Terabytes).
Low power consumption: It is not based on header like HDD so no mechanical components
in flash memory so it uses less amount of electricity from read the data.
Flexibility towards Erase and write operations: Flash memory can be erased electrically
multiple times and read multiple times so flexibility towards read/write operation is more in
flash memory.

Working of Flash Memory:


These two are the main steps.
Writing the data into flash memory: Flash memory is made up of small-small memory cells
which are made up of floating-gate transistors. All memory cells are organized in the sequential
order called an array of memory cells. Data can be stored to the hardware in the form of 0 and
1 only. So to store the data into the flash memory we should give the electric supply to add the
pattern of 0 and 1 into the flash memory and once this pattern is embedded on to the chip then
corresponding data is also stored in the flash memory. If we want to erase the data from flash
memory then we have to do it by supplying electrical impulse to make all bits of memory cell
to 0.
Reading the data into flash memory: By reading the stored 0 and 1 into the cell we can get
our data stored in the flash memory. So to read the bit which can contain 0 or 1 we have to
apply voltage to the gate of transistor, and whatever the current flow in the circuit is measured
and by using that measurement we are good to go to identify the bit present in the cell.

NAND Flash NOR Flash

NAND flash memory is organized in a NOR flash memory is organized in a


series of memory cells parallel of memory cells

NAND flash memory has a higher NOR flash memory has a lower density than
density(store more data in a smaller space) NAND Flash

NAND flash memory has a faster read NOR flash memory has faster random
speed. access times than NAND flash memory,
NAND flash memory can survive less NOR flash memory can survive more
erase/write cycles before starting to degrade erase/write cycles before starting to degrade
than NOR than NAND

It is commonly used in high-density storage NOR flash memory is used in applications


applications. that require frequent read and write
operations.

Limitations of Flash Memory


 Limited lifespan: Writing onto the flash memory by electrical supply may damage the
hardware so it has some limitations to the lifespan of flash memory.
 Slower write speeds: Frequency of writing speed so less than RAM and to write the
data by using an electrical pulse every time may take more time than RAM.
 Limited storage capacity: Flash memory has a high storage density, but lesser than
some other memory devices such as HDDs or tape drives.
 Data corruption: When we are writing to the flash memory by using electrical pulse
and when power supply is cut off accidentally then loss of data will be there.

Benefits of Flash Memory


 Large storage capacity: Flash memory has high memory density so it is able to store
a high volume of data.
 High speed: Some flash memory has parallel architecture of memory cells so it has
faster speed to read and write operation.
 Persistent Data: Without supply of electricity it persist the data like HDDs.
 Low power consumption: Flash memory don’t have mechanical components like
HDD’s so it consume less amount of power than HDDs.

Applications of Flash Memory


 Used in SSDs: Flash memory is used in SSDs to increase the speed of read/write of
operations.
 Embedded systems: Flash memory is used in embedded systems. Examples: digital
cameras, camcorders, MP3 players etc.
 Smartphones and tablets: Flash memory is used in smartphones and tablets.
 USB drives: Flash memory is commonly used in USB drives.

Free RTOS
FreeRTOS is a market-leading real-time operating system (RTOS) for microcontrollers and
small microprocessors. Distributed freely under the MIT open source license, FreeRTOS
includes a kernel and a growing set of IoT libraries suitable for use across all industry sectors.
FreeRTOS is built with an emphasis on reliability and ease of use.
 FreeRTOS provides methods for multiple threads or tasks, mutexes, semaphores and
software timers.
 Thread priorities are supported.
 FreeRTOS applications can be statically allocated, but objects can also be dynamically
allocated with five schemes of memory management (allocation).
 A tickless mode is provided for low power applications.
UNIT 4
Performance analysis

https://rcet.org.in/uploads/academics/rohini_87815623574.pdf

Speed, Power and Area Optimization


 Efficient Resource Utilization:
The cornerstone of optimizing embedded systems lies in efficient resource utilization. This
encompasses managing CPU cycles, memory, and power consumption judiciously. Utilize
profiling tools to identify performance bottlenecks and optimize critical code sections.
Moreover, employ efficient algorithms and data structures tailored to the specific requirements
of the application to minimize resource overhead.
 Compiler Optimization:
Compiler optimization plays a crucial role in enhancing the performance of embedded systems.
Leveraging compiler flags and optimization techniques can significantly improve code
efficiency. Utilize techniques such as loop unrolling, function inlining, and instruction
scheduling to generate optimized machine code. Additionally, explore compiler-specific
optimization options tailored to the architecture of the embedded platform to unlock
performance gains.
 Hardware Acceleration:
Harness the power of hardware acceleration to offload computationally intensive tasks from
the CPU. Utilize specialized hardware components such as DSPs (Digital Signal Processors),
FPGAs (Field-Programmable Gate Arrays), or dedicated coprocessors to accelerate specific
functions like signal processing, encryption, or image processing. By leveraging hardware
acceleration, you can achieve significant performance improvements while minimizing the
burden on the CPU.
 Real-time Operating Systems (RTOS):
Employing a real-time operating system tailored to the requirements of the embedded
application can streamline task scheduling and resource management. RTOSs offer
deterministic behavior, ensuring timely execution of critical tasks. Utilize features such as
priority-based scheduling, interrupt handling, and efficient memory management to optimize
system performance. Additionally, optimize task synchronization and communication
mechanisms to minimize overhead and latency.
 Power Management:
Efficient power management is essential for optimizing embedded systems, particularly in
battery-powered devices. Implement power-saving techniques such as dynamic voltage and
frequency scaling (DVFS), where the CPU adjusts its operating frequency and voltage
dynamically based on workload requirements. Utilize low-power modes during idle periods
and employ techniques like clock gating to minimize power consumption without
compromising performance.
 Cache Optimization:
Effective cache utilization is vital for improving memory access latency and overall system
performance. Optimize memory access patterns to maximize cache hits and minimize cache
misses. Employ techniques such as data prefetching, cache line optimization, and cache
blocking to enhance cache efficiency. Additionally, align data structures and code segments to
cache boundaries to leverage spatial locality and minimize memory latency.
 Code Optimization:
Fine-tuning code for performance is a fundamental aspect of optimizing embedded systems.
Analyze and refactor code to eliminate inefficiencies, reduce redundant computations, and
minimize code size. Employ techniques such as loop optimization, algorithmic improvements,
and code specialization to streamline execution paths and improve overall performance.
Furthermore, leverage platform-specific optimizations and intrinsic functions to exploit
hardware capabilities effectively.
 System-Level Optimization:
Adopt a holistic approach to system-level optimization by considering the interactions between
software and hardware components. Profile system behavior under varying workloads and
operating conditions to identify optimization opportunities. Optimize system configuration
parameters, such as interrupt priorities, clock frequencies, and peripheral settings, to achieve
optimal performance and responsiveness. Additionally, employ techniques like task
consolidation and parallelism to maximize resource utilization and throughput.
 Selecting the Right Hardware:
The foundation of an efficient embedded system lies in selecting hardware components that
match the application’s requirements. This involves considering factors such as processing
power, memory capacity, and energy efficiency. Choosing the most suitable microcontroller,
microprocessor, or System-on-Chip (SoC) can significantly impact performance.
 Efficient Algorithm Design:
Optimize algorithms to minimize computational complexity and memory usage. Use
techniques like dynamic programming, data compression, and algorithmic trade-offs to achieve
faster execution and conserve resources. Tailor algorithms to the specific tasks and constraints
of the embedded system to maximize efficiency.
 Compiler Optimization:
Compiler optimization plays a crucial role in improving code efficiency. Configure compilers
to generate optimized code tailored to the target hardware architecture. Enable compiler
optimizations such as loop unrolling, function inlining, and instruction scheduling to enhance
performance without sacrificing code readability or maintainability.
 Memory Management:
Efficient memory management is vital for embedded systems to minimize memory footprint
and access latency. Employ techniques like memory pooling, dynamic memory allocation
optimization, and data structure alignment to reduce memory fragmentation and overhead.
Utilize non-volatile memory solutions like Flash memory for persistent storage to enhance
reliability and performance.
 Power Optimization:
Power efficiency is paramount in embedded systems, especially for battery-powered devices.
Implement power-saving techniques such as clock gating, voltage scaling, and low-power
modes to minimize energy consumption during idle periods or low activity. Utilize power
profiling tools to identify and optimize power-hungry components or software routines.
 RTOS and Task Scheduling:
Real-Time Operating Systems (RTOS) provide efficient task scheduling mechanisms crucial
for managing system resources effectively. Utilize priority-based scheduling algorithms to
allocate CPU time to critical tasks while ensuring timely responsiveness. Optimize task
scheduling policies and parameters to minimize overhead and maximize system throughput.

How to increase the security of embedded applications?


Security risks come from adversaries who are actively trying to exploit system vulnerabilities.
When designing for security, it has to be assumed that an adversary could be trying to make
things go wrong at any point. Here are key elements to consider:
 Simplicity in design
Keeping system design as simple as possible is one of the best ways to improve the security of
a system. A simpler design reduces the attack surface and decreases the potential for
unanticipated system interactions.
 Secure boot
Secure boot is a feature where the system validates the device boots using only software that
is trusted by the equipment manufacturer. It leverages the signature provided by a device trust
anchor, the public part of the root of the public key infrastructure (PKI) used to sign the device
code. When the embedded system boots, the boot image will be validated using this public key
and the corresponding trust chain to ensure that boot-time software has not been tampered with.
 Usage of HSM
A hardware security module (HSM) handles encryption and decryption tasks as well as embeds
OS and application management. These modules traditionally come in the form of a system-
on-a-chip or plug-in card that attaches directly to an embedded system. During manufacturing,
a private key can be generated on a chip or injected into each chip to serve as a root of trust.
When the private key is certified by a public key infrastructure or PKI, the secure device
identifier can become a foundational component of trusted device connectivity.

How to improve the reliability of embedded applications?


The primary reliability risks are not malicious in nature—for example, a physical device
failure. When designing for reliability, it has to be assumed that things can go wrong at some
point in time. There are plenty of techniques that a programmer can adapt to make the
embedded application reliable:
 Implementation of failsafe
In embedded coding, the programmer is in charge of almost everything. Hence, it is important
to implement an adequate failsafe mechanism for all possible system failures to avoid irrational
behavior when an error occurs.
 Check for data integrity
It is important to check the integrity of the critical variables and data structures for an extended
run time. This can be achieved by keeping a CRC or checksum in the memory and verifying
the status periodically.
 Avoid dynamic memory allocation
Typical embedded systems don’t have the bandwidth to afford fragmented memory. Dynamic
allocation of memory can lead to memory leakage in such resource-constrained embedded
systems and hence should be avoided.
 Use of memory protection unit
The memory protection unit, often referred to as the MPU, is an optional component present in
many ARM-based microcontrollers. The MPU is used to separate sections in memory by
setting local permissions and attributes. This mechanism has several uses in real-life scenarios,
such as preventing access to the memory when the CPU is running in user mode or preventing
fetching code to execute from writable locations in RAM. When the MPU is enabled, it
enforces the rules by triggering a memory exception interrupt when those are violated.
 Use of watchdog
Most modern microprocessors support a watchdog timer to provide the ability to recover from
certain types of system hangs. It can identify software freezes within a few milliseconds and
reset the system appropriately, preventing further system failure.
Security and reliability have a lot in common—both are inherent properties of all information
systems that are tempting to sacrifice initially but costly to fix later. Despite the hopes and the
optimism of the developers, embedded systems can shake their faith in microcontrollers. Every
bit and byte requires maintenance and meticulous dedication to ensure that, over time, the
software runs correctly and securely with the associated hardware. These few methods might
not be sufficient to design for security and reliability; based on the criticality of security and
reliability, other appropriate methods must be chosen.

FPGA
https://digilent.com/blog/what-is-an-fpga/

SoC
https://www.ansys.com/en-in/blog/what-is-system-on-a-chip

Debugging
https://epgp.inflibnet.ac.in/epgpdata/uploads/epgp_content/S000007CS/P001072/M023189/E
T/1505901474lect37(1.pdf

ROM and In Circuit Emulators

https://educationalstuff1.tripod.com/ice.pdf

Case Studies of Embedded Systems


h ps://lembergsolu ons.com/blog/5-real-life-examples-embedded-
systems#:~:text=Some%20of%20embedded%20opera ng%20system,naviga on%20systems%2C%20
elevators%2C%20etc.

You might also like