Professional Documents
Culture Documents
MCA Notes
MCA Notes
‘A"READ-MOLIFY" type of instruction tke INC 2; wil read the value foam erste” Ah Qutput operation {Totally same as port 1} 1) To send a%0": Write a0" on the etch, The internal Vic Pull up provides a logic"1” on the port line Er i " Alternate function 1) Port 2 can be used as the higher order address b US (Ase = 2) The ram directs the Sadr oi -ontrol” signal shown in the dia ‘a 885 line to the “gate” of the FE bharatsir@hotmallcom Notes Prepared by Bharat Sp Chopra Academy Bandra 022 2642 1927 Scanned by CamScannerMicrocontrouers & App ICATIONS. 2m V (EXTC, ETRX, and Instrumentation} Yate Structure {Totally same as port 1 &2} Taput operation (Totally same as port 1 & 2) Output operation {Totally same as port 1 & 2) al junction 4) Port 3 has a list of alternate functions 2) The “Alternate Output function” signal directs the alternate function to the “gate” of the FET Used to receive Serial data bit by bit Used ta transmit Serlal data bit by bit Used to receive external hardware Interrupt 0 Used to receive external hardware Interrupt 1 “Gives clock input to Timer Oto act as a Counter “Gives clock input to Timer 1 to ect'as a Counter ‘Used to Wirite data Into external RAN, ‘Used to Read data from external RAM —tharatsir@l Notes Prepared by Bharat Sir ‘Bharat Sir: 98204 08 ‘bharatsir@hotmail.com Allthe best © Pop. Scanned by CamScannerBHARAT ACADEMY eo iy se, Thane ind agrhstore hae sy station cempet, Nera (WA NEVINS 2 2540 8086 / 809701 9, 2 2771 986 / 965 303 ay, power on Reset circuit of 8051 Sharatsi@hotmallcom ob’ ~ Wo apard = Sahat on Academy Bindra~ O95 Sea apap ue Scanned by CamScannerMicrocontroue Semv (Exrc, eTRy, RS & APPLICATIONS "Tend Instrumentation) JAVA » \cnes by Bharat sir starting Dee 2016 1 YP to aad en : Ql» contents of Znternal RM toca! Result at 42H and carry at 3H 7 * SOL: ov 43m, soon Zeliotie Cory as" ov As on Read frst number DD A, 42h ne JRC site ‘tn ry ty rth ~ cere, EE 8H 2 Store cary os "1" Pr HOV 42H, a Seen ERE: SuMP ERE End of rogram | QZ TES TGIEiPlY the numbers nat and 27H, store Result in cegisters nO SOLN: HOV A, HoB2H 1 Reed fist number 7 Mov OFOH, #26H | Reed secondmumter jk MUL AB 2 Multiply the operands * SBTB PSW.4 aun” ees 2 Select Bank 2 . HOV RO, & 1 Store 158 of result 4 ov Ri, OFOH 1 Sore MSB of result 5 HERE: SMP HERE 3 End of progrem 3 YAP to add a series of 10 munbirs. the series bagins trom Location 20H Q3 Sn retezna1 RAM. Store the result at locations 30 and 33H. s SOLN: MOV RO, 1208 sintlize Source adress : Nov Fl, 10a $intiaize count of 10 cur 2 Areaister wil accumulate the Sum ‘ OV OFOH, #09H register wikoccumulote the Carry F REPEAT: ADD A, @R0 AGS thecurent element Rie SNC SKIP {if na cary, then ctecty proceed aheod F ic oFo# ifthere iso carry, Increment 8Reghter 2, SKIP: ~ INC RO {Increment source edéress s DsWe:R1, REPEAT Decrement count. Count Is NOT ZERO then repect. z Mov 30H, A. 4 Store Sum 7 Nov 31H, OFOH Store Cory one: SIMP HERE 1 End of program ~ tharawsn@hoimallcom ‘Note: Prepared by Bhafat Sir ‘Bharat Sir'98204 082 mente Allthe best © Page Scanned by CamScannerv BHARAT ACADEM ), Tel: 022 2540 8086 / 809 701 ain nr tenn tC TOOT Sra we / et ne _ ‘Nerul (W), Navi Mur ‘Thane: 1, Vaghotkar AP Q4 TAF te add a certo of 10 a location Location 20H, Store the result st 2 ee psu Ce pooner emu te OMY mes ora ee Le ert ur tc anbt Ine OF Ziftnereiso cerry, sires ihe eo There sou SHO! ac cpen repent. DaNz RL, REPEAT Decrement count. Count is NOT Mov 30H, A | store Sum “ Nov 31H, OFoH $store Cory Heme: Some HERE 1 end of rogram rom loctticn uno to adi a series of 10 nanbors. The series begins £1 Q5 _Neoou’ sn teternal Ras Store the result at locations 3000 and 300in, SOLN: MOV DETR, #2000H Intille Source odiress Mov Ri, #oalt | intwatze count of 30 cur a 1 A* wilaccumulate the Sum, and ALSO get the data from Ext. RAM MOY OFOR, #008 1B register willaccumulate the Corry 7 MOY Ro, #00H + RO wil be used to REPEAT: MOV A, @DPTR Get the data rom Ext RAM . ADD A, RO {Add the dota tothe previous sum NC SKIP 3 lf a0 cary, then diecty proceed ahead INC OFDH bif theresa carry, increment 8 Register INC DETR {Increment source address o {Store current Sum in RO from nextiteration DaNz RL, REPEAT Decrement count. f Count ls WOT ZERO then repect. MOV DPTR, #3000H 3 OPTR gets address to store the Sum MOVK @DPTR, A 2 Store Sum INC DPTR DPTA gets address to store the Camy Nov By oFo# ‘Troe Cory rom BoA regen, MOVK @DPTR, A 4 Store Cony " ia HERE: SIMD HORE 2nd of program , : ! : ! : a 2 1 bharatsir@hotmall.com Scanned by CamScannerMICROCONTROLLERS & APPLICATIONS ‘Sem V (EXTC, ETRX, IT and Instrumentation) JAVA batches by Bharat Sir Starting Dec 20 QE FAP t© copy the value 254 to ali locations from 2000% to 2100H in the External RA, —S=— HOV A, 25H HOV RO, #008 Nov DPTR, #20008 wovx eortR, A. INC OPTR, INC RO he Count COME RO, 400K, BACK jChecklf ROhos opon become OH notrepest Wovx eoerR, a $store at 21004 ERE: SUMP HERE 4 nd of program In the akove program, you must rememter that on Bites ik O will ge 2.255 count, Hence the extra step oftr the loops required anette tea umber stored nA of MOVE works only on | ROwillcontin the coust DPT contains the Dest oddress 1 Slore at EvtnaM location polntedby OFTR Fine oes averess —pranatsir@! Notes Prepared by Bharat Sir ‘Bharat Sir: 98204 08 ratsir@hotmall.com Riese Pe Allthe best © Pop Scanned by CamScannerBHARAT ACADEMY ni ry ane enn arse ne 5022 2540 8086 / 809 701 ggp Thane: Veshollar AB, |:022 2774 8086 / 885 S05 ane, ers e103, 1" For, allway Staton Jc using 8052. Assune evo 100 p80 7 Wa to gonecate «vgormenns Delay”’0f 30° © 2 27 __soteabal"ceynten vee ed Tor 12 Mi, then each machine eycte NOTE: rm 1051, 1 wo select ¢ cevacel of 12,MHE, SIRO CVCLSOr' econ tes iz = wal Re oe nese. thie 2 Bocaue i Tiiatee: emer } ‘the following instructions require machine cycle 95 oom t Mov Ri, In 9 1 Machine cycle . a 3 i egies ora i Dave wi, ade 3 2 Hachine eyele ‘ RET . 9 2 Hachine cycle > smu seis, 1301 tine ia ta oi i i ver 2 cine oye . wares Doe Ro, WADE "Eien Cyt x Countin B9ence SBE i wer > echine res ; o8 WAP to genorate a SOFTWARE delay of 10 msec using 8051. Assume i Here'we wlll ceeace an inner leop of 300 heey This will be inside | fnioster oop unten wilt repost 0 tinea. lence ve get's delay er | io 5°50 ="10,000°yeoe 19 meee. : Tsxpioxinate") 22 we ignove the celay caused due to the first an : Tast instructions of the loop. ¥ See 1 cetats tov mi, ren ees a OOFER: tov noy trad Hi Machine ee > wares Bote Ro Feprseiniet : : WATE 12 Machine Cyelesx (249) hence 4 } : er (240) hence 498 Ges 3 DyN2 RL, OUTER HA Mechnecrce va 3 rer 24 Machine Cyte PS bharotsir@hotmail Notes Prop Chopra Academy Be d-by Bharat sit indra — 022 2642 1997 Scanned by CamScannerMicroconrrouters & APPLICATIONS Sem V(©XTC, E72, and instrumentation) JAVA batches by Bharat ir starting Dee 202 79989 pene yar rR eset DELAY: Mov nz, gone Lop? count of 1 toon: ov au, teat ‘tome gay Toor: HOV RO, HHH #1 Mochne oye Nop Machine Gye ‘WAIT: DJNZ RO, wart 42 Machine Cycles x (249) hence 498 Cycles DONE RI, Looe {peterma00 reretors Danz R2, Looe {Reform so nertiors rer entopsierouine . —————— Bharat Sir: 98206082 srt —_— TWotes Prepared by Bharat Sir Bharatsir@hotmall.com Page Allthe best © Scanned by CamScannerQ10 Meee Se Sctay sane ——_— REE Reguency eg wil be wore, fghotber Apt: 3,1 Foor, Ralway Satio% wap to generate 2 delay of sehied Nag Sores Ne2e ‘complex, Nerul desired cout eornal tiner-0 of 8052. 20 prec using S*°5o ome Suitable Crystal aot though POrtS-2 fz > 3 usec Por an Up Thus c+ count = 70 Mode SOLN: MOV { Progrom TMOD + {0000 0003) Timer * ood tomer oye of Count hoy To. 10RFA Hedvoperotee Cot ag : Nov Peon, 4104 1 rogram TCON (000% 0000: : snes Shim teow ss art Wa for overow sere Poi [endo trough Pot3.1 ov reo%, #008 sop Pmero : mene: Samp HERE {end eforogom Q11 17 te gererate a square wave of 1 tis trom the TaD pin of 6051, Using Finerl. Assume Clock Frequency of 12 Miz, : Nome: Fo: a square vave of 1 iz, the delay required is .5 asec . tio know, each count will require 1/iMie > 1 uses. : Thus for $00 yeec, the Desired Count vill be $00, OLFAH. For an . t = Max Count - Desired count + 2 . Count + prep oira + + Count = Feoew sama CORES 4 Gear Ted Une inti . zH00, Program TOD s sera. tt RCN ne ; MoV THI, #0FEH toad i MOV TCON, 408 s prooregber byte of Count > cn I Program TCON +9 (0109 0000) . waate ONB COW, WALT Henan 2h Start Timers cpt P31 7 w » Nov TcON, 4008 Leet Bi ater te dey ‘SUMP REPEAT . ve aan + Repeat the process * Scanned by CamScanner