You are on page 1of 8

Embedded Systems

Introduction:
System Definition
A way of working, organizing or performing one or many tasks. According to a fixed set
of rules, program or plan.
Examples of Systems
Time display system – A watc
Automatic clot wasing system – A wasing macine
Embedded System Definitions! "An embedded system is one tat as
dedicated purpose software embedded in computer ardware.#
Tree main embedded components!
Embeds ardware to gi$e computer like functionalities.
Embeds main application software generally into flas or %&' and te application
software performs concurrently te number of tasks
Embedded system components!
Embeds a real time operating system ( %T&S), wic super$ises te application software
tasks running on te ardware and organizes te accesses to system resources according
to priorities and timing constraints of tasks in te system.
Embedded system %T&S
Enables execution of concurrent processes or treads or tasks .
*ro$ides a mecanism to let te processor run eac process as per sceduling and to do
context+switc between te $arious processes(treads or tasks) .
%T&S sets te rules during execution of application processes to enable finising of a
process witin te assigned time inter$al and wit assigned priority.
Characteristics
Embedded systems are designed to do some specific task, rater tan be a general+
purpose computer for multiple tasks. Some also a$e real+time performance constraints
tat must be met, for reasons suc as safety and usability, oters may a$e low or no
performance re-uirements, allowing te system ardware to be simplified to reduce costs.
Embedded systems are not always standalone de$ices. 'any embedded systems consist
of small, computerized parts witin a larger de$ice tat ser$es a more general purpose.
.or example, te /ibson %obot /uitar features an embedded system for tuning te
strings, but te o$erall purpose of te %obot /uitar is, of course, to play music.
012

Similarly, an embedded system in an automobile pro$ides a specific function as a
subsystem of te car itself.
Te program instructions written for embedded systems are referred to as firmware, and
are stored in read+only memory or .las memory cips. Tey run wit limited computer
ardware resources! little memory, small or non+existent keyboard or screen.
Processors in embedded systems
Embedded processors can be broken into two broad categories. &rdinary microprocessors
(3*) use separate integrated circuits for memory and periperals. 'icrocontrollers (34)
a$e on+cip periperals, tus reducing power consumption, size and cost. 5n contrast to
te personal computer market, many different basic 4*6 arcitectures are used, since
software is custom+de$eloped for an application and is not a commodity product installed
by te end user. 7ot 8on 9eumann as well as $arious degrees of :ar$ard arcitectures
are used. %5S4 as well as non+%5S4 processors are found. ;ord lengts $ary from <+bit
to =<+bits and beyond, altoug te most typical remain >?@=+bit. 'ost arcitectures
come in a large number of different $ariants and sapes, many of wic are also
manufactured by se$eral different companies.
9umerous microcontrollers a$e been de$eloped for embedded systems use. /eneral+
purpose microprocessors are also used in embedded systems, but generally re-uire more
support circuitry tan microcontrollers.
ASIC and FPGA solutions
A common array of n configuration for $ery+ig+$olume embedded systems is te
system on a cip (So4) wic contains a complete system consisting of multiple
processors, multipliers, caces and interfaces on a single cip. So4s can be implemented
as an application+specific integrated circuit (AS54) or using a field+programmable gate
array (.*/A).
Peripherals
A close+up of te S'S4 AA9B@4@@C (S'S4 B@x) cip, an embedded eternet cip.
Embedded Systems talk wit te outside world $ia periperals, suc as!
• Serial 4ommunication 5nterfaces (S45)! %S+DED, %S+<DD, %S+<>F etc.
• Syncronous Serial 4ommunication 5nterface! 5D4, S*5, SS4 and ESS5
(Enanced Syncronous Serial 5nterface)
• 6ni$ersal Serial 7us (6S7)
• 'ulti 'edia 4ards (SD 4ards, 4ompact .las etc.)
• 9etworks! Eternet, Aon;orks, etc.
• .ieldbuses! 4A9+7us, A59+7us, *%&.576S, etc.
• Timers! *AA(s), 4apture?4ompare and Time *rocessing 6nits
• Discrete 5&! aka /eneral *urpose 5nput?&utput (/*5&)
• Analog to Digital?Digital to Analog (AD4?DA4)
• Debugging! GTA/, 5S*, 54S*, 7D' *ort, 75T*, and D*B ports.
Tools
As wit oter software, embedded system designers use compilers, assemblers, and
debuggers to de$elop embedded system software. :owe$er, tey may also use some
more specific tools!
• 5n circuit debuggers or emulators (see next section).
• 6tilities to add a cecksum or 4%4 to a program, so te embedded system can
ceck if te program is $alid.
• .or systems using digital signal processing, de$elopers may use a mat
workbenc suc as Scilab ? Scicos, 'ATAA7 ? Simulink, E54ASAA7, 'at4ad,
'atematica,or .lowStone DS* to simulate te matematics. Tey migt also use
libraries for bot te ost and target wic eliminates de$eloping DS* routines as
done in DS*nano %T&S.
• A model based de$elopment tool like 8isSim lets you create and simulate
grapical data flow and 6'A State cart diagrams of components like digital
filters, motor controllers, communication protocol decoding and multi+rate tasks.
5nterrupt andlers can also be created grapically. After simulation, you can
automatically generate 4+code to te 8isSim %T&S wic andles te main
control task and preemption of background tasks, as well as automatic setup and
programming of on+cip periperals.
• 4ustom compilers and linkers may be used to optimize specialized ardware.
• An embedded system may a$e its own special language or design tool, or add
enancements to an existing language suc as .ort or 7asic.
• Anoter alternati$e is to add a real+time operating system or embedded operating
system, wic may a$e DS* capabilities like DS*nano %T&S.
• 'odeling and code generating tools often based on state macines
Software tools can come from se$eral sources!
• Software companies tat specialize in te embedded market
• *orted from te /96 software de$elopment tools
• Sometimes, de$elopment tools for a personal computer can be used if te
embedded processor is a close relati$e to a common *4 processor
As te complexity of embedded systems grows, iger le$el tools and operating systems
are migrating into macinery were it makes sense. .or example, cellpones, personal
digital assistants and oter consumer computers often need significant software tat is
purcased or pro$ided by a person oter tan te manufacturer of te electronics. 5n tese
systems, an open programming en$ironment suc as Ainux, 9et7SD, &S/i or Embedded
Ga$a is re-uired so tat te tird+party software pro$ider can sell to a large market.
Debugging
Embedded debugging may be performed at different le$els, depending on te facilities
a$ailable. .rom simplest to most sopisticated tey can be rougly grouped into te
following areas!
• 5nteracti$e resident debugging, using te simple sell pro$ided by te embedded
operating system (e.g. .ort and 7asic)
• External debugging using logging or serial port output to trace operation using
eiter a monitor in flas or using a debug ser$er like te %emedy Debugger wic
e$en works for eterogeneous multicore systems.
• An in+circuit debugger (54D), a ardware de$ice tat connects to te
microprocessor $ia a GTA/ or 9exus interface. Tis allows te operation of te
microprocessor to be controlled externally, but is typically restricted to specific
debugging capabilities in te processor.
• An in+circuit emulator (54E) replaces te microprocessor wit a simulated
e-ui$alent, pro$iding full control o$er all aspects of te microprocessor.
• A complete emulator pro$ides a simulation of all aspects of te ardware,
allowing all of it to be controlled and modified, and allowing debugging on a
normal *4. Te downsides are expense and slow operation, in some cases up to
@CCH slower tan te final system.
• .or So4 designs, te typical approac is to $erify and debug te design on an
.*/A prototype board. Tools suc as 4ertus
0>2
are used to insert probes in te
.*/A %TA tat make signals a$ailable for obser$ation. Tis is used to debug
ardware, firmware and software interactions across multiple .*/A wit
capabilities similar to a logic analyzer.
6nless restricted to external debugging, te programmer can typically load and run
software troug te tools, $iew te code running in te processor, and start or stop its
operation. Te $iew of te code may be as :AA source+code, assembly code or mixture
of bot.
7ecause an embedded system is often composed of a wide $ariety of elements, te
debugging strategy may $ary. .or instance, debugging a software+ (and microprocessor+)
centric embedded system is different from debugging an embedded system were most of
te processing is performed by periperals (DS*, .*/A, co+processor). An increasing
number of embedded systems today use more tan one single processor core. A common
problem wit multi+core de$elopment is te proper syncronization of software
execution. 5n suc a case, te embedded system design may wis to ceck te data traffic
on te busses between te processor cores, wic re-uires $ery low+le$el debugging, at
signal?bus le$el, wit a logic analyzer, for instance.
Tracing
%eal+time operating systems (%T&S) often supports tracing of operating system e$ents. A
grapical $iew is presented by a ost *4 tool, based on a recording of te system
bea$ior. Te trace recording can be performed in software, by te %T&S, or by special
tracing ardware. %T&S tracing allows de$elopers to understand timing and performance
issues of te software system and gi$es a good understanding of te ig+le$el system
bea$ior. 4ommercial tools like %TH4 Iuadros or 5A% Systems exist.
Reliability
Embedded systems often reside in macines tat are expected to run continuously for
years witout errors, and in some cases reco$er by temsel$es if an error occurs.
Terefore te software is usually de$eloped and tested more carefully tan tat for
personal computers, and unreliable mecanical mo$ing parts suc as disk dri$es,
switces or buttons are a$oided.
Specific reliability issues may include!
• Te system cannot safely be sut down for repair, or it is too inaccessible to
repair. Examples include space systems, undersea cables, na$igational beacons,
bore+ole systems, and automobiles.
• Te system must be kept running for safety reasons. JAimp modesJ are less
tolerable. &ften backups are selected by an operator. Examples include aircraft
na$igation, reactor control systems, safety+critical cemical factory controls, train
signals.
• Te system will lose large amounts of money wen sut down! Telepone
switces, factory controls, bridge and ele$ator controls, funds transfer and market
making, automated sales and ser$ice.
A $ariety of tecni-ues are used, sometimes in combination, to reco$er from errorsKbot
software bugs suc as memory leaks, and also soft errors in te ardware!
• watcdog timer tat resets te computer unless te software periodically notifies
te watcdog
• subsystems wit redundant spares tat can be switced o$er to
• software Jlimp modesJ tat pro$ide partial function
• Designing wit a Trusted 4omputing 7ase (T47) arcitecture
0B2
ensures a igly
secure L reliable system en$ironment
• A :yper$isor designed for embedded systems, is able to pro$ide secure
encapsulation for any subsystem component, so tat a compromised software
component cannot interfere wit oter subsystems, or pri$ileged+le$el system
software. Tis encapsulation keeps faults from propagating from one subsystem to
anoter, impro$ing reliability. Tis may also allow a subsystem to be
automatically sut down and restarted on fault detection.
• 5mmunity Aware *rogramming
High vs low volume
.or ig $olume systems suc as portable music players or mobile pones, minimizing
cost is usually te primary design consideration. Engineers typically select ardware tat
is Must "good enoug# to implement te necessary functions.
.or low+$olume or prototype embedded systems, general purpose computers may be
adapted by limiting te programs or by replacing te operating system wit a real+time
operating system.
Embedded software architectures
'ain article! Embedded software
Tere are se$eral different types of software arcitecture in common use.
Simple control loop
5n tis design, te software simply as a loop. Te loop calls subroutines, eac of wic
manages a part of te ardware or software.
Interrupt-controlled system
Some embedded systems are predominantly controlled by interrupts. Tis means tat
tasks performed by te system are triggered by different kinds of e$ents, an interrupt
could be generated, for example, by a timer in a predefined fre-uency, or by a serial port
controller recei$ing a byte.
Tese kinds of systems are used if e$ent andlers need low latency, and te e$ent
andlers are sort and simple. 6sually, tese kinds of systems run a simple task in a main
loop also, but tis task is not $ery sensiti$e to unexpected delays.
Sometimes te interrupt andler will add longer tasks to a -ueue structure. Aater, after te
interrupt andler as finised, tese tasks are executed by te main loop. Tis metod
brings te system close to a multitasking kernel wit discrete processes.
Cooperative multitasking
A nonpreempti$e multitasking system is $ery similar to te simple control loop sceme,
except tat te loop is idden in an A*5. Te programmer defines a series of tasks, and
eac task gets its own en$ironment to "run# in. ;en a task is idle, it calls an idle
routine, usually called "pause#, "wait#, "yield#, "nop# (stands for no operation), etc.
Te ad$antages and disad$antages are similar to tat of te control loop, except tat
adding new software is easier, by simply writing a new task, or adding to te -ueue.
Preemptive multitasking or multi-threading
5n tis type of system, a low+le$el piece of code switces between tasks or treads based
on a timer (connected to an interrupt). Tis is te le$el at wic te system is generally
considered to a$e an Joperating systemJ kernel. Depending on ow muc functionality
is re-uired, it introduces more or less of te complexities of managing multiple tasks
running conceptually in parallel.
As any code can potentially damage te data of anoter task (except in larger systems
using an ''6) programs must be carefully designed and tested, and access to sared
data must be controlled by some syncronization strategy, suc as message -ueues,
semapores or a non+blocking syncronization sceme.
7ecause of tese complexities, it is common for organizations to use a real+time
operating system (%T&S), allowing te application programmers to concentrate on de$ice
functionality rater tan operating system ser$ices, at least for large systems, smaller
systems often cannot afford te o$eread associated wit a generic real time system, due
to limitations regarding memory size, performance, or battery life. Te coice tat an
%T&S is re-uired brings in its own issues, owe$er, as te selection must be done prior to
starting to te application de$elopment process. Tis timing forces de$elopers to coose
te embedded operating system for teir de$ice based upon current re-uirements and so
restricts future options to a large extent.
0@C2
Te restriction of future options becomes more
of an issue as product life decreases. Additionally te le$el of complexity is continuously
growing as de$ices are re-uired to manage $ariables suc as serial, 6S7, T4*?5*,
7luetoot, ;ireless AA9, trunk radio, multiple cannels, data and $oice, enanced
grapics, multiple states, multiple treads, numerous wait states and so on. Tese trends
are leading to te uptake of embedded middleware in addition to a real+time operating
system.
icrokernels and e!okernels
A microkernel is a logical step up from a real+time &S. Te usual arrangement is tat te
operating system kernel allocates memory and switces te 4*6 to different treads of
execution. 6ser mode processes implement maMor functions suc as file systems, network
interfaces, etc.
5n general, microkernels succeed wen te task switcing and intertask communication is
fast and fail wen tey are slow.
Exokernels communicate efficiently by normal subroutine calls. Te ardware and all te
software in te system are a$ailable to and extensible by application programmers.