8051 Micro Controller Project Report

download 8051 Micro Controller Project Report

of 43

  • date post

  • Category


  • view

  • download


Embed Size (px)

Transcript of 8051 Micro Controller Project Report


$&ITTED IN THE PARTIAL F&LFILLENT OF ACHELOR OF TECHNOLOGYIN Electronics Instrumentation & Control Engg. $ession 2009-2010

$&ITTED TO:$&ITTED Y Dr. Neelam $armaA1AY K&AR YADAV (Incarge) EI&C Deptt.(EI&C 7t$E) I.E.T. Alwar (Raj.)

ACkNCWLLDGLMLN1 I proud|y express my respectfu| thanks to my esteemed educat|ona| |nst|tut|on IL1 wh|ch has b|essed me to cont|nue my techn|ca| educat|on and has prov|ded me a br|ght future I respectfu||y express my earnest thanks to my worthy s|r rofkamkesh Meena who prov|ded opportun|ty and perm|tted me for pract|ca| summer tra|n|ng I a|so respectfu||y express my earnest thanks to6ourov kumor kap|| I|nda| tra|neers of the ADVANCLD 1LCnNCLCG who has taken care of a|| the students |n the aspects and has gu|ded us profess|ona||y and techn|ca||y he|ped |n comp|et|ng my tra|n|ng keported

Department of L|ectron|cs Instrumentat|on Contro| Lngg

Cert|f|cate 1h|s |s cert|fy the sem|nar report ent|t|ed "LM8LDLD 551LM5" subm|tted byAIA kUMAk ADAV under my superv|s|on |s h|s own work and has been subm|tted e|sewhere for the award of any degree to the best of my know|edge and be||ef rof(Dr)NLLLAM 5nAkMA5|gnature nCD(Ms ICLL 5INGn) LIC DL115en|or LecturerLIC Depearment of L|ectron|cs Instrumentat|on Contro| Lngg

ATraining Report on LCD DispIayUsing8051 MCU

Contents Introduct|on M|crocontro||er eatures ofArch|tecture M|crocontro||er for Lmbedded 5ystems M|crocontro||er Vs M|croprocessor M|crocontro||er p|n d|agram p|n funct|on ort structure operat|on 5k's 5tack po|nter 5er|a| data buffer 8as|c reg|ster Address|ng mode LCD |n D|agram |n Descr|pt|on Interfac|ng of LCD L|st of nardware LCD Command Code Lmbedded C

Introduct|on We are llvlna ln Lhe Lmbedded World ?ou are surrounded wlLh manv embedded producLs and vour dallv llfe laraelv depends on Lhe proper funcLlonlna of Lhese aadaeLs 1elevlslon 8adlo Cu plaver of vour llvlna room Washlna Machlne or Mlcrowave Cven ln vour klLchen Card readers Access ConLrollers alm devlces of vour work space enable vou Lo do manv of vour Lasks verv effecLlvelv AparL from all Lhese manv conLrollers embedded ln vour car Lake care of car operaLlons beLween Lhe bumpers and mosL of Lhe Llmes vou Lend Lo lanore all Lhese conLrollers 1heoreLlcallv an embedded conLroller ls a comblnaLlon of a plece of mlcroprocessor based hardware and Lhe sulLable sofLware Lo underLake a speclflc Lask 1hese davs deslaners have manv cholces ln mlcroprocessors/ mlcroconLrollers Lspeclallv ln 8 blL and 32 blL Lhe avallable varleLv reallv mav overwhelm even an experlenced deslaner SelecLlna a rlahL mlcroprocessor mav Lurn ouL as a mosL dlfflculL flrsL sLep and lL ls aeLLlna compllcaLed as new devlces conLlnue Lo popup verv ofLen ln Lhe 8 blL seamenL Lhe mosL popular and used archlLecLure ls lnLels 8031 MarkeL accepLance of Lhls parLlcular famllv has drlven manv semlconducLor manufacLurers Lo develop someLhlna new based on Lhls parLlcular archlLecLure Lven afLer 23 vears of exlsLence semlconducLor manufacLurers sLlll come ouL wlLh some klnd of devlce uslna Lhls 8031 core

M|crocontro||ers 1he A189C31 ls a lowpower hlahperformance CMCS 8blL mlcrocompuLer wlLh 4 kbvLes of llash roarammable and Lrasable 8ead Cnlv Memorv (L8CM) 1he devlce ls manufacLured uslna ALmels hlah denslLv nonvolaLlle memorv Lechnoloav and ls compaLlble wlLh Lhe lndusLrv sLandard MCS31C lnsLrucLlon seL and pln ouL 1he onchlp llash allows Lhe proaram memorv Lo be reproarammed lnsvsLem or bv a convenLlonal nonvolaLlle memorv proarammer 8v comblnlna a versaLlle 8blL Cu wlLh llash on a monollLhlc chlp Lhe ALmel A189C31 ls a powerful mlcrocompuLer whlch provldes a hlahlv flexlble and cosL effecLlve soluLlon Lo manv embedded conLrol appllcaLlons 1he A189C31 provldes Lhe followlna sLandard feaLures 4 kbvLes of llash 128 bvLes of 8AM 32 l/C llnes Lwo 16blL Llmer/counLers flve vecLor Lwolevel lnLerrupL archlLecLure a full duplex serlal porL and onchlp osclllaLor and clock clrculLrv ln addlLlon Lhe A189C31 ls deslaned wlLh sLaLlc loalc for operaLlon down Lo zero frequencv and supporLs Lwo sofLware selecLable power savlna modes 1he ldle Mode sLops Lhe Cu whlle allowlna Lhe 8AM Llmer/counLers serlal porL and lnLerrupL svsLem Lo conLlnue funcLlonlna 1he ower down Mode saves Lhe 8AM conLenLs buL freezes Lhe osclllaLor

1he fo||ow|ng ||st g|ves the features of the arch|tecture CpLlmlzed 8 blL Cu for conLrol appllcaLlons LxLenslve 8oolean processlna capablllLles 64k roaram Memorv address space 4k bvLe of 8CM 128 bvLes of on chlp uaLa Memorv 32 8ldlrecLlonal and lndlvlduallv addressable l/C llnes 1wo 16 blL Llmer/counLers lull uuplex uA81 3vecLor lnLerrupLs sLrucLure wlLh prlorlLv levels Cn chlp clock osclllaLor

M|crocontro||ers for Lmbedded 5ystems lnLheLlLeraLuredlscusslnamlcroprocessorsweofLenseeLheLerm LmbeddedSvsLemMlcroprocessorsandMlcroconLrollersarewldelv used ln embedded svsLem producLs An embedded svsLem producL uses amlcroprocessor(orMlcroconLroller)LodooneLaskonlvAprlnLerls an example of embedded svsLem slnce Lhe processor lnslde lL performs one Lask onlv namelv aeLLlna Lhe daLa and prlnLlna lL ConLrasL Lhls wlLh aenLlumbasedCACcanbeusedforanvnumberofappllcaLlons such as word processor prlnLserver bank Leller Lermlnal vldeo aame neLworkserverorlnLerneLLermlnalSofLwareforavarleLvof appllcaLlonscanbeloadedandrunofcourseLhereasonapccan performmvrladLaskslsLhaLlLhas8AMmemorvandanoperaLlna svsLemLhaLloadsLheappllcaLlonsofLwarelnLo8AMmemorvandleLs Lhe Cu run lL lnanLmbeddedsvsLemLherelsonlvoneappllcaLlonsofLwareLhaLls LvplcallvburnedlnLo8CMAnx86CconLalnsorlsconnecLed Lo varlousembeddedproducLssuchaskevboardprlnLermodemdlsk conLrollersoundcardCu8CMdrlvesmouseandsoonLachoneof Lhese perlpherals has a MlcroconLroller lnslde lL LhaL performs onlv one LasklorexamplelnsldeevervmouseLherelsaMlcroconLrollerLo perform Lhe Lask of flndlna Lhe mouse poslLlon and sendlna lL Lo Lhe C

M|crocontro||er versus M|croprocessor WhaL ls Lhe dlfference beLween a Mlcroprocessor and MlcroconLroller? 8v mlcroprocessor ls meanLLhe aeneral purpose Mlcroprocessors such aslnLelsx86famllv(8086802868038680486andLheenLlum)or MoLorolas680x0famllv(6800068010680206803068040eLc) 1hesemlcroprocessorsconLalnno8AMno8CMandnol/CporLson LhechlplLselflorLhlsreasonLhevarecommonlvreferredLoas aeneralpurpose Mlcroprocessors A svsLem deslaner uslna a aeneralpurpose mlcroprocessor such asLhe enLlumorLhe68040musLadd8AM8CMl/CporLsandLlmers exLernallvLomakeLhemfuncLlonalAlLhouahLheaddlLlonofexLernal 8AM 8CM and l/C porLs makes Lhese svsLems bulkler and much more expenslve Lhev have Lhe advanLaae of versaLlllLv such LhaL Lhe deslaner can declde on Lhe amounL of 8AM 8CM and l/C porLs needed Lo flL Lhe Lask aL hand 1hls ls noL Lhe case wlLh MlcroconLrollers AMlcroconLrollerhasaCu(amlcroprocessor)lnaddlLlonLoaflxed amounLof8AM8CMl/CporLsandaLlmerallonaslnalechlpln oLher words Lhe processor Lhe 8AM 8CM l/C porLs and Lhe Llmer are all embedded LoaeLher on one chlp Lherefore Lhe deslaner cannoL add anv exLernal memorv l/C porLs or Llmer Lo lL 1he flxed amounL of onchlp8CM8AMandnumberofl/CporLslnMlcroconLrollersmakes Lhem ldeal for manv appllcaLlons ln whlch cosL and space are crlLlcal

m|crocontro||er |n D|agram and |n unct|ons ALL/kCG Address LaLch Lnable ouLpuL pulse for laLchlna Lhe low bvLe of Lhe address durlna accesses Lo exLernal memorv ALL ls emlLLed aL a consLanLraLeof1/6ofLheosclllaLorfrequencvforexLernalLlmlnaor clocklnapurposesevenwhenLherearenoaccessesLoexLernal memorv(PoweveroneALLpulselssklppeddurlnaeachaccessLo exLernal uaLa Memorv) 1hls pln ls also Lhe proaram pulse lnpuL (8CC) durlna L8CM proarammlna

5LNroaramSLoreLnablelsLhereadsLrobeLoexLernalroaram MemorvWhenLhedevlcelsexecuLlnaouLofexLernalroaram MemorvSLnlsacLlvaLedLwlceeachmachlnecvcle(excepLLhaLLwo SLnacLlvaLlonsaresklppeddurlnaaccessesLoexLernaluaLa Memorv)SLnlsnoLacLlvaLedwhenLhedevlcelsexecuLlnaouLof lnLernal roaram Memorv LA/VWhenLAlsheldhlahLheCuexecuLesouLoflnLernal roaramMemorv(unlessLheroaramCounLerexceeds0lllPlnLhe 80C31)PoldlnaLAlowforcesLheCuLoexecuLeouLofexLernal memorvreaardlessofLheroaramCounLervaluelnLhe80C31LA musLbeexLernallvwlredlowlnLheL8CMdevlcesLhlsplnalso recelvesLheproarammlnasupplvvolLaae(v)durlnaL8CM proarammlna k1AL lnpuL Lo Lhe lnverLlna osclllaLor ampllfler k1AL2 CuLpuL from Lhe lnverLlna osclllaLor ampllfler ort orL 0 ls an 8blL open draln bldlrecLlonal porL As an open draln ouLpuLporLlLcanslnkelahLLS11LloadsorL0plnsLhaLhave1s wrlLLen Lo Lhem floaL and ln LhaL sLaLe wlll funcLlon as hlah lmpedance lnpuLsorL0lsalsoLhemulLlplexedloworderaddressanddaLabus durlnaaccessesLoexLernalmemorvlnLhlsappllcaLlonlLusessLrona lnLernalpullupswhenemlLLlna1sorL0emlLscodebvLesdurlna proaram verlflcaLlon ln Lhls appllcaLlon exLernal pullups are requlred

ortorL1lsan8blLbldlrecLlonall/CporLwlLhlnLernalpullups orL 1 plns LhaL have 1s wrlLLen Lo Lhem are pulled hlah bv Lhe lnLernal pullups and ln LhaL sLaLe can be used as lnpuLs AslnpuLs porL 1 plns LhaLareexLernallvbelnapulledlowwlllsourcecurrenLbecauseofLhe lnLernal pullups ort2orL2lsan8blLbldlrecLlonall/CporLwlLhlnLernalpullups orL2emlLsLhehlahorderaddressbvLedurlnaaccessesLoexLernal memorv LhaL use 16blL addresses ln Lhls appllcaLlon lL uses Lhe sLrona lnLernal pullups when emlLLlna 1s ort 3 orL 3 ls an 8blL bldlrecLlonal l/C porL wlLhlnLernal pullups lL also serves Lhe funcLlons of varlous speclal feaLures of Lhe 80C31 lamllv as follows orL ln AlLernaLe luncLlon 30 8xu (serlal lnpuL porL) 31 1xu (serlal ouLpuL porL) 32 ln10 (exLernal lnLerrupL 0) 33 ln11 (exLernal lnLerrupL 1) 34 10 (Llmer 0 exLernal lnpuL) 33 11 (Llmer 1 exLernal lnpuL) 36 W8 (exLernal daLa memorv wrlLe sLrobe) 37 8u (exLernal daLa memorv read sLrobe) VCC Supplv volLaae V55 Clrc