You are on page 1of 39

Debre Berhan University

Department of Computer science


Real Times and Embedded Systems

1-1
The course will enable you to:
 Understand and design embedded systems and real-time systems
 For embedded systems it will enable you to :

 Understand the basics of an embedded system


 Program an embedded system
 Design, implement and test an embedded system.

 For real-time systems:


 Identify the unique characteristics of real-time systems
 Explain the general structure of a real-time system
 Define the unique design problems and challenges of real-time systems
 Apply real-time systems design techniques to various software programs. 2
Chapter one : Introduction to Embedded Systems
 Definition of Embedded Systems

 Embedded Systems Characteristics

 Application area of Embedded Systems

 Contrast Between Embedded Systems and Other Computer Systems

1-3
What is Embedded System?
 An Electronic/Electro mechanical system which is designed to perform a specific
function and is a combination of both hardware and firmware (Software)
E.g. Electronic Toys, Mobile Handsets, Washing Machines, Air Conditioners,
Automotive Control Units, Set Top Box, DVD Player etc…
Embedded Systems are:
 Computer based systems that do not appear to be computers – Complexity is hidden from
the user
 Complexity is embedded inside the device- the user doesn’t have to deal with the
complexity
 Much more common that laptops or desktops

1-4
 They interact with users via simple interfaces
 Digital camera, TV, Cellphone
 Embedded systems tend to be application specific
 Perform one task or set of related tasks
 Some devices blur the line(e.g. cellphones)
 Design is focused on one application— unlike general purpose systems(e.g.
laptops)
 High design efficiency is possible: Special purpose Vs. General purpose(e.g.
Video games)
What is Embedded System?
 Hardware and software often designed together:
 General purpose systems use hardware and software developed by different
companies
 Takes data from the outside world and output data to the outside world

 Generic embedded system structure

1-6
Embedded Systems Definition
Precisely defining embedded system is difficult. The following definitions holds true :
 An embedded system is a special-purpose computer system designed to perform one or a
few dedicated functions, sometimes with real-time computing constraints
 Specialized computer system hardware that is used in larger systems or machines to
control devices such as automobiles, home appliances, and office equipment .
 Any electronic system that uses a CPU chip, but that is not a general-purpose,
workstation, desktop or laptop computer. Such systems generally use microprocessors, or
they may use custom-designed chips or both.

1-7
Embedded Systems Definition
 An embedded system is some combination of computer hardware and software, either fixed
in capability or programmable, that is specifically designed for a particular kind of
application device.
 An embedded system is a combination of computer circuitry and software that is built into a
product for purposes such as control, monitoring and communication without human
intervention.
 IEEE defines Embedded Systems as: “the devices used to control, monitor or assist the
operation of equipment, machinery or plant’’. “Embedded” reflects the fact that they are an
integral part of the system.

1-8
Classification of Embedded Systems
 Based on Generation  Based on deterministic behavior
 Based on Complexity & Performance Requirements  Based on Triggering
Embedded Systems - Classification based on Generation

 First Generation: The early embedded systems built around 8-bit microprocessors like 8085 and Z80

and 4-bit microcontrollers

• EX. stepper motor control units, Digital Telephone Keypads etc.

 Second Generation: Embedded Systems built around 16-bit microprocessors and 8 or 16-bit microcontrollers, following the

first generation embedded systems

• EX.SCADA, Data Acquisition Systems etc.

 Third Generation: Embedded Systems built around high performance 16/32 bit Microprocessors/controllers, Application

Specific Instruction set processors like Digital Signal Processors (DSPs), and Application Specific Integrated Circuits

(ASICs).The instruction set is complex and powerful.

• EX. Robotics, industrial process control, networking etc.


 Fourth Generation: Embedded Systems built around System on Chips (SoC’s), Re- configurable processors
and multicore processors. It brings high performance, tight integration and miniaturization into the embedded
device market
EX Smart phone devices, MIDs etc.
2. Embedded Systems - Classification based on Complexity & Performance

 Small Scale: The embedded systems built around low performance and low cost 8 or 16 bit microprocessors/
microcontrollers. It is suitable for simple applications and where performance is not time critical. It may or
may not contain OS.

 Medium Scale: Embedded Systems built around medium performance, low cost 16 or 32 bit
microprocessors / microcontrollers or DSPs. These are slightly complex in hardware and
firmware. It may contain GPOS/RTOS.
Large Scale/Complex: Embedded Systems built around high performance 32 or 64 bit RISC
processors/controllers, RSoC or multi-core processors and PLD.
It requires complex hardware and software. These system may contain multiple
processors/controllers and co-units/hardware accelerators for offloading the processing
requirements from the main processor. It contains RTOS for scheduling, prioritization and
management.
3.Embedded Systems - Classification Based on deterministic behavior: It is applicable for Real Time systems. The

application/task execution behavior for an embedded system can be either deterministic or non-deterministic

 These are classified in to two types

1. Soft Real time Systems: Missing a deadline may not be critical and can be tolerated to a certain degree

2. Hard Real time systems: Missing a program/task execution time deadline can have catastrophic consequences

(financial, human loss of life, etc.)

4.Embedded Systems - Classification Based on Triggering: These are classified into two types

1. Event Triggered : Activities within the system (e.g., task run-times) are dynamic and depend upon occurrence of different

events .

2. Time triggered: Activities within the system follow a statically computed schedule (i.e., they are allocated time
Components of embedded system
a) Hardware :The hardware of embedded systems is based around microprocessors
and microcontrollers. Microprocessors are very similar to microcontrollers and, typically,
refer to a CPU (central processing unit) that is integrated with other basic computing
components such as memory chips and digital signal processors (DSPs). Microcontrollers
have those components built into one chip.
In terms of hardware, a basic embedded system would consist of the following elements:
Sensors convert physical sense data into an electrical signal.
Analog-to-digital (A-D) converters change an analog electrical signal into a digital one.
Processors process digital signals and store them in memory.
Digital-to-analog (D-A) converters change the digital data from the processor into analog data.
Actuators compare actual output to memory-stored output and choose the correct one.
Component of embedded system cont.…
b). Real times operating system: These are not always included in
embedded systems, especially smaller-scale systems. RTOSes define how the
system works by supervising the software and setting rules during program
execution.

c. Application specific software: Software for embedded systems can


vary in complexity. However, industrial-grade microcontrollers and embedded IoT

systems usually run very simple software that requires little memory .
Block diagram of embedded system

Input devices / interfacing driver


Power supply Output interfacing driver circuit
circuit

Serial and parallel


Timer processor
communication port

Program memory and data System application software


Interrupt counter
memory circuit
Embedded Systems Characteristics

Common characteristics of Embedded Systems are the following:


 Frequently, embedded systems are connected to the physical environment through
sensors collecting information about that environment and actuators controlling that
environment.
 Embedded systems have to be dependable (trusted). Many ES are safety-critical.
Examples of safety critical systems are Nuclear power plants, airplanes, trains, cars,
satellites etc.

1-15
Embedded Systems Characteristics cont.…
The important characteristics of an embedded system are

 Speed (bytes/sec) : should be high speed


 Power (watts): low power dissipation
 Size and weight: as far as possible small in size and low weight
 Percentage error: must be very accurate
 Adaptability: high adaptability and
 Accessibility Reliability: must be reliable over a long period of time
1-16
Embedded Systems Characteristics cont.…
Dependability encompasses the following aspects of a system:

1. Reliability: Reliability is the probability that a system will not fail.

2. Maintainability: Maintainability is the probability that a failing system can be repaired within a certain
time-frame.

3. Availability: Availability is the probability that the system is available. Both the reliability and the
maintainability must be high in order to achieve a high availability.

4. Safety: This term describes the property that a failing system will not cause any harm.

5. Security: This term describes the property that confidential data remains confidential

and that authentic communication is guaranteed.


1-17
Embedded Systems Characteristics cont.…
 Embedded systems have to be efficient. The following metrics can be used for evaluating the

efficiency of embedded systems:

1. Energy: Many embedded systems are mobile systems obtaining their energy through

batteries. Available electrical energy must be used very efficiently.

2. Code-size: the code-size should be as small as possible for the intended application.

3. Weight: All portable systems must be of low weight. Low weight is frequently an

important argument for buying a certain system. 1-18


Embedded Systems Characteristics cont.

4. Cost: For high-volume embedded systems, especially in consumer electronics,

competitiveness on the market is an extremely crucial issue, and efficient use of hardware

components and the software development budget are required.

5. Run-time efficiency: We should be able to meet time constraints using the least amount of

hardware resources and energy. In order to reduce the energy consumption, clock frequencies

and supply voltages should be as small as possible.

1-19
Embedded Systems Characteristics cont.…
 These systems are dedicated towards a certain application.
 For example, processors running control software in a car or a train will always run that
software, and there will be no attempt to run a computer game or spreadsheet program on
the same processor.
 There are mainly two reasons for this:

 Running additional programs would make those systems less dependable.

 Running additional programs is only feasible if resources such as memory are unused.
No unused resources should be present in an efficient system.

1-20
Embedded Systems Characteristics cont.…

 Most embedded systems use a dedicated user-interface consisting of push-buttons, steering

wheels, pedals etc. Because of this, the user hardly recognizes that information processing is

involved.

 Many embedded systems must meet real-time constraints. Not completing computations

within a given time-frame can result in a serious loss of the quality provided by the system.

 A time-constraint is called hard if not meeting that constraint could result in a catastrophe.

All other time constraints are called soft 1-21


Embedded Systems Characteristics cont.…

 Many embedded systems are hybrid systems in the sense that they include analog and

digital parts.

 Typically, embedded systems are reactive systems. A reactive system is one that is in

continual interaction with its environment and executes at a pace determined by that

environment.

1-22
Embedded Systems Characteristics cont.…
Embedded Systems application
 Even though often nearly invisible, embedded systems are ubiquitous(being everywhere at the

same time).

 Embedded systems are present in many industries, including industrial automation, defense,

transportation, and aerospace.

 For example, NASA’s Mars Path Finder, Lockheed Martin’s missile guidance system, and the

Ford automobile all contain numerous embedded systems.

 Every day, people throughout the world use embedded systems without even knowing it.
 Remarkably adaptable and versatile, embedded systems can be found at home, at work,
1-24
Indeed, it is difficult to find a segment of daily life that does not involve embedded systems in
Major Application Areas of Embedded Systems
 Automotive electronics: Modern cars can be sold only if they contain a significant amount of electronics.
These include air bag control systems, engine control systems, anti-braking systems (ABS), air-
conditioning, GPS systems, safety features, and many more.
 Aircraft electronics: A significant amount of the total value of airplanes is due to the information processing
equipment, including flight control systems, anti-collision systems, pilot information systems, and others.
Dependability is of utmost importance.
 Consumer Electronics: Camcorders, Cameras etc.
 Trains: Again, safety features contribute significantly to the total value of trains, and dependability is
extremely important..
 Medical systems: There is a huge potential for improving the medical service by taking advantage of
information processing taking place within medical equipment.
 Military applications: Information processing has been used in military equipment for many years. In fact,
1-25
 Authentication systems: Embedded systems can be used for authentication purposes.
 Fabrication equipment: Fabrication equipment is a very traditional area in which
embedded systems have been employed for decades. Safety is very important for such
systems, the energy consumption is less a problem
 Telecom: Cellular Telephones, Telephone switches, Handset Multimedia Applications
etc
 Computer Networking Systems: Network Routers, Switches, Hubs, Firewalls etc.
 Health Care: Different Kinds of Scanners, EEG, ECG Machines etc
 Banking & Retail: Automatic Teller Machines (ATM) and Currency counters, Point of
Sales POS)
 Card Readers: Barcode, Smart Card Readers, Hand held Devices etc
Embedded Systems Examples
Smart buildings: Information processing can be
used to increase the comfort level in buildings, can
reduce the energy consumption within buildings,
and can improve safety and security.

Robotics: Robotics is also a traditional area in


which embedded systems have been used.
Mechanical aspects are very important for robots.
1-27
Contrast Between Embedded Systems and Other Computer Systems
Computer Systems Embedded Systems

Microprocessor based Micro-controller based


Single task oriented. For example, a washing
Microprocessors are multitasking in nature.
machine is designed for washing clothes only
RAM, ROM, I/O Ports, and Timers cannot
RAM, ROM, I/O Ports, and Timers can be be added externally.These components are
added externally and can vary in to be embedded together on a chip and are
numbers. fixed in numbers.

Designers can decide the number of memory Fixed number for memory or I/O makes a
or I/O ports needed. micro-controller ideal for a limited but specific task.

External support of external memory and


Micro-controllers are lightweight and cheaper
I/O ports makes a microprocessor-based system
than a microprocessor.
heavier and costlier
External devices require more space and A micro-controller-based system consumes
their power consumption is higher. less power and takes less space.
1-28
Components of Embedded Systems
 Microcontroller: Integrated circuit that executes a program
 Connected to other hardware components
 Sends commands and receives data
 Need to be programmed
• Write a program in a language, such as C
• Place the program in the mctrlr memory

Programming microcontrollers
• Write code on a host machine– regular desktop or laptop
• Programming the microcontroller– transferring the program from host to microcontroller
• Programming hardware can be used to place program in microcontroller memory

1-29
Components of Embedded Systems
 Sensors: Receives information from the environment
 Provide simple information
• Thermistor: reports temperature
• Photoresistor: reports light intensity
 Complex sensors: more complicated data
• CMOS camera: Captures images
• Ethernet controller: enables network communication
 Actuators: Cause events to occur in the environment
 Simple actuators
• Light emitting diodes(LEDs)– Small lights
• LCD display– simple display
 Complex actuators
• Servo motor: moves something
• Ethernet controller: enables network communication

1-30
Categories of Embedded Systems
 Embedded systems are classified based on performance and functional
requirements, as well as the performance of microcontrollers.
 These classifications can be further divided into categories and subcategories.
 When classifying embedded systems based on performance and functional
requirements, embedded systems are divided into four categories:
1. Real-time embedded systems
2. Standalone embedded systems
3. Network, or networked, embedded systems
4. Mobile embedded systems
1-31
Categories of Embedded Systems
Real-time embedded systems
Real-time embedded systems must provide results or outputs promptly. Priority
is assigned to output generation speed, as real-time embedded systems are
often used in mission-critical sectors, such as defense and aerospace, that need
important data,
Examples of real-time embedded systems include:
• Aircraft controls
• Land-vehicle and flight computers that process and transmit sensor-acquired
data
1-32
Real-time embedded systems

 Real-time embedded systems are further divided into soft real-time embedded systems and
hard real-time embedded systems to account for the importance of output generation speed.
 Soft real-time embedded systems have lenient output timeframes or deadlines. If outputs are not provided in
a specified timeframe, performance decline may ensue, but the consequences of this decline are relatively
insignificant, do not constitute a system or application failure, and are unlikely to result in a harmful
outcome. The system's outputs are also still considered valuable, despite their tardiness.

 Hard real-time embedded systems are the antithesis of soft real-time embedded systems. These systems must
consistently meet their assigned output deadlines, as not doing so is considered a system or application
failure, which, in many cases, could have catastrophic outcomes because of the hard real-time embedded
system's typical deployment in mission-critical programs and applications.
Categories of Embedded Systems
Standalone embedded systems
Standalone embedded systems don't require a host computer to function. They
can produce outputs independently.

Examples of standalone embedded systems include:


• Digital cameras
• Digital wristwatches
• MP3 players
• Appliances, such as refrigerators, washing machines, and microwave ovens
• Temperature measurement systems
• Calculators

1-34
Categories of Embedded Systems
Networked embedded systems
Network, or networked, embedded systems rely on wired or wireless networks and
communication with web servers for output generation.

Frequently cited examples of network embedded systems include:


• Home and office security systems
• Automated teller machines (ATMs)
• Point-of-sale (POS) systems

Mobile embedded systems


 Mobile embedded systems refer specifically to small, portable embedded devices.

 All mobile embedded systems are standalone embedded systems, but not all standalone embedded systems
are mobile embedded 1-35
Categories of Embedded Systems
When classifying embedded systems based on the performance of microcontrollers,
embedded systems are divided into three categories:
• Small-scale embedded systems
• Medium-scale embedded systems
• Sophisticated embedded systems

 Small-scale embedded systems have an 8-bit or 16-bit microcontroller.


 Medium-scale embedded systems have a 16-bit or 32-bit microcontroller.
 Sophisticated embedded systems have multiple 32-bit or 62-bit microcontrollers.

processing speed improves as the number of microcontroller bits increase.

1-36
What is a Real-Time Embedded System?

A real-time embedded system combines the technologies of embedded systems


and real-time computing. To achieve the most complete and accurate description,
we begin with a deeper look at the defining features of these technologies.
Real-Time Operating Systems
Real-time computing describes the capability of a computing system to respond
to a given input within a tightly constrained time frame.
In the context of embedded systems, engineers implement real-time computing
by installing a special type of operating system onto the embedded device.
Operating systems can be conceptualized as the bridge between embedded
hardware and software.
There are two basic types for embedded engineers to choose from:
1. General Purpose Operating System (GPOS)
2. Real-Time Operating System (RTOS)
General Purpose Operating System (GPOS) - A GPOS is the software layer that sits
between the hardware and the application in an embedded system. GPOS consists of
the kernel, memory management, networking, and other services that are provided to
the application. A GPOS is used in cases where tasks are not time-sensitive and
computing power is valued more highly than rapid response times.

Real-Time Operating System (RTOS) - An RTOS is used for embedded systems


applications that are time-sensitive or time-critical. A time-critical task is defined as one
where the task must be performed within specified time constraints to avoid negatively
impacting users. In a time-critical system, the value of completing a task is linked to its
timeliness and tasks that are completed past the deadline may have a negative value.
RTOS includes a task scheduler component whose goal is to ensure that critical tasks
Classifications for Real-Time Embedded Systems

 Real-time embedded systems combine the functionality of a real-time operating system with a microcontroller (hardware) and

unique application (software) to solve a business problem.

 There are three types of RTOS that differ in function based on the time constraints associated with their application.

1. Hard RTOS: A hard RTOS is implemented when it is crucial that no deadlines are missed and all tasks are completed within

the prescribed time frame. In a hard RTOS, delays in the system are strictly time-bound to ensure that deadlines are met at a

100% rate and any missed deadline is considered a system failure

2. Firm RTOS: In a firm RTOS, errors are occasionally permissible but there is an understanding that missed deadlines result in

degraded performance of the device

3. Soft RTOS: In a soft RTOS, user experience is optimized when tasks are completed on-time but performance is not totally

degraded when deadlines are missed. Consider a video game console that runs a game engine: it must schedule tasks and

complete them on time for the game to run smoothly, but a little bit of lag or an occasional hiccup in performance does not

necessarily ruin the experience for the player.

You might also like