Embedded Systems Architecture Programming and Design 2nd Edition Raj Kamal

sabinpetticj 16 views 72 slides May 09, 2025
Slide 1
Slide 1 of 72
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58
Slide 59
59
Slide 60
60
Slide 61
61
Slide 62
62
Slide 63
63
Slide 64
64
Slide 65
65
Slide 66
66
Slide 67
67
Slide 68
68
Slide 69
69
Slide 70
70
Slide 71
71
Slide 72
72

About This Presentation

Embedded Systems Architecture Programming and Design 2nd Edition Raj Kamal
Embedded Systems Architecture Programming and Design 2nd Edition Raj Kamal
Embedded Systems Architecture Programming and Design 2nd Edition Raj Kamal


Slide Content

Embedded Systems Architecture Programming and
Design 2nd Edition Raj Kamal download
https://ebookgate.com/product/embedded-systems-architecture-
programming-and-design-2nd-edition-raj-kamal/
Get Instant Ebook Downloads – Browse at https://ebookgate.com

Get Your Digital Files Instantly: PDF, ePub, MOBI and More
Quick Digital Downloads: PDF, ePub, MOBI and Other Formats
Embedded Systems Design 2nd Edition Steve Heath
https://ebookgate.com/product/embedded-systems-design-2nd-
edition-steve-heath/
Programming embedded systems with C and GNU development
tools 2nd Edition Michael Barr
https://ebookgate.com/product/programming-embedded-systems-with-
c-and-gnu-development-tools-2nd-edition-michael-barr/
Making Embedded Systems Design Patterns for Great
Software 2nd Edition Elecia White
https://ebookgate.com/product/making-embedded-systems-design-
patterns-for-great-software-2nd-edition-elecia-white/
Fast and Effective Embedded Systems Design 1st Edition
Rob Toulson
https://ebookgate.com/product/fast-and-effective-embedded-
systems-design-1st-edition-rob-toulson/

Software Development for Embedded Multi core Systems A
Practical Guide Using Embedded Intel Architecture 1st
Edition Max Domeika
https://ebookgate.com/product/software-development-for-embedded-
multi-core-systems-a-practical-guide-using-embedded-intel-
architecture-1st-edition-max-domeika/
Design Patterns for Embedded Systems in C An Embedded
Software Engineering Toolkit 1st Edition Bruce Powel
Douglass
https://ebookgate.com/product/design-patterns-for-embedded-
systems-in-c-an-embedded-software-engineering-toolkit-1st-
edition-bruce-powel-douglass/
TCP IP Lean Web Servers for Embedded Systems 2nd
Edition Jeremy Bentham
https://ebookgate.com/product/tcp-ip-lean-web-servers-for-
embedded-systems-2nd-edition-jeremy-bentham/
Real Time UML Workshop for Embedded Systems 2nd Edition
Bruce Powel Douglass
https://ebookgate.com/product/real-time-uml-workshop-for-
embedded-systems-2nd-edition-bruce-powel-douglass/
Embedded System Design Third Edition Santanu
Chattopadhyay
https://ebookgate.com/product/embedded-system-design-third-
edition-santanu-chattopadhyay/

,:.
.·,
,
Embedded
. S
y
stems
Architecture. Programming and Design
Second Edition
Raj Kamal
004.16 KAM
\I\ ll\\1111\\1\\II\II\ II\
12994

Acknowledgements
am immensely grateful to my teachers al the Indian Institute of Technology. Delhi (1966-72), and the University of
Jppsala, Sweden (1978—79, 1984), for teaching me the importance of self-learning and the essence of keeping up with
merging technology. I would like to thank Prof. MS Sodha. FNA, for hi.s support and blessings throughout my academic
fe. I acknowledge my Indore colleagues—Dr PC Sharma, Dr PK Chande, Dr Sanjeev Tokekar, Mrs VrindaTokekar, Dr AK
.amani. Dr Maya Ingle, Dr Sanjay Tanwani, Ms Preeti Saxena. Ms Shraddha Masih, Ms Apama Dev, and Ms Vasanti G
arulkar and other university academicians. Dr PS Grover (Delhi). Dr Harvinder Singh Saini (Hyderabad), Dr S Radhakrishnan
Srivilliputtur), Dr TV Gopal (Anna University) and Dr KM Mehata (Anna University)—for lheir constant encouragement
nd appreciation of my efforts. I am thankful to the editorial team at McGraw-Hill Education India for their reviews and
.iggestions. I acknowledge my late colleague Dr MK Sahu. Head. Computer Centre of the University, who will miss seeing
iis new edition as he passed away during the last phase of the preparation of this book.
I would also like to thank all (hose reviewers who look out lime to go through rhe script and give me their feedback.
heir names are listed below.
Ramanaryan Reddy
>ept. of Computer Science and Engineering,
idira Gandhi Institute of Technology, New Delhi
lilima Fulmare
Hindustan College of Science and Technology. Agra
JikhiJ Kothari
)ept. of Electronics and Communication Engineering,
>haram Sinh Desai Institute of Technology. Gujarat
upriya Kelkar
'umniins Institute of Engineering and Technology,
'nne University
himli Adhikari
>ept. of Electronics and Communication and Engineering,
'alcutta Institute of Engineering and Management. Kolkata
Hpankar Ghosh
)ept. of Electronics and Communication Engineering
■engal Institute of Technology. Kolkata
lebashish De
>ept. of Electronics and Communication Engineering.
leghnad Saha Institute of Technology, Kolkata
I
P Kabisatpathy
Dept, of Electronics and Instrumentation Engineering.
College of Engineering and Technology. Bhubaneswar
KK
Mohapatra
Dept, of Electronics.
National Institute of Technology, Rourkela
JK Mendiratta
Dept, of Electronics and Communication and Engineering.
II. K College of Engineering. Bangalore
Lyla B Das
Dept, of Electronics Engineering,
National Institute of Technology, Calicut
Santa Kumari
Dept, of Electronics and Communication Engineering.
Andhra University. Vishakhapafnafn
V Murlidharan
Dept, of Computer Science and Engineering.
MS Ramaiah Institute of Technology. Bangalore
Josephine P Kumar
Dept, of Computer Science and Engineering.
MV.I College of Engineering. Bangalore
Stanley Johnson
Invensys India Pvt. Ltd., Chennai
Finally, I acknowledge my wife, Sushil Mittal, and my family members—Shalin Mittal. Needhi Mittal. Dr Ami
Londaskar, Dr Shilpi Kondaskar, and Ms Arushi Kondaskar—for lheir immense love, understanding, and support during
le writing of this revised edition.

Contents
Preface to the Second Edition
Preface to the First Edition
1. Introduction to Embedded Systems
1.1 Embedded Systems 3
1.2 Processor Embedded into a System 5
1.3 Embedded Hardware Units and Devices in a System 10
1.4 Embedded Software in a System 19
1.5 Examples of Embedded Systems 27
1.6 Embedded System-on-chip (Soc) and Use of VLSI Circuit Design Technology 29
1.7 Complex Systems Design and Processors 32
1.8 Design Process in Embedded System 37
1.9 Formalization of System Design 42
1. 10 Design Process and Design Examples 43
1.11 Classification of Embedded Systems 52
1.12 Skills Required for an Embedded System Designer 53
2. 8051 and Advanced Processor Architectures, Memory Organization and
Real-world Interfacing
2.1 8051 Architecture 62
2.2 Real World Interfacing 72
2.3 Introduction to Advanced Architectures 84
2.4 Processor and Memory Organization 96
2.5 Instruction-Level Parallelism !04
2.6 Performance Metrics 106
2.7 Memory-Types, Memory-Maps and Addresses 106
2.8 Processor Selection 113
2.9 Memory Selection 118
3, Devices and Communication Buses for Devices Network
3.1 IO Types and Examples 130
3.2 Serial Communication Devices 134
3.3 Parallel
Device Pons 143
3.4 Sophisticated Interfacing Features in Device Ports 150
3.5 Wireless Devices 151
3.6 Timer and Counting Devices 152
3.7 Watchdog Timer 157
3.8 Real Time Clock 158
3.9 Networked Embedded Systems 159
3.10 Serial Bus Communication Protocols 160
3.11 Parallel Bus Device Protocols—Parallel Communication
Network Using ISA. PCI, PCI-X and Advanced Buses 166
3.12 Internet Enabled Systems—Network Protocols 170
3.13 Wireless and Mobile System Protocols 175
4. Device Drivers and Interrupts Service Mechanism
4 1 Programmed-I/O Busy-wail Approach without Interrupt Service Mechanism 189
vii
ix
I
128
187

Contents
■ n
xiv j
4.2 ISR Concept 192
4.3 Interrupt Sources 200
4.4 Interrupt Servicing (Handling) Mechanism 203
4.5 Multiple Interrupts 209
4.6 Context and the Periods for Context Switching, Interrupt Latency and Deadline 211
4.7 Classification of Processors Interrupt Service Mechanism from
Context-Saving Angle 217
4.8 Direct Memory Access 2/8
4.9 Device Driver Programming 220
.5. Programming Concepts and Embedded Programming in C, C++ and Java
5.1 Software Programming in Assembly Language (ALP) and in High-Level
Language ‘C’ 235
5.2 C Program Elements: Header and Source Files and Preprocessor Directives 237
5.3 Program Elements: Macros and Functions 239
5.4 Program Elements: Data Types, Data Structures, Modifiers, Statements,
Loops and Pointers 24/
5.5 Object-Oriented Programming 262
5.6 Embedded Programming in C++ 263
5.7 Embedded Programming in Java 264
6. Program Modeling Concepts
6.1 Program Models 274
6.2 DFG Models 277
6.3 State Machine Programming Models for Event-controlled Program Flow 282
6.4 Modeling of Multiprocessor Systems 288
6.5 UML Modelling 295
Interprocess Communication and Synchronization of Processes, Threads and Tasks
7.1 Multiple Processes in an Application 305
7.2 Multiple Threads in an Application 306
7.3 Tasks 308
7.4 Task States 308
7.5 Task and Data 310
7.6 Clear-cut Distinction between Functions, ISRS and Tasks by their Characteristics 311
1 ."7 Concept of Semaphores 314
7.8 Shared Data 326
7.9 Interprocess Communication 330
7.10 Signal Function 332
7.11 Semaphore Functions 334
7.12 Message Queue Functions 335
7.13 Mailbox Functions 337
7.14 Pipe Functions 339
7.15 Socket Functions 34/
7.16 RPC Functions 345
8. Real-Time Operating Systems
8.1 OS Services 351
8.2 Process Management 355
8.3 Timer Functions 356
8.4 Event Functions 358
8.5 Memory Management 359
234
273
303
3S0

Contents
8.6 Device. File and IO Subsystems Management 36!
8.7 Interrupt Routines in RTOS Environment and Handling of Interrupt Source Calls 366
8.8 Real-time Operating Systems 370
8.9 Basic Design Using an RTOS 372
8.10 Rios Task Scheduling Models, Interrupt Latency and Response of the Tasks as
Performance Metrics 385
8.11 OS Security Issues 401
9. Real-time Operating System Programming-I: Microc/OS-11 and VxWorks 406
9.1 Basic Functions and Types of RTOSES 408
9.2 RTOS mCOS-ll 410
9.3 RTOS VxWorks 453
10. Real-time Operating System Programming-ii: Windows CE, OSEK and Real-time
Linux Functions 477
10.1 Windows CE 478
10.2 OSEK 494
10.3 Linux 2.6.x and RTLinux 496
11. Design Examples and Case S’tudies of Program Modeling and Programming
with RTOS-1 511
11.1 Case Study of Embedded System Design and Coding for an Automatic 5/2
Chocolate Vending Machine (ACVM) Using Mucos RTOS
11.2 Case Study of Digital Camera Hardware and Sofware Architecture 531
11.3 Case Study of Coding for Sending Application Layer Byte Streams on a
TCP/IP Network Using RTOS Vxworks 537
12. Design Examples and Case Studies of Program Modeling and Programming with
RTOS-2 566
12.1 Case Study of Communication Between Orchestra Robots 567
12.2 Embedded Systems in Automobile 574
12.3 Case Study of an Embedded System for an Adaptive Cruise Control (ACC)
System in a Car 577
12.4 Case Study of an Embedded System for a Smart Card 593
12.5 Case Study of a Mobile Phone Software for Key Inputs 604
13. Embedded Software Development Process and Tools 618
13.1 Introduction to Embedded Software Development Process and Tools 620
13.2 Host and Target Machines 623
13.3 Linking and Locating Software 626
13.4 Getting Embedded Software into the Target System 630
13.5 Issues in Hardware-Software Design and Co-design 634
14. Testing, Simulation and Debugging Techniques and Tools 648
14.1 Testing on Host Machine 649
14.2 Simulators 650
14.3 Laboratory Tools 653
Appendix I: Roadmap for Various Coi.'l^e Studies 662
Appendix 2: Select Bibliography 663
Index 668

Walkthrough
Introduction to EmtxxJded Snrorru
” 1.1 EMBEDDED SYSTEMS
1.1.1 System
1.1.2 Embedded System
Definition Qtu; of ihcdcllniiiun-. ul tmlxdded nJrm i' j- full..- v
"Art rmbeddrd tjilrnt » u ivMrm 'hut hat indudikd u>)ln>ur u"d i<Kiputcf->u>rd^irc. »liuh muLrs it
Rmtx'dJcd system*. have been defined in hi«>ks puhli'tud :
uf definitions from otherv in the Held:
Simple approach with interesting
examples and figures
Simple approach with figures to
explain complex topic of system
on chip for a mobile phone
E^twMcd Systems
•>. Other fcifieaftdmiltif units.
An ciemptiry application >if Mich an embedded Sn(' is die iiu*nlc plmrus Sinele psiRx*-.' pncewirs.
ASYSTEMONCMiP
SIN&.E PURPOSE BUSES
PROCESSORS
OSGiTAi.
asipi cmcuns
. . TWER
IP, MUX,
BtTAADORESS .. -
GENERATOR PORt
INTERFACES
PROGRAM PROGR-M. DUAC
AOORESS data
GENERATOR AN0PORT
UEMORT IN1ERRUPT
COHTROUCR
MUtlt-
PROCESSOR
CBCWTS.
• i5-2tr* -cm -a a%
AREA AREA AREA
i«t. J.}0 ASoCembeddedsyitetnanditscommonbutwithinternalASlPiintcniaiprocesson,
IPl shored memories and peripheral interfaces
A syStem t' 4 *” wnrClllg. organizing or dimly- nW •» male. '.< .1- si'irilnli; In J 11 sei. plan, pc.glani.ir
•<t ofrok‘. A spk-inisalw. an MrangeiTk-ni m which all ■!' umis a.w-mHe amt <nrk u-gilbc'according tn the
plan or prugrani.
Consider a watch, It is a tnne-di-play .y.lcn, Ils pails j>< n. hardware. needles ami hatiery with I he
huuliful dial, chassis and strap ffu-n- i*jrn iv Jinn* ttic real nine ci cry s<v«Hid and cuntinwwsly
update the lime every second. The system. program updates the display using three needles alter exh second.
Itfutluwio let of ruin. Some of lhc.<c rules are astulli.ws <u All needles move only clockwise. tin A thin and
long needle routes every second such dial it return. to same pr.inon after a minute (nil A lung needle rutiles
every nunw'esuch that itneiunu tn same position after an hour, (in A shun needle n nates e > cry hour such dial
il returns n> same position after twelve nours tvi All three needles return to the vane inclination alter twelve
hours each day.
Consirfcr a washing machine. It is an automatic clothes-washing system, lie impurunl hardware pans
include its 'Ulus display panel, the switches and dials for u-er-defined programming, a tin. tor to rotate or
spin, its power supply and control unit, an inner water level vow. a solenoid salve tor letting waler in and
another valve fur letting water drain out. /here f^'ti wrguniw to wash clothes autunuticuHy accixding to a
program preset hy a user. The rv.trrny-pr>'errwi rs activated Io wash llK dirty d<dn*s plxcd in a lank, whwh
rotates or spins in preprogrammed steps and stages, fr fulton a ui "f nilrt Suioc of these roles arc as
follows: (il Follow the step* strictly in ihc ii.llm.mg scipn-ricc Step 1. Wash hy .pinning the motor according
to a programmed period. -Step II: Rinse in trcsli waler alter drarmng vol the dirty water, aid rinse a second
lime if the system is nut programmed in waler-saving nude. Step lit Alter draining imii the water completely,
spin the motor fast fora programmed (dud for drying by wniriiugingout waler Irunt ihr clothes. Step IV:
Show the Wash-over status hy a blinking display. Stund the alarm tut a minute to signal that the wa‘h cycle is
evmplcie. IiiI Al each step, display lhe pridess stage of the system. <m> fn ea-a: til an iiiierropuoti. eiecute
only lhe remaining part i'f lhe program. Mailing from the p'siiion wldn ihi- process was interrupted There
Can be m> re rx n ii on from Slept unless the u-arr resets the sysigmby in-efting another sc"1' clothes and rc.-els
thr program

xviii Walkthrough
Oswaw^ SysWi Pwyjs’wu^-U C£. O9€K.*« Awr-Tmc Inu .
Summary, keywords and their
definitions, review questions
and practice exercises in each
chapter
Review Questions
f i— . ■ ।
5. ‘5?’’“s' Practice Exercises

Walkthrough xix
____
>'
'pTCpaMrfrqCcneaptiaM&'«MiMadP'ognMr*qhC.C*« arddeva
1 Aa Java codn are fini interpreted by die JVM d rum comparatively elowly. Thia disadvantage can he
overcome aafollowa-. Java byte rode* can he convened toriMsve nwtune codes ftx faw .•jraimg using
jusl-rn-time (JlTJcompilalitm. A Jiva accdoalor teo-pwever) can be used in the system ft* fast
code-run.
X jAvabytn coder that arc prtendeef resafa larger memory. An cntbedW Java tyOcm may need a minimum
Cf SI2kB POM and 512 kB RAM became of the need to fire tnoalJ 1VM and run the application.
5.7.4 J2ME
(J»e of J2ME/Java 2 Micro Edition) twJav* Card c* Embedded Java helps in reducing the rude luetuK kH
for (he uaual application! like man card. How? The foUowiog arc the method!
I, Use roteetaacaonly.Claueaftwbalkron-timcenvironment fetmtheVM interns! t'ormai araloMy
(he programmer"* new Java clauea are not tn internal formal.
X Provide for configuring the run-time enviroctrneti. Eaamplca of configuring aredrfetmg rAeesrepnun
haniling clout), mer-defincd cluit loader), file ciautl. AWT clout), rrni'hnmited thread), thread
groufi. tnoill-dmmtiaul array) and Jong md flooring data ryptt Ocher cwfiguring examples are
adding che specific cluaea—daugnme. input, output and streams fr> connect tons to network when
needed.
3. Create one object at a time when running the multiple threads.
4. Reuse the object! instead of using a larger number of objects.
3. Use scalar types only as long u feasible.
JavaCard. EmbeddedJava and J2ME are three venioro of Jiva that generate a reduced cede siu. J2ME
provides the optimized run-lime environment. Instead of the use of package. J2ME provides fur the codes
for the core classes only. 'These codes are stored al the ROM of the embedded system, fl provides for two
alltmaiivecoctfiguraliooa. connected device configuration (CDClarsticonrcctcd limited desire configurations
rrtno CDC inherits a few classes from packages for oet. security, io. reflect, sccurity-cea test. leu.resources,
util, jar and zip. CLDC does oct provide fee the applets, swt, bears, math, net, rmi. security and *ql and ten
packages hr jiva.lang. There is ■ separate javu.mircoedrtiaa.so package itr CLDC cun figuration. A PDA
ipenonal digital assistant) or mobile phene uses CDC or CLDC.
There is scaleable OS future in J2ME. There it new virtual machine. KVM nr an alternative 10 JVM. When
using the KVM. the system needs a 64 kfi instead of 512 iB run-time environment. KVM features arc as
follows:
1. Use of following data types is optional, (a) Multi-dimensional arrays. (bl long 64-bil integer and tel
floating points.
2. Errors are handled by the program ctasaes, which rahenl only a few seeded error-handling lit'-*'
from the java bO package far the exceptions.
3. Ute of a separate set of APIs (application program interlaces) instead uf JINI. JINI importable. But in
(he embedded system, the ROM hu the application already ported and the user does not change it.
4. There is no verification nf the classes. KVM presumes the elistc as already validated
t. There is m> object finaliUUoii the garbage collector does nor have tojx-rti *111 InlK-viinwiviigrtungcv
in the object ter fiml'utiioo.
6, The class loader is not available to the user program. The KVM provides the loader.
7. Thread groups are not available.
8. There is no use of java.Ung.rcflection, Thus, there are no interfaces that do the object serialization,
debugging and profiling.
Simple way of point-wise
presentation of the details by
using lists and tables
Program Modafctg Concops
Table 6.2 UML Basic Elements
I Mndrllixy
j CM"
Widl dot) it rmitl
are! thtra-'
Class defines the states. aoribum ano tadunt**. A
clau can alto be aa active or atucract clAv
i Afcvxi
1 Cl-ll!
Object
Active
object
A ciaM in general may he abstract when cither rarer*
thorn states, operaon* <■ behaviour u eornpieiety
defined, being h an abroad age. or when it is not
fur creating objects but only a class, which c*tend>.
implencau the abstract behaviours (iMthedil and
specifies (he aharam roritues (fields ,* nremo)
that class can creMc the object.
An instance of a daa that e. a functional csaity fumed
by copying the tula. Stribum and hehavicw from 1
class.
An active class defines w> active cfcjen insurer n( an
active etass. A process or thread h equivalent 10 ite
active object in UML becaasc active object posts the
signals like rhrewl and cart wait before sirring or
rewriting the operation using the mcdsoA.
An active class ac*> a thread eta that has 1 defined
slate, attributes, behaviours and behaviours foe the
signals. Active dsa in addition, define* the -natroi
by signal betevun (for a signalling oi^ct. which
can be pouedandrar which it owy wail before starting
or resuming). Thus there is control on rhe class
behaviour.
Etreuilnrv Diutrurrvrviti.'
ftriirr.enluh.a.
Kev'Luigvtar hut uiih dissolves a. dsown
in Figure ft IfX-’l ft* etas ccinic* I.* it. -
identity, attributes and behaviuur. |
(o[ciaiio<l' or mcihudt vr iouIUa-i <w j
1un.-iH*tsi
Rr.tangvlar hot with din.no. for eU.x
names for its identity, alirihutrs and
opetvnns. but with prefit abstract w*b I
each ahorjct behaioiur ami aliirtarc
i
kectangutu bus with ob^ct identity I
follirwcd by wniKohm and class idcnlitv i
as sfs—n in Figure ft Ittifi
Rcvanpita For with itijcfl tienni
followed by scmtrokei ami ebss j
identity, lair with prefic «tivc with ■
ibjevt idcniHy. j
Rectangular hoi with thick border lines I
aril inner UivisiiMH ft* the ciaM narr*v !
for the identity, anritxues and Fehavnwn j
foyuratnXB *id signals), hit with peefis
as-ttvc with etar sdreeily.
I
Signal An object, wttidi it km (postal) front one active etas
(active object) to saoiher waive etas, wpidi uu foe
Man er resumption. Signal obsea tahaviuw tlcfines
the behaviour (operation roahod) of the kaspmeeas
eoasmmiatioiL (Signal (Section 4X2) is software
ihslncttm or method (tncuon). which gtaeralea
rmcrruftl Signal object tins attribute* (peatnctcrsl.
ASribute may be just a flag of I -tit.
Signal identity within two pai** of
iiacung and ctaang signs Ccshswral by
Ctai idcniity (Stmita to sttrcoiypeK
Slereo-
IJT*
An Dspacked cofioficn <4 dements (tfritam or
bdHvfrw) tiuf B repeatedly toed.
Rectangular bos with stereotype identity
ttme given ■ifhh Ihe iwn pairs of
aurring wad ekmirg signs Mbvnf by chr
class ickwky as shown in figure 6. lf(r>. |
IGmafi

Walkthrough
c^. SUM of UoMng and Progmmmmg -«n RTOS- >
)/• End«/Cotte Cw d^pVyTLmeCtec ftmclkm •/
69. r BR coda far po*Vg ■*»<■ far lap U>TM.Cfc<*«y •/
SR_TIneU<tt <>( , _
y. r^f— far crMseg * nvtragr far <r* and <fa*C ate each >’»? mtmfl fate 1V V Mem
KTCfct’f
TO. OBMtaxIVs (MbosTuacD^StrMsg, timcDaac);
71. )7>En>c( 13 R_Ttme Date euV’l
"11.2 CASE SHIM OF DIGITAL CAMERA HARDWARE AND SOFWARE
ARCHfTECTURE
TK digital OWi was iiuroduccd earlier in Section l.hl.4. Athgiialeainen issneeam^cidSrX.ISeetteilA I
1.10.4 Ihied tV camera funetkte. hardwwcaruj wdiwwc units. Hjirt' 1.14 4u—rd tWrdwwe
tn) wfiwarc cnmfeeicnu in * wnpte d>g*al earner*.
Scrtiou 11.2.t oral 11.2-2 gi't iVdcugn Ucyw cd* digital camera. Scslnwv 11 2.-* am) 11 24 dcwnV
hvdware and telware atvfaitciurc.
11.2.1 Requirements
RcquirmeW'ufiV digital earner* e» he undcruond through a requirtment table given m Table II I
nr OruiM funrtum iiuU* du earner* an ai faOm:
I. A « <9 onurcdlen crnuol Jitdicr. flash. <fro example, for pcnfdtcnh. direct mermuy KCOS. nJ
fote*r. neo facts and eye-ball image control. GUI consist* of the IXD display tor graphics. and
< wils-Vi and Iwueass f« inputs al camera. A liaahxrcen n amaher ahemaurc !•» VXD an) keypad.
TV user give* commands for twitching on the omen. Huh. diuricr, adyvrl brightness. couth.
s-ulnr. tare nJ transfer. The t»cr cnmmaruK vc in the hem of truerropr ogaah. Each sagnal groerate*
farm aute inpul from an t^craied twitch or burton. Uhen a bunucr (or opening the dwuer n prewol.
a I lash lanq) ghros and a self* timer circuit switcVv off the lamp aulcenalicaJIy.
2. IV (Vrarc generate light, which fill, m tV CCD array, which through an ADC tranuraw the bib
far eachpitetin each row in the frame, and also for 1V dark area pitch in each row in a veriKsl scrip
lie nflri cwrcctirm in CCD signaled light intensities far nit row. IV srnp t* m adjacent frame
3. A pkswvcrwvriH eda number of pi lets. TV number ofprset'used fir: pcture determines ffwilroiiuL
f*K picture sirtsoas of a number oThcrnnmlaJ and tenical pitch. Fur 2592 < 1944 (wtcK there are
2592 * 1*44 s SO.'KMK arts cd celts. i-Vti *ct of pixel hat three cells. fir the red. erren and blue
nimprnu in J piacf. Each cell getsespuaed Io a picture when tV shutter ufcanwruiysensim a met
command. 7he »anrro ffrnrds rte pictures irong a rtarge-tiwipW desires iCCDramy 0>r array
crourtsefa Urge rutrnber of CCD cells. throe at each pitch J
L
T.
a
/
K
C,
o
■J

c
T
/
‘1/
Mx mt/ fruM rmAardtLJ m/rmi dr»iffi th? thtrr • i/’e* ihm/iuM */lt4 in t*wi
t *toi/M«*f uW (ovr m rW w <r rkipw r 7 V /i • u i r i (mJ* t v 1 iAn outtRaniif <Avriita' *
rr^tf Mliu fXCVM/ !■ Ate A »H' rJ aj • h/ nn tn*r I. Hl 2 / A/ • -^<
it^fh it tif milmrn«it«'rJru'br<iA ) V) 4 <*'4
*/ fcAii A rvi tWAJtHfii cii'hr' ia < //
/V ubftx D.n lAf»* i tJw urr Ut i
t !•* irvn» hrv ti* irf 44 ijirrm uzr
liilftL
2. Ta At* UHl. n wi/ u> iV ^rnx*i t-f /Ar ijifr***.
J. Tit {ett'n fo defint htrdtrtft m/i tttprt’cri u>t •••
7i> Au m A* ki (Afbv* ^Ar wjhiw *rAiQcWr A fv r <rrv/w* tumid* •
plated rfUmi *Ar ia^*ufT i*ru
<7«iyK«KHJ>, /VTItftTfrM «/M^AaKr
1 T<t feat* lading fur d/ttin impUfnfnialion un^r A/VCVZY u*/ VrUti/li
#T7V.V’. dlx« /V uif r/ tT(\ f,u fiu* ivni Aa*<«/iin uaJ < w'rrn;
*11.1 CASE STUDY OF EMBEDDED SYSTEM DESIGN AND
COOING FOR AN AC/TOMATfC CHOCO1ATE
VENDING MACHINE |ACVM) USING MUCOS RTOS
ACVM wi* 1 arodueerfcaiIiftNafiwn I H>,2. h ACVm fafKlic*'. hMJwjre
i/xl Wiwdc unib. Fipjfc t.U *1**01 j diagrarrunjcic ripvtxflLiui«n H ACVM
SechnM JI I.Mo IIJ.AgivethedeMgnan AC'VM. V.2ik'wnt'cd
MUCOS StTOS. It ta a portable. ROMabk. scabbte. proemfioe. real nn« jai!
multiuskifif kemeL Section 11. J.? 4ncnhe* Gm AC'VM tohin^MUCtA** KHAS
(Scctiw 9.2) propimrung envmmmrnl.
11.1.1 Requirements
TIk crifui/ttwntt td dtf mo;hinr rm he uMentm«J lhAAigh j rrquftc/ncTM IjNc
pun in Table N.I.
11.1.2 Specifications
The ACVM spccircAik*i\ in brief arc v Jullu»> .
1. Ct h<s an ulfd^nunffie keypad <w» iftc l"p the flixhi/w TJol cnjhte* J
chihJ to imencl »rth 11 when bovi a c a rbw ci Parr The«r» ner c.m J w* cy* i imji-1
j nJ <nicr*xt uch the ’iijchihc
Explains modeling of programs and software engineering practices for system design by
case studies of systems for automatic chocolate vending machine, digital camera, TCP/
IP stack creation, robot orchestra, automatic cruise control, smart card and mobile phone
Embedded SyUemi
4h, /• Wriie IV imy element* ufkr encry^irwi. •!
ApplSir w SmanOStiiwiypi <rruwnUp,< DfSi.
5mirtU$Ql*ud (MtgQSun. AfT*Su>;
49. !• gaum Ddlyed uA uA .PW. •/
SmanOSTiincDlyRcura: (Lni.PWPmmijrp
//•Eid of While kxf’l
iO.V'EndcfUttjln^Cnia. V
...............
*........
22.5 CASE STUDY OF A MOBILE PHONE SOFTWARE FOR KEY INPUTS
Mobile pbmo arc wtiarl. Each fdmne fan many APlt Eumple of API* are pfamc. SM5 I*bnr1 me*ugc
uncrl MMS (nihimcdia mouxiny lenfoe). e-mail, akku book, —ell bmwung. enlendar, ladt-i.Hfo
lul. WimtfVL Pncket-VfanL i^ta-ExcH. awe-pad frv mono*, portd-ri'f., -Irk <bow andcamera.
Meiile phurw with a large icudbem 0fe a vsloal keypad Mrtile pKxw with a -mall wrecn u*e* T9
keypad. TV preirff case study relate in'SALS creacapplkatirti' bi a ombile pfame wiip T9 keypsd far input*
Section 115.1 gives tV icquiranrautd SUS create and *cnd applii-ainwi'. Sectuut 12-5.2 give* thr
uluses and clxa diagrams. SccuM I IS J gives tV abac diagram art! Scttam 12.5.4 gives cnminjmeaiiun
hardwn. SerJon 1155 describes wfrwoe achVdure. Section 12 5.6 ck-w-nN-t the bnfiwnre lash, ud
Syacteuriuiiun Afodcl for rhe atgAotm
12.5.1 Requirements
A pmcoaor. keypad, acieea. snxlch pad nrestery, penbleace rnemLCyandcreiimunication unit* arc required
heSMS ocae and out appUcajraxScnucbpdaiaooryadihtMS or used fur icntpnrary saving ofchmcieet
foytes) duriaf the appiicaiirai. PcnVoics tthjaory addresses are used u^q *m+i ihar as scam a change i*
made m the byte, it prrats era after lhe pow ewiictes off. Further, when tVn. is a change there, an
idenCai dtangc is refleoed in o/Vrcnrreiasedcbjeca. For example, a rtunc holueuina (V fietVCwcts.
de <me dtmgc laftcs in the file for Mhos boot for ndiiig t V e-onils.
figure IUD shows speeife MS. which MtBwdfortV SMS fact naeappUcataui. TV smen is med for
(EflttayttgiVnsmLHgwe IUD dtows tha diac oe four CErux5cys(up.di wiL left aMn^uldeixned by ri.
Cl Cl and C4. In oaugaiter keybad. fear (Sifcreea emer keys are med. TV mobile na»r key in tV kcy^J
i-jradilhait fti’rtS.ns asfocxkeys When thetcy is(msad towards die left iVinnurmmea left foLuta
'.rmgvcndtti.' ' a» the tight die eunwrwncsngbat-sk. aad seen for i^,Tyro drum <11
la edditkr. there are fmr command keys (righKomer sccoodupw. kfi<omcr Kturxl-row. rigli-cnmer
firU-row and left-eoner Tintmwldeaaed by keyULowLkcy iRowlkcylRnwl atri key IRtiwI. Also, there
arr. mne TV keys far oumben I to 9 b wtf! a for alphabets a to a. (« A io Z>. TVre we iwo modr-keys
ftcyMI and kcyM2) and one keyO key far byi^ in a nt character oianVrQ nr yxav. A)/tcavn>cnc>cnio
mall case or eapiul case is controlled by a mode-key's state. Teu characw entered tn keying depends on
Alate of die TV key. |Recall Rumples 5.6 and 6J andSectfon 63|. .

Walkthrough xxi
ErrMdod Sr»*™
4

A
K
K
I
Q
o
E
c
-r
i
E
5
K* B'jJf /mm iht f'JL^ing j/i rAn ,ipkf.
fu Bu.<k ftinchotu and npti vf fTOSti
hi' XTPX pCOS-lt ai MUCOX «n fht lent thrvugh iff riMwipffr—
tMtinplf 1V. I m 9 20. WAar arymi*iUj art paiwrfuaf irfeM nJwJ an minted
fttr rtii h <0V/i MUCO31 finiftw* •ill 6r cj^w«A It artin* *ht m<v «/
in rV AWCOJij tMp'fcvv/«r a remit • tv tn t] onaAtr UFOS it
urd Utttf J hit- di Ar/p f/r«jrfv m wUrr itum&Af fr ijJhmc W- and
mhrddrd JtfTAVi lairt <m.
ran k'rHo/Lj fuim Wtnd Hiivr* Stitmi m of iff an HTOS far »^ph/ifii and
tfdmMrJ irifi'MJ vi/A fuivttfal tuyl loppy* • thniugh irnn tuirtplct^
Ktamplfi 9.21 *•• 9.27. bifffnnftx brtntrt <Ar ft Hart 1 irm*tpAarrt
wwi Jfes tt i u</ 4*/w i irirt ft QVd tv Aai of MUCOS ndl ht •"•lit fltof
O»pw K* • rff drxfr&t lAc Hv>fowt Ct OSfiX reirf-f*mr fjftu f flTfa/uui.
5.1 BASK FUNCTIONS AND TYPES OF RTOSes
A rumple* rnd'jtt*tirt£ embedded QUem detigfi re/juicc* (he dcvelapmcm of
thwwghly tcUeJ hup free cafe* fa
l. JAtegnacd devtJapmeft efivinmment
2 Tuk furwiiixn in emhakfcd C « emtakferf C**
V Rcif-tinv ckxk-bwed hiftjwwt ind mftwire umen
a. Scheduler
V (Tevet driven «nd device mi Mger
6 Funetn«> f« [HTj vtiftg the vgMh. event (U< fnwp. wmiptvrr-hiftUmg
fuHciiofti »d function* for the queue*, m*ilbu*fcv pipe ind wekeb.
7 AddiUauJ (qm'mjim. fur cutapte* TCMP of US8 or RlwUjOth* a WIK of
IfDAMdGUh.
R Fjra md exception htftdtuig function.
v. (ruing and 5, uc m de huggiry wrffwirt for Icwag RTOS a% « e 11 a< de vchpcrf
embedded 4ppliCJ»f*,
9.UuJ shows the tag fumu*m* cipcttcd from the kmd of an RTOS.
The RTDS'% hi«c the fdJowing future* in genenl.
1 Ic/tkI fuiw'iiou and ichcduling.* preemptive e» pre-cmRrtc plus lime
dicing.
2 . Pnuniic* definicmns fur ihe CxsX> and 1ST.
V Pnoniy mhenuncc tenure <« oRjm ci pnurity ceitag (eattfe.
J. Lmui fa number of la«Xi
5. TA't synchro AUion md I PC function*.
6. IDE consisting of cd hew. pl at form builder. (iUI and trephre* wifiwjr?.
•.(Cipher, ikbugp3|! mxI hnsi urpci 'vpprihoA
?. (revue imaging tool and device driven.
(( f7iw*c /Y/SfX* (prwt f«qp<i_ini fvflnl* »n utrng lhe HJSf.V iparom tfr Tufbrw'ngs
< < I The tu fK i nAi R«d*«LMiU^ i ««cuu«t« <e\ the V t.Wiek*. Idwwy *u fcvwMi uw v( the KWX <>«w*
rhj DrfurKtun,^ i<w«rr. na^ vhner wlinkl JMUUuc.ck^andrmivc j.md m*cw
tel Dr ftfAaam n^.wuHi i / the ailnbvicid* a RISIX speoc.
Ml 1 he funciaau osteal < । mJ «fn_ft\xi*e () unloA and M • <f«w.
IcJ The fiwitiq n<i_iUjty I t ugMh <oa tingle warling ti'Alh* ihctma^e <* av«UMe The
mKv '*• <' * fcv a tab. which ha» hem tegrtrfed fa a mmTrai k* I feg i Ucrcd *i c an *
Jaitfot ukctocMcUihc na^nutifyj. Thi* prwrani n eMfO^fy mefo/fuo wrver tuk. A *er>cr
tart Kvciver tir m^iicatuMi from a dr nt t*dc thruiigh a Mgndhaaikr fiuKtk* (like an JKK i
H l lie fofeinm Ifrtfktct ihr aiuitarte irfa PDSLC (ftroc
fgt The rt)M\ .jane n^unlhik I 1net drun^ Ac <f«w imrAhatcly hut petent*
the <nhc« U«U ln« rung the ifurnc l>r ipeur »dl gs douuyvd urdy if the 11M usk cfane* ebe
ipcw. Jkak.iy iw b> dC'JtUxak* Ur nr'ruxy iMnriwd »ilh qmc IXB.
VcWitfU 4><vc\ bw»e tJcrAfaanal hjhuwtng fnii/tc* djTiotcwieficwnam he u<d. liilTwu
I-11-0 mdJok h« queue* bom hy multiple ia*L* RfSIX qumaa have the akiicavial firfh/wjag (e•kirr
U4 ft 41 fre J Km m t **e a single *stu*g ttfk is i vaiUMe IftJ there On be U pri<rity k*d» in place
or imc|Wumly iocH.'KGfXTft VcWiniL
12. CVruAKf a t*r»r drmc f»o nuJ.+nir or //*Ck Wh0 a Uak oukx a tskJD alkKUto tScctnm 93.il.
When OMOg the uU <eUtorf fmtfiom. the nunAcr tail iidca Uak ideAtfy. Sranlariy. a prpe fSaiiim 7.14 i<m
m Aid t Sci.v*i 7 I $ r im Gte I Stxdm X.6. ? I when cruiei. a fi te docrif*r <feta urudUK m cm al md a nuntfrr.
Ge cample, id n xuigrrd m ideveify Ac devcc croud. Tte numbs* h rnwgixd iffci claHiimeg j xi rd Jr
numhen abpnJy aJkratrd Whe» mwij: Ac deviedreltfal ImdiiMb. Ae nmotier farilitifca the dr* ice
The devuT fmrtM esampln arc vfen iv rod or write or gd Ufibur 9 vet 9 afifttuc ck“c tSnm<i X 61
A pqr it. VaWicts h i HFO^w. wbuch i* managed <M by quor tfC AnO/tn* Nit by the dc«icc4n«er
funutiiau. VtWud* ha* maoagcml funcucm f*M a pvpc-drHd (like a device Aixcrj pqw*/n*. Thi* 11 analifiaA
l‘» ihe named ppe driwr m Uwi. fipe* ahn in^Jcfncnt the unafrro.tjrmd iMtanauwt of tok.*.
FufKijiwi pipel'eiCfcaiC i’/jnp«//wprXo**r* . muuMki. maukfj/llytr/i crraici a pipe device named
ptfnHaon far muinaim «toi*i<7 mc\Mps E*h mage oa he of ni&Ktnis) ua Artec It cnicr*
ir.m a I in uf tk»ice* «m crerfxuu dev* f 1 fuiKtwn retrieve* th: 1n( of devrfts with the de«uT numbrr allftied
id Meh device including |wpc dencr*
Curuadu m cumplc (« crcAog a pipe named u piprUurinfo. Aswnre itaa *1 cac have a rottnfesn tX
fnur tncuagev i&cr name. po**«d. ictephunc number and c-ruait ID. tadi the< cuO b: of a nuAimum
m/c of J2 byto iMify A gkXmi variable fJ»» an integer number far J file docripfer that tdetuifet a (k*u*e
anmng a ninahcr of de»K^ at die IO *yucm. 77k ik*k*e can te a fife ur ppe or wekcl nr >*her dote.
K*ample V 26 ctpCam* Jk mde* tor creating. »*riimg and reading.
Example 9.26
I. * include Vedjh.h" P Indiofe du [0 librvy fmlicn*. */
pipeDrv l). /* Iroafl a ppe driwr. */
1. <* Declare file dscnywt. ♦ I
mfdi
3. P Mode refer* 10 the pennhoan in at* NFS (Network Rfe ScrrerL Mate h rev 0 0 for urnurfeial
permi«tkM. *f
IDI
4.7* Create pipe MmeJ a* pipeUicftnfo for J menage cart )2 byta maairaa */
Comprehensive explanation with coding examples for
learning the widely used RTOSes- mCOS-ll, VxWorks,
Windows CE, OSEK and Real Time Linux
Embedded Syilents
inlcmaj cwnmuntcutiorf. E&ten.ion diKA nrt permit creation and deletion ol t^vls durinp run. l*Aienxii>n defines
exh (1st <>f different priority and activates iiotfy inc taihecvdo. iMlcnsiim imi um; n>es<ape queues »1
vies semaphores as event flap only with no ask havmp rvo-time deletion <T crvjlinn of ilr'C.
|" OSEhMKAoiMcit............
i (Throe standards: MOPISTARC, Carrarwiotai slack and Network Management)
i'S "•
i EOfcient design ol , ■
. artMMtm' The ..
■ hint tie. nl*rr
1 shall be
: contigurMe and '
I Tti'ih'r *~ I
, ana&eCO&n*
; adnBW»r<o<d» |>
■archdedixitod'e
jsoffcatnnri !'
1 queuian ‘ f
।--------------- 1 -------------- ------ -
SMfleadon does not prascraie rrotems-naon averts and Vws provision o> aMoUrtn
independence win regards to MMdual bgrtomenMen and &wri ei the pcxtaWey and
* resMMy apflicaten wAeare
I EHtenee the perfarmenca d overal tjean <Mo<k *pMng addKond hardware due Io
I eoqkancad utBDtim cd the k*Ag«we («Mng rensna) tMAutod in (he vehicle
I* Verfcation d fiesOonatty and Inqdemeraadon <• IsuUjpes n aalacled pant prefects
I______________________ ____ _______ ______
Fig. J0.2 OSfKbasic ftatures

Walkthroughxxii
Omi^r*i Txts'. £*«* CUtaJJy. Cce 3>A
IMIItaam.May. 8U
rtMtopW. Arartrah IMI r^lra. Teykn Bl Froch. 0«. 3B5.
Ma*. USA. MM.
1)
9 mj KmmL
pwY» EdKf^B. $i*«E<L 2003.
11 K. VXL ‘WaiJrffcd te Spw.- Cortpo. Mp Mrffofrjvvf -
fW l/<h» Drvi wrh. 200).
0u^U» Bobftf WtOOVJ CLNfT.UXA. 2OQ3.
CwAtlia. "Dr4«v CnMW fiortwi'', M SAraa. CTR«2)> 2W1
prwt C V C K.. VUdGv^k Avhab Dm. AAr jkr&iMft
A. PRINTED BOOKS
I. GrWwn Fto<liF» B’ll 9ten« mJ Mm KaA*. vLm« Ajfiiantt Dr A Ma^>Oa GvaA
Fut^tSeixtan F^icliM SyriraA Uriah an".Springer, Mor. 2006.
prairie Halt 2001
$1MA 8. B«JL W*t4W Jynmr K^i ■brtf Druft, BaflD*vonb
itaam. Nw Mw. USA. 19% (T* Mfa. Mat 9021
Appendix 2:
Select Bibliography
us*, ro
4taf*Drdfa*,
(--o— w. Vajrara. Hitnrs^wr Syaaray. Aral Raw Mariydrtaf*.
Acporuiaj- 9etoa euto^icny
19. MpjVwvx.iMte nateAvs^lFx n^cntiog»»^ftiratMei t/ammsgujatl
20. lup/hraraEETAw.com(Frr rutecnlaAy u a W»l«otMted a>«Km rayUMel.
21 MpjrvwweRcnrWraibedBih |Fk wtaoibuf » • popular eateftW lywem rra^mrat
’.2 tat It w»« erMridtol-crranpiiuci cotwelcacr I For wbecrita*( » a pabular cotaddcd cooipuUf lyurm
maywraj
2) Mp/AraafomBModdmtA ppdar eoMdriri ry*a ■%!
21 KiqrWaaa aa« wrt^oiaxizri IA pofarls world "ifc rad BfCkvadia cm wt^Hc is daily de Lcy-ttnni
m «*riawi M<f«n|
C. PRINTED JOURNAL PAPER REFERENCES
■ Huan Ll Knthi RrinasmMm. FruhaH Sheaoy. Rods* A.G«0ri«adH>eD. SwWney. •«<«< Woufrww
tat Aral Raw TeaAa M «oMr Roterirr", Jewraai o< Syacna and Snftwwe. K>(1|. 962-971, 20%
2. C. R. <i«A N. Shnu. K- RawtiMhim. S. MrirwW.'EJIrriwhM nxSttrtnfxAmmuawAfpUcami:
A .wr Srad>~, Pnx at 11* tE£E Wemarari Goo/erracu oo Enriedfed taJ Tima Coanpding Syarirra lad
Afele&au" 2006
1 Lriv Berre. FtBxkaaai wad Knar. "CWfer Cnaien! frMdri Axotuotrn ttaxnrtj' IEEE Mem. 23r«).
M-». xm
4 Wayw Well, Bail Oia BM Tehaa La. "SwvrGracrar or CaaPaaAM Syumu**. IETF Micro. 22(5). 46-35,
2002.
1 tear Lmur Btlrt. 'EtgSadag HartrWCf>-dt»f* tA Wreea-U Pm FFCA>~ /Zryi) Jcamd. gp
H-n. Saw, law,. 2UO2.
4 Ou-Tiny UM| and Hom hoy 'Or"*B Uoftiat Cndar Cramed MA Caorararad Srrint StoMwy' law
Vehicle Syuma Dyrunucr. Jl.fV- Jll-JJO. 1909.
7. Tldad Mmu, */*arri Aru /*apr>urL AoJyei radAypteafaar”. hoc. (EEE. 77(4), $41-3W>. IM9
Detailed selected bibliography of books, journal references and
important web links at end of the book to facilitate building a startup
library for references and further studies in Embedded Systems
EnfeddM Systems
IS. Caiy F. M. >hmr.a>mKr,r aadMv<eraw ‘">-*-^'*wv'(,'^sT*n’r aidHo^ww £atm"My. Os(cod
UnhEftUy tfew, Nev Yivt. 199?
<6 Balann F.M CluaS*. A luoeUa. N. H«h- A I. la'.yr.-. C Poecunme. A E Smyanaaai. Vteolelli. K
Scncn. ah. K Saruli, aM R TaMua. #/un>-orr,.'a^-«m O-flrarn n/frArdidSmr^i; A P.du A.TVa»fc
Nnrxcll. S!A. Klu.cc Academic PuAIrdvrv laid 19*7
17 Joan FrarcM Bman. FmMIOJ Snrm A'a.rramAary m C unj AiirmN.>. Vta Ncawri. RcmhcJd. Nc» Tert,
USA. 19%
M fticrS|axi..Ar«nAvn<ra*r rnAnrd,.- y*r 4W2Z. l^EdW. fttnurcHoS. fi^mrandCldTA W. IOC*
39 FrrJ liilull. Ajiu C'lramaocuiwn C'ravulrr yrmniic ami Oyra S.urau. 4i>i ESaxa. tancr Edvuuoa.
1996 ilowth (ndon Rrynra. XDIi
90 Sdhcnchau end PR Calvin. OprnirMy Srarrai, Addrwai WWe*. Rearimy. MA. USA. 19%
VI. frier .MaramJrl. x*J Gcal Camrai. t'nlr CratKa^tt FxtMti fr.rirri, Ahram Academe niWicticn.
lux. Id*.*}.
92 Oanicl Tahah. Adranrrd Arn'mpmrrairai. McGrsv.HiH, L'SA 199$.
9J. Gajcl.. Daeul 0 . Frus Vahrt. Sxnj.r SaijA and lie Graf. Spr. dL'oram and Urain KmArddrrf .9. irrau,
Enykwrod C'-IK NJ. Proiiee Hall. 1991
94. FranUin G. F. I I) frat II aaJ A. EAami-Nerai. frrdharl Cmi*W rf thu&ue Snima, r* Ed, ArMicra
Walcy. Rc^uf. MA. USA. IMM.
9S. Sienan J. W.. Ar S»l Marnmnlkr—HaatMtr Stfium <rd Prance HaH, 1992
96. Wilier I Grmdiam and TTraui I- Vincera. Madrra GovralSyurwU-AAaluir<iAdUrvtra. Mo Wiley. 1901
47. Him, K. I and Daniel Trial. Mmv.mmdfrn—*»r*o«r»ra iS4*o«mM/Adri«HMwif, McCmir-JIrU.
im.
%. JaaaGoouk.AriyPn.inxM>Me CnArdMSruew AndnacUSA. 1942.
99 Giemndd C. D, Dw rjWCll Minra-mditr. Sanden Colkje PoUiahiat. 1991.
I®. Arina >. tt^Dtug* niiA A4rimrc»MAdkfldwJAGrnirT^rawm. TAcGraw Udl. 190.
B. WEBSITE REFERENCES
I
1. MrpVAra*abpvina<e. ’i.CTn IFnr Telia i.jmnirim DSP Pwcuo. Secwn lie, 136)
2. teipJhrav ncnmrfcaodrandaa (Far Sedrie IA|.
3. MipyfrrivjuairdicMeiei/ukMiedaleVvmTJain and anodjuni (For Scetina 2J3|.
4 InpJfmwjmao ISrnieo 13J, Ftr ARM froesm).
3. bepJAn<xjLeoaAcAkic i/lnhccttA2«racL ,appApa»6MaJrtrt I For Scam 2 -16(
6. hBpZMnrxaibcor| IRar temteunlaj rf|aifonuancea ti mdaatfrii Syacsa, Seaana 2.6 and 133.3],
7. hspJ/aww.jarajriiLCDcn.'fTOiiea/ja»«c«rd (ForSca™ 3.73).
<. tajrZArriw.nebc9edaxr»WrERW7<<cifiu»lin6_«rncnM>" I Fa SBia 2 tl.
9. hip-jTw».nnx«n |ForSB%i 9.3|.
in. kBpc/Araw^nd-vdLori [frr SaetiM IP 1|
tl. bnjtfnwwAioiixmi'eirScSiw '[K
11 hnp2Arwwza.«7xd»ad(ForCanfr' '.v,Mn*EniteddedSpanDo<o*eliai4eo<lWnrtiiyo<Calirvu
Rhttride, SecLoa llj(
13. tapjfrMu<4vn>aaal4-rrsMaMtHrax^era*Mfrr«i'irAcad (For Secta IlJI.
14. tapJAraw.taBXoml-jjJanitariniiMttai jFcTluwiM “ MBL Seco* till
13. IS^®c/2mmAteuxftteeAn|/taoriAVnMlira (For MIDI imafice. Seem 12.11
16. tapvKra*j(iiner(.ot (furSeaioa IZiwdbtGiiddiaet tar <br Vic of Ac C Loefeafc sMeetataad
Software tf M1SRA (Mast bdaoy Srfwere Rriiabiliiy AiwriMimH.
17. bap^ArwwaacarcKtaxcira'ieraayscTni/icarrLhon (Fee Secta ll4l
IS. bspcffirwwftoavdJataeccnd-alind^^^erVusaRCardScarityZ (For Seetioo |14|.

Embedded System^ i
S.J«. INSTITUTE «F
technology library
BANGALORE - 5iO *60.
ACCN.
NO.
DATE
Introduction to
£
E
2.
Section 1. 1
Definitions of system and embedded system
Section 1. 2
The processing unit of an embedded system consists of
/. A processor
2. Commonly used microprocessors
3. Application-specific instruction set processors (ASIPs).
microcontrollers, DSPs and others
4. Single purpose processors
Section 1. 3
The hardware unit of an embedded system consists of
I. An embedded system power source with controlled power­
dissipation
/I clock oscillator circuit and clocking unit that lets a processor
execute instructions
Timers and a real time clock (RTC)for various timing needs
of the system
Reset circuit and watchdog timer
System and external memories
System input output (10) ports, serial, parallel and wireless
communication, serial Universal Asynchronous Receiverand
Transmitter (UART) and other port protocols and buses
7. Devices such as Digital to Analog Converter (DAC) using
Pulse Width Modulation (PWM), Analog to Digital Converter
(ADC), Light Emitting Diode (LED) and Liquid Crystal
Display (LCD) units, keypad and keyboard, touch screen,
pulse dialer, modem and transceiver
8. Multiplexers, demultiplexers, decoder for interfacing of the
devices and buses

L
9. Interrupt controller (handler)
E Section 1.4
1. Languages that are used to develop embedded software for a system
J?
2. Program models
J. Multitasking using an operating system (OS), system device drivers, device
management and real time operating system (RTOS)
4. Software tools for system design
K
Section 1.5
Examples of applications of embedded systems
I Section 1.6
Designing an embedded system on a VLSI chip
Q
I. Embedded SoC (System on Chip) and examples of its applications
2. Uses of Application Specific Instruction Set Processor (ASIP) and Intellectual
Property (IP) core
3. Field Programmable Gate Array (FPGA) core with single or multiple processor
units on an ASIC chip
Section 1.7
0
The complex system consists of
1. Embedded microprocessors or GPPs in complex systems
e
2. Embedding ASIPs, microcontrollers. DSPs, media and network processors
3. Embedding application-specific system processors (ASSPs)
7
4. Embedding multiple processors in systems
Section 1.8
E
The design process has
1. Challenges in embedded system design
C
2. Design metrics optimi~ation
3. Co-design of hardware and software components
T
Section 1.9
The system design formalism is defined
I
Section 1.10
The design of embedded hardware and software in an automatic chocolate vending
V
machine, smart card, digital-camera, mobile phone, mobile computer and robot are
given as examples
E
Section 1.11
Classification of embedded systems into three types ' 'ir'
S
Section 1.12
Skills needed to design an embedded system

Introduction to Embedded Systems
I 3 ।
I__)
1.1 EMBEDDED SYSTEMS
1.1.1 System
A system is a way of working, organizing or doing one or many tasks according to a fixed plan, program, or
set of rules. A system is also an arrangement in which all its units assemble and work together according to the
plan or program.
Consider a watch. It is a time-display system. Its parts are its hardware, needles and battery with the
beautiful dial, chassis and strap. These parts organize to show the real time every second and continuously
update the time every second. The system-program updates the display using three needles after each second.
It follows a set of rules. Some of these rules are as follows: (i) All needles move only clockwise, (ii) A thin and
long needle rotates every second such that it returns to same position after a minute, (iii) A long needle rotates
every minute such that it returns to same position after an hour, (iv) A short needle rotates every hour such that
it returns to same position after twelve hours. (v) All three needles return to the same inclination after twelve
hours each day.
Consider a washing machine. It is an automatic clothes-washing system. The important hardware parts
include its status display panel, the switches and dials for user-defined programming, a motor to rotate or
spin, its power supply and control unit, an inner water-level sensor, a solenoid valve for letting water in and
another valve for letting water drain out. These parts organize to wash clothes automatically according to a
program preset by a user. The system-program is activated to wash the dirty clothes placed in a tank, which
rotates or spins in preprogrammed steps and stages. It follows a set of rules. Some of these rules are as
follows: (i) Follow the steps strictly in the following sequence. Step 1: Wash by spinning the motor according
to a programmed period. Step II: Rinse in fresh water after draining out the dirty water, and rinse a second
time if the system is not programmed in water-saving mode. Step III: After draining out the water completely,
spin the motor fast for a programmed period for drying by centrifuging out water from the clothes. Step IV:
Show the wash-over status by a blinking display. Sound the alarm for a minute to signal that the wash cycle is
complete, (ii) At each step, display the process stage of the system, (iii) In case of an interruption, execute
only the remaining part of the program, starting from the position when the process was interrupted. There
can be no repetition from Step 1 unless the user resets the system by inserting another set of clothes and resets
the program.
1.1,2 Embedded System
Definition One of the definitions of embedded system is as follows:
"An embedded system is a system that has embedded software and computer-hardware, which makes it
a system dedicated for an application(s) or specific part of an application or product or a part of a larger
system-.’’
Embedded systems have been defined in books published recently in several ways. Given below is a series
of definitions from others in the field:
Wayne Wolf author of Computers as Components - Principles of Embedded Computing System Design:
“What is an embedded computing system! Loosely defined, it is any device that includes a programmable
computer but is not itself intended to be a general-purpose computer” and “a fax machine or a clock built from
a microprocessor is an embedded computing system”.

S’**"
'>Morton author of Embedded Microcontrollers'. “Embedded Systems are electronic systems that
BBbotairi a microprocessor or microcontroller, but we do not think of them as computers—the computer is
* hidden or embedded in the system.”
David E. Simon author of An Embedded Software Primer: “People use the term embedded system to mean
any computer system hidden in any of these products.”
Tim Wilmshurst author of An Introduction to the Design of Small Scale Embedded Systems with examples
from PfC, 80C51 and 68HC05/08 microcontrollers; (1) “An embedded system is a system whose principal
function is not computational, but which is controlled by a computer embedded within it. The computer is
likely to be a microprocessor or microcontroller. The word embedded implies that it lies inside the overall
system, hidden from view, forming an integral part of [the] greater whole”. (2) “An embedded system is a
microcontroller-based, software-driven, reliable, real time control system, autonomous, or human- or network-
interactive, operating on diverse physical variables and in diverse environments, and sold into a competitive
and cost-conscious market”.
A computer is a system that has the following or more components.
1. A microprocessor
2. A large memory of the following two kinds:
(a) Primary memory (semiconductor memories: Random Access Memory (RAM), Read Only Memory
(ROM) and fast accessible caches)
(b) Secondary memory [(magnetic memory located in hard disks, diskettes and cartridge tapes, optical
memory in CD-ROMs or memory sticks (in mobile computers)] using which different user
programs can be loaded into the primary memory and run
3. I/O units such as touch screen, modem, fax cum modem, etc.
4. Input units such as keyboard, mice, digitizer, scanner, etc.
5. Output units such as an LCD screen, video monitor, printer, etc.
6. Networking units such as an Ethernet card, front-end processor-based server, bus drivers, etc.
7. An operating system (OS) that has general purpose user and application software in the secondary
memory
An embedded system is a system that has three main components embedded into it:
1. It embeds hardware similar to a computer. Figure 1.1 shows the units in the hardware of an embedded
system. As its software usually embeds in the ROM or flash memory, it usually do not need a secondary
hard disk and CD memory as in a computer
2. It embeds main application software. The application software may concurrently perform a series of
tasks or processes or threads
3. It embeds a real-time operating system (RTOS) that supervises the application software running on
hardware and organizes access to a resource according to the priorities of tasks in the system. It
provides a mechanism to let the processor run a process as scheduled and context-switch between the
various processes. (The concept of process, thread and task explained later in Sections 7.1 to 7.3.) It
sets the rules during the execution of the application software. (A small-scale embedded system may
not embed the RTOS.)
Characteristics An embedded system is characterized by the following; (1) Real-time and multirate
operations define the ways in which the system works, reacts to events, interrupts and schedules the system’s
functioning in real time. It does so by following a plan to control latencies and to meet deadlines. (Latency
refers to the waiting period between running the codes of a task or interrupt service routine and the instance
at which the need for the task or interrupt from an event arises). The different operations may take place at

Introduction to Embedded Systems
Input Devices
Interfacing/
Driver Circuits
Program
Memory
and Data
Memory
Serial
Communi­
cation
Ports
Parallel
Ports
Outputs Interfacing/
Driver Circuits
Fig. 1.1 The components of embedded system hardware
distinct rates. For example, audio, video, data, network stream and events have different rates and time
constraints. (2) Complex algorithms. (3) Complex graphic user interfaces (GUIs) and other user interfaces.
(4) Dedicated functions.
Constraints An embedded system is designed keeping in view three constraints: (I) available system­
memory, (2) available processor speed, (3) the need to limit power dissipation when running the system
continuously in cycles of ‘wait for events', ‘run', ‘stop’, ‘wake-up' and ‘sleep’.
The system design or an embedded system has constraints with regard to performance, power, size and
design and manufacturing costs.
1.2 PROCESSOR EMBEDDED INTO A SYSTEM
A processor is an important unit in the embedded system hardware. It is the heart of the embedded system.
Knowledge of basic concept of microprocessors and microcontrollers is must for an embedded system designer.
A reader may refer to a standard text or the texts listed in the ‘References’ at the end of this book for an in-
depth understanding of microprocessors, microcontrollers and DSPs that are incorporated in embedded system
design. Chapter 2 will explain 8051 and a few processors.
1.2.1 Embedded Processors in a System
A processhas two essential units: Program Flow Control Unit (CU) and Execution Unit (EU). The CU
includes a fetch unit for fetching instructions from the memory. The EU has circuits that implement the
instructions pertaining to data transfer operations and data conversion from one form to another. The EU
includes the Arithmetic and Logical Unit (ALU) and also the circuits that execute instructions for a program

0
Embedded Systems
control task, say, halt, interrupt, or jump to another set of instructions. It can also execute instructions for a call
or branch to another program and for a call to a function.
A processor runs the cycles of fetch-and-cxccute. The instructions, defined in the processor instruction
set, are executed in the sequence that they are fetched from the memory. A processor is in the form of an
[C chip; alternatively, it could be in core form in an Application Specific Integrated Circuit (ASIC) or
System on Chip (SoC). Core means a part of the functional circuit on the Very Large Scale Integrated (VLSI)
chip.
An embedded system processor chip or core can be one of the following.
1. General Purpose Processor (GPP): A GPP is a general-purpose processor with instruction set designed
not specific to the applications.
(a) Microprocessor. [Section l.2.2|
(b) Embedded Processor [Section 1.7.7]
2. Application Specific Instruction-Set Processor (ASIP). An ASIP is a processor with an instruction set
designed for specific applications on a VLSI chip.
(a) Microcontroller [Section I.2.3J
(b) Embedded microcontroller [Section 1.7.7]
(c) Digital Signal Processor (DSP) and media processor [Section 1.7.3]
(d) Network processor, IO processor or domain-specific programmable processor
3. Single Purpose Processors as additional processors: Single purpose processor examples are as follows:
(1) Coprocessor (e.g., as used for graphic processing, floating point processing, encrypting, deciphering,
discrete cosine transformation and inverse transformation or TCP/IP protocol stacking and network
connecting functions). (2) Accelerator (e.g., fava codes accelerator). (3) Controllers (e.g., for peripherals,
direct memory accesses and buses). [Section 1.7.7]
4. GPP or ASIP cores integrated into either an ASIC or a VLSI circuit or a Field Programmable Gate Array
(FPGA) core integrated with processor units in a VLSI (ASIC) chip. [Sections 1.6 and 1.7]
5. Application Specific System Processor (ASSP). [Section 1.7.9]
6. Multicore processors or multiprocessor [Section 1.7]
For a system designer, the following are important considerations when selecting a processor:
1. Instruction set
2. Maximum bits in an operand (8 or 16 or 32) in a single arithmetic or logical operation
3. Clock frequency in MHz and processing speed in Million Instructions Per Second (MIPS) or in an
alternate metric Dhrystone for measuring processing performance [Section 2.6]
4. Processor ability to solve complex algorithms while meeting deadlines for their processing
A microprocessor or GPP is used because: (i) processing based on the instructions available in a
predefined general purpose instruction set results in quick system development, (ii) Once the board and I/O
interfaces are designed for a GPP, these can be used for a new system by just changing the embedded software
in the ROM. (iii) Ready availability of a compiler facilitates embedded software development in high-level
languages, (iv) Ready availability of well-tested and debugged processor-specific APIs (Application
Program Interfaces) and codes previously designed for other applications results in new systems developed
quickly.
1.2.2 Microprocessor
The CPU is a unit that centrally fetches and processes a set of general-purpose instructions. The CPU instruction
set includes instructions for data transfer operations, ALU operations, stack operations, IO operations and

Introduction to Embedded Systems 7
program control, sequencing and supervising operations. The general-purpose instruction set is always specific
to a specific CPU. Any CPU must possess the following basic functional units:
I. A control unit that fetches and controls the sequential processing of a given command or instruction
and communicates with the rest of the system.
2. An ALU that undertakes arithmetic and logical operations on bytes or words. It may be capable of
processing 8, 16, 32 or 64-bit words at an instant.
A microprocessor is a single VLSI chip that has a CPU and may also have some other units (e.g., caches,
floating point processing arithmetic unit, pipelining and superscaling units) that are additionally present and
that result in faster processing of instructions.
The earlier generation microprocessor’s fetch-and-execute cycle was guided by a clock frequency of the
order of -4 MHz. Processors now operate at a clock frequency of 4 GHz and even have multiple cores. In
early 2002, it became possible to design Gbps (Giga bit per second) transceiver and encryption engines in a
few highly sophisticated embedded systems using processors that operate on GHz frequencies. A transceiver
is a transmitting cum receiving circuit that has appropriate processing and controls units, for example, for
controlling bus-collisions. An encryption engine is a system that encrypts the data to be transmitted on the
network.
Intel 80x86 (also referred as x86) processors are the 32-bit successors of 8086. [The r here refers to an
8086 extended for 32 bits.] Examples of 32-bit processors in 80x86 series are Intel 80386,80486 and Pentiums'
(a
new generation of 32- and 64-bit microprocessors is the classic Pentium series). IBM PCs use 80x86 series
and the embedded systems incorporated inside the PC for specific tasks (like graphic accelerator, disk
controllers, network interface card) use these microprocessors. High performance processors have pipeline and superscalar architecture, fast ALUs and Floating Point
Processing Units (FLPUs). [A pipeline architecture means that the instructions have between 3 and 9 stages.
Different instructions are at different stages of the pipeline at any given instance. A superscalar architecture
refers to two or more sets of instructions executing in parallel pipelines.]
The important microprocessors used in the embedded systems are ARM, 68HCxxx, 80x86 and SPARC
family of microprocessors.
Section 1.7 will describe the embedding of a microprocessor GPP in complex systems.
A microprocessor is used as general-purpose processor when large embedded software has to be located
in the external memory chips.
1.2.3 Microcontroller
A microcontroller is an integrated chip that has processor, memory and several other hardware units in it;
these form the microcomputer part of the embedded system. Figure 1.2 shows the functional circuits' present
(in solid boundary boxes) in a microcontroller. It also shows the application-specific units (in dashed boundary
boxes) in a specific version of a given microcontroller family.
Just as a microprocessor is the most essential part of a computing system, a microcontroller is the most
essentia) component of a control or communication circuit. A microcontroller is a single-chip VLSI unit (also
called ‘microcomputer^), wb/^h, though having limited computational capabilities, possesses enhanced input­
output capabilities and a number of on-chip functional units. [Refer to Section 1.3 for various functional
hardware units.] Microcontrollers are particularly suited for use in embedded systems for real-time control
applications with on-chip program memory and devices.

Embedded Systems
Functional Circuits in a Chip or Core of Microcontroller (Microcomputer)
Fig-1-2 Various functional circuits (solid boundary boxes) in a microcontroller chip or
core in an embedded system. Also shown are the application-specific units
(dashed boundary boxes) in a specific version of a microcontroller
A few of the latest microcontrollers also have dual core and high computational and superscalar processing
capabilities. Important microcontroller chips for embedded systems are 8051,8051 MX, 68HC1 Ixx, HC12xx,
HCloxx, PIC 16F84 or I6C76, 16F876 and PIC18, microcontroller enhancements of ARM9/ARM7 from
ARM, Intel, Philips, Samsung and ST microelectronics.
Figure 1.3 shows commonly used microcontrollers in small-, medium- and large-scale embedded systems.
Choosing a microcontroller as a processing unit depends upon the application-specific features in it.
A microcontroller is used when a small or part of the embedded software has to be located in the internal
memory and when on-chip functional units such as the interrupt-handler, port, timer, ADC, PWM and
CAN controller are required.
1.2.4 Single Purpose Processors
Single purpose processors used in embedded systems include:
1. Coprocessor (for example, for floating point processing).

Fig. 1.3 Commonly used microcontrollers in small-, medium- and large-scale embedded
systems
2. Graphics processor: An image consists of a number of pixels. For example. Quarter common intermediate
format—Quarter-CIF images have 144 x 176 (horizontal x-axis x vertical y-axis) pixels. Video frames
have 525 x 625 pixels. The video graphic adapter (VGA) format of e-mailing and web pages has
640 x 480 = 307,200 pixels. A separate graphics processor is required for functions such as, for example,
gaming, display from graphics memory buffers and to move (translate on screen) and rotate an image or its
segments.
3. Pixel coprocessor: High-resolution pictures have formats: 2592 x 1944 pixels = 5,038,848 pixels;
2592 x 1728 = 3.2 M; 2048 x 1536 = 3 M and 1280 x 960 = I M. A pixel coprocessor is required in
digital cameras for displaying images directly or after operations such as rotate right, rotate-left, rotate-
up, rotate-down, shift to next, shift to previous.
4. Encryption engine: A suitable algorithm runs in this processor to encrypt data for secure transmission.
5. Decryption engine: A suitable algorithm runs in this processor to decrypt the encrypted data at receiver’s
end.
6. A discrete cosine transformation (DCT) and inverse transformation (DCIT) processor is required in
speech and video processing.
7. Protocol stack processor: A protocol stack, which has a number of header words, is prepared before an
application data is sent to a network. At the receiver’s end, the protocol stack is received and application
data is accepted accordingly. A TCP/IP protocol stack processor processes TCP/IP network data.
8. Network processor: A network processor’s functions are to establish a connection, finish, send and
receive acknowledgements, send and receive retransmission requests and check and correct received
data frame errors. The network processor’s functions include all protocol stack-processing functions.
9. Accelerator (for example, Java codes accelerator). The accelerator is a coprocessor that accelerates
computations by taking advance actions that are just-in-time.comp^ations of the next object in Java
programs.
10. CODEC (Coder and Decoder): A CODEC is a processor circuit that encodes input and decodes the
encoded information or bits or signals into a complete set of bits or original signal. Voice, speech,

^"ioj Embedded Systems
image, video signals and bits are encoded for storing or transmission and decoded from the stored or
received bits or signal for display or playing. The CODEC functions as a compression and
decompression unit for voice, speech, image or video signals.
11. JPEG CODEC: This is a processor for jpg compression and decompression. The Joint Photographic
Experts Group (JPEG) is an International Telecommunication Union for Telecom (ITU-T) and
International Standards Organisation (ISO) committee.
12. MPEG CODEC: The Motion Pictures Experts Group (MPEG) recommends CODEC standards for
video. MPEG3 CODEC is a processor for mp3 compression and decompression. MPEG 2 or 3 or 4
compression of audio/video data streams is done before storing or transmitting, and decompression is
done before retrieving or playing files. For MPEG compression and decompression algorithms, if
GPP-embedded software is run, then separate DSPs are required to achieve real-time processing.
13. Controller (e.g„ for peripheral, direct memory access or bus).
Single purpose processors are used for specific applications or computations or as controllers for peripherals,
direct memory accesses and buses.
" 1.3 EMBEDDED HARDWARE UNITS AND DEVICES IN A SYSTEM
1.3.1 Power Source
Most systems have a power supply of their own. The Network Interface Card (NIC) and Graphic Accelerator are
examples of embedded systems that do not have their own power supply and connect to PC power­
supply lines. The supply has a specific operation range or a range of voltages. Various units in an
embedded system operate in one of the following four power ranges: 5.0 V + 0.25 V, 3.3 V + 0.3 V, 2.0 V + 0.2 V
and 1.5 V + 0.2 V. There is generally an inverse relationship between propagation delay in the gates and operational
voltage. Therefore, the 5 V system processor and units are used in most high performance systems.
Certain systems do not have a power source of their own: they connect to external power supply or are
powered by the use of charge pumps (made up of a circuit of diode and capacitor that accumulate charge from
the bus signals through which they connect or network to the host or from wireless radiation).
Low voltage operations
I. In portable or hand-held devices such as a cellular phone [when compared to 5 V, a CMOS 2 V circuit
power dissipation reduces by one-sixth, - (2 V/5 V)2. This also increases the time intervals needed for
recharging a battery by a factor of six.].
2. In a system with smaller overall geometry, low voltage system processors and IO circuits generate
lesser heat and thus can be packed into a smaller space.
A power supply source or a charge pump is essential in every system.
*1.3.2 Clock Oscillator Circuit and Clocking Units
The clock controls the time for executing an instruction. After the power supply, the clock is the basic unit of
a system. A processor needs a clock oscillator circuit. The clock controls the various clocking requirements of

Introduction to Embedded Systems I 11 j
the CPU, of the system timers and the CPU machine cycles. The machine cycles are for fetching codes and
data from memory and then decoding and executing them at the processor and for transferring the results to
memory.
For processing units, a highly stable oscillator is required and the processor clock-out signal provides the
clock for synchronizing all system units with the processor.
1.3.3 System Timers and Real-time Clocks
A timer circuit is suitably configured as the system-clock, which ticks and generates system interrupts
periodically; for example, 60 times in is. The interrupt service routines then perform the required
operation.
A timer circuit is suitably configured as the real-time clock (RTC) that generates system interrupts periodically
for the schedulers, real-time programs and for periodic saving of time and date in the system.
The RTC or system timer is also used to obtain software-controlled delays and time-outs. An RTC functions
as driver for software timers (SWTs). [Sections 3.6 and 3.8]
Microcontrollers also provide internal timer circuits for counting and timing devices.
To schedule the various tasks and for real-time programming, an RTC or system clock is needed. The
clock also drives the timers for various timing and counting needs in a system,
1.3.4 Reset Circuit, Power-up Reset and Watchdog-Timer Reset
The program counter (PC) holds the address from where the instruction is to be fetched for execution. In
80x86 processors, the instruction pointer (IP) holds that address. A code segment register (CS) holds the base
address of the code memory segment. The CS address equals the code starting address when the IP = 0 at the
start of a code segment. The IP increments when the program executes the codes.
Reset means that the processor begins the processing of instructions from a starting address. That address
is one that is set by default in the processor PC (or IP and CS in x86 processors) on a power-up. From that
address in memory, program-instructions are fetched following the reset of the processor. A program that is
reset and runs on a power-up can be one of the following: (i) A system program that executes from the
beginning, (ii) A system boot-up program, (iii) A system initialization program.
In certain processors, for example, 68HCII and HCI2, there are two start-up addresses. One is based on
the power-up reset vector and the other on the reset vector after the reset instruction or after a time-out (for
example, from a watchdog timer). The processor fetches the bytes for the PC from the first power-up reset
vector on power-up. The processor fetches the bytes for the PC from the second reset vector on the watchdog
timer timing out or on executing the reset instruction.
The reset circuit activates for a fixed period (a few clock cycles) and then deactivates. The processor
circuit keeps the reset pin active and then deactivates to let the program proceed from a default beginning
address. The reset pin or the internal reset signal, if connected to the other units (for example, the IO interface
or the serial interface) in the system, is activated again by the processor; it become,s_an ongoing pin to enforce
a reset state in other sister units of the system. On deactivation of the reset that succeeds the processor activation,
a program executes from a start-up address.
Reset can be activated by an external reset circuit that activates on power-up, on switching-on reset
of the system or on detection of a low voltage (e.g. <4.5 V when what is required is 5 V on the system

12 Embedded Systems
supply rails). This circuit output connects to a pin called the reset pin of the processor. This circuit may be a
simple RC circuit, an external IC circuit or a custom-built IC. Examples of ICs are MAX 6314 and Motorola
MC 34064.
Alternatively, it can also be activated by any one of the following: (i) software instruction; (ii) time-out by
a programmed timer known as a watchdog timer (or on an internal signal called COP in 68HC11 and 68HCI2
families); (iii) a clock monitor detecting a slowdown below certain frequencies.
The watchdog timer is a timing device that resets the system after a predefined timeout. It is activated
within the first few clock cycles after power-up. It has a number of applications. In many embedded systems
reset by a watchdog timer is very essential because it helps in rescuing the system if a fault develops and the
program gets stuck. On restart, the system can function normally. Most microcontrollers have on-chip watchdog
timers. The watchdog timer device is described in detail in Section 3.7.
Consider a system controlling temperature. Assume that when the program starts executing, the sensor
inputs work all right. However, before the desired temperature is achieved, the sensor circuit develops some
fault. The controller will continue delivering the current nonstop if the system is not reset. Consider another
example of a system for controlling a robot. Assume that the interfacing motor control circuit in the robot arm
develops a fault during the run. In such cases, the robot arm may continue to move unless there is a watchdo"
timer control. Otherwise, the robot will break its own arm!
When a program executes the program counter increments or changes. An important circuit that associates
a system is its reset circuit that can change the program counter to a power-up default value A progr im
that is reset and runs on a power-up can be one of the following: (i) A system program that executes from
the beginning, (u) A system boot-up program, (iii) A system initialization program.
The watchdog timer reset is a required feature in control applications.
1.3.5 Memory
In a system, there are various types of memory. Figure 1.4 shows a chart for various forms of memory that are
present in systems. These are as follows:
I. Internal RAM of 256 or 512 bytes in a microcontroller for registers, temporary data and stack.
2. Internal ROM/PROM/E2PROM for about 4 kB to 64 kB of program (in the case of microcontrollers).
3. External RAM for the temporary data and stack (in most systems) or internal caches (in the case of
certain microprocessors).
Various Forms of System Memory
1
Internal
RAM at
Micro­
controller
1
RAM at
System-
on-
Chip
or
External
RAM
1
Internal
Caches
at
Microprocessor
[Hold Copies
of System
Memory- ,th
pages]
1
External
RAM
Chip(s)
1
Flash/
EEPROM
1
ROM/
PROM
Memory
Addresses
at
External
and/or
Internal
the System
Ports
Fig. 1.4 The various forms of memories in the system

r~~t
Introduction to Embedded Systems 13 j
4. Internal Hash (in many systems the results of processing can be saved in nonvolatile memory: lor example,
system status periodically and images, songs, or speeches alter suitable formal compression).
5. Memory stick (or card): video, images, songs, or speeches and large storage in digital camera and
mobile systems. Sony memory stick Micro (M2) is of size 15x12.5x1.2 mm and has a flash memory
of 2 GB. Il has a data transfer rale of 160 Mbps (mega bit per second) and PRO-HG 4X0 Mbps and
120 Mbps write | since Dec. 2006. |
6. External ROM or PROM for embedding software (in almost all systems other than microcontroller-
based systems).
7. RAM memory buffers al ports.
8. Caches (in pipelined and superscalar microprocessors).
Table 1.1 details the functions assigned in embedded systems to the memories. ROM or PROM or EPROM
embeds the software specific to the system.
Table 1.1 Functions assigned to the memories in a system
Memory Needed Functions
ROM or EPROM
or flash
Storing application programs from where the processor fetches the instruction codes.
Storing codes for system booting, initializing, initial input data and strings. Codes for
RTOS. Pointers (addresses) of various interrupt service routines (ISRs).
RAM (internal and external)
and RAM for buffer
Storing the variables during program run and storing the stack. Storing input or output
buffers, for example, for speech or image.
Memory slick A
flash memory stick is inserted in mobile computing system or digital-camera. It
stores high definition video, images, songs, or speeches after a suitable formal
compression and stores large persistent data.
EEPROM or Flash Storing nonvolatile results of processing.
Cache Storing copies of instructions and data in advance from external primary memory and
storing the results temporarily during processing.
A system embeds (locates) the following either in the internal flash or ROM, PROM or in an external flash
or ROM or PROM of the microcontroller: boot-up program, initialization data, strings or pictogram for
screen-display or initial state of the system, programs for various tasks, ISRs and operating system kernel.
The system has RAMs for saving temporary data, stack and buffers that are needed during a program run.
The system uses flash for storing nonvolatile results.
1.3.6 Input, Output and IO Ports, IO Buses and IO Interfaces
The system gets inputs from physical devices through the input ports. Examples arc as follows:
I. A system gets inputs from the touch screen, keys in a keypad or keyboard, sensors and transducer
circuits.
2. A controller circuit in a system gets inputs from the sensor and transducer circuits.
3. A receiver of signals or a network card gets the input from a communication system. | A communicalion
system could be a fax or modem, or a broadcasting serviced
4. Ports receives inputs from a network or peripheral.

0
Embedded Systems
Consider the system in an Automatic Chocolate Vending Machine. It gets inputs from a port that collects
the coins that a child inserts.
Consider the system in a mobile phone. A user inputs the mobile number through the buttons, directly or
indirectly (through recall of the number from its memory). Keypad keys connect to the system through an
input port.
A processor identifies each input port by its memory buffer addresses, called port addresses. Just as a
memory location holding a byte or word is identified by an address, each input port is also identified by the
address. The system gets the inputs by the read operations at the port addresses.
The system has output ports through which it sends output bytes to the real world. Examples are as follows:
1. Output may be sent to an light emitting diode (LED), liquid crystal display (LCD) or touch screen
display panel. For example, a calculator or mobile phone system sends the output-numbers or an SMS
message to the LCD display.
2. A system may send the output to a printer.
3. Output may be sent to a communication system or network.
4. A control system sends the outputs to alarms, actuators, furnaces or boilers.
5. A robot is sent output for its various motors.
Each output port is identified by its memory-buffer addresses (called port addresses). The system sends the
output by a write operation to the port address.
There are also general-purpose ports for both the input and output (10) operations. For example, a mobile
phone system sends output as well as gets input through a wireless communication channel. A mobile computing
system touch screen system sends output as well as gets input when a user touches the menu displayed or key
on the screen.
Each 10 port is also identified by an address to which the read and write operations both take place.
Ports can have serial or parallel communication with the system address and data buses. In serial communication
a one-bit data line is used and bits are sent serially in successive time slots. Universal Asynchronous Receiver
and Transmitter (UART) is a popular communication protocol for serial communication. In parallel
communication, several data lines are used and bits are sent in parallel.
A system port may have to send output to multiple channels. A demultiplexer or multiplexer circuit is then
used.
A demultiplexer is a digital circuit that sends digital outputs at any instance to one of the provided channels.
The channel to which the output is sent is the one that is addressed by the channel address bits at the
demultiplexer input. A demultiplexer takes the input and transfers it to a select channel output among the
multiple output channels.
A multiplexer is a digital circuit that receives digital inputs at any instance from multiple channels, and
sends data output only from a specific channel at an instance. The channel address bits are at multiplexer
input. A multiplexer takes the input from one among the multiple input channels and transfers a selected
channel input to the output.
A system unit (for example, memory unit or 10 port or device) may have to be selected from among the
multiple units in the system and activated. A decoder circuit when used as an address decoder decodes the input
addresses and activates the selected output channel from among the many outputs. For example, there are 8 units
of which one has to be selected. An address-select input of 3 bits is input to the decoder. Based on the input
address, the output select line among the 8 activates. If the input address bit is 000, then the 0lh output is active
and the 0lh unit activates. If the input address bit is I l-i'f the.'J*ihe 7th output is active and the 7lh unit activates.
Bus A system might have to be connected to a number of other devices and systems. A bus consists of a
common set of lines to connect multiple devices, hardware units and systems for communication between any

Introduction to Embedded Systems 15
____
>
two of these at any given instance. A bus communication protocol specifies how signals communicate on the
bus.
A bus may be a serial or parallel bus that transfers one or multiple data bits at an instance, respectively.
The protocol also specifies the following: (i) ways of arbitration when several devices need to communicate
through the bus; (ii) ways of polling bus requirement from each device at an instance; (iii) ways of daisy
chaining the devices so that bus is granted to a device according to the device-priority in the chain. For networking the distributed units or systems, there are different types of serial and parallel bus protocols:
PC. CAN, USB, (SA, EISA and PCI. For wireless networking of systems there are 802.11, IrDA, Bluetooth
and ZigBee protocols.
Chapter 3 will describe the ports, devices, buses and protocols in detail.
A system connects to external physical devices and systems through parallel or serial I/O ports.
Demultiplexers and multiplexers facilitate communication of signals from multiple channels through a
common path. A system often networks to the other devices and systems through an I/O bus: for example,
PC, CAN. USB, ISA, EISA and PCI bus.
1.3.7 DAC Using a PWM and an ADC
DAC is a circuit that converts digital 8 or 10 or 12 bits to the analog output. The analog output is with respect
to the reference voltage. When all input bits are equal to I. then the analog output is the difference between
the positive and negative reference pin voltages; when all input bits equal 0, then the analog output equals
-ve reference pin voltage (usually 0 V).
Suppose a system needs to give the analog output of a control circuit for automation. The analog output
may be to a power system for d.c. motor or furnace.
A pulse width modulator (PWM) with an integrator circuit is used for the DAC. A PWM unit in the
microcontroller operates as follows: Pulse width is made proportional to the analog-output needed. PWM
inputs are from 00000000 to 11111111 for an 8-bit DAC operation. The PWM unit outputs to an external
integrator, which provides the desired analog output. From this information, the formula to obtain the analog
output from the bits in a given PWM register with bits ranging from 00000000 to 11111111 is as follows:
Analog output V = K-pw. where K is constant and pw is the pulse width.
Suppose a circuit (external to the microcontroller) gives an output of 1.024 V when the pulse width is 50%
of the total pulse time period, and 2.047 V when the width is 100%. When the width is made 25%. by
reducing by half the value in the PWM output control-register, the integrator output will become 0.512 V. The
constant K depends on integrator amplifier gain.
Assume that the integrator operates with a dual (plus-minus) supply. The PWM unit in the microcontroller
operates by another method, which is as follows. Assume that when an integrator circuit gives an output of
1.023 V. the pulse width is 100% of the total pulse time period and of-1.024 V when the width is 0%. When
the width is made 25% by reducing by half the value in an output control register, the integrator output will be
0.512 V; at 50% the output will be 0.0 V. From this information, the formula to obtain the analog output from
the bits in a given PWM register ranging from 00000000 to 11111111 in both situations is as follows: Analog ;
output V = 0.01. K'. (pw - 50), where K' is constant and pw is pulse width time in percentage with respect to
pulse time period. K' depends on integrator amplifier gain. r
Analog to Digital Converter ADC is a circuit that converts the analog input to digital 4, 8, 10 or 12
bits. The analog input is applied between the positive and negative pins and is converted with respect to the 1
reference voltage. When input is equal to difference of reference positive and negative voltages, then all i!
output bits equal 1; when equals negative reference voltage (usually 0 V), then all output bits equal 0.

16 j Embedded Systems
The ADC in the system microcontroller can be used in many applications such as data acquisition systems
(DAS), digital cameras, analog control systems and voice digitizing systems. Suppose a system gels the
analog inputs from sensors of temperature, pressure, heart-beats and other sources in a DAS. Suppose a
system gels the analog inputs from a digital camera. It has CCD (Charge Couple Device) which has tiny pixels
that charge up on exposure to light. The charging of each pixel depends upon the light intensity at that point
in the image. The analog inputs to lhe system generate from each pixel. Each pixel's analog input has to be
converted into bits to enable processing in the next stage.
Suppose a system needs to read an analog input from a sensor or transducer circuit. If converted to bits by
lhe
ADC unit in the system, then these bits, after processing, can also give an output. This provides a control
for automation by a combined use of ADC and DAC features. The convened bits can be given to the port meant for digital display. The bits may be transferred to a
memory address, a serial port or a parallel port.
A processor may process the converted bits and generate a Pulse Code Modulated (PCM) output. PCM
signals are used to digitize voice into a digital format.
Important points about the ADC are as follows.
I. Either a single or dual analog reference voltage-source is required in the ADC. It sets either the analog
input’s upper limit or the lower and upper limits both. For a single reference source, the lower limit is
set to 0 V (ground potential). When the analog input equals the lower limit, the ADC generates all bits
as Os. and when it equals the upper limit it generates all bits as Is. | As an example, suppose in an ADC
the upper limit or reference voltage is set to 2.255 V. Let the lower limit reference voltage be 0.255 V.
The difference in the limits is 2 V. Therefore, the resolution will be 2/256 V. If the 8-bit ADC analog­
input is 0.255 V, the converted 8 bits will be 00000000. When the input is 0.255 V + 1.000 V = 1.255 V,
the bits will be 10000000. When the analog input is 0.255 V + 0.50 V, the converted bits will be
01000000. [From this information, finding a formula io obtain converted bits for a given analog
input = v volt is as follows: Binary number n bits after conversion in an n-bit ADC corresponds to
decimal number N. Then N = v. (V|C|+ - V rcr_)/2". Here. Vld+ is the reference voltage that gives ail the
bits that are equal to I and Vrc|- is the reference voltage that gives all lhe bits that are equal Io 0. [
2. An ADC may be of 8. 10, 12, or 16 bits depending upon the resolution needed for conversion.
3. The start of the conversion (STC) signal or input initiates the conversion to 8 bits. In a system, an
instruction or a timer signals the STC.
4. There is an end of conversion (EOC) signal. A flag in a register is set to indicate the end of conversion
and the ADC generates an interrupt: the ISR reads the ADC bits and saves them in the memory buffer.
5. There is a conversion time limit in which the conversion is definite.
6. A Sample and Hold (S/H) unit is used to sample the input for a fixed time and hold till conversion is
over.
An ADC unit can be repeatedly used after the intervals equal to the conversion time. Therefore, one can
digitizes the DAS sensor signals, CCD signals, voice, music or video signals, or heart beat sensor signals in
different systems. An ADC unit in an embedded system microcontroller may have multichannels. It can then
take the inputs in succession from the various pins interconnected to different analog sources.
For automatic control and signal processing applications, a system provides necessary interfacing circuit
and software for the Digital to Analog Conversion (DAC) unit and Analog to Digital Conversion (ADC)
unit. A DAC operation is done with the help of a combination of a PWM unit in the microcontrollet'and ah
external integrator chip. ADC operations are required for data acquisition, image processing, voice
processing, video processing, instrumentation and automatic control systems.

Introduction to Embedded Systems 17
L_J
1.3.8 LCD, LED and Touchscreen Displays
A
system requires an interfacing circuit and software to display the status or message for a line, for multiline
displays, or for flashing displays. An LCD screen may show up a multiline display of characters or also show
a small graph or icon (called a pictogram). A recent innovation in the mobile phone system turns the screen
blue to indicate an incoming call. Third generation system phones have both image and graphic displays. An
LCD needs little power. A supply or battery (a solar panel in the calculator) powers it. The LCD is a diode that
absorbs or emits light and 3 to 4 V and 50 or 60 Hz voltage-pulses with currents less than -50 pA are required.
The pulses are applied with the same polarity on the crystal front and back plane for no light, and with
opposite polarity for light. Here, polarity means logic ‘ I' or ‘O'. A display-controller is often used in case of
matrix displays.
To indicate the ON status of the system, there may be an LED that glows. A flashing LED may indicate that
a specific task is under completion or is running or in wait status. The LED is a diode that emits yellow, green,
red or infrared light in a remote controller on application of a forward voltage of between 1.6-2 V. It needs
cunent up to 12 mA above 5 mA (less in flashing display mode). It is much brighter than the LCD, making it
suitable for flashing displays and for displays limited to a few digits.
A touchscreen is an input as well as an output device, which can be used to enter a command, a chosen menu
or to give a reply. The infomiation is input by physically touching at a screen position using a finger or a stylus.
A stylus is thin pencil-shaped object. It is held between the fingers and used just as a pen. The screen displays the
choices or commands, menus, dialog boxes and icons. The display-screen display is similar to a computer video
display unit screen. Newer touch screen senses the fingers even from proximity, for example, in Apple iPhone.
Sections 3.3.4 and 3.3.5 describe the LCD and touchscreen devices and their connections to the system.
The system may need the necessary interfacing circuit and software for the output to the LCD display
controller and the LED interfacing ports or for the I/Os with the touchscreen.
1.3.9 Keypad/Keyboard
The keypad or keyhoard is an important device for gelling user inputs. The system provides the necessary
interfacing and key-debouncing circuit as well as the software for the system to receive input from a set of
keys, from a keyboard, keypad or virtual keypad. A touchscreen provides for a virtual keypad in a mobile
computing system. A virtual keypad is a keypad displayed on the touch screen where the user can enter the
keys using a stylus or finger.
A keypad has upto a maximum of 32 keys. A keyboard may have 104 keys or more. The keypad or
keyboard may interface serially or parallelly to the processor directly through ports or through a controller.
Mobile phones may have a T9 keypad. A T9 keypad has 16 keys and four up-down right-left menu keys.
Using 0 to 9 keys text messages, such as SMS messages, are generated.
For inputs, a keypad or board may interface to a system. The system provides necessary interfacing circuit
and software to receive inputs directly from the keys or through a controller.
1.3.10 Pulse Dialer, Modem and Transceiver
For user connectivity through the telephone line, wireless or a network, a system provides the necessary
interfacing and circuits. It also provides the software for pulse dialing through the telephone line, for modem

I 18 Embedded Systems
interconnection for fax. for Internet packets routing and for transmitting and connecting to a wireless cellular
system or personal area wireless network. A transceiver is a circuit that can transmit as veil as receive
byte streams.
In
communication system, a pulse dialer, modem or transceiver is used. A system provides the necessary
interfacing circuit and software for dialing and for the modem and transceiver, directly or through a
controller.
1.3.11 Interrupt Handler
A timing device sends a time-out interrupt when a preset time elapses or sends a compare interrupt when the
present-time equals the preset time. Assume that data have to be transferred from a keyboard to a printer. A
port peripheral generates an interrupt on receiving the input data or when the transmitting buffer becomes
empty. Each action generates an interrupt. A system may possess a number of devices and the system processor
has to control and handle the requirements of each device by running an appropriate 1SR (interrupt service
routine) for each. An interrupts-handling mechanism must exist in each system to handle interrupts from
various processes and for handling multiple interrupts simultaneously pending for service. Chapter 4 describes
in detail the interrupts, ISRs, and their handling mechanisms in a system. Important points regarding the
interrupts and their handling by the program are as follows.
1. There can be a number of interrupt sources and groups of interrupt sources in a processor.
[Section 4.31 An interrupt may be a hardware signal that indicates the occurrence of an event.
[For example, a real-time clock continuously updates a value at a specified memory address; the
transition of that value is an event that causes an interrupt.) An interrupt may also occur
through timers, through an interrupting instruction of the processor program or through an error
during processing. The error may arise due to an illegal op-code fetch, a division by zero result or an
overtlow or underflow during an ALU operation. An interrupt can also arise through a software tinier.
A software interrupt may arise in an exceptional condition that may have developed while running a
program.
2. The system may prioritize sources and service them accordingly. [Section 4.5.|
3. Certain sources are not maskable and cannot be disabled. Some are assigned the highest priority
during processing.
4. The processor's current program has to divert to a service routine to complete that task on the occurrence
of the interrupt. For example, if a key is pressed, then an ISR reads the key and stores the key value in
the processor memory address. If a sequence of keys is pressed, for instance in a mobile phone, then
an ISR reads the keys and also calls a task to dial the mobile number.
5..There is a programmable unit on-chip for the interrupt handling mechanism in a microcontroller.
6. The operating system is expected to control the handling of interrupts and running of routines for the
interrupts in a particular application. The system always gives priority to the ISRs over the tasks of an
application.
A system provides an interrupt handling mechanism for executing the ISRs in case of the interrupts from
physical devices, systems, software instructions and software exceptions.

Introduction to Embedded Systems
19;
1.4 EMBEDDED SOFTWARE IN A SYSTEM
The software is like the brain of the embedded system.
1.4.1 Final Machine Implementable Software for a System
An embedded system processor executes software that is specific io a given application of that system. The
instruction codes rind data in the final phase are placed in the ROM or flash memory for all the tasks that are
executed when the system runs. The software is also called ROM image. Why? Just as an image is a unique
sequence and arrangement of pixels, embedded software is also a unique placement and arrangement of bytes
for instructions and data.
Each code or datum is available only in the bits and bytes’ format. The system requires bytes at each
ROM address, according to the tasks being executed. A machine implementable software file is therefore
like a table having in each rows the address and bytes. The bytes are saved at each address of the system
memory. The table has to be readied as a ROM image for the targeted hardware. Figure 1.5 shows the ROM
image in a system memory: The image consists of the boot up program, stacks address pointers, program
counter address pointers, application programs. ISRs, RTOS, input data and vector addresses.
Interrupt Service I
Routine Vector .
Addresses of
2 Bytes each I
Bootup ;
Program j-
Codes i
Machine Codes;
for Real Time i
Operating f
System (RTOS)j
2 Bytes for j
Address of I
Stack J"
on i
Reset '
System ROM
Memory
1 2 Bytes for
■ Address from
I Where System
I Starts
Execution on
Power Up
' (Not Needed in
i 80x86,8051,80196,
..
)
Bytes
for
- . i Data as
Inputs for each
Interrupt
< Service Routine
r Machine Specific
I Codes for
•. each
! Program, ISR -
L and Task
Fig. 1.5 System ROM memory embedding the software, RTOS, data and vector addresses

0
Embedded Systems
Final stage software is also called the ROM image. The final machine implementable software for a
product embeds in the once programmable Hash or ROM (or PROM) as an image in a frame. Bytes at each
address must be defined io create the ROM image. By changing this image, the same hardware platform
will work differently and can be used for entirely different applications or for new upgrades of the same
system.
1.4.2 Coding of Software in Machine Codes
During coding in this format, the programmer defines the addresses and the corresponding bytes or bits at
each address. In configuring some specific physical device or subsystem, machine code-based coding is used.
For example, in a transceiver, placing certain machine code and bits can configure it to transmit at specific
megabytes per second or gigabytes per second, using specific bus and networking protocols. Another example
is using certain codes for configuring a control register with the processor. During a specific code-section
processing, the register can be configured to enable or disable use of its internal cache. However, coding in
machine implementable codes is done only in specific situations because it is time consuming and the
programmer must first have to understand the processor instructions set and then memorize the instructions
and their machine codes.
1.4.3 Software in Processor Specific Assembly Language
A program or a small specific part can be coded in assemblv /mtguoge using an assembler after understanding
the processor and its instruction set. Assembler is software used for developing codes in assembly.
Assembly language coding is extremely useful for configuring physical devices like ports, a line-display
interface. ADC and DAC and reading into or transmitting from a buffer. These codes are also called low-level
codes for the device driver functions. (Sections 1.4.7 and 4.2.4.] They are useful to run the processor or
device-specific features and provide an optimal coding solution.
Lack of knowledge of writing device driver codes or codes that utilize the processor-specific features-
invoking codes in an embedded system design team can cost a lot. A vendor may charge for the APIs and also
charge intellectual property fees for each system shipped out of the company.
To make all the codes in assembly language may. however, be very time consuming. Full coding in assembly
may be done only for a few simple, small-scale systems, such as toys, automatic chocolate vending machines,
robots or data acquisition systems.
Figure 1.6 shows the process of converting an assembly language program into machine implementable
software file and then finally obtaining a ROM image file.
1. An assembler translates the assembly software into the machine codes using a step called assembling.
2. In the next step, called linking, a tinker links these codes with the other codes required. Linking is
necessary because of the number of codes to be linked for the final binary file. For example, there are
the standard codes to program a delay task for which there is a reference in the assembly language
program. The codes for the delay must link with the assembled codes. The delay code is sequential
from a certain beginning address. The assembly software code is also sequential from a certain beginning
address. Both the codes have to be linked at the distinct addresses as well as at the available addresses
in
the system. The linked file in binary for run on a computer is commonly known as an executable file
or simply an ‘.exe’ file. After linking, there has to be reallocation of the sequences of placing the codes
before actually placing the codes in memory.

Introduction to Embedded Systems
! 21
I
Fig. 1.6 The process of converting an assembly language program into the machine codes
and finally obtaining the ROM image
3. In the next step, the loader program performs the task of reallocating the codes after finding the
physical memory addresses available at a given instant. The loader is a part of the operating system
and places codes into the memory after reading the '.exe' file. This step is necessary because the
available memory addresses may not start from 0x0000. and binary codes have to be loaded al different
addresses during the run. The loader finds the appropriate start address. In a computer, after the loader
loads into a section of RAM. the program is ready to run.
4. The final step of the system design process is locaiing these codes as a ROM image. The codes are
permanently placed at the addresses actually available in the ROM. In embedded systems, there is no
separate program to keep track oflhe available addresses at different times during the run. as in a computer.
In embedded systems, therefore, the next step instead of loader after linking is the use of a locaior.
which locates the IO tasks and hardware device driver codes al fixed addresses. Port and device addresses
are llxed for a given system as per the interfacing circuit between the system buses and ports or devices.
The locator program reallocates the linked file and creates a file fora permanent location of the codes in
a standard format. The file formal may be in the Intel Hex file format or Motorola S-record format. The
designer has to define the available addresses to locale and create files to permanently locate the codes.
5. Lastly, either (i) a laboratory system, called device programmer, takes as input the ROM image file
and finally burns the image into the PROM or flash or (ii) at a foundry, a mask is created for the ROM
of the embedded system from the ROM image file. |The process of placing the codes in PROM or
flash is also called burning. | The mask created from the image gives the ROM in 1C chip form.
To configure some specific physical device or subsystem such as the transceiver, machine codes can be
used straightaway. For physical device driver codes or codes that utilize processor-specific features-invoking
codes, ‘processor-specific’ assembly tahgua^b is used. A file is then created in three steps using an Assembler,
Linker and Locator. The file has the ROM image in a standard format. A device programmer finally bums
the image in the PROM or EPROM. A mask created from the image gives the ROM in IC chip form.

Embedded Systems
1.4.4 Software in High Level Language
Since the coding in assembly language is very lime consuming in most cases, software is developed in a high-
level language, ‘C’ or ‘C++’ or visual C++ or Java' in most cases. ‘C’ is usually the preferred language. The
programmer needs to understand only the hardware organization when coding in high level language. As an
example, consider the following problem.
Example 1.1
Add 127, 29 and 40 and print the square root.
An exemplary C language program for all the processors is as follows, (i) # include <stdio.h>
(ii) # include <math.h> (iii) void main (void) { (iv) int i 1. i2, i3. a; float result', (v) il = 127;
i2 - 29; i3 = 40; a = il + i2 + i3; result = sqrt (a): (vi) printf (result);)
The coding for square root will need many lines of | ........ —~
code and can be done only by an expert assembly Preprocessor Commands
language programmer. To write the program in a high .. . ~ ~
level language is very simple compared to writing it in ---------------------- i--------------------
assembly language. ‘C‘ programs have a feature that Interrupt Service Routines
adds the assembly instructions when using certain Tasks 1 N
processor-specific features and coding for a specific ------------------------------------------
section, for example, a port device driver. Figure 1.7 Kernel and Scheduler
shows the different programming layers in a typical Standard Library
embedded ‘C’ software. These layers are as follows. Functions Including
(i) Processor Commands, (u) Main Function. Functions for j
(iii) Interrupt Service Routine, (iv) Multiple tasks, say. Sending Stack and I
1 to N. (v) Kernel and Scheduler, (vi) Standard library Receiving Stack _____i j
functions, protocol handling and stack functions. - ----------------------------------------------:
Figure 1.8 shows the process of converting a Fig 17 The different program |ayers in the
C program into the ROM image file. A compiler embedded software in C
generates the object codes. It assembles the codes
according to the processor instruction set and other specifications. The C compiler for embedded
systems must, as a final step of compilation, use a code-optimizer that optimizes the codes before
linking. After compilation, the linker links the object codes with other needed codes. For example, the
linker includes the codes for the functions printf and sep t codes. Codes for device and driver (device
control codes) management also link at this stage: for example, printer device management and driver
codes. After linking, the other steps for creating a file for ROM image are the same as shown earlier in
Figure 1.6.
Preprocessor Commands
Main Function
Interrupt Service Routines
Kernel and Scheduler
Standard Library
Functions Including
Network Protocol
Functions for
Sending Stack and
Receiving Stack
Tasks 1....N
C, C++, Java, Visual C++ are the languages used for software development. A C program has various
layers: processor commands, main function, task and library functions, interrupt service routines and kernel
(scheduler). The compiler generates an object file. Using a linker and locator, the file for the ROM image
is created for the targeted hardware.

Introduction to Embedded Systems
Fig. 1.8 The process of converting a C program into the file for ROM image
1,4.5
Program Models for Software Designing
The program design task is simplified if a program is modeled.
The different models that are employed during the design processes of the embedded software are as follows:
I. Sequential Program Model
2. Object Oriented Program Model
3. Control and Data flow graph or Synchronous Data Flow (SDF) Graph or Multi Thread Graph (MTG) Model
4. Finite State Machine for data path
5. Multithreaded Model for concurrent processing of processes or threads or tasks
UML (Universal Modeling language) is a modeling language for object oriented programming.
These models are explained Chapter 6.
1.4 fi Software for Concurrent Processing and Scheduling of Multiple
Tasks and ISRs Using an RTOS
An embedded system program is most often designed using multiple processes or multitasks or a
multithreads. | Refer to Sections 7.1 to 7.3 for definitions and understanding of the processes, threads and tasks. |
The multiple tasks are processed most often by the OS not sequentially but concurrently. Concurrent processing
tasks can be interrupted for running the ISRs, and a higher priority task preempts the running of lower priority
tasks.
An OS provides for process, memory, devices, 10s and file system management. A file system specifies
the ways in which a file is created, called, named, used, copied, saved or deleted, opened and closed. File
system is the software for using the files on a disk, flash memory, memory card or memory stick.
OS software have scheduling functions for all the processes (tasks, ISRs and device drivers) in the
system. Since the running of the tasks and ISRs may have real time constraints and deadlines for finishing the
tasks, an RTOS is required in an embedded system. The RTOS provides the OS functions for coding the
system, provides interprocess communication functicjis an,'/hcontrols the passing of messages and signals to
a task.
RTOS functions are highly complex. There are a number of popular and readily available RTOSs.
Chapters 8 to 12 describes the RTOS functions and examples of applications in the embedded systems.

24 Embedded Systems
RTOS is used in most embedded systems and the system does concurrent processing of multiple tasks
when the tasks have real time constraints and deadlines,.
1.4.7 Software for Device Drivers and Device Management in an
Operating System
An embedded system is designed to perform multipie functions and has to control multiple physical and
virtual devices. In an embedded system, there may be number of physical devices. Exemplary physical devices
arc timers, keyboards, display, flash memory, parallel ports and network cards.
A program is also be developed using the concept of virtual devices. Examples of virtual devices are as
follows.
I. A file (of records opened, read, written and closed, and saved as a stream of bytes or words)
2. A pipe (for sending and receiving a stream of bytes from a source to destination)
3. A socket (for sending and receiving a stream of bytes between the client and server software and
between source and destination computing systems)
4. A RAM disk (for using the RAM in a way similar to files on (he disk)
A file is a data structure (or virtual device) which sends the records (characters or words) to a data sink (for
example, a program function) and which stores the data from the data source (for example, a program function).
A tile in a computer may also be stored in the hard disk and in Hash memory in embedded system.
The term virtual device follows from the analogy that just as a keyboard gives an input to the processor for
a read, a tile also gives an input to the processor. The processor gives an output to a printer for a write.
Similarly, the processor writes an output to the file.
A device for the purpose of control, handling, reading and writing actions can be taken as consisting of
three components, (i) A control register or word that stores the bits that, on setting or resetting by a device
driver, control device actions, (ii) A status register or word that provides the flags (bits) to show the device
status to the device driver, (iii) A device mechanism that controls the device actions. There may be input and
output data buffers in a device, which may be written or read by a'device driver. Device driver actions are to
gel
input into or send output from the control registers, input data buffers, output data buffers and status
registers of the device. A device driver is software for opening, connecting or binding, reading, writing and closing or controlling
actions of the device. It is software written in a high level language. Il controls functions for device open
(configure), connect, bind, listen, read or write or close. The device driver executes after lhe programming of
the control register (or word) of a peripheral or virtual device. The programming is called device initialisation
or registration or attachment. The driver reads the status register, gets the inputs and writes the outputs. It
executes on an interrupt to or from the device.
A driver controls three functions, (i) Initializing, which is activated by placing appropriate bits at the
control register or word, (ii) Calling an ISR on interrupt or on setting a status flag in the status register and
running (driving) the ISR (Interrupt Handler Routine), (iii) Resetting the status fiag after an interrupt service.
A driver may be designed for asynchronous operations (multi pie use by tasks one after another) or synchronous
operations (concurrent use by the tasks).
Using the tuuctions of the OS, a device driver coding can be made such that the underlying hardware is
hidden as much as possible. An API then defines the hardware separately. This makes the driver usable when
the device hardware changes in a system.

. introduction to Embedded Systems
A device driver accesses a parallel or serial port, keyboard, mice, disk, network, display, file, pipe and
socket at specific addresses. An OS also provides device driver, codes lor system-port addresses and for
hardware access mechanisms.
A device manager software provide codes for detecting the presence of devices, for initializing these and
for testing the devices that are present. The manager includes software for allocating and registering port (in
fact, it may be a register or memory) addresses for the various devices al distinctly different addresses, including
codes for detecting any collision between these, if any. It ensures that any device accesses to one task only at
any given instant. It takes into account that virtual devices may also have addresses that archil located by lhe
manager.
An OS also provides and executes modules for managing devices that associate with an embedded system.
The underlying principle is that at an instant, only one physical or virtual device should gel access to or from
one task only.
Sections 4.2.4 and 8.6.1 will describe device drivers and device management in detail. The OS also
provides and manages virtual devices such as pipes and sockets. Sections 7.14 and 7.15 describe these in
detail.
For designing embedded-software, two types of devices are considered: physical and virtual. Physical
devices include keypad, printer or display unit. A virtual device could be a file or pipe or socket or RAM
disk. Device drivers and device manager software are needed in the system. The RTOS includes device­
drivers and a device manager to control and facilitates the use of the number of physical and virtual
devices in the system.
1.4.8 Software Tools for Designing an Embedded System
Table 1.2 lists the applications of software tools for assembly language programming, high level language
programming. RTOS. debugging and system integration.
Tao’? 1.2 Software modules and tools for designing of an embedded system
j Sojimire Tools Application
Editor For writing C codes or assembly mnemonics using the keyboard of the PC for entering the
program. Allows the entry, addition, deletion, insert, appending previously written lines or
files, merging record and Illes at the specific positions. Creates a source file that stores lhe
edited file. It also has an appropriate name [provided by the programmer].
Interpreter For expression-by-expression (line-by-line) translation to machine-executable codes.
Compiler Uses the complete set of codes. It may also include codes, functions and expressions from
lhe library routines. It creates a file called object file.
Assembler For translating assembly mnemonics into binary opcodes (instructions), that is, into
an executable file, called binary file and for making a list file that can be printed. The list
file has address, source code (assembly language mnemonics) and hexadecimal object^
codes. The file has addresses that reallocate during the actual run of the assembly
language program.
(Contd)

I 26 Embedded Systems
Integrated development This is a development software and hardware environment that consists of simulators with
Software Tools
Cross assembler
Application
For converting object codes or executable codes for a processor to other codes for another
processor and vice versa. The cross-assembler assembles the assembly codes of the target
processor as the assembly codes of the processor of the PC used in system development.
Later, it provides the object codes for the target processor. These codes will be the ones
actually needed in the final developed system.
Simulator To simulate all functions of an embedded system circuit including that or additional memory
and peripherals. It is independent of a particular target system. It also simulates the processes
that will execute when the codes of a particular processor execute.
Source-code
engineering software
For source code comprehension, navigation and browsing, editing, debugging, configuring
(disabling and enabling the C++ features) and compiling.
RTOS Refer Chapters 8 to 10.
Stethoscope For dynamically tracking the changes in any program variable or parameter. It demonstrates
the sequence of multiple processes (tasks, threads, service routines) that execute and also
records the entire time history.
Trace scope To help in tracing the changes in modules and tasks with time on the X-axis. A list of
actions also produces the desired time scales and the time expected to be taken for different
tasks.
' The locator program output is in the Intel hex Hie or Motorola S-record format.
environment editors, compilers, assemblers, RTOS, debuggers, stethoscope, tracer, emulators, logic
analyzers, and application code burners in PROM or Hash.
Prototyper This simulates and does source code engineering including compiling, debugging and,
browsing and summarizing the complete status of the final target system during the
development phase.
Locator* This uses a cross-assembler output and a memory allocation map and provides the locator
program output as a hex-file. It is the final step of the software design process or an
embedded system. i
Software tools are used to develop software for designing an embedded system. Debugging tools, such as a
stethoscope, trace scope, and sophisticated tools such as an integrated development environment
and prototype development tools, are needed for the integrated development of system software and hardware.
1.4.9 Software Tools Required in Exemplary Cases
Table 1.3 gives the various tools needed to design exemplary systems.
RTOS is essential in
y-
Jis
most embedded systems to process multiple tasks and ISRs. Embedded systems for
medium scale and sophisticated applications need a number of sophisticated software and debugging tools.

Introduction to Embedded Systems
Table 1.3 Software tools required in exemplary systems
Software
Tools
Automatic
Chocolate
Vending
Machine*
Data
Acquisition
System
Robot Mobile
Phone
Adaptive
Cruise Control
System with
String Stability#
Voice
Processor
Editor Yes Yes Yes Yes Yes NR
Interpreter Yes NR Yes NR NR NR
Compiler Yes Yes Yes Yes Yes Yes
Assembler Yes Yes Yes No No No
Cross Assembler NR Yes Yes No No No
Locator Yes Yes Yes Yes Yes Yes
Simulator NR Yes Yes Yes Yes Yes
Source code engineering
software
NR NR NR Yes Yes Yes
RTOS Yes MR Yes Yes Yes Yes
Stethoscope NR NR NR Yes Yes Yes
Trace scupe NR NR NR Yes Yes Yes
Integrated development
environment
NR Yes Yes Yes Yes Yes
Prototyper NR No No Yes Yes Yes
Note: NR means not required. MR means may be required in a specific complex system but not compulsorily needed.
1.5 EXAMPLES OF EMBEDDED SYSTEMS
Embedded systems have very diversified applications. A few select application areas of embedded systems
are telecommunications, smart cards, missiles and satellites, computer networking, digital consumer electronics,
and automotives. Figure 1.9 shows the applications of embedded systems in these areas.
A few examples of small scale embedded system applications are as follows:
1. Point of sales terminals: automatic chocolate vending machine
2. Stepper motor controllers for a robotics system
3. Washing or cooking systems
4. Multitasking toys
5. Microcontroller-based single or multidisplay digital panel meter for voltage, current, resistance and
frequency
6. Keyboard controller
7. SD, MMI and network access cards
8. CD drive or hard disk drive controller

0
Embedded Systems
9 The peripheral controllers of a computer, for example, a CRT display controller, a keyboard controller,
a DRAM controller, a DMA controller, a printer controller, a laser printer controller, a LAN controller,
a disk drive controller
10. Fax or photocopy or printer or scanner machine
11. Remote (controller) of TV
12. Telephone with memory, display and other sophisticated features
Telecom
I
J,
tg
I
- Mobile Computing
- Mobile Access
Smart
Cards
I
- Banking
- Security
Missiles and
- Defence
- Aerospace
- Communication
Computer Networking
Systems and Peripherals
(a)
- Networking Systems
- Image processing
- Printers
- Networks Cards
- Monitors and Displays
Digital
Consumer
Electronics
-DVDs
- Set top boxes
- High definition TVs
- Digital cameras
Automotive
- Motor Control System
- Cruise Control
- Engine/Body Safety
- Robotics in Assembly Line
- Car Entertainment
- Car Multimedia
(0
Fig. 1.9 Applications of the embedded systems in various areas
13. Motor controls systems—for example, an accurate control of speed and position of the d.c. motor,
robot and CNC machine; automotive applications such as closed loop engine control, dynamic ride
control, and an antilock braking system monitor
14. Electronic data acquisition and supervisory control system
15. Electronic instruments, such as an industrial process controller
16. Electronic smart weight display system and an industrial moisture recorder cum controller
17. Digital storage system for a signal wave form or for electric or water meter reading system
18i Spectrum analyzer
19. Biomedical systems such as an ECG LCD display cum recorder, a blood-cell recorder cum analyzer,
and a patient monitor system
Some examples of medium scale embedded systems are as follows:

Introduction to Embedded Systems I 29 I
20. Computer networking systems, tor example, a router, a front-end processor in a server, a switch, a
bridge, a hub and a gateway
21. For Internet appliances, there are numerous application systems (i) An intelligent operation,
administration and maintenance router (10AMR) in a distributed network and (ii) Mail client card to
store e-mail and personal addresses and to smartly connect to a modem or server
22. Entertainment systems such as a video game and a music system
23. Banking systems, for example, bank ATM and credit card transactions
24. Signal tracking systems, for example, an automatic signal tracker and a target tracker
25. Communication systems such as a mobile communication SIM card, a numeric pager, acellular phone,
a cable TV terminal and a FAX transceiver with or without a graphic accelerator
26. Image filtering, image processing, pattern recognizer, speech processing and video processing
27. Video games
28. A system that connects a pocket PC to the automobile driver mobile phone and a wireless receiver.
The system then connects to a remote server for Internet or e-mail or to a remote computer at an ASP
(application service provider)
29. A personal information manager using frame buffers in handheld devices
30. Thin client [A thin client provides disk-less nodes with remote boot capability]. Application of thin-
client accesses to a data centre from a number of nodes; in an Internet laboratory accesses to the
Internet leased line through a remote server.
31. Embedded firewall / router using ARM7/ multiprocessor with two Ethernet interfaces and interfaces
support to PPP, TCP/IP and UDP protocols.
Examples of sophisticated embedded systems are as follows:
32. Mobile smart phones and computing systems
33. Mobile computer
34. Embedded systems for wireless LAN and for convergent technology devices
35. Embedded systems for video, interactive video, broadband IPv6 (Internet Protocol version 6) Internet
and other products, real time video and speech or multimedia processing systems
36. Embedded interface and networking systems using high speed (400 MHz plus), ultra high speed
(10 Gbps) and a large bandwidth: Routers, LANs, switches and gateways. SANs (Storage Area
Networks), WANs (Wide Area Networks)
37. Security products and high-speed Network security. Gigabit rate encryption rate products
1.6 EMBEDDED SYSTEM-ON-CHIP (SoC) AND USE OF VLSI CIRCUIT
DESIGN TECHNOLOGY
Lately, embedded systems are being designed on a single silicon chip, called System on chip (SoC), a design
innovation. SoC is a system on a VLSI chip that has all the necessary analog as well as digital circuits,
processors and software.
A SoC may be embedded with the following components:
1. Embedded processor GPP or ASIP core,
2. Single purpose processing cores or multiple processors,
3. A network bus protocol core,
4. An encryption function unit,

30 Embedded Systems
5. Discrete cosine transforms for signal processing applications,
6. Memories,
7, Multiple standard source solutions, called IP (Intellectual Property) cores,
8. Programmable logic device and FPGA (Field Programmable Gate Array) cores,
9. Other logic and analog units.
An exemplary application of such an embedded SoC is the mobile phone. Single purpose processors,
ASIPs and IPs on an SoC are configured to process encoding and deciphering, dialing, modulating,
demodulating, interfacing the key pad and multiple line LCD matrix displays or touch screen, storing data
input and recalling data from memory. Figure 1.10 shows an SoC that integrates internal ASICs, internal
processors (ASIPs), shared memories and peripheral interfaces.on a common bus. Besides a processor,
memories and digital circuits with embedded software for specific applications, the SoC may possess analog
circuits as well.
A SYSTEM ON CHIP
I' SINGLE PURPOSE!_
;PROCESSORS n
I ASIPs !
——
i ,ps :
BUSES
DIGITAL ;
CIRCUITS- '
TIMER. ;
MUXs.... |
I DATA ADDRESS ;
I GENERATOR I
I... . T---------
____
L C.-JL ;--------
i PROGRAM
■ ADDRESS 1
i GENERATOR I
PROGRAM,
DATA
AND PORT
MEMORY
PORT i
INTERFACES I
DMAC
MULTI­
PROCESSOR I
; DSP I
; gpp :
I INTERRUPT
; CONTROLLER
ANALOG
CIRCUITS,
A/D
FIASH
or E2PROM
L
H------------------>
- 15-20%
AREA
- 60%
AREA
-20-25%
AREA
7|A’
Fig. 1.10 A SoC embedded system and its common bus with internal ASIPs, internal processors,
IPs, shared memories and peripheral interfaces

Introduction to Embedded Systems
0
1.6.1 Application Specific IC (ASIC)
ASICs are designed using the VLSI design tools with the processor GPP or ASIP and analog circuits embedded
into the design. The designing is done using the Electronic Design Automation (EDA) tool. [For design of an
ASIC, a High-level Design Language (HDL) is used|.
1.6.2 IP Core
On a VLSI chip, there may be integration of high-level components. These components possess
gate-level sophistication in circuits above that of the counter, register, multiplier, floating point operation unit
and ALU. A standard source solution for synthesizing a higher-level component by configuring an FPGA
core or a core of VLSI circuit may be available as an Intellectual Property, called (IP). The designer or the
designing company holds the copyright for the synthesized design of a higher-level component for gate-level
implementation of an IP. One might have to pay royalty for every chip shipped. An embedded system may
incorporate several IPs.
• An IP may provide hardwired implementable design of a transform, an encryption algorithm or a
deciphering algorithm.
• An IP may provide a design for adaptive filtering of a signal.
• An IP may provide a design for implementing Hyper Text Transfer Protocol (HTTP) or File Transfer
Protocol (FTP) or Bluetooth protocol to transmit a web page or a file on the Internet.
• An IP may be designed for a USB or PCI bus controller. [Sections 3.10.3 and 3.12.2]
1.6.3 FPGA Core with Single or Multiple Processors
Suppose an embedded system is designed with a view to enhancing functionalities in future. An FPGA
core is then used in the circuits. It consists of a large number of programmable gates on a VLSI chip. There is
a set of gates in each FPGA cell, called macro cell. Each cell has several inputs and outputs. All cellsinterconnect
like an array (matrix). Each interconnection is programmable through the associated RAM in an FPGA
programming tool. An FPGA core can be used with a single or multiple processor.
Consider the algorithms for the following: Fourier transform (FT) and its inverse (1FT), DFT or Laplace
transform and its inverse, compression or decompression, encrypting or deciphering, specific pattern recognition
(for recognizing a signature or finger print or DNA sequence). We can configure an algorithm into the logic
gates of FPGA. It gives hardwired implementation for a processing unit. It is specific to the needs of the
embedded system. An algorithm of the embedded software can implement in one of the FPGA sections and
another algorithm in its other section.
FPGA cores with a single or multiple processor units on chip are used. One example of such core is
Xilinx Virtex-Il Pro FPGA XC2VP125. XC2VP125 from Xilinx has 125136 logic cells in the FPGA core
with four IBM PowerPCs. It has been used as a data security solution with encryption engine and data rate
of 1.5 Gbps. Other examples of embedded systems integrated with logic FPGA arrays are DSP-enabled,
real-time video processing systems and line echo eliminators for the Public Switched Telecommunication
Networks (PSTN) and packet switched networks. [A packet is a unit of a message or a flowing data
such that it can follow a programmable route among the number of optional open routes available at an
instance.]

Embedded Systems
1.7 COMPLEX SYSTEMS DESIGN AND PROCESSORS
1.7.1 Embedding a Microprocessor
A General Purpose Processor microprocessor can be embedded on a VSLI chip. Table 1.4 lists different
streams of microprocessors embedded in a complex system design.
Table 1.4 Important microprocessors used in embedded systems
Stream Microprocessor Family Source CISC or RISC or Both features
Stream I 68HCxxx Motorola CISC
Stream 2 80x86 Intel CISC
Stream 3 SPARC Sun RISC
Stream 4 ARM ARM RISC with CISC functionality
1.7.2 Embedding a Microcontroller
Microcontroller VLSI cores or chips for embedded systems are usually among the five streams of families
given in Table 1.5.
Table 1.5 Major microcontrollers®1 used in the embedded systems
Stream Microcontroller Family Source CISC or RISC or Both
Stream 1 68HCHxx. HC12xx. HC16xx Motorola CISC
Stream 2 8051. 8051 MX Intel. Philips CISC
Stream 3 PIC I6F84 or 16C76, 16F876 and PIC 18 Microchip CISC
Stream 4’Microcontroller Enhancements of CORTEX-M3
ARM9/ARM7 from Philips, Samsung and
ST Microelectronics
ARM, Texas. Philips,
Samsung and ST
Microelectronics etc.
RISC Core with
CISC functionality
Other popular microcontrollers are as follows, (i) Hitachi H8x family and SuperH 7xxx. (ii) Mitsubishi 740,7700, M16C and
M32C families, (iii) National Semiconductor COP8 and CR16 /16C. (iv) Toshiba TLCS 900S (v) Texas Instruments MSP 430
for low voltage battery based system, (vi) Samsung SAM8. (vii) Ziglos Z80 and eZ80
1.7.3 Embedding a DSP
A digital signal processor (DSP) is a processor core or chip for the applications that process digital signals.
[For example, filtering, noise cancellation, echo elimination, compression and encryption applications.] Just
as a microprocessor is the most essential unit of a computing system, a DSP is essential unit of an embedded

Introduction to Embedded Systems
system in a large number of applications needing processing of signals. Exemplary applications are in image
processing, multimedia, audio, video, HDTV, DSP modem and telecommunication processing systems. DSPs
also find use in systems for recognizing image pattern or DNA sequence.
DSP as an ASIP is a single chip or core in a VLSI unit. It includes the computational capabilities of a
microprocessor and Multiply and Accumulate (MAC) units. A typical MAC has a 16 x 32 MAC unit.
DSP executes discrete-time, signal-processing instructions. It has Very Large Instruction Word (VLIW)
processing capabilities; it processes Single Instruction Multiple Dala(SIMD) instructions; it processes Discrete
Cosine Transformations (DCT) and inverse DCT (IDCT) functions. The latter are used in algorithms for
signal analyzing, coding, filtering, noise cancellation, echo elimination, compressing and decompressing, etc.
Major DSPs for embedded systems are from the three streams given in Table 1.6.
Table 1.6 Important digital signal processor® used in the embedded systems
Stream DSP Family Source
Stream 1 TMS320Cxx, OMAP 1 Texas
Stream 2 Tiger SHARC Analog Device
Stream 3 5600xx Motorola
Stream 4 PNX 1300, 15OO2 Philips
1 For example, TMS320C62XX a fixed point 200 MHz DSP (Section 2.3.5).
2 Media processor, which besides multimedia DSP operations, also does network stream data packet processing.
1.7.4 Embedding an RISC
A RISC microprocessor provides the speedy processing of instructions, each in a single clock-cycle. This
facilitates pipelining and superscalar processing. Besides greatly enhanced capabilities mentioned above,
there is great enhancement of speed by which an instruction from a set is processed. Thumb * instruction set
is a new industry standard that also gives a reduced code density in ARM RISC processor. RISCs are used
when the system needs to perform intensive computation, for example, in a speech processing system.
1.7.5 Embedding an ASIP
ASIP is a processor with an instruction set designed for specific application areas on a VLSI chip or core.
ASIPexainples are microcontroller, DSP, IO. media, network or other domain-specific processor.
Using VLSI design tools, an ASIP with instructions sets required in the specific application areas can be
designed. The ASIP is programmed using the instructions of the following functions: DSP, control signals
process! ng, discrete cosine transformations, adaptive filtering and communication protocol-implementing functions.
1.7.6 Embedding a Multiprocessor or Dual Core Using GPPs
In an embedded system, several processors or dual core processors may be needed to execute an
algorithm fast within a strict deadline. For example, in real-time video processing, the number of MAC
operations needed per second may be more than is possible from one DSP unit. An embedded system
then incorporates two or more processors running in synchronization. An example of using multiple ASIPs
is high-definition television signals processing. [High definition means that the signals are processed
for a noise-free, echo-cancelled transmission, and for obtaining a flat high-resolution image (1920 x 1020
pixels) on the television screen.] A cell phone or digital camera is another application with multiple ASIPs.

Another Random Scribd Document
with Unrelated Content

works, planted the French flag on the redoubt. But they paid dearly
for their temerity. The shouts of the French soldiers, hailing this
gallant deed, had scarcely reached their ears, when they fell mortally
wounded beneath the flag they had raised.
Taken by surprise by this desperate assault upon his left wing,
Prince Menschikoff hastily detached considerable reinforcements
from his main body to the succour of the embarrassed regiments
yielding to the prowess of their French antagonists. Then the battle
waged fiercely: the French, with all the chivalry of their race,
gallantly charged the Russian masses, and at the bayonet’s point
forced them to retreat. The enemy’s artillery, however, poured a
tremendous fire into the ranks of our allies, and for a time the issue
of the contest seemed doubtful. Some French regiments of the line
were driven back, so deadly was the fire to which they were
exposed; and nothing but the unflinching gallantry of the troops who
were enabled to hold their ground, prevented them from being
ignominiously precipitated from the cliffs they had so adventurously
scaled.
Marshal St. Arnaud, alarmed for the safety of his soldiers,
hundreds of whom were lying dead around him, so fatal were the
volleys from the Russian guns and so sure the aim of the riflemen,
hastily despatched an aide-de-camp to the English commander,
calling upon him to bring his troops into action without a moment’s
delay. “We are massacred,” was the message—certainly not the
words which Napoleon, or Murat, or Ney, would have used when
attacking an enemy considerably less in force than themselves; for,
be it remembered, Menschikoff still held the centre of the position
with the main body of the army, which had not yet been brought
into action. At half-past one o’clock the order to advance was given
to the English army. The soldiers, who had been lying down, so as
not to expose themselves unnecessarily to the fire of the enemy,
sprang to their feet, and rapidly formed into line. Sir G. Brown’s Light
Division, and the Second Division, under Sir De Lacy Evans, were the
first to dash into the stream, and through a perfect shower of balls

from the riflemen concealed in the gardens, and heavier missiles
from the batteries above, reached the opposite bank.
Since the commencement of the French attack, our artillery had
been throwing shot into the Russian redoubts, and under cover of
this cannonade, and the accurate fire of the Rifle Brigade, which
protected our advance, the two leading divisions succeeded in
crossing the stream, though not without great loss. The Russians
had previously marked out the range of their guns, so that they
were enabled to pour their volleys into our brigades, as they
advanced to the stream, with fatal precision. The burning village of
Burliuk, in front of the position occupied by Sir De Lacy Evans,
necessitated the separation of his division. General Pennefather led
the First Brigade and a portion of the Second across the river to the
right of the village; the remainder, under General Adams, crossing to
the left. The Light Division struggled manfully up the bank, which
was rugged and precipitous. The ford was deep and dangerous, and
as the men, drenched with water, scrambled up the banks, scores of
their number fell back into the stream pierced by the fatal rifle
bullet. But the blood of the gallant fellows was flowing hotly in their
veins; those who, in other times, had borne the shock of battles, felt
renewed the old spirit which had made them conquerors at Vimiera
and at Waterloo; those who for the first time trod the fatal field felt
an indescribable and fierce courage, which the sight of danger and
of death infuses into most men. Six months of inaction and passive
suffering were about to be consummated by a glorious victory, which
should crown them as conquering heroes or immortalize their death.
They had stood long “like greyhounds on the slips, straining upon
the start;” now “the game was afoot,” and the old fire of English
chivalry was rekindled, and burnt with as glowing a flame as of yore.
Quickly forming into line, and opening a sharp fire of musketry,
the gallant Light Division rapidly advanced towards the conical hill
opposite to which they had crossed, and immediately beneath the
guns of the great redoubt. As they passed through the vineyards,
the soldiers plucked and eagerly ate large bunches of the luscious

Crimean grapes, which allayed their burning thirst, and somewhat
cooled the mad fever of their excitement. Sir George Brown gallantly
led the charge, and, mounted on a white horse, was a conspicuous
mark for the enemy. The 7th Royal Fusiliers and the 23rd Welsh
Fusiliers were among the first in the mad career. “Hurrah for the
Royal Welsh! Well done! I will remember you!” shouted Sir George
Brown; and animated by his voice and example, the gallant regiment
dashed up the hill. Then there opened a sheet of fire, and when the
smoke lifted, the 7th was broken, and a long line of dead marked
the path of the fatal missiles. For a moment the brave soldiers
struggled onwards, and then, blinded and confused, fell back to re-
form. The Welsh Fusiliers, regardless of the fierce volleys, still
pressed onwards. Once they paused, as Sir George Brown fell at
their head, and rolled heavily on the blood-stained ground. In an
instant he was up again unhurt, and cheering the men to the
charge. His horse had fallen, pierced by eleven shots, but he was
unhurt! They had reached the first stockade, had even planted their
flag upon the works, when a shout was heard—“Cease firing; the
French are in front!” Their gallant chief, Colonel Chester, rushing to
the front, exclaimed, “No! no! on, lads!” As he spoke he fell mortally
wounded. Then the regiment, confused by the contrary orders, and
disheartened, did fall back; and the Russians, returning to the guns
from which the brave fellows had driven them, opened a fire which
left a long line of dead through their columns. Nine officers and
about one hundred men were stretched upon the field. The other
regiments of the Light Brigade, the 19th, 33rd, 77th, and 88th,
emulated the courage of the gallant Welshmen, who, after a
moment’s breathing-time, re-formed, and joined once more in the
heroic assault.
Onward swept that magnificent charge, officers and men vying
with each other who should be foremost to avenge their comrades’
death. But before they reached the guns, Prince Menschikoff had
formed a compact mass of Russian infantry on the summit of the
hill, which now advanced with level bayonets against our exhausted
battalions. Breathless from their rapid charge up the hill, diminished

in numbers, and fatigued from their almost superhuman exertions,
they were unable to resist the shock, and, desperately contesting
every inch of ground, slowly yielded to the enormous weight of the
Russian columns. The gallant 33rd, the Duke of Wellington’s
regiment, displayed a prowess excelled by none. Their colours were
borne proudly to the last, and ever in the spot of the greatest
danger. The Queen’s colours, when the fight was over, showed
fourteen bullet-holes, and the regimental colours eleven. Nineteen
sergeants fell around their standards, defending to the last the
honour of their regiment, and preserving the fame so identified with
the career of the departed warrior whose name it bore.
While the heroes of the Light Division were thus nobly performing
their part, Sir De Lacy Evans and General England were gallantly
bringing their divisions into action. They had forced a passage, with
great difficulty, and exposed to a most destructive fire, somewhat to
the left of their compatriots of Sir George Brown’s division, and,
breaking through the obstacles which awaited them on the bank,
rapidly advanced up the hill. The 55th and 95th encountered a
tremendous fire, which they returned with vigour from their
muskets, while our artillery did good service by an energetic
discharge of shot and shell into the enemy’s lines. Major Rose,
Captains Butler and Scham, fell to rise no more, and many other
officers were severely wounded; 123 killed and wounded were the
contribution of this regiment to the day’s slaughter.
As the 95th charged up the hill, one of the most affecting episodes
of that fierce encounter—so full of incidents, of unsurpassed
courage, and pathetic scenes—occurred. Early in the charge, Captain
Eddington, a young officer, fell wounded, a ball passing through his
chest. The regiment, unable to stand against the scathing fire to
which they were exposed, fell back to re-form, and left the wounded
officer on the ground. In full view of the regiment, a Russian
rifleman advanced, and kneeling by his side, appeared to be about
to offer his canteen to his lips. A thrill passed through the ranks, at
the spectacle of a soldier exposing his own life thus for the purpose

of alleviating the sufferings of a dying enemy. No gun would have
been pointed against that man, no bayonet levelled at his life. It
seemed one of those incidents that show the better feelings of
humanity are not quite extinguished by the breath of war. But what
was their horror when the rifleman, laying aside his canteen, levelled
his piece and deliberately blew out the brains of the dying man!
Among those who witnessed this cowardly assassination was a
younger brother of the captain who had recently exchanged into the
regiment, that he might share death and danger with his brother,
whom he tenderly loved. Maddened by the spectacle of his brother’s
murder, the young lieutenant sprang forward, shouting with frantic
energy to the men to follow and avenge the deed. One loud yell of
execration burst from the lips of the soldiers, and bounding onwards,
they rushed after their leader. Waving his sword above his head, the
gallant young man was a conspicuous mark, and in another moment
fell headlong, pierced by a dozen bullets. Thus the two brothers, so
fondly attached in life, mingled their blood on that fatal hillside—
among thousands of the slain perhaps the most generally and
deeply mourned.
At length Sir De Lacy Evans, who had received a severe contusion
on his shoulder, rallied his men, and led them victors to the summit
of the hill, silencing one of the batteries which had done such
execution upon the gallant fellows of the Light Division. Sir Richard
England’s division had fought—to use the language of one who
shared in that charge—“like devils,” and surmounting every
impediment, though not without dreadful loss, joined their gallant
comrades. Everywhere the Russians were driven back by the
irresistible bayonets of the British, and the conquerors literally
marched through paths of blood to victory.
As yet we have not detailed the part borne by the magnificent
First Division,—the very flower of the British army. The Duke of
Cambridge had led his Guards and Highlanders across the Alma, to
the left of the Light Division, and rapidly advanced to its assistance.
As they ascended the hill, they encountered Sir George Brown’s

regiments slowly yielding to the immense impetus of the Russian
charge. Opening their ranks, they allowed their comrades to pass
and re-form in their rear, and then the enemy for the first time was
confronted with the most redoubtable infantry soldiers in the world.
Then began the most desperate hand-to-hand conflict yet witnessed.
The Scots Fusiliers had hurried to the rescue without waiting to form
properly, and for a brief space were confused. But the individual
courage of the members of that distinguished corps never for an
instant was found deficient. Surrounded by the enemy, they fought
with undaunted valour. Viscount Chewton, a distinguished young
captain, who had gained renown in both services, having been
originally a midshipman, and having borne an honourable part in the
Indian campaign, dashed forward, and, waving his bearskin, shouted
to them to advance. Thirteen other officers, with reckless bravery,
followed his example, and in a few minutes eleven of their number
were wounded. The gallant Chewton had his leg broken by a ball,
and fell within fifty yards of the redoubt. Before he could be rescued,
several Russians attacked the fallen man, and beat him savagely
with the butt-ends of their muskets, others stabbing him at the same
time with their bayonets. A strong man, he struggled desperately;
and when at length rescued and borne from the field, his body was
found to be almost covered with wounds. He lingered for a few days,
and then expired. Two young officers, Lieutenants Lindsay and
Thistlethwayte, who bore the colours, were surrounded by the
enemy, and, except the four colour-sergeants, isolated from their
comrades. The sergeants were one by one struck down; and then
these gallant young men, back to back, kept the foe at bay, and,
almost miraculously escaping unhurt, cut their way through and
carried their colours safely to the top of the hill.
Meanwhile the Light Division had re-formed their lines, and now
returned to the charge, in the footsteps of the dauntless Guards. In
vain broad sheets of fire poured through the ranks—no man
flinched. The flag which the Fusiliers had planted on the redoubt was
still there, and pointed out the path they were to tread. Their royal
leader proved himself worthy of his charge, and encouraged by his

example the valour of his men. The Russians quailed before the
tremendous onset; and when the Highlanders, who had reserved
their fire, came dashing up to the front, and, after discharging a
tremendous volley, charged at the bayonet’s point, the rout was
complete. Thu enemy fled terror-stricken, and the Guards and
Highlanders together leaped into the redoubt, the gunners
precipitately hastening after their flying comrades.
At the summit of the hill a brief stand was made, and it seemed as
if the contest were about to be renewed; but the Highlanders,
levelling their bayonets, advanced at a rapid pace, and the enemy,
dashing down their accoutrements and arms, fled, like frightened
sheep, down the declivity.
Meantime the French had driven back the Russian left wing upon
the main body, and now brought to bear, with deadly effect, their
guns upon the retreating foe; and the second and third divisions of
our army arrived upon the scene. The victory was complete: a great
army, in a position of immense strength, had been ignominiously
defeated, in less than three hours, by the sheer valour of English
and French soldiers. True, we had paid dearly for our victory; but the
annals of the British army do not record a nobler achievement.
We were unable to pursue the fugitives—our cavalry was too weak
in numbers to be detached from the main body of the army: had we
been stronger in that branch of the service, the victory of the Alma
might have been equivalent to the conquest of the Crimea. We
afterwards ascertained that Sebastopol was emptied of its garrison
to strengthen the army, and had we been in a position to follow the
retreating forces, we might have inflicted a blow on Russian strength
from which it would not in all probability have soon recovered; as it
was, the Allies remained masters of the field, and the defeated
Menschikoff fled towards Baktchi-Serai, leaving behind him,
according to his own admission, 1,762 dead, and 2,720 wounded.
Russian assertions are not the most trustworthy, especially when the
circumstances are unfavourable to themselves, and the probability is
that the loss was really much greater. The English had 353 killed,

and 1,612 wounded, many of whom afterwards died of their injuries.
Our allies lost 256 killed, and 1,087 wounded.
On the bloody field reposed the victors when that day’s dreadful
work was done: amid the dead and dying—the lifebreath painfully
passing from the lips of wounded friend and foe—some of our bravo
fellows, pillowed on their knapsacks, slept a fitful sleep; some crept
among the heaps of dying, searching for friend or brother, and some
supported the drooping head and administered a draught of water to
the fevered lips of wounded comrade or dying enemy. The fight was
over, the lust of blood satisfied, and all the better qualities of
manhood, mercy and forgiveness, appeared beneath that setting
sun. Sometimes, as they stooped to assist a dying enemy, the
Muscovite, trained to treachery, with a final effort, would discharge a
pistol at their heads; and then the old war spirit was once more
aroused, and with clubbed musket, or deadly bayonet, the
malevolent Russian was sent to his account. The sailors, who had
watched the progress of the battle from the ships, when they saw
that victory was ours, swarmed ashore, and hurried to the scene of
strife. There they bore the wounded to the surgeon’s quarters, and
to the ships, with the tenderness of women. Little drummer-boys
might be seen among the prostrate heroes, comforting and
rendering assistance with a care and zeal beyond their years. A
fatigue party was ordered on service to bury the dead; and the
surgeons, with bare arms and splashed with blood, strove by their
skill and energy to alleviate the sufferings and save the lives of the
poor fellows brought to them.
A frightful spectacle was that hill-side of the Alma, on the evening
of the renowned 20th of September, 1854. England’s best and
bravest lay dead, their pale faces lit by the setting sun: some
retained the expression of that intense energy which bore them
fearlessly to the mouths of the Russian guns; some, with faces calm
and beautiful as an infant’s, seemed peacefully sleeping, and smiling
as they slept: others, with limbs contracted, and features frightfully
distorted, bore witness to the fierce agonies of the death-struggle.

Russian and English and French lay commingled, as they fell in the
deadly struggle; and among the heaps of corpses, many in whom
the spark of life yet lingered, lay miserably groaning, or faintly
crawled with shattered limbs, in search of help. Some of the bodies
were headless, the brains scattered around the bloody trunk: and
others were so frightfully mutilated that it was difficult to recognize
any trace of humanity. While some of our men helped to bear the
wounded from the field, and bury the corpses of the slain, others
hovered about, and plundered the dead of clothes, arms and such
matters as could be carried away; the sailors especially were active
in securing trophies of war. Russian orders and crosses, Russian
arms, and even the black bread from the soldiers’ knapsacks, were
eagerly sought; the boots were real prizes, and the seamen, who
would heartily lend a hand to succour a wounded comrade, or even
a foe, had no delicacy in appropriating the clothing of the dead. An
expeditious mode of measurement, by which they secured the
articles which would best fit, caused some amusement, even at such
a time. Jack, seating himself at the feet of a dead Russian, placed
the sole of his foot against that of the corpse; if they agreed in size,
the boots were at once appropriated; if otherwise, the critical
mariner proceeded to another selection.
For two days the armies remained upon the field; had they
marched at once, it is more than probable, nay, almost certain, they
might have entered Sebastopol with but little resistance. Marshal St.
Arnaud wished to make an immediate advance; but Lord Raglan
refused to leave his wounded untended on the field. Though possibly
we ultimately lost by this delay, we can scarcely blame a general
who showed such a fine humanity even among the horrors of
warfare. Our English courage is of the old chivalric sort—we fight as
men, for great principles, not for the lust of conquest: our soldiers
are every one a treasure of immense value, rightly used, not to be
cast away to perish when their first use is passed. Human life is to
Englishmen intensely sacred: we cheerfully lay it down when
demanded, and in proportion do we honour and cherish those who
have perilled it in our cause. A single life wilfully sacrificed for a

mere strategical advantage would have been a stain on our English
honour, which we should not speedily have forgiven.
At early morning, on the 23rd of September, the Allies turned their
backs on the memorable heights. Two men, strong and unwounded,
remained upon the field, and watched their departure; and in all that
proud array, flushed with victory, there were none who bore more
heroic hearts. Upwards of 200 wounded Russians still lay upon the
field; and Dr. Thompson, surgeon of the 44th regiment, and his
servant, volunteered to remain, and administer to their wants. Every
moment increased their loneliness and their danger; for predatory
bands of Cossack horsemen still hovered around the scene, against
whose revengeful lances the plea of mercy and Christian charity
would have been but an ineffectual shield; and yet these two brave
men quailed not in their mission, and many a dying foe had his last
pangs soothed, and parting agonies alleviated, by the ministrations
of these good Samaritans of peace.”
ALMANZA.—This battle was fought, April 4th, 1707, between the
confederate forces under the Earl of Galway, and the French and
Spaniards, commanded by James Fitzjames, Duke of Berwick, the
illegitimate son of James II of England, when most of the English
were killed or made prisoners of war, having been abandoned by the
Portuguese at the first charge.
ALMEIDA.—This was an important position, as a frontier town of
Portugal, in the Peninsular war. Massena laid siege to it August 15th,
1810, and the governor capitulated August 27th following. The
French crossed into Spain, leaving a garrison at Almeida, blockaded
by the British, April 6th, 1811. It was evacuated by the French, May
11th, of the same year. In the end Wellington compelled Massena to
retire from Portugal, but the route of the French was tracked by
horrid desolation.
ALNEY.—This was rather a single combat than a battle, between
Edmund Ironside and Canute the Great, in sight of their armies. The
latter was wounded, when he proposed a division of the kingdom,

the south part falling to Edmund, A.D. 1016; but this prince having
been murdered at Oxford, shortly after the treaty, according to some
by the treachery of Aldric Streon, Canute was left in the peaceable
possession of the whole kingdom, A.D. 1017.
AMBOYNA.—This place is celebrated for the memorable massacre
of the English factors by the Dutch, February 17th, 1623; they were
cruelly tortured and put to death on an accusation of a conspiracy to
expel the Dutch from the island, where the two nations resided and
jointly shared in the pepper trade of Java. Amboyna was seized by
the English, February 16th, 1796, but was restored by the treaty of
Amiens in 1802. It was again seized by the British, February 17th,
1810, and was restored at the peace of 1814.
AMHERSTBURG.—Fought between the Canadians and Americans.
In July, 1812, the American General Hull, with a force of 2500 men,
crossed over from Detroit, and entered the Western district, where
he issued a proclamation inviting the inhabitants to join his standard.
At this time the British force on the frontier was merely nominal, and
could offer little resistance. As soon as General Brock heard of this
invasion, he prorogued the Parliament, then sitting at Toronto, and
proceeded westward. He arrived on the 12th of August at
Amherstburg, where he mustered about 330 regulars, and 400
militia and six hundred Indians. Hull, whose force, weakened by
sickness and sending away two detachments, is said at this time not
to have exceeded 800 effective men, retreated across the river,
withdrawing the cannon prepared for the siege of Amherstburg, and
shut himself up in Detroit. General Brock, instantly crossing over,
advanced upon the fort and prepared for an immediate assault. A
white flag, however, appeared from the walls, and a capitulation was
signed, by which the whole American force, including the
detachments, were made prisoners and sent to Montreal. Loud and
just complaints were made by the Americans against the conduct of
Hull, who was afterwards tried and condemned to be shot, but was
spared on account of his age and former services.

AMIENS, PEACE OF.—Between Great Britain, Holland, France and
Spain, signed March 27th, 1801.
AMSTERDAM.—Capital of Holland, surrendered to the King of
Prussia, when he invaded Holland in favor of the Stadtholder in
1737. The French were admitted, without resistance, January 18th,
1795. The ancient government restored in November, 1813.
ANDRÉ, MAJOR.—An adjutant general of the British army, taken
prisoner by the Americans whilst returning in disguise from a secret
expedition to the American General Arnold; hanged October 2nd,
1780.
ANGRIA.—A pirate’s fort on the coast of Malabar, invested by
Admiral Watson, and destroyed 1756.
ANHOLT, ISLAND OF.—Owing to the injury done by the Danish
cruisers to British commerce, this island was taken possession of by
England. The Danes made an attempt to regain it with a force of
4000, but were gallantly repulsed. The British force opposed to them
did not amount to more than 150 men, yet triumphed in a close and
desperate engagement, March 14th, 1811.
ANJOU, OR BLAUGÉ.—This battle was fought between the English
and French armies April 3rd, 1421. The French were commanded by
the Dauphin of France, who defeated the English, on whose side the
Duke of Clarence and 1500 men perished on the field; the Duke was
slain by Sir Allan Swinton, a Scotch knight, who commanded a
company at arms; and the earls of Somerset, Dorset, and
Huntingdon were taken prisoners. This was the first battle that
turned the tide of success against the English in their first wars with
France.
ANTOIGN.—This battle was fought between the central army of
the French and the Allies, August 13th, 1792, in which 4500
Austrians and Prussians were killed, 3,500 taken prisoners, and 600
emigrants shut up in Longwy; 900 French were killed in the action;

30 pieces of battering cannon and howitzers, with all the baggage of
the combined army, were captured.
AQUILEIA.—In the first battle fought there, Constantine II was
slain by Constans towards the close of March, A.D. 340. In the
second, Maximus was defeated and slain by Theodosius, July 28th.
A.D. 388. In the third, Theodosius defeated Eugenius and Arbogastes,
the Gaul, and remained sole emperor of the Roman world,
September 6th, A.D. 394. Eugenius was put to death, and Arbogastes
died by his own hand, mortified by his overthrow.
ARBELA.—The third and decisive battle fought between Alexander
the Great and Darius Codomanus, king of Persia, which decided the
fate of Persia, B.C. 331. The army of Darius consisted of 1,000,000 of
foot and 100,000 horse; the Macedonian army amounted to only
40,000 foot and 7,000 horse. The gold and silver found in the cities
of Susa, Babylon, and Persepolis, which fell into the hands of
Alexander, after this victory, amounted to £30,000,000, and the
jewels and other precious spoil, belonging to Darius, sufficed to load
20,000 mules and 5,000 camels. At the battle of Arbela, the Persians
lost 300,000, or as some, with greater probability, say 40,000, whilst
the Macedonians had only 500 slain. Darius betook himself to flight,
and was slain by Bessus, Governor of Bactria, who was punished for
his perfidy in the following manner:—He was taken and bound
naked, hand and foot, and four trees having been by main force
bent down to the ground, and one of the criminal’s limbs tied to
each of them, the trees, as they were suffered to return to their
natural position, flew back with prodigious violence, each carrying
with it one of the limbs.
ARCOLA.—This battle was fought between the French, under
General Bonaparte, and the Austrians, under Field-Marshal Alvinzy,
November 19th, 1796. The result of this bloody conflict, which was
fought for eight successive days, was the loss on the part of the
Austrians of 12,000 men in killed, wounded, and prisoners, with 4
flags and 18 guns.

ARGENTARIA.—This battle was one of the most renowned of its
times. It was fought A.D. 378, in Alsace, between the Allemanni and
the Romans, the former being defeated by the latter, with the loss of
more than 35,000 men, out of their whole army of 40,000.
ARKLOW.—This battle was fought June 10th, 1798, between the
insurgent Irish, amounting to 31,000, and a small regular force of
British, which signally defeated them.
ARMADA.—Philip, king of Spain, after some years of preparation in
all the ports of his extensive dominions, had assembled in the river
Tagus a fleet of 130 large vessels, carrying nearly 30,000 men, and
the Prince of Parma had collected, in the ports of the Netherlands,
ships and boats for the embarkation of an equal number of his
veteran troops. To resist these formidable preparations, Elizabeth
had only a navy of 34 ships, but the nobility and the seaports fitted
out such a number of vessels at their own expense, that there soon
was at sea a fleet of 180 vessels of all kinds, large and small. The
chief command was committed to Howard of Effingham, Lord High-
Admiral of England, and Drake, Hawkins, and Frobisher held
commands under him. The fleet was stationed at Plymouth. A land
army of 30,000 men was posted at Tilbury, in Essex, under the
command of Lord Leicester, for the protection of the city of London,
while another of equal strength was destined for the guard of the
Queen’s person.
On the 29th of May, 1588, the Invincible Armada (i.e. Fleet), as it
was proudly styled, sailed from the Tagus, but owing to a storm
which it encountered, it did not appear off the coast of England till
the 19th of July. On that day it was descried near the Lizard point, in
Cornwall, by a Scottish pirate, who made all the sail he could to
convey the intelligence to Plymouth, and the Admiral got his fleet
out to sea with as little delay as possible.
As the Spanish Admiral had orders not to engage in hostilities till
he should have seen the Prince of Parma’s army landed in England,
he took no notice of the English fleet, but steadily directed his

course up the Channel. The Armada sailed in the form of a crescent,
of which the horns were seven miles asunder. Its motion was slow,
though every sail was spread; “The winds,” says the historian, “being
as it were tired with carrying the ships, and the ocean groaning
beneath their weight.” The English ships, which were smaller and
more active than those of the Armada, followed to harass it and cut
off stragglers, and during the six days which it took to reach Calais,
it suffered considerably from their persevering attacks. At Calais the
Admiral learned that the Prince could not embark his troops for want
of stores and sailors, and while he waited, the Armada narrowly
escaped destruction from fire-ships sent into it by the English. A
violent tempest succeeded, which drove it among the shoals on the
coast of Zealand; and a council of war determined that, as it was
now in too shattered a condition to attempt anything against the
enemy, it were best to return to Spain without delay; but as the
passage down the Channel was so full of hazard, it was resolved to
sail round Scotland and Ireland. The Armada, therefore, set sail; the
English pursued it as far as Flamborough-head, where want of
ammunition forced them to give over the chase. Storms, however,
assailed the Armada, and several of the vessels were cast away on
the coast of Ireland, where the crews were butchered by the
barbarous natives. The total loss was 30 large ships and 10,000
men. Philip received the intelligence with great tranquillity, and
ordered public thanks to God and the saints for the calamity not
having been greater.
In this great danger of herself and kingdom, Elizabeth had shown
the spirit of a heroine. She visited the camp at Tilbury, rode along
the lines mounted on a white palfrey, and cheered the soldiers by
her animated language. When the danger was over she went in
state to St. Paul’s, and publicly returned thanks to Heaven. She
granted pensions to the disabled seamen, created the Admiral, Earl
of Nottingham, and bestowed honours and rewards on his officers.
The sudden death of Leicester, shortly after he had disbanded his
army, intercepted the favours she might have designed for him.

ARMED NEUTRALITY.—A confederacy of the Northern powers
against England, commenced by the Empress of Russia, in 1780. It
resulted in the destruction of the Danish fleet before Copenhagen,
April, 1801. This gave England the acknowledged claim to the
empire of the sea. The neutrality was soon after dissolved.
ARMAGH.—This battle was fought A.D. 1318, against Edward Bruce,
who was defeated, taken, and beheaded at Dundalk, and with him
6200 Scots lost their lives.
ARMISTICES, CELEBRATED.—The most celebrated armistices
recorded in Modern History are the following:—That of Leobon, in
1797, was signed a few days after the victory of Tagliamento, gained
by Napoleon I over Prince Charles. It was Bonaparte himself who
proposed it. This armistice was followed by the preliminaries of
Leobon and the treaty of Campo-Formio. The armistice of Stayer,
concluded on the 25th December, 1800, took place after the battle
of Hohenlinden. It was signed by Moreau, on the 16th January,
1801. Brune signed the armistice of Treviso, which delivered into the
hands of the French the fortified places of Ferrara, Peschiera and
Porto-Legnano. He was reproached with not having demanded
Mantua. In 1805, Murat concluded an armistice at Hollebrun, which
saved the Russian army, and was the cause of a severe letter written
to him by the Emperor. On the very evening of the battle of
Austerlitz, the Emperor of Austria demanded and obtained an
armistice, which was preliminary to the peace of Presburg. Another
armistice, also celebrated, was signed after the battle of Friedland,
and led to the peace of Tilsit. At Wagram took place the armistice of
Zoaim, which was the prelude to the peace of Vienna, 1809. Lastly,
on the 4th of June, 1813, after Bautzen, was signed the armistice of
Pleiswitz, which the Emperor Napoleon I himself considered a fault.
ARTILLERY.—The first piece was invented by Schwartz, a German
Cordelier monk, soon after the invention of gunpowder, in 1330. First
used by the English by Edward III at the battle of Crecy, in 1346,
when that king had 4 pieces of cannon, which greatly aided in his

gaining the battle. Brass cannon, first used 1635—improvements
made by Browne in 1728, and have continued ever since.
ASCALON.—This battle was fought A.D. 1192. Richard I of England,
commanding the Christian army, met and defeated the Sultan
Saladin’s army of 300,000 Saracens and other infidels. No less than
40,000 of the enemy were left dead on the field of battle, and the
victorious Richard marched to Jerusalem.
ASPERNE.—This battle was fought between the Austrian army
under the archduke Charles, and the French, on the 21st of May,
1809, and two following days. In this most sanguinary fight the loss
of the former army exceeded 20,000 men, and the loss of the
French was more than 30,000; it ended in the defeat of Bonaparte,
who commanded in person, and was the severest check he had yet
received. The bridge of the Danube was destroyed and his retreat
endangered; but the success of the Austrians had no beneficial
effect on the subsequent prosecution of the war.
ASSAYE.—Fought September 23rd, 1803, between the Duke of
Wellington (then General Arthur Wellesley) and Scindiah and the
Rajah of Berar. This was Wellington’s first great battle in which he
opposed a force fully ten times greater than his own. In Stocqueler’s
Life of the “Iron Duke” we have the following account of this battle:
“Scindiah’s army having changed its position, occupied the whole
space between the Kaitna and Assaye, with a great number of guns
in front, and commenced a murderous cannonade. The small
number of British guns was quite incapable of coping with this vast
battery. General Wellesley, therefore, directed his infantry to advance
with the bayonet.
With the determined courage which had given them victory at
Seringapatam, in the actions with Dhoondia Waugh, and on the
walls of Ahmednuggur, the line dashed forward, carried the guns on
the right, and approached Assaye. At this moment a cloud of
Mahratta horse had stolen round the village, and fell upon them—

sabre to bayonet—with characteristic fury. The 74th regiment
wavered—the charge was too much for them.
Colonel Maxwell of the 19th Light Dragoons saw that the critical
moment had arrived, Forward! was the word. Falling upon the
Mahratta cavalry, the Dragoons gave the British infantry time to rally,
cut up the Mahratta horse, pushed through the Scindiah’s left, and
threw the whole of that part of the army into confusion. In the
meantime the enemy’s centre, which had remained untouched,
closed in upon the ground before occupied by their left wing, and
uniting with such of their infantry and artillery as had been passed
over unhurt by the British cavalry, formed itself into a kind of
crescent, with its right horn resting on the river Jouah, and its left on
the village of Assaye; thus presenting themselves in a fresh position
on the flank of our infantry, on which, having collected a
considerable number of guns, they recommenced a heavy fire. The
battle was now to be fought over again, with this difference, that the
contending forces had changed sides, and had the enemy’s horse
behaved with the least spirit, while our cavalry was absent in pursuit
of their broken battalions, there is no guessing what the
consequences might have been; but, happily for General Wellesley,
they kept aloof. To oppose the enemy in their new position, the
Sepoy battalion on the right was immediately advanced against
them, but without effect, being obliged to retire. Another was
brought forward and equally repulsed. The cavalry, having by this
time returned from the pursuit, and formed on the left, and the
enemy’s horse having disappeared before them, the General ordered
the 78th regiment and the 7th cavalry up, to head a fresh attack
against the enemy’s infantry and guns, which still defended their
position with obstinacy. No sooner, however, had he formed the 78th
regiment in line, in directing which his horse’s leg was carried off by
a cannon shot, than the enemy without waiting an attack,
commenced their retreat across the Jouah, which they passed in
tolerable order before our troops could come up with them.
Previously to this last attack Colonel Maxwell had requested and
obtained permission to charge a considerable body of infantry and

guns, which having formed part of the reserve, were seen retiring in
good order, along the right bank of the Jouah.
The 19th Dragoons were not long in coming up with the enemy,
who having formed with their left to the Jouah, steadily waited their
approach. The charge was sounded. The Dragoons advanced with
rapidity, amidst a shower of musketry and grape, and had already
got almost within reach of the bayonets of the enemy, who still
gallantly stood their ground.
“At this moment,” writes an officer engaged in the charge,
“instead of dashing among their ranks, I suddenly found my horse
swept round as it were by an eddy torrent. Away we galloped right
shoulders forward, along the whole of the enemy’s line, receiving
their fire as we passed, till having turned our backs on them, we
took to our heels manfully; every one called out Halt! Halt! while
nobody would set the example! till at last a trumpet having sounded,
we pulled up, but in complete disorder, dragoons and native cavalry,
pell-mell. On this occasion Colonel Maxwell fell, pierced by a grape-
shot. He was gallantly leading the charge when he received his
death blow. Having involuntarily checked his horse and thrown his
arm back, when he received his wound, the soldiers immediately
behind him, not knowing the cause, mistook the gesture for a signal
to retire, and did so accordingly. At least this was the reason
afterwards assigned for the failure, and if true, shows how the fate
of armies, and even of nations, may depend on the direction of a
single shot.” Recovering from their disorder, the Dragoons renewed
the charge with terrible effect, and the enemy gave way in every
direction.
Thus closed this memorable battle, one of the most bloody on
record to the victors. Out of about 4500 men in action, upwards of
2000 were either killed or wounded, the former amounting to more
than one-third of the whole number.”
ASSYRIANS AND JEWS.—the Battles, &c., between—B.C. 710. These
battles resulted in the total destruction of the army of Sennacharib,

so graphically described by the Sacred penman—and afterwards in
the destruction of Jerusalem, the overthrow of Solomon’s Temple,
and the exile of the Jews to Babylon, for 70 years.
ATHLONE.—The English army under General Ginckel stormed
Athlone, then a town of prodigious strength—crossing the Shannon
in the face of the Irish army, yet not losing more than 50 men. This
bold and successful enterprise procured for Ginckel the title of Earl
of Athlone, 1691. See Aughrim.
ATTILA.—Surnamed The Scourge of God, ravaged all Europe, A.D.
447. He invaded the Roman empire with an army of 500,000 Huns,
and laid waste all the provinces at Chalons-sur-Marne. Aetius, the
Roman prefect, met him, and defeated him with the loss of 200,000
men. Afterwards he was as signally defeated by Thorismond, King of
the Goths, and died in the midst of his career.
AUERSTADT, BATTLE OF.—In this most sanguinary conflict,
between the French and Prussian armies, October 14th, 1806, the
Prussians were routed on every side, having lost 200 pieces of
cannon, 30 standards, and 28,000 prisoners, and leaving 30,000
slain on the battle field. Both the King of Prussia and Napoleon
commanded at this engagement. The French Emperor immediately
afterwards entered Berlin, from which city he issued his memorable
Berlin Decrees.
AUGHRIM, BATTLE OF.—Near Athlone, in Ireland. This battle was
fought, July 12th, 1691, between the Irish, headed by the French
General St. Ruth, and the English under General Ginckel, when the
former lost 7000 men; the latter only 600 killed and 960 wounded.
St. Ruth was slain. This engagement proved decisively fatal to the
interests of James II in Ireland, Ginckel was immediately created
Earl of Athlone; the ball by which St. Ruth was killed is still
preserved suspended in the choir of St. Patrick’s Cathedral, Dublin.
AUGSBURG, BATTLE OF.—Fought between the Imperialists and the
French army, the latter commanded by Moreau; who obtained so
complete a victory, that Augsburg and Munich were opened to him.

It was fought August 26th, 1796; Moreau, September 2nd following,
again defeated the Austrians on the Jun, and again, September 7th,
at Mainburg.
AUSTERLITZ, BATTLE OF.—Fought December 2nd, 1805, between
the French and Austrian armies; gained by the former. Three
Emperors commanded at this battle, Alexander of Russia, Francis of
Austria, and Napoleon of France. The killed and wounded exceeded
40,000 on the side of the Allies, who lost besides, 40 standards, 150
pieces of cannon, and many thousands of prisoners. This decisive
victory of the French led to the treaty of Presburg, which was signed
December 26th same year.

B.
BABYLON.—This city was first taken by Ninus, B.C. 2059, then by
Esar-haddon, B.C. 680. Both Darius and Cyrus took the city, the first
through the fidelity of his officer Zopyrus, who having cut off his
nose and ears fled to the Babylonians, and was admitted within the
walls, and found means shortly afterwards to betray the city—the
other by turning the course of the river Euphrates, and marching his
soldiers up the dry bed into the city.
BADAJOS, SIEGE OF.—This important frontier fortress had
surrendered to the French, March 11th, 1811, and was invested by
the British under Lord Wellington, on March 16th, 1812; and
stormed and taken on April following. The siege is one of the most
important in the annals of warfare; for the victory was not only a
glorious military achievement in itself, but it obliged the French, who
had entered Portugal for the purpose of plunder, to commence a
precipitate retreat from that kingdom. For particulars, see Life of
Wellington, and Napier’s Peninsular War.
BADEN, TREATY OF.—Between France and the Emperor,
September 7th, 1814. It was erected into a grand duchy of the
Rhenish Confederation in 1806. Its territorial acquisitions, by its
alliance with France, was guaranteed by the Vienna Congress of
1815.
BALAKLAVA, BATTLE OF.—Fought October 25th, 1854. If the
exhibition of the most brilliant valour, of the excess of courage, and
of a daring which would have reflected lustre on the best days of
chivalry can afford full consolation for the disaster of to-day, we can
have no reason to regret the melancholy loss which we sustained in
a contest with a savage and barbarous enemy.
I shall proceed to describe, to the best of my power, what
occurred under my own eyes, and to state the facts which I have
heard from men whose veracity is unimpeachable, reserving to

Welcome to Our Bookstore - The Ultimate Destination for Book Lovers
Are you passionate about books and eager to explore new worlds of
knowledge? At our website, we offer a vast collection of books that
cater to every interest and age group. From classic literature to
specialized publications, self-help books, and children’s stories, we
have it all! Each book is a gateway to new adventures, helping you
expand your knowledge and nourish your soul
Experience Convenient and Enjoyable Book Shopping Our website is more
than just an online bookstore—it’s a bridge connecting readers to the
timeless values of culture and wisdom. With a sleek and user-friendly
interface and a smart search system, you can find your favorite books
quickly and easily. Enjoy special promotions, fast home delivery, and
a seamless shopping experience that saves you time and enhances your
love for reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!
ebookgate.com