0% found this document useful (0 votes)
14 views29 pages

ESD Mod 2

The document discusses embedded system design concepts, focusing on the characteristics and quality attributes that differentiate embedded systems from general-purpose computers. It outlines operational and non-operational quality attributes, including response time, reliability, maintainability, and security, along with examples of application-specific embedded systems like washing machines and automotive embedded systems. Additionally, it touches on hardware-software co-design issues, emphasizing the importance of model and architecture selection in the design process.

Uploaded by

E sravya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views29 pages

ESD Mod 2

The document discusses embedded system design concepts, focusing on the characteristics and quality attributes that differentiate embedded systems from general-purpose computers. It outlines operational and non-operational quality attributes, including response time, reliability, maintainability, and security, along with examples of application-specific embedded systems like washing machines and automotive embedded systems. Additionally, it touches on hardware-software co-design issues, emphasizing the importance of model and architecture selection in the design process.

Uploaded by

E sravya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

MODULE 2

EMBEDDED SYSTEM DESIGN CONCEPTS

Embedded System Design Concepts: Characteristics and Quality Attributes of


Embedded Systems, Operational and non-operational quality attributes, Embedded
Systems-Application and Domain specific, Hardware Software Co-Design and
Program Modeling (excluding UML), Embedded firmware design and development
(excluding C language).
Embedded System Design Concepts MODULE-2(BEC601)

EMBEDDED SYSTEM DESIGN CONCEPTS

*CHARACTERISTICS & QUALITY ATTRIBUTES OF EMBEDDED


SYSTEMS
The characteristics of embedded system are different from those of a general purpose computer and so are
its Quality metrics. This chapter gives a brief introduction on the characteristics of an embedded system
and the attributes that are associated with its quality.

CHARACTERISTICS OF EMBEDDED SYSTEM

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.

2. Reactive and Real time


 Certain Embedded systems are designed to react to the events that occurring the nearby
environment. These events also occur real-time.
 Ex. An air conditioner adjusts its mechanical parts as soon as it gets a signal from its sensors
To increase or decrease the temperature when the user operates it using a remote control.
 An embedded system uses Sensors to take inputs and has actuators to bring out the
required functionality.
3. Operation in harsh environment
 Certain embedded systems are designed to operate in harsh environments like very high
temperature of the deserts or very low temperature of the mountains or extreme rains.

1
Embedded System Design Concepts MODULE-2(BEC601)

 These embedded systems have to be capable of sustaining the environmental conditions


it is designed to operate in. 
4. Distributed systems
 Certain embedded systems are part of a larger system and thus form components of a
distributed system. 
 These components are independent of each other but have to work together for the larger
system to function properly. 
 Ex. A car has many embedded systems controlled to its dash board. Each one is an
independent embedded system yet the entire car can be said to function properly only if
all the systems work together.
5. Small size and weight
 An embedded system that is compact in size and has light weight will be desirable or
more popular than one that is bulky and heavy.
 Ex. Currently available cell phones. The cell phones that have the maximum features are
popular but also their size and weight is an important characteristic.

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)

QUALITY ATTRIBUTES OF EMBEDDED SYSTEM

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:-

1. Scheduled or Periodic Maintenance


 This is the maintenance that is required regularly after a periodic time interval.
 Example: Periodic Cleaning of Air Conditioners Refilling of printer cartridges.

2. Maintenance to unexpected failure


 This involves the maintenance due to a sudden break down in the functioning of the system.
 Example:
1. Air conditioner not powering on
2. Printer not taking paper in spite of a full paper stack

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.

Non Operational Attributes


a) Test ability and Debug-ability
 It deals with how easily one contests his/her design, application and by which mean
he/she can test it.
 In hardware testing the peripherals and total hardware function in designed manner
 Firmware testing is functioning in expected way
 Debug-ability is means of debugging the product as such for figuring out the probable
sources that create unexpected behavior in the total system

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)

 An embedded product can be called portable if it is capable of performing its operation as


it is intended to do in various environments irrespective of different processor and or
controller and embedded operating systems.

d) Time to prototype and market


 Time to Market is the time elapsed between the conceptualization of a product and time
at which the product is ready for selling or use
 Product prototyping help in reducing time to market.
 Prototyping is an informal kind of rapid product development in which important feature
of the under consider are develop.
 In order to shorten the time to prototype, make use of all possible option like use of reuse,
off the self component etc.

e) Per unit and total cost


 Cost is an important factor which needs to be carefully monitored. Proper market study
and cost benefit analysis should be carried out before taking decision on the per unit cost
of the embedded product.
 When the product is introduced in the market, for the initial period the sales and revenue
will be low
 There won’t be much competition when the product sales and revenue increase.
 During the maturing phase, the growth will be steady and revenue reaches highest point
and at retirement time there will be a drop in sales volume.

6
Embedded System Design Concepts MODULE-2(BEC601)

*EMBEDDED SYSTEMS - APPLICATION AND DOMAIN

SPECIFIC

Application specific systems: Washing Machine


Let us see the important parts of the washing machine; this will also help us understand the working
of the washing machine:
1) Water inlet control valve: Near the water inlet point of the washing there is water inlet
control valve. When you load the clothes in washing machine, this valve gets opened
automatically and it closes automatically depending on the total quantity of the water required.
The water control valve is actually the solenoid valve.

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)

AUTOMOTIVE EMBEDDED SYSTEM (AES)


 The Automotive industry is one of the major application domains of embedded systems.
 Automotive embedded systems are the one where electronic stake control over the
mechanical system. Ex. Simple viper control.

 The number of embedded controllers in a normal vehicle varies somewhere between 20


to 40 and can easily be between75 to100 for more sophisticated vehicles.

 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

d. Head lamp Control

e. Automatic break system 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)

AUTOMOTIVE COMMUNICATION BUSES


Embedded system used inside an auto mobile communicates with each other using serial buses. This
reduces the wiring required.
Following are the different types of serial Interfaces used in automotive embedded applications:
a. Controller Area Network (CAN):-
 CAN bus was originally proposed by Robert Bosch.

 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.

b. Local Interconnect Network (LIN):-


 LIN bus is single master multiple slave communication interface with support for data rates up to20

Kbps and is used for sensor/actuator interfacing

 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,

and position controls where response time is not a critical issue.

c. Media- Oriented System Transport (MOST):-


 MOST is targeted for automotive audio/video equipment interfacing.

 A MOST bus is a multimedia fiber optics point–to-point network implemented in a star,


ring or daisy chained topology over optical fiber cables.
 MOST bus specifications define the physical as well as application layer, network layer
and media access control.
 MOST bus is an optical fibre cable connected between the Electrical Optical Converter (EOC)
and Optical Electrical Converter (OEC), which would translate into the optical cable MOST bus.

11
Embedded System Design Concepts MODULE-2(BEC601)

*HARDAWARE AND SOFTWARE CO-DESIGN

1) Fundamental Issues in Hardware Software Co-Design


The fundamental issues in hardware software co-design are:

• Selecting the Model

• Selecting the Architecture

• Selecting the Language

• Partitioning System Requirements into Hardware and Software

 Model Selection

 A Model captures and describes the system characteristics

 A model is a formal system consisting of objects and composition rules

 It is hard to make a decision on which model should be followed in a particular


system design.

 Most often designers switch between a variety of models from the requirements
specification to the implementation aspect of the system design

 The objectives vary with each phase.

 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?’

 The architecture specifies how a system is going to implement in terms of the


number and types of different components and the interconnection among them

 Controller architecture, Datapath Architecture, Complex Instruction Set Computing


(CISC), Reduced Instruction Set Computing (RISC), Very long Instruction Word
Computing (VLIW), Single Instruction Multiple Data (SIMD), Multiple Instruction
Multiple Data (MIMD) etc are the commonly used architectures in system design.

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 programming Language captures a ‘Computational Model’ and maps it into


architecture.

 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.

 The only pre-requisite in selecting a programming language for capturing a model is


that the language should capture the model easily.

 Partitioning of System Requirements into H/w and S/w

 Implementation aspect of a System level Requirement

 It may be possible to implement the system requirements in either hardware or


software (firmware).

 Various hardware software trade-offs like performance, re-usability, effort etc are
used for making a decision on the hardware-software partitioning.

2) Computational Models in Embedded Design


 Data Flow Graph/Diagram (DFG) Model

 Translates the data processing requirements into a data flow graph

 A data driven model in which the program execution is determined by data.

 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)

E.g. Model the requirement x = a + b; and y = x - c;

14
Embedded System Design Concepts MODULE-2(BEC601)

Data path: The data flow path from input to output

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.

 Control Data Flow Graph/Diagram (CDFG) Model

 Translates the data processing requirements into a data flow graph

 Model applications involving conditional program execution

 Contains both data operations and control operations

 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

 Translates the requirement, which is modeled to a concurrent process model

 The decision on which process is to be executed is determined by the control node

 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.

E.g. Model the requirement If flag = 1, x = a + b; else y = a-b;

15
Embedded System Design Concepts MODULE-2(BEC601)

 State Machine Model

 Based on ‘States’ and ‘State Transition’

 Describes the system behavior with ‘States’, ‘Events’, ‘Actions’ and ‘Transitions’

 State is a representation of a current situation.

 An event is an input to the state. The event acts as stimuli for state transition.

 Transition is the movement from one state to another.

 Action is an activity to be performed by the state machine.

 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

 The Hierarchical/Concurrent Finite State Machine Model (HCFSM) is an extension


of the FSM for supporting concurrency and hierarchy

 HCFSM extends the conventional state diagrams by the AND, OR decomposition


of States together with inter level transitions and a broadcast mechanism for
communicating between concurrent processes

 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)

E.g. Automatic ‘Seat Belt Warning’ in an automotive

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.

Here the states are


• 'Alarm Off’
• 'Waiting’
• 'Alarm On’
The events are
• 'Ignition Key ON’
• 'Ignition Key OFF’
• 'Timer Expire’
• 'Alarm Time Expire’
• 'Seat Belt ON’
 Sequential Program Model

 The functions or processing requirements are executed in sequence

 The program instructions are iterated and executed conditionally and the data gets
transformed through a series of operations

 FSMs are good choice for sequential Program modeling.

 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)

E.g. Automatic ‘Seat Belt Warning’ in an automotive

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.

E.g. Automatic ‘Seat Belt Warning’ in an automotive

18
Embedded System Design Concepts MODULE-2(BEC601)

 Concurrent/Communicating Process Model

 Models concurrently executing tasks/processes The program instructions are


iterated and executed conditionally and the data gets transformed through a series
of operations

 Certain processing requirements are easier to model in concurrent processing model


than the conventional sequential execution.

 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.

 Concurrent processing model requires additional overheads in task scheduling, task


synchronization and communication.

 Object oriented Model


 The object-oriented model is an object based model for modelling system
requirements.
 It disseminates a complex software requirement into simple well defined pieces
called objects.
 Object-oriented model brings re-usability, maintainability and productivity in
system design.
19
Embedded System Design Concepts MODULE-2(BEC601)

 In the object-oriented modelling, object is an entity used for representing or


modelling a particular piece of the system.
 Each object is characterised by a set of unique behaviour and state.

*EMBEDDED FIRMWARE DESIGN AND DEVELOPMENT


The Embedded Operating System based approach:-
The decision on which approach needs to be adopted for firmware development is
purely dependent on the complexity and system requirements

1. Embedded firmware Design Approaches – The Super loop (Conventional Procedural


Based Design):

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)

2. Embedded firmware Design Approaches – Embedded OS based Approach: The embedded


device contains an Embedded Operating System which can be one of:
 A Real Time Operating System (RTOS)
 A Customized General Purpose Operating System (GPOS)

The General Purpose OS (GPOS) based design is very similar to a conventional PC


based application development where the device contains an operating system
(Windows/Unix/Linux, etc. for Desktop PCs) and you will be creating and running
user applications on top of it.
• Example of a GPOS used in embedded product development is Microsoft
Windows XP Embedded.
• Examples of Embedded products using Microsoft Windows XP OS are Personal
Digital Assistants (PDAs), Hand held devices/Portable devices and Point of Sale
(POS) terminals.
• Use of GPOS in embedded products merges the demarcation of Embedded
Systems and general computing systems in terms of OS.
• For developing applications on top of the OS, the OS supported APIs are used.
• Similar to the different hardware specific drivers, OS based applications also
require 'Driver software' for different hardware present on the board to
communicate with them.

Real Time Operating System (RTOS) based design approach is employed in


embedded products demanding Real-time response.
21
Embedded System Design Concepts MODULE-2(BEC601)

• RTOS responds in a timely and predictable manner to events.


• Real Time operating system contains a Real Time kernel responsible for
performing pre-emptive multitasking, scheduler for scheduling tasks, multiple
threads, etc.
• A Real Time Operating System (RTOS) allows flexible scheduling of system
resources like the CPU and memory and offers some way to communicate between
tasks.
• 'Windows CE', 'pSOS', 'VxWorks', 'ThreadX', 'MicroC/OS-II’, 'Embedded Linux',
'Symbian’, etc. are examples of RTOS employed in embedded product
development.
• Mobile phones, PDAs (Based on Windows CE/Windows Mobile Platforms),
handheld devices, etc. are examples of 'Embedded Products' based on RTOS.

22
Embedded System Design Concepts MODULE-2(BEC601)

Embedded firmware Development Languages/Options


• For embedded firmware development, we can use either
• a target processor/controller specific language (Generally known as Assembly language or low level language)
• a target processor/controller independent language (Like C, C++, JAVA, etc. commonly known as High Level
Language) or
• a combination of Assembly and High level Language.

 Assembly Language

 High Level Language

o Subset of C (Embedded C)
o Subset of C++ (Embedded C++)
o Any other high level language with supported Cross-compiler

 Mix of Assembly & High level Language


o Mixing High Level Language (Like C) with Assembly Code
o Mixing Assembly code with High Level Language (Like C)
o Inline Assembly

1. Embedded firmware Development Languages/Options – Assembly


Language :

‘Assembly Language’ is the human readable notation of ‘machine


language’. ‘Machine language’ is a processor understandable language. Machine
language is a binary representation and it consists of 1s and 0s Assembly language
and machine languages are processor/controller
dependent. An Assembly language program written for one processor/controller family
will not work with others
Assembly language programming is the process of writing processor specific machine
code in mnemonic form, converting the mnemonics into actual processor instructions
(machine language) and associated data using an assembler.
The general format of an assembly language instruction is an Opcode followed by
Operands.
The Opcode tells the processor/controller what to do and the Operands provide the data
and information required to perform the action specified by the opcode.
It is not necessary that all opcode should have Operands following them. Some of the
Opcode implicitly contains the operand and in such situation no operand is required. The
operand may be a single operand, dual operand or more.
The 8051 Assembly instruction,
MOV A, #30

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

DJNZ R1, DELAY; Decrement R1 and loop till R1= 0

RET ; Return to calling program

 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.

2. Embedded firmware Development Languages/Options – High Level Language


 The embedded firmware is written in any high level language like C, C++.
 A software utility called ‘cross-compiler’ converts the high level language
to target processor specific machine code.
 The cross-compilation of each module generates a corresponding object
file. The object file does not contain the absolute address of where the

24
Embedded System Design Concepts MODULE-2(BEC601)

generated code needs to be placed (a re-locatable code) on the program


memory.
 The software program called linker/locater is responsible for assigning
absolute address to object files during the linking process.
 The Absolute object file created from the object files corresponding to
different source code modules contain information about the address where
each instruction needs to be placed in code memory.
 A software utility called ‘Object to Hex file converter’ translates the
absolute object file to corresponding hex file (binary file)

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.

3. Embedded firmware Development Languages/Options – Mixing of Assembly Language


with High Level Language:
 Embedded firmware development may require the mixing of Assembly Language with high
level language or vice versa.
 Interrupt handling, Source code is already available in high level language\Assembly
Language etc are examples.
 High Level language and low level language can be mixed in three different ways
 Mixing Assembly Language with High level language like ‘C’
 Mixing High level language like ‘C’ with Assembly Language
 In line Assembly
The passing of parameters and return values between the high level and low level
language is cross-compiler specific

25
Embedded System Design Concepts MODULE-2(BEC601)

High Level Language –


1) ‘C’ V/s ‘Embedded C’
 ‘C’ is a well structured, well defined and standardized general purpose programming language with
extensive bit manipulation support
 ‘C’ offers a combination of the features of high level language and assembly and helps in hardware
access programming (system level programming) as well as business package developments
(Application developments like pay roll systems, banking applications etc)
 The conventional ‘C’ language follows ANSI standard and it incorporates various library files for
different operating systems
 A platform (Operating System) specific application, known as, compiler is used for the conversion
of programs written in ‘C’ to the target processor (on which the OS is running) specific binary files
 Embedded C can be considered as a subset of conventional ‘C’ language
 Embedded C supports all ‘C’ instructions and incorporates a few target processor specific
functions/instructions.
 The standard ANSI ‘C’ library implementation is always tailored to the target processor/controller
library files in Embedded C.
 The implementation of target processor/controller specific functions/instructions depends upon the
processor/controller as well as the supported cross-compiler for the particular Embedded C
language.
 A software program called ‘Cross-compiler’ is used for the conversion of programs written in
Embedded C to target processor/controller specific instructions.

26
Embedded System Design Concepts MODULE-2(BEC601)

2) ‘Compiler’ V/s ‘Cross-Compiler’

 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

You might also like