Embedded Systems by Raj Kamal - WeLearnFree
Embedded Systems by Raj Kamal - WeLearnFree
'Embedded
. Systems
Architecture. Pro9rammin9 and Desi9n
Second Edition
Raj Kamal
004.16 KAM
\\I \l\\l\11\11\\ Ill I I\ l\\
12994
Acknowledgements
am immensely grateful to my teachers al the Indian Institute of Technology. Delhi (1966--72), and the University of
lppsala, Sweden (1978-79. 1984). for teaching me the imponance of self-leam;ng and the essence of keeping up with
merging technology. I would J;ke to thank Prof. MS Sodha. FNA. for his support and blessings throughout my academic
le. I acknowledge my Indore colleagues-Dr PC Sharma. Dr PK Chande, Dr Sanjeev Tokekar, Mrs Vrinda Tokekar, Dr AK
.amani, Dr Maya Ingle. Dr Sanjay Tanwani. Ms Preeti Saxena. Ms Shraddha Masih. Ms Apama Dev, and Ms Vasanti G
arulkar and other university academicians, Dr PS Grover (Deihi). Dr Harvinder Singh Saini (HyderJbad), Dr S Radhakrishnan
>rivilliputtur), Dr TV Gopal (Anna University) and Dr KM Mehata (Anna University)-for their constant encouragement
nd appreciation of my efforts. l am thankful lo the editorial team at McGraw-Hill Education India for their reviews and
.1ggestions. I acknowledge my late colleague Dr MK Sahu. Head. Computer Centre of the University. who will miss
1is new edition as he passed away during the last phase of the preparation of this book.
[ would also like to thank all those reviewers who took out time to go through the script and give me their feedback.
heir names are listed below.
Ramanaryan Reddy
>ept. of Computer Science and Engineering.
1dira Ga11dl1i Institute ()fTecluwlogy. New Delhi
lilima Fulmare
I in dust an C()//ege of Science and Technology. Agra
likhil Kothari
>ept. of Electmnics and Co111111u11icllli()11 E11gineeri11g,
>haram Si11h Desai /11stit11te (l/Tec/111()/()g_r. Gujarat
upriya Kelkar
'ummins /11stit11te (If Engineering and Tecfu,()/ogy,
'une U11frersity
himli Adhikari
>ept. Ell'ctronics and Cmwmmication and Engineering.
'a/cutta lnstitllle of Engineering al!d Ma11age111e111. Kolkllla
tipankar Ghosh
>e11t. <?f Electro11ics <111d Communicatiou E11Ni11eeri11g
:enga( Institute (}( Tec/1110/ogr. Kolkata
lebashish Oe
>ept. of Electro11ics and Cmninunication Engineering.
1eghnad Saha Institute (If Tec/111()/()g1; K()/kata
I
P Kabisatpathy
Dept. (If Electmnic.r and Imtrume11ta/i()ll Engineering.
College (If E11gi11eeri11g and Tec/1110/()gY. Bl111bm1e.nvar
KK Mohapatra
Dept. of Electro11ics.
Nati()na/ /11stitute of Technology. Rourke/a
JK Mendiratta
Dept. (Ir Electronics and Communirnti()n and E11gi11eeri11g.
//. V. College (){Engineering. Bangalore
Lyla B Oas
Dept. of Electronic.< E11gineering.
National /11stit111e ()fTec/1110/ogr, Calicut
Santa Kumari
De11t. <?f" F:lectro11ics and Com11umicatio11 Engineering.
Andhm Uniiersitr. Vislwkhapatna111
V Murlidharan
Dept. (}{Computer Science and Engineering.
MS Rmuaiah h1stitute Bangalore
.Josephine P Kumar
Dept. (}f Computer Scimce and Engineering.
MV.I College (){Engineering, Bangalore
Stanley Johnson
/nven.n'.< India Pl'/. ltd .. Chennai
Finally, I acknowledge my wife, Sushi! Mittal, and my family members-Shalin Mittal. Needhi Mittal. Dr Atul
:ondaskar, Dr Shilpi Kondaskar, and Ms Arushi Kondaskar--for their immense love, understanding. and support during
1e writing of this revised edition.
P reji1ce to the Second tdi1ion
!'reface to the First Edi1io11
Contents
1. Intruduction to Embedded Systems
I. I Embedded Systems 3
1.2 Processor Embedded into a System 5
1.3 Embedded Hardware Units and Devices in a System /()
1.4 Embedded Sotiware in a System /9
1.5 Examples of Emhedded Systems 27
1.6 Embedded System-on-<:hip (Soc) and Use of VLSI Cin:uit Technology 29
I. 7 Complex Systems Design and Processors 32
1.8 Design Process in Embedded System 3 7
1.9 Formalization of System Design . 42
I. I 0 Design Process and Design Examples 43
I. 11 Classification of Embedded Systems 52
1.12 Skills Required for an Emhedded System Designer .'i.i
2. 8051 and Advanced Processor Architectures, Memory Organi7,ation and
Real-world Interfacing
2.1 8051 Architecture 62
2.2 Real World Interfacing 72
2.3 Introduction lo 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 1116
2.8 Processor Selection 113
2. 9 Memory Selection II 8
3. Devices and Communication Buses for Devices Network
3.1 10 Types and Examples 130
3.2 Serial Communicatiun Devices 13.J
3.3 Parallel Device Pons 143
3.4 Sophisticated Interfacing Features in Device Pons 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 Scaia! Bus Communication /60
3. l I Parallel Bus Device Protocols-Parallel Communication
Netvork Using !SA. PC!, PCl-X and Advanced Buses /66
3.12 Internet Enabled Systems-Network Protocols 170
3.13 Wireless and Mobile System Protocols 175
4. Device Drivers and Interrupts Service Mechanism
4 l Programmed-1/0 Busy-wail Approach without Interrupt Service Mechanism /89
vii
ix
61
128
187
r---1
I xiv I
. __ _)
4.2 ISR Concept /92
-U Interrupt Sources 20()
-IA Interrupt Servicing (Handling) Mechanism 203
4.5 Multiple Interrupts 209
4.6 Context and the Periods for Context Switching, Interrupt Latency and Deadline 2 I I
4. 7 Cla\!.itication of Processors Interrupt Service Mechanism from
Context-Saving Angle 217
4.8 Direct Memory Access 218
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 241
5.5 Object-Oriented Programming 262
5.6 Embedded Programming in C++ 263
5.7 Embedded Programming in Java 264
(,. Program Modeling
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 Mulliproccssor Systems 288
6.5 UML Modelling 295
1. Interprocess Communication and Synchronization of Processes, Threads and Tasks
7. I Multiple Processes in an Application 305
7.2 Multiple Threads in an Application 306
7 .3 Tasks 308
7.4 Tasl States 308
7.5 Task and Data 3/0
7.6 Clear-cut Distinction between Functions. ISRS and Tasks by !heir Characteristics 311
'-7 Concept of Semaphores 314
7 .8 Shared Data 326
7.9 Interprocess Communication 330
7.10 Signal Function 332
}. l I Semaphore Functions 334
7.12 Message Queue Functions 335
7.13 Mailhox Functions 337
7.14 Pipe Functions 339
7.15 Socket Functions 341
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
Contents
234
273
303
350
Contents
8.6 Device. file and 10 Subsystems Management 361
8.7 lmcm1pt Routines in RTOS Environmcm and Handling of lr.tcrrupt '>ourc-: Culh. 366
8.8 Real-time Operating Syslems 370
8. 9 Basic Design Using an RTOS 372
8.10 Rtos Task Scheduling Models, Interrupt Latency an<.I Response of the Tasks as
Performance Metrics 385
8.11 OS Security Issues 401
9. Real-time Operating System Programming-I: MicrocJOS-11 and VxWorks
9.1 Basic Functions and Types of RTOSES 408
9.2 RTOS mCOS-11 4/0
9.3 RTOS VxWorks 453
HI. Real-time Operating System Programming-ii: Windows CE, OSEK and Real-time
Linux Functions
I 0.1 Windows CE 478
I0.2 OSEK 494
I0.3 Linux 2.6.x and RTLinux 496
11. Design Examples and Case Studies of Program Modeling and Programming
with RTOS-1
11. I Case Study of Embedded System Design and Coding for an Automatic 512
Chocolate Vending Machine (ACVMJ Using Mucos RTOS
11.2 Case Study of Digital Camera Hardware and Sofware Architecture 531
I l .3 Case Study of Coding for Sending Application Layer Byte Streams on a
TCP/IP Network Using RTOS Vxworks 5.17
12. Design Examplt>s and Case Studies of Program Modeling and Programming with
RTOS-2
12.1 Ca'c Smdy of Communication Between Orchc.,1ra Robots 5ri7
12_2 Embedded Systems in Automobile 574
12.1 Case S!udy of an Embedded System for an Adaptive Cruise Con!rol (ACCl
System in a Car 577
12-4 Case Study of an Embedded System for a Smart Cird 593
12.'.i Case Study of a Mobile Phone Software for Key Inputs 61J../.
13. Embedded Software Developmenl Process and Tools
13.1 Introduction to Embedded Software Development Process and Tools 620
13.2 Host <md Target Machines 623
13.3 Linking and Locuting Software 626
13.4 Getting Embedded Software i1110 the Target System 630
13.5 Issues in Hardware-Software Design and Co-design 634
14. Testing, Simulation and Debugging Techniques and Tools
14.1 Testing on Host Machine 649
14.2 Sin1ulators 650
14.3 Laboratory Tools 653
Appendix I: Roadmap for Vario:i'.f
Appendix 2: Se/eel Bibliography
lm/e.r
406
477
511
566
648
662
663
668
Walkthrough
- 1.1 EMBE.OOLO SYSTEM'S
1.1.1 System
pbnutpn.igr.1111
{.."on'>i!kt;, w:.1.:h, h ;, .. rl""'' Ii- Nit'..,.,"' twd,..rc:. h..lll(i'y wnh
du!. ,cr.ip n.r1r urn"''""".'("' ,1,,,,.. W.: f'!',d u;nc: c:t:t) -.....r Jt,J u.01ui.....111ly
the: 1irneu<:'f')' '"'''''"J. hi: iJ<'11L1 """f !lu1:" ITTl.!lc- ;1ll<:l't:,...1i -n.imd.
h/"JW..1 .. UI v{n<ll"<. Sw1oc.. rlht."C ruk' ..!It: <L>hdl... l11All 1<U"lfk'"ll"''"""I) ,t..d, ....,..,, I ill A m...MW
it f'C'!ilm, lu 5*'!I: po:Utiun hdvc l'!<>l.W\ l>"I All 11\n:1: ...,.,;dk< mum lulhc ""'"' !!'lJi'l.ni"'' lW(IV"'
llO!lrJ;C..Xhlby
wa.<Jllll!l !l i 111 y,tcm. lk imp,oM.:tl\\ h;,,nl"';ak jQ(l
incti.k "' .utll:\ dip1:i.J poncl, th<: w1id111" J/>d .twh for UJ..S.:lincil f"'j1t..mml111 .1. 11M1!f ""'""' <lf
pin. iu f'iri<Cr wpply ;wl uoi1. ""- n!M:f w;it<"r <IN#. :i. "'i(a.,;\J .:>I"' I"' ldt11>;: l"lllc in l<llJ
Ive k11Wi,: vo,ll. IMU' f'<<'h w O..>r.1'11: utun"'1..:.<llf .._._,vnliu_g'. HJ lO
f!t08"'' pn.....ct hy II:!" 11i<' tu ..,.,,41 thcJ;rty ,,-k-:h.... "'.il.ini.
'(Ii'" in ""I" ,;ml '>I.I!!''' Jtfol(,,,..," 'I "/Mn S:'"'"t"f 1ti.;-..c nil..-. ,jU.,.
(olf""'': iii f>,,11,,..,. 1ti..: kl>' \lm.tly ;nth" 1i,lJu,. "'V ..._..lw"""' S:wl' I w....11 h; h, ...Cut """"11\ling
1QllPl1ll;'r.1mmc<.fp:riol!Sll:p JI; wakr tho:Jm1
![me! ifihoQo'ly_<ICm U\!ok. S:!c1' 111 llt.!l lhoQo
JpU- die ll'kllur fa.'4 f<1tll j)Wi;r.imnllM.I' I'"''""''"" .tr;m1 b1 ""'1 ....-.wr1n.m 11>c: S!cp I\':
Shaw !hr W01.1h...iwr \l:ttuh} S.ov1tU lb: .:r.1. minut<; tu ><;;:.....t 1h.;l lhi: "'"-"'
,vmpkh:. fiiJ Al (.ot:h "-P. !M '""" <>f 1& }'1<'11'1. !"'I In.::!'<' ul n i<llCtn>pli""
Only Ille f<'mailldl& p.or1 f'WS<;ml_ IJ.nin,: fo.1111 1h._ f"Nh"fl "'h.,:11 !ho;- !'ft.._'C" W,J. nktn1j)k(! ib!;ll:;
<!.II' t..: !!" fnm!il<'V I Mk' 11>..: "'""'""'""'I!" rlnn ...:I l
Ll,'.2 Embedded
I
I
Emt"''ll'i.tro lk'<:n Jdirn:J iu ""'->l pohl"'"''I ""-'"''I"-")'. 1;r.cur.,,i.,.., ;,_,, ,..,r" 1
vf&:.llniuunsfrom11lh<:r-in!helkh.I:
Wayiu: dG""/Wf'/1'14! (i""f>l'"""I' I'rirn>J>k "/ J,.,,,,,. 0.->ii.;A:
I "Wh;it <\ ;ui l'<"llJ..UVlJ; Uou,dy lldim:4, 11 h .n; llu! 110.:l...k" J'f'!!rw1r1ul>lc
\ 1n.:1d11r..:"'l'.:k><;i.t>uih rum j
-., ;1 ''"" cmN-d.Jed l"Vmpuiini: _J
Simple approach with figures to
explain complex topic of system
on chip for a mobile phone
Simple approach with interesting
examples and figures
---------------
,.
:'i. lr.lthlnnmfot "l'J'{,.$..'l<k
It :i.k11"'t'<.
7 .\hd!tillr l,'"'1.1!>.l""*r.:' "'!Ul\llO. ll'<hrt<'/b'<.l<1.1l
l'I l'fiFf.1mn:lf>k lu!!-i ,;.,,_,,, ...-.J FVl;,\ 'l'IJ !'l ..p;,_mt>ul>k ( :.11,; ""''
J.l!ll<:l<'!;"';indna.l"tllnit,
/',ro "' >.11tll 011!\1:.i.i...J Si.(' ;, tlo< 101<h:b:" pl1.. iv, r-ei"-....:
AS)!'>- 011.J Ir. "" .'i.ol' :.r. It< I"'"" '"""!'ti.."")! . to.1lm;.
J.:1<1J<>t..unr. Ilk j\l<I ofld mullif'h; 1- l.l"I) J"f'I"' rn k_..,, .,. .. -.11. ...:..-mi: .Uw
mltl n;.,;.thnt: l"'*ll 1m.'ml..y. Fit,:llr( I 1U ,11....,, m ;\<<i" th.11 111t1'J\f"'"' <ntro'lal .\>;I(,_
jtf-."C:.. IA\.fl'>t ..h,;.,,.J ":<'Hl<..W.,..J 1m.-<1.i..-.-. '"'"'""""""" lou. il,;.JJ..:.1 .. a,
,1JiJth_i::i1;>1.:.n.-i1!1 .. i1h ....t,.... : ... 'l"-\if,.- ..... 111<: ,<;.,<( "'"' 1""><.'"
.:in11"""'""ll
"''"
'"'"
Summa,,
-n...r..1k>..
l '( OV.{1".< h .,. <'"""' Y- fot ... : ,,_.,., "'"""''
...... ......,,,
"fl ..... .. 1t.:>
... OL1 _ _...i ....
l:f'Vn<'*.;,..,,.., ....... u..i.,...".i..
... .. ,,,J,.,...., ..,.,....,,.-
.. ..t"l'. .h .... ..,U-.
r""i"""""'""""""va<-
....
.. ..
4 ............. l'v.....i..,.,... ....... P"'P ....... _ "'l ...i ... ..,.,...,,.,,..._.,....,,,., .......... _ ....
... ..:.:::;::"'
""1.Jl,\P!-;,.....Jh(;!Jhf'"''M\,<HI"'
,.'.\l)._ ....
1m:.-.. p1!1wil)_,jf_Jol
Wi..i.,..,""" !Wdk.,. ,r..... .. u ,.,,..,,,..., --.,,.,,1..-..
wci;<!n'.-1""'.iplf'll'"""'., ..o:.,'" '"'"'""'<'i"'<""1.
rl'Ji Pra<.ricc Exercises
,..,,.. ...,.,,..i... ,..w ...1;An"* ...P,,,,,__,1 i: .... ..,.... -. .ui...." ... 1
c i..1 ...
!l ... .....-.........
1roo.1011-'t Mi.;""'4 !W)
!. .................... ,,...*"'"""'" ........i. ....
100).
!4. ...... nL
...
::ti. ...,,,,,,,...,.._..
.. ,..,,r...
,"I. w...,,,...,"*' r,.. ........ w... ... IX.
....
,'II
,\1.w,.,..,,....,_.,..,sf.d.tlt.>c=-:tioo'u\il<il"""''>iftl..inol.\..
,2.
...._...,,..,,r...
""i..r.11!i<,....J111,.,.k-.Thc!l>"""''<'lll1<>-"h'<'xl ...... .....
3.1
1.1....
H
)' ... --..-.,i!'tt;....
Walklhrough
Summary, keywords and their
definitions. review questions
and practice exercises in each
chapter
Walkthrough
1.
..
jll$l-in--dml! (JfT) (l)l'llfltJ!Wn A l&Y llCR:knlut NII b<: ..'Cd ,., thc '1"Cm ....
CQlkl'llR.
2.
dSl?:kB RQMmd)lll.S ltAMtw:<.-eflllbt.mn:lwfiN-..U IVMMd!'llll!hc
S.7.4 J2M
Uted J7MP, Um 1 Micro f.dil.i<lflia- Ju. Cardarfmb:ddcd hVI h::lp.,n m:l;ic1Q3 w mi: we iu K.tu
t !he uaial -wricwfoo.1 liUMQAl'I eW. How? The fdl<Ni!ll t: lbc
l.
1- Provide foraJAfipU!g E:l"""l'lcaofcmf1pil'16e ,,.,.<tU't(l1">
cmqi Md '"t-' jtoprin1 """11: OrJicr odlg ..nns :irt
.......
J.
4.
S. Oseiulu'1rpesolllrmb'.11lfe.Mbk.
ui.11, ,i&:- w Up. a.DC pnmdc forlbc appleU. "'1. tiwo, rmi. ud ..qi end 1clt
l'htfiis 1 ioCWC A 1111\
jpemlNol dlg1u.l-4unlJ (JI motn1t pnooc: usei; CDC or Cl.OC.
!Qllln:inJJ.ME. Thm:i.11'!'11'nt'l!JIJ mdilnt. KYMo:r1111 allrt1'IJll,ivcioJVM. Wiien
U"Jnf: Vie K\/M. Lhc >T*'ffi lftdji 1 6il l8 Sil !:B rwH.imc KVM fcuR:.1.,.,,""'
fohQwi:
?.
no.cingpolnu.
2. lll1ii h.>Pd.lI ... tuch fllhen1<m1y" r ....
4. lllC'rt:is1111tTifITTlioftoflhedMJn.
!. TI!ert:i>ntHib)a:lfinal1uuu1>
intlltobjeaforfuWiul.iofl.
6,
7. 1lvudgmtlfnvtllDltyf.iblllc.
\I. 1We U.oo iln.i:t. inld'f.cutN.! dti !he ob_tc:(l -1A!ir.alion.
debugains:M.Jpniflli,ng.
xix
Simple way of point-wise
presentation of the details by
using lists and tables
---
6-.:.! UML Bos#: Elements
10"'<"'""'
"'
IC4" CW.fiir.ltl't.w .... A
.....
... ....,..i..-11<,, ..i,.,.,n
...._..r, ..
I
....
.. ... d
l
... d I
I
I
I
__ ,............... . .!- .!\'\ I
l
lfilt l'W!Xp-t1111:dhfoillle1wmpinuf
'"
""11.2 CASE !ffiJDYOF OtGITAl CAMERA HAROWAR! ANO SOFWARE
ARCHITECTURE
.... n.1tlmillcd'S<lilll--
Sc>;tin<>ltl.l-l S...1iown ll :t\...,,
t>Wwan:""'il.....
11.1.1 Requirements
llnjU' ............ I
.....,...,. ... {JJ<tor;." I
1.
;>,pio.,...,,('{'ll,nto.of<111U'*'o4P'd<.
!W!'' l'iOU .. '.ll>,\J:li.4i('l<t:l."'ll.
uWM=-l.1lc(at11tr.> 1C."ln1 tm)'< l'hr;,m1
l
0
21
'
c
'I
JI
'.E
s
Walkthrough
Ii<" .. .u u ..M a"'Jk.t""''"<k.,<f""l. ,......,_, ,/1k,;,....i"' '"''
''''l'"'"'""f""'"'.w...... ,...,,..,,,,..,,....i,,,.,,,,..._.,.., .....
..... IJu ,...,.._t
,,,,.i,..,.,.. .n.,...r...,..,,.,_,..-<;oJ .... ,i,,-.. ...... 11,,111,,,,..,,,f,,..,,, ... 1
<1/f'l'llf'u ... J..,...,, 111
IN""1n"'"'"fl""><''"" 01...J"'""'"'f;,&,.,,
I ..
"""
i. .. ,..,J,,,-.x,.1w,;,,..l('>,.f1""',....,,.,
J r,, '"'"" /t> 1fr/i'lrllut1w11rt' .,,rloi"lrrt11r;r "'
.... ,,, IJSl'<. .,,.Jbw({L.
l,
,.-.,
......,.._,.... _.,......,.,._ ..,,, ...,,..
l
Rf{J ...... ""'' "'' , ... "" "'/f'('f"' ...... .... ... ,,.,""""""
-11.l CASE STUDY OF M6EDDEO .SYSTEM DESIGN ANO
CODING FOR AN AUTOMATIC CHOCOLATE
VENDING MACHINE (ACVMI MUCOS RT05
.\C'VM'"ll>inlmdllcnfc:uhn '":so,,;.,., 1 l!U 11.CVM r-iK111. """"'""""
;ni...tu'Of""'i..F,"'"" 1.12 Js>.00 <li:IC"'""""""' Al'\'\1
11 Um
MUCOS IO'OS. ti p:mlo. . ..::..W.>e, l""'=ir-i>r. lltw.-1
11.l,l
Tho ,.(\br ......_hil'(' (.,.. h: -'mtvoJ l.d>k
i'""""'T:.bk'llt.
U.l.2 Specifications
.. ,
I,
..1
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
'
....
AwJ.SlrSr.>:1"".0SEl"?f'l
....
/,..l,;Jtdol'Whikkqt"I
12.5.l Requirements
..,.
1k -dwlgi: !Bct$ lkfilc Ji.ddl'els'""" l-iinJ lhcNl141!t_
.. I
.
t<,H111N:il:fo1 .... .......... -ldl! .... lwlo
.. .. , ...oac..r... fl ... U....fh I
lllMll&qlit.....1 MD.l!lctt
Walkthrough
0
21
J
'.E
c
'I
I
o/
'
s
,,......Hr....,..,.... r.,rr....,,.1:,,.,1,,, ''**'
l1t&i<></w>c1<111U<""4'!'J'<>,,,il'10St<.
I"' ltfl;t i0S/J "' .WUCl.M ,t,,, .,..,, 111 <._,fn-
"""""*'V l h91U. W1w:....,-.o"'"f'<'.>W.-l_.,.,.._ .....1<>'<',,.,..-J
f,,, _,..,., .t(ll(ti)'f-<-1dbc- t..-..... ,,.,,,._,,..,,
NM!Hnf" ""l"'"'-f.a """""""'' 11:rus ..
... ,,.......... .. 1 ......... ._11<1
-.U-.JllJ11.f"/"'""""
""' f.,_ Wmd 1<1.,,,,-"' ;s:,,,,.., 11 .u"'- NflJ.f f,,, -""""""""'"
'""'""""";/n>U*'"llflt<-rrfo/t-'1"f'P<" ....... ,4ir ..."<--rh'-
};,.,,,.r/n .!I'" v.:r. />rhrlffl '""
""""""'' UA!l(WI" ....-m ""11'1"'"'' gfMU.'.:OS,..41;., ..
9:.1 BA.SIC FUNCTIONS AN!'.' TYPES OF RTQSe$
A ,-""'l'lu mufuu.oti& e.. llcddcd r"""' <i:t ch< lkfffupm<"I nr
!
\,
...
l A4oll!;...wfonr1i.on"fu'cl;lll'!lpk. W.Fi<lf
!.J.!Aand:(;Ult
..
. ..
..
fl.JWll' <J.lf,,1 th< boll' ("""tit"'' trctW f""" lk nf..,
I ..
,m.,
J.P,,.,,,u,:.i1er,11-fut1hct..1>1uo;l,l\dlST_
t
ti. !DE <>I w;"'l. pl>ifu!m b\li!dtt. <ilJI I'd !'-rl'"' .. ,h.,.,......
:<">l"k< Jndh>n< l..oJF"\
l
I
I 1
11
jjf!..,.{l'f\1:t., ........ 1"'f"'.......''f'"*"'"""''""l'l'l),j,(._.,..,, ....
hi fh:in""''""'"..,-..,M;,.1
<bi ni.-t."""'1
uI ..
11!
!ti ... ""t--i,11 .. ,....i....... .....;,,,1t4;. ..... _Jt<'" ......... t...No: lht
.. 11.,1.... ., ... .......... jttl>okl'nl"'""'
........
1(1 ..
,,, ....... ... .,....,"'"'""""""l't..i"'f'<:""
ll:oc"""'""""''"-_,,,..,'llK"C ..... <ht
<f'""'""''"'ri.:,d111(G1:NT .. v,w...u..
......
W1'n>....,.wu;.1. .. ... ..........
..
Id" ._,,, lk llov.,.,=-_ Thi:_.... .. -P"' 1flcr"""""'2 "'11it
\ll'Jn......,Jllio:Jor>1!....,.,d.,.l!l11t1.-..dit-*1'fa:iliiM<Wlk-""'.J.uo;"y
Arifo;"""._w.n..r.attR)..,.,,.....
pif'C1\<t:1..- -.<t -.oMJZl'l'lf'fl""..,... rfpr "'""' nan!N
,.,.,.._(JN.i"""11!-M>.Ufrn""'f'.!!" ht'll!<'N
... dr>I
!aC'.!oJ>r!f P'f't,k""""'
c...... ,.,,,.........p1tr... ............n...,,,,,r
.. 0nf,"'ril"'JAl>d<r'4"'1;
burnple 9.Z.6
J
;?_1Doeo::Llili!l!llledew:nf!11U1."1
fli/IJ;
Comprehensive explanation with coding examples for
learning the widely used RTOSes- mCOS-11, VxWorks,
Windows CE, OSEK and Real Time Linux
tlllCflU.l t:..tllmW'>ll.'J!ion. UCll<Wfl dov; 1111: pemli! at::lll(WI M\l <klcuun or t,,,J.' J.:rinir l\j>!. l(u.,..,.;m <kritll:'>
.....
, ......\, ..... -
Walkthrough
Appendix 2:
Select ....
' .. 1.' .;,::._"\.. ..: ..
......
JI
!? t.ipff ..... , ......
-
ll
"'.........,u'l""'I
C. PRINTED JOURNAL PA?at REfERENCfS
1.
p.;-r-r...t.;..,,,_.11:.-.,i.-w<!fs,.-""'11W-.ID(11.'116?M1,ao::'l6.
!.
J.
I
i ....... c..-r .....
,_
Detailed selected bibliography of books, journal references and
important web links at end of the book to faci!ftate building a startup
library for references and further studies in Embedded Systems
U.
{h
u ... Vr,o Y,rl,
U
s 1m11AJ....i1.11u..
::.
<IC: :::::.. __ -.JM>."'f""""'""'M...,,,...!Gll:Y.!m,
9,;. .. sll'I')'.. Ji><>if-""--' .......... ............
\Li ....
.....
'l6: W,,l1ti'I ".....;,,._"""n--t.- i<i'l.'
41. lt_Jll;_J_Doiliflf .....
It
tOO.
Introduction to
S.J INSTITUTE eF
TE.CHNQLOGY Ul'IAl'IY
-550 "1).
Embedded
0
'13
J
c
rr
I
'V
'E
s
Section 1.1
Definitions of system and embedded system
Section 1.2
The processing unit of an embedded system consists of
I. A processor
2. Commonly used microprocessors
3. Application-specific instruction set processors ( AS!Ps ).
microcontrollers, DSPs and others
4. Si11t,1le pwpose processors
Section 1.3
The hardware unit of an embedded system consists of
I. An embedded S\'Slem pmrer .1ource with co111m/fed power-
dissipation
2. A dock oscillator circuit and clocki11g unit that lets a pmcessor
exernte instmctions
3. Timers and a real time dock (RTC)for various timillg 11eeds
<if the .wstem
4. Reset circuit and watc/idog timer
5. System and external memories
6. System input output ( 10) ports, serial, parallel a11d wireless
communication, serial Universal Asy11chrono11s Receiver and
Tra11smi11er ( UAR1J and other port protocols aml bmes
7. Devices such as Digital to Analog Converter (DAC) using
Pulse Width Modulation ( PWM). Analog to D(r:ital Converter
(ADC), light Emitting Diode (LED) and Liquid Crystal
Display (LCD) units, keypad and keyboard, touch screen,
pulse dialer, modem and transceiver
8. Multiplexers, demultiplexers, decoder for inteifacing of the
devices and buses
I
L
'E
I
0
J
'E
c
I
'E
s
. ' .
9. 1n1errnpt coll/roller (handler)
Section 1.4
1. Languages that are used to develop embedded software.f(1r a system
2. Program models
3. Multitasking using an operating system (OS), system de1ice drivers. device
manaxement and real time operating system (RTOSJ
4. Software tools for system design
Section 1.5
Examples of applications of embedded systems
Section 1.6
Designing an embedded system on a VLSI chip
1. Embedded SoC (System on Chip) and examples of its applications
2. Uses of Application Specific Instruction Set Processor (ASIP) and Intellectual
Property (IP) core
3. Field Programmable Gate Array ( FPGA) core with single or multiple processor
units on an ASIC chip
Section 1.7
The complex system consists of
I. Embedded microprocessors or GPPs in complex s1"Ste111s
2. Embedding ASIPs, microcontrollers. DSPs. media and nel\Vork processors
3. E111heddi11g applicatio11-specijic system processors (ASSl's)
4. Embedding multipleprocessors in systems
Section 1.8
The design process has
I. Challenges in embedded system design
2. Design metrics
J. Co-design of hardware and software components
Section 1.9
The system designfonnalism is de.fined
Section 1.10
The design of embedded hardware and software in an automatic chocolate vending
machine, smart card, digital-camera, mobile phone, mobile computer and robot are
given as examples
Section 1.11
Classificalion of embedded systems into three types
Section 1.12
Skills needed to design an embedded system
, ._ ,ff\
Introduction to Embedded Systems
- EMBEDDED SYSTEMS 1.1
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 logether according to the
plan or program.
Consider a watch. It is a time-display system. Its parts are its hardware, needles and battery with the
beautiful dial, chassis and strap. These parts organize to show the real time every second and continuously
update the time every second. The system-program updates the display using three needles after each second.
It follows a set of rules. Some of these rules are as follows: (i) All needles move only clockwise. (ii) A thin and
long needle rotates every second such that it returns to same position after a minute. (iii) A long needle rotates
every minute such that it returns to same position after an hour. (iv) A short needle rotates every hour such that
it returns to same position after twelve hours. (v) All three needles return to the same inclination after twelve
hours each day.
Consider a washing machine. It is an automatic clothes-washing system. The important hardware parts
include its status display panel, the switches and dials for user-defined programming, a motor to rotate or
spin, its power supply and control unit, an inner water-level sensor, a solenoid valve for letting water in and
another valve for letting water drain out. These parts organize to wash clothes automatically according to a
program preset by a user. The system-program is activated to wash the dirty clothes placed in a tank, which
rotates or spins in preprogrammed steps and stages. It follows a set of rules. Some of these rules are as
follows: (il Follow the steps strictly in the following sequence. Step I: Wash i1y 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 Ill: 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 minule to signal that 1he wash cycle is
complete. (ii) Al each step, display the process stage of the system. (iii) ln 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 I 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:
"All embedded system is a system that has embedded software and computer-hardware, which makes it
a system dedicated for all applicatio1Z(s) or specific part of an application or product or a pm1 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 - Princ1iJles of Embedded Computing System Design:
"What is an embedded computing system?. Loosely defined, it is any device that includes a programmable
computer but is not itself intended to be a general-purpose computer" and ''a fax machine or a clock built from
a microprocessor is an embedded computing system".
Embedded Systems
. i ortJn.aulhor ofEmbedded Microcontrollers: "Embedded Systems are electronic systems that
. inicroprocessor or microcontroller, but we do not think of them as computers-the computer is
ddeii or embedded in the system."
David E. Simon author of An Embedded Software Primer: "People use the term embedded .1ystem to mean
any computer system hidden in any of these products."
lim Wilmshurst author of An Introduction to the Design of Small Scale Embedded Systems with example:.
from PIC, 80C5 J and 68HCOS/08 microcontrollers: (I) "An embedded system is a syscem 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 [theJ 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.
I. 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:
I. It embeds hardware similar to a computer. Figure I. I 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 !he 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 lask explained later in Sections 7. l 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: (I) 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. !t 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
Processor
Timers
Interrupt
Controller
Program
Memory
and Data
Memory
I Serial
I Communi-
cation
Ports
i Outputs Interfacing/
L__')river
The components of embedded system hardware Fig.1.1
. . ta network stream and events have different rates and time
distinct rates. For example, audio, video, da j h' ser interfaces (GUls) and other user interfaces.
constraints. (2) Complex algorithms. (3) Comp ex grap ic u
(4) Dedicated functions. .
. . ." ed kee in in view three constraints: ( 1) available sysiem-
Constraints An embedded system dis need if mit power dissipation when running the system
memory (2) available processor spee , . , ak d 's. leep'
' . f 5 run 'stop w e-up an
continuously in cycles of wait or event , h, . ,t a'nts with regard to performance, power, size and
The system design or an embedded system as cons r t
and manufacturing costs.
... 1.2 PROCESSOR EMBEDDED INTO A SYSTEM
. . bedded system hardware. ft is the heart of the embedded system.
A processor is an important umt. m the em is must for an embedded system designer.
Knowledge of basic concept of microprocessors and1 d . th 'References' at the end of this book for an in-
c t ndard text or the texts 1ste m e
A reader may re1er to a s a .
11
d DSPs that are incorporated in embedded system
depth understanding of microprocessors, m1crocontro ers an
design. Chapter 2 will explain 8051 and a few processors.
1.2..1 Embedded Processors in a System .
. . . ram Flow Control Unit (CU) and Execution Umt (EU). The CU
A has two essential Prog. he memo The EU has circuits that implement the
includes a fetch unit for fetchmg mstruct:Ion: from dat from one fonn to another. The EU
instructions to data ti:ansfiUer also circuits that execute instructions for a program
includes the Artthmet1c and Logical mt an .
Embedded Systems
control task, say, halt interrupt or jump to h f.
or branch to another ,prooram ior .. .. Jal ntot e
1
'. set instructions. It can also execute instructions for a calf
"' " c,1 o a unction.
A processor runs the rycles of cet,h ..
11
d 'fh .
.. ' jl "" CXCCLl!C. e instruct" . d fi d '
set, are executed in the sequence that they . c
1
h d
1
. tons, e me m the processor instruction
. . are ic c e rom the memory A p . .
IC chip; alternatively, it could be in core form in an . . . '. rocessor is the form of an
System on Chip (SoC) c , . . . Application Specific Integrated Circuit (ASIC) or
chip. . ore means a part ot the functional circuit on the Very Large Scale Integrated (VLSI)
An embedded system processor chip or core can be one of the followin .
I. General Purpose Processor (GPP) A GPP . I g
not specific to the 1 . . ts a genera -purpose processor with instruction set <lesioned
app 1cauons. "
(a) Microprocessor. [Section l.2.2I
(b) Processor [Section 1.7.7)
2. Application Specific Instruction-Set Processor (ASIP) . . .
designed for specific applications on a VLSI h . An ASIP Is a processor with an instruction set
( )
M' c 1p.
a 1crocontroller [Section 1.2.3 I
(b) microcontroller [Section 1.7.71
(
(de)) ND1g1tal Signal Processor (DSPJ and media processor [Section I 7 3j
etwork processor IO . d .
1 s I p p . , or omam-spec1fic programmable processor
- . mg e urpose rocessors as add1t1onal processors Sin I
(I) Coprocessor (e.g., as used for graphic pr .... fl g .e purpose are as follows:
d
. ocessm<>. oatm<> pomt process
1
o d
1scrcte cosine transformation and inve t c"' . "' n,,, encrypting, ec1pheling,
. rse rans1ormatron or TCP/IP prot
1
k'
connecting functions) (2) Accelerato (
1
od oco stac mg and network
direct memory acc:s;es and buses). accelerator). (3) Controllers (e.g., for peripherals,
4. GPP or ASIP cores mtegrated into either an ASIC V . . .
(FPGA) core integrated with processor units in a Programmable Gate Array
5. Application Specific System Processor (ASSP) [S . c ip. ect1ons 1.6 and l.7j
6 M I . ectlon 1.7.9]
. . u t1core pr.ocessors or multiprocessor [Section I. 71
For a system designer, the followino are
I. Instruction set "' important cons1deratmns when selecting a processor:
2. Maximum bits in an operand (8 or
16
)I). ..
1
. .
3. Clock frequency MH d _or - m a. smg e arnhmetic or logical operation
m z an processm<> speed m Million I st t' . p S
alternate metric Dhrvstone for measur "' . n. rue ions .er econd (MIPS) or in an
' p mg processing performance [Section 2 61
"' rocessor ab1hty to solve corr.plex aloo 'th . h'I . .
. ' "' n ms w 1 e meetm<> deadl' c h
A microprocessor or GPP . d . . "' mes 1or t e1r processing
is use because: (1) process1no bas d h . . .
predefined general purpose instruction set res It . . k
0
e on t e rnstruct10ns available in a
. c u s m qmc svstem development (i') o h b d
mtenaces are designed for a GPP. these can be d , "
1
nee t e oar and 1/0
. RO ... ' use ior a new system byj'us chang' th b dd d
m the M. (m) Ready availability of a com .
1
c .
1
. '
1
ng e em e e software
. pr er 1ac1 1tates embedded softwa d
1
. .
languages. (1v) Ready availability of well-t t d d d re eve opment m high-level
Program Interfaces) and codes previously h ebugged APls (Application
quickly. g r
01
er applications results In m:w systems developed
1.2.2 Microprocessor
The CPU is a unit that centrally fetches and proc . f "' ..
. I d . . esses a set o general-purpose instru f Th CPU.
set me u es instructions for data transfer operations ALU . c e instruction
0
Wat1ons, stack operatmns, JO operations and
Introduction to Embedded Systems
program control, sequencing and supervising operations. The general-purpose instruction set is always specific
to :
1
specific CPU. Any CPU must possess the following basic functional units:
I A control unir. 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 insiant.
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 x here refers to an
8086 extended for 32 bits.] Examples of 32-bit processors in 80x86 series are Intel 80386, 80486 and Pentiums
(a new generation of 32- and 64-bit microprocessors is the classic Pentium series). IBM PCs use 80x86 series
and the embedded systems incorporated inside the PC for specific tasks (like graphic accelerator, disk
controllers, network interface card) use these microprocessors.
High pe1formance 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 cf 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 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
essential component of a control or communication circuit. A microcontroller is a single-chip VLSI unit (also
called 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.
I
I
---., .
Interrupt L_ /
Controller/ -
Embedded Systems
1-1/0 Ports --1
I Control and 1----1
i Interlaces/ ;
LDrivers I
I Serial UART J
i Communication r-----J
j Port
I
Serial
Synchronous
I Communication I
/ Port
Application Specific Circuits in Specific Versions
I OMA I
l Con.t.r:.of!!r
1
r-Alo -
I Converter
r-----
I Network I
Driver I
I Stack I
I and
Interlaces I
I
j- -,
1 Controller I
J_ _
PWM J
1
Circuit
1
i for
!
I Printer
! Controller I
1-DTMFI
Circuit I
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 processina
capabilities. Important microcontroller chips for embedded systems are 805 l, 8051 MX, 68HC 11 xx, HC l 2x;,
HCl6xx, PfC 16F84 or l6C76, l6F876 and PfCl8, microcontroller enhancements of ARM9/ARM7 from
ARM, Intel, Philips, Samsung and ST microelectronics.
Figure l.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:
I. Coprocessor (for example, for floating point processing).
Introduction to Embedded Systems
Medium Scale Embedded System 16-bit Microcontroller
68HC12xx, 68HC16xx J
PIG 16F876, PIC18 Hitachi D64F2623FA
Large Scale Embedded System 32-bit Microcontroller
ARM family Cortex-M3, Atmel AT91 series,
C16x/ST10 series, Philips LPC 2000 s_eries,
Texas Instrument, TI TMS470RlB1M, SamsungS3C44BOX
Hitachi SH7045F
Fig. 1.3 Commonly used microcontrollers in small-, medium- and large-scale embedded
systems
2. Graphics processor: An image consists of a number of pixels. For example, Quarter common intem1ediate
format--Quaner-CIF images have 144 x .176 (horizontal x-axis x vertical y-axis) pixels. Video frames
have 525 x 625 pixels. The video graphic adapter (VGA) format of e-mailing and web pages has
640 x 480 = 307 ,200 pixels. A separate graphics processor is required for functions such as. for example,
gaming. display from graphics memory buffers and to move (translate on screen) and rotate an image or its
segments.
3. Pixel coprocessor: High-resolution pictures have formats: 2592 x 1944 pixels 5.038.848 pixels;
2592 x 1728 = 3.2 M: 2048 x 1536 =3M 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 rons in this processor to encrypt data for secure
5. Decryption engine: A suitable algorithm rons 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.
S. 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 functions.
9. Accelerator (for example, Java codes accelerator). The accelerator is a coprocessor that accelerates
computations by taking advance actions that are of the next object in Java
programs.
IO. CODEC (Coder and Decoder): A CODEC is a processor circuit that encodes input and decodes the
encoded information or or signals into a complete set of bits or original signal. Voice, speech,
Embedded Systems
image. video signals and bits are encoded for storing or transmission and uecodcd from the stored or
received bits or signal for display or playing. The CODEC functions as cornprcssior. 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 (ISOJ 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).
S_ingle purpose processors are used for specific applications or computations or as controllers for peripherals,
d1rect 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
of embedded systems that do not have their own power supply and connect to PC power-
supply Imes. 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 Y. 2.0 y 0.2 y
and 1.5 Y 0.2 Y. There is generally an inverse relationship between propagation delay i:i the gates and operational
voltage. Therefore, the 5 Y system processor and units are used in most high perforniance systems.
Certain systems 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 f when compared to 5 V, a CMOS 2 V circuit
power dissipation reduces by one-sixth, - (2 Y/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.
,fl\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 11
'-----------
the CPU, of the system timers and the CPU machine cycles. The machine cycles are for l'ctching codes and
data from memory and then decoding and executing them at the processor and for transferring the results to
memory.
For processing units, a highly stable oscillator is required and the processor clock-out signal provides the
clock for synchronizing all system units with the processor.
1.3.3 System Timers and Real-time Clocks
A timer circuit is suitably configured as the system-clock, which ticks and generates system interrupts
periodically; for example, 60 times in Is. The interrupt service routines then perform the required
operation.
A timer circuit is suitably configured as the real-time clock (RTC) that generates system interrupts periodically
for the schedulers, real-time programs and for periodic saving of time and date in the system.
The RTC or system timer is also used to obtain software-controlled delays and time-outs. An RTC functions
as driver for software timers (SWTs). [Sections 3.6 and 3.8]
Microcontrollers also provide internal timer circuits for counting and timing devices.
To schedule the various tasks and for real-time programming, an RTC or system clock i' needed. The
clock also drives the timers for various timing and counting needs in a system.
1.3.4 Rcet Circuit, Power-up Reset and Watchdog-Timer Reset
The program counter (PC) holds the audress from where the instruction is to be fetched for execution. In
80x86 processors. the instruction pointer (IP) holds that address. A code segment register (CSl 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 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 prccessors) on a power-up. From that
address in memory, program-instructions are fetched following the reset or 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, 68HCI I and HCl2, 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 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 C)jl\'going pin to enforce
a reset state in other sister units of the system. On deactivation of the reset that succeeds the processor activation,
a program executes from a start-up address.
Reset can be activated by an external reset circuit that activates on power-up, on switching-on reset
of the system or on detection of a low voltage (e.g. <4.5 V when what is required is 5 Y on the system
Embedded Systems
supply rails). This circuit output connects tu a pin called the reset pin of the processor. This circui1 may he a
simple RC circuit, an external IC circuit or a custom-built IC. Examples of I Cs are MAX 6314 and Molorola
MC 34064.
Alternatively, it can also be activated by any one of the following: (i) software instruction; (ii) time-out hy
a programmed timer known as a watchdog timer (or on an internal signal called COP in 68HC 11 and 68HC 12
families); (iii) a clock monitor de:ecting a slowdown below certain frequencies.
The watchdog timer is a timing device that resets the system after a predefined timeout. It is activalcd
within the first few clock cycles after power-up. It has a number of applications. In many embedded systems
reset by a watchdog timer is very essential because it helps in rescuing the system if a fault develops and the
program gets stuck. On restart, the system can function normally. Most microcontrollers have on-chip watchdog
timers. The watchdog timer device is described in detail in Section 3.7.
Consider a system controlling temperature. Assume that when the program starts executing, the sensor
inputs work all right. However, before the desired temperature is achieved, the sensor circuit develops some
fault. The controller will continue delivering the current nonstop if the system is not reset. Consider another
example of a system for controlling a robot. Assume that the interfacing motor control circuit in the robot arm
develops a fault during the run. In such cases, the robot arm may continue to move unless there is a watchdog
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 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.
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 of256 or 512 bytes in a microcontroller for registers. temporary data and stack.
2. Internal ROM/PROM I E
2
PROM 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 or
certain microprocessors).
I
Internal
RAMat
Micro-
Controller
Various Forms of System Memory
RAMat Internal External Flash/ ROM/
System- Caches RAM EEPROM PROM
on- at Chip(s)
Chip Microprocessor
External
or (Hold Copies
External of System
and/or
RAM Memt11J- ,{l\
Internal
pages]
Fig. 1.4 The various forms of memories in the system
Memory
Addresses
at
the System
Ports
Introduction to Embedded Systems
4. Internal flash (in many systcms the results or processing can be saved in nonvolatile memory: for exampk.
system status periodically and images. songs. or speeches after suitable formal compression).
5. Memory stick (or card): vidt:o. imagt:s. songs, or speeches and large storage in digital camera and
mobile systems. Sony memory slick Micro (M2) is of size I 5x I 2.5x 1.2 mm and has a flash memory
of 2 GB. It has a data lranskr ratt: or 160 Mhps (mega bii per second) and PRO-HG 480 Mbps and
120 Mbps write I since Dec. 2006.1
6. External ROM or PROM for embedding software (in almost all systems other than microcontrollt:r-
based systems).
7. RAM memory huffers at ports.
8. Caches (in pipelined and superscalar microprocessors).
Table I. I details the functions assignt:d in embedded systems to the memories. ROM or PROM or EPROM
embeds the software specific to the systt:m.
Table 1.1 Functions assigned to the memories in a system
Memon- Needed
ROM or EPROM
or nash
RAM (internal and external)
and RAM for buffer
Memory stick
F11nclions
Storing application programs from where the processor fetches the instruction codes.
SLOring codes for system booting, initializing, initial input data and strings. Codes for
RTOS. Pointers (addresses) of various interrupt service routines (ISRsJ.
Storing the variables during program run and storing the stack. Storing input or output
buffers. for example. for speech or image.
A flash memory stick is insened in mobile computing system or digital-camera. It
stores high definition video, images, songs, or speeches after a suitable format
compression and stores large pcrsistcnl data.
Storing nonvolatile results of procesing. I EEPROM or Flash
I
storing the results temporarily during processing.
A system embeds (locates) the following either in the internal nash or ROM. PROM or in an external flash
or ROM or PROM of the microcontrollcr: boot-up program, initialization data. strings or pictogram for
screen-display or initial state or the system, programs for various tasks, IS Rs and operating system kernel.
The system has RAMs for saving temporary data, stack and buffers that are needed during a program nm.
The system uses flash for storing nonvolatile results.
1.3.6 Input, Output and 10 Ports, 10 Buses and 10 Interfaces
The system gets inputs from physical devices through the input ports. Examples arc as
I. A system gets inputs from the tout:h screen. keys in a keypad or keyboard, sensors and transdut:er
circuits.
2. A controller circuit in a system gets inputs from the sensor and transducer
3. A receiver of signals or a network card gets the input from a communication system. I A communication
system could be a fax or modem, or a broadcasting service.I
4. Ports receives inputs from a network or peripheral.
Embedded Systems
Consider the system in an Automatic Chocolate Vending Machine. II gets inputs from a port that collccts
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 get'i 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:
I. 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 it5 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 get5 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 Asynchronolls 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
clrannel 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, [he output select line among the 8 activates. If the input address bit is 000, then the Qlh output is active
and the Olh unit activates. If the input address bit is I 7m output is active and the 7
1
h 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
two of these al any given instance. A bus communkation prowcol specifies how signals communicate on the
bus. A bus may be a serial or parallel bus that transkrs <'nc or multiple data bits at an instance, respectively.
The protocol also specifies the following: (i) ways of arbitration when. several devices communicate
throuah the bus; (ii) ways of polling bus requirement from each device at an instance; (111) ways of daisy
chainfng the devices so that bus is granted to a device according to the device-priority in the chain.
For networking the distributed units or systems, there are different types of serial and parallel bus protocols:
1:c. CAN. USB, ISA, EISA and PCI. For wireless networking of systems there are 802. l l, lrDA, Bluetooth
and ZigBce 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 110 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 1/0 bus: for example,
J2C, CAN. USB, !SA, E!SA and PCI bus.
1.3.7 OAC 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 L 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 VJ.
Suppose a system needs to give the analog ()t1tput of a control circuit for automation. The analog output
may be to a power system for d.c. motor or fuma('e. . .
A pulse width modulator (PWM) with an imegrator circuit is used for the DAC. A PWM unit in the
rnicrocontroller 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
which provides the desired analog output. From this information. the formula to obtain the analog
output from 1he hits in a given PWM register with bits ranging from OOOOO!KlO to 11111111 is as follows:
/\naiog 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 1s 50'/f
t1f the total pulse time period. and 2.047 V when the width is 100%. When the width is made 25'/f-. by
redacing by half the value in the PWM output control-register. the integrator output will become 0.512 V. The
constalll 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 I 00% of the total pulse time period and of -1.024 V when the width is 0%. When
the width is made 25% by reducing by half the value in an output control register, the integrator output will be
0.512 Y: at 50% the output wil I 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 1111111 l 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.
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
reference voltage. When input is equal to difference of reference positive and negative voltages, then all
output bits equal I; when equals negative reference voltage (usually 0 V), then all output bits equal 0.
G
Embedded Systems
The ADC in the system microcontroller can be used in many applic;itions such as dma acquisition syslc!ll.'i
jlJASl. digital camerns, analog control systems and voice tligitizing systems. Suppose a system gels the
;umlog inputs from :;ensors of temperature. pressure. and oth.:r soun;cs in a DAS. Suppose a
s;ystem gets the analog inputs from a digital camera. It has CCD rCharge Couple OcviceJ which has tiny pixels
1h;;t charge up on exposure to light. The charging of each pixel depends upon the light intensity at that point
in 1he image. The analog inputs to the system generate from each pixel. Each pixel's analog input lm.s to be
otJVerted into bits to enable processing in the next stage.
Suppose a system needs to read nn analog input from a sensor or transdw:er circuit. If converted to bits by
tl1c 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 convertetl bits can be given to the port meant for digital display. The bits may be transferred to a
memory atldre>s. a serial port or a parallel port.
A processor may process the converted bits and generate a Pulse Code Modulated (PCMJ 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 requiretl in the ADC. It sets either the analog
input's upper limii 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 equal' the lower limit. the ADC generates all bits
as Os. and when it equals the upper limit it generates all bits as ls. I As an example. suppose in un ADC
the upper limit or reference voltage is set to 2.255 V. Lei the lower limit reference voltngc be 0.'.:'55 V.
. The difference in the limits is 2 V. Therefore. the resolution will be 2/256 V. lfthe 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 Y,
the bits will be 10000000. When the analog input is 0.255 V + 0.50 V. the converted bits will be
0 !000000. l From this information. rinding a formula 10 obtain converted bit' for a given analog
input = v volt is as follows: Binary number 1 bits alter c(i1wersion in an n-bit ADC corresponds to
decimal number N. Then N v. (Y,cr+ V rcr-l/2". Herc. Vrd+ is the reference voltage that gives all the
bits that an: equal lo 1 and V,"'- is the reference voltage that gives all the bits that arc equal lo 0.1
' An ADC may be of 8. IO. I'.:', or 16 bits depending upon the resolution needed for conversion.
3. The start of the conversion (STC) signal or input initiutcs the conversion to 8 bits. ln <I system. all
instruction or a timer signals the STC.
4. There is an end of conversion (EOC) signal. A flag in a register is set lo indic<llc the e11d ,1f conversion
and the ADC generates an interrupt: the ISR reads the ADC bits and saves thc111 in the memory buffer.
5. There is a conversion time limit i11 which the conversinn is definite.
6. A Sample and Hold (S/HJ unit is used to sample the input for a fixed time and hold till conversion is
over.
An ADC unil 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 or heart beat sensor signals in
different systems. An ADC unit in an embedded system microcontroller may have multichannels. It can then
wke 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 microcontr-0lfot-and
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
1.3.8 LCD, LED and Touchscreen Displays
A sntem requires 1111 iiilcrfi1ci11g circuit and sofiirnre lo display tiu' status or mes.rage/fir a line, _f{,, multi line
di.1pfms. orforflasili11g disfllays. An LCD screen may show up a mtiltilint 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 hoth image and graphic displays. An
LCD needs little power. A supply or battery (a solar panel in the cakulatori 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 A are required.
The pulses are applied with the same poklfity on the crystal front and back plane for no light. and with
opposite polarity for light. Here. polarity means logic 1 or o. A display-controller is often used in case of
matrix displays.
To indicate the ON swlus 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. ft needs
current up to 12 mA above 5 mA (less in flashing display mode). It is much brighter than the LCD, making it
suitable for !lashing 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 information 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 10 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 kerp11tf or ker/1011rcl is llli i111porta/l/ tleiice j(1r gelling user inputs. The srstl.'111 pmi"ides tlie 11ecesswT
i111e1ji1ci11g wu/ key-dchow1ci11g cirrnit lls 11e// as tfte .wfiirnre .fi1r tile .1yste111 111 receire i11p111 Jivm ll set 1f
kers . .fimn a kerhoard. kcrpacl or rirtual 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 ha<; 16 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 1hrongh 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
18 Embedded Systems
intcrconnci.:tion for fax. for Internet packets routing and for transmitting and connecling to a wireless i.:cllular
system or personal area wireless network. A transceiver is a circuit tfuu um trwmnit as well as receive
hyte .11reams.
In communication system. a pulse dialer, modem or transceiver is used. A system provides ihe necessary
interfacing cin:uit 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
pon peripheral generates an interrupt on receivi'ng the input data or when the transmitting buffer becomes
empty. Each action generates an interrupt. A system may possess a number of devices and the system processor
has to control and handle the requirements of each device by running an appropriate !SR (interrupt service
routine) for each. An i111errup1s-ha11dli11g mechanism must exist in each .nstem to handle imerrupts from
various processes and jiJr handling multiple imerrupts simul1aneously peruling for service. Chapter 4 describes
in detail the interrupts, ISRs, and their handling mechanisms in a system. Important points regarding the
interrupts and their handling by the program are as follows.
l. There can be a number of interrupt sources and groups of interrupt sources in a processor.
[Section 4.3 J An i!"lterrupt 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. I 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 7.ern result or an
overflow or underllow during an ALU operation. An interrupt can also arise through a software timer.
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 the highest priority
during processing.
4. The processors current program has to divert to a service routine to complete that task on the occurrence
of the interrupt. For example, if a key is pressed. then an ISR reads the key and stores the key value in
the processor memory address. If a sequence of keys is pressed, for instance in a mobile phone, then
an !SR reads the keys and also calls a task to dial the mobiie 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
interrup1s in a particular application. The system always gives priority to the IS Rs over the tasks of an
application.
A system provides an interrupt handling mechanism for exeeuting the IS Rs in case of the intenupts from
physieal 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 sofiware that is specifie lo a given application or 1hat system. The
instruction codes 1tnd data in the final phase are placed in the ROM or flash memory for all the tasb that arc
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 rcquires bytes at each
ROM address, according to the tasks being executed. A machine implementable software file is rberefore
like a wble having in each rows 1he address and by1es. The bytes are saved at each address of the system
memorr. 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, stncks addre.ss pointers. program
counter address pointers. application programs. IS Rs. RTOS, input data and vector addresses.
2 Bytes for
Address of
Stack
on
Reset
Interrupt Service I
Routine Vector
Addresses of
2 Bytes each
Bootup :
Program
Codes i
.,
Machine Codes!
for Real Time l
Operating f
System (RTOS!J
PC-ADDR
SP-ADDR
ADDR-1
AODR-2
ADDR-3
ADDR-6
ADDR-7
ADDR-8
ADDR10 1
,,._ df\ System ROM
Memory
[
, 2 Bytes for
Address from
Where System
Starts
Execution on
Power Up
(Not Needed in
80x86,8051.80196,
....... ,)
Bytes for
.Data as
Inputs for each
Interrupt
Service Routine
Machine Specific
Codes for
each
Program, ISR
and Task
Fig. 1.5 System ROM memory embedding the software, RTOS, data and vector addresses
Embedded Systems
Final stage software is also called the ROM image. The final machine implementable software for a
product emhcJs in the once programmable tfa.;h or ROM (or PROMJ as an image in a frame. Bytes at each
address must be defined to 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 ol' 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 codc-basell 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
prm:essing, 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 he coded in assembfr language using an assembler after understanding
the processor and its instruction set. Assembler is software used for developing codes in 11sscmbfr.
Assembly language coding is extremely useful for configuring physical devices like purls. a line-display
interface. A DC and DAC and l"l'<1ding into or trnnsmitting from a buffer. These codes arc also called low-lcwl
codes for the device driver functions. !Sections 1.4.7 and 4.2.4.] They are useful to run the pmcessor or
dcvic.::-spccifo: li.:ature' and prmidc an optimal codin!! solmion.
Lack of knowledge of writing device driver or codes that utilize the processor-specific features-
invoking codes in an embedded system design team can cosl a lot. A vendor may charge fN the A Pis and also
charge intellectual property fees for each system shipped out of the company.
To make all the codes in a.1-.1e111hf.r lm1g11age may. however. he very time consuming. Full coding in assembly
may he done only for a few simple. small-scale systems. such as toys. automatic chocolate \ending machines.
mhots or data acquisition systems.
Figure 1.6 shows the process of converting an a.vsem/Jly /1111g1wge program into machine implementable
software file and then finally obtaining a ROM image file.
I. An assem/ller translates the assembly software into the machine codes using a step called a.1.ve111hli11g.
2. In the next step, called linking, a linker 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 llistinct :iddresses 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
1
----1 ; Machine
Machine i Codes
Specific I Assemble r! for .he I
I A'"omb'y :;j erogmm
Language 1 I at
Program I ! Various J
__J i Addresses
L-.......----
Bytes for
Linked
Programs
Data Bytes
Machine
Codes
ready for
Locating
at
Various
Addresses
3 4
Device
(ROM)
Loader Programmer
(Burner)
Embedded System
ROM Memory
21
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 or reallocmi11g the codes after linding the
physical memory addresses available at a given instant The loader is a part of the operating system
and places codes into the 1nc1m1ry after reading the .cxc file. This step is ncccss;iry bec;1usc the
availahlc memory addn:-.ses 111;1y 1101 starl from OxOOOO. and binary codes have to he loaded m diffcrc11t
<1ddrcsscs during the run. The loader finds !he <1ppropriarc start alldrcss. In a computer. after the l"adcr
loads inw a section or R1\M. the rrogr;1m is rc:1dy 10 run.
-I. The linal step or the system dt:'ign pruce"' is lon11i11g these codes <IS <I ROM image. The wdes 'll\"
permanently placed at the addresses actually available in the ROM. In embedded systems. there is no
separate program to keep track "rt he ;1\ail:1blc ;1dllrcsses al c.lilkrent times during th<: run. as in a cPmpurer.
In embedded system-.. therefore. the nc:>.t step inst;;ad or loatkr after linking is the use of a luu11nr.
whk:h lnc;1ti:s rhe IO tasks anll hartlwan: tlc\icc driver wdcs al fixed addresses. Pon and dc\in: addn:sscs
arc llxcd lor a given system as per the interfacing drcuit between the system buses and pors or devices.
The Ion/for progrn111 reallocates the I inked file and c1catcs a !ile for a permanent location or the codes in
a standard format. The file format may be in the Intel Hex life format or Motorola S-record format The
designer has to define the available addresses to locate and create files to pcnnane111ly locate the codes.
5. Lastly, either (i) a laboratory systrm. called device progra1111i1er, takes as input the ROM image file
and fimilly hums the image into the PROM or tlash 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.I The created from the image gives the ROM in IC 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, 'proc<>...ssor-specific' assembly !angu<!g-..: is used. A tile 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 assemhlr /ang11a,f{e is vt:ry lime cnnsuming 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 I
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 (voidJ ((iv) int ii. i2, i3. a; float result; (v) ii= 127;
i2 = 29; i3 = 40; a= ii+ i2 + i3; result= sqrt (a): (vi) primf(result);} :
The coding for square root will need many lines of
code and can be done only by an expert assembly
language programmer. To write the program in a high
level language is very simple compared to writing it in
assembly language. 'C' programs have a feature that
adds the assembly instructions when using certain
processor-specific features and coding for a specific
section. for example, a port device driver. Figure I. 7
shows the different programming layers in a typical
embedded 'C' software. These layers are as follows.
(i) Processor Commands. (ii) Main Function.
(iii) lntem1pt Service Routine. (iv) Mulriplc tasks. say.
I to N. (v) Kernel and Scheduler. (vi) Standard library
functions. protocol handling and stack functions.
Kernel and Scheduler
Standard Library
Functions Including
Network Protocol
Functions for
Stack and
Stack
Figure 1.8 shows the process of converting a Fig. 1.7 The different program layers in the
c program into the ROM image file. A compiler embedded software inc
generates the object codes. I! 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 prim/' and sqn codes. Codes for device and driver (device
control codes) management also link at this stage: for example. printer device management and driver
codes. After linking, the other steps for creating a file for ROM image are the same as shown earlier in
Figure 1.6.
C, C++, Java, Visual C++ are the languages used for software development. A C program has various
layers: processor commands, main function, task and library functions, interrupt service routines and kernel
(scheduler)_ The compiler generates an object file_ Using a linker and locator, the file for the ROM image
is created for the targeted hardware.
Introduction to Embedded Systems
c
Program
Functions
From
library
Needed
Machine
Codes
-
2
Linker
J
I
Machine
Codes in
Objeci File
Bytes for
Linked
Programs
.,
i 3
3i
i 1' '[
I: g
l=-JJ
_J
I Steps 3 and 4 shown in
Figure 1.6
Embedded System
ROM Memory
fig. 1.8 The process of converting a C program into the file for ROM image
1.4.S Program Models for Software Designing
The program design task is simplified if a program is modeled.
The different models that are employed during the design processes of the embedded software are as follows:
I . Sequential Program Model
2. Object Oriented Program Modei
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 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
multithrcads. I Refer to Sections 7. I to 7.3 for definitions and understanding of the processes, threads and tasks. I
The multiple tasks are processed most often by the OS not sequentially but concurrently. proce.ssmg
tasks can be interrupted for running the IS Rs, and a higher priority task preempts the runmng of lower pnonty
tasks.
An OS provides for process, memory, devices, 10s and file system management. A file system
the ways in which a file is created, called, named, used, copied, saved or deleted, opened closed. File
system is the software for using the files on a disk, flash memory, memory card or memo'.Y .
os software have scheduling functions for all the processes (tasks, ISRs and device drivers) m the
system. Since the running of the tasks and IS Rs may have real time and for finish_ing the
tasks, an RTOS is required in an embedded system. The RTOS provides the OS functions for codmg the
system, provides interprocess eommunicatjon functiQS'IS an:jf.c::ontrols 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.
1
1
I
\
;1
Embedded Systems
RTOS is used in most embedded systems and the system dPl'S co1H;urrrnt processing of multiple tasb
when the tash havi; real time constraints and
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
l'irtual devices. In an embedded system, there may be numhcr of 11hysirnl devics. Exemplary physical devices
are timers, keyboards, display, flash memory, parallel ports and 11ctwork cards.
A program is also be developed using the concept of virtual devices. Examples of virtual devices are as
follows.
I. A tile (of records opened, read, written and dosed. and saved as a stream of bytes or words)
2. A pipe (for sending and receivir.g 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 Illes on the disk)
A file is a data structure (or virtual devit:e) which sends the records (characters or words) 10 a data sink (for
ex:11nplc. a program function) and which stores the data fn>rn the data source (forcxmnple. a program functi(>ill.
A tJ!e in a computer may also be stored in the hard disk and in flash 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 file also gives an input lo the processor. The proc.;cssor gives an output to a printer for a wrile.
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 ol
three components.' (i) A control register or word that stores the bits that, on setting or resetting by a device
drin:r, comrol device actions. (ii) A status register or wonJ that provides the !fogs (hits) lo sh(fw 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 he wrinen or read hy ;(device driver. Device driver actions arc to
get input imo or send output from the control registers, input data buffers. output data huffers and status
registers of the device.
A device driver is software for opening, connecting or hinding, reading, writing and closing or controlling
actions of the device. It is software written in a high level language. It controls functions for device open
(configure), connect, bind, listen, read or write or close. The device driver executes after the programming or
the control register (or word) of a peripheral or virtual device. The programming is en I led device initialisation
or registration or auachment. The driver reads the status register, gets the inputs and writes the outputs. fl
executes on an interrupt to or from the device.
A driver controls three functions. (i) Initializing, which is activated by placing appropriate hits al tile
control register or word. (ii) Calling an ISR on interrupt or on setting a status tlag in the status register and
running (driving) the JSR (Interrupt Handler Routine). (iii) Resetting the status fiag after an interrupt service.
A driver may be designed for asynchronous operations (multiple use by tasks one after another) or synchronous
operations (concurrent use by the tasks).
Usiiig'The 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.
. Jntroduction to Embedded Systems
A device driver m:<.:esscs a parallel or serial port, keyboard, mice. disk. network. display. tile, pipe and
socket at spec.: iii(.; addresses. An OS also provides device driver. codes for 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 arc present. The manager includes software for allocating and registering port (in
fact, it may be a register or memory) addresses for the various devices at distinctly different addresses. including
codes for dctct:ting any collision between these, if any. It ensures that any device accesses LO one task on.ly at
any given im;tant. It takes into account that virtual devices may also have addresses that arc.;illocated by the
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 get access to or from
one task only.
Sections 4.2.4 and 8.6. l 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 J .2 lists the app!icmions of software tools for assembly language programming. high level language
programming. RTOS. debugging and system integration.
Software modules and tools for designing of an embedded system
________________ ._. ................................ __ ... ____________________ __
; 5;i:fiH'ru-e Tool.\ Applica1io11
I Ed;tor --------F-or_w_n-.t-in_g_C_c_od_c_:;_o_r-as--s-cm_b_ly_n_in_c_n_10-n-ic--s-u-si-.n-g-1h_c_k_e_y_b(-,a-rd-of_1_h_e_PC_l_(J-r-e1-1t-er-in_g_l_he-
j program. Allows the entry, addition. deletion, insc1t. appending previously written lines or
files. merging record and files at the specific positions. Creates a source file that stores the
edited file. It also has an appropriate name [provided by the programmer).
Interpreter
Compiler
Assembler
For expression-by-expression (line-by-line) translation to machine-executable codes.
Uses the complete set of codes. It may also include codes, functions and expressions from
the lihrary routines. It creates a file called object file.
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 r_imemonics) and
codes. The file has addresses that reallocate durmg the actual run of the assembly
language program.
(Contd)
26
Softwore fools
Cross assembler
Simulator
Source-code
engineering software
RTOS
Stethoscope
Trace scope
Integrated development
environment
Prototyper
Locator
Embedded Systems
Application
For converting object codes or executable for a processor lo o!hcr
processor and vice versa. The cross-assembler asscmbles 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.
To simulate all functions of an embedded system circuit including that or additional memory
and peripherals. It is independent of a particular target system. It also simulates the processes
that will execute when the codes of a particular processor execute.
For source code comprehension, navigation and browsing, editing. debugging, configuring
(disabling and enabling the C++ features) and compiling.
Refer Chapters 8 to 10.
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.
To help in !racing the changes in modules and tasks with time on the X-axis. A list of
actions also produces the desired lime scales and the time expected to be taken for different
tasks.
This is a development software and hardware environmenl that consist5 of simulators with
editors, compilers, assemblers, RTOS, debuggers. stethoscope, tracer. emulators. logic
analyzers. and application code burners in PROM or flash.
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.
This uses a cross-a5seinbler 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.
The locator progmm output is in the Intel hex Ilic or Motorola S-rccord format.
Software tools are used to develop software for designing an embedded system. Debugging tools, such as a
stethoscope. trace scope, and sophisticated tools such as an integrated development environment
and prototype development tools, are needed for the integrated development of system software and hardware.
1.4.9 Software Tools Required in Exemplary Cases
Table 1.3 gives the various tools needed to design exemplary systems.
,!'"- ,/I\
RTOS is essential in most embedded systems to process multiple tasks and ISRs. Embedded systems for
medium scale and sophisticated applications need a number of sophisticated software and debugging tools.
Introduction to Embedded Systems i 27
Table 1.3 Software tools required in exemplary systems
Softwore Auwmatic Dara Robot Mobile Adaptive VrJice
Tools Chocolare Acqu1:Yilion Phone Control Processor
Vending Sy.<tem System with
Machine& String Stabilit/
Editor Yes Yes Yes Yes Yes NR
Interpreter Yes NR Yes NR NR NR
Compiler Yes Yes Yes Yes Yes Ye.'
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 Ye.'
Source code engineering NR NR NR Yes Yes Yes
software
RTOS Yes MR Yes Yes Yes Yes
Stethoscope NR NR NR Yes Yes Yes
Trnce scope NR NR NR Yes Yes Yes
Integrated development NR Yes Yes Yes Yes Yes
environment
Prototypcr NR No No Yes Yes Ye.,
Nme: NR means not required. MR means may be required in a specific complex system but not compulsorily needed.
Embedded syslems 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 in these areas.
A few examples of small scale embedded system applications are as follows:
1. Point of sales tenninals: 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 multidisp!ay digital panel meter for voltage, current, resistance and
frequency
6. Keyboard controller
7. SD, MM! and network access cards
8. CD drive or hard disk drive controller
Embedded Systems
9. The peripheral controllers of a computer, for example, a CRT display controller, a keyboard controller.
a DRAM controller, a DMA controller, a printer controller, a laser printer cnntroller, a LAN controller.
a disk drive controller
JO. Fax or photocopy or printer or scanner machine
11. Remote (controller) of TV
12. Telephone with memory, display and other sophisticated features
Telecom
t
- Mobile Computing
Mobile Access
(a)
Computer Networking
Systems and Peripherals
- Networking Systems
Image processing
-Printers
Networks Cards
- Monitors and Displays
(d)
Smart
Cards
Banking
- Security
(b)
Digital
Consumer
Electronics
-DVDs
- Set top boxes
- High definition TVs
- Digital cameras
(e)
Missiles and
satellites
0
- Defence
-Aerospace
- Communication
(c)
Automotive
t
Motor Control System
Cruise Control
- Engine/Body Safety
Robotics in Assembly Line
- Car Entertainment
- Car Multimedia
(f)
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 instiuments, 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
18: Spectrum analyzer ,:" ,If>
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
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30
31.
32.
n
34.
35.
36.
37.
1.6
Computer networking sys1e111s, for example, a router, a front-end processor in a server. a switch. a
bridge, a hub and a g1tcway
For Internet appliances. then.: are numerous application systems (i) An intelligent operation.
administration and maintenance router (IOAMR) in a distributed network and (ii) Mail client card to
store e-mail and personal addn;sses and to smanly connect to a modem or server
Entertainment systems such as a video game and a music system
Banking systems, for example. bank ATM and credit card transactions
Signal tracking systems. for example. an automatic signal tracker and a target tracker
Communication systems such as a mobile communication SIM card, a numeric pager, a cellular phone,
a cable TV terminal and a FAX transceiver with or without a graphic accelerator
Image filtering, image processing. pattern recognizer, speech processing and video processing
Video games
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)
A personal information manager using frame buffers in handheld devices
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.
Embedded firewall/ router using ARM7/ multiprocessor with two Ethernet interfaces and interfaces
support to PPP, TCP/IP and UDP protocols.
Examples of sophisticated embedded are as follows:
Mobile smart phones and computing systems
Mobile computer
Embedded systems for wireless LAN and for convergent technology devices
Embedded systems ror video, interactive video, broadband !Pv6 (Internet Protocol version 6) Internet
and other products, real time video and speech or multimedia processing systems
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}, (Wide Area Networks)
Security products and high-speed Network security. Gigabit rate encryption rate products
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 011 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:
I . 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,
Embedded Systems
5. Discrete cosine transforms for signal processing applications,
6. Mem01ies,
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.
: stNGLE-PURf:>os"E:
r
I I I
11
1
---- ---------------- I I !
',' DATA ADDRESS ,' I I !
: GENERATOR i I i
' ' I
1
1----1==----i.
,-----L------------:----l J
j : PROGRAM ; I I
I ADDRESS i I
I i
MULTI-
A SYSTEM ON CHIP
BUSES
--111
I
PROGRAM,
DATA
AND PORT
MEMORY
I I
: I I
11 i
' I ;
111
I I I
I 1 ,
I !
DIGITAL
CIRCUITS-
TIMER.
MUXs .....
_____ :
PORT
INTERFACES :
:_ ______ ---- ----__ ,
DMAC
INTERRUPT
CONTROLLER
: I I
IL
.
PROCESSOR i
DSP '
1
--r,::..::..::.:_-=-=-=-:..:_J i i
- ; -i I i
GPP : I J I
..... H H l1 L ___
f- ------------- ----------------------!
-60%
AREA
-20-25%
AREA
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
1.6.1 Application Specific IC (ASIC)
AS I Cs 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 I.
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
;nd 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 tramform, an encryption algorithm or a
deciphering algorithm.
An IP may provide a design for adaptive filtering of a signal.
An IP may provide a design for implementing Hyper Text Transfer Protocol (HTIP) or File Transfer
Protocol (FTP) or Bluetooth protocol to transmit a web page or a file on the Internet.
An IP may be designed for a USB or PCI bus controller. [Sections 3.10.3 and 3.12.2]
1.6.3 FPGA Core with Single or Multiple Processors
Suppose an embedded system is designed with a view to enhancing functionalities in future. An FPGA
core is then used in the circuits. It consists of a large number of programmable gates on a VLSI chip. There is
a set of gates in each FPGA cell, called macro cell. Each cell has several inputs and outputs. All cells interconnect
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 (IFT), 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-11 Pro FPGA XC2VP125. XC2VPl25 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.]
I i
i 32 i
1.7 COMPLEX SYSTEMS DESIGN AND PROCESSORS
1.7.1 Embedding a Microprocessor
Embedded Systems
A General Purpose Processor microprocessor can be embedded on a VSLI chip. Table 1.4 lists different
stremns of microprocessors embedded in a complex system design.
Table 1.4 Important microprocessors used in embedded systems
Stream Microprocessor Family Source CISC or RISC or Both features
Stream I 68HCxxx Motorola CISC
Stream 2 80x86 Intel CISC
Stream 3 SPARC Sun RISC
Stream 4 ARM ARM RISC with CISC functionality
1.7.2 Embedding a Microcontroller
Microcontroller VLSI cores or chips for embedded systems are usually among the five streams of families
given in Table 1.5.
Table 1.5 Major microcontrollers@ used in the embedded systems
( Stream Microcontro/ler Familv Source
Stream I 68HC I I xx. HC I 2xx. HC I 6xx
Stream 2 8051. 8051 MX
Stream 3 PIC 16F84 or t6C76, 16F876 and PIC18
Stream 4' Microcontroller Enhancements of CORTEX-M3
ARM9/ARM7 from Philips, Samsung and
ST Microelectronics
Motorola
lnteL Philips
Microchip
ARM. Texas. Philips.
Samsung and ST
Microelectronics etc.
CISC or RISC or B01h
CISC
CISC
CISC
RISC Core with
CISC functionality
@Other popular microcontrollers are as follows. (i) Hitachi H8x family and SuperH 7xxx. (ii) Mitsubishi 740, 7700, MI 6C and
M32C families. (iii} National Semiconductor COP8 and CR I 6 /16C. (iv) Toshiba TLCS 900S (v) Texas Instruments MSP 430
for low voltage battery bao;ed system. (vi) Sam>ung SAM8. (vii) Ziglog Z80 and eZ80
1. 7 .3 Embedding a DSP
A digital signal processor (DSP) is a processor core Oi 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
sysrem in a large number of applications needing processing of signals. Exemplary applications are in image
processing. multimedia. audio. video, HDTV. DSP modem and 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 (VLIWJ
processing capabilities: it processes Single Instruction Multiple Data (SIMD) instructions; it processes Discrete
Cosine Transformations <DCT) and inverse OCT (IDCT) functions. The latter ::re 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
Stre;1111 DSP Family Sou re<'
Stream I TMS320Cxx, OMAP
1
Texas
St(eam 2 Tiger SHARC Analog Device
Stream 3 5600xx Motorola
Stream 4 PNX 1300, 1500
2
Philips
1
For example. TMS320C62XX a fixed point 200 MHz DSP (Section 2.3.5).
2
Media processor, which beside;; 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 dock-cycle. This
facilitates pipelining and superscalar processing. Besides greatly enhanced capabilities mentioned above.
there is great enhancement of speed by which an insuuction 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.
AS IP examples 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
processing, 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 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 two or more processors running in synchronization. An example of using multiple ASIPs
is 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.
34 Embedded Systems
ln a cell phone. a number of tasks have to be performed: (a) Speech signal-compression and coding.
(b) Dialing (cJ Modulating and Transmitting (dJ Demodulating and Receiving (e) Signal decoding and
(f) Keypad interface and display interface handling (g) Short Message Service (SMS) protocol-
based messaging (hJ 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-
C!F-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 (VPNJ_ [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 thl!I 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 10 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 ii has the following
capabilities:
I. 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.l]
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, 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 35
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 Advantage
Ge11eral Purpose
Microprocess11r
Microcontroller
I DSP
I
I
I Single purpose
I processors a11d
1
application specific
J system processor
I
I
I Dual core processor
I
When intensive
computations are
required, caches are used
and pipeline and
superscalar operations
are needed and I arge
embeclded software is to
be located in the external
memory cores or chips.
Used with internal
memory, devices and
peripherals and when
embedded software is to
be located in the internal
ROM or flash.
Used with signal
processing-related
instructions for filters,
image, audio, and videp
and CODEC operations.
Control IO and bus
operations and
peripherals and devices.
To significantly enhance
the performance of the
system.
No engineering cost for
designing the processor.
No engineering cost for
designing the processor
with internal memory,
devices and peripherals.
No engineering cost
involved for designing
the signal processor.
They support other
processing units in the
system and execute
specific hardware
processes fast.
Reduced engineering
cost.
Additional redundant
execution units that are
not needed in the given
system design
Additional
manufacturing costs and
redundant application
units which are not
needed in the given
system design.
Man_ufacturing cost may
1
be high. I
I
In-house engineering j
cost of development, ,
royalty payments for an I
IP core of processor and I
time-to-market cost. I
Manufacturing cost. as
dual core processors are
costly.
I
I
Accelerator To accelerate the Increases perfonnance by ; Engineering cost of
execution of codes. A co-processing with the development or royalty
i tloating point main processor. payments for IP core of
L
coprocessor accelerates processor and time-to-
mathematical operations market cost.
and Java accelerator
l!?.:celerates Java code
execution.
Embedded Systems
A DSP for mobile phones. for example. OMi\P of Texas Instruments. uses the effective power dissipation
methods of dynamic switching hoth for power supply voltage and operating frequency of rh.: CPU rnrc.
For a number or application;:. the DSPs cores may not suffice. Domain specific /\Sii'-; havc specific
instruction sets. For IOs. network. media or security applications. smart card. video game. palm top computer,
cell phone, mobile-Internet. hand-held embedded systems. Gbps transceivers, Ghps 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 ASf P.
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. I Refer to http:/
www.ti.com/sc/ docs/asic/modules/arm7.htm and arm9.htm].
ARM integrates with other features (for example DSPJ in new GPPs. which are available from several
;ources, for example, Intel and Texas Instruments. Exemplary ARM 9 applications arc 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 rn GS30
It has a five-stage pipdine. I! 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 TMS320C55x from Texas
[Refer to http:/www.ti.com/sc/docs/asic/modules/arm7.htm and arm9.htm]
A lower performance but very popular version of ARM9 is ARM7. ft operates at 80 MHz. I! uses 0.18
based GS20 m CMOSs. Using ARM7, ARM9 and CORTEX-M3, a large number of embedded systems
ha1e 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. Re;il-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)J has a TCP, UDP, IP, ARP and Ethernet 10/100 MAC (Media Access
Control) hardwired logic included into it. The chip from i2Chip, W3 IOOA, 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 hr.: added. Another ASSP. which is now available. is rhe 'Serial-lo-Ethernet
Converter (llM7100J. It does real-time data procc.'i'>ing by a hardware protocol stack. It needs no change in !he
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 and Software 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. Svstem Related Familv of designs: Families of related systems developed earlier should be
takeninio 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. should be such that the.y
can be composed (coupled or integrated) later. Effective modular design should ensure effecl!ve (1)
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 1s not permllled
to change or modify another module functionality. For example, protection trom a device dnver
modifying the configuration of another device.
6. Mapping into various representations is done from software requirements. For example,
data ilow in the same palh during the program flow can be mapped together as a single entity. Transform
and 1rnnsaction niapping 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 proce.ss each
pixel and colour individually. Transform mapping of is done by compression and
storage algorithms. Transaction mapping is done to dehnc the sequence ol 1mages.
7. User intedace design is an important part of design. User inlerfaces are designed
as per user requirements. analysis of the environment and system.functions. For in.an automatic
chocolate vending machine (ACVM) system, the user interface is an LCD multJhne 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 t.ouchsr.reen Interface (G.'), or It
may be designed with Voice User Interfaces (VUls). Any of these designs has to be validated by
the cus!Omer. For example, the ACVM customer who installs the machme must validate message language
and messages to be displayed before an interface design can proceed to 1he 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. ,!'-. ,JI\ .
The software design process may require use of Architecture Description Language (AOL). It rs used for
representing the following: (i) Control Hierarchy (ii) Structural Partitioning (iii) Data Structure and Hierarchy
(iv) Software Procedures.
Embedded Systems
Figure I.I I 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.
One
Life
Cycle
Development
Process
2
3
4
Is it per
specifications?
Linear
Sequence
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
}. design process is called design if it builds by starting from the components. A design process
1s top-to-down design 1f 11 first starts with abstraction of the process and then after abstraction the
details are create?. Top-to-down design approach is the most favoured approach. The following lists the five
levels of abstractmn from top to bottom in the design process:
Introduction to Embedded Systems
(I) Requirements: Definition and analysis of system requirement. It is only by a complete clarity of
the requ1red purpose, inputs, outputs,Junctionin1:, design metrics (Table 1.8) and validation rt:quirements
for finally developed systems specifications that a well system can be created. There has to
be consistency in the requirements.
Table 1.8 Design metrics used in the embedded systems
Metrics Description
Power Dissipation
Performance
Process deadlines
I User interfaces
I Size
Engineeritig cost
I Manufacturing cost
' flexibility
Prototype
developmeni cime
Time-to-market
System and user
safety.
Maintenance
For many systems, particularly battery operated systems, such as mobile phone or digital
camera tl1e power consumed by the system is an important feature. The battery needs to be
recharged less frequently if power dissipation is small.
Instructions execution time in the system measures the performanee. Smaller execution
time means higher performance. For example, a mobile phone, voice signals processed
between antenna and speaker in 0.1 s shows phone performance. Consider another. For
example, a digital camera, shooting a 4M pixel still image in 0.5s shows the camera
performance.
There are number of processes in the system, for example, keypad input processing, graphic
display refresh, audio signals processing and video signals processing. These have deadlines
within which each of them may be required lo finish computations and give results.
These include keypad GUis and VUis.
Size of the system is measured in terms of (i) physical space required, (ii) RAM in kB and
internal flash memory requirements in MB or GB for running the software and for data
storage and (iii) number of million logic gates in the hardware.
Initial cost of devehping, debugging and testing the hardware and software is called
engineering cost and is a one-time non-recurring cost
Cost of manufacturing each unit
Flexibility in design enables, without any significant engineering cost, development of I
different versions of a product and advanced versions later on. For example, software j
by adding extra functions necessitated by changing environment and software j
re-engmeermg. ,
. :
Time taken in days or months for developing the prototype and in-house testing for system I
'
functionalities. It includes engineering time and making the prototype time. I
Time taken iu days or months after prototype development to put a product fur users and
consumers.
System safety in terms of accidental fall from hand or table, theft (e.g., a phone locking
ability and tracing ability) and in terms of user safety when using a product (for example, l
automobile brake or engine).
Maintenance means changeability and additions to the system; for example, adding or updating ,
software, data and hardware. Example of software maintenance is additional service or
functionality software. Example of data maintenance is additionaffing-1!l'i-1es, wallpapers,
video-clips in mobile phone or extending card expiry date in case of smart canl. Example of
hardware maintenance is additional memory or changing the memocy stick in mobile computer
and digital camera.
Embedded Systems
(2) Specifications: Clear specifications of the required system arc must Specifications need to be
precise. Specifications guide customer expectations from the product. They also guide system
architecture. The designer needs specifications for (i) hardware, for example, peripherals, devices
processor and memory specifications, (ii) data types and processing specifications, (iii) expected system
behaviour specifications, (iv) constraints of design. and (\J expected lifo cycle specifications. Process
specifications are analysed by making lists of inputs on events, outputs on events and how the processes
activate on each event (interrupt).
(3) Architecture: Data modeling designs of attributes of data structure, data now graphs (Section 6.2J.
program models (Section 6.1 ), software architecture layers and hardware architecture are defined.
Software architectural layers are as follows:
I. The first layer is an architectural design. Here, a design for system architecture is developed. The
question arises as to how the different elements--<lata structures, databases, algorithms, control
functions, state transition functions, process, data and program flow-are to be organised.
2. The second layer consists of data-design. Questions at this stage are as follows. What design of
data structures and databases would be most appropriate for the given problem? Whether data
organised as a tree- like structure will be appropriate'? What will be the design of the components
in the data? [For example, video information will have two components, image and sound.I
3. The third layer consists of interface design. Important questions at this stage are as follows. What
shall be the interfaces to integrate the components? What is the design for system integration?
What shall be design of interfaces used for taking inputs from the data objects, structures and
databases and for delivering outputs? What will be the port structure for receiving inputs and
transmitting outputs?
(4) Components: The fourth layer is a component level design. The question at this stage is follows.
What shall be the design of each component? There is an additional requirement in the design of embedded
systems, that each component should be optimised for memory usage and power dissipation. Components
of hardware, processes, interfaces and algorithms. The following lists the common hardware components:
I. Processor, ASIP and single purpose processors in the system
2. Memory RAM, ROM or internal and external flash or secondary memory in the system
3. Peripherals and devices internal and external to the system
4. Ports and buses in the system
5. Power source or battery in the system
During software development process we can model the components as object-oriented. Table 1.9 lists the
stages as components-based object-oriented software development process.
(5) System Integration: Built components are integrated in the system. Components may work line
independently, but when integrated may not fullfil the design metrics. The system is made to function
and validated. Appropriate tests are chosen. Debugging tools are used to correct erroneous functioning.
Each component and its interface system is integrated after the design stage. Program implementation is in
a lan.!!llage and may use an integrated development environment (!DE), and source code engineering tools,
which should follow the model, software architecture and design specifications. Program simplicity should
be maintained during the implementation process.
The design stages range from abstrn:ilior.l\'IJ detailed designing to verification activities. Continuous
refinement in design can be made by effective communication between designers and implementers. Software
design can be assumed to consist of four layers: architecture design, design, interfaces design and
component level design.
Introduction to Embedded Systems
Table 1.9 Components-based object-oriented software development process
Stage I
Stage 1
Stage .1
Stage 4
Stage 5
Stage 6
Activities
Components that could be used in software development identified
Selection of available classes (single logically bonded groups) from a
software components resource library
Sort components. which are available and reusable by re-engiueering and
which are unavailable
Re-engineer components and create unavailable components
Construct software from the components and test them
Iteratively construct till final validation of software
Model Deficiency
Need for robust interfaces
and slow development in
case the reusable
are not
available in required
numbers
Actions at each step Research by software engineering experts have shown that on an average, a
designer needs to spend about 50% of the time for planning, analysis and design, 40% for testing, validation
and debugging and I 0--15% on coding. Action required to be taken at each step in the design process is listed
in Table I 10.
Table 1.10 Action to be taken at each step of design process
Design Metril"s Description
Analysis Design is analyzed
Steps for improvement The result of analysis is used to improve design to meet specifications and metrics
Veriflcatfrm System design must be verified to ensure that it meets the design metrics given in Table 1.8
1.8.3 Challenges in Embedded System Design: Optimizing Design Metrics
Following are the challenges that arise during the design process.
Amount and type of hardware needed: Optimizing the requirement of microprocessors, ASIPs and
single purpose processors in the system on the basis of performance, power dissipation, cost and other design
metrics are the challenges in a system design. A designer also chooses the appropriate hardware (memory
RAM, ROM or internal and external flash or secondary memory, peripherals and devices internal and external
ports and buses and power source or battery) taking into account the design given in Table 1.8; for
example, power dissipation, physical size, number of gates and the engineering, prototype development and
manufacturing costs.
Optimizing Power Dissipation and Consumption: Power, consumption during the operational and idle
state of system should be optimal. The following methods are used to meet the design challenges.
Clock Rate Reduction Power dissipation typically reduces 2.5 W per IOO kHz of reduced clock rate.
So reduction from 8000 kHz to I 00 kHz reduces power dissipation by about 200 W, which is nearly similar
to when the clock is nonfunctional. [Remember, total power dissipated (energy required) may not reduce.
This is because on reducing the clock rate, the computations will take a longer time and total energy required
equals the power dissipation per second multiplied by computation time].
Embedded Systems
The power 25 Wis typically the residual dissipation needed to operate the timers and few other u n i t ~ . By
operating the clock at a lower frequency or during the power-dowr. mode of the proce:;sor, the advantages are
as follows: (i) Power loss due to heat generation reduces. (ii) Radio frequency interference also reduces due
to the reduced power dissipation within the gates. [Radiated RF (Radio Frequency) power depends on the RF
current inside a gate, which reduces due to increase in 'ON' state resistance between drain and channel of
each MOSFET 1ransistor and that reduces heat generation.)
Voltage Reduction In portable or hand-held devices such as a cellular phone, compared to 5 V operation,
a CMOS circuit power dissipation reduces by one sixth, -(2V /5V)
2
, in 2.0 V operation. Thus the time intervals
needed for recharging the battery increase by a factor of six.
Wait, Stop and Cache Disable Instructions An embedded system may need to be run continuously,
without being switched off; the system design, therefore, is constrained by the need to limit power dissipation
while it is ON but is in idle state. Total power consumption by the system while in running, waiting and idle
states should be limited. A microcontroller must provide for executing Wait and Stop instructions for the
power-down mode. One way to reduce power dissipation is to cleverly incorporate into software the Wait and
Stop instructions. Another is to operate the system at the lowest voltage levels in the idle state and selecting
power-down mode in that state. Yet another method is to disable use of certain structural units of the processor-
for example, caches-when not necessary and to keep in disconnected state those structure units that are not
needed during a particular software execution, for example timers or 10 units.
Operations can be performed at low voltage or reduced clock rate in order to control power dissipation. For
embedded system software, performance analysis during its design phase must also include the analysis of
power dissipation during program execution and during standby. An embedded syst.wi has to perform
tasks continuously from power-up to power-off and may even be kept 'ON' continuously. Clever real-time
programming by using 'Wait' and 'Stop' instructions and disabling certain units when not needed is one
method of saving power during program execution.
Process Deadlines Meeting the deadline of all processes in the system while keeping the memory,
power dissipation, processor clock rate and cost at minimum is a challenge.
Ffexibilitv and Upgrade ability Flexibility and upgrade ability in design while keeping the cost
minimum and without any significant engineering cost is a challenge. Flexibility and upgrade ability allow
different and advanced versions of a product to be introduced in the market later on.
Reliability Designing a reliable product by appropriate design, testing and thorough verification, is a
challenge. The goal of testing is to find errors and to validate that the implemented software is as per the
specifications and requirements. Verification refers to an activity to ensure that specific functions are correctly
implemented. VaEdation refers to an activity to ensure that the system that has been created is as per the
requirements agreed upon at the analysis phase, and to ensure its quality.
1.9 FORMALIZATION. OF SYSTEM o'EsiGl\J
Formalization of system design is done using a top-down approach by abstraction (Section 1.8.2) and by
Detailing requirements and specifications of hardware and software
Introduction to Embedded Systems
Defining architectures of hardware and software
Coding and implcm:;ntation as per architecture
Testing, validation and verification of system .
Since a diagrammatic model dears the design concepts better than abstraction. a modeling language'. tor
formalization can be used. The Universal Modeling Language (UML) is used. In UML. a designer describes
the following:
I. 'User Diagram', Object Diagram', 'Sequence Diagram', 'State Diagram', 'Class Diagram' and
'Activity Diagram
2. Classes and Objects. which describe identity, attributes, components and behaviour
3. Inheritances of the classes and objects
4. Interfaces of the objects and their implementation at the objects
5. Structural description of the design components
6. Behavioral description in terms of states, state machine and signals (Section 6.3)
7. Events description
Section 6.5 will describe UML in detail. Chapters 11 and 12 will describe the model design examples in detail.
1.10 DESIGN PROCESS AND DESIGN EXAMPLES
1.10.1 System Design Process Examples
Chapters 11 and 12 will describe design examples in detail.
1.10.2 Automatic Chocolate Vending Machine (ACVM)
Let us consider an automatic chocolate vending machine. This interesting example given here helps a reader
to understand several concepts of programming an embedded system as a multitasking system.
Figure 1.12 shows the diagrammatic representation of ACVM. Assume that ACVM has following
components: _
l. It has keypad on the top of the machine. That enables a child to interact with it when buying a chocolate.
The owner can also command and interact with the machine.
2. It has an LCD display unit on the top of the machine. It displays menus, text entered into the ACVM
and pictograms, welcome, thank you and other messages. It enables the child as well as the ACVM
owner to graphically interact with the machine. It also displays time and date. (For GUis, the keypad
and LCD display units or touch screen are basic units.)
3. It has a coin insertion slot and a mechanical coin sorter so that child can insert coins to buy a chocolate.
4. It has a delivery slot so that child can collect the chocolate and coins, if refunded.
5. It has an Internet connection port using a USB based wireless modem so that owner can know status
of the ACVM sales from a remote location.
ACVM Functions Assume that ACVM functions are as follows:
I. The ACVM clisplays the GU!s and if the child wishes to enter contact information, birthday information
or get answer to FAQs, it displays the appropriate menu.
2. It displays a welcome message when in idle state. It also continuously displays time and date at the
right bottom corner of display screen. ft can also intermittently display news, weather data or
advertisements or important information of interest during idle state.
G
Embedded Systems
J. When first coin is inserted. a ti111cr also starts. The child is expected to insert all n:quired coins in
2 minutes.
4. After 2 minutes the ACVM will display a query to the child if the child does not insert sulfa:ient coins.
If the query is not answered the coins are refunded.
5. Within 2 minutes if sufficient coins are collected, it displays the message. 'Th<mh. wait for few
moments please!' delivers the chocolate through the delivery slot and displays message. collect the
chocolate and visit again. please''
Hardware units ACVM embeds the following hardware units.
I. Microcontroller or ASIP (Application Specific Instruction Set Processor)
2. RAM for storing temporary variables and stack
3. ROM for application codes and RTOS codes for scheduling the tash
4. Flash memory for storing user preferences, contact data, user address, user date or birth, user
identification code, answers of FAQs
5. Timer and interrupt controller
6. A TCPflP port (ln1ernet broadband connection) to the ACVM for remote control and for lhc owner to
ge< ACVM status reports
7. ACVM specific hardware to sort coins of different denominations. Each denominati(>n coin generates
a set of status and input hits and port-interrupts. Using an !SR for that port, the ACVM processor reads
the port status and input hits. The bit' give the information about which coin has hccn inserted. After
each read operation, the status bits are reset by the routine
8. Power supply
Mechanical
Coin Sorter
Fig. 1.12 Diagrammatic representation of the ACVM
Software components ACVM embeds the following software components:
I. Keyp;1d input read task
2 Display task
J. Read coins task for finding coins so1ted
4. Deliver chocolate task
5. TCP/IP stack processing task
6. TCPflP stack communication task
1.10.3 Smart Card
,:"- ,11\
Smart card is one of the most used embedded system today. It is used for crediHlebit bankcard, ATM card,
e-purse or e-Wallet card, identification card, medical card (for history and diagnosis details) and card for a
Introduction to Embedded Systems '45
number of new innovative applical!ons. I Reader may refer to a frequently updated w e b ~ i t e . hllp:f/
[email protected] for the answer:; or frequently asked 4uestions about cards.I The security aspec1 is or
paramount importance for smart card use. when used for financial and banking-related transactions. I Reader
may refer to http:f/www.home.hkstar.com/-alanehan/papers/smartCardSecurity/ and http:f/www.rescarch.
ibm.com/secure_systems/scard.htm for details of the card-security requirements.I
The smart card is a plastic card ISO ;tandard dimensions, 85.60 x 53.98 x 0.80 mm. It is an embedded
system on a card: SoC (System-On-Chip). ISO recommended standards are IS078 I 6 ( l to 4) for host-machi nc
contact-based cards and ISO 14443 (Part A or BJ for the contactless cards. The silicon chip is just a !Cw
multimeters in size and is concealed in-between the layers. Its very small size protects the card from bending.
figure 1.13 shows embedded-system hardware components for a contactless smart card.
Timer and
Controller
An Embedded System
Conlactless Smart Card Components
ROM
(Application
andRTOS)
System Power Supply
Identifications
Data Flow
on card
Fig. 1.13 Embedded hardware components in a contact less smart card
Embedded Hardware The embedded hardware components are as follows:
Microcontroller or ASIP
RAM for temporary variables and stack
One time programmable ROM for application codes and RTDS codes for scheduling the tasks
Flash for storing user data, user addres.';, user identification codes, card numher and expiry date
Timer and interrupt controller
A carrier frequency -16 MHz generating circuit and Amplitude Shifted Key (ASK) modulator
Interfacing circuit for the !Os
Charge pump for delivering power to the antenna for transmission and for system circuits. The charge
pump stores charge from received RF (rndio frequency) at the card antenna in ils vicinily. fThe charge
pump is a simple circuit that consists of the diode and high value ferroelectrics material-based capacitor. I
The details of the basic hardware units are as follows:
Embedded Systems
I. The Mitroconlroller used can be MC68HC 11 DO or PIC I 6C84 or a smart card processor Philips
Smart XA or a similar ASIP Processor. MC68HC 11 DO has 8 kB internal RAM and 32 kB EPROM
and 2/3 wire protected memory. Most cards use 8-bit CPUs. The recent introduction in the cards is_ ()f
a 32-bit RISC CPU. A smart card CPU should have special features, for example, a security lock. 1 he
Jock is for a certain sections of the memory. A protection bit at the microcontroller may protect I kB
or more data from modification and access by any external source or instructions outside that memory.
Once the protection bit is placed at the maskable ROM in the microcontroller, the i_nstructions or data
within that pan of the memory are accessible from instructions in that part only and not
accessible from the external instructions or instructions outside that part. The CPU may disable access
by blocking the write cycle placement of the data bits on the buses for instructions data protection
at the physical memory after certain phases of card initialization and before issuing the card to the
user. Another way of protecting is as follows: The CPU may access by using the physical addresses,
which are different from the logical address used in the program.
2. ROM is used in the card. The usual size is 8 or 64 kB for usual or advanced cryptographic features in
the card, respectively. Full or part of ROM bus activates only after a security check. The processor
protects a part of the memory from access. The ROM stores the following. . . .
i. Fabrication key, which is a unique secret key for each card. It 1s inserted during fabrication.
11. Personalization key, which is inserted after the chip is tested on a printed circuit board. Physical
addresses are used in the testing phase. The key preserves the fabrication key and this key insertion
preserves the card personalization. After insertion of this key, RTOS and applications use only
logical addresses.
iii. RTOS codes
iv. Application codes
v. A utilization lock to prevent modification of two PINs and to prevent access to the OS and
application instructions. It stores after the card enters the utilization phase. . . .
3. EEPROM or Flash is scalable. These means that only that part of the memory required for a particular
operation will unlock for use. The authorizer will use the required part; the will use the
other part. It is protected by the access conditions stored therein. It stores the followmg: . .
1. PIN (Personal Identification Number). the allotment and writing of which is by the authorizer (lor
example, a bank) and its use is possible by the latter only by using the personalizat_ion and fabrication
keys. It is for identifying the card user in future transactions. Card user 1s given this key.
Alternatively, a rnodifia':lle password is given to the user and password opens the PIN key.. .
11. An unblocking PIN fur use by the authorizer (say the bank). Through this key. the card circuit
identifies the authorizer before unblocking. Data of the user unblocks for the authorizer and
storing of information on the card is possible by the authorizer through the host.
111. Access conditions for various hierarchically arranged data files.
iv. Card user data, for example. name, bank and branch identification number and account number
or health insurance details.
v. Data post issue that the application generates. For example, in case of e-purse, the of
previous transactions and current balance. Medical history and diagnosis details and/or prev1011s
insurance claims and pending insurance claims record in case of a medical card.
v1. It also stores the application's non-vol:.ttile data.
vii. Invalidation lock sent by the host after the expiry period or card misuse and user account closing
request. It locks the data files of the master or elementary individual file or both.
4. RAM stores the temporary variables and stack during card operations by running the OS and the
application.
Introduction to Embedded Systems
s. Chip power supply voltage extracts by a charge pu111p cirn1it. The pump cxtracts the charge from the
signab from the host analogous to what a 111ou<.c doc, in computer and delivers the regulated voltage
card chip, memory and 10 systc:ni. Signals can he from antcnna or from clock pin. In a typical
card operation using 0.18 m technology. 1.6 to 5.5 V is the threshold limit and for a 0.35 m technology,
2.7 to 5.5 V.
6. IO System of chip and host interact through asynchronous serial UART (Section 3.2.3) at 9.6 k or
106 k or 115.2 k baud/s. The chip interconnects to a card hosting system (reader and writer) either
through the gold contacts or through a centimetcr sized antenna on each side. The latter provides
con1actle.1s interconnection between the 10 pins. which are meant for conlacl-hased interaction, RST
(Reset Signal from host) and Clock (from host).
7. Wireless Communication for 10 interaction is by radiations through the antenna coils for contactless .
interaction. The card and host interact through a card modern and a host modem. The application
protocol data unit (APDU) is a standard for communication between the card and host computer.
Modulation is with 10% index amplitude modulating carrier of 13.66-13.56 Mbps ASK (amplitude
shifted keying) is used forcontactless communication at data rates of-I Mbps. One-sixteenth frequency
subcarrier modulates through BPSK (Binary Phase Shil"tcd Keying).
Embedded Software Smart card embeds the follo\\'ing software components:
I. Boot-up, initialisation and OS programs
2. Smart card secure file system
3. Connection establishment and termination
4. Communication with host
5. Cryptography algorithm
6. Host authentication
7. Card authcnticEtion
8. Saving addition parameters or recent new data sent by the host (for example. present balance left)
The smart card is an exemplary secure embedded system with security software. The card needs
cryptographic software. Embedded software in the card needs special features in its operating system over
and above the MS DOS or UNIX system features. Special features needed arc as follows:
,/I\
I. Pm1ec1ed e11l"im11111e111. lt means solhvare should be stored in the protected part of the ROM.
2. Re.\"/rieled ru11-1i111e em'iro11111e111.
J. Its OS. every method. class and run time library sho11/d he scalable.
4. Code-size ge11em1ed slw11/d he op1imw11. The system needs should not exceed 64 kB memory.
S. Limited use of data types: multidimensionJI arrays. long 64-bil integcr and lloating points and very
limited use of the c1Tor handlers, (Section 4.2.2). signals (Sections 6.5 and 7.1 OJ, serialization,
debugging and profiling. I Serialization is the process of converting an object into a data stream J"or
transferring it to network or from one process to another. The de-serialized data arc the receiver end 1-
6. A three-layered file system for the data. One file for the 111as1erfile to store all file headers. A header
means file status, access conditions and the file lock. The second file is a dedico1ed.file to hold a file
grouping and headers of the immediate successor elementary files of the group. The third file is the
elementary file to hold the file header and its file data.
7. There is either a fixed length file management or a variable length fiie management with each file
having a predefined offset.
8. Classes for the network, sockets, connections, data grams, character-input output and streams, security
management, digital-certification, symmetric and asymmetric keys-based cryptography and digital
signatures. '
Embedded Systems
1.10.4 Digital Camera
Digital cameras may have 4 to 6 M pixel still images, ckar 1i,ual display (ClcarYid) CMOS sensor. 7 cm
wide LCD photo display screen, enhanced imaging processor, double anti blur solution and high-speed
engine. I OX optical and 20X digital zooms and can also record high definition video-clips. It
therefore ha:; speaker microphone(sJ for high quality recorded sound. It has an audio/video out port for
connecting to a TV/DVD player or computer.
Let us assume that the camera is still just a camera. Figmes l. l4(a) and (b) show hardware and software
L"<>mponents in a simple digital camera. Assume that the camera has the following components:
. ASIP CCDDSP 1
Fig. 1.14 (a) Digital camera hardware components (b) Digital camera software components
I. !t has keys on the camera. That enables a user to operate the camera. It has navigation keys to navigate
through the images back and forth.
2. Shutter, lens and charge coupled device (CCD) array sensors for images in sizes 2592 x 1944 pixels
5038848 pixels, VGA (E-mail) 640 x 480 = 307200 pixels, 2592 x 1728 3.2 M pixels, 2048 x 1536
pixels = 3 M pixels, or 1280 x 960 pixels = I M pixels.
3. ft has a good resolution photo quality LCD display unit on the back of camera to show photographs
or recorded video-clips. lt displays text such as image-title, shooting daw. and time and serial number.
ft displays messages. It displays the GUI menus when the user interacts with the camera.
4. It has a self-timer lamp for flash.
5. Internal memory flash to store OS and embedded software, and limited number of image files.
6. Flash memory stick of 2 GB or more for large storage.
Introduction to Embedded Systems
7. It has Universal Serial Bus (USB) port (Section 3.10.3) or Bluctooth interface. which connects it to u
computer and printer.
Camera Functions Assume that the camera functions is as follows:
I. It disphlys the frame view on the LCD screen so that user can adjust the camera inclination before
shooting the frame.
2. It displays the saved images on the LCD using navigation keys.
:i. When a key for opening the shutter is pressed, the !lash lamp glows and the .>elf-timer circuit switches
off the lamp automatically.
4. The frame light falls on the CCD array, which transmits the bits for each pixel in each row in the frame
through an ADC. Bits from dark area pixels in each row are used for offset corrections in the CCD
signal for light intensities in each row.
5. The CCD bits of each pixel in each row and column are offset corrected using a CCD signal processor
tCCDSP) .
6. The processed signals are compressed using a JPEG CODEC and saved in one jpg file for each frame.
A DSP does compression using the the discrete cosine transformations ( DCTs) and decompression by
inverse OCT. Thereafter, it also does Huffman coding for JPEG compression.
7. A DAC sends the inputs for the display unit. The DAC gets the input from the pixel processor, which
gets the inputs from the JPEG files for the saved images and gets input directly from the CCDSP
through the pixel processor or the frame in the present view.
Digital Hardware units The camera embeds the following hardware units.
I. Micmcontroller or ASlP
' Multiple processors (CCDSP. DSP. pixel proces;;ir and others)
' RAM for storing temporary variables and stack
4. ROM for application codes and RTOS codes for scheduling tasks
5. Ti111cr. lfash memory l"or storing user preferences. contact data. user address. user date of birth. u.,cr
identification code. ADC DAC and interrupt controller (Sections 1.3.3, 1.3.5, 1.3. 7 and 1.3.11 J
6. USB controllrr (Section :i. lOJJ
7. Direct memory access controller (Section 4.8)
8. LCD controller (Section :U.4)
9. Battery
5oftware components The camera embeds the following software components:
I. CCD signal processing for off-set correction
2. JPEG coding
3. JPEG decoding
4. Pixel processing before display
5. Memory and file systems
6. Light, flash and display device driven;
7. COM, USB port and Bluetooth device drivers for port operations for printer and computer
communication control
1.10.5 Mobile Phone
The mobile phone today has a large number of features. ft has sophisticated hardware and software.