Sie sind auf Seite 1von 12

"LM8LDDLD SS1LM DLSIGN"

Introductu|on
A mlcroconLroller ls a compuLeronachlpor a slnglechlp compuLer Mlcro suggesLs LhaL
Lhe devlce ls small and conLoller Lells LhaL Lhe devlce mlghL be used Lo conLrel ob[ecLs
processes or evenLs AnoLher Lerm Lo descrlbe a mlcroconLrller ls embedded conLroller
because Lhe mlcroconLrller and lLs supporL clrculLs are ofLen bullL lnLo or embedded ln Lhe
devlces Lhey conLrol
LvenaL aLlme when lnLel presenLed Lhe flrsL mlcroprocessor wlLh Lhe 4004 Lhere was already
a demand for mlcroconrollers 1he flrsL conLroller Lo galn really wldespread use were Lhe
lnLel 8048 whlch was lnLegraLed ln Lo C keyboards and lLs successor Lhe lnLel 8031 as
well as Lhe 68PCxx serles of mlcroconLrlllers from moLorola
1oday mlcroconLroller producLlon counLs are ln Le bllllons per year And Lhe conLroller are
lnLegaLed ln Lo many appllances llke
O Pousehold appllances(mlcrowave washlng machlne coffe machlne)
O 1elecommunlcaLlon(moblle phones)
O AuLomoLlve lndusLry(fuel ln[ecLlon A8S)
O Aerospace lndusLry
O lndusLreal auLomaLlon
A mlcrocoLroller ls slmllar Lo Lhe mlcroprocessor lnslde a personal compuLer Lxamples
of mlcroprocessors lnclude lnLel's 8086 MoLorola's 68000 and Zllog's Z80 8oLh
mlcroprocessors and mlcroconLroller conLaln a cenLral processlng unlLor Cu 1he Cu
execuLes lnsLrucLlons LhaL perform he baslc loglc maLh and daLamovlng fucLlons of a
compuLer
1o make a compleL compuLer a mlcroprocessor requlres memory for sLorlng daLa and
programs and lnpuL/ouLpuL (l/C) lnLerfaces for connecLlng exLernal devlces llke keyboards
and dlsplays
ln conLrasL a mlcroconLroller ls a slnglechlp compuLer because lL conLalns memory and l/C
lnLerfaces ln addlLlon L Lhe Cu because Lhe amounL of memory and lnLerfaces LhaL can flL
on a slngle chlp ls llmlLed mlcroconLroller are used ln smaller sysLems LhaL requlre llLLle
more LhaL Lhe mlcroconLroller and a few supporL componenLs Lxamples of opular
mlcroconLroller are lnLel's 8031 MoLorola's 68PC11 and Zllog'sZ8


Lmbedded systems 8u||d|ng 8|ocks
1he hearL of any Lmbedded sysLem ls generally a MlcroconLroller SomeLlmes processors
are also used
Computer and Lmbedded contro||er
All compuLer conLaln four hardware modules
O cenLral processlng unlL(Cu)
O memory
O lnpuL/ouLpuL devlces
O buses
Centra| process|ng Un|t
O overns Lhe order of lnsLrucLlon execuLlon
O conLrols access Lo memory and l/C devlces
O erforms arlLhmeLlc and loglcal operaLlons
O Pandles lnLerrupL servlces
O ConLalns ALu conLrol unlL lnLernal reglsLers Llmers buses
Memory
O ConLalns lnsLrucLlon and daLa
O von neumann archlLecLurelnsLrucLlons and daLa sLored ln Lhe same memory
Memory techno|og|es
O AM(andom Access Memory)
O CM(ead Cnly MLMC )
I]C Dev|ces
O Serlal l/C porLs
O arallel l/C porLs




Lmbedded Systems Arch|tectures


Cr|g|na| 80S1 Ieatures
rogram Memory(CM) 4k
uaLa Memory (AM) 128 byLes
1lmer 2
Serlal orL 1
lnLerrupLs 6
lC lns 32
8031 om less 8031 le no lnLernal program memory
8032 Lnhanced 8031 8k program memory 236 byLes of AM 8 lnLerrupL sources
1he 8031 ls a 8b|t processor
CISC core Complex lnsLrucLlon SeL CompuLers ls a CWLuL lnS1uC1lCn SL1 and lL
mlmlcs hlgher level languages so Lhere exlsLs an ease of programmlng A Comp|ex
|nstruct|on set computer (CISC pronounced llke slsk") ls a mlcroprocessor lnsLrucLlon SeL
ArchlLecLure (lSA) ln whlch each lnsLrucLlon can execuLe several lowlevel operaLlon such a
load from memory an arlLhmeLlc operaLlon and a memory sLore all ln a slngle lnsLrucLlon
arvard arch|tecture ConslsLs of dlfferenL Address and daLa 8uses
Parvard ArchlLecLure refers Lo a memory sLrucLure where Lhe processor ls connecLed Lo
Lwo dlfferenL memory banks vla Lwo seLs of buses
O 1hls ls Lo provlde Lhe processor wlLh Lwo dlsLlncL daLa paLhs one for lnsLrucLlon and
one for daLa
O Lhrough Lhls scheme Lhe Cu can read boLh an lnsLrucLlon and daLa from Lhe
respecLlve memory banks aL Lhe same Llme
O 1hls lnherenL lndependence lncreases Lhe LhroughpuL of Lhe machlne by enabllng lL
Lo always prefeLch Lhe nexL lnsLrucLlon
O Lhe cosL of such a sysLem ls complexlLy ln hardware
O opularly used ln uS's


















ASSLM8L LANGUAGL
Cu does Lhe processlng ln blnary lL undersLands Lhe laguage of 1s and 0s 1he program
LhaL conslsL of 0s and 1s ls called machlne language lL ls Ledlous for humans Lo wrlLe
program ln machlne language Pence assembly language was developed LhaL provlded
mnemonlcs for Lhe machlne cde lnsLrucLlon whlch made programmlng fasLer
rogramm|ng mode|



Cond|t|on code keg|ster


Structure of Assemb|y |anguage program
Motoro|a Assemb|y Label Cpcode Cperand(s) CommenL
Language sLarL LuAA #C load acc A
O Label name for a memory locaLlon
O Cpcode mnemonlc acLlon parL of lnsLrucLlon
O Cperand access Lo daLa for lnsLrucLlon vla addresslng mode
O CommenL " lndlcaLes commenL follows can also be used aL Lhe beglnnlng of a llne





kCGkAMMING USING 'C'
C la a programmlng language creaLed aL Lhe bell laboraLorles ln Lhe early 1970s when low
level access Lo Lhe machlne was consldered lmporLenL
Character|st|cs of 'c' |anguage
O Lowlevel" Language
O SLays very close Lo a processor's hardware
O MlnlmallsLlc
O 8aslc slngleLhread conLrol flow consLrucLs + opLlonal llbrarles
O LlghLly1ypes" Language
O uncLlon8ased
O Lmphaslzes on sLrucLured deslgn and modularlLy
'C' Var|ab|es and Data 1ypes
A varlable ls an lnformaLlon holder whose conLenLs can be used or changed by Lhe
program A varlble ls genrally ln lowercase LexL lf Lhe varlable name coslsL of more Lhan
one word Lhan Lhe flrsL laLLer of each successlve word ls caplLallzed
Constant
A consLanL ls a varlable who's value can noL be changed durlng Lhe course of Lhe
program ConsLanL's are usually glven a value aL Lhe Llme Lhey are declared (lnlLlally
creaLed) ln C consLanLs are generally creaLed wlLh Lhe deflned sLaLmenL
or example 3deflned pl 314 /* deflne pl Lo be 314*/
Numer|ca| Data 1ypes
uaLa Lypes are for Lhe Lwo baslc number formaLs whole numbers (also called lnLegers)
And declmals (also called real or floaLlngpolnL numbers) 1he comman lnLeger daLa
Lypes are
O lnL
O ShorL
O Log
All of Lhese daLa Lypes are slgned daLa Lypes meanlng Lhey can have a poslLlve
or negaLlve value or poslLlve Lhey keyword unslgned" ls added Lo Lhe daLa
Lype
O unslgned lnL
O unslgned shorL
O unslgned long

1here are Lwo maln floaLlngpolnL Lypes
O loaL
O uouble
A floaL has Lwo represenL aL leasL slx slgnlflcanL flgures and allow a rang of 1037 and
1037 1hese values are ofLen represenLed ln exponenLlal noLaLlon Lhe same noLaLlon
used ln maLh and physlcs or example Lhe number 1000000000 would we reLurn
as 10e9where e" represenLs 10 Lo Lhe power of" and Lhe number afLer e" ls Lhe
exponenL
uouble ls for doublepreclslon floaLlngpolnL Lype 1he double Lype ls slmllar Lo a
floaL buL exLends Lhe mlnlmum number of slgnlflcanL flgures Lo Len

Character type
varlables LhaL are deflned as a characLer Lype can hold leLLers as well as numbers
and even puncLuaLlon marks ln Lhls case number are noL LreaLed llke lnLeger and
declmal values buL are LreaLed as characLers Lhe same as Lhe leLLers A or Z ln C
characLer Lypes are deflned wlLh Lhe keyword char varlables of Lhe char Lype can
only hold a slngle laLLer of number
Str|ngs
SLrlngs are anoLher characLerbased daLa Lype ou can Lhlnk of a sLrlng as a serles of
characLers SLrlngs are usually longer Lhan a slngle characLer buL do noL have Lo be
A sLrlngs can be a slngle word such as LexL" or a small phrase such as Lype a
number"
Cr even a comblnaLlon of characLers
O CharAlways a slngle byLe Also used for LexL
O lnLusually" maLches Lhe slze of baslc sLorage unlL CfLen 2 byLes
O loaLslngle preclslon floaLlng polnL (used for fracLlonal maLh)
O uoubledouble preclslon floaLlng polnL (wlder range of numbers)
Var|ab|e Mod|f|ers
O ShorLremalns a 2 byLe lnLeger
O Longlncreases number of byLe used for an lnLeger (4 byLe)
O SlgnedLwo's complemenL number (uLAuL1)
O unslgnedAllow as unslgned arlLhmeLlc
O SLaLlculrecLly allocaLes memory Lo remember a value beLween funcLlon
calls
O LxLernAllows access by oLher flles
O ConsLAsslgns a consLanL value Lo varlable
kLAL 1IML IN1LkkU1
lL keeps Lrack of Llme and also lnlLlaLes Lask on perlodlc basls lf a Llme ouL occurs and lf
lnLerrupL ls enabled Cu generaLes an lnLerrupL requesL and Lhe 1l vecLor ls feLched
1he Lechnlque of walLlng Llll Lhe flag ls seL and Lhem proceedlng Lo do oLher Lask ls known as
polllng lL ls noL a effecLlve procedure lf Cu has a Lo servlce many devlce as Cu does noL
do any producLlve work whlle checklng for Lhe flag
A more efflclenL Lechnlque would be Lo use lnLerrupLs ln Lhls meLhod any devlce whlch
requlres Lhe aLLenLlon of Lhe Cu lssues an lnLerrupL Lo Lhe Cu of Lhe mlcroconLroller 1he
conLroller Lemporarlly sLops lLs work and proceeds Lo servlce Lhe lnLerrupL
1he program assoclaLed wlLh Lhe lnLerrupL ls called as lnLerrupL Servlce ouLlne lnLerrupL
vecLor 1able ls Lhe place from where Lhe address of Lhe lS can be feLched
1he Cv (clock and reseL generaLor ) generaLes a realLlme lnLerrupL when Lhe selecLed
lnLerrupL Llme perlod elapses 1l lnLerrupL are locally dlsabled by seLLlng Lhe 1lL blL Lo 0
1he realLlme lnLerrupL flag (1l) ls seL Lo 1 when a LlmeouL occurs and ls cleared Lo 0 by
wrlLlng a 1 Lo Lhe 1l blL











S1LLk MC1Ck IN1LkIACING
SLepper moLor converLs LlecLrlcal pulses ln Lo roLaLlon 1here ls a speclflc sequence as Lo
how Lhe pulses are Lo be glven speed of roLaLlon depends on frequency of Lhe pulses lnpuLs
ln appllcaLlon such as dlsk drlves doL maLrlx prlnLers and roboLlcs Lhe sLepper moLor ls used
for poslLlon conLrol

unlpolar sLepper moLor enerally 6 or 3 wlre lnLerface ls provlded
3 wlre lnLerface lmplles LhaL boLh Lhe power Lermlnals (12) are shorLed



Contents

1 lnLroducLlon Lo Lmbedded sysLem
2 Lmbedded sysLem archlLecLure
3 Assembly language
4 rogrammlng uslng 'c'
3 eal Llme lnLerrupL
6 SLepper moLor lnLerfaclng

Das könnte Ihnen auch gefallen