ebook img

The Final Word on the 8051 Microcontroller (tutorial) PDF

255 Pages·1994·1.479 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview The Final Word on the 8051 Microcontroller (tutorial)

THE FINAL WORD ON THE 8051 - Introduction sihT si a kr oetolu blod obner aah tlt sne . tote1syicng5tloIr0nira8amc ldai fnfmoecs etdI d esdineottni egt sv nn, rtisi eu,ucg ez1dmor oeeeui5npyeryj hmqm0aod ooetoii8lawfrhsnteeepthpvrncoeedt rsoefpi cseuroi readvi v k .ooos esrtoifs tpbhoo ctp teretsIj uhoioeptnrs poreushosostfuyecorp tnereffid sepyt fo deddebme.stcejorp ,e lrbeiv seIsr oed ph eeWs dveeualdlhpoc mcnoaitx e. ernkeoari maseesh lutcc seirde h eTsrtanionpi .r e htcf p uonatM e h nfevgceiohinhotgitptar td sess usa nflsaaolue icmsestricade jeo rr kepeohhowtb si hetd oecl bsai ln iona ov ,iaeknhsatip dmootc esu ti uo yll idween ot r ae ibhltiimwaf C dna1508 e ny .ineerfarr emael hb l Tmna de ii oes1 Cretds5ro bn a0otae k 8uttsos tnoioieinbhc tnrieslbmessa ko oabt aldet ne Ihseticru otss ee bh,trelbmes s1 a5 .I0r CS 8osNtfAAuo bnara eoy ltun bau cosykoob hci hsw ie emr ofrr ufr1oo5yd0 n8reov. rlee ahl tutbrsanma ehaelhmtmsu toscricaiuwtoryap d nluk i oooerdhyohoebtflip mdee o nt decsaoIohnrctiwat neotctek sniodina p e mendeohoohctcT ette k e .send etd ih o osh aet d ttscithta yooihtshna t n Tetessdlteanabhano i.tsc d ny nrul tauflsIhouiyf syida eort o go m tre dnutdeiosnr yya es se vatb.irsla tepf cdore uj ooeyrmpo Sfo e egt rnilialuhiqcwer ero f tedi .beon mttareancu trioesgybyestni s kli po lhnlo uiTrebwowahoy e hole t keta hsmtteu bo f so e.luheootvoyat h f I uyeolvy nano1ha508 ,relb mueosysa nac lli tnsrae lmorf siht koob dna esu ,eshetlp mtauxbe uoy lliw evah ot edicedrof flesruoy woh ot tnemelpmi eht C egaugn aslelpmaxe ni .relbmessa sihT si ton a tluciffid ksat rofenoyna .t erselbmes s1a5 0e8 hdt n fCasocis aeb hstdnatsred nouhw If you have a C compiler for the 8051, then I congratulate you. You have made an excellent decision in ruoy esu fo .C uoY lliw dnif tah t trn uetomc ypeeojmloie rtvgpendisu C si rewol dna tahtruoy ec ne amgninetitsnu iCam si o.srleawol fI uo yeva heh tl i,e e K1gn5aeCkh ctuao pyev aehdamna excellent decision in 8051 development tools. I have found that the Keil package for the 8051 provides .sn o i efslseue vInitno hfaeereoyCtohtKoh xpt yep.luttsrc oe e k ep rsdtonhpeiiosoiTuhdhcebsttb t nsreeemghpatok olcheacvpuesd sseademih crro A,tecov Auoy lliw dnif taht siht koob si llits fotaerg ecivres ot .uoy ehT niam gniht ot eb erawa fo si taht uoy yam evah ot egnahc emos fo eht lieKcificeps sevitcerid ot eht etairporppa seno rof ruoy tnempoleved.sloot e er.sas e nheuT dreolcpm a exhhect ienhrowawd r easfhhmotarg a eikrd oaso ibsnheitc ayl npnaIm ton dednetni ot eb lluf ,scitamehcs tub era ylerem kcolb smargaid taht evah hguone noitamrofni otwolla .erawdr ae hhoettcafret ntis uemrawtf oe shw todhnatsred nouutoy .sss iinhgTi smeedt ssyusoi refacov rn u aaorhseth tla orgontin rks a oaaesol ibnh otkp oudollu ouhosY eraw drrea phnso e er1fveip5oiht0gti8l inb oafeipohtatacr or le n ph,atxtkueaobro b tk 1oon5noa0c8 r uhoc yim hoswr a fee f cdko srio sau oa ioeblhs s ltuuti oawky h n. trino ehgtfti esIererpdawt fdonsa uko ny, ihIhgtu o,hytlsuoi r!esSe s doenrnaihs ndfulos rsouwole vwn r oiaa drmdngraaobgni rspnsgised e glmd l oelnisrluiw ifwfakhoeg otnstoku ablh lt pi e lws vy enroluh gurtodiopay nsymeeaeirkdgaumoy .u r1 u5sg0’8ynap mr oue cokkyiolol egaP 1 CHAPTER 2 - THE HARDWARE - The Hardware Overview ehT 1508 ylimaf fo o rscriemllortno csi desab no nearutcetihcra hcihw si ylhgih dezimitpo rofdeddebme control systems. It is used in a wide variety of applications from military equipment to automobiles to the 15 0e 8h,tsel assrosseco rt pitbhg in1ei1CH 8a6lorot oe Mhoyttl ndon o. c CrePu S ondyoraobyek family of microcontrollers is available in a wide array of variations from manufacturers such as Intel , Philips sne m,deniaS 1 5 e0soh8lttarehpi r desnpearut aseufore mduen ded vasarherutcafu n ea.sm ehT 2 Is ahcus .st udpettuao l hu, etdsdsd ornligmeauwompdi ht,cstraewtr e lvgan o to,loicsatgenicadaf rCetni es rt n al5owso.totv1dnemeriu qeegrat ldz sonH pdvaMoue 0tek4pc soh lt1 sci5efnw0hoo8titairaV .e le b cea sdteigls siend oniaf eth seinhaa oy hrTsalw ocr veleta eble1anirpnkeh5omoaact0acmx8fe eru trc oeef ts siae'h bryc ainretaannpi emls o tfcecocundio srtpi msnrna oocyfindrtanecmapnuf developers will only have to learn this one platform. :ser u gtsnati eswf f iooeeslrhnlutootcfcet i cheichsrTaab • ntah gtiiebULA • desse cyclalaudiv i ndhe an cbs cifip)oh u8 wso 4 nrO(eig/tpIerc s2e3d • sret nouwo tc6/ 1rteimbit • full duplex UART • ste pc hur6truiro wesyst tln2ieirvoeilrp • M AdRra onfsbooet y8b21 • yrom eEmD Od CnAaT Ar Dosfeca pssserd deat yK b4e6tarapes elc yrcosseco r1p5 0e8nO stsisn ofr.co osetdvaollielrwietcp so hcaE fo er h ostetdvaollielrwietcpssio ys itapdurre t ensfhieotlp m dasnseahc tee dfhspo caoceu rs1o 5c e0nyh8obtitc nluafi c r edoapefssu niahc ro f .gsntipdunrerpetn i ehT em idteriuqe rrof yna n1o5i0t8cur tnsanci eb detupmoc yb gnidivideht kcolc ycneuqerf yb ,21 gnitrevni taht tluser dna gniylpitlum ti yb eht rebmun fo rossecor pselcycderiuqer ,, e ku.rf z con oiuHe oy ohf oMvnlmic egy9aoc etisrn 5hiantshiein0tisewhsa.cyuTu 1usqy 1rbethstni nac etupmoc eht rebmun s nfooitcu rrtespni dnoces yb gnidiv isdiht eulav yb .21 sihT sevigna y cnnoeiutqceurrftsni of 921583 instructions per second. Inverting this will provide the amount of time .)sdnoceso r5c8i 0me. l1nc(oyictcur tn hseycnkbaiaet egaP 2 THE FINAL WORD ON THE 8051 Memory Organization se cyarp ostmcenmi tyslildaci sey e hh rrspteheeihtsdwtui veorruptceti h 1ce5rh0aT8 nee se bna chcih w in erugiF A -1 smeosrs fes.0ru dos dut,moag s eu tifiey zmetoscrhniihnnaocisxtoopmaaccseEmm ,se t fy sob h n r.cyoeeeirih fchott seawmc dp rpeuge as smrnvelsti lrreszyoaernibsvdileodirAtu .wo ldeebbir c nssoeaidtc nsuefc aypr so .meeee c mreashhpstTse r ydnolde tlavaaicgificeps erugiF A - 1 er u-t c 1ey5tr0io8hmcerMA The CODE Space e hty Tsrerocimafep mssi e h ttEnDeOmCges tn e.m sgs eeidshi Tsmearrg oerlpbatuc eehxhc etinhiw da e srtanemg essi hsttae rrtosseco r)e.p sheTn islserd d 6 ay1dbesserd d s atieicni sK( 4 o 6p teunbac ,r e. vM he O scweRnauocPasHi Evy ersdo s mae eecotmctaairpor psplaan geitsare nl eldyginlwano de d.d M eg O yb nnRnmdiaPaeesEMtunem e t ltsepnubmemi m Eg teDe nahO sstahtCseoetionmhdt 1 5 e0ryh8ebth tnieettirwr eyoevrtboo m eeshmwto lhlca iMhOwR PgEnE i essru yaeasd eshmtetsys nearcawt fweo e csy n onsottiadcseud oseorehtpdtar gs pe. ukes acimih vTleadn r f er lytonebxaseti . MlO lRwaa Pet eEnsdtlnnibiamess a gsoniti dvn aarhheth tMaOrR Peo EhtdEtneidaoln weobd dsyeM rkAn,ecRaytaSc ltbe labdabenso uineticia dlfdpo A .nMaOR P sE dr soeeihfhehtftmTeoams tf ro yoens va tasoh en do,ndMaOR PsnE eaEtso ia d eneohurttawt f wodesano lyopttuilibapac MegAhnRtiylp pyurset ten ahe,bthr we. vsMe a Ow hhR o scPsHnauEnasEoitati meil lceytcirw/daer yll a,usteniedv eos seod eehrtawtf onsi .ti gnisU na MARS ni ecalp fo na MORPtEn enmipoleved , t e ni.sn eamionb cehdett hstWyesg reo aht et t ngdwfinoeoicndaoln wdoi dprsaowrfo lslmaetsys s, esd l M ngdnhsoOpaniatssRliocialPesvwhaEhaare/gnitset/gni m dm esiaelp orhclfvgtyeoaochrp over an in circuit emulator which is usually a rare commodity. n Inoitidd aeoltba t,uecdeoxce ti si n oemcmiotcc ahrtpiw eht 1508 ot erot sdex ipfuk osoellbat nieht .t nsE hen D wcmosO do ig isCeilhe,tetpl w sscca aas oiuctsr eethraieo lhttldaT1btsiii5ancvv0tiao8frp eht a trae dt)nRiToPpD( ro e hm tarregton ruhpotciw na tesf footni e hydt leeldlaibnvaoo tirytpbpoeht ed Rh ndTtnaePi dD naseaosbcler de dssaa'b e,l sbaeamtitne tt faso hn. tars eoimthaTlumucca tne mfeo leeehl tb saos ttenca cc .ae rbdol t e da nhneloim u i reymetsohbu hiiftceTdrch1deat5ap08 .n ogi n tin adoeun nht Aset ih epnscneyleoiavncdihcaay twsmcnco uif r toetg uhsnectniheirtxued elp mfa oxseih t s nirweoth a snlr iestiphnatihc egaP 3 CHAPTER 2 - THE HARDWARE gni tAsi L-5 . egaP 4 THE FINAL WORD ON THE 8051 The DATA Space lan rs e e ftt8,lt Mo ns 21ayrAenire15nboRho i h0rtsfet 8e ecfste8ytaoinh2rypit 1obsdmne omecheTs dt enore t rms AeegayThfelAteslD r aM t.cA nn2iResoe5p hi m0ystg8tiehsT . ehT s nMoAiRtanciol h cesu mimsiste c.scn iaohiTtcurt s engnhinotidne pseedl c oy erwcdnnoteiosse c ectranaem gseisht ani aavrheth tyalrtce rdiedsser dysdriao meesmua ctenbem gAeTs A esDohsXtte cnc aarhetkciuq yromem retniop hcus sa RTPD hcihw tsum tsrif eb .dezilaitini ,ero fyelrtenheTuqerf desu selbairavdna t ensenouboimdt a.ct on hl ec ldm uAaegoeSTnethAgst Diyslsla aseuerslauba ihrcatv ayrrcasropmet with care, however, due to the limited amount of memory in this segment. gn ir e eay b0til.rRsvt1oi c RgeeehrrTi ddneiss e o cesntcblanaacem gA deTenesAhir DtosteslbairaV .dee s red ehert Tvo ls e ea sfietoe orh y trettnbedbeihdrata t tnrsoeuctm nyi rod opesemsaheutm .et yabt andoitanitsed/ecru oe shngtonidnep esdelc yrcosseco ro pwre toneok an tascnoitcurtsni s trfesuohio tsftnnoecm g.et sst b es uerrss heitfTtfnone imrgeel s lsoanwmitsa ttnnoec m AgeTehAsTD r ueosf e yfh enot nsa 1au. 5c M e0sfAh8eoRT tt2ys3b r eiehfstop mhocc ishkw nraebtsi gsfetores yetnlaabaegn asshki cnraebtsi gnfeoorit c.e kl enerhaseTbtsi gtelrua f ssesteda ittyh b gsfipoeuorg emit aiv eht 1SR dna eht 0SR stib ni erhots sseuctoartP Sdro W.)WSP( esehT owt st iebnibm ooctnia rken taos sbte e .itrehmdgaebtoee cbr sr himftu0)cdunt innaiohicbtw i hf g 3 ti1netinSihswgReto(ibms rro of eoshdnt eop so tl,uagbnis sraeptema rkacp i ruyoq lf tnsoowno lglnaihct ikw nsraebtsigeR g ngi n hkincsyotaf itiew.lhs1pt5m0i8s tnemg eeslbasserd dt a isaebica pAsT AeD h nttinemges-b udsnoc eeshT ne tabhic cbhace inhiw .de sd t seyn erl esocrlsmitceaigh afuteTsedn s arieAevmThigAtdeDnsBi elbasserd dt .aie bhT snia t. ny1 or5e co0 hsm8nTk einrmaebtsi gr eueerohv fto)bs at8 i2 sb 1se f(tt6osy1ibs ntoncemges lareve selgnis tsinboitcu rhtcsinhiw era netfo yrev lufesu ni lsonrotintoaccil pdpnaa dia nignicalper .m e t tt ns se nutgyge oorntsrhecaiIa trpc tnaus1eiw du5hthc eh0tftilrt8oigaswoilrotani blmaoncretxe et yrbeh tyo neak itls usjis a"bediw-ety bnad"oessec c eaobs lna ascet y 6be1se htta hdtet o endbluohs .ec aA pTensAhiDt Special Function Registers MlAaRnr e dtneniniiat ne1 sor5enlca0hoa8trehpi redmehneptat stypsurre tersnhoritfetsi gleorrtnoC sn o0i8 xtteaahcol e.se ev hodTbnaa + 0 1 2 3 4 5 6 7 e rsaretsiger F8 doestrarefer F0 B special function E8 sretsiger ro(RFS s E0 ACC for short). Many of D8 them are bit D0 PSW e. heTlbasserdda C8 T2CON RCAP2L RCAP2H TL2 TH2 bits in the bit C0 sR FeSlbasserdda B8 IP reebh tniaec B0 P3 ,em a yndbessecca A8 IE .sse r xdtrediodabni A0 P2 re fnu,eaosrcyuhT 98 SCON SBUF to the EA bit of the 90 P1 e ltbpaunrEretnI 88 TCON TMOD TL0 TL1 TH0 TH1 RFS sa , A,E7.EIro 80 P0 SP DPL DPH PCON .Hs FReAFh0ST hc ussgni hltortnoc - Denotes bit addressable Special Function Registers in this table and all following diagrams as the function of elbaT A - 1 the timer ,sretnuoc/ ed,hnTt aReAhUt egaP 5 CHAPTER 2 - THE HARDWARE snoitcurts nft ioeesm ae shydtbessec ce arsaretsig ee rs.e sheTitiroi rrpie hsltal esswaecru otspurretni . st ssdenea tn teh n iaymtAeiybbgThpr eAtaoAsDmmem h csirhewts igegnheitrta c i sdfeRnohFitS nniwo h sseilbasserd dta iebra elbaT A -1 . The IDATA Space 1 5n0i8atreC l l h a sMasc8nheAn ri2rct Ro fneh1euyyisoibw t sb ltaamenn2iitehia5mdnmt0ado8fac edis etr asn oMiA tR0a8co lxeh d.neavoba tsniehmT gfeos M Ad Reyrl rls eaiofcteirpy tsa ehAtTADI neewt esbtcilfn oscserd d,apalre vsoesserd dR aFe Shd tnsaesserd dAaTA De Ihetsu a.c tenBemges e ,ceAd nhTe Mi tAmdAsdD reR n Ieov syag hfl sRbnee troesFirhyespeS eatrpeycfbortcomaem .se dgonmisser dtdcaeri dadnieivss e y c elnctbnaanocem gAeTsADI The XDATA Space The final 8051 e h stsaen islserd d 6ae1m aes h ytdbesserd d sadi nhatgn e nlKi 4 s6eica pysromem e ycr A.yd raoeTtle laop(hAn lroatmstD e ea rt naeXEmsc ces rdmDgiasifaeeOehpipehtCsTsyrtxte )deyO sM nhl/ntAfatlIa sRoa tiS ue rsfMsmyonoAuolsoR(slc atu ns.eu) mt s g riterohnsohTefsmges e cas a ils .hfs va to scrner1ittuieoheo5sbht it ht0uwn tdp8m ilaai earersrtneReeo irppcrreoiowtvxeed rR eT ghPdntDeii mses ru ed orlnef ocarrtemsyaenku sc pea mf esmtaioocignwoheitrtsmp , ,0 Rro .1R noiti dsndsiaer dddeari s eedhd ateoo rtlsroeoml cryocssec o orswpet kyaltla u,tsRiu TefP soD eanhcIt ot eht ow tsdeelrciyucq eo rtmrofr eepht daer r o. neotiitra wr, e ygplnoriadlaio ml0iRS ro 1R lliwekat minimum of one cycle in addition to the two cycles imposed by the memory access itself. Therefore, it is ysae ot ees taht a nloaict iahprtyeitpwo eht A TtAnDe Xm,glelsiw n,ilar eenkeagt a mumini mfoeerht . sreol sces ysecuc a ofc,roesp Bieth hntAteT mAsg Di eeesvc iaayt l lcoypetatrrnr eoetyvtutnsqaaerf .sel bdaeisruav tI si elbissop ot llif siht tnemg eysleritne htiw K46 fo MAR fi eht 1508 seod ton deen ot mrofrep ynaO/I g se sn eeselMei oh re hcA cen rttn acssyRdnib iseofOit icnevhunf/virwahetb goIeo wdifidewishetd r s enistihratel td penasihsc u l celesuibiqwdin h scgienhtitmro f srr .doedaesofpeihu hsvtbtseeMcca .koob egaP 6 THE FINAL WORD ON THE 8051 Bit processing and Boolean logic nael o toeiBlb gs nnaiisat n1o 5ce0h8T y nnsaonoitare ploacig omlrofr eodpte sen ubahcci hrwosseco rp tnem g T eesIn shtBietilbbasser d 8 de2fah1ot 2e 3hfy tond an,asR Fe Shnstit ieblbasserd d8 a2e 1h,t O /s Ietnriolp ( h0g utorro hp.t)3 eh T15 0 m8nrao cf,rR eO,pDNA ,t n,et me, esRdlOnprXamaoeclc snoitare pnoo stib sa llew sa gnivom tib seulav sa eno dl uyolwlamr oenvom etyb.seulav gnitsi LA - 1 MOV C, 22H ; move the bit value at address ; 22H to the carry bit ORL C, 23H ; or the bit value a t address ; 23H into the carry bit ANL 24H, C ; and the carry bit into bit ; address 24H hci hhwcna rhbc ue.s nnOoitidn oec h stsat idbesserd dea shuci hswehcna rlbanoitidn oocs lea rearehT y l llsuaifiecse upssie eh tpmuj“ fi tib si tes dn a.rnaoei lt”cctui rbtsn i shichnTa rdb n""arae lncaceb o rogp tedawnmenhnet iuhital s tjt cseetd evl i narrlacolraoecsywpovyctsso csd ee ncmoiorwrotpfrep o0t. 0n Pir podfeti ahwci hewnit u eoatri rod wtau hotya hetsopp u,selp m.a sxnseeaAd opecotarapes set, but could not wait indefinitely. This routine would have to decrement a timeout value and exit the . de rtec tosdr t kus u eo i ncosg smp efn,s eaeennoio0cesiehbmciito.xhthhWiolpl0ewetttrlP0spop and exit the polling loop. With normal logic flow, the routine would look like the following. gnitsi LA - 2 MOV timeout, #TO_VAL ; set the timeout value L2: JB P0.0, L1 ; check the bit DJNZ timeout, L2 ; decrement the timeout counter ; and sample aga in L1: CLR P0.0 ; force P0.0 to logic level 0 RET ; exit the routine noitcurt sCegnBhniJtisU .swoll osdfaed oedcblu oewnitu oerm ae sh,t gnitsi LA - 3 MOV timeout, #TO_VAL ; set the timeout value L2: JBC P0.0, L1 ; check the bit and force P0.0 ; to logic level 0 if set DJNZ timeout, L2 ; decrement the timeout counter L1: RET ; exit the routine elihW eht dno ceensituor yam ton reffo a eguh tnuoma fo sgnivas ni eht ,edoc ti seod ekam eht edoca r e dle npl.amtti tn ssia e n lge rol ernoi lrlei m tyiue heeealwoyTdbsuby n outmnafc ieomoess1hs5ta08 n o li rlteeeic rmlwuseolri hcot.hnwrsytitndninoach egaP 7 CHAPTER 2 - THE HARDWARE Addressing Modes se. ss y yse ntsrer e cto cuohogc1ac s eomTmnc5pedterieeia0sr nilirmmm8isabda rdianvfopiofarcep sessec ctac e.r yirDom esmsec csamets yrsosseco rhpci hhwguor hstdoht elmacip ye the treasehT e ra .fel senesohtiTitc uer ltnebsihan tiidrea svss sefeeec o hcrcfetnd aohedd tsaeyezbripretcarahc dyt er nd .s s tmon eneseney crmoeAmahRsallf eoehTgtFs cpnoerfmtAeSemobirDscadecxpaE .wole bnwoh ser asessecca gnitsi LA - 4 MOV A, 03H ; move the value at address 03H to ; the accumulator MOV 43H, 22H ; move the value at address 22H to ; address 43H MOV 02H, C ; move the value of the carry bit to ; bit address 02H MOV 42H, #18 ; load address 42H with the value 18 MOV 09H, SBUF ; load the value in SBUF into ; address 09H sessec ctaceridnI RrTeP tD, s(, riC,egP0 heRretro vo1 lnR soan nevoe1ihnh5 atit0 ht8)cniohcw en hartheth traertsi ggenrit n sieorohte ptfn eenrhotitc u.rdt eses nhs eiTe olcetbcba ai srefsahoevtrdda .d eehmTrof r eesrptanem gAeTs A dD,nXAaT A,DE I DsoOetCsse c l. cwslfsa oialihhe Tsstsierdda desse cyec lba nntaoncem gAeTs A eD.snhBr titeinB nsa imdnheitsse coec sba yltaanmem gAeTsAD directly. den toda er rnr el oee kpu, httcofd aae fwl soeestteoaeulsveaibrmbuosduamsq eycr cotamceemridnI htiw a muminim tnuoma fo edoc ecnis eht retniop nac eb detnemercni hguorht eht yromem aera aiva erheth tsnisieer d ede s ava anatbahncem gEe D s eOsohCettsse ctccae r.im dsniInah cgenmipool RTPD or the PC register and an offset in the accumulator. This is useful for operations involving lookup selbat .wo lnew boeshresasse cycrao mtecmer i sdfen oli.pm axE egaP 8 THE FINAL WORD ON THE 8051 gnitsi LA - 5 DATA and IDATA accesses MOV R1, #22H ; set R1 to point at DATA ; address 22H MOV R0, #0A9H ; set R0 to point at IDATA ; address A9H MOV A, @R1 ; read the value at DATA ; address 22H ; into the accumulator MOV @R0, A ; write the value in the accumulator ; to IDATA address A9H INC R0 ; set R0 to point at IDATA ; address AAH INC R1 ; set R1 to point at DATA ; address 23H MOV 34H, @R0 ; write the value at IDATA ; address AA ; to DATA address 34H MOV @R1, #67H ; write 67H to DATA addre ss 23H XDATA accesses MOV DPTR, #3048H ; set DPTR to point at XDATA ; address 3048H MOVX A, @DPTR ; read the data at XDATA ; address 3048H ; into the accumulator INC DPTR ; set DPTR to point at XDATA ; address 3049H MOV A, #26H ; set the accumulator to 26H MOVX @DPTR, A ; write 26H to XDATA address 3049H MOV R0, #87H ; set R0 to point at XDATA ; address 87H MOVX A, @R0 ; read the data at XDATA ; address 87H into the accumulator CODE accesses MOV DPT R, #TABLE_BASE ; set DPTR to point at the base ; of a lookup table MOV A, index ; load the accumulator with an ; index into the table MOVC A, @A+DPTR ; read the value from the table ; into the accumulator egaP 9 CHAPTER 2 - THE HARDWARE Processor Status WdSePl lReaFlcSbass e tr n sp dsitueadiitka bartosssecorP d rsouWt artoSsseco rP( .)ret ssiigheTr y trsi o nryty yei arar ,rhahtprla,trttciaui sian ibcmlennbc oshuihao dciwcxtihecut tsAaaDiurCweBpo ekso snatruaebtsi g eethrcte lhecs ish t wo idw,bntsag aelsfop rluapre n oe,wggt awloflfr e dvgnoaalf .ethltuafe d d ,esenArooi ftreenehb ettnm sokiing taescbrteil beeskam a owt t irbeb mmuonrf 0 ot3 ,)H 0s0serdd at(nemg eAsT Ae D hfetos ae b htstani g ke0.nb daeB s eoukbtn ae bhstetacid nhicihw yrom eemse h f tyo. nHA 8s1serd d tak3an adb nHa 0s1serd d tak2an a,bH 8s0serd d tasanig ek1bnab ssfeoldr asgeesrse rr sdiaedeisahvs teycr cotamcee mr t idc ednerlnarobiifadl is ay svaenawrolaiatacol . .wtn o uonf lW oiwoeSesytobPhiachT les klrneeastbs ieghetr Power Control :er adw etyt f b atosn vas eagihedcntt boi crm veae oarwswsu o nt tfp1oeao5ih e0stSf 8rOeeMhvHTC NO Ce Pha tidvessec ce arsaed oe ms.e ehd Tonmw ordew od pnead oemldi lort NrOeCw oP( ) SFR n inwoh ss ihcihw elbaT A -2 . The idle mode is activated by setting the IDLE bit high. The idle mode seunit nrooctalli ceddshneotavres eesrrtpanet nMloAa cRn. rp ne oootttinstIuc emxaerg olsrlepasuac ot nur tub si dekcolb morf eht .UPC ehT sremit dna eht TRA Ueunitnoc ot noitcnuf sa .lamron eldIedom is terminated by the activation of any interrupt. Upon completion of the interrupt service routine, noitucexe lliw eunitnoc morf eht noitcurtsni gniwollof eht noitcurtsni hcihw tes eht ELDI.tib PPrroocceessssoorr SSttaattuuss WWoorrdd ((PPSSWW)) -- BBiitt AAddddrreessssaabbllee CY AC F0 RS1 RS0 OV USR P CY Carry Flag AC Auxiliary Carry Flag F0 General Purpose Flag RS1 Register Bank Selector 1. MSB of selector. RS0 Register Bank Selector 0. LSB of selector. OV Overflow Flag USR User Definable Flag P Accumulator Parity Flag elbaT A - 2 ed onmw ordew oephT is activated by setting the PDWN bit high. In this mode, the on chip oscillator is sg.aan doselAtl ae hrnaoituce xeerawtf oslsal esTwaR Ae Uhd tnsarem ie th, ts.u dheTppots minimum of 2 volts are applied to the chip (assuming a five volt part) the contents of the internal RAM re w goanpiylp pyseabid onmw ordew oft pouroosseco re phetcr ooy ftay wl .ne doheTvrese relpbliw .tes enro ehTDOMS (Serial MODe detaren ergehte htwr olpair ee shfstoet adru ae bhetlbu ooddte sen ubat ci)b yb eht remit 1 wolfrev oetar ro e hr to.tyaclnleiucqseorf gnitteS DOMS hgih sesuac a gnilbuod foeht ,se td auerat b ae ,dr d,n r 1eero 2ide.tn omo2em3aesnt sirgie uTehn pWeTo h R ewrAeh oUttdfaurab the value of SMOD will have no effect on the UART. egaP 01

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.