You are on page 1of 67

An Introduction to Embedded Systems

Dr. Manish Tiwari


MNNIT Allahabad
Presentation Objectives
• Define & Identify an Embedded System.

• Provide a simple in sight to Embedded Systems.

• Enlist some of the required tools.

• Introduce you toto component


Click add text selection.
• Enlist simple requirements of system design.

• Make you understand why you must learn the


subject of Embedded Systems.

Embedded Systems – Manish Tiwari 2


Embedded Systems
D “Embedded Systems are the dedicated systems
built around a computer hardware, usually a
E
microprocessor or a microcontroller. The
F computer hardware is hidden or embedded in
the system, so the name Embedded System.”
I
• Designed to be an stand alone system.
N • Designed to occupy a smaller area.

• High performance lower cost & higher speed


E
are the characteristics of Embedded Systems.
Embedded Systems – Manish Tiwari 3
Application Areas
I

O
Embedded Systems – Manish Tiwari 4
Product with Embedded Systems
• VCRs, DVD players
• Cell phone
• Microwave
• Washer
• Camera
• Cars (antilock brake system, air-bag, gas
injection, electricity distribution..)
• Printers, copiers
• Fax Machines
• Video Games

Embedded Systems – Manish Tiwari 5


But …… it Raise Questions ?????
I • They seem to cover almost each & every
application area.

N • How they are different from other systems?


• Does this mean that all the computer based
T systems are embedded systems?
• Does it mean that all the fixed mechanism
R systems are embedded systems?
• Is it really worth to study such dedicated
systems, in the era of high performance
O General Purpose Computer Systems?
Embedded Systems – Manish Tiwari 6
Embedded Systems
I

N Many efforts have been made to answer these


questions with certain level of clarity. Here are
T few descriptions that might be helpful.

O
Embedded Systems – Manish Tiwari 7
Embedded Systems
I “An Embedded Systems is a system whose
principle function is not computational, but which
N is controlled by a computer embedded within it.
The computer is likely to be a microprocessor or
T
a microcontroller. The word embedded implies
that it lies inside the overall system, hidden from
R
view, forming an integral part of greater whole. ”
- Tim Wilmshurst
O
Embedded Systems – Manish Tiwari 8
Embedded Systems
I “It is any device that includes a programmable
computer but is not itself intended to be a
N general purpose computer.” - Wayne Wolf

T “Embedded Systems are the electronic systems


that may contain a microprocessor or a
R microcontroller, but we do not think of them as
computers, the computer is hidden or embedded
O in the system.” – Todd D. Morton
Embedded Systems – Manish Tiwari 9
Embedded Systems
I “It is a dedicated computer based system for an
application or product. It may be an independent
N or part of a large system. It has a dedicated
purpose software embedded into a ROM device.”
T
“An Embedded System is a system that has

R software embedded into computer-hardware,


which makes a system dedicated for an

O application (s) or specific part of an application


or product or part of a larger system.”
Embedded Systems – Manish Tiwari 10
Embedded Systems
I
“An Embedded System is a microcontroller
based, software driven, reliable, real time control
N
system, autonomous or human or network-

T interactive, operating on diverse physical


variables and in diverse environments and sold
R into a competitive and cost-conscious market.”
- Tim Wilmshurst
O
Embedded Systems – Manish Tiwari 11
I

N
A Comparison may also serve well.
T

O
Embedded Systems – Manish Tiwari 12
A Comparison
I General Purpose Vs Embedded Systems
General Purpose Embedded

N High computing performance Low computing performance

End-user programmable Developer programmable

T GUI GUI or non-GUI

Few memory / storage / power High resource constraints


constraints (economics dominate)

R Multi-purpose to end-user Typically dedicated function

Operated when user runs Typically operating 24/7 or

O application always when switched on

Embedded Systems – Manish Tiwari 13


Embedded Systems
R
“An Embedded system is one that has
E
computer hardware with software embedded
D
in it as one of its most important component.”
E • It is a dedicated computer based system for
F an application or product.
I • It may be either independent or a part of a
N larger system.
E • Its software is embedded in a ROM so it does
D not need secondary memory as in computer .
Embedded Systems – Manish Tiwari 14
C Embedded System Design
O • Throughput Performance.
N • Response Time/Process Deadlines.
S • Power Dissipation.
T • User Interfaces.
R
• Size of End Product.
A
• Nonrecurring Design Costs/Engineering Costs.
I
• Manufacturing costs.
N
• Total Cost of End Product.
T
• Prototype Development Time.
S Embedded Systems – Manish Tiwari 15
C Embedded System Design
O • Time to Reach Market.
N • Survivability.
S • Availability.
T • Testability.
R
• Maintainability.
A
• Flexibility.
I
• Reliability.
N
• User Safety.
T
• Security.
S Embedded Systems – Manish Tiwari 16
C Embedded System
O Three main embedded components -
• Embeds hardware to give computer like
M
functionalities.
P
• Embeds main application software into a ROM
O
or flash device. The application software may
N
perform multiple or series of concurrent tasks.
E • Embeds a Real Time Operating System (RTOS)
N that supervises the application software to meet
T the given constraints & deadlines. 
S Embedded Systems – Manish Tiwari 17
C Hardware
O
M
P
O
N
E
N
T
S Embedded Systems – Manish Tiwari 18
C Hardware
O • Since computation is not the primary goal of
M embedded systems, the main hardware
P component is most often a microcontroller
O (8051, 8751 etc) or in some cases a

N microprocessor (Z80, 8085 etc).

E • Other hardware components include Real Time

N Clock (RTC), Power Supplies, Reset Circuitry,


Watch Dog Timers, ………
T
S Embedded Systems – Manish Tiwari 19
C Embedded Software
O • Embedded software is most often designed for
M deterministic performance. They are designed
P to keep in view three constraints -
O • Available system-memory.
N • Available processor speed.
E • Limited power dissipation when running the

N system continuously in cycle of start, stop, run,

T wait, sleep and wake-up.

S Embedded Systems – Manish Tiwari 20


C RTOS
O • An RTOS is an operating system for response

M time controlled and event controlled processes.


P • It is an OS for Embedded Systems as these

O have real time programming issues to solve.

N • Enables execution of concurrent tasks .

E • Provides a mechanism to let the processor run

N each process as per scheduling and to do


context-switch between the various tasks.
T
S Embedded Systems – Manish Tiwari 21
Embedded System Classification

• Small Scale Embedded Systems.

• Medium Scale Embedded System.

• Sophisticated Embedded System.

Embedded Systems – Manish Tiwari 22


C Small Scale Embedded Systems
L
• Designed around an 8-bit/16-bit microcontroller.
A
S • They may occasionally be designed around 8-bit
S microprocessors.
I
• Have little Hardware and Software complexities.
F
I • Usually involves a board level design.
C • Normally they are battery operated.
A
• Generally they don’t need RTOS.
T
I • e.g. Washing Machine, Digital Diary, Printers, TV
O Remote, Fax, Photocopier ………
N Embedded Systems – Manish Tiwari 23
C Small Scale Embedded Systems
L
A • Limiting power dissipation is a very important
S design issue in these systems.
S
• C programming language is main software tool for
I
F these systems.
I • The Application Software has to fit in available
C memory, so program optimization is must.
A
• A Comprehensive understanding of Microcontroller
T
I and its Interfacing, Interrupt handling, memory
O optimization are must required skills for design.
N Embedded Systems – Manish Tiwari 24
C Medium Scale Embedded Systems
L
A • Designed around one or more 16-bit/32-bit
S microcontrollers or DSPs or RISCs.
S • Both hardware and software complexities are
I
F much more than the small scale embedded
I systems.
C • WDTs are required to define time constraints.
A
• e.g. Bank ATMs, Credit Card Transactions,
T
I Image & Speech Processing, Pocket PCs or
O PDAs, Network Routers, Bridges ……
N Embedded Systems – Manish Tiwari 25
C Medium Scale Embedded Systems
L
A • They require RTOS to fulfill the system
S
requirements for application.
S
I • The interrupt latency control is crucial.

F • Atomic Operation Units (AOUs) should be used


I
avoid loss/corruption of shared data.
C
• Tools like IDE (Integrated Development
A
T Environment), Source code Engineering tools,
I Debugger are used for developing software.
O
N Embedded Systems – Manish Tiwari 26
C Sophisticated Embedded Systems
L
A • Designed around Scalable or Configurable
S processors, Embedded Processors and multiple
S
PLAs.
I
F • They have enormous software and hardware
I complexities.
C • e.g. Real Time Multimedia Processing, Ultra
A
T High Speed and Large BW Routers, Space Life
I Boat (Fault tolerance system), High Speed N/w
O Security, AWACS (Adv Warning & Control Sys).
N Embedded Systems – Manish Tiwari 27
C Sophisticated Embedded Systems
L
A • They are constrained by the processing speed
S available in the hardware units with the State of
S Art.
I
• Certain software features like Encryption,
F
I Decryption, Network Drives, Protocol Stacking
C etc are realized through hardware.
A
• They are used in cutting edge application.
T
I • Development tools may not be available at all.
O
N Embedded Systems – Manish Tiwari 28
C Sophisticated Embedded Systems
L
A • Special tools might have to be developed.
S • A team of different specialty people is the main
S development tool.
I
• Team working & Team Spirit is required skill.
F
I
C
A
T
I
O
N Embedded Systems – Manish Tiwari 29
HARDWARE UNITS in ES

Embedded Systems – Manish Tiwari 30


Hardware Units
• Processors
• Memory Units
• Real Time Clock
• Power Supplies
• Reset Cicuitaries
• Watch Dog Timers
• ADCs & DACs

Embedded Systems – Manish Tiwari 31


Processors
H Embedded Systems for a wide spectrum of
A applications need different hardware processing
R features. Some of them are -
• Data Length in Byte/Word/Double Words etc.
D
• Internal & External bus width in data path.
W
• Supported amount of Program & Data Memory.
A • Efficiency of Instruction Set.
R • Ability to solve complex algorithms in deadlines.
E • Power Management Options.
Embedded Systems – Manish Tiwari 32
Processors
H
Clock frequency in MHz & Processor Performance
A Metrics –
R •Million Instructions Per Second (MIPS).
D •Million Floating Point Instructions per Second

W (MFLOPS).
•Dhrystone is a benchmarking program, that
A
measures the CPU performance in processing
R
integers and strings. It benchmarks a CPU, not
E the IO or OS. 1 MIPS=1757 Dhrystones/sec.
Embedded Systems – Manish Tiwari 33
A Princeton Vs Harvard
R • Initiated by DoD in late 30s.
C • University of Princeton & Harvard were asked to
H come up with a computer architecture that
I
could be used for Naval Artillery under different
T
conditions.
E
C • Design from Princeton was called Princeton or
T more popularly Von Neumann Architecture.
U • Harvard design was called Harvard Architecture.
R
E Embedded Systems – Manish Tiwari 34
8085 Memory Connection
P AD0-AD7

R
I A8-A15

N
C
E
T
O
N
• Only one memory interface, for both Program & Data making it Princetorn
Architecture.

Embedded Systems – Manish Tiwari 35


Harvard Memory Connection
H
A
R
Program memory interface
V
A
R
D Data memory interface
Embedded Systems – Manish Tiwari 36
Modified Harvard Memory
H Connection

A
R
V
A
R
• Two memory interfaces (Program & Data) making it Harvard Architecture.

D • Two interfaces with single address & data bus makes it Modified Harvard
Architecture.
Embedded Systems – Manish Tiwari 37
A CISC Vs RISC
R • CISC – Complex Instruction Set Computer.
C – Micro Programmed Control Unit.
H – Have a vast and rich instruction set.
I
– Various permutations are possible for same
T
E work. e.g. MOV in 8085 has 63 variations
C while over 10,000 MOV variations in 8086.
T – Compiler Design is very easy.
U – Processing Capability is very high.
R – Supposed to be slower than RISC.
E Embedded Systems – Manish Tiwari 38
A CISC Vs RISC
R • RISC – Reduced Instruction Set Computer.
C – Hard Wired Control Unit.
H
– Limited & speed optimized instruction set.
I
T – Don’t have much flexibility in instructions.
E – Compiler Design is tedious as instructions
C are not flexible as CISC.
T – Processing Capability is limited but very
U
efficient and very fast for the applications
R
they are designed.
E Embedded Systems – Manish Tiwari 39
A CISC Vs RISC
R • Optimizing instructions in RISC simplify the job.
C • There are instructions that are same for each &
H every operand i.e. one instruction will do same
I processing on any operand. This is called
T Symmetrical or Orthogonal core.
E • RISC processors are not always faster than
C CISC.
T • In some cases even they are unable to
U
complete the task.
R
• Many processors have a RISC core with CISC.
E Embedded Systems – Manish Tiwari 40
General Purpose Processors
H (GPPs)
• Embedded Systems processing core frequently
A uses General Purpose Processors (GPPs).
R – Microcontrollers
– Microprocessors
D
– Embedded Processors
W
– Digital Signal Processors
A
R
E
Embedded Systems – Manish Tiwari 41
GPPs
H • GPPs are used in embedded systems due to following

A advantages
– Use of known instruction set results in faster system
R
development.
D – Design boards, I/O interfacing circuits are readily

W available. Change of embedded software makes them


reusable for a variety of applications.
A – Ready availability of compilers to facilitate software
R development in high level language.
– Ready availability of well tested and debugged
E
software routines.
Embedded Systems – Manish Tiwari 42
Processors
H • A MICROCONROLLER, or a single chip
A MICROCOMPUTER is a device with limited
R processing capability, ROM, RAM, I/O ports, Serial
Ports, Timers, ADC, PWM etc, all built on a single
D
chip.
W
• Microcontrollers are used when, a part of the
A embedded software has to be located in internal
R memory, and when on chip functionalities like

E ADC, PWM, Interrupt Handlers etc are needed.

Embedded Systems – Manish Tiwari 43


Processors
H
• A CPU of a computer system built on a single
A chip is referred as a MICROPROCESSR.
R • They may also contains a floating point unit,
D caches, prefetch units etc ……

W • A Microprocessors is used when large amount


of embedded software is to be located in
A
external memory chips and a relatively efficient
R
processing is required by the embedded
E systems.
Embedded Systems – Manish Tiwari 44
Processors
H
• Microprocessors or Microcontrollers, specially
A designed to suit embedded system design are
R called, Embedded Processors.
D • An Embedded Processor is used when besides

W fast processing, fast context switching and


atomic ALU operations are required.
A
• A DSP Processor is used when signal
R
processing functions are to be processed fast.
E
Embedded Systems – Manish Tiwari 45
Processors
H
• System on Chip (SoC) is a chip that have all
A
the required hardware components, needed to
R design an Embedded System, are built on a
D single chip.
W • An embedded processor is a part of SoC.

A • An SoC may contain Multiple Processors,


Memories, FPGAs, DCT for Signal Processing,
R
IP (Intellectual Property) cores etc.
E
Embedded Systems – Manish Tiwari 46
Memory
H
• ROM (Read Only Memory) is a generic name
A
for read only memory devices.
R • RAM (Random Access Memory) is a generic
D name for read/write memory
W • DRAM (Dynamic RAM)

A • SRAM (Static RAM)


• NVRAM (Non Volatile SRAM) refers to
R
battery backed up SRAM.
E
Embedded Systems – Manish Tiwari 47
Memory
H
• Masked ROM
A
• Advantageous when product development is
R stabilized after debugging.
D • Cost effective solution for mass production
W of end products.

A • For small volumes cheaper OTP versions are


very popular choice.
R
E
Embedded Systems – Manish Tiwari 48
Memory
H
• EPROM (Erasable Programmable ROM)/UVPROM
A
• Advantageous when requirements of end
R product changes time to time.
D • Most suitable when a large variety of end
W product has to be introduced in market.

A • Are used for data logging after a large time


interval e.g. peak temperature in a day.
R
• Must be removed from board for
E
reprogramming.
Embedded Systems – Manish Tiwari 49
Memory
H
• E-EPROM/FLASH
A
• Advantageous in software debugging.
R • Useful in runtime data logging.
D • Are the best solution when runtime changes
W in operating parameters are inevitable.

A • Are costly.

R
E
Embedded Systems – Manish Tiwari 50
Power Supply
H
• Total power consumption by the system must
A
be optimized.
R • The power supply have a specific range.
D • The flow of voltage and the connection
W depend upon the number of supply pin in the

A chip.
• System which do not have a power of their
R
own connect to external power supply.
E
Embedded Systems – Manish Tiwari 51
Real Time Clock (RTC)
H
• Real time means continuously flowing time that
A
neither stops nor comes back ……………
R • So is a Real Time Clock. Means a clock circuit
D that ones start with power on, continuously
W works, can not be stopped, can not be altered,

A and can not be reset to initial state.


• A timer circuit configured in the system clock is
R
called real time clock (RTC). An RTC is used by
E
the scheduler for real time programming.
Embedded Systems – Manish Tiwari 52
Reset Circuits
H • The Reset circuit activates for a fixed period
A and then deactivates. The processor keeps the
R Reset pins active and deactivates to let the
D program proceed from a default beginning.
• A program that is reset and runs on a power-on
W
may be –
A
– A System Boot Up Program.
R – A System Initialization Program.
E – A System program that check for errors.
Embedded Systems – Manish Tiwari 53
Interrupt Handler
H • An efficient way to save the processor’s time
A and serve, Devices Connected in the System,
R Software Exceptions, is Interrupt.

D • Whenever an Interrupt occur processor can


execute an ISR to serve the source raising it.
W
• A Hardware Interrupt-Handing Mechanism must
A
exist in system to – Priorities the interrupts,
R Resolve Priorities of Multiple Interrupts,
E Selectively Mask & Unmask the interrupts etc.
Embedded Systems – Manish Tiwari 54
Watchdog Timer Reset
H
• Watchdog timer is a timer that reset the
A processor after a predefined period of time if a
R program gets stuck for an unexpected time.
D • It is activated within the first few clock cycles

W after power-up.
• Before entering in a loop, embedded software
A
initiates it for a fixed time. If within that time
R
timer is not reset or reinitiated then after the
E configured amount of time it resets the system.
Embedded Systems – Manish Tiwari 55
Embedded System Software
S • An embedded system processor and the system
O need software that is specific to a given
F application of that system.
T • Code must take advantages of power optimizing

W features of processor.
• Reduction in Power Dissipation has always been
A
an issue in Embedded system designs.
R • Here is why ???????
E
Embedded Systems – Manish Tiwari 56
Embedded System Software
S • What if you need to replace the batteries of
O your Scientific Calculators
F – Once in a month.
– Once in two months.
T
– Even once in Six months.
W • Such dissatisfaction will fail your design as when
A it comes to market there is always some one
R with design better than you.

E • Software may help you reduce the power needs.

Embedded Systems – Manish Tiwari 57


Embedded System Software
S • Recall the TV Remotes, they don’t even have an
O ON/OFF button for themselves.
F • Would you like to use a Remote Control that
asks you to replace its battery (since no power
T
button).
W – Once in a month.
A – Even once in two months.
• Unsatisfied customer may replace whole
R
product.
E • Software will help in Power Optimization.
Embedded Systems – Manish Tiwari 58
Embedded System Software
S • Infinite loop programming is a feature of
O Embedded Programming.
F – Recall the remote control of a TV.
– No one would appreciated much if first they
T
had to turn ON the remote and then the TV.
W • Embedded Systems are always on their toe
A 24/7, always ready to serve.
R • Yet another reason why code must take
advantages of power optimizing features of
E
processor.
Embedded Systems – Manish Tiwari 59
Embedded System Software
S • Recursive routines must not be used.
O • MACROs may turn out to be disadvantage in
F embedded programming.
T • But Why….??????
–I made Factorial Program easily with
W
recursion.
A – MACROs helped reducing program writing
R time.
E • You will Run Out of Memory.
Embedded Systems – Manish Tiwari 60
Embedded System Software
S
O The Out Come
F • Code must take advantages of power
T optimizing features of processor.
W • Codes must be optimized not only for
A power but also for speed, memory
R etc.
E
Embedded Systems – Manish Tiwari 61
ALP into ROM Image
S
O
F
T
W
A
R
E
Embedded Systems – Manish Tiwari 62
Software in High Level Language
S
O
F
T
W
A
R
E
Embedded Systems – Manish Tiwari 63
Real Time Operating System
• RTOS is an OS for Real Time Task-Scheduling
R and interrupt latency controlled processes.
• An RTOS sets the rules during execution of
T application processes to enable a process
finish within the assigned time interval and
O
with assigned priority.
• It organize access to right system resources at
S
right time at right place according to priorities
and timing constraints of tasks.
Embedded Systems – Manish Tiwari 64
• An RTOS is necessary when scheduling of

R multiple processes, ISRs, devices with real time


constraints is required.
T • Functions of RTOS include time allocation and
de-allocation to attain the best utilization in the
O given time constraints of the tasks.
• It uses real time clock for scheduling multiple
S tasks according to priorities and constraints in
real time.
Embedded Systems – Manish Tiwari 65
R A Real Time Operating System is
needed when the application tasks
T
for the system have real time
O constraints and deadlines for
finishing the tasks
S

Embedded Systems – Manish Tiwari 66


Example RTOS

R • OS COS-II
• Vx Works
T • Windows CE
• OSEK
O • Linux 2.6.24 or RT Linux
• QNX
S

Embedded Systems – Manish Tiwari 67

You might also like