You are on page 1of 1

Paper3

EMBEDDED SYSTEMS

AUTHORS

K.NIKHITHA GRACE K.HEMALATHA

E.C.E-3/4 E.E.E-3/4
Email:nikhitha422@yahoo.com hemalatha_kolla@yahoo.com

P.INDRA REDDY MEMORIAL ENGG COLLEGE

CHEVELLA, R.R.DISTRICT.

ABSTRACT
With the advent of industrial automation, embedded systems have been around since the 1960s in
all manufacturing organizations, including chemical plants, automobile manufacturing units, nuclear
plants, energy generation units and the like. Now we can make embedded systems network
enabled & connect them to internet or corporate intranet. These networked information appliances
can range from a simple web camera to a complex system for monitoring a nuclear plant. The
mobile device is now used for accessing data, voice and video services using third generation
wireless networks.

These developments led to a growing demand for embedded software development professionals.
Until relatively recently, embedded software development was done mostly in assembly
languages. With the development of cross compilers, C took over as prominent language. Object
oriented programming languages such as C ++ are now extensively used. The main attraction of
object oriented programming languages –reuse-is exploited to reduce the development time. Java
has become a force to reckon with for embedded software development, with availability of small
footprint Java Virtual Machines &powerful application programming interfaces(APIs) for embedded
programming .Java's main attraction ,platform independence ,makes it the most amenable to
embedded software development ,because of the variety processors & operating systems used in
embedded systems .

Fast development cycles & the availability of a wide variety of processors ,operating
systems ,development tools and programming languages are the some of the challenges for the
embedded software programmers. Programmers need a good understanding of design
alternatives like how to choose a processor an operating system, a programming language etc. So
that one can develop cost effective, reliable embedded software with minimal development time.

This paper is an attempt to describe the general processes involved in the embedded systems
development .It includes brief idea of choosing a processor, operating system, programming
languages etc.

EMBEDDED SYSTEMS

An embedded system is specific purpose device consisting of a processor, associated peripherals,


and software used for specific purpose.

In our daily lives we use a number of embedded systems-such as those found in TVs, VC Rs,
toasters, C D players, digital cameras, and mobile phones etc.All the systems are specific purpose
as VC Rs specific task is to record & play video cassettes.

Like any other computing system, an embedded system is a combination of hardware & software.
In the case of an embedded system hardware is generally custom built for systems specific
purpose, mainly because the requirements of each system vary considerably.

CATEGORIESOF EMBEDDED SYSTEMS:

This categorization is based on weather the system has to work as an independent unit or it has to
be networked, weather it has perform real time operation or not, and so on.

STAND ALONE EMBEDDED SYSTEMS: As the name suggests it works in stand alone mode,
taking input and producing output. The input can be electrical signals from sensor commands from
human being. The output can be electrical signals to drive another system. Examples of stand
alone systems are toys, C D players, measuring instruments etc.

REAL TIME EMBEDDED SYSTEMS: Some embedded systems are required to carry out specific
task in a specified amount of times. Such systems are called real time embedded systems. The
system in which the re al time constraints have to be strictly met are called hard real time
embedded systems. These systems are used mainly in process control, when time critical task
have to be carried out. The systems in which real time constraint are present but not critical are
called soft real time embedded systems (voice & video communication)

NETWORKED APPLIANCES Some systems are connected to a network-typically based on TC P/IP


protocol suite such as internet or company intranet. All these protocols can be embedded into the
system. The system can monitor some parameters (temp. & pressures) &send data over a
network to a centralized system for online monitoring.

MOBILE DEVICES: These are capable of supporting high data rate using wireless services in
addition to the voice services. Accessing internet services such as e-mail, World Wide Web, and so
on can be done while a person is on the move. The special requirements of these mobile devices
are threefold: they should have powerful computing and communicating capabilities. They should
be able to perform some real time tasks in addition to some non-real time tasks. & they should be
capable of handling multimedia applications.

REQUIREMENTS OF EMBEDDED SYSTEMS:

RELIABILITY : Embedded systems have to work without the need for the rebooting or resetting
typical of many desktop systems. This calls for very reliable hardware & software. This is
necessary because the system is not readily accessible for human intervention.

COST EFFECTIVENESS : If the embedded system is designed for very specific purpose then cost
may not be an issue. However, if the embedded system is for mass market cost is a major
consideration. C hoosing a right processor, memory devices and peripherals to meet the
functionality & performance requirements keeping the cost reasonable is of critical importance.

LOWPOWER CONSUMPTION : As many embedded systems are powered by batteries, power


consumption should be minimized to avoid draining the batteries. This can be achieved by
reducing the number of hardware components or by designing the processor to revert to low
power or “sleep”

Mode when there is no operation to perform.

EFFICIENT USE OF PROCESSING : Developers must keep processing power, memory & cost in
mind when choosing the right processor. The processing power requirement is specified in million
instructions per second (MIPS).

EFFICIENT USE OF MEMORY : Most embedded systems don't have secondary storage such as
harddisk.The memory chips available in embedded systems are only ROM & RAM. The embedded
systems with flash memory are used to store the program including operating system.

APPROPRIATE EXECUTION TIME : In real time embedded systems, certain tasks must be
performed within a specified times. The S/W developer needs to ascertain weather the embedded
system is hard real time system or soft real time system and perform the analysis accordingly.
The performance requirement also calls for code optimization to the maximum possible extent.

CHALLENGES AND ISSUES IN EMBEDDED


SYSTEMS

CO-DESIGN : Because an embedded system consists of H/W & S/W, deciding which functions of
the system be implemented in H/W & its which function should be in S/W is a major consideration.
The issue of choosing between H/W implementation & S/W implementation is known as co-design
issue .For example; C RC can be implemented either in S/W or H/W.Hardware implementation has
the advantage that the task execution is faster compared with that of software implementation. On
the downside, a chip costs money, consumes valuable power,& occupies space. The software
implementation is better if these are measure concerns for a particular project. Software
implementation offers flexibility if the algorithm changes, it is easier to modify the software.

EMBEDDINGAN OPERATING SYSTEM : It is possible to write embedded S/W without any


operating system embedded into the system. Developers can implement services such as memory
management, input/output & process management with a combination of assembly language & a
high level language such as C .

Embedded operating systems provide the necessary application programming interfaces to


develop applications.

CODE OPTIMISATION : Though the compilers perform code optimization, the programmer still
has optimized the code for faster execution and less memory occupation. Sometimes to achieve
required response time, the programmer may have written some portions of the code in assembly
language.

EFFICIENT INPUT & OUTPUT : In most embedded systems, the input interfaces have limited
functionality. For instance, inputting devices may be small keypad & output interface may consist
of small number of LEDs or a small LC D. Some embedded systems have no input /output devices
such as keyboard or display for user interaction-for example many systems used in processes
control.

TESTING AND DEBUGGING : Software for an embedded system cannot be tested on the target
H/W during the development phase because debugging will be extremely difficult. A host system
that has the development tools is used for the development & initial testing, &finallythe S/W will be
transferred to the target H/W for final testing.

APPLICATIONS OF EMBEDDED SYSTEMS :

l C onsumer electronics
l C ontrol systems and industrial automation
l Biomedical systems
l Field instrumentation
l Hand held computers
l Data communications
l Networked information appliances
l Telecommunications
l Wireless communications

DEVELOPING FOR EMBEDDED SYSTEMS

Writing the S/W for embedded systems ,need to be cognizant of the constraints imposed by the
embedded systems –namely the limited processing power ,limited memory & limited I/P /
O/P.Understanding the process of embedded systems development & the options available will
help to choose the right development environment for projects.

DETERMINETHE REQUIREMENTS :

The requirements of embedded systems can be broadly divided into functional & non-functional
requirements. Based on functionality embedded system can be divided into one of the following
two classes.

Multifunction systems: These systems are capable of executing multiple operations simultaneously
such as capturing video signals & processing audio signals while web browsing.

Multimode systems: These systems offer users more than one mode of operation .For example a
mobile device capable of handling voice calls from a terrestrial mobile network such as GSM or
from a satellite network such as INMARSAT(International Maritime Satellite).

The computing & communication requirements for the two classes of embedded systems are
different. For multifunction systems, the computing requirements are much higher. Incase of
multimode systems, two or more separate models are required to cater to the different modes of
operation.

The functional requirements dictate the H/W components, such as input/output peripheral
components, & computing & communication components. The most important non-functional
requirements of embedded systems include size, cost, & power consumption.

DESIGNTHESYSTEM ARCHITECHTURE :

The system architecture depends on the following factors:

l Whether the system is hard real time system or soft real time system: in case of hard real
time systems, timing constraints are strict but in soft real time system timing deadlines are
less stringent and can be missed occasionally without adversely affecting the performance
of the system.
l Whether an operating system needs to be embedded or not: for application involving very
simple input and output operations having one or few task to be handled, and only soft real
time performance is required. It is better use an off- the –shelf operating system such as
VxWorks or pSOS thus accelerating the development process.
l Whether cost, size of the physical system, and power consumption are critical for the
success of the product: if you are developing an embedded system for one customer for a
specific application some of these factors are not critical. However for mass market as in
the case of consumer electronic items these factors are critical. Hence the code design
issue is used determined the better choice between hardware and software.

CHOICE OF PROCESSOR AND RELATED HARDWARE :

Processor is can be a microcontroller, microprocessor, or a digital signal processor. In


multifunction system, the embedded system can contain in microcontroller or microprocessor and
a DSP, to cater to the different functionality.

CHOOSE THE OPERATING SYSTEM :

For writing the embedded software we have two options:

l Write the kernel yourself.


l Use an off –the –shelf operating system.

If the embedded software has to do a very small job, such an in toys air conditioners etc there is
no need for full –fledged operating system.

For mass market devices writing own kernel is better than full-fledged operating system.

However if all the services of the operating system have to provided, it is better to use an off-the
shelf operating system.

These operating systems provide the necessary APIs for task scheduling interrupt handling,
input/output management, memory management and file management.

However operating system is used in embedded software has some limitations:

l There will be no GUI.


l The o.s. caters only one user. Hence multi-user security feature are not provided.

Generally, there is no file system in the embedded system as there is no secondary storage.

If you determined that an off-shelf operating system is appropriate for the system, then there is a
need to consider whether operating system as to perform real time task or not.

The real time operating system are Wind river system VxWorks and pSOS, Microwares OS/9,
Microtecs VRTX, QNX software systems QNX are available for non-real time functionality, OS such
has Windows C E, Embedded Windows XP, Embedded Windows NT, etc can be chosen.

CHOOSE THE PROCESSOR :

Based on the desired functionality, processing speed, and memory addressing capability we need
to select the right processors. The following guidelines can be helpful when selecting processors:

l If the application involves minimal processing and a small number of input/output functions
we can chose and 8bit microcontroller. Digital watches, air conditioners, refrigerators, VC Rs
etc, use a microcontroller.
l For an embedded operating system with computation and communication requirements,
you need a 16bit or 32bit processors as used in telecom nation switches, routers, and
protocols converters.

l For signal processing and mathematical computation and application such as audio coding
video signal processing, select a DSP. The DSP can be fixed point or floating point
depending on application.
l If the application is highly graphics operated with fast response time requirements there is
need to use a 64bit processor.

CHOOSETHE DEVELOPMENT PLATFORM


The development platform consists of the following:

l The hardware platform


l The O.S.
l The programming language.
l The development tools.

Once the processor is decided upon, the vender provides the required development tools; it
includes the cross compiler, linker, loader, and debugger. In addition the following also may be
required.

l EPROM programmer.
l ROM emulator.
l In circuit emulator.
l Instruction set simulator, which simulates processors and memory of the target system.

l Test instruments

CHOICE OF PROGRAMMING LANGUAGE :

Historically, major embedded development projects involved writing code in C . but with the
availability of Microsofts embedded visual tools the visual studio environment can be take-up
embedded software development. If the embedded O.S you choose provides a JAVA virtual
machine then we can write the application in JAVA as well. For a network enable embedded
appliance JAVA is good choice.

CODING ISSUES :

This software written in a high-level language such as C or C ++ is converted into object code
using a cross compiler. The assembly language code written in the target processors assembly
language is also converted into object code using assembler. The linker/loader combines the
various object files and converts into a single binary executable file. These executable file is
ported to the target platforms memory.

CODE OPTIMISATION :

C ode optimization is a trade off between code size and speed of application. For code optimization
use the following checklist.

l Eliminate dead code in the program.


l Remove the code that has been introduced for debugging.
l Avoid large library routines.
l Avoid recursion routines, as the require a large stack.
l Avoid floating point operations, if necessary convert into fixed point operations.
l Reduce computational requirements by using a very simple trick.
l Use unsigned data types wherever possible.
l For high speed use assembly language programming,

PROGRAMMING IN JAVA :

Sun Micro system has released the connected, limited device configuration (C LDC ) specifications
for writing embedded applications in Java for mobile devices that are highly memory constrained.
There are some limitations of Java in writing embedded software:

l No support is available for floating point operations.


l They offer no finalization of class instances.
l Limited error classes are available because error handling in embedded systems is specific
to the device.
l They do not support Java native interface.

VERIFY THE SOFTWARE ON THE HOST SYSTEM :

We can convert source code into executable binary code by performing following three steps:

1. C ompile and assemble this source code into object code.


2. Link all the object files to a single object file, which is known as the relocatable object code.
A linker that runs on a host machine is used to achieve this.
3. Relocate the single object file in which physical memory addresses are assigned. The code
and data sections of the program are assigned physical addresses by the loader. The result
of this step is an executable binary image of the programmer, which can be loaded into the
target ROM of the embedded system.

VERIFY THE SOFTWARE ON THE EMBEDDED SYSTEM :

Once the software system is tested the host system, it ca be ported on to target board, where
complete testing can be carried out for functionality and performance requirements.

EMBEDDED SOFTWARE REQUIREMENTS

OPERATING SYSTEMS :

The interaction of embedded software with hardware to achieve desired functionality consists of
efficiently managing the input /output operations ,the memory ,the various tasks to be carried
out,and resources to do the specific tasks needed to obtain the desired response time. All these
operartions are achieved through opearating system.The processing power and memory
requirements are reduced to the bare minimum by writing the routines (kernel) in assembly
languages to achieve these functions. The kernel has a disadvantage of code
debugging ,testing ,maintenance are difficult as most of code is in assembly language & also
porting the application to other processor based hardware most of code needs to be rewritten for
new processor .

KERNEL ARCHITECHTURE:

TASK /PROCESS CONTROL SUBSYSTEM :

The task /process control subsystem is responsible or memory management, task scheduling, and
inter task communication. The task scheduler allocates C PU time to tasks based on their priority.
The inter task communication module facilitates the passing of the messages between tasks.

SYSTEM CALLS :

System calls facilitate accessing the various operations of the kernel. System calls are provided to
manage the memory, to control the task scheduler, and to carry out inter process communication.

C was the first high level programming language to provide system calls to access the operating
system.

EMBEDDED OPERATING SYSTEMS:

The off the shelf O.S is specially targeted towards embedded system the advantages of using an
off the shelf O.S are as follows:

l The code can be written in a high-level language, making the development faster.
l The code can be maintained easily.
l The programmer can focus on the application code, rather than basic services such as
memory management, IO management etc.
l However, the O.S has some limitations like:
l There is no file system as no secondary story devices are used.
l There is no graphical user interface.

l The O.S works in a single user mode. This not a constraint, but for networked embedded
systems, in which system eventually need to be accessed by multiple users; these will
surely be a limitation.
l Security related which are not addressed by developers of these O.S. But security will be a
major issue over the public neighbor.

TASKSCHEDULING EMBEDDED SYSTEMS :

In embedded system the processor has to handle multiple tasks, a task contest is maintained to
determine how much processing has been completed. A task context, a context task state, and the
priority of the task. The task scheduler determined which task the processor has to run next. A
task can be in one of the three states.

RUNNINGSYSTEMS : when the task is being executed by the processor, it is said to be in the
running state. In an embedded system running a preemptive O.S, one task cannot be allowed to
run continuously.

READY STATE : a task is said to be in ready state if it is waiting in a queue for the processor for
the executed.

WAITING STATE : if a task is waiting an external event to occur, it said t be waiting state: only
when the external event take place will it move to ready state.

TASK SC HEDULER :

The task scheduler keeps track of the state of each task and decides which task to run, based on
priority assigned to be tasks depending on task scheduler working O.S are divided into two
categories.

Preemptive O.S in these a low priority task is stopped and the high priority task is executed when
the requirement arises.

Non preemptive O.S: In these low priority task is continues to run even if a high priority task is
ready. The four algorithms available to schedule the tasks are

1. FIFO
2. Shortest job first.
3. Round robin.
4. Priority based scheduling.

TASK SYNCHRONISATION :

Various tasks in n embedded system need to communicate with one another and shred data,
processes known as task synchronization. The mechanism used to carried out synchronization are
mutexes and semaphores.

MUTEXS :

Mutexs is short form of mutual exclusion , ensuring that different task do not executed the same
portion of the code at same time. Embedded O.S provided system calls for mutexs operates.

SEMAPHORES :

In O.S, the various task have to use the resource in discipline manner an application may dement
some condition to execute setup task in a specified sequence. In such cases semaphores are
used.

A simple implementation are of semaphore is as follows: a task is executing in the kernel, it sets a
flag, and until is clear, other task have to wait, and this cannot be interrupted. These flag is called
semaphore; it is a locking mechanism which informs other tasks that a particular resource is
locked.

TYPESOFEMBEDDED OPERATING SYSTEM:

NON-REALTIME EMBEDDED OS :These OS do not provide hard real time functionality .Sysem
calls are provided for process management ,memory management ,& I/O management for tasks
that do not require real time response.

Examples-Embedded Windows NT,Windows XP Embedded, Open Source Embedded OS

REAL TIME OS :These OS provide the necessary system calls to achieve real time dead lines

Ex.-RTLinux,eC OS

MOBILEHANDHELD OS : Operating systems that are fine tuned to work in mobile environment
are known as mobile handheld OS.However , note that many real time OS can be used as
mobile/handheld OS as well.

Ex.-Windows C E, Palm OS,Symbian OS

REFERENCES :

1. Dreamtech software team, Programming for Embedded systems, Wiley Publishing Inc.(2000)

2. Myke Predko, Programming & customizing the 8051 microcontroller, TMH (1999)

3. Jhon B.Peatman, Design with PIC microcontrollers, Pearson Education Asia (2001)

C ollected and C reated by youtrick.com .....