chapter 1 Introduction to embedded system
chapter 1 Introduction to embedded system
Automotive
everywhere
Ubiquitous, invisible
Hidden (computer inside) Communications
Military
Dedicated purpose
INTRODUCTION TO Embedded
System
Embedded system
Microcontroller LM3S or TM4C Electrical,
mechanical,
Processor chemical,
I/O Ports or
RAM optical
devices
ROM DAC Analog
Bus ADC signals
SYLLABUS
1.1 History of embedded systems,
1.2 Classification of embedded systems based on
generation and complexity,
1.3 Purpose of embedded systems,
1.4 The embedded system design process-
requirements, specification, architecture design,
designing hardware and software, components,
system integration,
1.5Applications of embedded systems,
1.6 characteristics of embedded systems.
What is a system?
A system is an arrangement (interconnection of
components) in which all its units assemble and work
together
SYSTEM according
EXAMPLESto the plan or program(rules).
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
WASHING MACHINE It is an
automatic clothes washing
SYSTEM
Parts: Status display panel,
Switches & Dials, Motor, Power
supply
Rules & control unit, Inner water
level
1.Washsensor and solenoid valve.
by spinning
2.Rinse
3.Drying
4.Wash over by blinking
5.Each step display the process
stage
6.In case interruption, execute
only the remaining
EMBEDDED SYSTEM
Definition: An Embedded System is one that has computer
hardware with software embedded in it as one of its important
components.
Glasses
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
PROCESSOR program. A small scale embedded system may not
need an RTOS. is the heart of the
• A Processor
Embedded System.
• For an embedded system
designer knowledge of
microprocessor and
microcontroller is a must.
Two Essential Units:
Operations
Control Unit (CU),
Parts of an Embedded System
I/O
MEMORY PROCESSOR
ACTUATORS
SENSORS
HARDWIRED UNIT
• Application-specific logic
• Timers
• A/D and D/A conversion
ENVIRONMENT
An embedded system is a combination of 3 things, Hardware
Software Mechanical Components and it is supposed to do one
specific task only. A typical embedded system contains a single
chip controller which acts as the master brain of the system.
Diagrammatically an embedded system can be represented as
follows:
VARIOUS 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
MICROPROCESSOR
• 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
Microcontroller
number of serial and parallel ports.
A microcontroller (often abbreviated MCU) is a single computer chip
(integrated circuit) that executes a user program, normally for the purpose
of controlling some device, hence the name microcontroller.
The program is normally contained either in a second chip, called an
EPROM, or within the same chip as the microcontroller itself.
Microprocessor Vs
Microcontroller
Ext int Microcontrolle
r
interrupt
CPU
Data Bus (Bi directional)
Control Lines
OSC
Microprocessor
Ext int
interrupt
Timer0
Timer1
ROM RAM
CPU
lens
4. Distributed: –
• It means that embedded systems may be a part of a larger
system.
• Many numbers of such distributed embedded systems form a
single large embedded control unit.
• Ex – Automatic vending machine. It contains a card reader, a
vending unit etc. Each of them are independent embedded units
but they work together to perform the overall vending function.
5. Small Size and Weight:-
• Product aesthetics (size, weight, shape, style, etc) is an
important factor in choosing a product.
• It is convenient to handle a compact device than a bulky
product.
6. Power Concerns:-
• Power management is another important factor that needs to be
considered in designing embedded systems.
• E.S should be designed in such a way as to minimize the heat
dissipation by the system.
7. Single-functioned:-
Dedicated to perform a single function
8. Complex functionality: -
We have to run sophisticated algorithms or multiple algorithms in
some applications.
9. Tightly-constrained:-
Low cost, low power, small, fast, etc
10. Safety-critical:-
Must not endanger human life and the environment
Quality Attributes of Embedded System:
Quality attributes are the non-functional requirements that need
to be documented properly in any system design
Quality attributes can be classified as
I. Operational quality attributes
II. Non-operational quality attributes.
I. Operational Quality Attributes:
The operational quality attributes represent the relevant quality
attributes related to the embedded system when it is in the
operational mode or online mode.
Operational Quality Attributes are:
1. Response :- It is the measure of quickness of the system.
2. Throughput :-It deals with the efficiency of a
system.
3. Reliability :It is a measure of how much we can rely upon
the proper functioning of the system.-
4. Maintainability:-• It deals with support and maintenance
to the end user or client in case of technical issues and
product failure or on the basis of a routine system checkup.
5. Security: Confidentiality, Integrity and availability are the
three major measures of information security.-
6. Safety :-Safety deals with the possible
damages that can happen to the operator, public
and the environment due to the breakdown of an
Embedded System.
II. Non-Operational Quality Attributes:
The quality attributes that needs to be addressed for the product
not on the basis of operational aspects are grouped under this
category.
1. Testability and Debug-
ability:
Testability deals with how easily one can test the design,
application and by which means it can be done
GPS & GPRS based RF transmitter and receivers (RF System) are
connected to a computer
GPS system is capable of interacting over area of 1 square metre
The GPS will transmit the data in a periodic interval continuously from the data point
Server
Block diagram of data locker
Receiver Memory
D i s p l a y
GPS & GPRS
Micro
Controller
Transmitter
sensors
Start/stop alarm
Load
Fuel
Block diagram of data point
Server
Receiver
Pump
Pump link
circuit
5. Control:-
Embedded systems with control
functionalities are used for imposing
control over some variables according to
the changes in input variables
Embedded system with control
functionality contains both sensors and
actuators
Sensors are connected to the input port for
capturing the changes in environmental
variable or measuring variable The
actuators connected to the output port are
controlled according to the changes in
input variable to put an impact on the
controlling variable to bring the controlled
variable to the specified range
Air conditioner for controlling room
temperature is a typical example for
embedded system with „Control‟
functionality Air conditioner contains a
room temperature sensing element
6. Application Specific User
Interface:-
Embedded systems which are designed for
a specific application
Contains Application Specific User interface
(rather than general standard UI ) like key
board, Display units etc
Aimed at a specific target group of users
■ Functionality: This
system is designed for
highway driving and similar
uses, not nautical or
aviation uses that require
more specialized databases
and functions. The system
should show major roads
and other landmarks
■ User interface: The screen should have at least 400_600
pixel resolution. The device should be controlled by no more than
three buttons. A menu system should pop up on the screen when
buttons
■ are pressed
Performance: The to allow
map the scroll
should user smoothly.
to make selections to
Upon power-
control
up, the system.
a display should take no more than one second to appear,
and the system should be able to verify its position and display
the current map within 15 s.
■ Cost: The selling cost (street price) of the unit should be no
more than $100.
■ Physical size and weight: The device should fit comfortably
in the palm of the hand.
Note that many of these requirements are not specified in
■Power consumption: The device should run for at least eight
engineering units—for example, physical size is measured
hours on four AA batteries.
relative to a hand, not in centimeters. Although these
requirements must ultimately be translated into something that
can be used by the designers, keeping a record of what the
customer wants can help to resolve questions about the
specification that may crop up later during design. Based on this
discussion, let‘s write a requirements chart for our moving map
system:
GPS MODULE:
LCD main
LCD
display driver Fixed-point
0 to 2.000
The Fork-Join construct is used in Parallel programming.
Structured Programming
This is different from multi-threading used in concurrent
(Distributed) programming. In multi-threading there may
be multiple threads that are active but at any given
instant only one of them is being executed.
Common Constructs (as Flowcharts)
Sequence Conditional While-loop
Block 1
main Cook
Output heat
Input from is on
switch Too cold
return
main A
void SysTick_Handler(void){
Input n from B Clock PORTA = PORTA^0x01; E
< } >
PORTB
PORTA = E void main(void){ A
PORTA^1 unsigned long n;
n = (n/4)+12 C while(1){
> n = PORTB; B
n = (n/4)+12; C
PORTD = n; D
Output n to }
PORTD D
}
< : Hardware Interrupt causing the main program to be suspended and the corresponding ISR
to execute
> : Return from Interrupt causing the control to be returned to the point where the main
program was suspended.
We say this code is multi-threaded because we have two threads: The foreground thread
computes the primes and the background thread issues a pulse. They are both active at the
same time.
Embedded systems are special, offering special
challenges to developers. Most embedded software
engineers develop a toolkit for dealing with the
constraints. Before we can start building yours, let's
look at the difficulties associated with developing an
embedded system. Once you become familiar with
how your embedded system might be limited, we'll
start on some principles to guide us to better solutions.
Debugging
Embedded systems aren't like that. In addition to a
cross compiler, you'll need a cross debugger. The
debugger sits on your computer and communicates
with the target processor through the special processor
interface. The interface is dedicated to letting
someone else eavesdrop on the processor as it works.
This interface is often called JTAG (pronounced "jay-
tag"), whether it actually implements that widespread
standard or not.
Writing software for an embedded system can be
tricky, as you have to balance the needs of the system
and the constraints of the hardware. Now you'll need
to add another item to your to-do list: making the
software debuggable in a somewhat hostile
environment.
SW Development
Environment
Editor Keil uVision TM ®
Simulated
Source code Processor
Start Microcontroller
Start
; direction register Debug
LDR R1,=GPIO_PORTD_DIR_R Session Memory
LDR R0,[R1]
ORR R0,R0,#0x0F
; make PD3-0 output I/O
STR R0, [R1]
10 kOhms
P3.0 P1.0 a a
P3.1 P1.1 b
f b
P3.2 P1.2 c g
PORT 1 (P1)
PORT 3 (P3)
P3.3 P1.3 d
c
P3.4 P1.4 e e
.5 P1.5 f
d
.6 P1.6 g
.7 P1.7
+ volts
Internal Memory
7 6 5 4 3 2 1 0
SFRs
Zone
Zone
Zone
Zone
B0h
1
2
3
4
90h
I-RAM
Input circuit , Output circuit ,
+ 5 volts a
f b
g
input x e c
d
normally closed
Switches are
Read port P3
YES
Are all
P3 inputs at 0
NO
Sound alarm
Bell
ALARM_1 Program source code