You are on page 1of 26

IN1kCDUC1ICN 1C LM8LDDLD SS1LMS

MlcroconLrollers are wldely used ln Lmbedded SysLem producLs An


LmbeddedproducL uses Lhe mlcroprocessor (or mlcroconLroller) Lo do one Lask
one Laskonly A prlnLer ls an example of embedded sysLem slnce Lhe processor
lnslde lLperforms one Lask only namely geLLlng Lhe daLa and prlnLlng lL ConLrasL
Lhls wlLhenLlum based C A C can be used for any no of appllcaLlons such as
wordprocessor prlnL server bank Leller Lermlnal vldeo game player neLwork
server or lnLerneL Lermlnal SofLware for varleLy of appllcaLlons can be loaded and
run Cf course Lhe reason a C can perform mulLlple Lask ls LhaL lL has 8AM
memory andan operaLlng sysLem LhaL loads Lhe appllcaLlon sofLware lnLo 8AM
leLs Lhe Curun lL ln and Lmbedded sysLem Lhere ls only one appllcaLlon
sofLware LhaL
lsLyplcally burn lnLo 8CM An x86C ConLaln or lLs connecLed Lo varlousLmbedded
roducLs such as keyboard prlnLer modem ulsc conLroller Soundcard Cu8om
urlver Mouse so on Lach one of Lhese perlpherals as amlcroconLroller lnslde lL
LhaL performs only one Lask lor example lnslde everymouse Lhere ls
mlcroconLroller Lo perform Lhe Lask of flndlng Lhe mouse poslLlonand sendlng lL Lo
CAlLhough mlcroconLroller are preferred cholce for many Lmbedded sysLems1h
ere are Llmes LhaL a mlcroconLroller ls lnadequaLe for Lhe Lask lor Lhls reasonln
recenL years many manufacLures of general purpose mlcroprocessors such
asln1LL MoLorolla AMu Cyrlx have LargeLed Lhelr mlcroprocessors for Lhe
hlghend of Lmbedded markeL Whlle ln1LL AMu Cyrlx push Lhelr x86
processorsfor boLh Lhe embedded and deskLop pc markeL MoLorolla ls
deLermlned Lo keepLhe 68000 famllles allve by LargeLlng lL malnly for hlgh end of
embedded sysLemCne of Lhe mosL crlLlcal needs of Lhe embedded sysLem ls Lo
decrease power consumpLlons and space 1hls can be achleved by lnLegraLlng
more funcLlonslnLo Lhe Cu chlps All Lhe embedded processors based on Lhe x86
and 680x0have low power consumpLlons ln addlLlons Lo some forms of l/C Com
porL 8CM all on a slngle chlp ln hlgher performance Lmbedded sysLem Lhe
Lrend lsLo lnLegraLe more more funcLlon on Lhe Cu chlp leL Lhe deslgner
decldewhlch feaLure he/she wanLs Lo us
LM8LDDLD SS1LM
An Lmbedded SysLem employs a comblnaLlon of hardware sofLware (acompuL
aLlonal englne") Lo perform a speclflc funcLlon ls parL of a larger
sysLemLhaL may noL be a compuLer works ln a reacLlve and Llme
consLralnedenvlronmenL SofLware ls used for provldlng
features
and
f|ex|b|||ty
Pardware rocessors ASlCs Memory ls used for
performance
( someLlmes securlLyAn embedded sysLem ls a speclal purpose sysLem ln whlch
Lhe compuLer lscompleLely encapsulaLed by Lhe devlce lL conLrols unllke a
general
purposecompuLer such as a C an embedded sysLem performs predeflned Lask's
usually wlLh very speclflc Lasks deslgn englneers can opLlmlze lL reduclng Lhe
slzeand cosL of Lhe producL Lmbedded sysLems are ofLen mass produced so
LhecosL savlngs may be mulLlplled by mllllon of lLems1he core of any embedded
sysLem ls formed by one or several mlcroprocessor or mlcro conLroller
programmed Lo perform a small number of Lasks ln conLrasL Lo
a general purpose compuLer whlch can run any sofLware appllcaLlon Lhe
user chooses Lhe sofLware on an embedded sysLem ls semlpermanenL so lL ls
ofLencalled flrmware
LkAMLLS CI LM8LDDLD SS1LM
W AuLomaLed Llller machlnes (A1MS)
WAvlonlc such as lnerLlal guldance sysLems fllghL conLrol hardware /sofLwa
re and leLLer lnLegraLed sysLem ln alrcrafL and mlsslle
WCellular Lelephones and Lelephonlc swlLches
WCompuLer prlnLersCoplers MulLlmedla appllances lnLerneL radlo
recelvers 1v seL Lop boxes
WPouse hold appllances lncludlng mlcrowave ovens washlng machlnes
1vseLs uvu players/recorders
WMedlcal equlpmenL
WMeasuremenL equlpmenL such as dlglLal sLorage oscllloscopes loglcanalyz
ers and specLrum analyzers
MICkCkCCLSSCk VS MICkCCCN1kCLLLkS
roducLs uslng mlcroprocessors generally fall lnLo Lwo caLegorles 1he flrsL
caLegory useshlghperformance
mlcroprocessors such as Lhe enLlum ln appllcaLlon where
sysLem performance ls crlLlcal Powever Lhe second caLegory of appllcaLlons ln
whlch performance ls secondary lssues of power space and rapld
developmenL are more crlLlcalLhan raw processlng power 1he mlcroprocessors
for Lhls caLegory are ofLen called amlcroconLrolle
MICkCCCN1kCLLLkS (MCU)
llgure shows Lhe block dlagram of a Lyplcal mlcroconLroller whlch ls a Lrue
compuLer
ona chlp 1he deslgn lncorporaLes all of Lhe feaLures found ln mlcro
processor CuALu C S and reglsLers lL also added Lhe oLher feaLures
needed Lo make a compleLecompuLer 8CM 8AM parallel l/C serlal l/C
counLers and clock clrculL
CU
kAM kCM
I]Cort 1|mer
Ser|a|CC
Mort
A slngle
chlp
llC 8LCCk ulAC8AM Cl A MlC8CCCn18CLLL8
MICkCkCCLSSCk (MU)
A mlcroprocessor ls a generalpurpose dlglLal compuLer cenLral
processlngunlL (Cu) AlLhough popularly known as a compuLer on a chlp" ls l
n no sense acompleLe dlglLal compuLer 1he block dlagram of a
mlcroprocessor Cu ls shown
whlch conLalns an arlLhmeLlc and loglcal unlL (ALu) program counLer (C) a
sLack polnLer (S)some worklng reglsLers a clock Llmlng clrculL and
lnLerrupL clrculLs
M|croprocessors
Mlcroprocessors conLaln no 8AM
or 8CM
2 Mlcroprocessors do noL have any
l/C porLs
3 AdvanLage of versaLlllLy
4 Lxpenslve
WlLh Lhe addlLlon of exLernal 8AM and
8CM Lhe sysLemls more bulkler
M|crocontro||ers
1MlcroconLrollers have an lnLernal 8A
M and a 8CM
2 MlcroconLrollers have l/C porLs
3 AdvanLage of less power consumpL
lon
4 Cheaper ln comparlson
3 Cccuples less space
1nL 80S1 MICkCCCN1kCLLLk
1he 803 ls Lhe flrsL mlcroconLroller of Lhe MCS3 famlly lnLroduced by lnLel
CorporaLlon aLLhe end of Lhe 0s 1he 803 famlly wlLh lLs many enhanced
members en[oys Lhe largesLmarkeL share esLlmaLed Lo be abouL 40 among
Lhe varlous mlcroconLroller archlLecLures 1hearchlLecLure of Lhe 803 famlly of
mlcroconLrollers ls referred Lo as Lhe MCS3 archlLecLure o
someLlmes slmply as MCS3 1he mlcroconLrollers have an 8blL daLa bus 1hey
are capableof addresslng 64k of program memory and a separaLe 64k of daLa
memory 1he 803 has 4k of code memory lmplemenLed as onchlp 8ead Cnly
Memory (8CM) 1he 803 has 28 byLesof lnLernal 8andom Access Memory
(8AM) lL has Lwo Llmer/counLers a serlal porL 4 general purpose parallel
lnpuL/ouLpuL porLs and lnLerrupL conLrol loglc wlLh flve sources of
lnLerrupLs8esldes lnLernal 8AM Lhe 803 has varlous Speclal luncLlon 8eglsLers
(Sl8) whlch are LheconLrol and daLa reglsLers for onchlp faclllLles
80S1 AkCnI1LC1UkL
LlghLblL Cu wlLh reglsLers A(LheaccumulaLor) 8
slxLeenblL program counLer(C)and daLa polnLer(u18)
LlghLblL program sLaLus word(SW)
LlghLblL sLack polnLer(S)
lnLernal 8CM or L8CM(83) of 0(803)Lo 4k(803)
lnLernal 8AM of 28 byLes
lour reglsLer bankseach conLalnlng elghL reglsLers
SlxLeen byLeswhlch may be addressed aL Lhe blL level
LlghL byLes of generalpurpose daLa memory
1hlrLy Lwo l/C plns arranged as fourblL porLs 0 3
1wo 6blL 1lmer/CounLers 10 and 1
lull duplex serlal daLa recelver/LransmlLLer (S8ul)
ConLrol reglsLers 1CCn1MCuSCCnCCnl and lL
1wo exLernal and Lhree lnLernal lnLerrupL sources
CsclllaLor and clock clrculLs
ARIHITEITIRE ARE BESIBX IX TWB
WAYS
narvard
Von Neuman
lL has separaLe
memorles of program and
daLa
lL has same memorles
for program and daLa
CU
CU
uA1A
MLMC8?
8CC8AM
MLMC8?
MLMC8?
80S1 M|crocontro||ers p|ns
|ns 18orL Lach of Lhese plns can be conflgured as lnpuL or ouLpuL
|n 9 8S Loglcal one on Lhls pln sLops mlcroconLroller's operaLlng and
rases LheconLenLs of mosL reglsLers 8y applylng loglcal zero Lo Lhls pln
Lhe program sLarLsexecuLlon from Lhe beglnnlng ln oLher words a
poslLlve volLage pulse on Lhls pln reseLsLhe mlcroconLroller
|ns1017orL 3 Slmllar Lo porL each of Lhese plns can serve as unlversal
lnpuL or ouLpuL 8esldes all of Lhem have alLernaLlve funcLlons
|n 108xu Serlal asynchronous communlcaLlon lnpuL or Serlal
synchronouscommunlcaLlon ouLpuL
|n 111xu Serlal asynchronous communlcaLlon ouLpuL or Serlal
synchronouscommunlcaLlon clock ouLpuL
|n 12ln10 lnLerrupL 0 lnpuL
|n 13ln1 lnLerrupL lnpuL
|n 1410 CounLer 0 clock lnpuL
|n 1S1 CounLer clock lnpuL
|n 16W8 Slgnal for wrlLlng Lo exLernal (addlLlonal) 8AM
|n 178u Slgnal for readlng from exLernal 8AM
|n 18 19x2 x lnLernal osclllaLor lnpuL and ouLpuL A quarLz crysLal
whlchdeLermlnes operaLlng frequency ls usually connecLed Lo Lhese plns
lnsLead of quarLzcrysLal Lhe mlnlaLure ceramlcs resonaLors can be also
used for frequency sLablllzaLlonLaLer verslons of Lhe mlcroconLrollers operaLe
aL a frequency of 0 Pz up Lo over 30 Pz
|n 20Cnu Cround
|n 2128orL 2 lf Lhere ls no lnLenLlon Lo use exLernal memory Lhen Lhese porL
plns areconflgured as unlversal lnpuLs/ouLpuLs ln case exLernal memory ls used
Lhen Lhe hlgher address byLe le addresses A8A3 wlll appear on Lhls porL lL ls
lmporLanL Lo know LhaLeven memory wlLh capaclLy of 64kb ls noL used ( le noLe
all blLs on porL are used for memory addresslng) Lhe resL of blLs are noL avallable
as lnpuLs or ouLpuLs
|n 29SLn lf exLernal 8CM ls used for sLorlng program Lhen lL has a loglc0
valueevery Llme Lhe mlcroconLroller reads a byLe from memory
|n 30
ALL rlor Lo each readlng from exLernal memory Lhe mlcroconLroller wlll seL
Lhelower address byLe (A0A) on 0 and lmmedlaLely afLer LhaL acLlvaLes
Lhe ouLpuL ALLupon recelvlng slgnal from Lhe ALL pln Lhe exLernal reglsLer
(4PC133 or 4PC133clrculL ls usually embedded ) memorlzes Lhe sLaLe of
0 and uses lL as an address for memory chlp ln Lhe second parL of Lhe
mlcroconLroller's machlne cycle a slgnal on Lhls pln sLops belng emlLLed and 0 ls
used now for daLa Lransmlsslon (uaLa 8us) ln Lhls way by means of only one
addlLlonal (and cheap) lnLegraLed clrculL daLa mulLlplexlng fromLhe porL ls
performed 1hls porL aL Lhe same Llme used for daLa and address Lransmlsslon
|n 31LA 8y applylng loglc zero Lo Lhls pln 2 and 3 are used for daLa and
addressLransmlsslon wlLh no regard Lo wheLher Lhere ls lnLernal memory or
noL 1haL means LhaLeven Lhere ls a program wrlLLen Lo Lhe mlcroconLroller lL
wlll noL be execuLed Lhe program wrlLLen Lo exLernal 8CM wlll be
used lnsLead CLherwlse by applylng loglc oneLo Lhe LA pln
Lhe mlcroconLroller wlll use boLh memorles flrsL lnLernal and
afLerwardsexLernal (lf lL exlsLs) up Lo end of address space
|n 3239orL 0 Slmllar Lo porL 2 lf exLernal memory ls noL used Lhese
plns can be usedas unlversal lnpuLs or ouLpuLs CLherwlse 0 ls conflgured as
address ouLpuL (A0A)when Lhe ALL pln ls aL hlgh level () and as daLa
ouLpuL (uaLa 8us) when loglc zero (0)ls applled Lo Lhe ALL pln
|n 40vCC ower supply +3v
SLCIAL IUNC1ICN kLGIS1Lk
1he Spec|a| Iunct|on keg|ster(Sl8) ls Lhe upper area of addressable memory
from address0x80 Lo 0xll 1hls area of memory cannoL be used for daLa
or program sLorage buL ls lnsLead aserles of memorymapped porLs and reglsLers
All porL lnpuL and ouLpuL can Lherefore be performed by memory
mov
operaLlons on speclfled addresses ln Lhe Sl8 Also dlfferenL sLaLusreglsLers are
mapped lnLo Lhe Sl8 for use ln checklng Lhe sLaLus of Lhe 803 and
changlngsome operaLlonal parameLers of Lhe 8031he 4 porLs reglsLer A8 and
sLack polnLer S have already been explalned above 1he resL of Lhe Sl8
are explalned below
ull/uln (uoto lolotet low/nlqb AJJtesses 82b/8Jb)
1he Sl8s uL and uP work LogeLher Lo represenL a 6blL value called Lhe uaLa
olnLer 1hedaLa polnLer ls used ln operaLlons regardlng exLernal 8AM and some
lnsLrucLlons lnvolvlngcode memory Slnce lL ls an unslgned LwobyLe lnLeger
value lL can represenL values from0000h Lo llllh (0 Lhrough 63333 declmal)
PcON {Power contro/ 4ddresses 87h)
1he ower ConLrol Sl8 ls used Lo conLrol Lhe 803s power conLrol
modes CerLaln operaLlonmodes of Lhe 803 allow Lhe 803 Lo go lnLo a
Lype of sleep mode whlch requlres much less power 1hese modes of
operaLlon are conLrolled Lhrough CCn AddlLlonally one of Lhe
blLs lnCCn ls used Lo double Lhe effecLlve baud raLe of Lhe 803s serlal
porL
@cON {@er contro/ 4ddresses 88h 8t
4ddressob/e)
1he 1lmer ConLrol Sl8 ls used Lo conflgure and modlfy Lhe way ln whlch
Lhe 803s LwoLlmers operaLe 1hls Sl8 conLrols wheLher each of Lhe Lwo
Llmers ls runnlng or sLopped andconLalns a flag Lo lndlcaLe LhaL each
Llmer has overflowed AddlLlonally some nonLlmer relaLed blLs are
locaLed ln Lhe 1CCn Sl8 1hese blLs are used Lo conflgure Lhe way ln
whlch LheexLernal lnLerrupLs are acLlvaLed and also conLaln Lhe exLernal
lnLerrupL flags whlch are seL whenan exLernal lnLerrupL has occured
@,Ou {@er ,ode 4ddresses 89h)
1he 1lmer Mode Sl8 ls used Lo conflgure Lhe mode of operaLlon of each of Lhe
Lwo Llmersuslng Lhls Sl8 your program may conflgure each Llmer Lo be a 6
blL Llmer an 8blL auLoreloadLlmer a 3blL Llmer or Lwo separaLe Llmers
AddlLlonally you may conflgure Lhe Llmers Lo onlycounL when an exLernal pln ls
acLlvaLed or Lo counL evenLs LhaL are lndlcaLed on an exLernal pln
1L0/1P0 (1lmer 0 Low/Plgh Addresses 8Ah/8Ch) 1hese Lwo Sl8s Laken
LogeLher represenLLlmer 0 1helr exacL behavlor depends on how Lhe Llmer ls
conflgured ln Lhe 1MCu Sl8however Lhese Llmers always counL up WhaL ls
conflgurable ls how and when Lhey lncremenLln value1L/1P (1lmer
Low/Plgh Addresses 88h/8uh) 1hese Lwo Sl8s Laken LogeLher represenLLlmer
1helr exacL behavlor depends on how Lhe Llmer ls conflgured ln Lhe 1MCu
Sl8however Lhese Llmers always counL up WhaL ls conflgurable ls how and
when Lhey lncremenLln value
cON {ero/ contro/ 4ddresses 98h 8t4ddressob/e)
1he Serlal ConLrol Sl8 ls used Lo conflgure Lhe behavlor of Lhe 803s on
board serlal porL1hls Sl8 conLrols Lhe baud raLe of Lhe serlal porL wheLher
Lhe serlal porL ls acLlvaLed Lo recelvedaLa and also conLalns flags LhaL are seL
when a byLe ls successfully senL or recelved
8ul {ero/ contro/ 4ddresses 99h)
1he Serlal 8uffer Sl8 ls used Lo send and recelve daLa vla Lhe onboard serlal porL
Any valuewrlLLen Lo S8ul wlll be senL ouL Lhe serlal porLs 1xu pln Llkewlse any
value whlch Lhe 803recelves vla Lhe serlal porLs 8xu pln wlll be dellvered Lo Lhe
user program vla S8ul ln oLher words S8ul serves as Lhe ouLpuL porL when
wrlLLen Lo and as an lnpuL porL when read from
{nterrupt nob/e 4ddresses 48h)
1he lnLerrupL Lnable Sl8 ls used Lo enable and dlsable speclflc lnLerrupLs 1he
low blLs of Lhe Sl8 are used Lo enable/dlsable Lhe speclflc lnLerrupLs where as
Lhe hlghesL blL ls used Lo enableor dlsable ALL lnLerrupLs 1hus lf Lhe hlgh blL of
lL ls 0 all lnLerrupLs are dlsabled regardless of wheLher an lndlvldual lnLerrupL ls
enabled by seLLlng a lower blL
PJ {Proqro totus Jord 4ddresses u0h 8t4ddressob/e)
kAM Memory A||ocat|on
00lP 32 8?1LS 8LClS1L8 8A
nkS S1ACk
202lP 6 8?1LS 8l1 Auu8LSS
A8LL 8AM
30lP 80 8?1LS SC8A1CPA
u 8AM
IN1LkIACING CI SCML CU1U1 DLVICLS
ln1L8lAClnC Cl LLu Wl1P 803
MlC8CCCn18CLLL8
LLus are by far Lhe mosL wldely used means of Laklng ouLpuL 1hey flnd huge
appllcaLlon as lndlcaLors durlng experlmenLaLlons Lo check Lhe valldlLy of
resulLs aL dlfferenL sLages 1hey are very cheap and easlly avallable ln a
varleLy of shape slze and colors
1he prlnclple of operaLlon of LLus ls slmple 1he commonly avallable LLus
have a drop volLage of v and need 0 mA Lo glow aL full lnLenslLy 1he
followlng clrculL descrlbes how Lo glow an led"
1he value of reslsLance 8 can be calculaLed uslng Lhe equaLlon 8 (v)/0
mA Slnce mosL of Lhe conLrollers work on 3v so subsLlLuLlng v 3v Lhe value
of reslsLance comes ouL Lo be 330 ohm 1he reslsLance 220 ohm 40 ohm ls
commonly used subsLlLuLe ln case 330 ohm ls noL avallable
LLus are connecLed Lo Lhe porL 0 LLus need approxlmaLely 0mA currenL Lo
flow Lhrough Lhem ln order Lo glow aL maxlmum lnLenslLy Powever Lhe
ouLpuL of Lhe conLroller ls noL sufflclenL enough Lo drlve Lhe LLus so lf Lhe
poslLlve leg of Lhe LLu ls connecLed Lo Lhe pln and Lhe negaLlve Lo ground as
shown ln Lhe flgure Lhe LLu wlll noL glow aL full lllumlnaLlon
$mod3
Crg 00h
SeLb p0
end
IN1LkIACING CI SLVLN SLGMAN1
A seven segmenL conslsLs of elghL LLus whlch are allgned ln a manner so as Lo
dlsplay dlglLs from 0 Lo when proper comblnaLlon of LLu ls swlLched on Seven
segmenL uses seven LLu's Lo dlsplay dlglLs from 0 Lo and Lhe elghLh LLu ls used
for Lhe doL A Lyplcal seven segmenL looks llke as shown ln Lhe flgure below
Seven SegmenL are avallable ln Lwo conflguraLlon
(1) Common Anode (2) Common CaLhode
When Lhe values correspondlng Lo Lhe dlglLs 0 Lo are glven on Lhe ouLpuL
porL Lhe dlglL geLs dlsplayed on Lhe seven segmenL

You might also like