ESD Mod 2
ESD Mod 2
Following are some of the characteristics of an embedded system that make it different from a
general purpose computer:
1. Application and Domain specific
An embedded system is designed for a specific purpose only. It will not do any other task.
Ex. A washing machine can only wash, it cannot cook
Certain embedded systems are specific to a domain: ex. A hearing aid is an application
that belongs to the domain of signal processing.
1
Embedded System Design Concepts MODULE-2(BEC601)
6. Power concerns
It is desirable that the power utilization and heat dissipation of any embedded system be
low.
If more heat is dissipated then additional units like heat sinks or cooling fans need to be
added to the circuit.
If more power is required then a battery of higher power or more batteries need to be
accommodated in the embedded system
2
Embedded System Design Concepts MODULE-2(BEC601)
These are the attributes that together form the deciding factor about the quality of an embedded
system.
There are two types of quality attributes are:-
1. Operational Quality Attributes.
These are attributes related to operation or functioning of an embedded system. The way
an embedded system operates affects its overall quality.
2. Non- Operational Quality Attributes.
These are attributes not related to operation or functioning of an embedded system. The
way an embedded system operates affects its overall quality.
These are the attributes that are associated with the embedded system before it can be put
in operation.
Operational Attributes
a) Response
Response is a measure of quickness of the system.
It gives you an idea about how fast your system is tracking the input variables.
Most of the embedded system demand fast response which should be real-time.
b) Throughput
Through put deals with the efficiency of system.
It can be defined as rate of production or process of a defined process over a stated period
of time.
In case of card reader like the ones used in buses, through put mean show much
transaction the reader can perform in a minute or hour or day.
3
Embedded System Design Concepts MODULE-2(BEC601)
c) Reliability
Reliability is a measure of how much percentage you rely upon the proper functioning of
the system.
Mean Time between failures and Mean Time To Repair are terms used in defining
system reliability.
Mean Time between failures can be defined as the average time the system is functioning
before a failure occurs.
Meantime to repair can be defined as the average time the system has spent in repairs.
d) Maintainability
Maintain ability deals with support and maintenance to the end user or a client in case of
technical issues and product failures or on the basis of a routine system checkup
It can be classified into two types:-
e) Security
Confidentiality, Integrity and Availability are three corner stone’s of information security.
Confidentiality deals with protection data from unauthorized disclosure.
Integrity gives protection from unauthorized modification.
Availability gives protection from unauthorized user
4
Embedded System Design Concepts MODULE-2(BEC601)
Certain Embedded systems have to make sure they conform to the security measures.
Ex. An Electronic Safety Deposit Locker can be used only with a pin number like a
password.
f) Safety
Safety deals with the possible damage that can happen to the operating person and
environment due to the breakdown of an embedded system or due to the emission of
hazardous materials from the embedded products.
A safety analysis is a must in product engineering to evaluate the anticipated damage and
determine the best course of action to bring down the consequence of damages to an
acceptable level.
b) Evolvability
For embedded system, the qualitative attribute “Evolvability ”refer to ease with which the
embedded product can be modified to take advantage of new firmware or hardware
technology.
c) Portability
Portability is measured of “system Independence”.
5
Embedded System Design Concepts MODULE-2(BEC601)
6
Embedded System Design Concepts MODULE-2(BEC601)
SPECIFIC
2) Water pump: The water pump circulates water through the washing machine. It works in two
directions, re-circulating the water during wash cycle and draining the water during the spin
cycle
7
Embedded System Design Concepts MODULE-2(BEC601)
3) Tub: There are two types of tubs in the washing machine: inner and outer. The clothes are
loaded in the inner tub, where the clothes are washed, rinsed and dried. The inner tub has small
holes for draining the water. The external tub covers the inner tub and supports it during various
cycles of clothes washing.
8
Embedded System Design Concepts MODULE-2(BEC601)
4) Agitator or rotating disc: The agitator is located inside the tub of the washing machine. It is
the important part of the washing machine that actually performs the cleaning operation of the
clothes. During the wash cycle the agitator rotates continuously and produces strong rotating
currents within the water due to which the clothes also rotate inside the tub. The rotation of the
clothes within water containing the detergent enables the removal of the dirt particles from the
fabric of the clothes. Thus the agitator produces most important function of rubbing the clothes
with each other as well as with water.
In some washing machines, instead of the long agitator, there is a disc that contains blades on its
upper side. The rotation of the disc and the blades produce strong currents within the water and
the rubbing of clothes that helps in removing the dirt from clothes.
5) Motor of the washing machine: The motor is coupled to the agitator or the disc and produces
it rotator motion. These are multispeed motors, whose speed can be changed as per the
requirement. In the fully automatic washing machine the speed of the motor i.e. the agitator
changes automatically as per the load on the washing machine.
6) Timer: The timer helps setting the wash time for the clothes manually. In the automatic mode
the time is set automatically depending upon the number of clothes inside the washing machine.
7) Printed circuit board (PCB): The PCB comprises of the various electronic components and
circuits, which are programmed to perform in unique ways depending on the load conditions (the
condition and the amount of clothes loaded in the washing machine). They are sort of artificial
intelligence devices that sense the various external conditions and take the decisions accordingly.
These are also called as fuzzy logic systems. Thus the PCB will calculate the total weight of the
clothes, and find out the quantity of water and detergent required, and the total time required for
washing the clothes. Then they will decide the time required for washing and rinsing. The entire
processing is done on a kind of processor which may be a micro processor or microcontroller.
8) Drain pipe: The drain pipe enables removing the dirty water from the washing that has been
used for the washing purpose.
9
Embedded System Design Concepts MODULE-2(BEC601)
One of the first and very popular use of embedded system in automotive industry was
microprocessor based fuel injection.
Some of the other uses of embedded controllers in a vehicle are listed below:
a. Air Conditioner
b. Engine Control
c. Fan Control
f. Wiper control
g. Airbag control
h. Power Windows
AES are normally built around microcontrollers or DSPs or a hybrid of the two and are generally
known as Electronic Control Units (ECUs).
TYPES OF ELECTRONIC CONTROL UNITS (ECU)
1. High-speed Electronic Control Units (HECUs):
a. HECUs are deployed in critical control units requiring fast response.
b. They Include fuel injection systems, antilock brake systems, engine control, electronic throttle,
steering controls, transmission control and central control units.
2. Low Speed Electronic Control Units (LECUs):-
a. They are deployed in applications where response time is not so critical.
b. They are built around low cost microprocessors and microcontrollers and digital signal
processors.
c. Audio controller, passenger and driver door locks, door glass control etc.
10
Embedded System Design Concepts MODULE-2(BEC601)
It supports medium speed and high speed data transfer (ISO11519-class B with data rates up to 125
Kbps) and high speed (IS011898 class C with data rates up to 1 Mbps) data transfer.
CAN is an event driven protocol interface with support for error handling in data transmission.
It is generally employed in safety system like airbag control; power train systems like engine
control and Antilock Brake System (ABS); and navigation systems like GPS.
LIN bus follows the master communication triggering to eliminate the bus arbitration problem
that can occur by the simultaneous talking of different slave nodes connected to a single interface
bus.
LIN bus applications are mirror controls, fan controls, seat positioning controls, window controls,
11
Embedded System Design Concepts MODULE-2(BEC601)
Model Selection
Most often designers switch between a variety of models from the requirements
specification to the implementation aspect of the system design
For example, at the specification stage, only the functionality of the system is in
focus and not the implementation information.
When the design moves to the implementation aspect, the information about the
system components is revealed and the designer has to switch to a model capable of
capturing the system's structure.
Architecture Selection
A model only captures the system characteristics and does not provide information
on ‘how the system can be manufactured?’
12
Embedded System Design Concepts MODULE-2(BEC601)
Some of them fall into Application Specific Architecture Class (like controller
architecture), while others fall into either general purpose architecture class (CISC,
RISC, etc.) or Parallel processing class (like VLIW, SIMD, MIMD, etc.).
The controller architecture implements the finite state machine model using a state
register and two combinational circuits. The state register holds the present state
and the combinational circuits implement the logic for next state and output.
The datapath architecture is best suited for implementing the data flow graph model
where the output is generated as a result of a set of predefined computations on the
input data. A datapath represents a channel between the input and output. The
datapath may contain registers, counters; register files, memories and ports along
with high speed arithmetic units. Ports connect the datapath to multiple buses.
The Finite State Machine Datapath (FSMD) architecture combines the controller
architecture with datapath architecture. It implements a controller with datapath.
The controller generates the control input whereas the datapath processes the data.
The datapath contains two types of I/O ports, out of which one acts as the control
port for receiving/sending the control signals from/to the controller unit and the
second I/O port interfaces the datapath with external world for data input and data
output. Normally the datapath is implemented in a chip and the I/O pins of the chip
acts as the data input output ports for the chip resident data path.
The Complex Instruction Set Computing (CISC) architecture uses an instruction set
representing complex operations. It is possible for a CISC instruction set to perform
a large complex operation with a single instruction.
The Reduced Instruction Set Computing (RISC) architecture uses instruction set
representing simple operations. It requires the execution of multiple RISC
instructions to perform a complex operation.
The Very Long Instruction Word (VLIW) architecture implements multiple functional units
(ALUs, multipliers, etc.) in the datapath. The VLIW instruction packages one standard
instruction per functional unit of the datapath.
Language Selection
A model can be captured using multiple programming languages like C, C++, C#,
Java etc for software implementations and languages like VHDL, System C,
Verilog etc for hardware implementations.
13
Embedded System Design Concepts MODULE-2(BEC601)
Certain languages are good in capturing certain computational model. For example,
C++ is a good candidate for capturing an object oriented model.
Various hardware software trade-offs like performance, re-usability, effort etc are
used for making a decision on the hardware-software partitioning.
Emphasizes on the data and operations on the data which transforms the input data
to output data.
A visual model in which the operation on the data (process) is represented using a
block (circle) and data flow is represented using arrows. An inward arrow to the
process (circle) represents input data and an outward arrow from the process
(circle) represents output data in DFG notation
Best suited for modeling Embedded systems which are computational intensive
(like DSP applications)
14
Embedded System Design Concepts MODULE-2(BEC601)
A DFG model is said to be acyclic DFG (ADFG) if it doesn’t contain multiple values for the input
variable and multiple output values for a given set of input(s). Feedback inputs (Output is feed
back to Input), events etc are examples for non-acyclic inputs. A DFG model translates the
program as a single sequential process execution.
Uses Data Flow Graph (DFG) as element and conditional (constructs) as decision
makers.
CDFG contains both data flow nodes and decision nodes, whereas DFG contains
only data flow nodes
A visual model in which the operation on the data (process) is represented using a
block (circle) and data flow is represented using arrows. An inward arrow to the
process (circle) represents input data and an outward arrow from the process
(circle) represents output data in DFG notation.
The control node is represented by a ‘Diamond’ block which is the decision making
element in a normal flow chart based design
Capturing of image and storing it in the format selected (bmp, jpg, tiff, etc.) in a
digital camera is a typical example of an application that can be modeled with
CDFG.
15
Embedded System Design Concepts MODULE-2(BEC601)
Describes the system behavior with ‘States’, ‘Events’, ‘Actions’ and ‘Transitions’
An event is an input to the state. The event acts as stimuli for state transition.
A Finite State Machine (FSM) Model is one in which the number of states are
finite. In other words the system is described using a finite number of possible
states
Most of the time State Machine model translates the requirements into sequence
driven program
HCFSM uses state charts for capturing the states, transitions, events and actions.
The Harel State chart, UML State diagram etc are examples for popular state charts
used for the HCFSM modeling of embedded systems.
16
Embedded System Design Concepts MODULE-2(BEC601)
Requirement:
When the vehicle ignition is turned on and the seat belt is not fastened within 10
seconds of ignition ON, the system generates an alarm signal for 5 seconds. The
Alarm is turned off when the alarm time (5 seconds) expires or if the
driver/passenger fastens the belt or if the ignition switch is turned off, which ever
happens first.
The program instructions are iterated and executed conditionally and the data gets
transformed through a series of operations
Flow Charts is another important tool used for modeling sequential program
The FSM approach represents the states, events, transitions and actions, whereas the
Flow Chart models the execution flow
17
Embedded System Design Concepts MODULE-2(BEC601)
Requirement:
When the vehicle ignition is turned on and the seat belt is not fastened within 10
seconds of ignition ON, the system generates an alarm signal for 5 seconds.
The Alarm is turned off when the alarm time (5 seconds) expires or if the
driver/passenger fastens the belt or if the ignition switch is turned off, whichever
happens first.
18
Embedded System Design Concepts MODULE-2(BEC601)
Sequential execution leads to a single sequential execution of task and thereby leads
to poor processor utilization, when the task involves I/O waiting, sleeping for
specified duration etc.
If the task is split into multiple subtasks, it is possible to tackle the CPU usage
effectively, when the subtask under execution goes to a wait or sleep mode, by
switching the task execution.
The Super loop based firmware development approach is Suitable for applications
that are not time critical and where the response time is not so important (Embedded
systems where missing deadlines are acceptable).
It is very similar to a conventional procedural programming where the code is
executed task by task
The tasks are executed in a never ending loop.
The task listed on top on the program code is executed first and the tasks just
below the top are executed after completing the first task
A typical super loop implementation will look like:
1. Configure the common parameters and perform initialization for
various hardware components memory, registers etc.
2. Start the first task and execute it
3. Execute the second task
4. Execute the next task
5. :
6. :
7. Execute the last defined task
8. Jump back to the first task and follow the same flow.
The ‘C’ program code for the super loop is given below
void main ( )
Configurations ();
Initializations ();
while (1)
20
Embedded System Design Concepts MODULE-2(BEC601)
Task 1 ();
Task 2 ();
:
:
Task n ();
}
}
Pros:
Doesn’t require an Operating System for task scheduling and monitoring and
free from OS related overheads
Simple and straight forward design.
Reduced memory footprint
Cons:
Non Real time in execution behavior (As the number of tasks increases the
frequency at which a task gets CPU time for execution also increases)
Any issues in any task execution may affect the functioning of the product
(This can be effectively tackled by using Watch Dog Timers for task
execution monitoring)
22
Embedded System Design Concepts MODULE-2(BEC601)
Assembly Language
o Subset of C (Embedded C)
o Subset of C++ (Embedded C++)
o Any other high level language with supported Cross-compiler
23
Embedded System Design Concepts MODULE-2(BEC601)
Moves decimal value 30 to the 8051 Accumulator register. Here MOV A is the Opcode and 30 is
the operand (single operand). The same instruction when written in machine language will look
like
01110100 00011110
The first 8 bit binary value 01110100 represents the opcode MOV A and the second 8 bit binary
value 00011110 represents the operand 30.
Assembly language instructions are written one per line
A machine code program consists of a sequence of assembly language instructions,
where each statement contains a mnemonic (Opcode + Operand)
Each line of an assembly language program is split into four fields as:
LABEL OPCODE OPERAND COMMENTS
LABEL is an optional field. A ‘LABEL’ is an identifier used extensively in programs to
reduce the reliance on programmers for remembering where data or code is located.
LABEL is commonly used for representing
A memory location, address of a program, sub-routine, code portion etc.
The maximum length of a label differs between assemblers. Assemblers insist
strict formats for labeling. Labels are always suffixed by a colon and begin with a
valid character. Labels can contain number from 0 to 9 and special character _
(underscore).
;###############################################################
; SUBROUTINE FOR GENERATING DELAY
; DELAY PARAMETR PASSED THROUGH REGISTER R1
; RETURN VALUE NONE,REGISTERS USED: R0, R1
;###############################################################
##### DELAY: MOV R0, #255 ; Load Register R0 with 255
The symbol ; represents the start of a comment. Assembler ignores the text in a
line after the ; symbol while assembling the program.
DELAY is a label for representing the start address of the memory location
where the piece of code is located in code memory.
The above piece of code can be executed by giving the label DELAY as part of the
instruction. E.g. LCALL DELAY; LMP DELAY.
24
Embedded System Design Concepts MODULE-2(BEC601)
Advantages:
Reduced Development time: Developer requires less or little
Knowledge on internal hardware details and architecture of the target processor/Controller.
Developer independency: The syntax used by most of the high level languages
are universal and a program written high level can easily understand by a second
person knowing the syntax of the language
Portability: An Application written in high level language for particular target
processor /controller can be easily be converted to another target
processor/controller specific application with little or less effort
Drawbacks:
• The cross compilers may not be efficient in generating the optimized target
processor specific instructions.
• Target images created by such compilers may be messy and non- optimized in
terms of performance as well as code size.
• The investment required for high level language based development tools (IDE) is
high compared to Assembly Language based firmware development tools.
25
Embedded System Design Concepts MODULE-2(BEC601)
26
Embedded System Design Concepts MODULE-2(BEC601)
Compiler is a software tool that converts a source code written in a high level language on top of a
particular operating system running on a specific target processor architecture (E.g. Intel
x86/Pentium).
The operating system, the compiler program and the application making use of the source code run
on the same target processor.
The source code is converted to the target processor specific machine instructions
A native compiler generates machine code for the same machine (processor) on which it is running.
Cross compiler is the software tools used in cross-platform development applications
In cross-platform development, the compiler running on a particular target processor/OS converts
the source code to machine code for a target processor whose architecture and instruction set is
different from the processor on which the compiler is running or for an operating system which is
different from the current development environment OS
Embedded system development is a typical example for cross-platform development where
embedded firmware is developed on a machine with Intel/AMD or any other target processors and
the same is converted into machine code for any other target processor architecture (E.g. 8051, PIC,
ARM9 etc).
Keil C51compiler from Keil softwasre is an example for cross-compiler for 8051 family
architecture.
27
Embedded System Design Concepts MODULE-2(BEC601)
28