SlideShare a Scribd company logo
Embedded Systems Architecture Programming And
Design 2nd Edition Raj Kamal download
https://ebookbell.com/product/embedded-systems-architecture-
programming-and-design-2nd-edition-raj-kamal-52398932
Explore and download more ebooks at ebookbell.com
Here are some recommended products that we believe you will be
interested in. You can click the link to download.
Embedded Systems Architecture Design And Write Software For Embedded
Devices 2nd Edition 2nd Daniele Lacamera
https://ebookbell.com/product/embedded-systems-architecture-design-
and-write-software-for-embedded-devices-2nd-edition-2nd-daniele-
lacamera-47545404
Embedded Systems Architecture Explore Architectural Concepts Pragmatic
Design Patterns And Best Practices To Produce Robust Systems Lacamera
https://ebookbell.com/product/embedded-systems-architecture-explore-
architectural-concepts-pragmatic-design-patterns-and-best-practices-
to-produce-robust-systems-lacamera-33469636
Embedded Systems Architecture A Comprehensive Guide For Engineers And
Programmers Tammy Noergaard
https://ebookbell.com/product/embedded-systems-architecture-a-
comprehensive-guide-for-engineers-and-programmers-tammy-
noergaard-4409390
Embedded Systems Architecture A Comprehensive Guide For Engineers And
Programmers Tammy Noergaard
https://ebookbell.com/product/embedded-systems-architecture-a-
comprehensive-guide-for-engineers-and-programmers-tammy-
noergaard-4546396
Embedded Systems Architecture For Agile Development A Layersbased
Model 1st Ed Mirtalebi
https://ebookbell.com/product/embedded-systems-architecture-for-agile-
development-a-layersbased-model-1st-ed-mirtalebi-55613936
Embedded Systems Architecture Explore Architectural Concepts Pragmatic
Design Patterns And Best Practices To Produce Robust Systems Daniele
Lacamera
https://ebookbell.com/product/embedded-systems-architecture-explore-
architectural-concepts-pragmatic-design-patterns-and-best-practices-
to-produce-robust-systems-daniele-lacamera-48704164
Embedded Systems Architecture Second Edition 2 Converted Daniele
Lacamera
https://ebookbell.com/product/embedded-systems-architecture-second-
edition-2-converted-daniele-lacamera-55927800
Embedded Systems And Computer Architecture 1st Ed Gr Wilson Auth
https://ebookbell.com/product/embedded-systems-and-computer-
architecture-1st-ed-gr-wilson-auth-4341750
Memory Architecture Exploration For Programmable Embedded Systems
Peter Grun Nikil Dutt Alexandru Nicolau
https://ebookbell.com/product/memory-architecture-exploration-for-
programmable-embedded-systems-peter-grun-nikil-dutt-alexandru-
nicolau-4104508
Embedded Systems Architecture Programming And Design 2nd Edition Raj Kamal
,:.
.·,
,
Embedded
. Sy
stems
Architecture. Programming and Design
Second Edition
Raj Kamal
004.16 KAM
Ill11111IIIIII
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
arulkarand other university academicians. Dr PS Grover (Delhi). Dr HarvinderSingh Saini (Hyderabad), Dr S Radhakrishnan
Srivilliputtur), Dr TV Gopal (Anna University) and Dr KM Mehata (Anna University)—for lheir constant encouragement
nd appreciation of my efforts. I am thankful to the editorial team at McGraw-Hill Education India for their reviews and
.iggestions. I acknowledge my late colleague Dr MK Sahu. Head. Computer Centre of the University, who will miss seeing
iis new edition as he passed away during the last phase of the preparation of this book.
I would also like to thank all (hose reviewers who look out lime to go through rhe script and give me their feedback.
heir names are listed below.
Ramanaryan Reddy
>ept. ofComputer Science and Engineering,
idira Gandhi Institute of Technology, New Delhi
lilima Fulmare
Hindustan College ofScience and Technology. Agra
JikhiJ Kothari
)ept. of Electronics and Communication Engineering,
>haram Sinh Desai Institute of Technology. Gujarat
upriya Kelkar
'umniins Institute of Engineering and Technology,
'nne University
himli Adhikari
>ept. ofElectronics and Communication and Engineering,
'alcutta Institute ofEngineering and Management. Kolkata
Hpankar Ghosh
)ept. of Electronics and Communication Engineering
■engal Institute of Technology. Kolkata
lebashish De
>ept. of Electronics and Communication Engineering.
leghnad Saha Institute of Technology, Kolkata
I
P Kabisatpathy
Dept, of Electronics and Instrumentation Engineering.
College of Engineering and Technology. Bhubaneswar
KK Mohapatra
Dept, ofElectronics.
National Institute of Technology, Rourkela
JK Mendiratta
Dept, ofElectronics and Communication and Engineering.
II. K College of Engineering. Bangalore
Lyla B Das
Dept, of Electronics Engineering,
National Institute of Technology, Calicut
Santa Kumari
Dept, of Electronics and Communication Engineering.
Andhra University. Vishakhapafnafn
V Murlidharan
Dept, of Computer Science and Engineering.
MS Ramaiah Institute of Technology. Bangalore
Josephine P Kumar
Dept, of Computer Science and Engineering.
MV.I College of Engineering. Bangalore
Stanley Johnson
Invensys India Pvt. Ltd., Chennai
Finally, I acknowledge my wife, Sushil Mittal, and my family members—Shalin Mittal. Needhi Mittal. Dr Ami
Londaskar, Dr Shilpi Kondaskar, and Ms Arushi Kondaskar—for lheir immense love, understanding, and support during
le writing of this revised edition.
Contents
Preface to the Second Edition
Preface to the First Edition
1. Introduction to Embedded Systems
1.1 Embedded Systems 3
1.2 Processor Embedded into a System 5
1.3 Embedded Hardware Units and Devices in a System 10
1.4 Embedded Software in a System 19
1.5 Examples of Embedded Systems 27
1.6 Embedded System-on-chip (Soc) and Use of VLSI Circuit Design Technology 29
1.7 Complex Systems Design and Processors 32
1.8 Design Process in Embedded System 37
1.9 Formalization of System Design 42
1. 10 Design Process and Design Examples 43
1.11 Classification of Embedded Systems 52
1.12 Skills Required for an Embedded System Designer 53
2. 8051 and Advanced Processor Architectures, Memory Organization and
Real-world Interfacing
2.1 8051 Architecture 62
2.2 Real World Interfacing 72
2.3 Introduction to Advanced Architectures 84
2.4 Processor and Memory Organization 96
2.5 Instruction-Level Parallelism !04
2.6 Performance Metrics 106
2.7 Memory-Types, Memory-Maps and Addresses 106
2.8 Processor Selection 113
2.9 Memory Selection 118
3, Devices and Communication Buses for Devices Network
3.1 IO Types and Examples 130
3.2 Serial Communication Devices 134
3.3 Parallel Device Pons 143
3.4 Sophisticated Interfacing Features in Device Ports 150
3.5 Wireless Devices 151
3.6 Timer and Counting Devices 152
3.7 Watchdog Timer 157
3.8 Real Time Clock 158
3.9 Networked Embedded Systems 159
3.10 Serial Bus Communication Protocols 160
3.11 Parallel Bus Device Protocols—Parallel Communication
Network Using ISA. PCI, PCI-X and Advanced Buses 166
3.12 Internet Enabled Systems—Network Protocols 170
3.13 Wireless and Mobile System Protocols 175
4. Device Drivers and Interrupts Service Mechanism
4 1 Programmed-I/O Busy-wail Approach without Interrupt Service Mechanism 189
vii
ix
I
128
187
Contents
■ n
xiv j
4.2 ISR Concept 192
4.3 Interrupt Sources 200
4.4 Interrupt Servicing (Handling) Mechanism 203
4.5 Multiple Interrupts 209
4.6 Context and the Periods for Context Switching, Interrupt Latency and Deadline 211
4.7 Classification of Processors Interrupt Service Mechanism from
Context-Saving Angle 217
4.8 Direct Memory Access 2/8
4.9 Device Driver Programming 220
.5. Programming Concepts and Embedded Programming in C, C++ and Java
5.1 Software Programming in Assembly Language (ALP) and in High-Level
Language ‘C’ 235
5.2 C Program Elements: Header and Source Files and Preprocessor Directives 237
5.3 Program Elements: Macros and Functions 239
5.4 Program Elements: Data Types, Data Structures, Modifiers, Statements,
Loops and Pointers 24/
5.5 Object-Oriented Programming 262
5.6 Embedded Programming in C++ 263
5.7 Embedded Programming in Java 264
6. Program Modeling Concepts
6.1 Program Models 274
6.2 DFG Models 277
6.3 State Machine Programming Models for Event-controlled Program Flow 282
6.4 Modeling of Multiprocessor Systems 288
6.5 UML Modelling 295
Interprocess Communication and Synchronization of Processes, Threads and Tasks
7.1 Multiple Processes in an Application 305
7.2 Multiple Threads in an Application 306
7.3 Tasks 308
7.4 Task States 308
7.5 Task and Data 310
7.6 Clear-cut Distinction between Functions, ISRS and Tasks by their Characteristics 311
1 ."7 Concept of Semaphores 314
7.8 Shared Data 326
7.9 Interprocess Communication 330
7.10 Signal Function 332
7.11 Semaphore Functions 334
7.12 Message Queue Functions 335
7.13 Mailbox Functions 337
7.14 Pipe Functions 339
7.15 Socket Functions 34/
7.16 RPC Functions 345
8. Real-Time Operating Systems
8.1 OS Services 351
8.2 Process Management 355
8.3 Timer Functions 356
8.4 Event Functions 358
8.5 Memory Management 359
234
273
303
3S0
Contents
8.6 Device. File and IO Subsystems Management 36!
8.7 Interrupt Routines in RTOS Environment and Handling of Interrupt Source Calls 366
8.8 Real-time Operating Systems 370
8.9 Basic Design Using an RTOS 372
8.10 Rios Task Scheduling Models, Interrupt Latency and Response of the Tasks as
Performance Metrics 385
8.11 OS Security Issues 401
9. Real-time Operating System Programming-I: Microc/OS-11 and VxWorks 406
9.1 Basic Functions and Types of RTOSES 408
9.2 RTOS mCOS-ll 410
9.3 RTOS VxWorks 453
10. Real-time Operating System Programming-ii: Windows CE, OSEK and Real-time
Linux Functions 477
10.1 Windows CE 478
10.2 OSEK 494
10.3 Linux 2.6.x and RTLinux 496
11. Design Examples and Case S’tudies of Program Modeling and Programming
with RTOS-1 511
11.1 Case Study of Embedded System Design and Coding for an Automatic 5/2
Chocolate Vending Machine (ACVM) Using Mucos RTOS
11.2 Case Study of Digital Camera Hardware and Sofware Architecture 531
11.3 Case Study of Coding for Sending Application Layer Byte Streams on a
TCP/IP Network Using RTOS Vxworks 537
12. Design Examples and Case Studies of Program Modeling and Programming with
RTOS-2 566
12.1 Case Study of Communication Between Orchestra Robots 567
12.2 Embedded Systems in Automobile 574
12.3 Case Study of an Embedded System for an Adaptive Cruise Control (ACC)
System in a Car 577
12.4 Case Study of an Embedded System for a Smart Card 593
12.5 Case Study of a Mobile Phone Software for Key Inputs 604
13. Embedded Software Development Process and Tools 618
13.1 Introduction to Embedded Software Development Process and Tools 620
13.2 Host and Target Machines 623
13.3 Linking and Locating Software 626
13.4 Getting Embedded Software into the Target System 630
13.5 Issues in Hardware-Software Design and Co-design 634
14. Testing, Simulation and Debugging Techniques and Tools 648
14.1 Testing on Host Machine 649
14.2 Simulators 650
14.3 Laboratory Tools 653
Appendix I: Roadmapfor Various Coi.'l^e Studies 662
Appendix 2: Select Bibliography 663
Index 668
Embedded Systems Architecture Programming And Design 2nd Edition Raj Kamal
Walkthrough
Introduction to EmtxxJded Snrorru
” 1.1 EMBEDDED SYSTEMS
1.1.1 System
1.1.2 Embedded System
Definition Qtu; of ihcdcllniiiun-. ul tmlxdded nJrm i' j- full..-v
"Art rmbeddrd tjilrnt » u ivMrm 'hut hat indudikd u>)ln>ur u"d i<Kiputcf->u>rd^irc. »liuh muLrs it
Rmtx'dJcd system*. have been defined in hi«>ks puhli'tud :
ufdefinitions from otherv in the Held:
Simple approach with interesting
examples and figures
Simple approach with figures to
explain complex topic of system
on chip for a mobile phone
E^twMcd Systems
•>. Other fcifieaftdmiltif units.
An ciemptiry application >if Mich an embedded Sn(' is die iiu*nlc plmrus Sinele psiRx*-.' pncewirs.
ASYSTEMONCMiP
SIN&.E PURPOSE BUSES
PROCESSORS
OSGiTAi.
asipi cmcuns
. . TWER
IP, MUX,
BtTAADORESS .. -
GENERATOR PORt
INTERFACES
PROGRAM PROGR-M. DUAC
AOORESS data
GENERATOR AN0PORT
UEMORT IN1ERRUPT
COHTROUCR
MUtlt-
PROCESSOR
CBCWTS.
• i5-2tr* -cm -a a%
AREA AREA AREA
i«t. J.}0 ASoCembeddedsyitetnanditscommonbutwithinternalASlPiintcniaiprocesson,
IPl shored memories andperipheral interfaces
A syStem t' 4 *” wnrClllg. organizing or dimly- nW •» male. '.< .1- si'irilnli; In J 11sei. plan, pc.glani.ir
•<t ofrok‘. A spk-inisalw.an MrangeiTk-ni m which all ■!' umis a.w-mHe amt <nrk u-gilbc'according tnthe
plan or prugrani.
Consider a watch, It is a tnne-di-play .y.lcn, Ils pails j>< n. hardware. needles ami hatiery with Ihe
huuliful dial, chassis and strap ffu-n- i*jrn iv Jinn* ttic real nine cicry s<v«Hid and cuntinwwsly
update the lime every second. The system.program updates the display using three needles alterexh second.
Itfutluwio let ofruin. Someoflhc.<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 itneiunutn same position after an hour, (in A shun needle nnatese>cry hour such dial
il returns n> same position after twelve nours tvi All three needles return to the vane inclination alter twelve
hours each day.
Consirfcr a washing machine. It is an automatic clothes-washing system, lie impurunl hardware pans
include its 'Ulus display panel, the switches and dials for u-er-defined programming, a tin.tor to rotate or
spin, its power supply and control unit, an inner water level vow. a solenoid salve tor letting waler in and
another valve fur letting water drain out. /here f^'ti wrguniw to wash clothes autunuticuHy accixding to a
program preset hy a user. The rv.trrny-pr>'errwi rs activated Io wash llK dirty d<dn*s plxcd in a lank, whwh
rotates or spins in preprogrammed steps and stages, fr fulton a ui "f nilrt Suioc of these roles arc as
follows: (il Follow the step* strictly in ihc ii.llm.mg scipn-ricc Step 1. Wash hy .pinning the motor according
to a programmed period. -Step II: Rinse in trcsli waler alter drarmng vol the dirty water, aid rinse a second
lime ifthe system isnutprogrammedin waler-saving nude. Step lit Alter draining imii the watercompletely,
spin the motor fast fora programmed (dud for drying by wniriiugingout waler Irunt ihr clothes. Step IV:
Show the Wash-overstatus 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
Canbe m> rerxniion from Slept unless the u-arr resets the sysigmby in-efting another sc"1' clothesand rc.-els
thr program
xviii Walkthrough
Oswaw^ SysWi Pwyjs’wu^-U C£. O9€K.*« Awr-Tmc Inu .
Summary, keywords and their
definitions, review questions
and practice exercises in each
chapter
Review Questions
f i— . ■ ।
5. ‘5?’’“s' Practice Exercises
Walkthrough xix
_
___>'
'pTCpaMrfrqCcneaptiaM&'«MiMadP'ognMr*qhC.C*« arddeva
1 Aa Java codn are fini interpreted by dieJVMdrum comparatively elowly. Thiadisadvantagecan he
overcomeaafollowa-. Javabyte rode* can heconvenedtoriMsve nwtunecodesftx faw .•jraimg using
jusl-rn-time (JlTJcompilalitm. A Jiva accdoalor teo-pwever) can be used in the system ft* fast
code-run.
X jAvabytncoderthatarcprtendeefresafalargermemory. AncntbedWJavatyOcm mayneedaminimum
CfSI2kB POM and 512 kB RAM becameofthe needto fire tnoalJ 1VM and run the application.
5.7.4 J2ME
(J»eofJ2ME/Java 2 Micro Edition) twJav*Cardc*EmbeddedJavahelpsinreducing the rude luetuK kH
for (he uaual application! likeman card. How? The foUowiogarc the method!
I, Use roteetaacaonly.Claueaftwbalkron-timcenvironment fetmtheVM interns! t'ormai araloMy
(he programmer"* newJavaclauea are not tn internal formal.
X Provideforconfiguring therun-time enviroctrneti. Eaamplcaofconfiguring aredrfetmg rAeesrepnun
haniling clout), mer-defincdcluitloader),fileciautl. AWTclout), rrni'hnmitedthread), thread
groufi. tnoill-dmmtiaularray) and Jong mdflooring data ryptt Ochercwfiguring examples are
adding che specific cluaea—daugnme. input, output and streams fr> connecttons to network when
needed.
3. Create one object at a time when running the multiple threads.
4. Reuse the object! insteadofusing a largernumber ofobjects.
3. Usescalar 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 ofthe use of package. J2ME provides fur the codes
for the core classes only. 'These codes are stored al the ROM of the embedded system, fl provides for two
alltmaiivecoctfiguraliooa.connecteddeviceconfiguration(CDClarsticonrcctcdlimiteddesireconfigurations
rrtno CDCinheritsafewclasses frompackagesforoet.security,io.reflect,sccurity-cea test.leu.resources,
util, jar and zip.CLDCdoes oct provide feethe applets, swt, bears, math, net, rmi. security and *ql and ten
packages hr jiva.lang. There is ■ separate javu.mircoedrtiaa.so package itr CLDC cunfiguration. A PDA
ipenonal digital assistant)or mobile phene uses CDC or CLDC.
There is scaleable OS future inJ2ME. Thereit newvirtual machine. KVM nr analternative 10JVM. When
using the KVM. the system needs a 64 kfi instead of 512 iB run-time environment. KVM features arc as
follows:
1. Useoffollowing 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 thejava bO package farthe exceptions.
3. Ute ofaseparate setofAPIs(applicationprogram interlaces) insteadufJINI. JINI importable. But in
(he embedded system, the ROM hu the application alreadyported and the user does not change it.
4. There is no verificationnf theclasses. KVM presumes the elistc as already validated
t. Thereis m>object finaliUUoii thegarbage collectordoesnorhave tojx-rti*111 InlK-viinwiviigrtungcv
in theobject 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 ofjava.Ung.rcflection, Thus, there are no interfaces that do the object serialization,
debugging and profiling.
Simple way of point-wise
presentation of the details by
using lists and tables
Program ModafctgConcops
Table 6.2 UML Basic Elements
I Mndrllixy
j CM"
Widl dot) itrmitl
are! thtra-'
Class defines the states. aoribum ano tadunt**. A
clau canaltobe aa active or atucract clAv
i Afcvxi
1 Cl-ll!
Object
Active
object
A ciaM ingeneral may he abstract whencitherrarer*
thorn states, operaon* <■ behaviour u eornpieiety
defined, being h anabroadage.or when it is not
fur creating objects but only a class, which c*tend>.
implencau the abstract behaviours (iMthedil and
specifies (he aharam roritues (fields ,* nremo)
that class can creMc theobject.
Aninstanceofadaathate.afunctionalcsaityfumed
by copyingthetula.Stribum and hehavicw from 1
class.
Anactiveclassdefinesw> activecfcjeninsurern(an
active etass. A processor threadh equivalent 10 ite
activeobject inUML becaascactive object poststhe
signals like rhrewl and cart wait before sirring or
rewriting the operationusing the mcdsoA.
Anactiveclassac*>athreadetathathas 1defined
slate, attributes, behaviours and behaviours foe the
signals. Active dsa in addition, define* the -natroi
by signal betevun (for a signalling oi^ct. which
canbepouedandrarwhichitowy wailbeforestarting
or resuming). Thus there is control on rhe class
behaviour.
Etreuilnrv Diutrurrvrviti.'
ftriirr.enluh.a.
Kev'Luigvtar hut uiih dissolves a. dsown
in Figure ft IfX-’l ft* etas ccinic* I.* it. -
identity, attributes and behaviuur. |
(o[ciaiio<l' or mcihudt vr iouIUa-i <w j
1un.-iH*tsi
Rr.tangvlar hot with din.no. for eU.x
names for its identity, alirihutrs and
opetvnns. but with prefit abstract w*b I
each ahorjct behaioiur ami aliirtarc
i
kectangutu bus with ob^ct identity I
follirwcd by wniKohm and class idcnlitv i
as sfs—n in Figure ft Ittifi
Rcvanpita For withitijcfl tienni
followed by scmtrokei amiebss j
identity,lair with prefic «tivc with ■
ibjevt idcniHy. j
Rectangular hoi with thick border lines I
arilinnerUivisiiMH ft* theciaM narr*v !
for the identity,anritxuesand Fehavnwn j
foyuratnXB *id signals), hit with peefis
as-ttvc withetar sdreeily.
I
Signal Anobject,wttidi itkm (postal)frontoneactiveetas
(activeobject)tosaoiherwaiveetas,wpidiuufoe
Man er resumption. Signal obsea tahaviuw tlcfines
the behaviour(operation roahod)ofthe kaspmeeas
eoasmmiatioiL (Signal (Section 4X2) is software
ihslncttm or method (tncuon). which gtaeralea
rmcrruftl Signal object tins attribute* (peatnctcrsl.
ASribute maybejusta flagofI-tit.
Signal identity within two pai**of
iiacungandctaangsigns Ccshswral by
Ctai idcniity (StmitatosttrcoiypeK
Slereo-
IJT*
An Dspacked cofioficn <4 dements (tfritam or
bdHvfrw)tiufB repeatedlytoed.
Rectangularbos withstereotype identity
ttme given ■ifhhIhe iwnpairsof
aurring wadekmirg signsMbvnfbychr
classickwkyasshownin figure 6.lf(r>. |
IGmafi
Walkthrough
c^. SUM of UoMng andProgmmmmg -«n RTOS->
)/• End«/Cotte Cwd^pVyTLmeCtecftmclkm•/
69. r BR coda farpo*Vg■*»<■ farlap U>TM.Cfc<*«y •/
SR_TIneU<tt <>( , _
y.r^f— far crMseg * nvtragrfar<r*and<fa*Cateeach >’»?mtmfl fate1VVMem
KTCfct’f
TO. OBMtaxIVs (MbosTuacD^StrMsg, timcDaac);
71. )7>En>c(13R_TtmeDate euV’l
"11.2 CASE SHIMOF DIGITAL CAMERA HARDWARE ANDSOFWARE
ARCHfTECTURE
TKdigitalOWiwasiiuroduccdearlierinSection l.hl.4.Athgiialeainen issneeam^cidSrX.ISeetteilA I
1.10.4 Ihied tV camera funetkte. hardwwcaruj wdiwwc units. Hjirt' 1.14 4u—rd tWrdwwe
tn) wfiwarccnmfeeicnu in * wnpted>g*al earner*.
Scrtiou 11.2.t oral 11.2-2 gi't iVdcugn Ucyw cd* digital camera. Scslnwv 11 2.-* am) 11 24 dcwnV
hvdware and telware atvfaitciurc.
11.2.1 Requirements
RcquirmeW'ufiVdigital earner* e» he undcruond througha requirtmenttable given m Table II I
nr OruiMfunrtumiiuU* duearner*an aifaOm:
I. A « <9 onurcdlen crnuol Jitdicr. flash. <froexample, for pcnfdtcnh. direct mermuy KCOS. nJ
fote*r. neo facts and eye-ball image control. GUI consist* of the IXD display tor graphics. and
<wils-ViandIwueassf« inputs al camera. A liaahxrcen n amaher ahemaurc!•»VXD an)keypad.
TV user give* commands for twitching on the omen. Huh. diuricr, adyvrl brightness. couth.
s-ulnr.tare nJ transfer.Thet»crcnmmaruKvc in thehemoftruerropr ogaah.Eachsagnalgroerate*
farm aute inpul fromant^craiedtwitchorburton. Uhen a bunucr(oropeningthedwuern prewol.
a Ilash lanq) ghros and a self*timercircuitswitcVv offthe lamp aulcenalicaJIy.
2. IV (Vrarc generate light, which fill, m tV CCD array, which through an ADC tranuraw the bib
far eachpitetineach row in the frame, and alsofor1Vdark area pitch ineachrow in a veriKsl scrip
lie nflri cwrcctirm in CCDsignaledlight intensities far nit row. IV srnp t*m adjacentframe
3. A pkswvcrwvriHedanumberofpilets. TV numberofprset'usedfir:pcturedeterminesffwilroiiuL
f*Kpicture sirtsoasof a number oThcrnnmlaJ and tenical pitch. Fur 2592 < 1944 (wtcKthereare
2592 * 1*44 s SO.'KMK arts cdcelts. i-Vti *ct of pixel hat three cells. fir the red. erren and blue
nimprnuin J piacf. EachcellgetsespuaedIoa picture when tV shutter ufcanwruiysensim amet
command. 7he »anrro ffrnrds rtepictures ironga rtarge-tiwipWdesires iCCDramy 0>r array
crourtsefa UrgerutrnberofCCD cells. throe ateachpitch J
L
T.
a
/
K
C,
o
■J
'£
c
T
/
‘1/
Mx mt/ fruMrmAardtLJ m/rmi dr»iffi th?thtrr•i/’e* ihm/iuM */lt4 in t*wi
t*toi/M«*fuW(ovrm rWw<rrkipwr 7V/i • uir i(mJ* tv1iAnouttRaniif<Avriita'*
rr^tfMliufXCVM/!■AteA»H' rJaj•h/nn tn*r I.Hl2 /A/ •-^<
it^fh ittifmilmrn«it«'rJru'br<iA ) V)4 <*'4
*/ fcAiiA rvi tWAJtHfiicii'hr' ia < //
/V ubftxD.n lAf»* itJw urr Ut i
t !•* irvn» hrv ti* irf44 ijirrm uzr
liilftL
2. Ta At* UHl. n wi/ u> iV^rnx*it-f/Ar ijifr***.
J. Tit {ett'n fo defint htrdtrtft m/i tttprt’cri u>t •••
7i>AumA*ki(Afbv*^Arwjhiw*rAiQcWrA fv r<rrv/w* tumid*•
platedrfUmi *Ar ia^*ufT i*ru
<7«iyK«KHJ>, /VTItftTfrM «/M^AaKr
1 T<t feat* lading fur d/ttin impUfnfnialion un^r A/VCVZY u*/ VrUti/li
#T7V.V’. dlx« /V uif r/ tT( f,u fiu* ivniAa*<«/iin uaJ < w'rrn;
*11.1 CASE STUDY OF EMBEDDED SYSTEM DESIGN AND
COOING FOR AN AC/TOMATfC CHOCO1ATE
VENDING MACHINE |ACVM) USING MUCOS RTOS
ACVM wi* 1arodueerfcaiIiftNafiwn I H>,2. h ACVm fafKlic*'.hMJwjre
i/xlWiwdc unib. Fipjfc t.U *1**01 j diagrarrunjcic ripvtxflLiui«nH ACVM
SechnM JI I.Mo IIJ.AgivethedeMgnan AC'VM. V.2ik'wnt'cd
MUCOS StTOS. It ta a portable. ROMabk. scabbte. proemfioe. real nn« jai!
multiuskififkemeLSection 11.J.?4ncnhe* Gm AC'VM tohin^MUCtA**KHAS
(Scctiw 9.2) propimrung envmmmrnl.
11.1.1 Requirements
TIk crifui/ttwntt td dtf mo;hinr rm he uMentm«J lhAAigh j rrquftc/ncTM IjNc
pun in Table N.I.
11.1.2 Specifications
The ACVMspccircAik*i in briefarc v Jullu»>.
1. Ct h<s an ulfd^nunffie keypad <w» iftc l"p the flixhi/w TJol cnjhte* J
chihJtoimencl»rth11whenboviacarbwciParr The«r»nerc.m Jw*cy*iimji-1
jnJ <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. •!
ApplSirw SmanOStiiwiypi <rruwnUp,< DfSi.
5mirtU$Ql*ud (MtgQSun. AfT*Su>;
49. !• gaum Ddlyed uA uA.PW. •/
SmanOSTiincDlyRcura: (Lni.PWPmmijrp
//•Eid ofWhilekxf’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 ofAPI* 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-VfanLi^ta-ExcH. awe-pad frv mono*, portd-ri'f., -Irk <bow andcamera.
Meiile phurw witha large icudbem 0fe a vsloal keypad Mrtile pKxw witha -mall wrecn u*e* T9
keypad.TVpreirffcasestudyrelatein'SALScreacapplkatirti' bia ombilepfame wiipT9 keypsd farinput*
Section 115.1 gives tV icquiranrautd SUS create and *cnd applii-ainwi'. Sectuut 12-5.2 give* thr
ulusesandclxa diagrams. SccuM IISJgives tV abac diagram art! Scttam 12.5.4 gives cnminjmeaiiun
hardwn. SerJon 1155 describes wfrwoeachVdure. Section 12 5.6 ck-w-nN-t the bnfiwnre lash, ud
Syacteuriuiiun Afodclforrhe atgAotm
12.5.1 Requirements
Apmcoaor.keypad,acieea.snxlchpadnrestery,penbleace rnemLCyandcreiimunicationunit*arc required
heSMSocaeandoutappUcajraxScnucbpdaiaooryadihtMSorusedfuricntpnrarysavingofchmcieet
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 afterlhe pow ewiictes off. Further, when tVn. is a change there, an
idenCaidtangcisrefleoedino/Vrcnrreiasedcbjeca.Forexample,a rtuncholueuina (V fietVCwcts.
de<me dtmgclaftcsin thefile forMhosboot forndiiig tVe-onils.
figure IUDshowsspeeife MS.whichMtBwdfortV SMS factnaeappUcataui.TV smen ismedfor
(EflttayttgiVnsmLHgweIUDdtowsthadiacoefourCErux5cys(up.diwiLleft aMn^uldeixnedby ri.
Cl Cland C4.Inoaugaiterkeybad. fear(Sifcreeaemerkeysaremed.TV mobilena»rkeyin tVkcy^J
i-jradilhait fti’rtS.nsasfocxkeys Whenthetcyis(msad towardsdie left iVinnurmmea left foLuta
'.rmgvcndtti.'' a»thetightdieeunwrwncsngbat-sk.aadseenfori^,Tyro drum<11
la edditkr. there are fmrcommand keys(righKomersccoodupw. kfi<omcr Kturxl-row. rigli-cnmer
firU-rowand left-eonerTintmwldeaaedbykeyULowLkcyiRowlkcylRnwl atrikeyIRtiwI.Also,there
arr. mne TVkeys faroumben I to 9 b wtf!a foralphabetsa to a.(« A io Z>. TVre we iwo modr-keys
ftcyMI andkcyM2)andonekeyOkeyfarbyi^inantcharacteroianVrQnr yxav. A)/tcavn>cnc>cnio
mallcase or eapiul case is controlled by amode-key'sstate. Teucharacw entered tn keying dependson
Alate ofdie TV key.|Recall Rumples 5.6 and 6J andSectfon 63|. .
Walkthrough xxi
ErrMdod Sr»*™
4
'£
A
K
K
I
Q
o
E
c
-r
i
E
5
K* B'jJf /mm iht f'JL^ing j/i rAn ,ipkf.
fu Bu.<k ftinchotu andnpti vffTOSti
hi' XTPX pCOS-lt ai MUCOX «n fht lent thrvugh iff riMwipffr—
tMtinplf1V.I m 920. WAararymi*iUj artpaiwrfuafirfeMnJwJanminted
fttr rtii h <0V/i MUCO31 finiftw* •ill 6r cj^w«A Itartin* *ht m<v «/
in rV AWCOJij tMp'fcvv/«ra remit• tvtn t]onaAtr UFOSit
urdUtttf Jhit-diAr/pf/r«jrfvmwUrritum&AffrijJhmcW- and
mhrddrdJtfTAVi lairt <m.
ran k'rHo/Lj fuim Wtnd Hiivr* Stitmi m ofiff an HTOS far »^ph/ifiiand
tfdmMrJ irifi'MJ vi/A fuivttfal tuyl loppy*• thniugh irnn tuirtplct^
Ktamplfi 9.21 *•• 9.27. bifffnnftx brtntrt <Ar ftHart1 irm*tpAarrt
wwiJfestti u</4*/wi irirt ftQVdtvAai ofMUCOS ndlht •"•litfltof
O»pw K* •rffdrxfr&tlAc Hv>fowt Ct OSfiX reirf-f*mrfjftufflTfa/uui.
5.1 BASK FUNCTIONS AND TYPES OF RTOSes
A rumple* rnd'jtt*tirt£ embedded QUem detigfi re/juicc* (he dcvelapmcm of
thwwghly tcUeJhupfree cafe* fa
l. JAtegnacd devtJapmeft efivinmment
2 Tuk furwiiixnin emhakfcdC «emtakferf C**
V Rcif-tinv ckxk-bwed hiftjwwt ind mftwireumen
a. Scheduler
V (Tevet driven «nd devicemiMger
6 Funetn«> f« [HTj vtiftg the vgMh. event (U< fnwp. wmiptvrr-hiftUmg
fuHciiofti »d function* for the queue*, m*ilbu*fcvpipe ind wekeb.
7 AddiUauJ (qm'mjim. fur cutapte*TCMPof US8or RlwUjOth*a WIKof
IfDAMdGUh.
R Fjra md exception htftdtuig function.
v. (ruingand5,ucmdehuggirywrffwirtforIcwagRTOS a%«e11a<devchpcrf
embedded 4ppliCJ»f*,
9.UuJ shows the tag fumu*m* cipcttcd from the kmd of an RTOS.
The RTDS'% hi«c the fdJowing future* in genenl.
1 Ic/tkI fuiw'iiouand ichcduling.*preemptive e» pre-cmRrtcpluslime
dicing.
2 . Pnuniic* definicmns fur ihe CxsX> and 1ST.
V Pnoniy mhenuncctenure <«oRjm ci pnurity ceitag (eattfe.
J. Lmui fanumber of la«Xi
5. TA't synchroAUion md IPC function*.
6. IDE consisting of cdhew. platform builder. (iUI and trephre* wifiwjr?.
•.(Cipher, ikbugp3|! mxI hnsi urpci 'vpprihoA
?. (revue imaging tool and devicedriven.
(( f7iw*c /Y/SfX*(prwt f«qp<i_ini fvflnl*»n utrng lhe HJSf.Viparom tfr Tufbrw'ngs
<<I The tufKinAi R«d*«LMiU^ i ««cuu«t«<ethe Vt.Wiek*.Idwwy*ufcvwMiuwv(the KWX<>«w*
rhj DrfurKtun,^ i<w«rr. na^ vhner wlinkl JMUUuc.ck^andrmivcj.mdm*cw
tel DrftfAaamn^.wuHi i / the ailnbvicid*a RISIX speoc.
Ml 1he funciaau osteal < । mJ «fn_ftxi*e() unloAand M •<f«w.
IcJ The fiwitiqn<i_iUjty I t ugMh<oa tinglewarling ti'Alh*ihctma^e<* av«UMe The
mKv '*•<'* fcv a tab.whichha»hemtegrtrfedfaammTraik* IfegiUcrcd*ican*
Jaitfot ukctocMcUihcna^nutifyj.Thi* prwranineMfO^fymefo/fuowrvertuk. A *er>cr
tartKvcivertirm^iicatuMifroma drnt t*dc thruiighaMgndhaaikr fiuKtk* (like an JKKi
Hl lie fofeinm Ifrtfktct ihr aiuitarteirfaPDSLC (ftroc
fgt The rt)M .jane n^unlhik I 1net drun^Ac<f«wimrAhatcly hut petent*
the<nhc«U«Uln«rung the ifurnc l>ripeur»dl gsdouuyvd urdyifthe 11M usk cfane* ebe
ipcw.Jkak.iy iw b> dC'JtUxak* Ur nr'ruxy iMnriwd »ilhqmc IXB.
VcWitfU 4><vcbw»etJcrAfaanal hjhuwtng fnii/tc* djTiotcwieficwnamhe u<d. liilTwu
I-11-0 mdJok h«queue* bom hymultipleia*L* RfSIXqumaahavetheakiicavial firfh/wjag (e•kirr
U4 ft41freJKm mt**ea single *stu*g ttfk is ivaiUMe IftJthereOnbe U pri<rityk*d» in place
or imc|Wumly iocH.'KGfXTft VcWiniL
12. CVruAKfat*r»r drmcf»onuJ.+nir or //*Ck Wh0 a Uak oukx a tskJDalkKUto tScctnm 93.il.
When OMOg the uU<eUtorf fmtfiom. the nunAcr tailiidca Uak ideAtfy.Sranlariy. a prpefSaiiim 7.14i<m
mAidtSci.v*i 7 I$rim GteIStxdmX.6.?Iwhencruiei.afitedocrif*r<fetaurudUK m cmalmdanuntfrr.
Ge cample, id n xuigrrdmideveify Ac devcccroud. Tte numbs*h rnwgixd iffciclaHiimeg jxi rd Jr
numhen abpnJy aJkratrd Whe» mwij: Ac deviedreltfalImdiiMb. Aenmotierfarilitifca thedr*ice
The devuTfmrtMesampln arcvfen iv rodorwriteorgd Ufibur9vet9afifttucck“c tSnm<i X 61
A pqrit.VaWicts h i HFO^w. wbuch i* managed <MbyquortfCAnO/tn*Nit by the dc«icc4n«er
funutiiau. VtWud* ha* maoagcmlfuncucmf*M a pvpc-drHd(likeadeviceAixcrjpqw*/n*.Thi*11 analifiaA
l‘»ihe namedppedriwrmUwi. fipe*ahn in^Jcfncnttheunafrro.tjrmdiMtanauwtoftok.*.
FufKijiwi pipel'eiCfcaiC i’/jnp«//wprXo**r*. muuMki. maukfj/llytr/i crraici a pipe device named
ptfnHaon farmuinaim«toi*i<7mcMps E*h mageoa he ofni&Ktnis) ua Artec It cnicr*
ir.ma Iin uftk»ice*«mcrerfxuudev*f 1 fuiKtwnretrieve*th:1n(ofdevrfts withthede«uTnumbrrallftied
id Meh device including|wpcdencr*
Curuadu m cumplc (« crcAog a pipe namedupiprUurinfo.Aswnre itaa*1cachave a rottnfesn tX
fnurtncuagev i&crname. po**«d. ictephunc number and c-ruaitID.tadi the< cuO b: of a nuAimum
m/c of J2 byto iMify A gkXmi variablefJ»» an integer number farJfile docripfer that tdetuifeta (k*u*e
anmng a ninahcrof de»K^ at die IO *yucm. 77k ik*k*e can te a fife ur ppe or wekcl nr>*her dote.
K*ample V 26 ctpCam*Jk mde*torcreating. »*riimg and reading.
Example 9.26
I. * include Vedjh.h"P Indiofe du [0 librvy fmlicn*. */
pipeDrv l)./* Iroafl a ppe driwr. */
1.<* Declarefiledscnywt.♦I
mfdi
3. P Moderefer* 10 the pennhoan inat* NFS (Network RfeScrrerL Mate h rev 00 for urnurfeial
permi«tkM. *f
IDI
4.7*Create pipeMmeJ a* pipeUicftnfo forJ menagecart )2 bytamaairaa */
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 nrtpermitcreationand deletion ol t^vls durinp run. l*Aienxii>ndefines
exh (1st<>fdifferentpriorityand activatesiiotfyinc taihecvdo. iMlcnsiim imi um; n>es<apequeues»1
vies semaphores as event flaponly with no askhavmp rvo-time deletion <T crvjlinn ofilr'C.
|" OSEhMKAoiMcit............
i (Throestandards: MOPISTARC,Carrarwiotai slackand NetworkManagement)
i'S "•
i EOfcientdesignol , ■
. artMMtm' The ..
■ hinttie.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 -------------- ------ -
SMfleadondoesnotprascraierrotems-naonavertsandVws provisiono>aMoUrtn
independencewinregards to MMdualbgrtomenMenand&wrieithe pcxtaWey and
* resMMy apflicatenwAeare
I EHtenee the perfarmenca doveraltjean<Mo<k*pMngaddKondhardwaredueIo
I eoqkancad utBDtimcdthek*Ag«we(«Mngrensna)tMAutodin (he vehicle
I*Verfcation dfiesOonattyand Inqdemeraadon <•IsuUjpesn aalacledpantprefects
I__________________________ _
______ ______
Fig. J0.2 OSfKbasicftatures
Walkthrough
xxii
Omi^r*i Txts'. £*«* CUtaJJy.Cce 3>A
IMIItaam.May. 8U
rtMtopW. ArartrahIMI r^lra.TeyknBlFroch.0«. 3B5.
Ma*. USA.MM.
1)
9 mjKmmL
pwY» EdKf^B. $i*«E<L 2003.
11 K.VXL‘WaiJrffcd teSpw.-Cortpo.MpMrffofrjvvf-
fW l/<h» Drviwrh. 200).
0u^U» Bobftf WtOOVJCLNfT.UXA. 2OQ3.
CwAtlia."Dr4«v CnMWfiortwi'', M SAraa. CTR«2)>2W1
prwtC V CK..VUdGv^k AvhabDm.AAr jkr&iMft
A. PRINTED BOOKS
I. GrWwnFto<liF»B’ll9ten«mJ Mm KaA*.vLm«AjfiianttDr AMa^>OaGvaA
Fut^tSeixtanF^icliMSyriraA Uriah an".Springer, Mor.2006.
prairie Halt2001
$1MA 8. B«JL W*t4W Jynmr K^i ■brtf Druft, BaflD*vonb
itaam. Nw Mw. USA. 19%(T* Mfa. Mat 9021
Appendix 2:
Select Bibliography
us*,ro
4taf*Drdfa*,
(--o— w. Vajrara. Hitnrs^wr Syaaray. Aral Raw Mariydrtaf*.
Acporuiaj- 9etoa euto^icny
19. MpjVwvx.iMte nateAvs^lFx n^cntiog»»^ftiratMeit/ammsgujatl
20. lup/hraraEETAw.com(Frr rutecnlaAy ua W»l«otMted a>«KmrayUMel.
21 MpjrvwweRcnrWraibedBih |Fk wtaoibuf»• populareateftW lywem rra^mrat
’.2 tatIt w»«erMridtol-crranpiiucicotwelcacr IFor wbecrita*( » a pabular cotaddcd cooipuUf lyurm
maywraj
2) Mp/AraafomBModdmtA ppdareoMdriri ry*a ■%!
21 KiqrWaaaaa«wrt^oiaxizri IA pofarls world "ifcradBfCkvadiacm wt^Hc isdaily de Lcy-ttnni
m «*riawi M<f«n|
C. PRINTED JOURNAL PAPER REFERENCES
■ HuanLl KnthiRrinasmMm.FruhaHSheaoy. Rods*A.G«0ri«adH>eD.SwWney.•«<«<Woufrww
tat AralRawTeaAa M «oMrRoterirr", Jewraaio<SyacnaandSnftwwe.K>(1|. 962-971, 20%
2. C.R.<i«AN. Shnu. K-RawtiMhim.S.MrirwW.'EJIrriwhMnxSttrtnfxAmmuawAfpUcami:
A .wr Srad>~, Pnx at 11* tE£E WemarariGoo/erracu oo EnriedfedtaJ Tima Coanpding Syarirra lad
Afele&au" 2006
1 LrivBerre. FtBxkaaaiwad Knar. "CWfer Cnaien!frMdriAxotuotrn ttaxnrtj' IEEE Mem. 23r«).
M-». xm
4 Wayw Well, Bail Oia BM Tehaa La. "SwvrGracrar orCaaPaaAMSyumu**. IETF Micro. 22(5).46-35,
2002.
1 tearLmur Btlrt. 'EtgSadagHartrWCf>-dt»f*tA Wreea-UPm FFCA>~ /Zryi) Jcamd. gp
H-n. Saw,law,. 2UO2.
4 Ou-Tiny UM| and Hom hoy 'Or"*B UoftiatCndar CramedMA Caorararad Srrint StoMwy' law
Vehicle SyumaDyrunucr. Jl.fV- Jll-JJO. 1909.
7. Tldad Mmu, */*arriAru /*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,raadMv<eraw‘">-*-^'*wv'(,'^sT*n’raidHo^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^-«mO-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 CunjAiirmN.>. Vta Ncawri.RcmhcJd.Nc» Tert,
USA. 19%
M fticrS|axi..Ar«nAvn<ra*r rnAnrd,.- y*r4W2Z. l^EdW. fttnurcHoS. fi^mrandCldTAW. IOC*
39 FrrJ liilull. Ajiu C'lramaocuiwn C'ravulrryrmniic ami Oyra S.urau. 4i>i ESaxa. tancr Edvuuoa.
1996ilowth (ndon Rrynra. XDIi
90 Sdhcnchauend PR Calvin. OprnirMy Srarrai, Addrwai WWe*. Rearimy.MA. USA. 19%
VI. frier.MaramJrl. x*J GcalCamrai. t'nlrCratKa^tt FxtMti fr.rirri, Ahram AcademeniWicticn.
lux. Id*.*}.
92 Oanicl Tahah.AdranrrdArn'mpmrrairai.McGrsv.HiH, L'SA 199$.
9J. Gajcl.. Daeul 0 . Frus Vahrt. Sxnj.r SaijAand lieGraf.Spr.dL'oramandUrain KmArddrrf.9.irrau,
Enykwrod C'-IK NJ. Proiiee Hall. 1991
94. FranUinG. F. I I) fratII aaJ A. EAami-Nerai. frrdharl Cmi*Wrfthu&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. WilierI Grmdiam and TTrauiI-Vincera.MadrraGovralSyurwU-AAaluir<iAdUrvtra.Mo Wiley. 1901
47. Him, K. I andDanielTrial.Mmv.mmdfrn—*»r*o«r»ra iS4*o«mM/Adri«HMwif,McCmir-JIrU.
im.
%. JaaaGoouk.AriyPn.inxM>Me CnArdMSruew AndnacUSA. 1942.
99 GiemnddC. D, DwrjWCll Minra-mditr. Sanden Colkje PoUiahiat. 1991.
I®. Arina >. tt^Dtug* niiAA4rimrc»MAdkfldwJAGrnirT^rawm.TAcGraw Udl. 190.
B. WEBSITE REFERENCES
I
1. MrpVAra*abpvina<e.’i.CTn IFnrTeliai.jmnirim DSP Pwcuo.Secwn lie, 136)
2. teipJhravncnmrfcaodrandaa (FarSedrie IA|.
3. MipyfrrivjuairdicMeiei/ukMiedaleVvmTJain and anodjuni (ForScetina 2J3|.
4 InpJfmwjmaoISrnieo13J,Ftr ARM froesm).
3. bepJAn<xjLeoaAcAkici/lnhccttA2«racL,appApa»6MaJrtrt IFor Scam 2-16(
6. hBpZMnrxaibcor| IRartemteunlajrf|aifonuancea ti mdaatfrii Syacsa,Seaana2.6and 133.3],
7. hspJ/aww.jarajriiLCDcn.'fTOiiea/ja»«c«rd (ForSca™ 3.73).
<. tajrZArriw.nebc9edaxr»WrERW7<<cifiu»lin6_«rncnM>"IFa SBia 2 tl.
9. hip-jTw».nnx«n |ForSB%i9.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 (ForSecta IlJI.
14. tapJAraw.taBXoml-jjJanitariniiMttai jFcTluwiM “MBLSeco* till
13. IS^®c/2mmAteuxftteeAn|/taoriAVnMlira (For MIDI imafice. Seem 12.11
16. tapvKra*j(iiner(.ot (furSeaioa IZiwdbtGiiddiaettar<br VicofAcCLoefeafc sMeetataad
SoftwaretfM1SRA(MastbdaoySrfwereRriiabiliiy AiwriMimH.
17. bap^ArwwaacarcKtaxcira'ieraayscTni/icarrLhon (Fee Secta ll4l
IS. bspcffirwwftoavdJataeccnd-alind^^^erVusaRCardScarityZ(For Seetioo |14|.
Embedded System^ i
S.J«. INSTITUTE «F
technology library
BANGALORE - 5iO *60.
ACCN. NO.
DATE
Introduction to
£
E
2.
Section 1. 1
Definitions of system and embedded system
Section 1. 2
The processing unit ofan 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 ofan embedded system consists of
I. An embedded system power source with controlled power­
dissipation
/I clock oscillator circuit andclocking unit that letsa processor
execute instructions
Timers and a real time clock (RTC)for various timing needs
ofthe system
Reset circuit and watchdog timer
System and external memories
System input output (10) ports, serial, parallel and wireless
communication, serial UniversalAsynchronous Receiverand
Transmitter (UART) and other port protocols and buses
7. Devices such as Digital to Analog Converter (DAC) using
Pulse Width Modulation (PWM), Analog to Digital Converter
(ADC), Light Emitting Diode (LED) and Liquid Crystal
Display (LCD) units, keypad and keyboard, touch screen,
pulse dialer, modem and transceiver
8. Multiplexers, demultiplexers, decoderfor interfacing ofthe
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 toolsfor system design
K Section 1.5
Examples of applications ofembedded systems
I Section 1.6
Designing an embedded system on a VLSI chip
Q
I. Embedded SoC (System on Chip) and examples of its applications
2. Uses ofApplication Specific Instruction Set Processor (ASIP) and Intellectual
Property (IP) core
3. Field Programmable Gate Array (FPGA) core with single or multiple processor
units on an ASIC chip
Section 1.7
0 The complex system consists of
1. Embedded microprocessors or GPPs in complex systems
e 2. Embedding ASIPs, microcontrollers. DSPs, media and network processors
3. Embedding application-specific system processors (ASSPs)
7
4. Embedding multiple processors in systems
Section 1.8
E
The design process has
1. Challenges in embedded system design
C
2. Design metrics optimi~ation
3. Co-design of hardware and software components
T
Section 1.9
The system design formalism is defined
I Section 1.10
The design of embedded hardware and software in an automatic chocolate vending
V machine, smart card, digital-camera, mobile phone, mobile computer and robot are
given as examples
E Section 1.11
Classification of embedded systems into three types ' 'ir'
S Section 1.12
Skills needed to design an embedded system
Introduction to Embedded Systems
I 3 ।
I__ )
1.1 EMBEDDED SYSTEMS
1.1.1 System
A system is a way of working, organizing or doing one or many tasks according to a fixed plan, program, or
set of rules. A system is also an arrangement in which all its units assemble and work together according to the
plan or program.
Consider a watch. It is a time-display system. Its parts are its hardware, needles and battery with the
beautiful dial, chassis and strap. These parts organize to show the real time every second and continuously
update the time every second. The system-program updates the display using three needles after each second.
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 ofEmbedded 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 ofSmall 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 ofbasic 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 forgraphic 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 ofgeneral-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 of32- 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 ofa numberof pixels. Forexample. Quartercommon 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, forexample,
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 forspecific 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 timercircuit 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 ofthe reset that succeeds the processoractivation,
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 ifa fault develops and the
program gets stuck. On restart, the system can function normally. Most microcontrollers have on-chip watchdog
timers. The watchdog timer device is described in detail in Section 3.7.
Consider a system controlling temperature. Assume that when the program starts executing, the sensor
inputs work all right. However, before the desired temperature is achieved, the sensor circuit develops some
fault. The controller will continue delivering the current nonstop if the system is not reset. Consider another
example of a system for controlling a robot. Assume that the interfacing motor control circuit in the robot arm
develops a fault during the run. In such cases, the robot arm may continue to move unless there is a watchdo"
timer control. Otherwise, the robot will break its own arm!
When a program executes the program counter increments or changes. An important circuit that associates
a system is its reset circuit that can change the program counter to a power-up default value A progr im
that is reset and runs on a power-up can be one of the following: (i) A system program that executes from
the beginning, (u) A system boot-up program, (iii) A system initialization program.
The watchdog timer reset is a required feature in control applications.
1.3.5 Memory
In a system, there are various types of memory. Figure 1.4 shows a chart for various forms of memory that are
present in systems. These are as follows:
I. Internal RAM of 256 or 512 bytes in a microcontroller for registers, temporary data and stack.
2. Internal ROM/PROM/E2PROM for about 4 kB to 64 kB of program (in the case of microcontrollers).
3. External RAM for the temporary data and stack (in most systems) or internal caches (in the case of
certain microprocessors).
Various Forms of System Memory
1
Internal
RAM at
Micro­
controller
1
RAM at
System-
on-
Chip
or
External
RAM
1
Internal
Caches
at
Microprocessor
[Hold Copies
of System
Memory- ,th
pages]
1
External
RAM
Chip(s)
1
Flash/
EEPROM
1
ROM/
PROM
Memory
Addresses
at
External
and/or
Internal
the System
Ports
Fig. 1.4 The various forms of memories in the system
r~~t
Introduction to Embedded Systems 13 j
4. Internal Hash (in many systems the results ofprocessing can be saved in nonvolatile memory: lor example,
system status periodically and images, songs, or speeches alter suitable formal compression).
5. Memory stick (or card): video, images, songs, or speeches and large storage in digital camera and
mobile systems. Sony memory stick Micro (M2) is of size 15x12.5x1.2 mm and has a flash memory
of 2 GB. Il has a data transfer rale of 160 Mbps (mega bit per second) and PRO-HG 4X0 Mbps and
120 Mbps write | since Dec. 2006. |
6. External ROM or PROM for embedding software (in almost all systems other than microcontroller-
based systems).
7. RAM memory buffers al ports.
8. Caches (in pipelined and superscalar microprocessors).
Table 1.1 details the functions assigned in embedded systems to the memories. ROM or PROM or EPROM
embeds the software specific to the system.
Table 1.1 Functions assigned to the memories in a system
Memory Needed Functions
ROM or EPROM
or flash
Storing application programs from where the processor fetches the instruction codes.
Storing codes for system booting, initializing, initial input data and strings. Codes for
RTOS. Pointers (addresses) of various interrupt service routines (ISRs).
RAM (internal and external)
and RAM for buffer
Storing the variables during program run and storing the stack. Storing input or output
buffers, for example, for speech or image.
Memory slick A flash memory stick is inserted in mobile computing system or digital-camera. It
stores high definition video, images, songs, or speeches after a suitable formal
compression and stores large persistent data.
EEPROM or Flash Storing nonvolatile results of processing.
Cache Storing copies of instructions and data in advance from external primary memory and
storing the results temporarily during processing.
A system embeds (locates) the following either in the internal flash or ROM, PROM or in an external flash
or ROM or PROM of the microcontroller: boot-up program, initialization data, strings or pictogram for
screen-display or initial state of the system, programs for various tasks, ISRs and operating system kernel.
The system has RAMs for saving temporary data, stack and buffers that are needed during a program run.
The system uses flash for storing nonvolatile results.
1.3.6 Input, Output and IO Ports, IO Buses and IO Interfaces
The system gets inputs from physical devices through the input ports. Examples arc as follows:
I. A system gets inputs from the touch screen, keys in a keypad or keyboard, sensors and transducer
circuits.
2. A controller circuit in a system gets inputs from the sensor and transducer circuits.
3. A receiverofsignals ora networkcard gets the input from acommunication 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 ofserial 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 halfthe 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 ofdevices 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
variousprocesses andfor handling multiple interrupts simultaneously pending for service. Chapter4 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, ifa key is pressed, then an ISR reads the key and stores the key value in
the processor memory address. If a sequence of keys is pressed, for instance in a mobile phone, then
an ISR reads the keys and also calls a task to dial the mobile number.
5..There is a programmable unit on-chip for the interrupt handling mechanism in a microcontroller.
6. The operating system is expected to control the handling of interrupts and running of routines for the
interrupts in a particular application. The system always gives priority to the ISRs over the tasks of an
application.
A system provides an interrupt handling mechanism for executing the ISRs in case of the interrupts from
physical devices, systems, software instructions and software exceptions.
Introduction to Embedded Systems
19;
1.4 EMBEDDED SOFTWARE IN A SYSTEM
The software is like the brain of the embedded system.
1.4.1 Final Machine Implementable Software for a System
An embedded system processor executes software that is specific io a given application of that system. The
instruction codes rind data in the final phase are placed in the ROM or flash memory for all the tasks that are
executed when the system runs. The software is also called ROM image. Why? Just as an image is a unique
sequence and arrangement of pixels, embedded software is also a unique placement and arrangement of bytes
for instructions and data.
Each code or datum is available only in the bits and bytes’ format. The system requires bytes at each
ROM address, according to the tasks being executed. A machine implementable software file is therefore
like a table having in each rows the address and bytes. The bytes are saved at each address of the system
memory. The table has to be readied as a ROM image for the targeted hardware. Figure 1.5 shows the ROM
image in a system memory: The image consists of the boot up program, stacks address pointers, program
counter address pointers, application programs. ISRs, RTOS, input data and vector addresses.
Interrupt Service I
Routine Vector .
Addresses of
2 Bytes each I
Bootup ;
Program j-
Codes i
Machine Codes;
for Real Time i
Operating f
System (RTOS)j
2 Bytes for j
Address of I
Stack J"
on i
Reset '
System ROM
Memory
1 2 Bytes for
■ Address from
I Where System
I Starts
Execution on
Power Up
' (Not Needed in
i 80x86,8051,80196,
.. )
Bytes for
- . i Data as
Inputs for each
Interrupt
< Service Routine
r Machine Specific
I Codes for
•. each
! Program, ISR -
L and Task
Fig. 1.5 System ROM memory embedding the software, RTOS, data and vector addresses
0 Embedded Systems
Final stage software is also called the ROM image. The final machine implementable software for a
product embeds in the once programmable Hash or ROM (or PROM) as an image in a frame. Bytes at each
address must be defined io create the ROM image. By changing this image, the same hardware platform
will work differently and can be used for entirely different applications or for new upgrades of the same
system.
1.4.2 Coding of Software in Machine Codes
During coding in this format, the programmer defines the addresses and the corresponding bytes or bits at
each address. In configuring some specific physical device or subsystem, machine code-based coding is used.
For example, in a transceiver, placing certain machine code and bits can configure it to transmit at specific
megabytes per second or gigabytes per second, using specific bus and networking protocols. Another example
is using certain codes for configuring a control register with the processor. During a specific code-section
processing, the register can be configured to enable or disable use of its internal cache. However, coding in
machine implementable codes is done only in specific situations because it is time consuming and the
programmer must first have to understand the processor instructions set and then memorize the instructions
and their machine codes.
1.4.3 Software in Processor Specific Assembly Language
A program or a small specific part can be coded in assemblv /mtguoge using an assembler after understanding
the processor and its instruction set. Assembler is software used for developing codes in assembly.
Assembly language coding is extremely useful for configuring physical devices like ports, a line-display
interface. ADC and DAC and reading into or transmitting from a buffer. These codes are also called low-level
codes for the device driver functions. (Sections 1.4.7 and 4.2.4.] They are useful to run the processor or
device-specific features and provide an optimal coding solution.
Lack of knowledge of writing device driver codes or codes that utilize the processor-specific features-
invoking codes in an embedded system design team can cost a lot. A vendor may charge for the APIs and also
charge intellectual property fees for each system shipped out of the company.
To make all the codes in assembly language may. however, be very time consuming. Full coding in assembly
may be done only for a few simple, small-scale systems, such as toys, automatic chocolate vending machines,
robots or data acquisition systems.
Figure 1.6 shows the process of converting an assembly language program into machine implementable
software file and then finally obtaining a ROM image file.
1. An assembler translates the assembly software into the machine codes using a step called assembling.
2. In the next step, called linking, a tinker links these codes with the other codes required. Linking is
necessary because of the number of codes to be linked for the final binary file. For example, there are
the standard codes to program a delay task for which there is a reference in the assembly language
program. The codes for the delay must link with the assembled codes. The delay code is sequential
from a certain beginning address. The assembly software code is also sequential from a certain beginning
address. Both the codes have to be linked at the distinct addresses as well as at the available addresses
in the system. The linked file in binary for run on a computer is commonly known as an executable file
or simply an ‘.exe’ file. After linking, there has to be reallocation of the sequences of placing the codes
before actually placing the codes in memory.
Introduction to Embedded Systems
! 21
I
Fig. 1.6 The process of converting an assembly language program into the machine codes
and finally obtaining the ROM image
3. In the next step, the loader program performs the task of reallocating the codes after finding the
physical memory addresses available at a given instant. The loader is a part of the operating system
and places codes into the memory after reading the '.exe' file. This step is necessary because the
available memory addresses may not start from 0x0000. and binary codes have to be loaded al different
addresses during the run. The loader finds the appropriate start address. In a computer, after the loader
loads into a section of RAM. the program is ready to run.
4. The final step of the system design process is locaiing these codes as a ROM image. The codes are
permanently placed at the addresses actually available in the ROM. In embedded systems, there is no
separate program to keep track oflhe available addresses at different times during the run. as in a computer.
In embedded systems, therefore, the next step instead of loader after linking is the use of a locaior.
which locates the IO tasks and hardware device driver codes al fixed addresses. Port and device addresses
are llxed for a given system as per the interfacing circuit between the system buses and ports or devices.
The locator program reallocates the linked file and creates a file fora permanent location of the codes in
a standard format. The file formal may be in the Intel Hex file format or Motorola S-record format. The
designer has to define the available addresses to locale and create files to permanently locate the codes.
5. Lastly, either (i) a laboratory system, called device programmer, takes as input the ROM image file
and finally burns the image into the PROM or flash or (ii) at a foundry, a mask is created for the ROM
of the embedded system from the ROM image file. |The process of placing the codes in PROM or
flash is also called burning. | The mask created from the image gives the ROM in 1C chip form.
To configure some specific physical device or subsystem such as the transceiver, machine codes can be
used straightaway. For physical device driver codes or codes that utilize processor-specific features-invoking
codes, ‘processor-specific’ assembly tahgua^b is used. A file is then created in three steps using an Assembler,
Linker and Locator. The file has the ROM image in a standard format. A device programmer finally bums
the image in the PROM or EPROM. A mask created from the image gives the ROM in IC chip form.
Embedded Systems
1.4.4 Software in High Level Language
Since the coding in assembly language is very lime consuming in most cases, software is developed in a high-
level language, ‘C’ or ‘C++’ or visual C++ or Java' in most cases. ‘C’ is usually the preferred language. The
programmer needs to understand only the hardware organization when coding in high level language. As an
example, consider the following problem.
Example 1.1
Add 127, 29 and 40 and print the square root.
An exemplary C language program for all the processors is as follows, (i) # include <stdio.h>
(ii) # include <math.h> (iii) void main (void) { (iv) int i1. i2, i3. a; float result', (v) il = 127;
i2 - 29; i3 = 40; a = il + i2 + i3; result = sqrt (a): (vi) printf(result);)
The coding for square root will need many lines of | ........ —~
code and can be done only by an expert assembly Preprocessor Commands
language programmer. To write the program in a high .. . ~ ~
level language is very simple compared to writing it in ----------------------i--------------------
assembly language. ‘C‘ programs have a feature that Interrupt Service Routines
adds the assembly instructions when using certain Tasks 1 N
processor-specific features and coding for a specific ------------------------------------------
section, for example, a port device driver. Figure 1.7 Kernel and Scheduler
shows the different programming layers in a typical Standard Library
embedded ‘C’ software. These layers are as follows. Functions Including
(i) Processor Commands, (u) Main Function. Functions for j
(iii) Interrupt Service Routine, (iv) Multiple tasks, say. Sending Stack and I
1 to N. (v) Kernel and Scheduler, (vi) Standard library Receiving Stack _____ i j
functions, protocol handling and stack functions. - ----------------------------------------------:
Figure 1.8 shows the process of converting a Fig 17 The different program |ayers in the
C program into the ROM image file. A compiler embedded software in C
generates the object codes. It assembles the codes
according to the processor instruction set and other specifications. The C compiler for embedded
systems must, as a final step of compilation, use a code-optimizer that optimizes the codes before
linking. After compilation, the linker links the object codes with other needed codes. For example, the
linker includes the codes for the functions printf and sep t codes. Codes for device and driver (device
control codes) management also link at this stage: for example, printer device management and driver
codes. After linking, the other steps for creating a file for ROM image are the same as shown earlier in
Figure 1.6.
Preprocessor Commands
Main Function
Interrupt Service Routines
Kernel and Scheduler
Standard Library
Functions Including
Network Protocol
Functions for
Sending Stack and
Receiving Stack
Tasks 1....N
C, C++, Java, Visual C++ are the languages used for software development. A C program has various
layers: processor commands, main function, task and library functions, interrupt service routines and kernel
(scheduler). The compiler generates an object file. Using a linker and locator, the file for the ROM image
is created for the targeted hardware.
Introduction to Embedded Systems
Fig. 1.8 The process of converting a C program into the file for ROM image
1,4.5 Program Models for Software Designing
The program design task is simplified if a program is modeled.
The different models that are employed during the design processes ofthe 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 ofphysicaldevices. 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) ofa 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 archillocated by lhe
manager.
An OS also provides and executes modules for managing devices that associate with an embedded system.
The underlying principle is that at an instant, only one physical or virtual device should gel access to or from
one task only.
Sections 4.2.4 and 8.6.1 will describe device drivers and device management in detail. The OS also
provides and manages virtual devices such as pipes and sockets. Sections 7.14 and 7.15 describe these in
detail.
For designing embedded-software, two types of devices are considered: physical and virtual. Physical
devices include keypad, printer or display unit. A virtual device could be a file or pipe or socket or RAM
disk. Device drivers and device manager software are needed in the system. The RTOS includes device­
drivers and a device manager to control and facilitates the use of the number of physical and virtual
devices in the system.
1.4.8 Software Tools for Designing an Embedded System
Table 1.2 lists the applications of software tools for assembly language programming, high level language
programming. RTOS. debugging and system integration.
Tao’? 1.2 Software modules and tools for designing of an embedded system
j Sojimire Tools Application
Editor For writing C codes or assembly mnemonics using the keyboard of the PC for entering the
program. Allows the entry, addition, deletion, insert, appending previously written lines or
files, merging record and Illes at the specific positions. Creates a source file that stores lhe
edited file. It also has an appropriate name [provided by the programmer].
Interpreter For expression-by-expression (line-by-line) translation to machine-executable codes.
Compiler Uses the complete set of codes. It may also include codes, functions and expressions from
lhe library routines. It creates a file called object file.
Assembler For translating assembly mnemonics into binary opcodes (instructions), that is, into
an executable file, called binary file and for making a list file that can be printed. The list
file has address, source code (assembly language mnemonics) and hexadecimal object^
codes. The file has addresses that reallocate during the actual run of the assembly
language program.
(Contd)
I 26 Embedded Systems
Integrated development This is a development software and hardware environment that consists of simulators with
Software Tools
Cross assembler
Application
For converting object codes or executable codes for a processor to other codes for another
processor and vice versa. The cross-assembler assembles the assembly codes of the target
processor as the assembly codes of the processor of the PC used in system development.
Later, it provides the object codes for the target processor. These codes will be the ones
actually needed in the final developed system.
Simulator To simulate all functions ofan embedded system circuit including that or additional memory
and peripherals. It is independent ofa particular target system. It also simulates the processes
that will execute when the codes of a particular processor execute.
Source-code
engineering software
For source code comprehension, navigation and browsing, editing, debugging, configuring
(disabling and enabling the C++ features) and compiling.
RTOS Refer Chapters 8 to 10.
Stethoscope For dynamically tracking the changes in any program variable or parameter. It demonstrates
the sequence of multiple processes (tasks, threads, service routines) that execute and also
records the entire time history.
Trace scope To help in tracing the changes in modules and tasks with time on the X-axis. A list of
actions also produces the desired time scales and the time expected to be taken for different
tasks.
' The locator program output is in the Intel hex Hie or Motorola S-record format.
environment editors, compilers, assemblers, RTOS, debuggers, stethoscope, tracer, emulators, logic
analyzers, and application code burners in PROM or Hash.
Prototyper This simulates and does source code engineering including compiling, debugging and,
browsing and summarizing the complete status of the final target system during the
development phase.
Locator* This uses a cross-assembler output and a memory allocation map and provides the locator
program output as a hex-file. It is the final step of the software design process or an
embedded system. i
Software tools are used to develop software for designing an embedded system. Debugging tools, such as a
stethoscope, trace scope, and sophisticated tools such as an integrated development environment
and prototype development tools, are needed for the integrated development of system software and hardware.
1.4.9 Software Tools Required in Exemplary Cases
Table 1.3 gives the various tools needed to design exemplary systems.
RTOS is essential in
y- Jis
most embedded systems to process multiple tasks and ISRs. Embedded systems for
medium scale and sophisticated applications need a number of sophisticated software and debugging tools.
Introduction to Embedded Systems
Table 1.3 Software tools required in exemplary systems
Software
Tools
Automatic
Chocolate
Vending
Machine*
Data
Acquisition
System
Robot Mobile
Phone
Adaptive
Cruise Control
System with
String Stability#
Voice
Processor
Editor Yes Yes Yes Yes Yes NR
Interpreter Yes NR Yes NR NR NR
Compiler Yes Yes Yes Yes Yes Yes
Assembler Yes Yes Yes No No No
Cross Assembler NR Yes Yes No No No
Locator Yes Yes Yes Yes Yes Yes
Simulator NR Yes Yes Yes Yes Yes
Source code engineering
software
NR NR NR Yes Yes Yes
RTOS Yes MR Yes Yes Yes Yes
Stethoscope NR NR NR Yes Yes Yes
Trace scupe NR NR NR Yes Yes Yes
Integrated development
environment
NR Yes Yes Yes Yes Yes
Prototyper NR No No Yes Yes Yes
Note: NR means not required. MR means may be required in a specific complex system but not compulsorily needed.
1.5 EXAMPLES OF EMBEDDED SYSTEMS
Embedded systems have very diversified applications. A few select application areas of embedded systems
are telecommunications, smart cards, missiles and satellites, computer networking, digital consumer electronics,
and automotives. Figure 1.9 shows the applications of embedded systems in these areas.
A few examples of small scale embedded system applications are as follows:
1. Point of sales terminals: automatic chocolate vending machine
2. Stepper motor controllers for a robotics system
3. Washing or cooking systems
4. Multitasking toys
5. Microcontroller-based single or multidisplay digital panel meter for voltage, current, resistance and
frequency
6. Keyboard controller
7. SD, MMI and network access cards
8. CD drive or hard disk drive controller
0 Embedded Systems
9 The peripheral controllers ofa computer, for example, a CRT display controller, a keyboard controller,
a DRAM controller, a DMA controller, a printer controller, a laser printer controller, a LAN controller,
a disk drive controller
10. Fax or photocopy or printer or scanner machine
11. Remote (controller) of TV
12. Telephone with memory, display and other sophisticated features
Telecom
I
J,
tg
I
- Mobile Computing
- Mobile Access
Smart
Cards
I
- Banking
- Security
Missiles and
- Defence
- Aerospace
- Communication
Computer Networking
Systems and Peripherals
(a)
- Networking Systems
- Image processing
- Printers
- Networks Cards
- Monitors and Displays
Digital
Consumer
Electronics
-DVDs
- Set top boxes
- High definition TVs
- Digital cameras
Automotive
- Motor Control System
- Cruise Control
- Engine/Body Safety
- Robotics in Assembly Line
- Car Entertainment
- Car Multimedia
(0
Fig. 1.9 Applications of the embedded systems in various areas
13. Motor controls systems—for example, an accurate control of speed and position of the d.c. motor,
robot and CNC machine; automotive applications such as closed loop engine control, dynamic ride
control, and an antilock braking system monitor
14. Electronic data acquisition and supervisory control system
15. Electronic instruments, such as an industrial process controller
16. Electronic smart weight display system and an industrial moisture recorder cum controller
17. Digital storage system for a signal wave form or for electric or water meter reading system
18i Spectrum analyzer
19. Biomedical systems such as an ECG LCD display cum recorder, a blood-cell recorder cum analyzer,
and a patient monitor system
Some examples of medium scale embedded systems are as follows:
Introduction to Embedded Systems I 29 I
20. Computer networking systems, tor example, a router, a front-end processor in a server, a switch, a
bridge, a hub and a gateway
21. For Internet appliances, there are numerous application systems (i) An intelligent operation,
administration and maintenance router (10AMR) in a distributed network and (ii) Mail client card to
store e-mail and personal addresses and to smartly connect to a modem or server
22. Entertainment systems such as a video game and a music system
23. Banking systems, for example, bank ATM and credit card transactions
24. Signal tracking systems, for example, an automatic signal tracker and a target tracker
25. Communication systems such as a mobile communication SIM card, a numeric pager, acellular phone,
a cable TV terminal and a FAX transceiver with or without a graphic accelerator
26. Image filtering, image processing, pattern recognizer, speech processing and video processing
27. Video games
28. A system that connects a pocket PC to the automobile driver mobile phone and a wireless receiver.
The system then connects to a remote server for Internet or e-mail or to a remote computer at an ASP
(application service provider)
29. A personal information manager using frame buffers in handheld devices
30. Thin client [A thin client provides disk-less nodes with remote boot capability]. Application of thin-
client accesses to a data centre from a number of nodes; in an Internet laboratory accesses to the
Internet leased line through a remote server.
31. Embedded firewall / router using ARM7/ multiprocessor with two Ethernet interfaces and interfaces
support to PPP, TCP/IP and UDP protocols.
Examples of sophisticated embedded systems are as follows:
32. Mobile smart phones and computing systems
33. Mobile computer
34. Embedded systems for wireless LAN and for convergent technology devices
35. Embedded systems for video, interactive video, broadband IPv6 (Internet Protocol version 6) Internet
and other products, real time video and speech or multimedia processing systems
36. Embedded interface and networking systems using high speed (400 MHz plus), ultra high speed
(10 Gbps) and a large bandwidth: Routers, LANs, switches and gateways. SANs (Storage Area
Networks), WANs (Wide Area Networks)
37. Security products and high-speed Network security. Gigabit rate encryption rate products
1.6 EMBEDDED SYSTEM-ON-CHIP (SoC) AND USE OF VLSI CIRCUIT
DESIGN TECHNOLOGY
Lately, embedded systems are being designed on a single silicon chip, called System on chip (SoC), a design
innovation. SoC is a system on a VLSI chip that has all the necessary analog as well as digital circuits,
processors and software.
A SoC may be embedded with the following components:
1. Embedded processor GPP or ASIP core,
2. Single purpose processing cores or multiple processors,
3. A network bus protocol core,
4. An encryption function unit,
30 Embedded Systems
5. Discrete cosine transforms for signal processing applications,
6. Memories,
7, Multiple standard source solutions, called IP (Intellectual Property) cores,
8. Programmable logic device and FPGA (Field Programmable Gate Array) cores,
9. Other logic and analog units.
An exemplary application of such an embedded SoC is the mobile phone. Single purpose processors,
ASIPs and IPs on an SoC are configured to process encoding and deciphering, dialing, modulating,
demodulating, interfacing the key pad and multiple line LCD matrix displays or touch screen, storing data
input and recalling data from memory. Figure 1.10 shows an SoC that integrates internal ASICs, internal
processors (ASIPs), shared memories and peripheral interfaces.on a common bus. Besides a processor,
memories and digital circuits with embedded software for specific applications, the SoC may possess analog
circuits as well.
A SYSTEM ON CHIP
I'SINGLE PURPOSE!_
;PROCESSORS n
I ASIPs !
——
i ,ps :
BUSES
DIGITAL ;
CIRCUITS- '
TIMER. ;
MUXs.... |
I DATA ADDRESS ;
I GENERATOR I
I.... T---------
____ LC.-JL ;--------
i PROGRAM
■ ADDRESS 1
i GENERATOR I
PROGRAM,
DATA
AND PORT
MEMORY
PORT i
INTERFACES I
DMAC
MULTI­
PROCESSOR I
; DSP I
; gpp :
I INTERRUPT
; CONTROLLER
ANALOG
CIRCUITS,
A/D
FIASH
or E2PROM
L
H------------------>
- 15-20%
AREA
- 60%
AREA
-20-25%
AREA
7|A’
Fig. 1.10 A SoC embedded system and its common bus with internal ASIPs, internal processors,
IPs, shared memories and peripheral interfaces
Introduction to Embedded Systems
0
1.6.1 Application Specific IC (ASIC)
ASICs are designed using the VLSI design tools with the processor GPP or ASIP and analog circuits embedded
into the design. The designing is done using the Electronic Design Automation (EDA) tool. [For design of an
ASIC, a High-level Design Language (HDL) is used|.
1.6.2 IP Core
On a VLSI chip, there may be integration of high-level components. These components possess
gate-level sophistication in circuits above that of the counter, register, multiplier, floating point operation unit
and ALU. A standard source solution for synthesizing a higher-level component by configuring an FPGA
core or a core of VLSI circuit may be available as an Intellectual Property, called (IP). The designer or the
designing company holds the copyright for the synthesized design of a higher-level component for gate-level
implementation of an IP. One might have to pay royalty for every chip shipped. An embedded system may
incorporate several IPs.
• An IP may provide hardwired implementable design of a transform, an encryption algorithm or a
deciphering algorithm.
• An IP may provide a design for adaptivefiltering 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 ofgates 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 Bothfeatures
Stream I 68HCxxx Motorola CISC
Stream 2 80x86 Intel CISC
Stream 3 SPARC Sun RISC
Stream 4 ARM ARM RISC with CISC functionality
1.7.2 Embedding a Microcontroller
Microcontroller VLSI cores or chips for embedded systems are usually among the five streams of families
given in Table 1.5.
Table 1.5 Major microcontrollers®1 used in the embedded systems
Stream Microcontroller Family Source CISC or RISC or Both
Stream 1 68HCHxx. HC12xx. HC16xx Motorola CISC
Stream 2 8051. 8051 MX Intel. Philips CISC
Stream 3 PIC I6F84 or 16C76, 16F876 and PIC 18 Microchip CISC
Stream 4’ Microcontroller Enhancements of CORTEX-M3
ARM9/ARM7 from Philips, Samsung and
ST Microelectronics
ARM, Texas. Philips,
Samsung and ST
Microelectronics etc.
RISC Core with
CISC functionality
Other popular microcontrollers are as follows, (i) Hitachi H8x family and SuperH 7xxx. (ii) Mitsubishi 740,7700, M16C and
M32C families, (iii) National Semiconductor COP8 and CR16 /16C. (iv) Toshiba TLCS 900S (v) Texas Instruments MSP 430
for low voltage battery based system, (vi) Samsung SAM8. (vii) Ziglos Z80 and eZ80
1.7.3 Embedding a DSP
A digital signal processor (DSP) is a processor core or chip for the applications that process digital signals.
[For example, filtering, noise cancellation, echo elimination, compression and encryption applications.] Just
as a microprocessor is the most essential unit of a computing system, a DSP is essential unit of an embedded
Introduction to Embedded Systems
system in a large number of applications needing processing of signals. Exemplary applications are in image
processing, multimedia, audio, video, HDTV, DSP modem and telecommunication processing systems. DSPs
also find use in systems for recognizing image pattern or DNA sequence.
DSP as an ASIP is a single chip or core in a VLSI unit. It includes the computational capabilities of a
microprocessor and Multiply and Accumulate (MAC) units. A typical MAC has a 16 x 32 MAC unit.
DSP executes discrete-time, signal-processing instructions. It has Very Large Instruction Word (VLIW)
processing capabilities; it processes Single Instruction Multiple Dala(SIMD) instructions; it processes Discrete
Cosine Transformations (DCT) and inverse DCT (IDCT) functions. The latter are used in algorithms for
signal analyzing, coding, filtering, noise cancellation, echo elimination, compressing and decompressing, etc.
Major DSPs for embedded systems are from the three streams given in Table 1.6.
Table 1.6 Important digital signal processor® used in the embedded systems
Stream DSP Family Source
Stream 1 TMS320Cxx, 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.
I 34 Embedded Systems
In a cell phone, a number of tasks have to be performed: (a) Speech signal-compression and coding,
(b) Dialing (c) Modulating and Transmitting (cl) Demodulating and Receiving (e) Signal decoding and
decompression (f) Keypad interface and display interface handling (g) Short Message Service (SMS) protocol­
based messaging (h) SMS message display. For all these tasks, a single processor does not suffice. Suitably
synchronized multiple processors are used.
Consider a video conferencing system. In this system, a quarter common intermediate format—Quarter-
CIF—is used. The number of image pixels is just 144 x 176 as against 525 x 625 pixels in a video picture on
TV. Even then, samples of the image have to be taken at a rate of 144 x 176 x 30 = 760320 pixels per second
and have to be processed by compression before transmission on a telecommunication or Virtual Private
Network (VPN). [Note: The number of frames are 25 or 30 per second (as per the standard adopted) for real­
time displays and in motion pictures.] A single DSP-based embedded system does not suffice to get real-time
images during video conferencing. Real-time video processing and multimedia applications most often need
a multiprocessor unit in the embedded system.
Multiple processors or dual core processors are used when a single microprocessor does not meet the
needs of the different tasks that execute concurrently. The operations of all the processors are synchronized
to obtain optimum performance.
1.7.7 Embedded Processor/Embedded Microcontroller
An embedded processor is a processor with special features that allow it to embed multiple processes into the
system.
Real time image processing and aerodynamics are two areas where fast, precise and intensive calculations
and fast context switching (from one program to another) are essential. Embedded processor is the
term sometimes used for processor that has been a specially designed such that il has the following
capabilities:
1. Fast context switching and thus lower latencies of the tasks in complex real time applications.
[Section 4.6] Fast context switching means that the calling program or interrupted service routine CPU
registers save and retrieve fast (Section 4.6],
2. 32-bit or 64-bit atomic addition and multiplication, and no shared data problem in the operations with
large operands with each operand placed in two or four registers. (Section 7.8.1 ]
3. 32-bit RISC core for fast, more precise and intensive calculations by the embedded software.
Embedded microcontroller is the term sometimes used for specially designed microcontrollers that have
the following capabilities:
I. When a microcontroller has internal RAM, large flash or ROM, timer, interrupt handler, devices and
peripherals and there is no external memory or device or peripheral required for the given application.
2. Fast context switching and thus lower latencies of the tasks in complex real time applications. For
example, ARM and 68HClx microcontrollers save all CPU registers fast
An embedded processor is term used for processors with fast processing, fast context-switching and atomic
ALU operations. An embedded microcontroller is the term used for a microcontroller that has internal
RAM, large flash or ROM, timer, interrupt handler, internal devices and internal peripherals and there is no
external memory or device or peripheral required for the given application.
Introduction to Embedded Systems
Complex System Embedded Processors Table 1.7 gives different processors that can embed in a
complex system.
Table 1.7 Processors in complex embedded systems
Processor Application Advantage Disadvantage
General Purpose
Microprocessor
When intensive
computations are
required, caches are used
and pipeline and
superscalar operations
are needed and large
embedded software is to
be located in the external
memory cores or chips.
No engineering cost for
designing the processor.
Additional redundant
execution units that are
not needed in the given
system design
Microcontroller Used with internal
memory, devices and
peripherals and when
embedded software is to
be located in the interna!
ROM or flash.
No engineering cost for
designing the processor
with internal memory,
devices and peripherals.
Additional
manufacturing costs and
redundant application
units which are not
needed in the given
system design.
DSP Used with signal
processing-related
instructions for filters,
image, audio, and video
and CODEC operations.
No engineering cost
involved for designing
the signal processor.
Manufacturing cost may
be high.
Single purpose
processors and
application specific
system processor
i
Control IO and bus
operations and
peripherals and devices.
They support other
processing units in the
system and execute
specific hardware
processes fast.
In-house engineering
cost of development,
royalty payments for an
IP core of processor and
time-to-market cost.
Dual core processor To significantly enhance
the performance of the
system.
Reduced engineering
cost.
Manufacturing cost, as
dual core processors are
costly.
Accelerator To accelerate the
execution of codes. A
floating point
coprocessor accelerates
mathematical operations
and Java accelerator
'Accelerates Java code
execution.
Increases performance by
co-processing with the
main processor.
i Engineering cost of
development or royalty
payments for IP core of
processor and time-to-
market cost.
36 Embedded Systems
A DSP for mobile phones, for example, OMAP of Texas Instruments, uses the effective power dissipation
methods of dynamic switching both for power supply voltage and operating frequency of the CPU core.
For a number of applications, the DSPs cores may not suffice. Domain specific ASIPs have specific
instruction sets. For lOs. network, media or security applications, smart card, video game, palm top computer,
cell phone, mobile-internet, hand-held embedded systems. Gbps transceivers, Gbps LAN systems, satellite or
missile systems, we need special processing units in a VLSI circuit designed to function as a processor with
an instruction-set for programmability. These special units are called domain-specific ASIP.
1.7.8 Embedding ARM processor
Examples of Stream 4 GPPs in Table 1.4 are ARM 7 and ARM 9. The core of these processors can be
embedded onto a VLSI chip or an SoC. An ARM-processor VLSI-architecture is available either as a CPU
chip or for integrating it into VLSI or SoC. ARM, Intel and Texas Instruments and several other companies
have developed such processors. ARM provides CISC functionality with RISC architecture at the core. The
cores of ARM7. ARM9 and their DSP enhancements are available for embedding in systems. (Refer to http:/
www.ti.com/sc/ docs/asic/modules/arm7.htm and arm9.htm],
ARM integrates with other features (for example DSP) in new GPPs, which are available from several
sources, for example, Intel and Texas Instruments. Exemplary ARM 9 applications are setup boxes, cable
modems, and wireless-devices such as mobile handsets.
ARM9 has a single cycle 16 x 32 multiple accumulate unit. It operates at 200 MHz. It uses 0.15 pm GS30
CMOSs. It has a five-stage pipeline. It incorporates RISC core with CISC functions. It integrates with a DSP
.vhen designed for an ASIC solution. An example is its integration with DSP is TMS320C.55x from Texas
Instruments. [Refer to http:/www.ti.com/sc/docs/asic/modu)es/arm7.htm and arm9.htm]
A lower performance but very popular version of ARM9 is ARM7. It operates at 80 MHz. It uses 0.18 pm
based GS20 pm CMOSs. Using ARM7, ARM9 and CORTEX-M3, a large number of embedded systems
have recently become available.
Lately, a new class of embedded systems has emerged that additionally incorporates ASSP chips or cores
in its design.
1.7.9 Embedding ASSP
Assume that there is an embedded system for real-time video processing. Real-time processing arises for
digital television, high definition TV decoders, set-up boxes. DVD (Digital Video Disc) players, web phones,
video-conferencing and other systems. An ASSP that is dedicated to these specific tasks alone provides a
faster solution. The ASSP is configured and interfaced with the rest of the embedded system.
Assume that there is an embedded system that using a specific protocol interconnects, its units through
specific bus architecture to another system. Also, assume that suitable encryption and decryption is required.
[The output bit stream encryption protects messages or design from passing to an unknown external entity.]
For these tasks, besides embedding the software, it may also be necessary to embed some RTOS features
[Section 1.4.6]. If the software alone is used for the above tasks, it may take a longer time than a hardwired
solution for application-specific processing. An ASSP chip provides such a solution. For example, an ASSP
chip [from i2Chip (http://www.i2Chip.com)] has a TCP, UDP, IP, ARP and Ethernet 10/100 MAC (Media Access
Control) hardwired logic included into it. The chip from i2Chip, W3I00A, is a unique hardwired internet
connectivity solution. Much needed TCP/IP stack processing software for networking tasks is thus available as
a hardwired solution. This gives output five times faster than a software solution using the system’s GPP. It is
also an RTOS-less solution. Using the same microcontroller in the embedded system to which this ASSP chip
Introduction to Embedded Systems
interfaces, Ethernet connectivity can be added. Another ASSP, which is now available, is the ‘Serial-to-Elhcrnet
Converter (IIM7I00). It does real-time data processing by a hardware protocol stack. It needs no change in the
application software or firmware and provides the most economical and smallest RTOS-solution.
An ASSP is used as an additional processing unit for running application specific tasks in place of processing
using embedded software.
1.8 DESIGN PROCESS IN EMBEDDED SYSTEM
The concepts used during a design process are as follows.
1. Abstraction: Each problem component is first abstracted. For example, in the design of a robotic
system, the problem of abstraction can be in terms of control of arms and motors.
2. Hardware andSoftware architecture: Architectures should be well understood before a design.
3. Extra functional Properties: Extra functionalities required in the system being developed should
be well understood from the design.
4. System Related Family of designs: Families of related systems developed earlier should be
takenfinto consideration during designing.
5. Modular Design: Modular design concepts should be used. System designing is fast by
decomposition of software into modules that are to be implemented. Modules should be such that they
can be composed (coupled or integrated) later. Effective modular design should ensure effective (i)
function independence, (ii) cohesion and (iii) coupling.
(a) Modules should be clearly understood and should maintain continuity.
(b) Also, appropriate protection strategies are necessary for each module. A module is not permitted
to change or modify another module functionality. For example, protection from a device driver
modifying the configuration of another device.
6. Mgpping: Mapping into various representations is done from software requirements. For example,
data flow in the same path during the program flow can be mapped together as a single entity. Transform
and transaction mapping design processes are used in designing. For example, an image is input data
to a system: it can have a different number of pixels and colours. The system does not process each
pixel and colour individually. Transform mapping of image is done by appropriate compression and
storage algorithms. Transaction mapping is done to define the sequence of images.
7. User Interface Design: User interface design is an important part ofdesign. User interfaces are designed
as per user requirements, analysis ofthe environment and system functions. For example, in an automatic
chocolate vending machine (ACVM) system, the user interface is an LCD multiline graphics display. It
can display a welcome message as well as specify the coins needed to be inserted into the machine for
each type of chocolate. The same ACVM may be designed with touchscreen User Interface (GUI), or it
may be designed with Voice User Interfaces (VUIs). Any of these interface designs has to be validated by
the customer. For example, the ACVM customer who installs the machine must validate message language
and messages to be displayed before an interface design can proceed to the implementation stage.
8. Refinements: Each component and module design needs to be refined iteratively till it becomes the
most appropriate for implementation by the software team. ,th
The software design process may require use of Architecture Description Language (ADL). It is used for
representing the following: (i) Control Hierarchy (ii) Structural Partitioning (iii) Data Structure and Hierarchy
(iv) Software Procedures.
38 Embedded Systems
Figure 1.11 shows the activities for software-design cycle during an embedded software-development
process and the cycle may be repeated till tests show the verification of specifications.
Development
One
Life
Cycle
Fig. 1.11 Activities for software design during an embedded software-development process
1.8.1 Design Metrics
A design process takes into account design metrics. There are several design metrics for an embedded system,
and these are listed in Table 1.8.
1.8.2 Abstraction of Steps in the Design Process
A design process is called bottom-to-top design if it builds by starting from the components. A design process
is called top-to-down design if it first starts with abstraction of the process and then after abstraction the
details are created. Top-to-down design approach is the most favoured approach. The following lists the five
levels of abstraction from top to bottom in the design process:
Random documents with unrelated
content Scribd suggests to you:
Embedded Systems Architecture Programming And Design 2nd Edition Raj Kamal
Embedded Systems Architecture Programming And Design 2nd Edition Raj Kamal
Embedded Systems Architecture Programming And Design 2nd Edition Raj Kamal
The Project Gutenberg eBook of Cricket
This ebook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this ebook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.
Title: Cricket
Editor: Horace G. Hutchinson
Release date: November 3, 2015 [eBook #50373]
Most recently updated: October 22, 2024
Language: English
Credits: Produced by Giovanni Fini, MWS and the Online
Distributed
Proofreading Team at http://www.pgdp.net (This file
was
produced from images generously made available by
The
Internet Archive/American Libraries.)
*** START OF THE PROJECT GUTENBERG EBOOK CRICKET ***
Embedded Systems Architecture Programming And Design 2nd Edition Raj Kamal
Embedded Systems Architecture Programming And Design 2nd Edition Raj Kamal
CRICKET
From a Painting by R. James.
TOSSING FOR INNINGS.
C R I C K E T
EDITED BY
HORACE G. HUTCHINSON
“DESIPERE IN LOCO”
LONDON: PUBLISHED AT THE OFFICES OF
“COUNTRY LIFE,” TAVISTOCK STREET, COVENT
GARDEN, W.C. & BY GEORGE NEWNES, Ltd.
SOUTHAMPTON STREET, STRAND, W.C.
MCMIII
Embedded Systems Architecture Programming And Design 2nd Edition Raj Kamal
PREFACE
Surely it is sheer neglect of opportunity offered by an official
position if, being an editor, one has no prefatory word to say of the
work that one is editing. It is said that that which is good requires
no praise, but it is a saying that is contradicted at every turn—or
else all that is advertised must be very bad. While it is our firm belief
that the merits of the present book—The Country Life Cricket Book—
are many and various (it would be an insult to the able heads of the
different departments into which the great subject is herein divided
to think otherwise), we believe also that the book has one very
special and even unique merit. We believe, and are very sure, that
there has never before been given to the public any such collection
of interesting old prints illustrative of England’s national game as
appear in the present volume. It is due to the kind generosity of the
Marylebone Cricket Club, as well as of divers private persons, that
we are able to illustrate the book in this exceptional way; and we
(that is to say, all who are concerned in the production) beg to take
the opportunity of giving most cordial thanks to those who have
given this invaluable help, and so greatly assisted in making the
book not only attractive, but also original in its attraction. In the first
place, the prints form in some measure a picture-history of the
national game, from the early days when men played with the wide
low wicket and the two stumps, down through all the years that the
bat was developing out of a curved hockey-stick into its present
shape, and that the use of the bat at the same time was altering
from the manner of the man with the scythe, meeting the balls
called “daisy-cutters,” to the straightforward upright batting of the
classical examples. The classical examples perhaps are exhibited
most ably in the pictures of Mr. G. F. Watts, which show us that the
human form divine can be studied in its athletic poses equally well
(save for the disadvantage of the draping flannels) on the English
field of cricket as in the Greek gymnasium. The prints, too, give us a
picture-history of the costumes of the game. There are the
“anointed clod-stumpers” of Broadhalfpenny going in to bat with the
smock, most inconvenient, we may think, of dresses. There are the
old-fashioned fellows who were so hardly parted from their top-hats.
These heroes of a bygone age are also conspicuous in braces. We
get a powerful hint, too, from the pictures, of the varying estimation
in which the game has been held at different times. There is a
suggestion of reverence in some of the illustrations—a sense that
the artist knew himself to be handling a great theme. In others we
see with pain that the treatment is almost comic, certainly frivolous.
We hardly can suppose that the picture of the ladies’ cricket match
would encourage others of the sex to engage in the noble game,
although “Miss Wicket” of the famous painting has a rather attractive
although pensive air—she has all the aspect of having got out for a
duck’s egg.
More decidedly to the same effect—of its differing hold on
popular favour—do we get a hint from the spectators assembled
(but assembled is too big a word for their little number) to view the
game. “Lord’s” on an Australian match day, or a Gents v. Players, or
Oxford and Cambridge, hardly would be recognised by one of the
old-time heroes, if we could call him up again across the Styx to take
a second innings. He would wonder what all the people had come to
look at. He hardly would believe that they were come to see the
game he used to play to a very meagre gallery in his life. But he
would be pleased to observe the progress of the world—how
appreciative it grew of what was best in it as it grew older.
Another thing that the collection illustrates is the various changes
of site of the headquarters of the game, if it had a headquarters
before it settled down to its present place of honour in St. John’s
Wood. There is a picture (vide p. v) of “Thomas Lord’s first Cricket
Ground, Dorset Square, Marylebone. Match played June 20, 1793,
between the Earls of Winchilsea and Darnley for 1000 guineas.” With
regard to this interesting picture, Sir Spencer Ponsonby-Fane, in his
catalogue of the pictures, drawings, etc., in possession of the
Marylebone Cricket Club, has a note as follows:—“This match was
Kent (Lord Darnley’s side) v. Marylebone, with Walker, Beldham, and
Wills (Lord Winchilsea’s side). M.C.C. won by ten wickets. It will be
noticed that only two stumps are represented as being used,
whereas, according to Scores and Biographies, it is known that as far
back as 1775 a third stump had been introduced; many
representations, however, of the game at a later date show only two
stumps.” No doubt at this early period there was no very fully
acknowledged central authority, and such little details as these were
much a matter of local option. The wicket shown in this picture does
not seem to differ at all from the wicket in the picture of “Cricket” by
F. Hayman, R.A. (vide p. 1), in the possession of the Marylebone
Club, though the date of the latter is as early as 1743. Neither does
the bat appear to have made much evolution in the interval. It is on
the authority of Sir Spencer Ponsonby-Fane, in the catalogue above
quoted, that we can give “about 1750” for the date of the picture
named “A Match in Battersea Fields” (vide p. 3), in which St. Paul’s
dome appears in the background. Here they seem to be playing with
the three stumps, early as the date is. Again, in the fine picture,
“painted for David Garrick” by Richard Wilson, of “Cricket at
Hampton Wick” (vide p. 375), three stumps are in use, and the bat
has become much squared and straightened. Of course the pictures
obviously fall into two chief classes—one in which “the play’s the
thing”; the cricket is the object of the artist’s representation; the
other in which the cricket is only used as an incidental feature in the
foreground, to enliven a scene of which the serious interest is in the
background or surroundings. But the pictures in which the cricket is
the main, if not the only, interest are very much more numerous. A
quaintly suggestive picture enough is that described in Sir S.
Ponsonby-Fane’s catalogue as, “Situation of H.M.’s Ships Fury and
Hecla at Igloolie. Sailors playing Cricket on the Ice.” In this, of
course, there is no historical interest about the cricket (vide p. 392).
The one-legged and one-armed cricketers make a picture that is
curious, though not very pleasant to contemplate; and the same is
to be said of the rather vulgar representation of the ladies’ cricket
match noticed above. The “Ticket to see a Cricket Match” (vide p.
40) shows a bat of the most inordinate, and probably quite
impossible, length; but we may easily suppose that the artist,
consciously or unwittingly, has exaggerated the weapon of his day.
Here too are two stumps only. We may notice the price of the ticket
as somewhat remarkably high, 2s. 6d.; but it was in the days when
matches were played for large sums of money, so perhaps all was in
proportion (length of bat excepted, be it understood). There is a
picture of the “celebrated Cricket Field near White Conduit House,
1787” (vide p. 17), which is named a “Representation of the Noble
Game of Cricket.” It is a picture of some merit, and evidently careful
execution, and here too the players are seen with bats of a
prodigious length; so it may be that these huge weapons came into
fashion for a while, only to be abandoned again when their
uselessness was proved, or perhaps when the legislature began to
make exact provision with regard to the implements used. In this
same picture of the “Noble Game of Cricket” a man may be seen
standing at deep square leg, who is apparently scoring the
“notches,” or “notching” the runs, on a piece of stick. This at least
appears to be his occupation, and it is interesting to observe it at
this comparatively late date, and at headquarters. In the match
between the sides led by Lord Winchilsea and Lord Darnley
respectively, it is seen that there are two tail-coated gentlemen
sitting on a bench, and probably scoring on paper, for it is hardly
likely that they can have been reporting for the press at that time.
England did not then demand the news of the fall of each wicket, as
it does now. Nevertheless, that there must have been a good deal of
enthusiasm for the game, even at a pretty early date, is shown
conclusively enough by the engraving (vide p. 190) of the “North-
East View of the Cricket Grounds at Darnall, near Sheffield,
Yorkshire.” What the precise date of this picture may be I do not
know, but it is evident that it must be old, from the costumes of the
players, who are in knee-breeches and the hideous kind of caps that
have been reintroduced with the coming of the motor-car. Also the
umpires, with their top-hatted heads and tightly-breeched lower
limbs, show that this picture is not modern. And yet the concourse
of spectators is immense. Even allowing for some pardonable
exaggeration on the part of the artist, it is certain that many people
must have been in the habit of looking on at matches, otherwise this
picture would be absurd; and this, be it observed, was not in the
southern counties, which we have been led to look on as the
nurseries of cricket, but away from all southern influence, far from
headquarters, in Yorkshire, near Sheffield. To be sure, it may have
been within the wide sphere of influence of the great Squire
Osbaldeston, but even so the picture is suggestive. The scorers are
here seated at a regular table. A very curious representation of the
game is that given in the picture by James Pollard, named “A Match
on the Heath” (vide p. 29). It is a good picture. What is curious is
that, though the period at which Pollard was producing his work was
from 1821 to 1846, the bats used in the game are shown as slightly
curved, and, more notably, the wicket is still of the two stumps only.
There are only two alternative ways of accounting for this: either
they still played in certain places with the two-stump wicket, or else,
which is not likely, Pollard was very careless, and no cricketer, and
took his cricket apparatus from some older picture. I observe, by the
way, that I have, on the whole, done less than justice to the ladies,
as they are portrayed playing the game, for though it is true that the
one picture is, as noticed, vulgar enough, there is another, “An
Eleven of Miss Wickets” (vide p. 248), that is pretty and graceful.
While some of the pictures in this collection are interesting mainly
for their curiosity, or as being something like an illustrated history or
diary of events and changes in the game, there are others that are
real works of art and beauty, sometimes depending mainly on their
expression of the game itself, and sometimes only using it as an
adjunct to the scenery. Of the former kind, we must notice most
especially the remarkable series of drawings by Mr. G. F. Watts, R.A.,
which show the batsman in the various positions of defence or
attack. To very many it will be a revelation that the great artist could
lend his pencil to a matter of such trivial importance (as some base
souls may deem it) as the game of cricket; but without a doubt that
great knowledge of anatomy, which has been one of the strong
points in all his paintings, has been learned in some measure from
these studies, which also give it a very high degree of expression.
There is a force, a vigour, a meaning about these sketches which are
interesting enough, if for no other reason than because they show
so vividly the inadequacy of the mechanical efforts of photography,
when brought into competition, as a means of expression, with the
pencil of a really great artist. You feel almost as if you must jump
aside out of the way of the fellow stepping forward to drive the leg
volley, or of the fearful man drawn back to cut, so forcefully is the
force expressed with which the batsman is inevitably going to hit the
ball (vide p. 67). One of the most charming pictures of those who
have taken cricket for their theme is that which is lent by His Majesty
the King to the M.C.C., and is styled “A Village Match.” It is by Louis
Belanger, of date 1768 (vide p. 361). Charming, too, is the picture
attributed to Gainsborough, “Portrait of a Youth with a Cricket-bat”;
it is said to be a portrait of George IV. as a boy, but it seems
doubtful. The bat here is curved, but hardly perceptibly; it shows the
last stage in evolution before the straight bat was reached (vide p.
208). Our frontispiece is a jolly scene—the ragged boys tossing the
bat for innings—“Flat or Round?” and the fellow in the background
heaping up the coats for a wicket. We all of us have played and
loved that kind of cricket. A wonderfully good and detailed picture is
that of “Kent v. Sussex” (vide p. 137). It is a picture of a match in
progress on the Brighton ground, and Brighton is seen in the
background; in the foreground is a group of celebrated cricketers in
the spectators’ ring, yet posed, in a way that gives a look of
artificiality to the whole scene, so as to show their faces to the artist.
Even old Lillywhite, bowling, is turning his head quaintly, to show his
features. One of the most conspicuous figures is the great Alfred
Mynn, who was to a former generation what W. G. Grace has been
to ours. All the figures are portraits, and every accessory to the
scene is worked out most carefully. The drawing is by W. H. Mason.
Sir Spencer Ponsonby-Fane has a note on this picture: “As a matter
of fact, this match, as here represented, did not take place, the men
shown in the engraving never having played together in such a
match, but they all played for their respective counties about 1839-
1841.” Very delightful, too, is the picture that is the last in our book
(p. 433), “At the End of the Innings”—an old veteran with eye still
keen, and firm mouth, telling of a determination to keep his wicket
up and the ball down “as well as he knows how,” and with an
interest in the game of his youth unabated by years. A jolly painting
is that of “Old Charlton Church and Manor House” (vide p. 415), with
the coach and four darting past, and the boys at cricket on the
village green. And last, but to many of us greatest of all, there is the
portrait of Dr. W. G. Grace, from Mr. A. Stuart Wortley’s picture,
which sums up a modern ideal of cricket that we have not yet found
ourselves able to get past (vide p. 228).
There are other pictures, not a few, that we might select for
notice, but already this ramble goes beyond due prefatory limits.
There are the sketches in which the cricket is made to point or
illustrate political satires. To do full justice to these, one would need
to be well versed in the history (other than the cricketing history) of
the period. But enough has been said. One could not let such a
gallery of old masters go without an attempt to do the showman for
them in some feeble way. They need neither help nor apology. They
are good enough to win off their own bat.
In our modern instances we have been no less lucky: with Mr.
Warner to bat, Mr. Jephson to bowl, Mr. Jessop to field, and the rest
of the good company, we do not know that any other choice could
have made our eleven better than it is; but after all, that is for the
public to say; it is from the pavilion, not the players, that the
applause should come.
CONTENTS
CHAP. PAGE
1. Some Points in Cricket
History 1
2. Early Developments of the
Cricketing Art 29
3. Batting 48
4. Bowling 79
5. Fielding 117
6. County Cricket 137
7. Amateurs and Professionals 193
8. Earlier Australian Cricket 217
9. English and Australian
Cricket from 1894 to
1902 251
10. University Cricket 296
11. Country-House Cricket 342
12. Village Cricket 361
13. Foreign Cricket 381
14. Cricket in South Africa 396
15. Cricket in New Zealand 409
16. Cricket Grounds 415
INDEX 443
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.
More than just a book-buying platform, we strive to be a bridge
connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.
Join us on a journey of knowledge exploration, passion nurturing, and
personal growth every day!
ebookbell.com

More Related Content

PDF
Embedded Systems Architecture Programming and Design 2nd Edition Raj Kamal
PDF
Embedded Systems Architecture Programming and Design 2nd Edition Raj Kamal
PDF
Embedded Systems Second Edition D Sundaram R M Kothari Dwarkadas Pralhaddas N
PDF
Embedded Systems Design Programming And Applications 1st Edition Ak Ganguly
PPTX
BESCK104C_Module 4 & 5.pptx presentatio
PPTX
Embedded system and development
PPT
Embedded basics For beginners
PPT
Embedded System Basics - Introduction.ppt
Embedded Systems Architecture Programming and Design 2nd Edition Raj Kamal
Embedded Systems Architecture Programming and Design 2nd Edition Raj Kamal
Embedded Systems Second Edition D Sundaram R M Kothari Dwarkadas Pralhaddas N
Embedded Systems Design Programming And Applications 1st Edition Ak Ganguly
BESCK104C_Module 4 & 5.pptx presentatio
Embedded system and development
Embedded basics For beginners
Embedded System Basics - Introduction.ppt

Similar to Embedded Systems Architecture Programming And Design 2nd Edition Raj Kamal (20)

PDF
Design Principles for Embedded Systems Kcs Murti
PPTX
EMBEDDED AND REAL TIME SYSTEMS Unit-1_6703.pptx
PPTX
Embedded Systems Introdution
PPTX
Embedded system
PDF
Embedded systems
PPTX
ES UNIT-I.pptx
PDF
PDF Embedded Systems Design 2nd Edition Steve Heath download
PDF
Intro to embedded systems programming
PDF
Embedded systems introduction
PPTX
The Comprehensive Guide to Embedded Systems Architecture: Building Blocks, De...
PPTX
EC 308 Embedded Systems Module 1 Notes APJKTU
PDF
Embedded System -Lyla B Das.pdf
PPTX
Language for Embedded System
PPTX
Language for embedded system
PDF
2e062d07-4a72-4792-af77-5e53147d4c81.pdf
PDF
Programming Embedded Systems With C And Gnu Development Tools 2nd Edition 2nd...
PPTX
Class 1 introduction to embedded systems
PDF
Embedded operating systems
PPTX
RECENT TRENDS or ADVANCES IN EMBEDDED SYSTEMS.pptx
PDF
K.Bhagavan gupta.pdf according to the labu
Design Principles for Embedded Systems Kcs Murti
EMBEDDED AND REAL TIME SYSTEMS Unit-1_6703.pptx
Embedded Systems Introdution
Embedded system
Embedded systems
ES UNIT-I.pptx
PDF Embedded Systems Design 2nd Edition Steve Heath download
Intro to embedded systems programming
Embedded systems introduction
The Comprehensive Guide to Embedded Systems Architecture: Building Blocks, De...
EC 308 Embedded Systems Module 1 Notes APJKTU
Embedded System -Lyla B Das.pdf
Language for Embedded System
Language for embedded system
2e062d07-4a72-4792-af77-5e53147d4c81.pdf
Programming Embedded Systems With C And Gnu Development Tools 2nd Edition 2nd...
Class 1 introduction to embedded systems
Embedded operating systems
RECENT TRENDS or ADVANCES IN EMBEDDED SYSTEMS.pptx
K.Bhagavan gupta.pdf according to the labu
Ad

Recently uploaded (20)

PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Classroom Observation Tools for Teachers
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
GDM (1) (1).pptx small presentation for students
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
Pharma ospi slides which help in ospi learning
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Complications of Minimal Access Surgery at WLH
PDF
Basic Mud Logging Guide for educational purpose
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Sports Quiz easy sports quiz sports quiz
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
01-Introduction-to-Information-Management.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
Final Presentation General Medicine 03-08-2024.pptx
Anesthesia in Laparoscopic Surgery in India
2.FourierTransform-ShortQuestionswithAnswers.pdf
Classroom Observation Tools for Teachers
human mycosis Human fungal infections are called human mycosis..pptx
Pharmacology of Heart Failure /Pharmacotherapy of CHF
GDM (1) (1).pptx small presentation for students
Microbial disease of the cardiovascular and lymphatic systems
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Pharma ospi slides which help in ospi learning
102 student loan defaulters named and shamed – Is someone you know on the list?
Complications of Minimal Access Surgery at WLH
Basic Mud Logging Guide for educational purpose
Module 4: Burden of Disease Tutorial Slides S2 2025
Sports Quiz easy sports quiz sports quiz
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
VCE English Exam - Section C Student Revision Booklet
01-Introduction-to-Information-Management.pdf
Microbial diseases, their pathogenesis and prophylaxis
Ad

Embedded Systems Architecture Programming And Design 2nd Edition Raj Kamal

  • 1. Embedded Systems Architecture Programming And Design 2nd Edition Raj Kamal download https://ebookbell.com/product/embedded-systems-architecture- programming-and-design-2nd-edition-raj-kamal-52398932 Explore and download more ebooks at ebookbell.com
  • 2. Here are some recommended products that we believe you will be interested in. You can click the link to download. Embedded Systems Architecture Design And Write Software For Embedded Devices 2nd Edition 2nd Daniele Lacamera https://ebookbell.com/product/embedded-systems-architecture-design- and-write-software-for-embedded-devices-2nd-edition-2nd-daniele- lacamera-47545404 Embedded Systems Architecture Explore Architectural Concepts Pragmatic Design Patterns And Best Practices To Produce Robust Systems Lacamera https://ebookbell.com/product/embedded-systems-architecture-explore- architectural-concepts-pragmatic-design-patterns-and-best-practices- to-produce-robust-systems-lacamera-33469636 Embedded Systems Architecture A Comprehensive Guide For Engineers And Programmers Tammy Noergaard https://ebookbell.com/product/embedded-systems-architecture-a- comprehensive-guide-for-engineers-and-programmers-tammy- noergaard-4409390 Embedded Systems Architecture A Comprehensive Guide For Engineers And Programmers Tammy Noergaard https://ebookbell.com/product/embedded-systems-architecture-a- comprehensive-guide-for-engineers-and-programmers-tammy- noergaard-4546396
  • 3. Embedded Systems Architecture For Agile Development A Layersbased Model 1st Ed Mirtalebi https://ebookbell.com/product/embedded-systems-architecture-for-agile- development-a-layersbased-model-1st-ed-mirtalebi-55613936 Embedded Systems Architecture Explore Architectural Concepts Pragmatic Design Patterns And Best Practices To Produce Robust Systems Daniele Lacamera https://ebookbell.com/product/embedded-systems-architecture-explore- architectural-concepts-pragmatic-design-patterns-and-best-practices- to-produce-robust-systems-daniele-lacamera-48704164 Embedded Systems Architecture Second Edition 2 Converted Daniele Lacamera https://ebookbell.com/product/embedded-systems-architecture-second- edition-2-converted-daniele-lacamera-55927800 Embedded Systems And Computer Architecture 1st Ed Gr Wilson Auth https://ebookbell.com/product/embedded-systems-and-computer- architecture-1st-ed-gr-wilson-auth-4341750 Memory Architecture Exploration For Programmable Embedded Systems Peter Grun Nikil Dutt Alexandru Nicolau https://ebookbell.com/product/memory-architecture-exploration-for- programmable-embedded-systems-peter-grun-nikil-dutt-alexandru- nicolau-4104508
  • 5. ,:. .·, , Embedded . Sy stems Architecture. Programming and Design Second Edition Raj Kamal 004.16 KAM Ill11111IIIIII 12994
  • 6. 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 arulkarand other university academicians. Dr PS Grover (Delhi). Dr HarvinderSingh Saini (Hyderabad), Dr S Radhakrishnan Srivilliputtur), Dr TV Gopal (Anna University) and Dr KM Mehata (Anna University)—for lheir constant encouragement nd appreciation of my efforts. I am thankful to the editorial team at McGraw-Hill Education India for their reviews and .iggestions. I acknowledge my late colleague Dr MK Sahu. Head. Computer Centre of the University, who will miss seeing iis new edition as he passed away during the last phase of the preparation of this book. I would also like to thank all (hose reviewers who look out lime to go through rhe script and give me their feedback. heir names are listed below. Ramanaryan Reddy >ept. ofComputer Science and Engineering, idira Gandhi Institute of Technology, New Delhi lilima Fulmare Hindustan College ofScience and Technology. Agra JikhiJ Kothari )ept. of Electronics and Communication Engineering, >haram Sinh Desai Institute of Technology. Gujarat upriya Kelkar 'umniins Institute of Engineering and Technology, 'nne University himli Adhikari >ept. ofElectronics and Communication and Engineering, 'alcutta Institute ofEngineering and Management. Kolkata Hpankar Ghosh )ept. of Electronics and Communication Engineering ■engal Institute of Technology. Kolkata lebashish De >ept. of Electronics and Communication Engineering. leghnad Saha Institute of Technology, Kolkata I P Kabisatpathy Dept, of Electronics and Instrumentation Engineering. College of Engineering and Technology. Bhubaneswar KK Mohapatra Dept, ofElectronics. National Institute of Technology, Rourkela JK Mendiratta Dept, ofElectronics and Communication and Engineering. II. K College of Engineering. Bangalore Lyla B Das Dept, of Electronics Engineering, National Institute of Technology, Calicut Santa Kumari Dept, of Electronics and Communication Engineering. Andhra University. Vishakhapafnafn V Murlidharan Dept, of Computer Science and Engineering. MS Ramaiah Institute of Technology. Bangalore Josephine P Kumar Dept, of Computer Science and Engineering. MV.I College of Engineering. Bangalore Stanley Johnson Invensys India Pvt. Ltd., Chennai Finally, I acknowledge my wife, Sushil Mittal, and my family members—Shalin Mittal. Needhi Mittal. Dr Ami Londaskar, Dr Shilpi Kondaskar, and Ms Arushi Kondaskar—for lheir immense love, understanding, and support during le writing of this revised edition.
  • 7. Contents Preface to the Second Edition Preface to the First Edition 1. Introduction to Embedded Systems 1.1 Embedded Systems 3 1.2 Processor Embedded into a System 5 1.3 Embedded Hardware Units and Devices in a System 10 1.4 Embedded Software in a System 19 1.5 Examples of Embedded Systems 27 1.6 Embedded System-on-chip (Soc) and Use of VLSI Circuit Design Technology 29 1.7 Complex Systems Design and Processors 32 1.8 Design Process in Embedded System 37 1.9 Formalization of System Design 42 1. 10 Design Process and Design Examples 43 1.11 Classification of Embedded Systems 52 1.12 Skills Required for an Embedded System Designer 53 2. 8051 and Advanced Processor Architectures, Memory Organization and Real-world Interfacing 2.1 8051 Architecture 62 2.2 Real World Interfacing 72 2.3 Introduction to Advanced Architectures 84 2.4 Processor and Memory Organization 96 2.5 Instruction-Level Parallelism !04 2.6 Performance Metrics 106 2.7 Memory-Types, Memory-Maps and Addresses 106 2.8 Processor Selection 113 2.9 Memory Selection 118 3, Devices and Communication Buses for Devices Network 3.1 IO Types and Examples 130 3.2 Serial Communication Devices 134 3.3 Parallel Device Pons 143 3.4 Sophisticated Interfacing Features in Device Ports 150 3.5 Wireless Devices 151 3.6 Timer and Counting Devices 152 3.7 Watchdog Timer 157 3.8 Real Time Clock 158 3.9 Networked Embedded Systems 159 3.10 Serial Bus Communication Protocols 160 3.11 Parallel Bus Device Protocols—Parallel Communication Network Using ISA. PCI, PCI-X and Advanced Buses 166 3.12 Internet Enabled Systems—Network Protocols 170 3.13 Wireless and Mobile System Protocols 175 4. Device Drivers and Interrupts Service Mechanism 4 1 Programmed-I/O Busy-wail Approach without Interrupt Service Mechanism 189 vii ix I 128 187
  • 8. Contents ■ n xiv j 4.2 ISR Concept 192 4.3 Interrupt Sources 200 4.4 Interrupt Servicing (Handling) Mechanism 203 4.5 Multiple Interrupts 209 4.6 Context and the Periods for Context Switching, Interrupt Latency and Deadline 211 4.7 Classification of Processors Interrupt Service Mechanism from Context-Saving Angle 217 4.8 Direct Memory Access 2/8 4.9 Device Driver Programming 220 .5. Programming Concepts and Embedded Programming in C, C++ and Java 5.1 Software Programming in Assembly Language (ALP) and in High-Level Language ‘C’ 235 5.2 C Program Elements: Header and Source Files and Preprocessor Directives 237 5.3 Program Elements: Macros and Functions 239 5.4 Program Elements: Data Types, Data Structures, Modifiers, Statements, Loops and Pointers 24/ 5.5 Object-Oriented Programming 262 5.6 Embedded Programming in C++ 263 5.7 Embedded Programming in Java 264 6. Program Modeling Concepts 6.1 Program Models 274 6.2 DFG Models 277 6.3 State Machine Programming Models for Event-controlled Program Flow 282 6.4 Modeling of Multiprocessor Systems 288 6.5 UML Modelling 295 Interprocess Communication and Synchronization of Processes, Threads and Tasks 7.1 Multiple Processes in an Application 305 7.2 Multiple Threads in an Application 306 7.3 Tasks 308 7.4 Task States 308 7.5 Task and Data 310 7.6 Clear-cut Distinction between Functions, ISRS and Tasks by their Characteristics 311 1 ."7 Concept of Semaphores 314 7.8 Shared Data 326 7.9 Interprocess Communication 330 7.10 Signal Function 332 7.11 Semaphore Functions 334 7.12 Message Queue Functions 335 7.13 Mailbox Functions 337 7.14 Pipe Functions 339 7.15 Socket Functions 34/ 7.16 RPC Functions 345 8. Real-Time Operating Systems 8.1 OS Services 351 8.2 Process Management 355 8.3 Timer Functions 356 8.4 Event Functions 358 8.5 Memory Management 359 234 273 303 3S0
  • 9. 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: Roadmapfor Various Coi.'l^e Studies 662 Appendix 2: Select Bibliography 663 Index 668
  • 11. Walkthrough Introduction to EmtxxJded Snrorru ” 1.1 EMBEDDED SYSTEMS 1.1.1 System 1.1.2 Embedded System Definition Qtu; of ihcdcllniiiun-. ul tmlxdded nJrm i' j- full..-v "Art rmbeddrd tjilrnt » u ivMrm 'hut hat indudikd u>)ln>ur u"d i<Kiputcf->u>rd^irc. »liuh muLrs it Rmtx'dJcd system*. have been defined in hi«>ks puhli'tud : ufdefinitions from otherv in the Held: Simple approach with interesting examples and figures Simple approach with figures to explain complex topic of system on chip for a mobile phone E^twMcd Systems •>. Other fcifieaftdmiltif units. An ciemptiry application >if Mich an embedded Sn(' is die iiu*nlc plmrus Sinele psiRx*-.' pncewirs. ASYSTEMONCMiP SIN&.E PURPOSE BUSES PROCESSORS OSGiTAi. asipi cmcuns . . TWER IP, MUX, BtTAADORESS .. - GENERATOR PORt INTERFACES PROGRAM PROGR-M. DUAC AOORESS data GENERATOR AN0PORT UEMORT IN1ERRUPT COHTROUCR MUtlt- PROCESSOR CBCWTS. • i5-2tr* -cm -a a% AREA AREA AREA i«t. J.}0 ASoCembeddedsyitetnanditscommonbutwithinternalASlPiintcniaiprocesson, IPl shored memories andperipheral interfaces A syStem t' 4 *” wnrClllg. organizing or dimly- nW •» male. '.< .1- si'irilnli; In J 11sei. plan, pc.glani.ir •<t ofrok‘. A spk-inisalw.an MrangeiTk-ni m which all ■!' umis a.w-mHe amt <nrk u-gilbc'according tnthe plan or prugrani. Consider a watch, It is a tnne-di-play .y.lcn, Ils pails j>< n. hardware. needles ami hatiery with Ihe huuliful dial, chassis and strap ffu-n- i*jrn iv Jinn* ttic real nine cicry s<v«Hid and cuntinwwsly update the lime every second. The system.program updates the display using three needles alterexh second. Itfutluwio let ofruin. Someoflhc.<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 itneiunutn same position after an hour, (in A shun needle nnatese>cry hour such dial il returns n> same position after twelve nours tvi All three needles return to the vane inclination alter twelve hours each day. Consirfcr a washing machine. It is an automatic clothes-washing system, lie impurunl hardware pans include its 'Ulus display panel, the switches and dials for u-er-defined programming, a tin.tor to rotate or spin, its power supply and control unit, an inner water level vow. a solenoid salve tor letting waler in and another valve fur letting water drain out. /here f^'ti wrguniw to wash clothes autunuticuHy accixding to a program preset hy a user. The rv.trrny-pr>'errwi rs activated Io wash llK dirty d<dn*s plxcd in a lank, whwh rotates or spins in preprogrammed steps and stages, fr fulton a ui "f nilrt Suioc of these roles arc as follows: (il Follow the step* strictly in ihc ii.llm.mg scipn-ricc Step 1. Wash hy .pinning the motor according to a programmed period. -Step II: Rinse in trcsli waler alter drarmng vol the dirty water, aid rinse a second lime ifthe system isnutprogrammedin waler-saving nude. Step lit Alter draining imii the watercompletely, spin the motor fast fora programmed (dud for drying by wniriiugingout waler Irunt ihr clothes. Step IV: Show the Wash-overstatus 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 Canbe m> rerxniion from Slept unless the u-arr resets the sysigmby in-efting another sc"1' clothesand rc.-els thr program
  • 12. 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
  • 13. Walkthrough xix _ ___>' 'pTCpaMrfrqCcneaptiaM&'«MiMadP'ognMr*qhC.C*« arddeva 1 Aa Java codn are fini interpreted by dieJVMdrum comparatively elowly. Thiadisadvantagecan he overcomeaafollowa-. Javabyte rode* can heconvenedtoriMsve nwtunecodesftx faw .•jraimg using jusl-rn-time (JlTJcompilalitm. A Jiva accdoalor teo-pwever) can be used in the system ft* fast code-run. X jAvabytncoderthatarcprtendeefresafalargermemory. AncntbedWJavatyOcm mayneedaminimum CfSI2kB POM and 512 kB RAM becameofthe needto fire tnoalJ 1VM and run the application. 5.7.4 J2ME (J»eofJ2ME/Java 2 Micro Edition) twJav*Cardc*EmbeddedJavahelpsinreducing the rude luetuK kH for (he uaual application! likeman card. How? The foUowiogarc the method! I, Use roteetaacaonly.Claueaftwbalkron-timcenvironment fetmtheVM interns! t'ormai araloMy (he programmer"* newJavaclauea are not tn internal formal. X Provideforconfiguring therun-time enviroctrneti. Eaamplcaofconfiguring aredrfetmg rAeesrepnun haniling clout), mer-defincdcluitloader),fileciautl. AWTclout), rrni'hnmitedthread), thread groufi. tnoill-dmmtiaularray) and Jong mdflooring data ryptt Ochercwfiguring examples are adding che specific cluaea—daugnme. input, output and streams fr> connecttons to network when needed. 3. Create one object at a time when running the multiple threads. 4. Reuse the object! insteadofusing a largernumber ofobjects. 3. Usescalar 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 ofthe use of package. J2ME provides fur the codes for the core classes only. 'These codes are stored al the ROM of the embedded system, fl provides for two alltmaiivecoctfiguraliooa.connecteddeviceconfiguration(CDClarsticonrcctcdlimiteddesireconfigurations rrtno CDCinheritsafewclasses frompackagesforoet.security,io.reflect,sccurity-cea test.leu.resources, util, jar and zip.CLDCdoes oct provide feethe applets, swt, bears, math, net, rmi. security and *ql and ten packages hr jiva.lang. There is ■ separate javu.mircoedrtiaa.so package itr CLDC cunfiguration. A PDA ipenonal digital assistant)or mobile phene uses CDC or CLDC. There is scaleable OS future inJ2ME. Thereit newvirtual machine. KVM nr analternative 10JVM. When using the KVM. the system needs a 64 kfi instead of 512 iB run-time environment. KVM features arc as follows: 1. Useoffollowing 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 thejava bO package farthe exceptions. 3. Ute ofaseparate setofAPIs(applicationprogram interlaces) insteadufJINI. JINI importable. But in (he embedded system, the ROM hu the application alreadyported and the user does not change it. 4. There is no verificationnf theclasses. KVM presumes the elistc as already validated t. Thereis m>object finaliUUoii thegarbage collectordoesnorhave tojx-rti*111 InlK-viinwiviigrtungcv in theobject 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 ofjava.Ung.rcflection, Thus, there are no interfaces that do the object serialization, debugging and profiling. Simple way of point-wise presentation of the details by using lists and tables Program ModafctgConcops Table 6.2 UML Basic Elements I Mndrllixy j CM" Widl dot) itrmitl are! thtra-' Class defines the states. aoribum ano tadunt**. A clau canaltobe aa active or atucract clAv i Afcvxi 1 Cl-ll! Object Active object A ciaM ingeneral may he abstract whencitherrarer* thorn states, operaon* <■ behaviour u eornpieiety defined, being h anabroadage.or when it is not fur creating objects but only a class, which c*tend>. implencau the abstract behaviours (iMthedil and specifies (he aharam roritues (fields ,* nremo) that class can creMc theobject. Aninstanceofadaathate.afunctionalcsaityfumed by copyingthetula.Stribum and hehavicw from 1 class. Anactiveclassdefinesw> activecfcjeninsurern(an active etass. A processor threadh equivalent 10 ite activeobject inUML becaascactive object poststhe signals like rhrewl and cart wait before sirring or rewriting the operationusing the mcdsoA. Anactiveclassac*>athreadetathathas 1defined slate, attributes, behaviours and behaviours foe the signals. Active dsa in addition, define* the -natroi by signal betevun (for a signalling oi^ct. which canbepouedandrarwhichitowy wailbeforestarting or resuming). Thus there is control on rhe class behaviour. Etreuilnrv Diutrurrvrviti.' ftriirr.enluh.a. Kev'Luigvtar hut uiih dissolves a. dsown in Figure ft IfX-’l ft* etas ccinic* I.* it. - identity, attributes and behaviuur. | (o[ciaiio<l' or mcihudt vr iouIUa-i <w j 1un.-iH*tsi Rr.tangvlar hot with din.no. for eU.x names for its identity, alirihutrs and opetvnns. but with prefit abstract w*b I each ahorjct behaioiur ami aliirtarc i kectangutu bus with ob^ct identity I follirwcd by wniKohm and class idcnlitv i as sfs—n in Figure ft Ittifi Rcvanpita For withitijcfl tienni followed by scmtrokei amiebss j identity,lair with prefic «tivc with ■ ibjevt idcniHy. j Rectangular hoi with thick border lines I arilinnerUivisiiMH ft* theciaM narr*v ! for the identity,anritxuesand Fehavnwn j foyuratnXB *id signals), hit with peefis as-ttvc withetar sdreeily. I Signal Anobject,wttidi itkm (postal)frontoneactiveetas (activeobject)tosaoiherwaiveetas,wpidiuufoe Man er resumption. Signal obsea tahaviuw tlcfines the behaviour(operation roahod)ofthe kaspmeeas eoasmmiatioiL (Signal (Section 4X2) is software ihslncttm or method (tncuon). which gtaeralea rmcrruftl Signal object tins attribute* (peatnctcrsl. ASribute maybejusta flagofI-tit. Signal identity within two pai**of iiacungandctaangsigns Ccshswral by Ctai idcniity (StmitatosttrcoiypeK Slereo- IJT* An Dspacked cofioficn <4 dements (tfritam or bdHvfrw)tiufB repeatedlytoed. Rectangularbos withstereotype identity ttme given ■ifhhIhe iwnpairsof aurring wadekmirg signsMbvnfbychr classickwkyasshownin figure 6.lf(r>. | IGmafi
  • 14. Walkthrough c^. SUM of UoMng andProgmmmmg -«n RTOS-> )/• End«/Cotte Cwd^pVyTLmeCtecftmclkm•/ 69. r BR coda farpo*Vg■*»<■ farlap U>TM.Cfc<*«y •/ SR_TIneU<tt <>( , _ y.r^f— far crMseg * nvtragrfar<r*and<fa*Cateeach >’»?mtmfl fate1VVMem KTCfct’f TO. OBMtaxIVs (MbosTuacD^StrMsg, timcDaac); 71. )7>En>c(13R_TtmeDate euV’l "11.2 CASE SHIMOF DIGITAL CAMERA HARDWARE ANDSOFWARE ARCHfTECTURE TKdigitalOWiwasiiuroduccdearlierinSection l.hl.4.Athgiialeainen issneeam^cidSrX.ISeetteilA I 1.10.4 Ihied tV camera funetkte. hardwwcaruj wdiwwc units. Hjirt' 1.14 4u—rd tWrdwwe tn) wfiwarccnmfeeicnu in * wnpted>g*al earner*. Scrtiou 11.2.t oral 11.2-2 gi't iVdcugn Ucyw cd* digital camera. Scslnwv 11 2.-* am) 11 24 dcwnV hvdware and telware atvfaitciurc. 11.2.1 Requirements RcquirmeW'ufiVdigital earner* e» he undcruond througha requirtmenttable given m Table II I nr OruiMfunrtumiiuU* duearner*an aifaOm: I. A « <9 onurcdlen crnuol Jitdicr. flash. <froexample, for pcnfdtcnh. direct mermuy KCOS. nJ fote*r. neo facts and eye-ball image control. GUI consist* of the IXD display tor graphics. and <wils-ViandIwueassf« inputs al camera. A liaahxrcen n amaher ahemaurc!•»VXD an)keypad. TV user give* commands for twitching on the omen. Huh. diuricr, adyvrl brightness. couth. s-ulnr.tare nJ transfer.Thet»crcnmmaruKvc in thehemoftruerropr ogaah.Eachsagnalgroerate* farm aute inpul fromant^craiedtwitchorburton. Uhen a bunucr(oropeningthedwuern prewol. a Ilash lanq) ghros and a self*timercircuitswitcVv offthe lamp aulcenalicaJIy. 2. IV (Vrarc generate light, which fill, m tV CCD array, which through an ADC tranuraw the bib far eachpitetineach row in the frame, and alsofor1Vdark area pitch ineachrow in a veriKsl scrip lie nflri cwrcctirm in CCDsignaledlight intensities far nit row. IV srnp t*m adjacentframe 3. A pkswvcrwvriHedanumberofpilets. TV numberofprset'usedfir:pcturedeterminesffwilroiiuL f*Kpicture sirtsoasof a number oThcrnnmlaJ and tenical pitch. Fur 2592 < 1944 (wtcKthereare 2592 * 1*44 s SO.'KMK arts cdcelts. i-Vti *ct of pixel hat three cells. fir the red. erren and blue nimprnuin J piacf. EachcellgetsespuaedIoa picture when tV shutter ufcanwruiysensim amet command. 7he »anrro ffrnrds rtepictures ironga rtarge-tiwipWdesires iCCDramy 0>r array crourtsefa UrgerutrnberofCCD cells. throe ateachpitch J L T. a / K C, o ■J '£ c T / ‘1/ Mx mt/ fruMrmAardtLJ m/rmi dr»iffi th?thtrr•i/’e* ihm/iuM */lt4 in t*wi t*toi/M«*fuW(ovrm rWw<rrkipwr 7V/i • uir i(mJ* tv1iAnouttRaniif<Avriita'* rr^tfMliufXCVM/!■AteA»H' rJaj•h/nn tn*r I.Hl2 /A/ •-^< it^fh ittifmilmrn«it«'rJru'br<iA ) V)4 <*'4 */ fcAiiA rvi tWAJtHfiicii'hr' ia < // /V ubftxD.n lAf»* itJw urr Ut i t !•* irvn» hrv ti* irf44 ijirrm uzr liilftL 2. Ta At* UHl. n wi/ u> iV^rnx*it-f/Ar ijifr***. J. Tit {ett'n fo defint htrdtrtft m/i tttprt’cri u>t ••• 7i>AumA*ki(Afbv*^Arwjhiw*rAiQcWrA fv r<rrv/w* tumid*• platedrfUmi *Ar ia^*ufT i*ru <7«iyK«KHJ>, /VTItftTfrM «/M^AaKr 1 T<t feat* lading fur d/ttin impUfnfnialion un^r A/VCVZY u*/ VrUti/li #T7V.V’. dlx« /V uif r/ tT( f,u fiu* ivniAa*<«/iin uaJ < w'rrn; *11.1 CASE STUDY OF EMBEDDED SYSTEM DESIGN AND COOING FOR AN AC/TOMATfC CHOCO1ATE VENDING MACHINE |ACVM) USING MUCOS RTOS ACVM wi* 1arodueerfcaiIiftNafiwn I H>,2. h ACVm fafKlic*'.hMJwjre i/xlWiwdc unib. Fipjfc t.U *1**01 j diagrarrunjcic ripvtxflLiui«nH ACVM SechnM JI I.Mo IIJ.AgivethedeMgnan AC'VM. V.2ik'wnt'cd MUCOS StTOS. It ta a portable. ROMabk. scabbte. proemfioe. real nn« jai! multiuskififkemeLSection 11.J.?4ncnhe* Gm AC'VM tohin^MUCtA**KHAS (Scctiw 9.2) propimrung envmmmrnl. 11.1.1 Requirements TIk crifui/ttwntt td dtf mo;hinr rm he uMentm«J lhAAigh j rrquftc/ncTM IjNc pun in Table N.I. 11.1.2 Specifications The ACVMspccircAik*i in briefarc v Jullu»>. 1. Ct h<s an ulfd^nunffie keypad <w» iftc l"p the flixhi/w TJol cnjhte* J chihJtoimencl»rth11whenboviacarbwciParr The«r»nerc.m Jw*cy*iimji-1 jnJ <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. •! ApplSirw SmanOStiiwiypi <rruwnUp,< DfSi. 5mirtU$Ql*ud (MtgQSun. AfT*Su>; 49. !• gaum Ddlyed uA uA.PW. •/ SmanOSTiincDlyRcura: (Lni.PWPmmijrp //•Eid ofWhilekxf’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 ofAPI* 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-VfanLi^ta-ExcH. awe-pad frv mono*, portd-ri'f., -Irk <bow andcamera. Meiile phurw witha large icudbem 0fe a vsloal keypad Mrtile pKxw witha -mall wrecn u*e* T9 keypad.TVpreirffcasestudyrelatein'SALScreacapplkatirti' bia ombilepfame wiipT9 keypsd farinput* Section 115.1 gives tV icquiranrautd SUS create and *cnd applii-ainwi'. Sectuut 12-5.2 give* thr ulusesandclxa diagrams. SccuM IISJgives tV abac diagram art! Scttam 12.5.4 gives cnminjmeaiiun hardwn. SerJon 1155 describes wfrwoeachVdure. Section 12 5.6 ck-w-nN-t the bnfiwnre lash, ud Syacteuriuiiun Afodclforrhe atgAotm 12.5.1 Requirements Apmcoaor.keypad,acieea.snxlchpadnrestery,penbleace rnemLCyandcreiimunicationunit*arc required heSMSocaeandoutappUcajraxScnucbpdaiaooryadihtMSorusedfuricntpnrarysavingofchmcieet 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 afterlhe pow ewiictes off. Further, when tVn. is a change there, an idenCaidtangcisrefleoedino/Vrcnrreiasedcbjeca.Forexample,a rtuncholueuina (V fietVCwcts. de<me dtmgclaftcsin thefile forMhosboot forndiiig tVe-onils. figure IUDshowsspeeife MS.whichMtBwdfortV SMS factnaeappUcataui.TV smen ismedfor (EflttayttgiVnsmLHgweIUDdtowsthadiacoefourCErux5cys(up.diwiLleft aMn^uldeixnedby ri. Cl Cland C4.Inoaugaiterkeybad. fear(Sifcreeaemerkeysaremed.TV mobilena»rkeyin tVkcy^J i-jradilhait fti’rtS.nsasfocxkeys Whenthetcyis(msad towardsdie left iVinnurmmea left foLuta '.rmgvcndtti.'' a»thetightdieeunwrwncsngbat-sk.aadseenfori^,Tyro drum<11 la edditkr. there are fmrcommand keys(righKomersccoodupw. kfi<omcr Kturxl-row. rigli-cnmer firU-rowand left-eonerTintmwldeaaedbykeyULowLkcyiRowlkcylRnwl atrikeyIRtiwI.Also,there arr. mne TVkeys faroumben I to 9 b wtf!a foralphabetsa to a.(« A io Z>. TVre we iwo modr-keys ftcyMI andkcyM2)andonekeyOkeyfarbyi^inantcharacteroianVrQnr yxav. A)/tcavn>cnc>cnio mallcase or eapiul case is controlled by amode-key'sstate. Teucharacw entered tn keying dependson Alate ofdie TV key.|Recall Rumples 5.6 and 6J andSectfon 63|. .
  • 15. Walkthrough xxi ErrMdod Sr»*™ 4 '£ A K K I Q o E c -r i E 5 K* B'jJf /mm iht f'JL^ing j/i rAn ,ipkf. fu Bu.<k ftinchotu andnpti vffTOSti hi' XTPX pCOS-lt ai MUCOX «n fht lent thrvugh iff riMwipffr— tMtinplf1V.I m 920. WAararymi*iUj artpaiwrfuafirfeMnJwJanminted fttr rtii h <0V/i MUCO31 finiftw* •ill 6r cj^w«A Itartin* *ht m<v «/ in rV AWCOJij tMp'fcvv/«ra remit• tvtn t]onaAtr UFOSit urdUtttf Jhit-diAr/pf/r«jrfvmwUrritum&AffrijJhmcW- and mhrddrdJtfTAVi lairt <m. ran k'rHo/Lj fuim Wtnd Hiivr* Stitmi m ofiff an HTOS far »^ph/ifiiand tfdmMrJ irifi'MJ vi/A fuivttfal tuyl loppy*• thniugh irnn tuirtplct^ Ktamplfi 9.21 *•• 9.27. bifffnnftx brtntrt <Ar ftHart1 irm*tpAarrt wwiJfestti u</4*/wi irirt ftQVdtvAai ofMUCOS ndlht •"•litfltof O»pw K* •rffdrxfr&tlAc Hv>fowt Ct OSfiX reirf-f*mrfjftufflTfa/uui. 5.1 BASK FUNCTIONS AND TYPES OF RTOSes A rumple* rnd'jtt*tirt£ embedded QUem detigfi re/juicc* (he dcvelapmcm of thwwghly tcUeJhupfree cafe* fa l. JAtegnacd devtJapmeft efivinmment 2 Tuk furwiiixnin emhakfcdC «emtakferf C** V Rcif-tinv ckxk-bwed hiftjwwt ind mftwireumen a. Scheduler V (Tevet driven «nd devicemiMger 6 Funetn«> f« [HTj vtiftg the vgMh. event (U< fnwp. wmiptvrr-hiftUmg fuHciiofti »d function* for the queue*, m*ilbu*fcvpipe ind wekeb. 7 AddiUauJ (qm'mjim. fur cutapte*TCMPof US8or RlwUjOth*a WIKof IfDAMdGUh. R Fjra md exception htftdtuig function. v. (ruingand5,ucmdehuggirywrffwirtforIcwagRTOS a%«e11a<devchpcrf embedded 4ppliCJ»f*, 9.UuJ shows the tag fumu*m* cipcttcd from the kmd of an RTOS. The RTDS'% hi«c the fdJowing future* in genenl. 1 Ic/tkI fuiw'iiouand ichcduling.*preemptive e» pre-cmRrtcpluslime dicing. 2 . Pnuniic* definicmns fur ihe CxsX> and 1ST. V Pnoniy mhenuncctenure <«oRjm ci pnurity ceitag (eattfe. J. Lmui fanumber of la«Xi 5. TA't synchroAUion md IPC function*. 6. IDE consisting of cdhew. platform builder. (iUI and trephre* wifiwjr?. •.(Cipher, ikbugp3|! mxI hnsi urpci 'vpprihoA ?. (revue imaging tool and devicedriven. (( f7iw*c /Y/SfX*(prwt f«qp<i_ini fvflnl*»n utrng lhe HJSf.Viparom tfr Tufbrw'ngs <<I The tufKinAi R«d*«LMiU^ i ««cuu«t«<ethe Vt.Wiek*.Idwwy*ufcvwMiuwv(the KWX<>«w* rhj DrfurKtun,^ i<w«rr. na^ vhner wlinkl JMUUuc.ck^andrmivcj.mdm*cw tel DrftfAaamn^.wuHi i / the ailnbvicid*a RISIX speoc. Ml 1he funciaau osteal < । mJ «fn_ftxi*e() unloAand M •<f«w. IcJ The fiwitiqn<i_iUjty I t ugMh<oa tinglewarling ti'Alh*ihctma^e<* av«UMe The mKv '*•<'* fcv a tab.whichha»hemtegrtrfedfaammTraik* IfegiUcrcd*ican* Jaitfot ukctocMcUihcna^nutifyj.Thi* prwranineMfO^fymefo/fuowrvertuk. A *er>cr tartKvcivertirm^iicatuMifroma drnt t*dc thruiighaMgndhaaikr fiuKtk* (like an JKKi Hl lie fofeinm Ifrtfktct ihr aiuitarteirfaPDSLC (ftroc fgt The rt)M .jane n^unlhik I 1net drun^Ac<f«wimrAhatcly hut petent* the<nhc«U«Uln«rung the ifurnc l>ripeur»dl gsdouuyvd urdyifthe 11M usk cfane* ebe ipcw.Jkak.iy iw b> dC'JtUxak* Ur nr'ruxy iMnriwd »ilhqmc IXB. VcWitfU 4><vcbw»etJcrAfaanal hjhuwtng fnii/tc* djTiotcwieficwnamhe u<d. liilTwu I-11-0 mdJok h«queue* bom hymultipleia*L* RfSIXqumaahavetheakiicavial firfh/wjag (e•kirr U4 ft41freJKm mt**ea single *stu*g ttfk is ivaiUMe IftJthereOnbe U pri<rityk*d» in place or imc|Wumly iocH.'KGfXTft VcWiniL 12. CVruAKfat*r»r drmcf»onuJ.+nir or //*Ck Wh0 a Uak oukx a tskJDalkKUto tScctnm 93.il. When OMOg the uU<eUtorf fmtfiom. the nunAcr tailiidca Uak ideAtfy.Sranlariy. a prpefSaiiim 7.14i<m mAidtSci.v*i 7 I$rim GteIStxdmX.6.?Iwhencruiei.afitedocrif*r<fetaurudUK m cmalmdanuntfrr. Ge cample, id n xuigrrdmideveify Ac devcccroud. Tte numbs*h rnwgixd iffciclaHiimeg jxi rd Jr numhen abpnJy aJkratrd Whe» mwij: Ac deviedreltfalImdiiMb. Aenmotierfarilitifca thedr*ice The devuTfmrtMesampln arcvfen iv rodorwriteorgd Ufibur9vet9afifttucck“c tSnm<i X 61 A pqrit.VaWicts h i HFO^w. wbuch i* managed <MbyquortfCAnO/tn*Nit by the dc«icc4n«er funutiiau. VtWud* ha* maoagcmlfuncucmf*M a pvpc-drHd(likeadeviceAixcrjpqw*/n*.Thi*11 analifiaA l‘»ihe namedppedriwrmUwi. fipe*ahn in^Jcfncnttheunafrro.tjrmdiMtanauwtoftok.*. FufKijiwi pipel'eiCfcaiC i’/jnp«//wprXo**r*. muuMki. maukfj/llytr/i crraici a pipe device named ptfnHaon farmuinaim«toi*i<7mcMps E*h mageoa he ofni&Ktnis) ua Artec It cnicr* ir.ma Iin uftk»ice*«mcrerfxuudev*f 1 fuiKtwnretrieve*th:1n(ofdevrfts withthede«uTnumbrrallftied id Meh device including|wpcdencr* Curuadu m cumplc (« crcAog a pipe namedupiprUurinfo.Aswnre itaa*1cachave a rottnfesn tX fnurtncuagev i&crname. po**«d. ictephunc number and c-ruaitID.tadi the< cuO b: of a nuAimum m/c of J2 byto iMify A gkXmi variablefJ»» an integer number farJfile docripfer that tdetuifeta (k*u*e anmng a ninahcrof de»K^ at die IO *yucm. 77k ik*k*e can te a fife ur ppe or wekcl nr>*her dote. K*ample V 26 ctpCam*Jk mde*torcreating. »*riimg and reading. Example 9.26 I. * include Vedjh.h"P Indiofe du [0 librvy fmlicn*. */ pipeDrv l)./* Iroafl a ppe driwr. */ 1.<* Declarefiledscnywt.♦I mfdi 3. P Moderefer* 10 the pennhoan inat* NFS (Network RfeScrrerL Mate h rev 00 for urnurfeial permi«tkM. *f IDI 4.7*Create pipeMmeJ a* pipeUicftnfo forJ menagecart )2 bytamaairaa */ 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 nrtpermitcreationand deletion ol t^vls durinp run. l*Aienxii>ndefines exh (1st<>fdifferentpriorityand activatesiiotfyinc taihecvdo. iMlcnsiim imi um; n>es<apequeues»1 vies semaphores as event flaponly with no askhavmp rvo-time deletion <T crvjlinn ofilr'C. |" OSEhMKAoiMcit............ i (Throestandards: MOPISTARC,Carrarwiotai slackand NetworkManagement) i'S "• i EOfcientdesignol , ■ . artMMtm' The .. ■ hinttie.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 -------------- ------ - SMfleadondoesnotprascraierrotems-naonavertsandVws provisiono>aMoUrtn independencewinregards to MMdualbgrtomenMenand&wrieithe pcxtaWey and * resMMy apflicatenwAeare I EHtenee the perfarmenca doveraltjean<Mo<k*pMngaddKondhardwaredueIo I eoqkancad utBDtimcdthek*Ag«we(«Mngrensna)tMAutodin (he vehicle I*Verfcation dfiesOonattyand Inqdemeraadon <•IsuUjpesn aalacledpantprefects I__________________________ _ ______ ______ Fig. J0.2 OSfKbasicftatures
  • 16. Walkthrough xxii Omi^r*i Txts'. £*«* CUtaJJy.Cce 3>A IMIItaam.May. 8U rtMtopW. ArartrahIMI r^lra.TeyknBlFroch.0«. 3B5. Ma*. USA.MM. 1) 9 mjKmmL pwY» EdKf^B. $i*«E<L 2003. 11 K.VXL‘WaiJrffcd teSpw.-Cortpo.MpMrffofrjvvf- fW l/<h» Drviwrh. 200). 0u^U» Bobftf WtOOVJCLNfT.UXA. 2OQ3. CwAtlia."Dr4«v CnMWfiortwi'', M SAraa. CTR«2)>2W1 prwtC V CK..VUdGv^k AvhabDm.AAr jkr&iMft A. PRINTED BOOKS I. GrWwnFto<liF»B’ll9ten«mJ Mm KaA*.vLm«AjfiianttDr AMa^>OaGvaA Fut^tSeixtanF^icliMSyriraA Uriah an".Springer, Mor.2006. prairie Halt2001 $1MA 8. B«JL W*t4W Jynmr K^i ■brtf Druft, BaflD*vonb itaam. Nw Mw. USA. 19%(T* Mfa. Mat 9021 Appendix 2: Select Bibliography us*,ro 4taf*Drdfa*, (--o— w. Vajrara. Hitnrs^wr Syaaray. Aral Raw Mariydrtaf*. Acporuiaj- 9etoa euto^icny 19. MpjVwvx.iMte nateAvs^lFx n^cntiog»»^ftiratMeit/ammsgujatl 20. lup/hraraEETAw.com(Frr rutecnlaAy ua W»l«otMted a>«KmrayUMel. 21 MpjrvwweRcnrWraibedBih |Fk wtaoibuf»• populareateftW lywem rra^mrat ’.2 tatIt w»«erMridtol-crranpiiucicotwelcacr IFor wbecrita*( » a pabular cotaddcd cooipuUf lyurm maywraj 2) Mp/AraafomBModdmtA ppdareoMdriri ry*a ■%! 21 KiqrWaaaaa«wrt^oiaxizri IA pofarls world "ifcradBfCkvadiacm wt^Hc isdaily de Lcy-ttnni m «*riawi M<f«n| C. PRINTED JOURNAL PAPER REFERENCES ■ HuanLl KnthiRrinasmMm.FruhaHSheaoy. Rods*A.G«0ri«adH>eD.SwWney.•«<«<Woufrww tat AralRawTeaAa M «oMrRoterirr", Jewraaio<SyacnaandSnftwwe.K>(1|. 962-971, 20% 2. C.R.<i«AN. Shnu. K-RawtiMhim.S.MrirwW.'EJIrriwhMnxSttrtnfxAmmuawAfpUcami: A .wr Srad>~, Pnx at 11* tE£E WemarariGoo/erracu oo EnriedfedtaJ Tima Coanpding Syarirra lad Afele&au" 2006 1 LrivBerre. FtBxkaaaiwad Knar. "CWfer Cnaien!frMdriAxotuotrn ttaxnrtj' IEEE Mem. 23r«). M-». xm 4 Wayw Well, Bail Oia BM Tehaa La. "SwvrGracrar orCaaPaaAMSyumu**. IETF Micro. 22(5).46-35, 2002. 1 tearLmur Btlrt. 'EtgSadagHartrWCf>-dt»f*tA Wreea-UPm FFCA>~ /Zryi) Jcamd. gp H-n. Saw,law,. 2UO2. 4 Ou-Tiny UM| and Hom hoy 'Or"*B UoftiatCndar CramedMA Caorararad Srrint StoMwy' law Vehicle SyumaDyrunucr. Jl.fV- Jll-JJO. 1909. 7. Tldad Mmu, */*arriAru /*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,raadMv<eraw‘">-*-^'*wv'(,'^sT*n’raidHo^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^-«mO-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 CunjAiirmN.>. Vta Ncawri.RcmhcJd.Nc» Tert, USA. 19% M fticrS|axi..Ar«nAvn<ra*r rnAnrd,.- y*r4W2Z. l^EdW. fttnurcHoS. fi^mrandCldTAW. IOC* 39 FrrJ liilull. Ajiu C'lramaocuiwn C'ravulrryrmniic ami Oyra S.urau. 4i>i ESaxa. tancr Edvuuoa. 1996ilowth (ndon Rrynra. XDIi 90 Sdhcnchauend PR Calvin. OprnirMy Srarrai, Addrwai WWe*. Rearimy.MA. USA. 19% VI. frier.MaramJrl. x*J GcalCamrai. t'nlrCratKa^tt FxtMti fr.rirri, Ahram AcademeniWicticn. lux. Id*.*}. 92 Oanicl Tahah.AdranrrdArn'mpmrrairai.McGrsv.HiH, L'SA 199$. 9J. Gajcl.. Daeul 0 . Frus Vahrt. Sxnj.r SaijAand lieGraf.Spr.dL'oramandUrain KmArddrrf.9.irrau, Enykwrod C'-IK NJ. Proiiee Hall. 1991 94. FranUinG. F. I I) fratII aaJ A. EAami-Nerai. frrdharl Cmi*Wrfthu&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. WilierI Grmdiam and TTrauiI-Vincera.MadrraGovralSyurwU-AAaluir<iAdUrvtra.Mo Wiley. 1901 47. Him, K. I andDanielTrial.Mmv.mmdfrn—*»r*o«r»ra iS4*o«mM/Adri«HMwif,McCmir-JIrU. im. %. JaaaGoouk.AriyPn.inxM>Me CnArdMSruew AndnacUSA. 1942. 99 GiemnddC. D, DwrjWCll Minra-mditr. Sanden Colkje PoUiahiat. 1991. I®. Arina >. tt^Dtug* niiAA4rimrc»MAdkfldwJAGrnirT^rawm.TAcGraw Udl. 190. B. WEBSITE REFERENCES I 1. MrpVAra*abpvina<e.’i.CTn IFnrTeliai.jmnirim DSP Pwcuo.Secwn lie, 136) 2. teipJhravncnmrfcaodrandaa (FarSedrie IA|. 3. MipyfrrivjuairdicMeiei/ukMiedaleVvmTJain and anodjuni (ForScetina 2J3|. 4 InpJfmwjmaoISrnieo13J,Ftr ARM froesm). 3. bepJAn<xjLeoaAcAkici/lnhccttA2«racL,appApa»6MaJrtrt IFor Scam 2-16( 6. hBpZMnrxaibcor| IRartemteunlajrf|aifonuancea ti mdaatfrii Syacsa,Seaana2.6and 133.3], 7. hspJ/aww.jarajriiLCDcn.'fTOiiea/ja»«c«rd (ForSca™ 3.73). <. tajrZArriw.nebc9edaxr»WrERW7<<cifiu»lin6_«rncnM>"IFa SBia 2 tl. 9. hip-jTw».nnx«n |ForSB%i9.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 (ForSecta IlJI. 14. tapJAraw.taBXoml-jjJanitariniiMttai jFcTluwiM “MBLSeco* till 13. IS^®c/2mmAteuxftteeAn|/taoriAVnMlira (For MIDI imafice. Seem 12.11 16. tapvKra*j(iiner(.ot (furSeaioa IZiwdbtGiiddiaettar<br VicofAcCLoefeafc sMeetataad SoftwaretfM1SRA(MastbdaoySrfwereRriiabiliiy AiwriMimH. 17. bap^ArwwaacarcKtaxcira'ieraayscTni/icarrLhon (Fee Secta ll4l IS. bspcffirwwftoavdJataeccnd-alind^^^erVusaRCardScarityZ(For Seetioo |14|.
  • 17. Embedded System^ i S.J«. INSTITUTE «F technology library BANGALORE - 5iO *60. ACCN. NO. DATE Introduction to £ E 2. Section 1. 1 Definitions of system and embedded system Section 1. 2 The processing unit ofan 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 ofan embedded system consists of I. An embedded system power source with controlled power­ dissipation /I clock oscillator circuit andclocking unit that letsa processor execute instructions Timers and a real time clock (RTC)for various timing needs ofthe system Reset circuit and watchdog timer System and external memories System input output (10) ports, serial, parallel and wireless communication, serial UniversalAsynchronous Receiverand Transmitter (UART) and other port protocols and buses 7. Devices such as Digital to Analog Converter (DAC) using Pulse Width Modulation (PWM), Analog to Digital Converter (ADC), Light Emitting Diode (LED) and Liquid Crystal Display (LCD) units, keypad and keyboard, touch screen, pulse dialer, modem and transceiver 8. Multiplexers, demultiplexers, decoderfor interfacing ofthe devices and buses
  • 18. 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 toolsfor system design K Section 1.5 Examples of applications ofembedded systems I Section 1.6 Designing an embedded system on a VLSI chip Q I. Embedded SoC (System on Chip) and examples of its applications 2. Uses ofApplication Specific Instruction Set Processor (ASIP) and Intellectual Property (IP) core 3. Field Programmable Gate Array (FPGA) core with single or multiple processor units on an ASIC chip Section 1.7 0 The complex system consists of 1. Embedded microprocessors or GPPs in complex systems e 2. Embedding ASIPs, microcontrollers. DSPs, media and network processors 3. Embedding application-specific system processors (ASSPs) 7 4. Embedding multiple processors in systems Section 1.8 E The design process has 1. Challenges in embedded system design C 2. Design metrics optimi~ation 3. Co-design of hardware and software components T Section 1.9 The system design formalism is defined I Section 1.10 The design of embedded hardware and software in an automatic chocolate vending V machine, smart card, digital-camera, mobile phone, mobile computer and robot are given as examples E Section 1.11 Classification of embedded systems into three types ' 'ir' S Section 1.12 Skills needed to design an embedded system
  • 19. Introduction to Embedded Systems I 3 । I__ ) 1.1 EMBEDDED SYSTEMS 1.1.1 System A system is a way of working, organizing or doing one or many tasks according to a fixed plan, program, or set of rules. A system is also an arrangement in which all its units assemble and work together according to the plan or program. Consider a watch. It is a time-display system. Its parts are its hardware, needles and battery with the beautiful dial, chassis and strap. These parts organize to show the real time every second and continuously update the time every second. The system-program updates the display using three needles after each second. 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 ofEmbedded 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”.
  • 20. 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 ofSmall 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
  • 21. 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 ofbasic 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
  • 22. 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 forgraphic 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 ofgeneral-purpose instructions. The CPU instruction set includes instructions for data transfer operations, ALU operations, stack operations, IO operations and
  • 23. 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 of32- 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.
  • 24. 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).
  • 25. Fig. 1.3 Commonly used microcontrollers in small-, medium- and large-scale embedded systems 2. Graphics processor: An image consists ofa numberof pixels. Forexample. Quartercommon 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, forexample, 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,
  • 26. ^"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 forspecific 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
  • 27. 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 timercircuit 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 ofthe reset that succeeds the processoractivation, 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
  • 28. 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 ifa fault develops and the program gets stuck. On restart, the system can function normally. Most microcontrollers have on-chip watchdog timers. The watchdog timer device is described in detail in Section 3.7. Consider a system controlling temperature. Assume that when the program starts executing, the sensor inputs work all right. However, before the desired temperature is achieved, the sensor circuit develops some fault. The controller will continue delivering the current nonstop if the system is not reset. Consider another example of a system for controlling a robot. Assume that the interfacing motor control circuit in the robot arm develops a fault during the run. In such cases, the robot arm may continue to move unless there is a watchdo" timer control. Otherwise, the robot will break its own arm! When a program executes the program counter increments or changes. An important circuit that associates a system is its reset circuit that can change the program counter to a power-up default value A progr im that is reset and runs on a power-up can be one of the following: (i) A system program that executes from the beginning, (u) A system boot-up program, (iii) A system initialization program. The watchdog timer reset is a required feature in control applications. 1.3.5 Memory In a system, there are various types of memory. Figure 1.4 shows a chart for various forms of memory that are present in systems. These are as follows: I. Internal RAM of 256 or 512 bytes in a microcontroller for registers, temporary data and stack. 2. Internal ROM/PROM/E2PROM for about 4 kB to 64 kB of program (in the case of microcontrollers). 3. External RAM for the temporary data and stack (in most systems) or internal caches (in the case of certain microprocessors). Various Forms of System Memory 1 Internal RAM at Micro­ controller 1 RAM at System- on- Chip or External RAM 1 Internal Caches at Microprocessor [Hold Copies of System Memory- ,th pages] 1 External RAM Chip(s) 1 Flash/ EEPROM 1 ROM/ PROM Memory Addresses at External and/or Internal the System Ports Fig. 1.4 The various forms of memories in the system
  • 29. r~~t Introduction to Embedded Systems 13 j 4. Internal Hash (in many systems the results ofprocessing can be saved in nonvolatile memory: lor example, system status periodically and images, songs, or speeches alter suitable formal compression). 5. Memory stick (or card): video, images, songs, or speeches and large storage in digital camera and mobile systems. Sony memory stick Micro (M2) is of size 15x12.5x1.2 mm and has a flash memory of 2 GB. Il has a data transfer rale of 160 Mbps (mega bit per second) and PRO-HG 4X0 Mbps and 120 Mbps write | since Dec. 2006. | 6. External ROM or PROM for embedding software (in almost all systems other than microcontroller- based systems). 7. RAM memory buffers al ports. 8. Caches (in pipelined and superscalar microprocessors). Table 1.1 details the functions assigned in embedded systems to the memories. ROM or PROM or EPROM embeds the software specific to the system. Table 1.1 Functions assigned to the memories in a system Memory Needed Functions ROM or EPROM or flash Storing application programs from where the processor fetches the instruction codes. Storing codes for system booting, initializing, initial input data and strings. Codes for RTOS. Pointers (addresses) of various interrupt service routines (ISRs). RAM (internal and external) and RAM for buffer Storing the variables during program run and storing the stack. Storing input or output buffers, for example, for speech or image. Memory slick A flash memory stick is inserted in mobile computing system or digital-camera. It stores high definition video, images, songs, or speeches after a suitable formal compression and stores large persistent data. EEPROM or Flash Storing nonvolatile results of processing. Cache Storing copies of instructions and data in advance from external primary memory and storing the results temporarily during processing. A system embeds (locates) the following either in the internal flash or ROM, PROM or in an external flash or ROM or PROM of the microcontroller: boot-up program, initialization data, strings or pictogram for screen-display or initial state of the system, programs for various tasks, ISRs and operating system kernel. The system has RAMs for saving temporary data, stack and buffers that are needed during a program run. The system uses flash for storing nonvolatile results. 1.3.6 Input, Output and IO Ports, IO Buses and IO Interfaces The system gets inputs from physical devices through the input ports. Examples arc as follows: I. A system gets inputs from the touch screen, keys in a keypad or keyboard, sensors and transducer circuits. 2. A controller circuit in a system gets inputs from the sensor and transducer circuits. 3. A receiverofsignals ora networkcard gets the input from acommunication system. |A communicalion system could be a fax or modem, or a broadcasting serviced 4. Ports receives inputs from a network or peripheral.
  • 30. 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
  • 31. 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 ofserial 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 halfthe 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.
  • 32. 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.
  • 33. 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
  • 34. 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 ofdevices 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 variousprocesses andfor handling multiple interrupts simultaneously pending for service. Chapter4 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, ifa 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.
  • 35. Introduction to Embedded Systems 19; 1.4 EMBEDDED SOFTWARE IN A SYSTEM The software is like the brain of the embedded system. 1.4.1 Final Machine Implementable Software for a System An embedded system processor executes software that is specific io a given application of that system. The instruction codes rind data in the final phase are placed in the ROM or flash memory for all the tasks that are executed when the system runs. The software is also called ROM image. Why? Just as an image is a unique sequence and arrangement of pixels, embedded software is also a unique placement and arrangement of bytes for instructions and data. Each code or datum is available only in the bits and bytes’ format. The system requires bytes at each ROM address, according to the tasks being executed. A machine implementable software file is therefore like a table having in each rows the address and bytes. The bytes are saved at each address of the system memory. The table has to be readied as a ROM image for the targeted hardware. Figure 1.5 shows the ROM image in a system memory: The image consists of the boot up program, stacks address pointers, program counter address pointers, application programs. ISRs, RTOS, input data and vector addresses. Interrupt Service I Routine Vector . Addresses of 2 Bytes each I Bootup ; Program j- Codes i Machine Codes; for Real Time i Operating f System (RTOS)j 2 Bytes for j Address of I Stack J" on i Reset ' System ROM Memory 1 2 Bytes for ■ Address from I Where System I Starts Execution on Power Up ' (Not Needed in i 80x86,8051,80196, .. ) Bytes for - . i Data as Inputs for each Interrupt < Service Routine r Machine Specific I Codes for •. each ! Program, ISR - L and Task Fig. 1.5 System ROM memory embedding the software, RTOS, data and vector addresses
  • 36. 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.
  • 37. Introduction to Embedded Systems ! 21 I Fig. 1.6 The process of converting an assembly language program into the machine codes and finally obtaining the ROM image 3. In the next step, the loader program performs the task of reallocating the codes after finding the physical memory addresses available at a given instant. The loader is a part of the operating system and places codes into the memory after reading the '.exe' file. This step is necessary because the available memory addresses may not start from 0x0000. and binary codes have to be loaded al different addresses during the run. The loader finds the appropriate start address. In a computer, after the loader loads into a section of RAM. the program is ready to run. 4. The final step of the system design process is locaiing these codes as a ROM image. The codes are permanently placed at the addresses actually available in the ROM. In embedded systems, there is no separate program to keep track oflhe available addresses at different times during the run. as in a computer. In embedded systems, therefore, the next step instead of loader after linking is the use of a locaior. which locates the IO tasks and hardware device driver codes al fixed addresses. Port and device addresses are llxed for a given system as per the interfacing circuit between the system buses and ports or devices. The locator program reallocates the linked file and creates a file fora permanent location of the codes in a standard format. The file formal may be in the Intel Hex file format or Motorola S-record format. The designer has to define the available addresses to locale and create files to permanently locate the codes. 5. Lastly, either (i) a laboratory system, called device programmer, takes as input the ROM image file and finally burns the image into the PROM or flash or (ii) at a foundry, a mask is created for the ROM of the embedded system from the ROM image file. |The process of placing the codes in PROM or flash is also called burning. | The mask created from the image gives the ROM in 1C chip form. To configure some specific physical device or subsystem such as the transceiver, machine codes can be used straightaway. For physical device driver codes or codes that utilize processor-specific features-invoking codes, ‘processor-specific’ assembly tahgua^b is used. A file is then created in three steps using an Assembler, Linker and Locator. The file has the ROM image in a standard format. A device programmer finally bums the image in the PROM or EPROM. A mask created from the image gives the ROM in IC chip form.
  • 38. 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 i1. i2, i3. a; float result', (v) il = 127; i2 - 29; i3 = 40; a = il + i2 + i3; result = sqrt (a): (vi) printf(result);) The coding for square root will need many lines of | ........ —~ code and can be done only by an expert assembly Preprocessor Commands language programmer. To write the program in a high .. . ~ ~ level language is very simple compared to writing it in ----------------------i-------------------- assembly language. ‘C‘ programs have a feature that Interrupt Service Routines adds the assembly instructions when using certain Tasks 1 N processor-specific features and coding for a specific ------------------------------------------ section, for example, a port device driver. Figure 1.7 Kernel and Scheduler shows the different programming layers in a typical Standard Library embedded ‘C’ software. These layers are as follows. Functions Including (i) Processor Commands, (u) Main Function. Functions for j (iii) Interrupt Service Routine, (iv) Multiple tasks, say. Sending Stack and I 1 to N. (v) Kernel and Scheduler, (vi) Standard library Receiving Stack _____ i j functions, protocol handling and stack functions. - ----------------------------------------------: Figure 1.8 shows the process of converting a Fig 17 The different program |ayers in the C program into the ROM image file. A compiler embedded software in C generates the object codes. It assembles the codes according to the processor instruction set and other specifications. The C compiler for embedded systems must, as a final step of compilation, use a code-optimizer that optimizes the codes before linking. After compilation, the linker links the object codes with other needed codes. For example, the linker includes the codes for the functions printf and sep t codes. Codes for device and driver (device control codes) management also link at this stage: for example, printer device management and driver codes. After linking, the other steps for creating a file for ROM image are the same as shown earlier in Figure 1.6. Preprocessor Commands Main Function Interrupt Service Routines Kernel and Scheduler Standard Library Functions Including Network Protocol Functions for Sending Stack and Receiving Stack Tasks 1....N C, C++, Java, Visual C++ are the languages used for software development. A C program has various layers: processor commands, main function, task and library functions, interrupt service routines and kernel (scheduler). The compiler generates an object file. Using a linker and locator, the file for the ROM image is created for the targeted hardware.
  • 39. 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 ofthe 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.
  • 40. 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 ofphysicaldevices. 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) ofa 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.
  • 41. . 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 archillocated 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)
  • 42. I 26 Embedded Systems Integrated development This is a development software and hardware environment that consists of simulators with Software Tools Cross assembler Application For converting object codes or executable codes for a processor to other codes for another processor and vice versa. The cross-assembler assembles the assembly codes of the target processor as the assembly codes of the processor of the PC used in system development. Later, it provides the object codes for the target processor. These codes will be the ones actually needed in the final developed system. Simulator To simulate all functions ofan embedded system circuit including that or additional memory and peripherals. It is independent ofa particular target system. It also simulates the processes that will execute when the codes of a particular processor execute. Source-code engineering software For source code comprehension, navigation and browsing, editing, debugging, configuring (disabling and enabling the C++ features) and compiling. RTOS Refer Chapters 8 to 10. Stethoscope For dynamically tracking the changes in any program variable or parameter. It demonstrates the sequence of multiple processes (tasks, threads, service routines) that execute and also records the entire time history. Trace scope To help in tracing the changes in modules and tasks with time on the X-axis. A list of actions also produces the desired time scales and the time expected to be taken for different tasks. ' The locator program output is in the Intel hex Hie or Motorola S-record format. environment editors, compilers, assemblers, RTOS, debuggers, stethoscope, tracer, emulators, logic analyzers, and application code burners in PROM or Hash. Prototyper This simulates and does source code engineering including compiling, debugging and, browsing and summarizing the complete status of the final target system during the development phase. Locator* This uses a cross-assembler output and a memory allocation map and provides the locator program output as a hex-file. It is the final step of the software design process or an embedded system. i Software tools are used to develop software for designing an embedded system. Debugging tools, such as a stethoscope, trace scope, and sophisticated tools such as an integrated development environment and prototype development tools, are needed for the integrated development of system software and hardware. 1.4.9 Software Tools Required in Exemplary Cases Table 1.3 gives the various tools needed to design exemplary systems. RTOS is essential in y- Jis most embedded systems to process multiple tasks and ISRs. Embedded systems for medium scale and sophisticated applications need a number of sophisticated software and debugging tools.
  • 43. Introduction to Embedded Systems Table 1.3 Software tools required in exemplary systems Software Tools Automatic Chocolate Vending Machine* Data Acquisition System Robot Mobile Phone Adaptive Cruise Control System with String Stability# Voice Processor Editor Yes Yes Yes Yes Yes NR Interpreter Yes NR Yes NR NR NR Compiler Yes Yes Yes Yes Yes Yes Assembler Yes Yes Yes No No No Cross Assembler NR Yes Yes No No No Locator Yes Yes Yes Yes Yes Yes Simulator NR Yes Yes Yes Yes Yes Source code engineering software NR NR NR Yes Yes Yes RTOS Yes MR Yes Yes Yes Yes Stethoscope NR NR NR Yes Yes Yes Trace scupe NR NR NR Yes Yes Yes Integrated development environment NR Yes Yes Yes Yes Yes Prototyper NR No No Yes Yes Yes Note: NR means not required. MR means may be required in a specific complex system but not compulsorily needed. 1.5 EXAMPLES OF EMBEDDED SYSTEMS Embedded systems have very diversified applications. A few select application areas of embedded systems are telecommunications, smart cards, missiles and satellites, computer networking, digital consumer electronics, and automotives. Figure 1.9 shows the applications of embedded systems in these areas. A few examples of small scale embedded system applications are as follows: 1. Point of sales terminals: automatic chocolate vending machine 2. Stepper motor controllers for a robotics system 3. Washing or cooking systems 4. Multitasking toys 5. Microcontroller-based single or multidisplay digital panel meter for voltage, current, resistance and frequency 6. Keyboard controller 7. SD, MMI and network access cards 8. CD drive or hard disk drive controller
  • 44. 0 Embedded Systems 9 The peripheral controllers ofa computer, for example, a CRT display controller, a keyboard controller, a DRAM controller, a DMA controller, a printer controller, a laser printer controller, a LAN controller, a disk drive controller 10. Fax or photocopy or printer or scanner machine 11. Remote (controller) of TV 12. Telephone with memory, display and other sophisticated features Telecom I J, tg I - Mobile Computing - Mobile Access Smart Cards I - Banking - Security Missiles and - Defence - Aerospace - Communication Computer Networking Systems and Peripherals (a) - Networking Systems - Image processing - Printers - Networks Cards - Monitors and Displays Digital Consumer Electronics -DVDs - Set top boxes - High definition TVs - Digital cameras Automotive - Motor Control System - Cruise Control - Engine/Body Safety - Robotics in Assembly Line - Car Entertainment - Car Multimedia (0 Fig. 1.9 Applications of the embedded systems in various areas 13. Motor controls systems—for example, an accurate control of speed and position of the d.c. motor, robot and CNC machine; automotive applications such as closed loop engine control, dynamic ride control, and an antilock braking system monitor 14. Electronic data acquisition and supervisory control system 15. Electronic instruments, such as an industrial process controller 16. Electronic smart weight display system and an industrial moisture recorder cum controller 17. Digital storage system for a signal wave form or for electric or water meter reading system 18i Spectrum analyzer 19. Biomedical systems such as an ECG LCD display cum recorder, a blood-cell recorder cum analyzer, and a patient monitor system Some examples of medium scale embedded systems are as follows:
  • 45. 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,
  • 46. 30 Embedded Systems 5. Discrete cosine transforms for signal processing applications, 6. Memories, 7, Multiple standard source solutions, called IP (Intellectual Property) cores, 8. Programmable logic device and FPGA (Field Programmable Gate Array) cores, 9. Other logic and analog units. An exemplary application of such an embedded SoC is the mobile phone. Single purpose processors, ASIPs and IPs on an SoC are configured to process encoding and deciphering, dialing, modulating, demodulating, interfacing the key pad and multiple line LCD matrix displays or touch screen, storing data input and recalling data from memory. Figure 1.10 shows an SoC that integrates internal ASICs, internal processors (ASIPs), shared memories and peripheral interfaces.on a common bus. Besides a processor, memories and digital circuits with embedded software for specific applications, the SoC may possess analog circuits as well. A SYSTEM ON CHIP I'SINGLE PURPOSE!_ ;PROCESSORS n I ASIPs ! —— i ,ps : BUSES DIGITAL ; CIRCUITS- ' TIMER. ; MUXs.... | I DATA ADDRESS ; I GENERATOR I I.... T--------- ____ LC.-JL ;-------- i PROGRAM ■ ADDRESS 1 i GENERATOR I PROGRAM, DATA AND PORT MEMORY PORT i INTERFACES I DMAC MULTI­ PROCESSOR I ; DSP I ; gpp : I INTERRUPT ; CONTROLLER ANALOG CIRCUITS, A/D FIASH or E2PROM L H------------------> - 15-20% AREA - 60% AREA -20-25% AREA 7|A’ Fig. 1.10 A SoC embedded system and its common bus with internal ASIPs, internal processors, IPs, shared memories and peripheral interfaces
  • 47. 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 adaptivefiltering 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 ofgates 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.]
  • 48. 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 Bothfeatures Stream I 68HCxxx Motorola CISC Stream 2 80x86 Intel CISC Stream 3 SPARC Sun RISC Stream 4 ARM ARM RISC with CISC functionality 1.7.2 Embedding a Microcontroller Microcontroller VLSI cores or chips for embedded systems are usually among the five streams of families given in Table 1.5. Table 1.5 Major microcontrollers®1 used in the embedded systems Stream Microcontroller Family Source CISC or RISC or Both Stream 1 68HCHxx. HC12xx. HC16xx Motorola CISC Stream 2 8051. 8051 MX Intel. Philips CISC Stream 3 PIC I6F84 or 16C76, 16F876 and PIC 18 Microchip CISC Stream 4’ Microcontroller Enhancements of CORTEX-M3 ARM9/ARM7 from Philips, Samsung and ST Microelectronics ARM, Texas. Philips, Samsung and ST Microelectronics etc. RISC Core with CISC functionality Other popular microcontrollers are as follows, (i) Hitachi H8x family and SuperH 7xxx. (ii) Mitsubishi 740,7700, M16C and M32C families, (iii) National Semiconductor COP8 and CR16 /16C. (iv) Toshiba TLCS 900S (v) Texas Instruments MSP 430 for low voltage battery based system, (vi) Samsung SAM8. (vii) Ziglos Z80 and eZ80 1.7.3 Embedding a DSP A digital signal processor (DSP) is a processor core or chip for the applications that process digital signals. [For example, filtering, noise cancellation, echo elimination, compression and encryption applications.] Just as a microprocessor is the most essential unit of a computing system, a DSP is essential unit of an embedded
  • 49. 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.
  • 50. I 34 Embedded Systems In a cell phone, a number of tasks have to be performed: (a) Speech signal-compression and coding, (b) Dialing (c) Modulating and Transmitting (cl) Demodulating and Receiving (e) Signal decoding and decompression (f) Keypad interface and display interface handling (g) Short Message Service (SMS) protocol­ based messaging (h) SMS message display. For all these tasks, a single processor does not suffice. Suitably synchronized multiple processors are used. Consider a video conferencing system. In this system, a quarter common intermediate format—Quarter- CIF—is used. The number of image pixels is just 144 x 176 as against 525 x 625 pixels in a video picture on TV. Even then, samples of the image have to be taken at a rate of 144 x 176 x 30 = 760320 pixels per second and have to be processed by compression before transmission on a telecommunication or Virtual Private Network (VPN). [Note: The number of frames are 25 or 30 per second (as per the standard adopted) for real­ time displays and in motion pictures.] A single DSP-based embedded system does not suffice to get real-time images during video conferencing. Real-time video processing and multimedia applications most often need a multiprocessor unit in the embedded system. Multiple processors or dual core processors are used when a single microprocessor does not meet the needs of the different tasks that execute concurrently. The operations of all the processors are synchronized to obtain optimum performance. 1.7.7 Embedded Processor/Embedded Microcontroller An embedded processor is a processor with special features that allow it to embed multiple processes into the system. Real time image processing and aerodynamics are two areas where fast, precise and intensive calculations and fast context switching (from one program to another) are essential. Embedded processor is the term sometimes used for processor that has been a specially designed such that il has the following capabilities: 1. Fast context switching and thus lower latencies of the tasks in complex real time applications. [Section 4.6] Fast context switching means that the calling program or interrupted service routine CPU registers save and retrieve fast (Section 4.6], 2. 32-bit or 64-bit atomic addition and multiplication, and no shared data problem in the operations with large operands with each operand placed in two or four registers. (Section 7.8.1 ] 3. 32-bit RISC core for fast, more precise and intensive calculations by the embedded software. Embedded microcontroller is the term sometimes used for specially designed microcontrollers that have the following capabilities: I. When a microcontroller has internal RAM, large flash or ROM, timer, interrupt handler, devices and peripherals and there is no external memory or device or peripheral required for the given application. 2. Fast context switching and thus lower latencies of the tasks in complex real time applications. For example, ARM and 68HClx microcontrollers save all CPU registers fast An embedded processor is term used for processors with fast processing, fast context-switching and atomic ALU operations. An embedded microcontroller is the term used for a microcontroller that has internal RAM, large flash or ROM, timer, interrupt handler, internal devices and internal peripherals and there is no external memory or device or peripheral required for the given application.
  • 51. Introduction to Embedded Systems Complex System Embedded Processors Table 1.7 gives different processors that can embed in a complex system. Table 1.7 Processors in complex embedded systems Processor Application Advantage Disadvantage General Purpose Microprocessor When intensive computations are required, caches are used and pipeline and superscalar operations are needed and large embedded software is to be located in the external memory cores or chips. No engineering cost for designing the processor. Additional redundant execution units that are not needed in the given system design Microcontroller Used with internal memory, devices and peripherals and when embedded software is to be located in the interna! ROM or flash. No engineering cost for designing the processor with internal memory, devices and peripherals. Additional manufacturing costs and redundant application units which are not needed in the given system design. DSP Used with signal processing-related instructions for filters, image, audio, and video and CODEC operations. No engineering cost involved for designing the signal processor. Manufacturing cost may be high. Single purpose processors and application specific system processor i Control IO and bus operations and peripherals and devices. They support other processing units in the system and execute specific hardware processes fast. In-house engineering cost of development, royalty payments for an IP core of processor and time-to-market cost. Dual core processor To significantly enhance the performance of the system. Reduced engineering cost. Manufacturing cost, as dual core processors are costly. Accelerator To accelerate the execution of codes. A floating point coprocessor accelerates mathematical operations and Java accelerator 'Accelerates Java code execution. Increases performance by co-processing with the main processor. i Engineering cost of development or royalty payments for IP core of processor and time-to- market cost.
  • 52. 36 Embedded Systems A DSP for mobile phones, for example, OMAP of Texas Instruments, uses the effective power dissipation methods of dynamic switching both for power supply voltage and operating frequency of the CPU core. For a number of applications, the DSPs cores may not suffice. Domain specific ASIPs have specific instruction sets. For lOs. network, media or security applications, smart card, video game, palm top computer, cell phone, mobile-internet, hand-held embedded systems. Gbps transceivers, Gbps LAN systems, satellite or missile systems, we need special processing units in a VLSI circuit designed to function as a processor with an instruction-set for programmability. These special units are called domain-specific ASIP. 1.7.8 Embedding ARM processor Examples of Stream 4 GPPs in Table 1.4 are ARM 7 and ARM 9. The core of these processors can be embedded onto a VLSI chip or an SoC. An ARM-processor VLSI-architecture is available either as a CPU chip or for integrating it into VLSI or SoC. ARM, Intel and Texas Instruments and several other companies have developed such processors. ARM provides CISC functionality with RISC architecture at the core. The cores of ARM7. ARM9 and their DSP enhancements are available for embedding in systems. (Refer to http:/ www.ti.com/sc/ docs/asic/modules/arm7.htm and arm9.htm], ARM integrates with other features (for example DSP) in new GPPs, which are available from several sources, for example, Intel and Texas Instruments. Exemplary ARM 9 applications are setup boxes, cable modems, and wireless-devices such as mobile handsets. ARM9 has a single cycle 16 x 32 multiple accumulate unit. It operates at 200 MHz. It uses 0.15 pm GS30 CMOSs. It has a five-stage pipeline. It incorporates RISC core with CISC functions. It integrates with a DSP .vhen designed for an ASIC solution. An example is its integration with DSP is TMS320C.55x from Texas Instruments. [Refer to http:/www.ti.com/sc/docs/asic/modu)es/arm7.htm and arm9.htm] A lower performance but very popular version of ARM9 is ARM7. It operates at 80 MHz. It uses 0.18 pm based GS20 pm CMOSs. Using ARM7, ARM9 and CORTEX-M3, a large number of embedded systems have recently become available. Lately, a new class of embedded systems has emerged that additionally incorporates ASSP chips or cores in its design. 1.7.9 Embedding ASSP Assume that there is an embedded system for real-time video processing. Real-time processing arises for digital television, high definition TV decoders, set-up boxes. DVD (Digital Video Disc) players, web phones, video-conferencing and other systems. An ASSP that is dedicated to these specific tasks alone provides a faster solution. The ASSP is configured and interfaced with the rest of the embedded system. Assume that there is an embedded system that using a specific protocol interconnects, its units through specific bus architecture to another system. Also, assume that suitable encryption and decryption is required. [The output bit stream encryption protects messages or design from passing to an unknown external entity.] For these tasks, besides embedding the software, it may also be necessary to embed some RTOS features [Section 1.4.6]. If the software alone is used for the above tasks, it may take a longer time than a hardwired solution for application-specific processing. An ASSP chip provides such a solution. For example, an ASSP chip [from i2Chip (http://www.i2Chip.com)] has a TCP, UDP, IP, ARP and Ethernet 10/100 MAC (Media Access Control) hardwired logic included into it. The chip from i2Chip, W3I00A, is a unique hardwired internet connectivity solution. Much needed TCP/IP stack processing software for networking tasks is thus available as a hardwired solution. This gives output five times faster than a software solution using the system’s GPP. It is also an RTOS-less solution. Using the same microcontroller in the embedded system to which this ASSP chip
  • 53. Introduction to Embedded Systems interfaces, Ethernet connectivity can be added. Another ASSP, which is now available, is the ‘Serial-to-Elhcrnet Converter (IIM7I00). It does real-time data processing by a hardware protocol stack. It needs no change in the application software or firmware and provides the most economical and smallest RTOS-solution. An ASSP is used as an additional processing unit for running application specific tasks in place of processing using embedded software. 1.8 DESIGN PROCESS IN EMBEDDED SYSTEM The concepts used during a design process are as follows. 1. Abstraction: Each problem component is first abstracted. For example, in the design of a robotic system, the problem of abstraction can be in terms of control of arms and motors. 2. Hardware andSoftware architecture: Architectures should be well understood before a design. 3. Extra functional Properties: Extra functionalities required in the system being developed should be well understood from the design. 4. System Related Family of designs: Families of related systems developed earlier should be takenfinto consideration during designing. 5. Modular Design: Modular design concepts should be used. System designing is fast by decomposition of software into modules that are to be implemented. Modules should be such that they can be composed (coupled or integrated) later. Effective modular design should ensure effective (i) function independence, (ii) cohesion and (iii) coupling. (a) Modules should be clearly understood and should maintain continuity. (b) Also, appropriate protection strategies are necessary for each module. A module is not permitted to change or modify another module functionality. For example, protection from a device driver modifying the configuration of another device. 6. Mgpping: Mapping into various representations is done from software requirements. For example, data flow in the same path during the program flow can be mapped together as a single entity. Transform and transaction mapping design processes are used in designing. For example, an image is input data to a system: it can have a different number of pixels and colours. The system does not process each pixel and colour individually. Transform mapping of image is done by appropriate compression and storage algorithms. Transaction mapping is done to define the sequence of images. 7. User Interface Design: User interface design is an important part ofdesign. User interfaces are designed as per user requirements, analysis ofthe environment and system functions. For example, in an automatic chocolate vending machine (ACVM) system, the user interface is an LCD multiline graphics display. It can display a welcome message as well as specify the coins needed to be inserted into the machine for each type of chocolate. The same ACVM may be designed with touchscreen User Interface (GUI), or it may be designed with Voice User Interfaces (VUIs). Any of these interface designs has to be validated by the customer. For example, the ACVM customer who installs the machine must validate message language and messages to be displayed before an interface design can proceed to the implementation stage. 8. Refinements: Each component and module design needs to be refined iteratively till it becomes the most appropriate for implementation by the software team. ,th The software design process may require use of Architecture Description Language (ADL). It is used for representing the following: (i) Control Hierarchy (ii) Structural Partitioning (iii) Data Structure and Hierarchy (iv) Software Procedures.
  • 54. 38 Embedded Systems Figure 1.11 shows the activities for software-design cycle during an embedded software-development process and the cycle may be repeated till tests show the verification of specifications. Development One Life Cycle Fig. 1.11 Activities for software design during an embedded software-development process 1.8.1 Design Metrics A design process takes into account design metrics. There are several design metrics for an embedded system, and these are listed in Table 1.8. 1.8.2 Abstraction of Steps in the Design Process A design process is called bottom-to-top design if it builds by starting from the components. A design process is called top-to-down design if it first starts with abstraction of the process and then after abstraction the details are created. Top-to-down design approach is the most favoured approach. The following lists the five levels of abstraction from top to bottom in the design process:
  • 55. Random documents with unrelated content Scribd suggests to you:
  • 59. The Project Gutenberg eBook of Cricket
  • 60. This ebook is for the use of anyone anywhere in the United States and most other parts of the world at no cost and with almost no restrictions whatsoever. You may copy it, give it away or re-use it under the terms of the Project Gutenberg License included with this ebook or online at www.gutenberg.org. If you are not located in the United States, you will have to check the laws of the country where you are located before using this eBook. Title: Cricket Editor: Horace G. Hutchinson Release date: November 3, 2015 [eBook #50373] Most recently updated: October 22, 2024 Language: English Credits: Produced by Giovanni Fini, MWS and the Online Distributed Proofreading Team at http://www.pgdp.net (This file was produced from images generously made available by The Internet Archive/American Libraries.) *** START OF THE PROJECT GUTENBERG EBOOK CRICKET ***
  • 63. CRICKET From a Painting by R. James. TOSSING FOR INNINGS.
  • 64. C R I C K E T EDITED BY HORACE G. HUTCHINSON “DESIPERE IN LOCO” LONDON: PUBLISHED AT THE OFFICES OF “COUNTRY LIFE,” TAVISTOCK STREET, COVENT GARDEN, W.C. & BY GEORGE NEWNES, Ltd. SOUTHAMPTON STREET, STRAND, W.C.
  • 67. PREFACE Surely it is sheer neglect of opportunity offered by an official position if, being an editor, one has no prefatory word to say of the work that one is editing. It is said that that which is good requires no praise, but it is a saying that is contradicted at every turn—or else all that is advertised must be very bad. While it is our firm belief that the merits of the present book—The Country Life Cricket Book— are many and various (it would be an insult to the able heads of the different departments into which the great subject is herein divided to think otherwise), we believe also that the book has one very special and even unique merit. We believe, and are very sure, that there has never before been given to the public any such collection of interesting old prints illustrative of England’s national game as appear in the present volume. It is due to the kind generosity of the Marylebone Cricket Club, as well as of divers private persons, that we are able to illustrate the book in this exceptional way; and we (that is to say, all who are concerned in the production) beg to take the opportunity of giving most cordial thanks to those who have given this invaluable help, and so greatly assisted in making the book not only attractive, but also original in its attraction. In the first place, the prints form in some measure a picture-history of the national game, from the early days when men played with the wide low wicket and the two stumps, down through all the years that the bat was developing out of a curved hockey-stick into its present shape, and that the use of the bat at the same time was altering from the manner of the man with the scythe, meeting the balls
  • 68. called “daisy-cutters,” to the straightforward upright batting of the classical examples. The classical examples perhaps are exhibited most ably in the pictures of Mr. G. F. Watts, which show us that the human form divine can be studied in its athletic poses equally well (save for the disadvantage of the draping flannels) on the English field of cricket as in the Greek gymnasium. The prints, too, give us a picture-history of the costumes of the game. There are the “anointed clod-stumpers” of Broadhalfpenny going in to bat with the smock, most inconvenient, we may think, of dresses. There are the old-fashioned fellows who were so hardly parted from their top-hats. These heroes of a bygone age are also conspicuous in braces. We get a powerful hint, too, from the pictures, of the varying estimation in which the game has been held at different times. There is a suggestion of reverence in some of the illustrations—a sense that the artist knew himself to be handling a great theme. In others we see with pain that the treatment is almost comic, certainly frivolous. We hardly can suppose that the picture of the ladies’ cricket match would encourage others of the sex to engage in the noble game, although “Miss Wicket” of the famous painting has a rather attractive although pensive air—she has all the aspect of having got out for a duck’s egg. More decidedly to the same effect—of its differing hold on popular favour—do we get a hint from the spectators assembled (but assembled is too big a word for their little number) to view the game. “Lord’s” on an Australian match day, or a Gents v. Players, or Oxford and Cambridge, hardly would be recognised by one of the old-time heroes, if we could call him up again across the Styx to take a second innings. He would wonder what all the people had come to look at. He hardly would believe that they were come to see the game he used to play to a very meagre gallery in his life. But he would be pleased to observe the progress of the world—how appreciative it grew of what was best in it as it grew older. Another thing that the collection illustrates is the various changes of site of the headquarters of the game, if it had a headquarters before it settled down to its present place of honour in St. John’s
  • 69. Wood. There is a picture (vide p. v) of “Thomas Lord’s first Cricket Ground, Dorset Square, Marylebone. Match played June 20, 1793, between the Earls of Winchilsea and Darnley for 1000 guineas.” With regard to this interesting picture, Sir Spencer Ponsonby-Fane, in his catalogue of the pictures, drawings, etc., in possession of the Marylebone Cricket Club, has a note as follows:—“This match was Kent (Lord Darnley’s side) v. Marylebone, with Walker, Beldham, and Wills (Lord Winchilsea’s side). M.C.C. won by ten wickets. It will be noticed that only two stumps are represented as being used, whereas, according to Scores and Biographies, it is known that as far back as 1775 a third stump had been introduced; many representations, however, of the game at a later date show only two stumps.” No doubt at this early period there was no very fully acknowledged central authority, and such little details as these were much a matter of local option. The wicket shown in this picture does not seem to differ at all from the wicket in the picture of “Cricket” by F. Hayman, R.A. (vide p. 1), in the possession of the Marylebone Club, though the date of the latter is as early as 1743. Neither does the bat appear to have made much evolution in the interval. It is on the authority of Sir Spencer Ponsonby-Fane, in the catalogue above quoted, that we can give “about 1750” for the date of the picture named “A Match in Battersea Fields” (vide p. 3), in which St. Paul’s dome appears in the background. Here they seem to be playing with the three stumps, early as the date is. Again, in the fine picture, “painted for David Garrick” by Richard Wilson, of “Cricket at Hampton Wick” (vide p. 375), three stumps are in use, and the bat has become much squared and straightened. Of course the pictures obviously fall into two chief classes—one in which “the play’s the thing”; the cricket is the object of the artist’s representation; the other in which the cricket is only used as an incidental feature in the foreground, to enliven a scene of which the serious interest is in the background or surroundings. But the pictures in which the cricket is the main, if not the only, interest are very much more numerous. A quaintly suggestive picture enough is that described in Sir S. Ponsonby-Fane’s catalogue as, “Situation of H.M.’s Ships Fury and Hecla at Igloolie. Sailors playing Cricket on the Ice.” In this, of
  • 70. course, there is no historical interest about the cricket (vide p. 392). The one-legged and one-armed cricketers make a picture that is curious, though not very pleasant to contemplate; and the same is to be said of the rather vulgar representation of the ladies’ cricket match noticed above. The “Ticket to see a Cricket Match” (vide p. 40) shows a bat of the most inordinate, and probably quite impossible, length; but we may easily suppose that the artist, consciously or unwittingly, has exaggerated the weapon of his day. Here too are two stumps only. We may notice the price of the ticket as somewhat remarkably high, 2s. 6d.; but it was in the days when matches were played for large sums of money, so perhaps all was in proportion (length of bat excepted, be it understood). There is a picture of the “celebrated Cricket Field near White Conduit House, 1787” (vide p. 17), which is named a “Representation of the Noble Game of Cricket.” It is a picture of some merit, and evidently careful execution, and here too the players are seen with bats of a prodigious length; so it may be that these huge weapons came into fashion for a while, only to be abandoned again when their uselessness was proved, or perhaps when the legislature began to make exact provision with regard to the implements used. In this same picture of the “Noble Game of Cricket” a man may be seen standing at deep square leg, who is apparently scoring the “notches,” or “notching” the runs, on a piece of stick. This at least appears to be his occupation, and it is interesting to observe it at this comparatively late date, and at headquarters. In the match between the sides led by Lord Winchilsea and Lord Darnley respectively, it is seen that there are two tail-coated gentlemen sitting on a bench, and probably scoring on paper, for it is hardly likely that they can have been reporting for the press at that time. England did not then demand the news of the fall of each wicket, as it does now. Nevertheless, that there must have been a good deal of enthusiasm for the game, even at a pretty early date, is shown conclusively enough by the engraving (vide p. 190) of the “North- East View of the Cricket Grounds at Darnall, near Sheffield, Yorkshire.” What the precise date of this picture may be I do not know, but it is evident that it must be old, from the costumes of the
  • 71. players, who are in knee-breeches and the hideous kind of caps that have been reintroduced with the coming of the motor-car. Also the umpires, with their top-hatted heads and tightly-breeched lower limbs, show that this picture is not modern. And yet the concourse of spectators is immense. Even allowing for some pardonable exaggeration on the part of the artist, it is certain that many people must have been in the habit of looking on at matches, otherwise this picture would be absurd; and this, be it observed, was not in the southern counties, which we have been led to look on as the nurseries of cricket, but away from all southern influence, far from headquarters, in Yorkshire, near Sheffield. To be sure, it may have been within the wide sphere of influence of the great Squire Osbaldeston, but even so the picture is suggestive. The scorers are here seated at a regular table. A very curious representation of the game is that given in the picture by James Pollard, named “A Match on the Heath” (vide p. 29). It is a good picture. What is curious is that, though the period at which Pollard was producing his work was from 1821 to 1846, the bats used in the game are shown as slightly curved, and, more notably, the wicket is still of the two stumps only. There are only two alternative ways of accounting for this: either they still played in certain places with the two-stump wicket, or else, which is not likely, Pollard was very careless, and no cricketer, and took his cricket apparatus from some older picture. I observe, by the way, that I have, on the whole, done less than justice to the ladies, as they are portrayed playing the game, for though it is true that the one picture is, as noticed, vulgar enough, there is another, “An Eleven of Miss Wickets” (vide p. 248), that is pretty and graceful. While some of the pictures in this collection are interesting mainly for their curiosity, or as being something like an illustrated history or diary of events and changes in the game, there are others that are real works of art and beauty, sometimes depending mainly on their expression of the game itself, and sometimes only using it as an adjunct to the scenery. Of the former kind, we must notice most especially the remarkable series of drawings by Mr. G. F. Watts, R.A., which show the batsman in the various positions of defence or attack. To very many it will be a revelation that the great artist could
  • 72. lend his pencil to a matter of such trivial importance (as some base souls may deem it) as the game of cricket; but without a doubt that great knowledge of anatomy, which has been one of the strong points in all his paintings, has been learned in some measure from these studies, which also give it a very high degree of expression. There is a force, a vigour, a meaning about these sketches which are interesting enough, if for no other reason than because they show so vividly the inadequacy of the mechanical efforts of photography, when brought into competition, as a means of expression, with the pencil of a really great artist. You feel almost as if you must jump aside out of the way of the fellow stepping forward to drive the leg volley, or of the fearful man drawn back to cut, so forcefully is the force expressed with which the batsman is inevitably going to hit the ball (vide p. 67). One of the most charming pictures of those who have taken cricket for their theme is that which is lent by His Majesty the King to the M.C.C., and is styled “A Village Match.” It is by Louis Belanger, of date 1768 (vide p. 361). Charming, too, is the picture attributed to Gainsborough, “Portrait of a Youth with a Cricket-bat”; it is said to be a portrait of George IV. as a boy, but it seems doubtful. The bat here is curved, but hardly perceptibly; it shows the last stage in evolution before the straight bat was reached (vide p. 208). Our frontispiece is a jolly scene—the ragged boys tossing the bat for innings—“Flat or Round?” and the fellow in the background heaping up the coats for a wicket. We all of us have played and loved that kind of cricket. A wonderfully good and detailed picture is that of “Kent v. Sussex” (vide p. 137). It is a picture of a match in progress on the Brighton ground, and Brighton is seen in the background; in the foreground is a group of celebrated cricketers in the spectators’ ring, yet posed, in a way that gives a look of artificiality to the whole scene, so as to show their faces to the artist. Even old Lillywhite, bowling, is turning his head quaintly, to show his features. One of the most conspicuous figures is the great Alfred Mynn, who was to a former generation what W. G. Grace has been to ours. All the figures are portraits, and every accessory to the scene is worked out most carefully. The drawing is by W. H. Mason. Sir Spencer Ponsonby-Fane has a note on this picture: “As a matter
  • 73. of fact, this match, as here represented, did not take place, the men shown in the engraving never having played together in such a match, but they all played for their respective counties about 1839- 1841.” Very delightful, too, is the picture that is the last in our book (p. 433), “At the End of the Innings”—an old veteran with eye still keen, and firm mouth, telling of a determination to keep his wicket up and the ball down “as well as he knows how,” and with an interest in the game of his youth unabated by years. A jolly painting is that of “Old Charlton Church and Manor House” (vide p. 415), with the coach and four darting past, and the boys at cricket on the village green. And last, but to many of us greatest of all, there is the portrait of Dr. W. G. Grace, from Mr. A. Stuart Wortley’s picture, which sums up a modern ideal of cricket that we have not yet found ourselves able to get past (vide p. 228). There are other pictures, not a few, that we might select for notice, but already this ramble goes beyond due prefatory limits. There are the sketches in which the cricket is made to point or illustrate political satires. To do full justice to these, one would need to be well versed in the history (other than the cricketing history) of the period. But enough has been said. One could not let such a gallery of old masters go without an attempt to do the showman for them in some feeble way. They need neither help nor apology. They are good enough to win off their own bat. In our modern instances we have been no less lucky: with Mr. Warner to bat, Mr. Jephson to bowl, Mr. Jessop to field, and the rest of the good company, we do not know that any other choice could have made our eleven better than it is; but after all, that is for the public to say; it is from the pavilion, not the players, that the applause should come.
  • 74. CONTENTS CHAP. PAGE 1. Some Points in Cricket History 1 2. Early Developments of the Cricketing Art 29 3. Batting 48 4. Bowling 79 5. Fielding 117 6. County Cricket 137 7. Amateurs and Professionals 193 8. Earlier Australian Cricket 217 9. English and Australian Cricket from 1894 to 1902 251 10. University Cricket 296 11. Country-House Cricket 342 12. Village Cricket 361 13. Foreign Cricket 381
  • 75. 14. Cricket in South Africa 396 15. Cricket in New Zealand 409 16. Cricket Grounds 415 INDEX 443
  • 76. Welcome to our website – the perfect destination for book lovers and knowledge seekers. We believe that every book holds a new world, offering opportunities for learning, discovery, and personal growth. That’s why we are dedicated to bringing you a diverse collection of books, ranging from classic literature and specialized publications to self-development guides and children's books. More than just a book-buying platform, we strive to be a bridge connecting you with timeless cultural and intellectual values. With an elegant, user-friendly interface and a smart search system, you can quickly find the books that best suit your interests. Additionally, our special promotions and home delivery services help you save time and fully enjoy the joy of reading. Join us on a journey of knowledge exploration, passion nurturing, and personal growth every day! ebookbell.com