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

1introduction To Embedded System

1. The document discusses various types of processors used in embedded systems including microprocessors, microcontrollers, general purpose processors, digital signal processors, and application specific system processors. 2. It provides examples of microprocessors like Intel's 4004 and 8080 and microcontrollers like Intel's 8051 and PIC microcontrollers. 3. Embedded processors, DSPs, and multi-processor systems using general purpose processors are also introduced.

Uploaded by

Tech Tutorials
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views

1introduction To Embedded System

1. The document discusses various types of processors used in embedded systems including microprocessors, microcontrollers, general purpose processors, digital signal processors, and application specific system processors. 2. It provides examples of microprocessors like Intel's 4004 and 8080 and microcontrollers like Intel's 8051 and PIC microcontrollers. 3. Embedded processors, DSPs, and multi-processor systems using general purpose processors are also introduced.

Uploaded by

Tech Tutorials
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 96

What are the various machines you

use as domestic appliances..


Basic concept of Embedded
System
A system is a way of working, organizing or doing one or
many tasks according to a fixed plan, program or
set of rules.
A system is also an arrangement in which all its units
assemble and work together according to the plan or
program.
Basic concept of Embedded System

• 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.
•  It may or not be programmable, depending on
application. Examples of embedded systems
include washing machines, printers,
automobiles, cameras, industrial machines
Basic concept of System example

WATCH
It is a time display SYSTEM
Parts: Hardware, Needles, Battery, Dial,
Chassis and Strap
Rules
1. All needles move clockwise only
2. A thin needle rotates every second
3. A long needle rotates every minute
4. A short needle rotates every hour
5. All needles return to the original position after 12 hours
Smart watch….
Brainstorming..
• What are the problems faced by people
around that you think as an electronic design
engineer you can solve?
Basic concept of Embedded system

An embedded system is a computer system—a combination


of a computer processor, computer memory, and
input/output peripheral devices—that has a dedicated
function within a larger mechanical or
electrical system. ... Embedded systems control many
devices in common use today.

An embedded system is a microprocessor-based computer


hardware system with software that is designed to perform a
dedicated function, either as an independent system or as a
part of a large system. At the core is an integrated circuit
designed to carry out computation for real-time operations.
Basic concept of Embedded
system
An Embedded System is one that has computer
hardware with software embedded in it as one of its
important components.

Software program

Its software embeds in ROM (Read Only Memory). It does not


need secondary memories as in a computer
Basic concept of Embedded
system
COMPUTER HARDWARE
• Microprocessor
• A Large Memory
(Primary and Secondary)
(RAM, ROM and caches)
• Input Units
(Keyboard, Mouse, Scanner, etc.)
• Output Units
(Monitor, printer, etc.)
• Networking Units
(Ethernet Card, Drivers, etc.)
• I/O Units
(Modem, Fax cum Modem, etc.)
COMPONENTS OF EMBEDDED
SYSTEM
•It has Hardware
Processor, Timers, Interrupt controller, I/O Devices, Memories,
Ports, etc.
• It has main Application Software
Which may perform concurrently the series of tasks or multiple
tasks.
• It has Real Time Operating System (RTOS)
RTOS defines the way the system work. Which supervise the
application software. It sets the rules during the execution of the
application program. A small scale embedded system may not
need an RTOS.
Typical Embedded System Hardware
Typical Embedded System Hardware
EMBEDDED SYSTEM CONSTRAINTS
An embedded system's software designed to keep
in view three constraints:
• – Available system memory
• – Available processor speed
• – The need to limit the power dissipation
• - Production cost per unit
Characteristics of Embedded system

• Real-time operation
• Size
• Cost
• Time
• Reliability
• Safety
• Energy/ power consumption
• Security
CLASSIFICATIONS OF EMBEDDED SYSTEM

• Small Scale Embedded System


• Medium Scale Embedded System
• Sophisticated Embedded System
CLASSIFICATIONS OF EMBEDDED SYSTEM

• Small Scale Embedded System


• Single 8 bit or 16bit Microcontroller.
• Little hardware and software complexity.
• They May even be battery operated.
• Usually “C” is used for developing these system.
• The need to limit power dissipation when system is running continuously.
• Programming tools: Editor, Assembler and Cross Assembler
CLASSIFICATIONS OF EMBEDDED SYSTEM

• MEDIUM SCALE EMBEDDED SYSTEM


• Single or few 16 or 32 bit microcontrollers or Digital Signal Processors
(DSP) or Reduced Instructions Set Computers (RISC).
• Both hardware and software complexity.
• Programming tools: RTOS, Source code Engineering Tool, Simulator,
Debugger and Integrated Development Environment (IDE).
CLASSIFICATIONS OF EMBEDDED SYSTEM

• SOPHISTICATED EMBEDDED SYSTEM


• Enormous hardware and software complexity
• Which may need scalable processor or configurable processor and programming
logic arrays.
• Constrained by the processing speed available in their
• hardware units.
Programming Tools:
For these systems may not be readily available at a reasonable cost or may not be
available at all. A compiler might have to developed for this.
PROCESSOR
• A Processor is the heart of the Embedded
System.
• For an embedded system designer knowledge
of microprocessor and microcontroller is a
must.
• Two Essential Units: Operations
1) Control Unit (CU) Fetch
2) Execution Unit (EU) Execute
TYPES OF PROCESSOR
1. General Purpose processor (GPP)
• Microprocessor
• Microcontroller
• Embedded Processor
• Digital signal Processor
2. Application Specific System Processor (ASSP)
3. Multi Processor System using GPPs
Review of microprocessor and
microcontroller
• A microprocessor is a single chip semi conductor
device also which is a computer on chip, but not a
complete computer.
• Its CPU contains an ALU, a program counter, a stack
pointer, some working register, a clock timing circuit
and interrupt circuit on a single chip.
• To make complete micro computer, one must add
memory usually ROM and RAM, memory decoder, an
oscillator and a number of serial and parallel ports.
Review of microprocessor and
microcontroller
HISTORY OF MICROPROCESSOR
• 1st Generation (4 bit processors)
4004 and 4040 4 bit in early 1970 by Intel (Integrated Electronics)
• 2nd Generation (8 bit processors)
8008 and 8080 8 bit in 1974 Intel with +5 V Input supply 8080  8085 8 bit
• 3rd Generation (16 bit processors)
• 8086 16 bit. Same as 8086, the 8088 introduced 8088 has only 8 bit data bus
(This made it easier to interface to the common 8 bit peripheral devices
available at the time)
• Followed by:
The 80186 & 80286 (16 bit processor), the 80386 & 80486 (a 32 bit processor),
leading to the Pentium range of microprocessors (64 bit processors)
available today. The 80x86 and Pentium processors have all been designed
for use in personal computer type applications and have large memory maps
MICROPROCESSORS eg
• Intel
4004, 4040 8080, 8085 8086, 8088,
80186, 80188 80286, 80386
x86-64
• Motorola
6800,6809, 68000
G3, G4, G5
• Zilog
Z80, Z180, eZ80, Z8, eZ8
MICROCONTROLLER
• A microcontroller is a functional computer
system-on-a-chip. It contains a processor,
memory, and programmable input/output
peripherals.
• Microcontrollers include an integrated CPU,
memory (a small amount of RAM, program
memory, or both) and peripherals capable of
input and output.
MICROCONTROLLERS examples

• INTEL
8031,8032,8051,8052,8751,8752
• PIC
8-bit PIC16, PIC18,
16-bit DSPIC33 / PIC24,
PIC16C7x
• Motorola
MC68HC11
MICROPROCESSOR Vs MICROCONTROLLER
MICROPROCESSOR MICROCONTROLLER

The functional blocks are ALU, It includes functional blocks of


registers, timing & control units microprocessors & in addition has
timer, parallel i/o, RAM, EPROM,
ADC & DAC

Bit handling instruction is less, One Many type of bit handling


or two type only instruction

Rapid movements of code and Rapid movements of code and


data between external memory & MP data within MC

It is used for designing general They are used for designing


purpose digital computers system application specific dedicated
systems
Were the Embedded systems existing
earlier
• Yes, We have been enjoying the grace of embedded system
quite a long time. But they were not so popular because in
those days most of the embedded systems were designed
around a microprocessor unlike today’s systems which
were built around a microcontroller.
• As we know a microprocessor by itself do not possess any
memory, ports etc. So everything must be connected
externally by using peripherals like 8255, 8257, 8259 etc.
So the embedded system designed using microprocessor
was not only complicated in design but also large in size.
At the same time the speed of microprocessor is also a
limitation for high end applications
EMBEDDED PROCESSOR
• Special microprocessors & microcontrollers
often called, Embedded processors.
• An embedded processor is used when fast
processing fast context-switching & atomic
ALU operations are needed.

Examples : ARM 7, INTEL i960, AMD 29050.


General purpose processor (DSP)
• DSP as a GPP is a single chip VLSI unit.
• It includes the computational capabilities of
microprocessor and multiply & accumulate units (MAC).
• DSP has large number of applications such as image
processing, audio, video & telecommunication
processing systems.
• It is used when signal processing functions are to be
processed fast.
Examples : TMS320Cxx, SHARC, Motorola 5600xx
MULTI PROCESSOR SYSTEM USING GPPs

• Multiple processors are used when a single


processor does not meet the needs of different
task.
• The operations of all the processors are
synchronized to obtain an optimum
performance.
APPLICATION SPECIFIC SYSTEM
PROCESSOR (ASSP)
• ASSP is dedicated to specific tasks and
provides a faster solution.
• An ASSP is used as an additional processing
unit for running the application in place of
using embedded software.

Examples : IIM7100, W3100A


Classification of Embedded Systems

• Based on functionality and performance


requirements
1. Stand-alone Embedded Systems
2. Real-time Embedded Systems
3. Networked Information Appliances
4. Mobile Devices
Real-time Systems and its types
Embedded systems in which some specific work has to be done in a
specific time period are called real-time systems. For example,
consider a system that has to open a valve within 30 milliseconds
when the humidity crosses a particular threshold. If the valve is not
opened within 30 milliseconds, a catastrophe may occur. Such
systems with strict deadlines are called hard real-time systems.
In some embedded systems, deadlines are imposed, but not adhering to
them once in a while may not lead to a catastrophe.
For example, consider a DVD player. Suppose, you give a command to
the DVD player from a remote control, and there is a delay of a few
milliseconds in executing that command. But, this delay won’t lead to
a serious implication. Such systems are called soft real-time systems .
Networked Information Appliances
• Embedded systems that are provided with network
interfaces and accessed by networks such as Local
Area Network or the Internet are
called networked information appliances. Such
embedded systems are connected to a network,
typically a network running TCP/IP (Transmission
Control Protocol/Internet Protocol) protocol suite,
such as the Internet or a company’s Intranet.
Example: A web camera can be connected to the
Internet
Smart door lock system – e.g. of ES

• The door lock of your home can be a small


embedded system with TCP/IP and HTTP
server software running on it. When your
children stand in front of the door lock after
they return from school, the web camera in
the door-lock will send an alert to your
desktop over the Internet and then you can
open the door-lock through a click of the
mouse
Mobile Devices
• Mobile devices such as mobile phones,
Personal Digital Assistants (PDAs), smart
phones etc. are a special category of
embedded systems. Though the PDAs do
many general purpose tasks, they need to be
designed just like the ‘conventional’
embedded systems.
OTHER HARDWARE
• Power Source
• Clock Oscillator
• Real Time Clock (RTC)
• Reset Circuit, Power-up Reset and watchdog timer Reset
• Memory
• I/O Ports, I/O Buses
• Interrupt Handler
• DAC and ADC
• LCD and LED Display
• Keypad/Keyboard
Communication Interfaces
For embedded systems to interact with the external world, a number of
communication interfaces are available. They are
• Serial Communication Interfaces (SCI):
RS-232, RS-422, RS-485 etc
• Synchronous Serial Communication Interface:
I2C, JTAG, SPI, SSC and ESSI
• Universal Serial Bus (USB)
• Networks:
Ethernet, Controller Area Network, LonWorks, etc
• Timers:
PLL(s), Capture/Compare and Time Processing Units
• Discrete IO:
General Purpose Input/Output (GPIO)
• Analog to Digital/Digital to Analog (ADC/DAC)
Moore’s Law
• Moore's law describes a long-term trend in the history of
computing hardware.
• Since the invention of the integrated circuit in 1958, the number
of transistors that can be placed inexpensively on an integrated
circuit has increased exponentially, doubling approximately
every two years.
• The trend was first observed by Intel co-founder Gordon E.
Moore in 1965.
• Almost every measure of the capabilities of digital electronic
devices is linked to Moore's law: processing speed, memory
capacity, etc.
Features of ES
• Embedded systems do a very specific task, they cannot
be programmed to do different things.
• Have very limited resources, particularly the memory
and do not have secondary storage devices such as the
CDROM
• Embedded systems have to work against some deadlines.
A specific job has to be completed within a specific time.
In some embedded systems, called real-time systems,
the deadlines are stringent. Missing a dead line may
cause a catastrophe – loss of life or damage to property.
Features of ES
• Embedded systems are constrained for power, As many embedded systems
operate through a battery, the power consumption has to be very low.
• Embedded systems need to be highly reliable. Once in a while, pressing ALT-
CTRL-DEL is OK on your desktop, but you cannot afford to reset your
embedded system.
• Some embedded systems have to operate in extreme environmental conditions
such as very high temperatures and humidity.
• Embedded systems that address the consumer market (for example
electronic toys) are very cost-effective. Even a reduction of Rs.10 is lot of
cost saving, because thousands or millions systems may be sold.(practical aspect)
• Unlike desktop computers in which the hardware platform is dominated
by Intel and the operating system is dominated by Microsoft, there is a
wide variety of processors and operating systems for the embedded
systems. So, choosing the right platform is the most complex task
SOFTWARE
(Languages for Programming Embedded Systems)
• SOFTWARE
C, C++,Dot Net
• COMPILER
RIDE, KEIL
• SIMULATOR
And others….
Assembly language was the pioneer for programming embedded systems till recently. Nowadays
there are many more languages to program these
systems. Some of the languages are C, C++, Ada, Forth, and Java together
with its new enhancement J2ME.
The presence of tools to model the software in UML, SDL is sufficient to
indicate the maturity of embedded software programming
C++ is based on C language, thus providing programmer the object oriented methodologies
language can definitely claim to have more mature compilers C++. Now in order to avail the extra
benefits of C++ and plus to avoid buggy execution, experts are doing efforts to identify a
subset of C++ that can be used in embedded systems and this subset is called Embedded C+
+.
APPLICATIONS
Household appliances:
Microwave ovens, Television, DVD
Players & Recorders
•Audio players
•Integrated systems in aircrafts and
missiles
•Cellular telephones
•Electric and Electronic Motor controllers
•Engine controllers in automobiles
•Calculators
• Medical equipments
•Videogames
•Digital musical instruments, etc
Discussion point
Explore the processors in following applications
Enrichment Activity:
• Roll no 1to 10: Remote control
• Roll no 11to 20: Cars
• Roll no 21to 30: Planes
• Roll no 31to 40: Video games
• Roll no 41to 50: Setup box
• Roll no 51to 60:elevators
• Roll no 61to 70: Refrigerators
• Roll no 71 onwards: Tele- Vision

And consider their types too .. If any


How to select microcontroller for design?

Trade off between efficiency and power


dissipation.
ARM processor is a strong option for better
performance. But when we consider the power
consumption, in the case of ARM it is around 400mW
and the ATmega1031, AVR microcontroller consumes
low power around 16.5mW, but provides low
performance.
Texas instruments MSP430 with wide range of operation
modes consumes only 1.2mW with reasonably good
performance. So it is always left to the designer to
choose a suitable device according to the requirement
Enrichment Activity…..2
• Compare different micro controllers used for
embedded system designing
Steps to Design a ES
The data acquisition system
1. First we must select a temperature sensor like thermistor or
AD590 or LM35 or LM335 or LM75 etc
2. After this the analog data is converted into digital data and at the
same time proper signal conditioning is done
3. This digital input is fed to the microcontroller through its ports.By
developing a suitable program(Embedded C or Assembly) the data
is processed and controlled..keil
• 4. Once the program is debugged, and found error free it can be
dumped into the microcontroller flash memory using ISP(in system
programming).Now, microcontroller chip acts as an embedded chip
Machines are getting smart…

Semi automatic Fully automatic

IFB 6.5 Kg Wi-Fi Alexa Enabled Fully-


Automatic Front Loading Washing
Machine (SENORITA ZX, White, In Built
heater)
Further study…
• Washing Machine Controller with a New Programming Method

https://www.researchgate.net/publication/322
094000_Washing_Machine_Controller_with_a
_New_Programming_Method
Layered architecture of Embedded system
Application software

Operating system

Hardware
• Every embedded system consists of custom-built hardware
built around a Central Processing Unit (CPU). This
hardware also contains memory chips onto which the
software is loaded. The software residing on the memory
chip is also called the ‘firmware’.
• The operating system runs above the hardware, and the
application software runs above the operating system. The
same architecture is applicable to any computer including a
desktop computer. However,
there are significant differences. It is not compulsory to
have an operating system in every embedded system.
For small appliances such as remote control units, air
conditioners, toys etc., there is no need for an operating
system and we can write only the software specific to that
application. For applications involving complex processing,
it is advisable to have an operating system.
In such a case, you need to integrate the application software
with the operating system and then transfer the entire
software on to the memory chip. Once the software is
transferred to the memory chip, the software will continue to
run for a long time and you don’t need to reload new software
Operating System (OS):
• An operating system (OS) is system software that
manages computer hardware, software resources, and
provides common services for computer programs.
Types of operating systems
• Single-tasking and multi-tasking
• Single- and multi-user
• Distributed
• Templated
• Embedded
• Real-time
• Library
System software and Application software

• System software is used for operating


computer hardware. On other
hand Application software is used by user to
perform specific task. System software are
installed on the computer when
operating system is installed. On other
hand Application software are installed
according to user's requirements
Types of OS
• Single-tasking and multi-tasking
A single-tasking system can only run one program at a time, while a multi-tasking
 operating system allows more than one program to be running in concurrency. This
is achieved by time-sharing, where the available processor time is divided between
multiple processes. These processes are each interrupted repeatedly in time slices by
a task-scheduling subsystem of the operating system.
Multi-tasking may be characterized in
1. Preemptive and
2. Co-operative types.
In preemptive multitasking, the operating system slices the CPU time and dedicates a
slot to each of the programs. Unix-like operating systems, such as Solaris and Linux
—as well as non-Unix-like, such as AmigaOS—support preemptive multitasking.
Cooperative multitasking is achieved by relying on each process to provide time to
the other processes in a defined manner. 16-bit versions of Microsoft Windows used
cooperative multi-tasking; 32-bit versions of both Windows NT and Win9x used
preemptive multi-tasking.
Types of OS

• Single- and multi-user


Single-user operating systems have no facilities to distinguish users, but may
allow multiple programs to run in tandem. A multi-user operating system
extends the basic concept of multi-tasking with facilities that identify
processes and resources, such as disk space, belonging to multiple users, and
the system permits multiple users to interact with the system at the same time.
Time-sharing operating systems schedule tasks for efficient use of the system
and may also include accounting software for cost allocation of processor
time, mass storage, printing, and other resources to multiple users.
• Distributed
A distributed operating system manages a group of distinct, networked
 computers and makes them appear to be a single computer, as all
computations are distributed (divided amongst the constituent computers).
Types of OS
• Templated
In the distributed and cloud computing context of an
OS, templating refers to creating a single virtual machine image as
a guest operating system, then saving it as a tool for multiple
running virtual machines. The technique is used both in 
virtualization and cloud computing management, and is common
in large server warehouses.
• Embedded
Embedded operating systems are designed to be used in 
embedded computer systems. They are designed to operate on
small machines with less autonomy (e.g. PDAs). They are very
compact and extremely efficient by design, and are able to operate
with a limited amount of resources. Windows CE and Minix 3 are
some examples of embedded operating systems.
Types of OS
• A real-time operating system is an operating system that guarantees
to process events or data by a specific moment in time. A real-time
operating system may be single- or multi-tasking, but when
multitasking, it uses specialized scheduling algorithms so that a 
deterministic nature of behavior is achieved. Such an event-driven
system switches between tasks based on their priorities or external
events, whereas time-sharing operating systems switch tasks based
on clock interrupts.
• Library
A library operating system is one in which the services that a typical
operating system provides, such as networking, are provided in the
form of libraries and composed with the application and
configuration code to construct a unikernel: a specialized, 
single address space, machine image that can be deployed to cloud or
embedded environments.
Mobile OS
• A mobile operating system is an operating system
for mobile phones, tablets, smartwatches, 2-in-1 PCs
 (that can be convert to a laptop mode or detach and
work as a tablet mode), smart speaker or other
mobile devices.
• Mobile operating systems combine features of a 
personal computer operating system with other
features useful for mobile or handheld use,and
usually including a wireless inbuilt modem and SIM
 tray for telephony and data connection
Types of Mobile OS
• Android OS (Google Inc.) ...
• Bada (Samsung Electronics) ...
• BlackBerry OS (Research In Motion) ...
• iPhone OS / iOS (Apple) ...
• MeeGo OS (Nokia and Intel) ...
• Palm OS (Garnet OS) ...
• Symbian OS (Nokia) ...
• webOS (Palm/HP)
Embedded Operating Systems
• As the name suggests Embedded Operating System is an
Embedded System’s Operating System. It has limited
features. It is usually designed for some particular
operations to control an electronic device. For instance,
all mobile phones essentially consist of an operating
system that always boots up when the mobile phone is in
running condition. It controls all the features and basic
interface of the mobile phone. There are some other
programs that can be loaded onto the mobile phones.
Mostly, JAVA Apps run on the top. Embedded operating
systems runs on embedded processors
Characteristics of Embedded Operating Systems

• Direct use of interrupts


• Reactive operation
• Real-time operation
• Streamlined protection mechanisms
• I/O device flexibility
• Configurability
Embedded Operating Systems
• We can adapt the existing Operating System to our
embedded application by streamline operation, real-time
capability and be adding other necessary functions. The
advantage of this approach that it has a familiar interface
and its disadvantage is that it is not optimized for real-time
• The most common examples of embedded operating system
around us include Windows Mobile/CE (handheld
Personal Data Assistants), Symbian (cell phones) and 
Linux. Flash Memory Chip is added on a motherboard in
case of the embedded operating system of your personal
computer to boot from the Personal Computer.
• Windows Embedded Compact,
formerly Windows Embedded CE and Windo
ws CE, is an operating system subfamily
developed by Microsoft as part of
its Windows Embedded family of products.
Unlike Windows Embedded Standard, which
is based on Windows NT, Windows
Embedded Compact uses a different hybrid
kernel.
Types of Embedded Operating Systems

• Single System Control Loop


Single system control loop is the simplest type of embedded operating system.
It is so like operating system but it is designed to run the only single task. It
still under debate that this system should be classified as a type of operating
system or not.
• Multi-Tasking Operating System
As the name suggests that this operating system can perform multiple tasks.  In
multi-tasking operating system there are several tasks and processes that
execute simultaneously. More than one function can be performed if the system
has more than one core or processor.
The operating system is switched between tasks. Some tasks wait for events while
other receive events and become ready to run. If one is using a multitasking
operating system, then software development is simplified because different
components of software can be made independent to each other.
Types of Embedded Operating Systems…..
• Rate Monotonic Operating System
It is a type of operating system that ensures that task runs in a system can run for a specific
interval of time and for a specific period of time. When it is not ensured, there comes a
notification of failure to system software to take suitable action. This time limit cannot be
ensured if the system is oversubscribed, at this point another event may occur during run time
and the failure notification comes.
• Preemptive Operating System
A preemptive operating system is a type of multitasking operating system that interprets the
preemptive predominance for tasks. A higher priority is task is always defined and run before
a lower priority task. Such multi-tasking operating systems are efficient in increasing system
response to events and also simplify the development of software making the system more
reliable. The designer of the system may be able to calculate the time required for the service
interprets in a system and also the time is taken by the scheduler for switching tasks. Such
systems may fail to meet the deadline of a system and the software is unaware of the missed
deadline. CPU loading in a preemptive operating system can be measured naturally by
defining a lower priority task that only increments counter and do nothing else.
Types of Embedded Operating Systems…..

• Real Time Operating System


A real-time operating system is the one which serves real time
applications. It processes data as it comes in. The time
requirements for processing of operating system are usually
measured in shorter increments or in 10 th of seconds. They
may be time sharing or driven by events. Real time Operating
systems are used in small embedded systems.
The main features of real-time operating system include
1. Process threads that can be defined
2. Multitasking
3. Interrupt levels
Real Time Operating Systems
Real Time Embedded Operating Systems Examples

• VxWorks
1. It is developed by Wind River.
2. The latest version of this operating system is VxWorks 6.0.
3. It is widely used software operating system.
4. At the moment, there are 300 million devices that utilize this operating system.
5. The core or processor of VxWorks credits reliability, high performance, low latency,
determinism, and scalability.
6. It has increased potential for the management of errors.
7. It has compatibility with extensive POSIX 1003.1, .1b, .1c,
8. It uses preemptive priority and has scheduled for both real time and non-real time processes.
9. Memory is protected on the basis of MMU(memory management unit).
10.It has reduced context switch time. It restores only register windows.
11.For increasing response time, it saves the windows that are registered in a register cache and they
are used for recurring tasks.

• Video
Real Time Embedded Operating Systems
Examples…..
• Microkernels
Microkernels is an operating system that consists of the
basic necessities like scheduling, task switching, and
device handling.
Micro Kernels implement different memory techniques
and protect all system components.
Some of the microkernels protect memory by separating
all components of software from one another.
For further reading :
https://www.design-reuse.com/articles/10722/applica
tion-specific-real-time-microkernel-in-hardware.html
Basic kernel services

“Kernel" is the part of an operating system that


provides the most basic services to application
software running on a processor.

The "kernel" of a real-time operating system ("RTOS")


provides an "abstraction layer" that hides from
application software the hardware details of the
processor (or set of processors) upon which the
application software will run. This is shown in
Figure1.
• Figure 1: An RTOS Kernel provides an Abstraction Layer between Application
Software and Embedded Hardware
Task Management
Task Management : Concept of Task
This set of services allows application software developers to
design their software as a number of separate "chunks" of
software -- each handling a distinct topic, a distinct goal, and
perhaps its own real-time deadline. Each separate "chunk" of
software is called a "task." Services in this category include
the ability to launch tasks and assign priorities to them. The
main RTOS service in this category is the scheduling of tasks
as the embedded system is in operation. The Task Scheduler
controls the execution of application software tasks, and can
make them run in a very timely and responsive fashion.
Intertask Communication and
Synchronization

These services make it possible for tasks to pass information


from one to another, without danger of that information ever
being damaged. They also make it possible for tasks to
coordinate, so that they can productively cooperate with one
another. Without the help of these RTOS services, tasks might
well communicate corrupted information or otherwise
interfere with each other.

Timers
Since many embedded systems have stringent timing
requirements, most RTOS kernels also provide some basic
Timer services, such as task delays and time-outs.
Dynamic Memory Allocation services
This category of services allows tasks to "borrow"
chunks of RAM memory for temporary use in
application software. Often these chunks of memory
are then passed from task to task, as a means of
quickly communicating large amounts of data
between tasks. Some very small RTOS kernels that are
intended for tightly memory-limited environments,
do not offer Dynamic Memory Allocation services.

Device I/O Supervisor


Many (but not all) RTOS kernels also provide a
"Device I/O Supervisor" category of services. These
services, if available, provide a uniform framework for
organizing and accessing the many hardware device
drivers that are typical of an embedded system.
Task Scheduling

“Priority-based Preemptive Scheduling."


Each task in a software application must be assigned a priority, with higher priority values
representing the need for quicker responsiveness. Very quick responsiveness is made
possible by the "preemptive" nature of the task scheduling. "Preemptive" means that the
scheduler is allowed to stop any task at any point in its execution, if it determines that
another task needs to run immediately.
The basic rule that governs priority-based preemptive scheduling is that at every moment
in time, "The Highest Priority Task that is Ready to Run, will be the Task that Must be
Running." In other words, if both a low-priority task and a higher-priority task are ready to
run, the scheduler will allow the higher-priority task to run first. The low-priority task will
only get to run after the higher-priority task has finished with its current work.

Problem

What if a low-priority task has already begun to run, and then a higher-priority
task becomes ready?

It will allow the low-priority task to complete the current assembly-language instruction
that it is executing. [But it won’t allow it to complete an entire line of high-level language
code; nor will it allow it to continue running until the next clock tick.] It will then
immediately stop the execution of the low-priority task, and allow the higher-priority task
to run. After the higher-priority task has finished its current work, the low-priority task will
be allowed to continue running.
Figure 3: Timeline for Priority-based Preemptive Scheduling
Examples
Task Switching : Steps to handle
external trigger
Each time the priority-based preemptive scheduler is
alerted by an external world trigger (such as a switch
closing) or a software trigger (such as a message arrival), it
must go through the following 5 steps:
• Determine whether the currently running task should
continue to run. If not then.
• Determine which task should run next.
• Save the environment of the task that was stopped (so it
can continue later).
• Set up the running environment of the task that will run
next.
• Allow this task to run.
• These 5 steps together are called "task switching."
• Preemptive System

1. Non-Deterministic (General Computing Systems)


In more sophisticated preemptive task schedulers, the scheduler may
need to search through arrays of tasks to determine which task should be
made to run next. If there are more tasks to search through, the search
will take longer. Such searches are often done by general-computing
operating systems, thus making them non-deterministic.

2. Deterministic (Real Time Systems)


Real-time operating systems, on the other hand, avoid such searches by
using incrementally updated tables that allow the task scheduler to
identify the task that should run next in a rapid fixed-time fashion.
Intertask communication and
synchronization
Most operating systems, including RTOSs, offer a variety of mechanisms for
communication and synchronization between tasks. These mechanisms
are necessary in a preemptive environment of many tasks, because
without them the tasks might well communicate corrupted information or
otherwise interfere with each other.

Why Communication Required?

For instance, a task might be preempted when it is in the middle of


updating a table of data. If a second task that preempts it reads from that
table, it will read a combination of some areas of newly-updated data plus
some areas of data that have not yet been updated. These updated and
old data areas together may be incorrect in combination, or may not even
make sense. An example is a data table containing temperature
measurements that begins with the contents "10 C." A task begins
updating this table with the new value "99 F", writing into the table
character-by-character. If that task is preempted in the middle of the
update, a second task that preempts it could possibly read a value like "90
C" or "99 C." or "99 F", depending on precisely when the preemption took
place. The partially updated values are clearly incorrect, and are caused by
delicate timing coincidences that are very hard to debug or reproduce
Figure 5: Intertask Message Communication

Message Queues :
If messages can be sent more quickly than they can
be handled, the RTOS will provide message queues
for holding the messages until they can be
processed.
Synchronization Information
• Another kind of communication between tasks in embedded systems is
the passing of what might be called "synchronization information" from
one task to another.
• "Synchronization information" is like a command, where some commands
could be positive, and some negative.
• Negative Command
For example, a negative command to a task would be something like
"Please don’t print right now, because my task is using the printer." Or
more generally, "I want to lock the . . . for my own use only”.
• Positive Command
A positive command would be something like "I have detected a cardiac
emergency, and I want you to help me handle it." Or more generally,
"Please join me in handling . . ."

• Most RTOSs offer a semaphore or mutex mechanism for handling negative


synchronization (sometimes called "mutual exclusion"). These
mechanisms allow tasks to lock certain embedded system resources for
their use only, and subsequently to unlock the resource when they are
done.

• For positive synchronization, different RTOSs offer different mechanisms.


Some RTOSs offer event-flags, while others offer signals. And yet others
Dynamic memory allocation

Heap
Determinism of service times is also an issue in the area of
dynamic allocation of RAM memory. Many general-computing
non-real-time operating systems offer memory allocation
services from what is termed a "Heap." The famous "malloc"
and "free" services known to C-language programmers work
from a heap. Tasks can temporarily borrow some memory from
the operating system’s heap by calling "malloc", and specifying
the size of memory buffer needed. When this task (or another
task) is finished with this memory buffer it can return the buffer
to the operating system by calling "free." The operating system
will then return the buffer to the heap, where its memory might
be used again, perhaps as part of a larger buffer. Or perhaps it
may in the future be broken into several smaller buffers.
External Memory Fragmentation
• Heaps suffer from a phenomenon called "" that may cause the
heap services to degrade. This fragmentation is caused by the
fact that when a buffer is returned to the heap, it may in the
future be broken into smaller buffers when "malloc" requests
for smaller buffer sizes occur. After a heap undergoes many
cycles of "malloc"s and "free"s, small slivers of memory may
appear between memory buffers that are being used by tasks.
These slivers are so small that they are useless to tasks. But
they are trapped between buffers that are being used by
tasks, so they cann’t be coagulated ("glued") together into
bigger, useful buffer sizes. Over time, a heap will have more
and more of these slivers. This will eventually result in
situations where tasks will ask for memory buffers ("malloc")
of a certain size, and they will be refused by the operating
system --- even though the operating system has enough
available memory in its heap. The problem: That memory is
scattered in small slivers distributed in various separate parts
of the heap. In operating system terminology, the slivers are
called "fragments", and this problem is called "external
Garbage Collection-Defragmentation
• This fragmentation problem can be solved by so-called "garbage collection"
(defragmentation) software. Unfortunately, "garbage collection" algorithms are
often wildly non-deterministic , injecting randomly-appearing random-duration
delays into heap services. These are often seen in the memory allocation services
of general-computing non-real-time operating systems.
This puts the embedded system developer who wants to use a general-computing
non-real-time operating system into a confusing state:

• Should the embedded system be allowed to suffer occasional randomly-appearing


random-duration delays if / when "garbage collection" kicks in?...
• Or, alternatively, should the embedded system be allowed to fragment its memory
until application software "malloc" requests to the heap are refused even though a
sufficient total amount of free memory is still available? Neither alternative is
acceptable for embedded systems that need to provide service continually for long
periods of time.
Real-time operating systems, on the other hand, solve this by altogether avoiding
both memory fragmentation and "garbage collection", and their consequences.
RTOSs offer non-fragmenting memory allocation techniques instead of heaps. They
do this by limiting the variety of memory chunk sizes they make available to
application software. While this approach is less flexible than the approach taken
by memory heaps, they do avoid external memory fragmentation and avoid the
need for defragmentation. For example, the "Pools" memory allocation
mechanism allows application software to allocate chunks of memory of perhaps 4
Figure 7: A Memory Pool's Free Buffer Lists

Memory is allocated and de-allocated from a pool with deterministic,


often constant, timing.
Summary
• Real-time and embedded systems are used in many
applications such as airborne computers, medical instruments
and communication systems.

• Embedded systems are characterized by limited processor


memory, limited processing power, and unusual interfaces to
the outside world. Real-time requirements impose stringent
time deadlines for delivering the results of embedded
processing.

• RTOS kernels hide from application software the low-level


details of system hardware, and at the same time provide
several categories of services to application software. These
include:
1. Task management with priority-based preemptive
scheduling
2. Reliable intertask communication and synchronization
3. Non-fragmenting dynamic memory allocation,
Applications of
Embedded
Operating Systems

• Symbian: It is used in mobile phones mainly in Nokia.


• BlackBerry Operating System: It is particularly used
in BlackBerry Phones,
• Embedded Linux: It is used in Android phones and
other devices like printers.
• IOS: It is used in MAC operating systems and other
Apple devices.
• Windows Mobile Operating System: It is used in
window phones.
Enrichment Activity …3
Compare different Operating Systems used for
embedded system designing.
• References
• Wikipedia
• Research gate
• Slideshare
• YouTube videos
• Online content
• Book by AVR Microcontroller and Embedded
Systems.. By MAZIDI

You might also like