100% found this document useful (2 votes)
660 views

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

The document provides links to various ebooks on embedded systems, including titles by Raj Kamal, Steve Heath, Michael Barr, and others. It includes a detailed table of contents for Raj Kamal's 'Embedded Systems Architecture Programming and Design' 2nd Edition, covering topics such as embedded systems introduction, processor architectures, device communication, real-time operating systems, and case studies. The document also acknowledges contributors and reviewers who supported the creation of the book.

Uploaded by

cwoongdouass
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
660 views

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

The document provides links to various ebooks on embedded systems, including titles by Raj Kamal, Steve Heath, Michael Barr, and others. It includes a detailed table of contents for Raj Kamal's 'Embedded Systems Architecture Programming and Design' 2nd Edition, covering topics such as embedded systems introduction, processor architectures, device communication, real-time operating systems, and case studies. The document also acknowledges contributors and reviewers who supported the creation of the book.

Uploaded by

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

Embedded Systems Architecture Programming and

Design 2nd Edition Raj Kamal pdf download

https://ebookgate.com/product/embedded-systems-architecture-
programming-and-design-2nd-edition-raj-kamal/

Get Instant Ebook Downloads – Browse at https://ebookgate.com


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Embedded Systems Design 2nd Edition Steve Heath

https://ebookgate.com/product/embedded-systems-design-2nd-edition-
steve-heath/

ebookgate.com

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/

ebookgate.com

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/

ebookgate.com

Fast and Effective Embedded Systems Design 1st Edition Rob


Toulson

https://ebookgate.com/product/fast-and-effective-embedded-systems-
design-1st-edition-rob-toulson/

ebookgate.com
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/
ebookgate.com

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/
ebookgate.com

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/

ebookgate.com

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/

ebookgate.com

Embedded System Design Third Edition Santanu Chattopadhyay

https://ebookgate.com/product/embedded-system-design-third-edition-
santanu-chattopadhyay/

ebookgate.com
,:.

,
.·,

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 P Kabisatpathy


>ept. of Computer Science and Engineering, Dept, of Electronics and Instrumentation Engineering.
idira Gandhi Institute of Technology, New Delhi College of Engineering and Technology. Bhubaneswar

KK Mohapatra
lilima Fulmare
Dept, of Electronics.
Hindustan College of Science and Technology. Agra
National Institute of Technology, Rourkela
JikhiJ Kothari JK Mendiratta
)ept. of Electronics and Communication Engineering, Dept, of Electronics and Communication and Engineering.
>haram Sinh Desai Institute of Technology. Gujarat II. K College of Engineering. Bangalore

upriya Kelkar Lyla B Das


'umniins Institute of Engineering and Technology, Dept, of Electronics Engineering,
'nne University National Institute of Technology, Calicut

Santa Kumari
himli Adhikari
Dept, of Electronics and Communication Engineering.
>ept. of Electronics and Communication and Engineering,
Andhra University. Vishakhapafnafn
'alcutta Institute of Engineering and Management. Kolkata
V Murlidharan
Hpankar Ghosh Dept, of Computer Science and Engineering.
)ept. of Electronics and Communication Engineering MS Ramaiah Institute of Technology. Bangalore
■engal Institute of Technology. Kolkata
Josephine P Kumar
lebashish De Dept, of Computer Science and Engineering.
>ept. of Electronics and Communication Engineering. MV.I College of Engineering. Bangalore
leghnad Saha Institute of Technology, Kolkata
Stanley Johnson
I
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 vii
Preface to the First Edition ix
1. Introduction to Embedded Systems I
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 128


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 187


4 1 Programmed-I/O Busy-wail Approach without Interrupt Service Mechanism 189
■ n
xiv j Contents

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 234
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 273


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 303


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 3S0


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
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
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 ofruin. 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
Simple approach with interesting
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 examples and figures
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

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:

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.
Simple approach with figures to asipi cmcuns
. . TWER
explain complex topic of system IP, MUX,

on chip for a mobile phone 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
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 prtendeefresafa 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 Simple way of point-wise
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, presentation of the details by
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 using lists and tables
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.

Program Modafctg Concops

Table 6.2 UML Basic Elements


I Mndrllixy Widl dot) it rmitl Etreuilnrv Diutrurrvrviti.'
are! thtra-' ftriirr.enluh.a.
j CM" Class defines the states. aoribum ano tadunt**. A Kev'Luigvtar hut uiih dissolves a. dsown
clau can alto be aa active or atucract clAv 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
i Afcvxi A ciaM in general may he abstract when cither rarer* Rr.tangvlar hot with din.no. for eU.x
1 Cl-ll! thorn states, operaon* <■ behaviour u eornpieiety names for its identity, alirihutrs and
defined, being h an abroad age. or when it is not opetvnns. but with prefit abstract w*b I
fur creating objects but only a class, which c*tend>. each ahorjct behaioiur ami aliirtarc
implencau the abstract behaviours (iMthedil and
specifies (he aharam roritues (fields ,* nremo)
that class can creMc the object.
i
Object An instance of a daa that e. a functionalcsaity fumed kectangutu bus with ob^ct identity I
by copying the tula. Stribum and hehavicw from 1 follirwcd by wniKohm and class idcnlitv i
class. as sfs—n in Figure ft Ittifi
Active An active class defines w> active cfcjen insurer n( an Rcvanpita For with itijcfl tienni
object active etass. A process or thread h equivalent 10 ite followed by scmtrokei ami ebss j
active object in UML becaasc active object posts the identity, lair with prefic «tivc with ■
signals like rhrewl and cart wait before sirring or ibjevt idcniHy. j
I rewriting the operation using the mcdsoA.
An active class ac*> a thread eta that has 1 defined Rectangular hoi with thick border lines I
slate, attributes, behaviours and behaviours foe the aril inner UivisiiMH ft* the ciaM narr*v !
signals. Active dsa in addition, define* the -natroi for the identity, anritxues and Fehavnwn j
by signal betevun (for a signalling oi^ct. which foyuratnXB *id signals), hit with peefis
can be pouedandrar which it owy wail before starting as-ttvc with etar sdreeily.
or resuming). Thus there is control on rhe class
behaviour.
Signal An object, wttidi it km (postal) front one active etas Signal identity within two pai** of
(active object) to saoiher waive etas, wpidi uu foe iiacung and ctaang signs Ccshswral by
Man er resumption. Signal obsea tahaviuw tlcfines Ctai idcniity (Stmita to sttrcoiypeK
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.
Slereo- An Dspacked cofioficn <4 dements (tfritam or Rectangular bos with stereotype identity
IJT* bdHvfrw) tiuf B repeatedly toed. 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 •/ L Mx mt/ fruM rmAardtLJ m/rmi dr»iffi th? thtrr • i/’e* ihm/iuM */lt4 in t*wi
69. r BR coda far po*Vg ■*»<■ far lap U>TM.Cfc<*«y •/ 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' *
SR_TIneU<tt <>( , _
y. r^f— far crMseg * nvtragr far <r* and <fa*C ate each >’»? mtmfl fate 1V V Mem T. 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
KTCfct’f a */ fcAii A rvi tWAJtHfii cii'hr' ia < //
/V ubftx D.n lAf»* i tJw urr Ut i
TO. OBMtaxIVs (MbosTuacD^StrMsg, timcDaac); t !•* irvn» hrv ti* irf 44 ijirrm uzr
71. )7>En>c( 13R_TtmeDate euV’l 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* •
"11.2 CASE SHIM OF DIGITAL CAMERA HARDWARE AND SOFWARE
plated rfUmi *Ar ia^*ufT i*ru
ARCHfTECTURE K <7«iyK«KHJ>, /VTItftTfrM «/M^AaKr
1 T<t feat* lading fur d/ttin impUfnfnialion un^r A/VCVZY u*/ VrUti/li
TK digital OWi was iiuroduccd earlier in Section l.hl.4. Athgiialeainen issneeam^cidSrX.ISeetteilA I C, #T7V.V’. dlx« /V uif r/ tT(\ f,u fiu* ivni Aa*<«/iin uaJ < w'rrn;
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.1 CASE STUDY OF EMBEDDED SYSTEM DESIGN AND
o
11.2.1 Requirements COOING FOR AN AC/TOMATfC CHOCO1ATE
RcquirmeW'ufiV digital earner* e» he undcruond through a requirtment table given m Table II I VENDING MACHINE |ACVM) USING MUCOS RTOS
nr OruiM funrtum iiuU* du earner* an ai faOm: ■J ACVM wi* 1 arodueerfcaiIiftNafiwn I H>,2. h ACVm fafKlic*'. hMJwjre
I. A « <9 onurcdlen crnuol Jitdicr. flash. <fro example, for pcnfdtcnh. direct mermuy KCOS. nJ i/xl Wiwdc unib. Fipjfc t.U *1**01 j diagrarrunjcic ripvtxflLiui«n H ACVM
fote*r. neo facts and eye-ball image control. GUI consist* of the IXD display tor graphics. and SechnM JI I.Mo IIJ.AgivethedeMgnan AC'VM. V.2ik'wnt'cd
< wils-Vi and Iwueass f« inputs al camera. A liaahxrcen n amaher ahemaurc !•» VXD an) keypad. '£
MUCOS StTOS. It ta a portable. ROMabk. scabbte. proemfioe. real nn« jai!
TV user give* commands for twitching on the omen. Huh. diuricr, adyvrl brightness. couth. multiuskifif kemeL Section 11. J.? 4ncnhe* Gm AC'VM tohin^MUCtA** KHAS
s-ulnr. tare nJ transfer. The t»cr cnmmaruK vc in the hem of truerropr ogaah. Each sagnal groerate* c (Scctiw 9.2) propimrung envmmmrnl.
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. T
2. IV (Vrarc generate light, which fill, m tV CCD array, which through an ADC tranuraw the bib 11.1.1 Requirements
far eachpitetin each row in the frame, and also for 1V dark area pitch in each row in a veriKsl scrip / TIkcrifui/ttwntt td dtf mo;hinr rm he uMentm«J lhAAigh j rrquftc/ncTM IjNc
lie nflri cwrcctirm in CCD signaled light intensities far nit row. IV srnp t* m adjacent frame pun in Table N.I.
3. A pkswvcrwvriH eda number of pi lets. TV number ofprset'used fir: pcture determines ffwilroiiuL ‘1/
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 11.1.2 Specifications
nimprnu in J piacf. Each cell getsespuaed Io a picture when tV shutter ufcanwruiysensim a met The ACVM spccircAik*i\ in brief arc v Jullu»>.
command. 7he »anrro ffrnrds rte pictures irong a rtarge-tiwipW desires iCCDramy 0>r array 1. Ct h<s an ulfd^nunffie keypad <w» iftc l"p the flixhi/w TJol cnjhte* J
crourtsefa Urge rutrnber of CCD cells. throe at each pitch 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 ISJ 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 tV 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»*™

(( 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.
4 K* B'jJf /mm iht f'JL^ing j/i rAn ,ipkf. Ml 1 he funciaau osteal < । mJ «fn_ft\xi*e () unloA and M • <f«w.
fu Bu.<k ftinchotu and npti vf fTOSti IcJ The fiwitiq n<i_iUjty I t ugMh <oa tingle warling ti'Alh* ihctma^e <* av«UMe The
'£ hi' XTPX pCOS-lt ai MUCOX «n fht lent thrvugh iff riMwipffr— mKv '*• <' * fcv a tab. which ha» hem tegrtrfed fa a mmTrai k* I feg i Ucrcd *i c an *
tMtinplf 1V. I m 9 20. WAar arymi*iUj art paiwrfuaf irfeM nJwJ an minted Jaitfot ukctocMcUihc na^nutifyj. Thi* prwrani n eMfO^fy mefo/fuo wrver tuk. A *er>cr
A fttr rtii h <0V/i MUCO31 finiftw* •ill 6r cj^w«A Itartin* *ht m<v «/
in rV AWCOJij tMp'fcvv/«r a remit• tvtn t] onaAtr UFOS it
tart Kvciver tir m^iicatuMi from a drnt t*dc thruiigh a Mgndhaaikr fiuKtk* (like an JKK i
H l lie fofeinm Ifrtfktct ihr aiuitarte irfa PDSLC (ftroc
urd Utttf J hit- di Ar/p f/r«jrfv m wUrr itum&Af fr ijJhmcW- and fgt The rt)M\ .jane n^unlhik I 1net drun^ Ac <f«w imrAhatcly hut petent*
K mhrddrd JtfTAVi lairt <m. the <nhc« U«U ln« rung the ifurnc l>r ipeur »dl gs douuyvd urdy if the 11M usk cfane* ebe
ran k'rHo/Lj fuim Wtnd Hiivr* Stitmi m ofiff an HTOS far »^ph/ifii and ipcw. Jkak.iy iw b> dC'JtUxak* Ur nr'ruxy iMnriwd »ilh qmc IXB.
K tfdmMrJ irifi'MJ vi/A fuivttfal tuyl loppy*• thniugh irnn tuirtplct^ VcWitfU 4><vc\ bw»e tJcrAfaanal hjhuwtng fnii/tc* djTiotcwieficwnam he u<d. liilTwu
Ktamplfi 9.21 *•• 9.27. bifffnnftx brtntrt <Ar ft Hart 1 irm*tpAarrt I-11-0 mdJok h« queue* bom hy multiple ia*L* RfSIX qumaa have the akiicavial firfh/wjag (e•kirr
I wwiJfes tt i u</ 4*/w i irirt ft QVd tv Aai ofMUCOS ndl ht •"•lit fltof U4 ft 41 freJ Km m t **e a single *stu*g ttfk is i vaiUMe IftJ there On be U pri<rity k*d» in place
O»pw K* • rff drxfr&t lAc Hv>fowt Ct OSfiX reirf-f*mr fjftu f flTfa/uui. 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 cmal md a nuntfrr.
Q 5.1 BASK FUNCTIONS AND TYPES OF RTOSes
Ge cample, id n xuigrrd m ideveify Ac devcc croud. Tte numbs* h rnwgixd iffci claHiimeg j xi rd Jr
A rumple* rnd'jtt*tirt£ embedded QUem detigfi re/juicc* (he dcvelapmcm of numhen abpnJy aJkratrd Whe» mwij: Ac deviedreltfal ImdiiMb. Ae nmotier farilitifca the dr* ice
thwwghly tcUeJ hup free cafe* fa The devuT fmrtM esampln arc vfen iv rod or write or gd Ufibur 9 vet 9 afifttuc ck“c tSnm<i X 61
l. JAtegnacd devtJapmeft efivinmment A pqr it. VaWicts h i HFO^w. wbuch i* managed <M by quor tfC AnO/tn* Nit by the dc«icc4n«er
o 2 Tuk furwiiixn in emhakfcd C « emtakferf C** funutiiau. VtWud* ha* maoagcml funcucm f*M a pvpc-drHd (like a device Aixcrj pqw*/n*. Thi* 11 analifiaA
V Rcif-tinv ckxk-bwed hiftjwwt ind mftwire umen l‘» ihe named ppe driwr m Uwi. fipe* ahn in^Jcfncnt the unafrro.tjrmd iMtanauwt of tok.*.
a. Scheduler FufKijiwi pipel'eiCfcaiC i’/jnp«//wprXo**r* . muuMki. maukfj/llytr/i crraici a pipe device named
V (Tevet driven «nd device mi Mger ptfnHaon far muinaim «toi*i<7 mc\Mps E*h mage oa he of ni&Ktnis) ua Artec It cnicr*
6 Funetn«> f« [HTj vtiftg the vgMh. event (U< fnwp. wmiptvrr-hiftUmg 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
fuHciiofti »d function* for the queue*, m*ilbu*fcv pipe ind wekeb. id Meh device including |wpc dencr*

E 7 AddiUauJ (qm'mjim. fur cutapte* TCMP of US8 or RlwUjOth* a WIK of Curuadu m cumplc (« crcAog a pipe named u piprUurinfo. Aswnre itaa *1 cac have a rottnfesn tX
IfDAMdGUh. fnur tncuagev i&cr name. po**«d. ictephunc number and c-ruait ID. tadi the< cuO b: of a nuAimum
R Fjra md exception htftdtuig function. m/c of J2 byto iMify A gkXmi variable fJ»» an integer number far J file docripfer that tdetuifet a (k*u*e
c v. (ruing and 5, uc m de huggiry wrffwirt for Icwag RTOS a% « e 11 a< de vchpcrf 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.
embedded 4ppliCJ»f*, K*ample V 26 ctpCam* Jk mde* tor creating. »*riimg and reading.
-r 9.UuJ shows the tag fumu*m* cipcttcd from the kmd of an RTOS.
The RTDS'% hi«c the fdJowing future* in genenl. Example 9.26
i 1 Ic/tkI fuiw'iiou and ichcduling.* preemptive e» pre-cmRrtc plus lime
I. * include Vedjh.h" P Indiofe du [0 librvy fmlicn*. */
dicing.
2 . Pnuniic* definicmns fur ihe CxsX> and 1ST. pipeDrv l). /* Iroafl a ppe driwr. */
V Pnoniy mhenuncc tenure <« oRjm ci pnurity ceitag (eattfe. 1. <* Declare file dscnywt. ♦I
J. Lmui fa number of la«Xi mfdi
E 5. TA't synchroAUion md I PC function*. 3. P Mode refer* 10 the pennhoan in at* NFS (Network Rfe ScrrerL Mate h rev 0 0 for urnurfeial
6. IDE consisting of cd hew. plat form builder. (iUI and trephre* wifiwjr?. permi«tkM. *f
5 •.(Cipher, ikbugp3|! mxI hnsi urpci 'vpprihoA IDI
?. (revue imaging tool and device driven. 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
xxii Walkthrough

Appendix 2:
Select Bibliography

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. Acporuiaj- 9etoa euto^icny
Omi^r*i Txts'. £*«* CUtaJJy. Cce 3>A 19.MpjVwvx.iMte nateAvs^lFx n^cntiog»»^ftiratMei t/ammsgujatl
IMIItaam.May. 8U 20.lup/hraraEETAw.com(Frr rutecnlaAy u a W»l«otMted a>«Km rayUMel.
21 MpjrvwweRcnrWraibedBih |Fk wtaoibuf » • popular eateftW lywem rra^mrat
’.2tat It w»« erMridtol-crranpiiuci cotwelcacr I For wbecrita*( » a pabular cotaddcd cooipuUf lyurm
rtMtopW. Arartrah IMI r^lra. Teykn Bl Froch. 0«. 3B5. 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|
us*, ro
9 mj KmmL 4taf*Drdfa*,
pwY» EdKf^B. $i*«E<L 2003.
C. PRINTED JOURNAL PAPER REFERENCES
Ma*. USA. MM.
■ Huan Ll Knthi RrinasmMm. FruhaH Sheaoy. Rods* A.G«0ri«adH>eD. SwWney. •«<«< Woufrww
11 K. VXL ‘WaiJrffcd te Spw.- Cortpo. Mp Mrffofrjvvf - tat Aral Raw TeaAa M «oMr Roterirr", Jewraai o< Syacna and Snftwwe. K>(1|. 962-971, 20%
fW l/<h» Drvi wrh. 200). 2. C. R. <i«A N. Shnu. K- RawtiMhim. S. MrirwW.'EJIrriwhM nxSttrtnfxAmmuawAfpUcami:
1) 0u^U» Bobftf WtOOVJ CLNfT.UXA. 2OQ3. A .wr Srad>~, Pnx at 11* tE£E Wemarari Goo/erracu oo Enriedfed taJ Tima Coanpding Syarirra lad
CwAtlia. "Dr4«v CnMW fiortwi'', M SAraa. CTR«2)> 2W1 Afele&au" 2006
prwt C V C K.. VUdGv^k Avhab Dm. AAr jkr&iMft 1 Lriv Berre. FtBxkaaai wad Knar. "CWfer Cnaien!frMdri Axotuotrn ttaxnrtj' IEEE Mem. 23r«).
M-». xm
(--o— w. Vajrara. Hitnrs^wr Syaaray. Aral Raw Mariydrtaf*. 4 Wayw Well, Bail Oia BM Tehaa La. "SwvrGracrar or CaaPaaAM Syumu**. IETF Micro. 22(5). 46-35,
2002.
1 tear Lmur Btlrt. 'EtgSadagHartrWCf>-dt»f* tA Wreea-U Pm FFCA>~ /Zryi) Jcamd. gp
prairie Halt 2001 H-n. Saw, law,. 2UO2.
$1MA 8. B«JL W*t4W Jynmr K^i ■brtf Druft, BaflD*vonb 4 Ou-Tiny UM| and Hom hoy 'Or"*B Uoftiat Cndar Cramed MA Caorararad Srrint StoMwy' law
itaam. Nw Mw. USA. 19% (T* Mfa. Mat 9021 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
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|.
I
S.J«. INSTITUTE «F
technology library
BANGALORE - 5iO *60.

Introduction to ACCN. NO.

Embedded System^ i
DATE

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
2. /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,
E 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

Section 1.5
K Examples of applications of embedded systems

I Section 1.6
Designing an embedded system on a VLSI chip
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
Q 3. Field Programmable Gate Array (FPGA) core with single or multiple processor
units on an ASIC chip

Section 1.7
The complex system consists of
0 1. Embedded microprocessors or GPPs in complex systems
2. Embedding ASIPs, microcontrollers. DSPs, media and network processors
e 3. Embedding application-specific system processors (ASSPs)
4. Embedding multiple processors in systems
7 Section 1.8
The design process has
E 1. Challenges in embedded system design
2. Design metrics optimi~ation
C 3. Co-design of hardware and software components

Section 1.9
T The system design formalism is defined

I Section 1.10
The design of embedded hardware and software in an automatic chocolate vending
machine, smart card, digital-camera, mobile phone, mobile computer and robot are
V given as examples

Section 1.11
E
Classification of embedded systems into three types ' 'ir'

S Section 1.12
Skills needed to design an embedded system
Introduction to Embedded Systems
II__3 )।

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.
Itfollows a set ofrules. 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 1 1 1 1 1
Internal RAM at Internal External Flash/ ROM/ Memory
RAM at System- Caches RAM EEPROM PROM Addresses
Micro­ on- at Chip(s) at
controller Chip Microprocessor the System
or [Hold Copies External
Ports
External of System and/or
RAM Memory- ,th Internal
pages]

Fig. 1.4 The various forms of memories in the system


Introduction to Embedded Systems
r~~
13 j
t
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 Storing application programs from where the processor fetches the instruction codes.
or flash 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) Storing the variables during program run and storing the stack. Storing input or output
and RAM for buffer 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, orfor 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 andfor 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.

1 2 Bytes for
■ Address from
2 Bytes for j
Address of I I Where System
Stack J" I Starts
on i Execution on
Power Up
Reset ' ' (Not Needed in
i 80x86,8051,80196,
.. )
Interrupt Service I
Bytes for
Routine Vector . - . i Data as
Addresses of Inputs for each
2 Bytes each I
Interrupt
Bootup ; < Service Routine
Program j-
Codes i

r Machine Specific
I Codes for
•. each
! Program, ISR -
L and Task
Machine Codes;
for Real Time i
Operating f
System (RTOS)j

System ROM
Memory

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.
! 21
Introduction to Embedded Systems
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 .. . ~ ~
Main Function
level language is very simple compared to writing it in ----------------------i--------------------
assembly language. ‘C‘ programs have a feature that Interrupt Routines
Interrupt Service Routines
adds the assembly instructions when using certain Tasks N
Tasks 11....N
processor-specific features and coding for a specific ------------------------------------------
section, for example, a port device driver. Figure 1.7 Kernel
Kernel and and Scheduler
Scheduler
shows the different programming layers in a typical Standard Library
embedded ‘C’ software. These layers are as follows. Functions Including
Network Protocol
(i) Processor Commands, (u) Main Function. Functions
Functions for
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
Receiving Stack
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.

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

Software Tools Application

Cross assembler 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 For source code comprehension, navigation and browsing, editing, debugging, configuring
engineering software (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.

Integrated development This is a development software and hardware environment that consists of simulators with
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

' The locator program output is in the Intel hex Hie or Motorola S-record format.

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.
y- Jis
RTOS is essential in 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 Automatic Data Robot Mobile Adaptive Voice


Tools Chocolate Acquisition Phone Cruise Control Processor
Vending System System with
Machine* String Stability#

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 NR NR NR Yes Yes Yes


software

RTOS Yes MR Yes Yes Yes Yes

Stethoscope NR NR NR Yes Yes Yes

Trace scupe NR NR NR Yes Yes Yes

Integrated development NR Yes Yes Yes Yes Yes


environment

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 Smart Missiles and


I Cards
J,
tg

I I

- Mobile Computing - Banking - Defence


- Mobile Access - Security - Aerospace
- Communication
(a)
Computer Networking Digital Automotive
Systems and Peripherals Consumer
Electronics

- Motor Control System


- Networking Systems -DVDs
- Cruise Control
- Image processing - Set top boxes
- Engine/Body Safety
- Printers - High definition TVs
- Robotics in Assembly Line
- Networks Cards - Digital cameras
- Car Entertainment
- Monitors and Displays
- 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!_ BUSES


;PROCESSORS n
DIGITAL ;
I ASIPs ! CIRCUITS- '
TIMER. ;
——
MUXs.... |
i ,ps :
I DATA ADDRESS ;
I GENERATOR I PORT i
I.... T--------- INTERFACES I
____ L C.-JL ;--------
i PROGRAM
PROGRAM, DMAC
■ ADDRESS 1 DATA
i GENERATOR I AND PORT
MEMORY I INTERRUPT
; CONTROLLER
MULTI­
PROCESSOR I
; DSP I
ANALOG
CIRCUITS,

; gpp :
A/D

FIASH
or E2PROM

H------------------ >
- 15-20% - 60% -20-25%
AREA AREA AREA
L
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 ARM, Texas. Philips, RISC Core with
ARM9/ARM7 from Philips, Samsung and Samsung and ST CISC functionality
ST Microelectronics Microelectronics etc.

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, OMAP1 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.
Other documents randomly have
different content
Shortly after settling in the Hervey Islands Mr. Williams determined to carry
the Gospel to the Navigator's, or Samoan group. Having no ship, he built a
boat, sixty feet long and eighteen feet wide, with the aid of the Raratonga
natives. He wanted a blacksmith's bellows to shape the iron-work, and in
order to make it he killed three of his four goats to obtain their skins. In a
single night his bellows was devoured by the rats, the only quadrupeds
indigenous to the islands, and he then invented a pump by which air could be
forced.
His boat took fifteen weeks for its construction. Its sails were of native
matting, the cordage was of the bark of the hibiscus, the oakum for calking
the seams was made from banana stumps and cocoanut husks, and the
sheaves were of iron-wood. To obtain planks, trees were split with wedges,
and then cut up with hatchets. One anchor was of stone, and another of iron-
wood, and the provisions consisted of pigs, cocoanuts, bananas, and other
tropical products. In this vessel he sailed during the next four years to many
islands of the Pacific, distributing teachers among them, and doing everything
in his power for the good of the people. In 1834 he visited England, and
returned in the missionary ship Camden, which had been purchased by the
London Missionary Society.
Mr. Williams continued his work
until 1839, when he, with a
companion missionary, James
Harris, was murdered by the
natives of the New Hebrides
Islands, whither he had gone
to plant a mission. The stories
of the conversion of the people
of the Tonga, Samoan, and
Feejee groups is only scarcely
less romantic than what has
just been narrated of the
Hervey Isles. In all these
islands, as well as in the
Sandwich and Society groups,
it is probable that the
proportion of the inhabitants
who observe the Sabbath,
attend divine service, and COCOA PALMS IN THE HERVEY
gather in their families for ISLANDS.
morning and evening worship, is greater than among the people of Great
Britain or the United States.
In their inter-tribal wars, which sometimes occur in these days, though far
less frequently than before the advent of the missionaries, all parties abstain
from fighting on Sunday, and men may safely circulate from one hostile camp
to another.
And all this has been accomplished through the self-abnegation of the men
who obeyed the divine injunction, "Go ye into all the world and preach the
Gospel to every creature." Volumes could be written, as volumes have been
written, but even then the whole story of the work and sufferings of the
missionaries in the South Seas would remain untold.
Referring to the opposition of the traders to the missionaries, Doctor Bronson
said that the death of Mr. Williams was due to the conduct of the seamen,
though it was not directly instigated by them.
"One of the products of the Pacific Islands," said the Doctor, "is sandal-wood,
which brings a high price in the Chinese market, and so much has it been
sought in the last fifty or sixty years that on many of the islands it has entirely
disappeared. The sandal-wood traders committed many outrages on the
islands that they visited, and these outrages naturally led to reprisals.
"When Mr. Williams and his friend landed on Erromanga, in the New Hebrides,
a party of warriors rushed upon them from a thicket where they had been
lying concealed. In an instant the missionaries were clubbed, and their bodies
were afterwards roasted and eaten by the savages whom the devoted men
sought to reclaim. Investigation showed that a sandal-wood ship had visited
the island a few weeks before, and her crew had killed several of the natives
who opposed the plunder of their plantations and the destruction of their
trees. Of course the natives were ready to revenge themselves on the first
foreign ship that came there, and this happened to be the one carrying the
missionaries.
"In 1871," continued the Doctor, "the death of Bishop Patteson occurred on
the island of Nukapu in much the same way. The bishop was widely known
and esteemed for his devotion to missionary work in Polynesia, and was
greatly beloved by the natives on all the islands he had visited. Shortly before
his visit to Nukapu a labor-vessel had been there, and carried off many of the
natives against their will. While the natives were thirsting for revenge the
bishop arrived, and, not knowing him, they put him to death, as the natives of
Erromanga had killed Mr. Williams more than thirty years before."
"Please tell us something about the labor-vessels and the labor-trade," said
Frank. "I have read about them, and we heard them mentioned in Tahiti and
Honolulu, and would like to know more about them."
"It is quite a long story," was the reply, "but I'll try to give it to you briefly. You
remember that in the Hawaiian and Society islands it was necessary to import
foreign labor for the plantations, the natives being too indolent, or not
sufficiently numerous, for the wants of the planters. Well, the same state of
affairs prevailed, and still prevails, in the Samoa, Feejee, Tonga, and other
groups, where cotton and sugar plantations have been established, and also
in Queensland, in Australia.
"Well, the demand naturally
led to an effort to supply the
want. Labor-vessels went
among the islands and groups
farther to the west, especially
among the Solomon and New
Hebrides islands, to hire men
to work on the plantations
where they were needed.
"Nearly all of these vessels
were English, either from the
ports of Australia or hailing
from Feejee, Samoa, or Tahiti.
Occasionally an American
captain went into the labor
traffic, and there was now and
NATIVE HOUSES AND CANOE. then a French or German
vessel engaged in it.
"The theory of the business was that men were hired on regular contracts to
work for a period of years (from three to five years) on designated
plantations, for certain stipulated wages, and at the end of the contract they
were to be returned to their homes free of expense to themselves. Every man
was to understand perfectly what was required of him, and nobody was to be
taken except of his own free-will.
"This was the theory and the practice at the outset, but very soon the practice
became far otherwise. Some men were hired on the above plan, more were
hired from their chiefs without being consulted as to their own willingness in
the matter, and a still greater number were kidnapped and sold into slavery."
"Sold into slavery?"
"Yes, exactly that. They were decoyed on board the labor-ships, and when a
sufficient number were there they were bound hand and foot, flung into the
hold, and the ship sailed away with them. They were delivered over to the
planters at so much a head, and very few of them ever found their way back
again to their homes."
"Why, that's just like what we used to read about the African slave-trade,"
said Fred, who had been listening with open-eyed astonishment.
"Quite so," the Doctor answered. "It was the revival of the African slave-trade,
and was carried on under the British flag. And many of the men were taken
into slavery on British soil as they were turned over to the planters of
Queensland, a British colony.
"The matter became so notorious that the attention of the British Government
was called to it, and measures were taken to put an end to the outrages.
Ships of war were sent to the South Pacific to suppress the illegal trade, and
stringent laws were passed to prevent further outrages. At present every
labor-vessel must be licensed for her business, and carry an official who
superintends the making of contracts, and makes sure that every laborer
signs the agreement with his own free-will, and with a full understanding of
the terms of the document. Care is taken with regard to the food and
treatment of the men while on shipboard, and also when at work on the
plantations."
Frank asked what were the means resorted to to obtain men before the
Government took these precautions.
MISSIONARY STATION ON ANEITYUM ISLAND.
"As to that," was the reply, "the tricks and devices were various. The usual
plan was for a ship to anchor near an island, and of course she was soon
surrounded by the natives in their canoes, ready to barter cocoanuts and
other produce for what the white men had to sell. The men were enticed on
board, and when a sufficient number was on the deck a signal was given by
the captain, and the sailors would knock the victims down as rapidly as
possible. Some escaped by jumping overboard, but the rest were secured,
and the ship then proceeded to another island to repeat the process until her
cargo was complete. Then, with her hold packed like that of an African slave-
ship fifty years ago, she steered for Feejee or for Queensland, and the captain
and crew made a handsome profit for their work.
TANNA ISLANDER ON A
QUEENSLAND
PLANTATION.
"After a time the natives became too wary to be enticed on board in the
ordinary way, and then other plans were tried. The Southern Cross, the
mission ship used by Bishop Patteson, was painted white, and the natives
were familiar with its appearance. Accordingly the slavers adopted the
following plan to obtain their living cargoes:
"About the time the bishop was making his rounds a white vessel appeared
and anchored near an island. A boat put off for the shore, and in its stern sat
a black-coated individual with a white neck-tie, green glasses, a book under
his arm which would readily pass for a Bible, and an umbrella over his head.
The cry went around that the bishop had come, and the natives flocked to the
beach to welcome him.
"Instead of the bishop it was a strange missionary, who spoke enough of the
language to make himself understood. He told them that the bishop had had
a fall the day before and broke his leg, and therefore could not come on
shore. He must hurry away to Sydney to see a doctor, and could only stay a
little while at the island, but he wanted to see his friends on board, and would
like some yams and fruit.
"In the course of an hour or so fifty or more canoes are flying over the water
laden with presents for the good bishop. The fruit is passed on board, the
men follow and are admitted two or three at a time, to descend into the
bishop's cabin.
GROUP OF ISLANDERS ON A FEEJEEAN PLANTATION.
"At the foot of the cabin-stairs they are met by half a dozen sailors, who put
pistols to their heads, threaten to kill them if they make the least outcry, tie
their hands, and pass them along into the hold through a hole which has been
cut from the cabin for that purpose. When a batch has been thus disposed of
another is allowed to descend, and in a little while the hold is full; fifty or
more natives have been made prisoners, and meantime the strange
missionary has returned from shore, the canoes are cut adrift or sunk by
dropping pieces of iron into them, and the pretended missionary ship sails
away with a cargo of slaves for the Queensland or Feejee market."
"And was this really done by Englishmen?" one of the youths asked.
"Yes, not only once, but several times," the Doctor answered; "and of the men
thus stolen from their homes very few ever found their way back again. If you
wish more information on this point, read 'Kidnapping in the South Seas,' by
Captain Palmer, and 'The Cruise of the Rosario,' by Captain Markham, both of
the Royal Navy. These gentlemen were sent to cruise in Polynesian waters to
suppress the slave-trade; and though they made several captures, they did
not find themselves supported by the colonial courts. 'In two glaring
instances,' says Captain Markham, 'when slavers were seized and sent to
Sydney for adjudication they were acquitted, and their captors were
themselves condemned in heavy damages for detention and injury done to
those vessels.'

FIRING DOWN THE HATCHWAY.


"A notorious case," continued the Doctor, "was that of the slaver Carl, which
has figured prominently in the newspapers and official documents. This vessel
left Melbourne in June, 1871, for a cruise among the South Sea Islands, with
the object of procuring laborers. Dr. James Patrick Murray was on board as a
passenger and part owner of the vessel, which was commanded by Joseph
Armstrong. They tried to obtain laborers at the New Hebrides Islands by
legitimate methods but failed, and then they resorted unsuccessfully to the
'missionary trick.'
"After this the party captured the natives by upsetting or destroying their
canoes. According to Dr. Murray's account, given on the trial of Armstrong and
one of the crew, the captain and crew used to smash the canoes by dropping
pig-iron or stones into them, and the passengers in their own boat picked the
natives out of the water, sometimes stunning them with clubs or slung-shot if
they were troublesome.
THE "ROSARIO" CHASING A MAN-STEALING
SCHOONER.
"In this way they collected about eighty natives, keeping them in the hold at
night, and allowing them to come on deck during the day. One night there
was a disturbance in the hold, and the natives tore down the bunks, or
sleeping-places, and with the materials thus obtained they attacked the main
hatchway.
"An attempt was made to pacify them but it failed, and then the crew began
firing down the hatchway. The firing lasted about eight hours, being kept up
during the night, one of the men occasionally throwing lights into the hold in
order to enable the others to direct their aim. At daylight all appeared to be
quiet, and so the hatches were opened and those who were alive were invited
to come up. About five came up without help; there were eight or nine
seriously wounded, sixteen badly wounded, and about fifty dead. The dead
and the sixteen badly wounded were immediately thrown overboard; the ship
was out of sight of land at the time, and therefore it was impossible that any
of the wounded could have reached the shore.
"The blood was removed from the hold, all traces of the affair were effaced,
and when the Carl was overhauled by the Rosario shortly afterwards there
was nothing suspicious in her appearance, and she was allowed to proceed on
her voyage.
"The captain and one of the crew were condemned to death, but the
sentence was afterwards commuted to imprisonment. Murray was allowed to
be one of the witnesses for the prosecution, and so escaped punishment.
Others of the party on board said Murray was the ringleader in the whole
business, and that he sang 'Marching through
Georgia' while firing at the poor natives in the hold.
They further said that he selected those who were
the least wounded when the remainder were
thrown overboard, and he used to read prayers to
the crew and then give the order to go and smash
the canoes of the natives."[4]
"And all this happened in 1871," said Frank, "and
was done by Englishmen and under the English
flag!"

A WITNESS FOR THE "Yes," replied the Doctor; "and until the outrages
DEFENCE. became so notorious that the attention of the
civilized world was drawn towards them, many
official Englishmen in the British colonies were very
lukewarm on the subject, and evidently did not wish to impede the progress
of the cotton and sugar industries by interfering with the business of
procuring laborers. Let me give an instance of this:
"Captain Palmer, the predecessor of Captain Markham in command of the
Rosario, seized the schooner Daphne, of forty-eight tons burden, fitted up
exactly like an African slaver, and with one hundred natives on board. They
were entirely naked, had not even mats to sleep on, and the hold of the
schooner resembled a pigpen more than anything else.
"The Daphne had a license to carry fifty native 'passengers,' but it made no
mention of Feejee, where she was seized, and whither she had taken her
cargo for sale. The natives were landed at Levuka, Feejee, and placed under
the care of the British consul, and the Daphne was sent to Sydney for
adjudication. The Chief-justice of New South Wales, Sir Alfred Stephen,
decided in the Daphne's favor in the following words, which I will read from
Captain Palmer's Book, 'Kidnapping in the South Seas:'

"'.... It will not be enough to show that artifice has been used, or even
falsehood told, to induce the natives to enter into the agreements or
contracts mentioned, if they really did enter into the contracts.
"'The morality of the proceeding cannot be taken into consideration in
determining the question raised here. The captor will have substantially
to prove that the natives were going to be passed into a state of real
slavery by those who had taken them on board the Daphne, or were to
be put into a state really amounting to slavery, and in violation of the
agreement and against their will.'

"The Daphne was released, and Captain Palmer was compelled to pay the
expenses of the trial, amounting to nearly $900. This money was afterwards
refunded to him by Her Majesty's Government, which approved his action in
seizing the schooner and placed his name on the list for promotion."
"How do the colonies obtain their laborers at present?" Fred asked.

INDIAN GIRL
HOUSE-SERVANT
IN FEEJEE.
"They get them from the islands in legitimate ways, as I before told you, and
they also import Chinese and Indian coolies. The supply of Polynesian labor is
not equal to the demand, and in the last few years, especially in Feejee, there
has been a large importation of coolies from India. We will learn something
about them when we visit the Feejee Islands."
CHAPTER VI.
THE SAMOAN ISLANDS.—APIA.—ITS POSITION AND PECULIARITIES.—
BEACH-COMBERS.—HISTORY AND ADVENTURES OF SOME OF THEM.—
CHARLEY SAVAGE.—SAMOAN POLITICS.—ATTEMPT TO POISON
MISSIONARIES.—FRENCH CONVENT AND SCHOOLS.—COMMERCE WITH
SAMOA.—VISITING A NATIVE VILLAGE.—GAMES OF THE YOUNG PEOPLE.—
YOUTHS THROWING SPEARS.—MISSION COLLEGE AT MALUA.—HOW THE
STUDENTS LIVE.—PANGO-PANGO.—ADMIRAL WILKES'S DESCRIPTION.—
ATTENDING A SAMOAN PICNIC.—DIFFERENCES OF TASTE.—MASSACRE BAY.
—LA PÉROUSE.—HOW HIS FATE WAS DISCOVERED.—THE SWORD-HILT AT
TUCOPIA.—LOSS OF THE BOUSSOLE AND ASTROLABE.—VANIKORO ISLAND.
The Pera reached the Samoan Islands without mishap, and anchored in the
harbor of Apia. The Samoan group is also known on charts and maps as the
Navigator's Islands; the former name is the native one, while the latter was
bestowed by Bougainville in 1768, who called the group Archipel des
Navigateurs, in consequence of the skill displayed by the natives in managing
their canoes. There are nine inhabited islands in the group, with an area of
about 1125 square miles and a population of something less than forty
thousand.

SAMOAN DOUBLE CANOE.


In general effect our friends found the scenery of Samoa not unlike that of
Tahiti, though the detail was materially different. The harbor of Apia is an
excellent one, affording secure anchorage and safety from all winds; the
captain of the yacht told Frank that there was a finer harbor at Pango-Pango,
in another island, but Apia was the most important commercially. The trading
company that succeeded the German house of Godefroy & Sons, after the
latter's failure, has a large establishment at Apia, and controls a great part of
the business of the islands. The ship-yard of the company was pointed out,
and it needed only a glance to show that it was extensive and well equipped.

CORAL ARCHITECTS IN SAMOAN


WATERS.
Apia consists of a long and rather straggling village, stretched along the shore
of a crescent-shaped bay; like most of these South Sea island ports, it is
concealed by the cocoa palms and other trees peculiar to the tropics, and
many of the houses are so well covered by the verdure that the visitor cannot
make out their position until he is close upon them.
Back of the town, which contains two or three hundred stores and residences,
the horizon is filled with richly green hills, which rise one upon the other to a
height of nearly five thousand feet. Streams come trickling down from these
hills, and there is one water-fall visible from the harbor large enough to make
a well-defined stipple of white against the rich green of the mountains that
surround it. Frank and Fred immediately suggested a walk to the water-fall,
but their enthusiasm was checked by Doctor Bronson, who thought there
would be enough in Apia to amuse them at least for that day.
Hardly was the anchor fixed in the mud before a boat was lowered and the
Pera's party went on shore. Doctor Bronson and the youths proceeded to the
American consulate, while Colonel Bush and Doctor Macalister went to call
upon the representative of their country. After the official formalities were
over they strolled about the town, and in a short time Frank and Fred had
familiarized themselves with a considerable amount of the history of Samoa,
as we have ascertained by a perusal of their journals.

A BEACH-COMBER.
"Apia isn't much of a place," said Frank, "but what it lacks in numbers it
makes up in variety. Among the residents there are Americans, Englishmen,
Germans, French, and several other nationalities, the Germans being most
numerous and controlling the best of the trade. Then there is a fair sprinkling
of men whose nationality is open to question, and whom any respectable
country would not be anxious to claim. Samoa is at present the favorite resort
of the beach-comber; perhaps you don't know what a beach-comber is.
"All through the islands of the Pacific there are men whose history is shrouded
in obscurity, and who are unwilling to tell the truth about themselves, for the
simple reason that the truth would be inconvenient. They are deserters from
ships, runaways from home—perhaps in consequence of crimes for which the
law would like to lay hands on them—outcasts from decent society or society
of any kind, and not at all particular as to how they make a living. They were
more numerous fifty years ago than at present, but there is still a sufficient
number of them for all practical wants of the country. In the days when
England sent its criminal classes to Australia, the South Sea Islands were filled
with escaped convicts and ticket-of-leave men; but that source of supply no
longer abounds, and thereby hangs a tale which may as well be told here as
anywhere else.

GROWTH OF CORAL ON A MOUNTAIN


SLOWLY SUBSIDING.
"The first white settlers of the Feejee Islands was a band of twenty-seven
convicts, who escaped from imprisonment in New South Wales, in 1804, on a
small schooner which they had captured. They landed in Feejee with a few
muskets, and in their encounters with the natives their weapons made them
all-powerful. The natives regarded the muskets as something supernatural,
and if the white men had conducted themselves with intelligence they could
have obtained mastery over the whole population with very little trouble. The
natives were ready to acknowledge them as rulers, and did in fact exalt
several of them to the position of chiefs. But the fellows quarrelled with the
natives and among themselves, and when Commodore Wilkes touched at the
Feejees, in 1840, only two of them were alive.
"These wandering or stationary vagabonds are the men who are called beach-
combers in the parlance of the South Pacific. They are not fond of law and
order, and whenever an island group goes under the control of any European
power the beach-combers are very likely to leave and take up their abode on
islands where the natives are still independent. When the French occupied
Tahiti many beach-combers there fled to Feejee, and when Feejee became an
English colony they departed for Samoa. Samoa is still under the rule of its
own kings, or rather under their misrule, but the probabilities are that it will
soon be in the hands of the Germans. When this happens you may expect an
emigration of beach-combers to the islands, if any remain, where there will be
no legal restraints.

ASS'S EARS, FLORIDA ISLAND.


"The stories of many of these fellows is full of the most startling incidents,
even after making a very liberal deduction for what their imaginations have
added to the facts as they occurred. One of them tells how, when he landed
in Feejee, he was condemned to be baked and served up at a feast; the oven
was being heated for his reception when the chief concluded to keep his prize
a while longer until he could be fattened. The man was released, but he ate
sparingly of the food that was given him, and at the same time ingratiated
himself with the natives, particularly with the chief, by showing him how to
make war successfully upon his enemies. The result was he was saved from
baking, became a man of importance, had fifty wives, and a goodly number of
slaves.
"Another beach-comber named Charley Savage became a man of great
importance, and received the honors that were given to the most exalted
chiefs. He assisted his tribe in making war, and was nearly always successful.
One day, however, his fortune deserted him, as he was killed in a fight, and
his body fell into the hands of his enemies. They cooked and devoured him,
and made his bones into sail needles, which were distributed among the
people in token of the event, and as a remembrance of the victory in which he
was slain.
"It must not be supposed from this reference to cannibalism that the Samoans
practised it. They seem never to have been addicted to devouring their
enemies or anybody else, and in other respects were superior to their
neighbors.
A HOUSE IN THE TONGA ISLANDS.
"Like nearly all these island groups, Samoa has been, from time immemorial,
the scene of almost constant warfare between the tribes inhabiting the
different islands. There are generally two or three claimants to the throne of
Samoa, and the foreign consuls are kept pretty busy adjusting difficulties
growing out of the local wars, and involving the destruction of foreign
property. On two occasions the protectorate of the islands has been offered to
the United States, but it has been declined with thanks. It has also been
offered to England, but thus far has not been accepted, and the indications, at
the time of this writing, are that Samoa will be a German colony before many
months.[5]
"The Samoans have been divided into two great factions, and it has never
been possible for them to come to an agreement that could be kept for any
length of time. Their quarrels have been aided by the scoundrelly white men
just mentioned, and our consul says that if all these bad fellows could be
driven out there might be a chance for peace.
"It was these beach-combers that in the early days of the labors of the
missionaries greatly hindered their work, and in several instances directly
caused their deaths. As an illustration I may mention the death of the first
three English missionaries who went to the Tonga Islands. There was an
escaped English convict living there who persuaded the King that these men
were wizards, and that an epidemic which was then raging had been caused
by them. The King accordingly murdered the good men at the bidding of the
scoundrel.
"When the first missionaries settled in Pango-Pango, in Samoa, some twelve
or fifteen of these beach-combers were living there. These rascals were so
bitterly opposed to the missionaries that they tried to drive them away, and
failing in this laid a plot to poison them. The story is thus told by Rev. Mr.
Murray in his book, 'Forty Years of Mission Work in Polynesia:'

"'The plot was wellnigh carried into execution. The opportunity was to be
embraced when the teakettle was on the fire. Cooking and boiling of
water are carried on in open sheds on the islands. The time fixed upon
for carrying the plan into effect was service afternoon. The lad who
attended to the boiling of the water was accustomed to fill the kettle and
put it upon the fire before going to the service. Hence there was afforded
the opportunity which our enemies sought. We had all gone to the
service, and there was no human eye to watch their movements. The
appointed afternoon happened to be windy, and while the man who had
undertaken to carry the plot into effect was in the act of doing the deed,
another, who had been smitten with remorse, struck his arm and
scattered the poison; they had no means of obtaining more, and so the
attempt failed. The man who was instrumental in saving our lives
remained on the island several years acting as pilot to vessels entering
Pango-Pango harbor, and in 1841 he left in our missionary brig Camden.
It was not from himself that we learned our obligations but from another
white man who lived on the island at the time of the plot, and knew of it
though he had no hand in it. The occurrence led to the breaking up and
scattering of the party of would-be murderers, as they feared the arrival
of a man-of-war, and they could no longer trust one another.'

"The Samoans are a handsome people," continued Frank in his journal, "of a
deep bronze or copper color, and graceful figures. Some of them have
adopted foreign garments; but a good proportion adhere to the native dress,
which consists of fine mats or thick handsome tappa, made from the fibre of
the mulberry or bread-fruit tree. Their tappa is thicker than that of the
Marquesas, but unfortunately the manufacture of it is diminishing year by
year, and in a little while no more will be made. Foreign calicoes are taking its
place, just as in Tahiti and the Marquesas. Of course the foreigners wish a
market for the goods they have to sell, and therefore they encourage the
wearing of garments or materials of European make.
"The most lightly clad Samoans were those that came out in boats when we
lay at anchor and wanted to dive for money. They are excellent swimmers and
divers, and when a piece of silver is thrown into the water they are after it
instantly, and catch it before it reaches the bottom. The best of the divers was
a girl who appeared to be about fifteen years old; when she caught a coin she
held it between her teeth till she rose to the surface, and after taking breath
for half a minute or so was ready for another dive. The performance was
exactly like what we saw at Singapore, Malta, and other ports, where there
are always plenty of natives ready to dive for the coins that passengers throw
over for them. The water is perfectly clear, and though it is fully a hundred
feet deep, every object on the bottom can be seen.

NATIVE TEACHER, UPOLU,


SAMOAN ISLANDS.
"In our stroll about Apia we passed the convent where four French Sisters and
as many Samoan ones have charge of the education of some sixty or more
native girls, many of them the daughters of chiefs or belonging to the high
caste families. As we passed the convent the girls were singing very sweetly,
and we paused to listen; it was easy to imagine that we were passing a
school in Rouen or Dijon, so much was the singing like what one hears in
France. The French Sisters are said to be very much devoted to their work,
and as the Samoans are fond of music they readily receive instruction in
singing. The girls are taught in all the branches customary in schools of this
sort in other parts of the world; sewing and other home duties are not
neglected, and when the pupils leave the school they are in a position to do a
great deal of good among their less accomplished sisters.
"There is a similar school for boys, under the charge of French priests, and
there are Protestant schools in every village. The Catholics have made greater
progress here than in any other of the island groups; they have between
three and four thousand adherents, and among their converts are some of the
most influential men of the islands. The representatives of the London
Missionary Society claim about twenty-five thousand followers, and the
Methodists something more than five thousand, the latter having come into
the field much later than did the London society. Nearly all the adult
population can read and write, and there is scarcely a child ten years old that
cannot read its own language.
"There are groves of cocoanut-trees everywhere, and we were not surprised
to learn that the principal product of the islands is from the cocoa-tree. Ten
thousand tons of copra are shipped every year to the markets of Europe,
where the oil is extracted, and there is besides a large production of
cocoanut-oil in Samoa, which some have estimated as high as two thousand
tons. The Germans have extensive cotton plantations, and there are smaller
plantations belonging to English and American companies and individuals;
coffee and sugar are cultivated, but the culture of these articles has not thus
far been very extensive.

"As at Tahiti and in the other islands, it has been necessary to import laborers
from elsewhere to work the plantations, as the Samoans are not fond of
exerting themselves any more than are those of the Society group. Thus far
most of the laborers have been imported by the Germans, and they come
from all the islands where the German vessels trade. The Polynesian Land
Company and the American Land Company have also made some
importations of the same sort, but up to the present time they have not
equalled the Germans.
"While walking in the outskirts of the town we were thirsty, and asked the
native boy who accompanied us where we could find some water to drink. He
immediately suggested cocoanut-milk, and on our acquiescing he hailed a boy
who was lounging under a cocoanut-tree close by, and said something to him
in Samoan.
"Immediately the second boy took a small piece of rope which had been
twisted out of cocoa fibre, and prepared to ascend one of the trees. By means
of this rope and his hands and feet he went up about as quickly as we could
have ascended a staircase of the same height, and threw down several nuts,
with which we quenched our thirst. Any one who has been in the tropics
knows how refreshing is the milk of the green cocoanut when he is weary and
thirsty.

CRABS EATING COCOANUTS.


"We saw some crabs feeding on cocoanuts, which are about the last thing in
the world you would suppose a crab could eat. Perhaps you'll laugh and be
incredulous, but they really do eat cocoanuts, and get the meat out without
any assistance. Cocoanuts are their principal food, but they do not refuse
other fruits, such as figs, candle-nuts, and nutmegs. This is the way they do
it:
"The crab climbs a tree and pushes down a ripe cocoanut, which is easily
detached, and he shows a great deal of sagacity in selecting only the ripe
nuts. Then he comes down to the ground and tears the husk from the nut,
and he always begins at the end where the eye-holes are. If the tree is a
sloping one, and there are rocks underneath, he climbs up again, carrying the
nut with him, and drops it on a rock, where it will be broken. If the situation is
not favorable for this performance, he digs into the eye-holes until he makes
an entrance sufficiently large to admit his pincers, with which he withdraws
the meat.

A PLANTATION IN THE SOUTH SEA ISLANDS.


"These land-crabs are excellent eating, though they are rather too oily for a
delicate stomach. They live in large holes, which they dig themselves and line
with the fibre torn from the cocoanut shell. They grow to a great size, and
sometimes a single crab will yield a quart of oil. They are distinctively land-
crabs, and the natives say they only use the sea to bathe in. We asked our
guide if all crabs in Samoa are good to eat, and he answered that all land-
crabs were, but the sea ones were doubtful, some of them being poisonous at
certain seasons of the year.
A FAIR WIND.
"We went into some of the native houses, and found them neat and clean.
The roofs of the houses are very high, and supported on low posts; Fred said
there was a great deal of roof and very little wall, and this exactly describes a
Samoan house. The roof is thatched with palm-leaves, and when well and
properly laid will exclude the heaviest rains. The houses have no doors, mats
being suspended at the entrance; the result is, the dogs and chickens may
walk in when they choose, though in many houses the chickens are not
allowed to enter.
"It is the custom to place screens of plaited palm-leaves around the houses at
night, but they are always removed at daylight. In the interior of the houses
screens of cloth are suspended from the roof to divide the space into rooms
where the inmates sleep. The couches are piles of fine mats of cocoa fibre,
and the pillows are simply sticks of bamboo or other wood, on which the
neck, not the head, is rested. It is about as uncomfortable as the Japanese
pillow, which it closely resembles, and is no doubt the cause of the early-rising
habits of the natives.
"All the cooking is done out-of-doors, and there is very little inside the houses
that can be called furniture. In one house we found a group of young people
playing a game which was something like our game of forfeits. They sat in a
circle and spun a cocoanut around on its sharp end; when it fell the person
towards whom the three black eyes pointed was adjudged the loser. When
they are to decide which of them is to do anything, leaving the others free,
the lottery of the cocoanut is used to determine the matter.
"Warfare being more prevalent here in later years than in the Society group,
we found the games of the young men much more vigorous than at Tahiti. We
saw a party of boys playing at totoga, or reed-throwing; they had reeds five
or six feet long, with points of hard wood, and the skill of the game consisted
in making the reeds skim as far as possible along the grass.
"In another spot some young men were throwing spears at the stumps of
trees, and in this game the skill consisted in a youth's ability to force out the
spear of some one else while fixing his own in the stump. They have several
games in which spears and clubs are used, and sometimes they are
accompanied by a good deal of risk. Spears are thrown so as to hit the
ground and then glide upward to the mark, and sometimes a man stands up
armed with only a club and allows half a dozen others to throw their spears at
him in rapid succession. By a dexterous handling of his club he turns the
spears aside, but it is evident that the slightest mistake may have serious
consequences.
"When we came back to the landing-place we thought we would take a ride in
a native boat instead of calling away the boat of the yacht. So we hired an
outrigger canoe, and were quickly paddled to the side of the Pera. These
boats are not by any means new to us, as we have seen them in Ceylon, the
Malay Archipelago, and other parts of the world. The Samoans handle them
with a great deal of skill, and I do not wonder that Bougainville recognized
their ability by calling this group the 'Navigator's Islands.'
"I forgot to say," added Frank, "that we saw
several cases of elephantiasis, which the natives
call fé-fé, and is said to be quite common in all
the islands of the group. The arms and legs of
the victims are swollen to a great size, but,
happily for them, the disease is not attended
with pain. The cause of fé-fé is as unknown as
is that of goitre in Switzerland."
Apia is on the north side of Upolu Island, which
is the most important and the most populous of
the group. It has an area of about three
hundred and thirty-five square miles, and a
population of not far from fifteen thousand, or
more than one-third the entire number of
inhabitants of Samoa. In the middle of the
island is a chain of broken hills sloping towards
the sea, and these hills up to their very tops are
green with verdure. The harbor of Apia is BREAD-FRUIT.
sheltered by a natural breakwater; but, though
the principal seat of commerce, it is not
considered as fine as that of Pango-Pango, on Tutuila Island, whither our
friends proceeded when their inspection of Upolu was completed.
The day after their arrival at Apia they made an excursion to Malua, about
twelve miles distant, to see the college of the London Mission, which is
located at that point. Of this journey Fred wrote as follows:
"We hired a boat with six strong natives to row it, but they didn't have much
to do, as the wind favored us both ways, and the greater part of the distance
we were under sail. The journey seemed a very short one, as we were busy
studying the scenery, which is very pretty and changed every few minutes as
the valleys opened to our gaze and revealed their wonderful richness of
tropical productions. We kept a sharp watch for the college buildings, but
didn't see them until we were quite close to the village.
"The fact is the college is not a huge edifice such as you find in Europe or
America, but a collection of fifty or sixty one-story cottages, which are built
around a large square, with a hall or class-room at one side. In another
respect it is unlike a college in civilized countries, as each student is generally
accompanied by his wife and family; we were told that married men were
preferred to single ones, as the wife and children could be educated at the
same time that the student pursued his studies, and they are useful
afterwards in instructing the women and children in the places to which they
are assigned.
"Every cottage has a garden attached to it, which the student is required to
cultivate sufficiently to support his family. Any surplus stock he raises is sold
and placed to his credit, and nearly all the students feed and clothe their
families out of the proceeds of the garden. The college was founded in 1844
by Doctor G. A. Turner; it has educated more than two thousand teachers and
preachers, and in consequence of the system I have just mentioned is almost
self supporting. There are several thousand cocoanut, bread-fruit, and other
life-supporting trees on the grounds, while the gardens are devoted to taro,
yams, bananas, and similar plants. Here, as elsewhere in the South Pacific,
the banana-plant is very productive, and requires comparatively little labor to
take care of it.
"The rules of the institution are very strict, and any student who repeatedly
disobeys them is requested to make way for some one who will not. The bell
rings at daylight for morning prayers, after which the students go to work in
their gardens or at their trades, or fish in the lagoon in front of the
settlement. At eight o'clock the bell rings again for bath and breakfast, and at
nine it summons the classes for recitation and instruction, which continue until
four in the afternoon. Then more work till sunset, when the bell calls to family
prayer. After this the students study by themselves till nine o'clock, when the
bell tells them to extinguish their lights and go to bed.

WAR CANOE OF THE OLDEN TIME.


"The majority of the students are Samoans; the rest are from all the islands of
the South Pacific, whence they have been sent by the local missionaries. They
study arithmetic, geography, and of course learn to read and write, and
besides these ordinary branches of education they devote considerable time
to the Scriptures and to theology.
"Every Saturday evening there is a prayer-meeting, at which the students
make short exhortations. On Sunday there are three services—morning,
afternoon, and evening; and there are Sunday-schools for the children and
Bible classes for the older folks. On the first Sunday of each month there is a
communion-service, after the manner of churches in England and other
civilized lands. We have not seen anywhere in the Pacific a finer assemblage
of native men and women than the class at this college; they had bright,
intelligent faces, and we were told that they were all so anxious to progress in
their studies that they rarely infringed any of the rules of the institution, the
one most frequently violated being that which required them to stop studying
at nine o'clock and go to bed.
CANOES DRAWN ON SHORE.
"It was getting quite dark when we returned to Apia and found our old
quarters on the yacht. They wanted us to stay all night at the mission school;
but there were so many of us that we thought it best to come back to Apia
lest we might incommode our hosts by thrusting such a large number of
visitors on them at once. You may be sure we slept soundly in our cabins, as
we were all thoroughly tired out with the long but very interesting excursion."
After a few days at Apia the yacht proceeded to Pango-Pango, in Tutuila
Island, a distance of about eighty miles. Under her steam-power she made
the journey in a single day; had she relied on her sails it would have been far
different, as Tutuila lies dead to windward of Upolu, and there are several
currents which add their force to make a passage difficult. Sailing vessels are
often five or six days making this trip, which can be covered in a few hours by
steam.
Our young friends thought they had never seen anywhere a more beautiful
harbor than this; Frank sat down to describe it, and after writing a few lines
said he would abandon the attempt, and fall back upon the account of
Admiral Wilkes, who visited it in 1839. Accordingly he copied the following
from the history of the famous expedition:

"The harbor of Pango-Pango is one of the most singular in all the


Polynesian isles. It is the last point at which one would look for a shelter;
the coast near it is peculiarly rugged, and has no appearance of
indentations, and the entrance being narrow, is not easily observed. Its
shape has been compared to a variety of articles; that which it most
nearly resembles is a retort. It is surrounded on all sides by inaccessible
mural precipices, from eight hundred to one thousand feet in height. The
lower part of these rocks is bare, but they are clothed above with
luxuriant vegetation. So impassable did the rocky barrier appear in all but
two places, that the harbor was likened to the valley of 'Rasselas
'changed to a lake. The harbor is of easy access, and its entrance, which
is about a third of a mile in width, is marked by the Tower Rock and the
Devil's Point."

CAPTAIN JAMES COOK.


"He might have added," said Frank, "that there is a coral reef on each side of
the entrance, with the surf breaking heavily over it, or at any rate it was doing
so at the time we entered. Pango-Pango is a splendid harbor, and could hold a
great many ships. Its principal disadvantage is that the prevailing trade-wind
blows directly into it, so that while a sailing-ship can get in without much
trouble she has a hard time to get out unless she has a steam tow-boat to
help her."
Doctor Bronson told the youths that at one time the King of Samoa proposed
to present the harbor of Pango-Pango, and an area of land surrounding it, to
the United States Government for a coaling and naval station; but as the
acceptance of the proposal would involve political relations that might be
troublesome in future, the offer was practically declined. The commerce of
Pango-Pango is not as important as that of Apia, for the very simple reason
that the island of Tutuila contains only four thousand inhabitants, and their
productive energies are not great. Copra and cocoanut-oil are the principal
articles of export; there are some small plantations devoted to cotton, sugar,
or coffee, but the lack of native laborers and the high cost of imported ones
has kept these industries in a backward state.
The first European vessel to enter this harbor was
the Elizabeth, an English whaler, commanded by
Captain Cuthbert. He gave it the name of Cuthbert
Harbor, but the appellation never adhered to it.
Pango-Pango is its native name, and will probably
be maintained long after Cuthbert is quite forgotten.
The settlement at Pango-Pango was so much like
the one at Apia that we will not risk wearying the
reader with a description. Suffice it to say the yacht
remained two or three days there, and then
proceeded on her voyage in the direction of the
AN AMERICAN Feejee Islands.
RESIDENT.
Before their departure they were invited to attend a
Fa-Samoa party, and the invitation was promptly
accepted. Frank asked what a Fa-Samoa party was.
"You might put it in French," said the American consul, by whom the invitation
was given, "and say a la Samoa, or, to come to plain English, you may render
it 'Samoan fashion.' 'Fa-Samoa,' 'Fa-Feejee,' or 'Fa-Tonga,' mean after the
manner of Samoa, Feejee, or Tonga. It is a convenient feature of the
language, and I can assure you the party will be an enjoyable one."
"The consul was right," said Frank, in telling their experience, "as the party
was a jolly one. It reminded us of the dinner at Tahiti after the native style,
but was more like a picnic than anything else we have at home. In fact it was
a good deal of a picnic, as each person who was invited contributed
something to the supply of eatables for the table, so that those who did not
fancy the native dishes need not go hungry.
"The picnic ground was just outside the town, on a pretty bit of lawn shaded
by grand old bread-fruit and cocoanut trees, and in the midst of a grove of
bananas, which extended on three sides of the lawn and served as a sort of
hedge. Banana-leaves were spread thickly on the grass, and on this lowly
table the edible things were spread, and what do you suppose we had to eat?
"We had sucking-pigs roasted
very much as they are roasted
at home, or folded in taro-
leaves and baked in hot ashes;
the steam from the green
leaves cooks them thoroughly,
so that the joints fall apart at
the merest touch of the knife,
or a slight strain of the fingers.
They gave us pigeons cooked
the same way, and I remark,
by-the-way, that there are
pigeons in the Samoan
Islands, and it is one of the
native pastimes to catch them.
We had several kinds of scale-
fish, some cooked and others
raw, and we had crawfish and
prawns and Samoan oysters; CAVE NEAR THE PICNIC GROUND.
but I'm bound to say I didn't
think much of the oysters when I remembered those of my native land. They
give us a salad made of the young and tender shoots of the cocoa-tree, and
very nice it was, and everywhere we turned there were bananas, oranges,
pineapples, and other tropical fruits.
"The dishes that most attracted our attention were the puddings made of
bananas, bread-fruit, taro, and similar things. The consul told us that each of
the ingredients was beaten fine and baked separately, and then they were all
worked in together and covered with the thick cream from a ripe cocoanut.
Cocoanut-cream is wonderfully rich; when taken by itself it is apt to cloy the
stomach and disturb digestion, but used as a sauce for the puddings it is
delicious; but you must touch it sparingly, as it is full of oil.
"We sat on the ground to partake of the feast, and had a back-ache
afterwards, just as we did in Tahiti. For drink we each had a freshly opened
cocoanut-shell, and we took the cocoa-milk as we would take tea or any other
beverage in civilized lands. There were some cakes made of putrid bread-fruit,
but we did not touch them any more than we did the equally vile-smelling
Limburger cheese which one of our entertainers had brought along. The
bread-fruit is in season for about half the year; the natives store the fruit in
pits lined with banana-leaves, and thus stored the stuff ferments, and soon
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

You might also like