MC Unit-5 Notes PDF
MC Unit-5 Notes PDF
MC Unit-5 Notes PDF
,W 8os t
*
Deshu,
_'\J
.f-\*^grL
O
-
Srwr€fr t
D,r klb
<-- Tl-tt -j tr--'tU #
.Tl"\cf,> o I
C
hnnltli [1 fvro la*l "tt1] P^O
c- 1t =D T!uq1_
ctT :,L C.Oc-t-\rt*e.it
4
Ex", Fi*d -ar@ ae 'm^oD .ta oPe\oJt€ & n& Awe&
e
t\A -rrr-ao -4ottoc^:\^3 m"clo-s.
Ex
") 0ado t T\u,gr
q
I
v ",)
Mo&
N{o&\
ft top
2- tu,tQn
'l*i*,rolu
(aale
ooo
\+
noc6 mt
I 0ooo
<V+
- Tivacvl
1
o r
Gpxc\fitno
l\^odo*z
=
Tim4erLl
lO,)
't't) Ti'}fl({o
l.{r&2 -ilu,aen O, y\DAA-> ftrr,rOn- /
Tf'^DD Ll
\_-.1,-\-,
<L--
t--^/e
v
UL
Pstr".0
J4
{o!t9."ig
exXsto'!'PYegute-rtaieA'
-
tz'MHt
'
b) '''tJ'; 05'q2 'f4 Hg '- ' t
") t/,. o+ Cr6st<-[
IL\OtE: RoSt'T\iinelui''tr(c- &q , rregoxd
Trlro
' ?{e ei^s
b,
I '
":i,fl
I
I
it
rt
,
t.e
t6
:b) c-:ve-,,t KrlL = "t.l:,?I:: MH t" . ,, . ! ,,- i. , I
[.*.'
Ex: Hoc4) q\.g . -$,mqrr o 8A t $tg"j.ted ( StgPed 91 f*Stn^UlH,.[
24 :
.i
' %pl'.-.
tz* i-'9,t t3'". +r-.Sl tD &3 K. ":
.rcod
'TC0*l t\ I 1- D
&fuq oaQy
Couuyo.( bi+)
) )
'i-r -- qtr*,..1Ju euen#too ,+W S.etS <,cl,-o-^" 't'ir.rren tri4
oV ar-rFteLcg, , (i e) Courvtt yo[\r o\rerL &gro" FF FF. tD ooco. "J D.
Ass..
+ '-a
[] o\^qrL *o4q I pgrg Vg r,,n u.nt,e i _
.e
dc.
-- Lr>o.d -tua- 'rt rouva-{.,-^o V^q(stet [*&ic-rti 0 ot^ic].,r t.P t^-'€
tO
-tt"\^eJL is to toe- L^ged o-^^d u:L^ic,k t{rrrrgrr- r..,r.oc{a fa T rn Sec
SeLeue-d . *o cvec
- LoJ TL ( Ttst venisterl ' c*:o-rr,r t.^?t-iJ coc.r.L.r-t P2"Z
, vq-L.d-s
*)
.
\_
.^t
Scanned by CamScanner
Mov *lnDD,,Sot6. t
bo-ct< ,
Mo \)
r1iA^r,L o m.&'l
'ru; {foo h
E/
t
0\AO U
t oad, ?*i q o_o
1".
!r' .
rHl1 4*o"Ee h
Co._r_r.tT f1
Sers 'f Bo, - te, '
t' .\
"i'^^e-0-
I St ouL-t li,ntgrr
Aqaivn' qNp .TFo ,eqar* a
0 , 't^]ait (-ul"ipo
CLR
)
-id h,
= 1 1i.. TiY'r€rrov(
Teo :' &ro7 Ti"r*erz-
CPL ?L,3 6
CLR TCO
) -g i-oq4, :ri *g a. o ve&}l,,"- l{A
S4N{r 6+ue j xelocd -169 ti me-r 4
cPr_ .? Ls
cLR TFs
SS [^p bac6
a Pvel' uP
C1e-t"oYqte
*re4. ol aaMhtt ,
Fil,"- ust*,. s- \ \1^ fttu& f
4r:-" Ug,L T\P\LII
G^ - Pitnr &'3
\Oo KRA
r f.r
?ea XtA u = L2- l"'\ Ht "
;*, K-*f = toot<r+ai
-l9r p
>t tc{
t"t.,*r..-qn Q.\\( ,F[ea = Ir- =t 4C)v \bo KF+L SEuaru
rr<r cvq{tlc- k)o^rQ
: \'t33 /lHtE*
-F: too' - I( l\t.
.=i
v:
I ? l.4HU
\n : S zt'tr-q-L
: Q.t666+ A, I ctoLKS
c>'s\tw Ay
L
EJi gv t)
TH -jl_ bo.-C-\< 0'^ov tut , Ho e +h to*d iu\+iJ.ti cora.w*
.c -t" {id t\ou tHlrSOfrla.', " ira
gr,.'Sn fe?.
H'-nooo "n1 g1]alt* T\l\ u
.'s\,rqoJel ' s ET\g TRt ', I
ot
A?o.^\,\ : JNB TF \ ,oto^n
\,LL\,t--
-o
tv1 cLR 'T8l
rQ? cYL. P2.3
CL.R TF
'
STt,\P f,o*e \r
r or}9-
\sV
ct/
3r%rcr*'-
t E*^, Creore q Srytr-a-\e U(=*uQ of tnt6t, poTti6\,I
t
:/-. bacv I tr
I ots Ale( + [ou: govt\orn tDts ,us(. ^.i';:\rwro- .n.
Cv6stoQ XTAU: ll.O5q2 i4Hg' U}< 't-rr,.rerr t Vro& t ' S
,. J
%on^
;,o!r'
4- C
C
-Gsili*rogsrrs
c(
Pu\gq uctcl+tn s to g_E l.tSqc,
sf
Lolrr pe\rt\crA ( \p.). l08-s /-rlzt-
+ti6tn povr\orn
C \*y. loKsl.{sac. 3' $qvrt\o
De-sived t\rne &(oX = IOBS .(rSec. 3 ,tnrSec +
() XrAu: . -,\
\\,DSq2- MRe ?ork o
J
T\tqer e-\K (-'{eg, ( e) -- -5.
(e * Lt'::..,
,r= tc"9u6MAQ
T\'rrngr c\k gesioJ c.,\ * t *
Lev) /-o-Lo-u
t t'' ? =ZGrt6 : l"o8s-ak( r
I
Ve$\'+\q+ier,"
Fc 16
Fc tg
t-C -\
'--.,, \
l rrrcr ..^
\alu < !.. .-
lo ts /,rs
f"\ou TMoD r jH toh ', t rvno&
Tirvq:r- t
DftiGA{
bacvl Mou TLt, Stgh I (oqd iuitioJ co\^M i,r
[ti^!_ . two u TN\ , *.oech rs?
:
_l--t
frrs
- e
CPL P('tt
CLR TFI
t.
' Cteo.r rinterr r ove#lo.^:. {taA
g5M? 6o-cr
$e-uo-to*e
a. S?uolo usose .-,rit!. s,Nt $x^t of,
-}'
3 rnSec + o.\^ of4 t\uwq o( totnEet olr o-Ll p?t^r 4
?o{t- o . -AsSt'^*o ob XTAL -= gz l'4Ftt
S.
_9 *g
-ASs."rni cx$SrJ r M Ht t"-rt'?te,
,frW
9r6ut to
a.
'2 ev\ p?.rr eg'9 .
gu^lirq*a + p^Lr" tvd* c4 2- R-c-
14Dd
" _-
tLg,L fiuaruf fnedO t '
w -i') .( = nt,Tn: :
( r---
tt (, 33 r.^H+
f+ ts
vM
r.z\,^j)
q-H f L, \otts
Det"U s ( frFE +t -oec6) v D-(YFqfl
i-
La\8zj,.f t?r^o- .&t U = 3!-g vq&r .' (,fr,n, fwi+J
Csqur eqo g^
0Tu9arc-ul^r.lugr
t' {t'' '-
--
o\€t4lau:
S,sr';
L*'7*
t.rha^r-^-
_
"Y
t tr-soc
CP
-1iF :- \, I
CLB
L,) ctes.rL +uq .rtr #n, s
C'\) W ,-e^. .fo I
_s.teg
t tiul
- -So.v.1q Mwea_r_ t i
**uovnle^d |
$.1, -.{ss
)ek*a.
5o!:, -A*s.^"rS*g XTA I: tt' D-fqz- i4t-(L, u .fiuen_ o 146/4-_r_ ,,
^a
'l-t$.\Q_f\ eu( #va7 . :P"s." tr.o19 xro6
t!- :-c o"t>lG tl+t4.
qi^ a-tt c\k ?e_Nio., (r) . t'oEs / !ec,
f
- t*,'#-) o.,\uql .tx pe,.^e/ *
o
J-ostued t\c.\o &o-rav -= (sr
[^oa\, \j,
fo(l Cc)Lr\tl
oLet4b.r, Ccrutg o UG\
Ao.tt S€{, - r
*tns (\ zSSt( * i.^iti-/ \X t.og f
9tq ( ueqw"-)
x rLG
.,
D S L.ttex*- &u,-^D.
?^J-ic-.ai""y ''' !v.i+\",i Qo-lvq te qrp toa-d*-d t.^-*o TH f€fl t
,
9<-t4-{t J*.a.q
-TH s DBh,
1'9ef.,ct-S
*-=*Y3bDt'ots/i
te=D TF=6 .TE;o
^ I
'otsJ,!-l
Lti}---r@
.
j- t cofiP eo }-eurafa',l'
^do- :D,, -,-\Ss ".l^l.\Vg -{-r.^s.t c-\IB-$a-l-= Ll-f Ht^
O. <+votrt- .,^>oue c{- }req"'to^-n 'tRe(t-
+qiE u_ 9^ fiu t,z W9€ .t\il^{-tL D r.v>&'
Mo& z- '
u.g,<_r. tJ-t{ KtAu: Lzl.\t\L t?l,r-l-sr- o
o' 9 ua. (.cc , &]-n fr \^or- po(3 i g ta usov{^ f^^f $e{ ,*"0
",
LI.UL cot,._rr.*eA_ @\
: o,S vw$r.
-o'S
S'trt s 3's-? A' q c'ss.-r*{
t-^.ov TMop
o:- I
Saqr:
tKD
R,x-p,, .
.-. r I
Scanned by CamScanner
Scanned by CamScanner
.*L gcoN
Snt / sutt
l^ot_ u&d
jtt kosr
lv\de
O ., Bo!.d Ra&e s 4rs.
St"V+ Yq , rraoae
It-
al
a, I | 9-bh uAF.r rro&" , R,Rs vq^i..ato
{ l-(.d-a-,,+rar^^{. (<sa_taltag
(cr-rtl# t stoJrf, / g d-ar* bi+3, t swol,
ol b D 2- g*b\t uART i^odL, B,p.Qs_. Cql&ss
Soto +vou"{ Ce".rt*i',-l , isr*g.,3- -
-'-}
I
-Wf@-rliffT-:
i
Rosr krUR, Cogr\r,1u1, u$ Br Jivid-qJ
I
r+ /c
3> Left*e (s L^kC Lg
ir_ ftnrott / -tO
t_
l.* -h" BK .
t
t--
?roflr,gutlui*t }o-. g.sr P {'rs$R S" M
Seda.\\U:^ M
==-
5 L5>-d .+\^q TN\oD tf.en-1'S1qr. ur":?ru vo{r"a- "^ [ to I'I
SE
LJ.Se- qtd.NtX-r t,n ttto& u *e Set 1t^a Bsr^& t1-*:fe"
FIqx* : cL
itqd Bq-u-d \{t?r4 q--
\ L.,*d 'rHl +u= S*5 11A c0 oI
3e: Ju
S.ri.-l $.,todo-1 , \-,.:\^aa!- o-^,r E.-h:rt &o*q ?s fiau'-/
er>-tfl^ Stc.Y\ 4 Bto7 L.9.|3
\, S.; TR\ "to ', ' 'to Sto.ruiltt Nran I ' Er,.
,---.----=noa*
5 c\e-o.n TS- .r?t ^ c LR tI- fws+YwLFi srx .
0
I t,^{\\te o\ dJrg[yo-c1err tc lae- Eejr\t t\ *'{} lua- S RUF
b e,\n-qcrd -t!\0* TtL +t^t tott "^:^s-tt^ J-\tts Tt. L^g:?' g'
-
1L€(-./
St
S'!^'' ASsur^"\5 qr.dt.t-"\0 :- \rlc>s?D- 4{flt '/
1 3z'- m_ C
i
94* rg K wr€ fir:e-Lt n*o& r- " l
t' KR 5 ?6ao
Ac
l"
.lr2 .f-^d vaJ)^a- .t-o he to*&d €.^+o TH t t-D
Ar
o,s
9* BR : g6oo i
Stta4,
2- n DSC. ka+- T\k"r^$fo. I
W) 6 Roft- = Gacx
I
CLR €A
gatk- l SNID pa,Bact<
ATy A. SBuF
,€ I\,\DU @ ,.4
Mq, 6oh, A
o'4 toq NDp ag heve I SSf4 he'C
it Clnata+-
The initial test is to ensure both the crystal and the RESET circuit are working
CRYSTAL test:
8051 has an on chip oscillator for supplying clk signals to internal circuits of 8051 . It needs
external crystal to operate. external crystal decides the operating frequency of the 8051.
ALE signal will be high two times during one machine cycle.
To test crystal, ALE pulse is checked with an oscilloscope to verify that the ALE frequency is 1/6 of the
crystal frequency.
If ALE signal is high two times during one machine cycle means crystal test PASS otherwise crystal test
FAIL.
To test the RESET ckt simply press reset switch and check whether all the ports are in input state (HIGH)
or not. If ports are in i/p state means test pass else test fail.
ROM TEST:
During ROM test by running one program we will check whether all pins are properly soldered or not.
In the above program we are verifying that each address line of the ROM is properly wired by using a
series of repeated JUMP instructions that exercise all of the address lines. In the above program observe
the jump addresses (only one address line is high at a time)(0001h=0000 0000 0000 0001,
0010h=0000 0000 0001 0000)
Suppose if any two pins are shorted means both will receive 00 or 11 as input. So above program jump
address will change and program control will jump to some other wrong location and above program
execution will be disturbed.
If above program is executed successfully then ROM test PASS else FAIL.
RAM TEST:
, ,NTR oF the
' Pins ET, G ADC
OP ADC
ADC starts conversion when it detects +ve edge on WR bar pin. (make wr bar=0 and immediately make
WR bar=1)
DAC r^n kex4acinS
DAc o8!8
To cRo
-\9V
t{oe 3o ll
[. lv,lserFec;r3 D Ac ogoe {E
-rhe DNc o?og \s o- si*g\g rrnovrolr bh;c B-bi t- DIA
Coove{tet^'
+
d;scxete vsltage
+ 3-\nfub Dftc o$oB p-eovides "56
pv cu-x.sevrL) leve\< oF out'qub '
J- t|'e ; s a6tl"'r€c*-d to
1r-, the atove 4t3 Pork oP tt \
rrhe i/r d-ta \r.nes Coo- D+) o F DAc osog
eithet(
rhe olf to.tr.vr {rso:-n DFc c^-n be- olose*svC
afr A Jlglt*l ,>,:ulti..n epe Y @ 6:11 & cPo
ck-t (^)e c.^'/Y' &i'ppgYp/1.!l'-
ugi*8 the aborle feYterate
u^ul{cru-s
Pxogxawr -f-ox qey,€-6cH'rnq o. Sautoo Fh t^nvefo*e.^
Mov ft, * oo
Bacr'. l.^ov pl,, A
lNc R iFF+l :o o
SfMP [acK
i?
uax e g"te
To genersaEe S? uo\-6€ unv€ 'fi:ss ts
tt.r e"n oo o:n Post a
"t BOSI
8ac'r', Hov Pl ,4foffh ) o)f val e orr ,.r
A cAt-L uelaS
Mov P1 , oo'
A ch LL >ela3
sTM P Bo.cs
oe\o.y I MoV Ro, *oPtrh
uJ o.i L : DTNZ RG, t'rui L
6La-ix co.sg uro.ve forsro n
rc:r 5 SbepS
5 skrPs
ry 2
:5r sor the iln cxQ-rQf t a€ each 6{ef
-
Cw)esE--
F cRLL uel aY
CTNE ft, * oo, RPTU
STM P Nox t
Delog a
MoV Rnr* t5
B o-Cr< Mov RI, # oFFh
tpai t DTrrrz Rl, uuclL
DTNZ Ro, Ba-ctc
?€a
5in€ l,l:o,Ve
+5v
\ !
.v -9 ,
3o io"
v a\uee seoE- _ \qr 255
to PAc
-5V
To 3 e*enute 5iroeuuqv€ rpe houve to *lp Jigit*f ft,u"rrater'ts
Valu g s oh;c-h l\ xefnesevr L S\\ne uoav€ A.s Shod:1 ahow€ '
"r
Pr ?"P 3:T3;
Trrte.s';uu.Pb
B0 5l
Do V..
.Dt
D2-
D3 \ee
e.s Rls EN
LcD to
;! t antex{ac\nJ
LtP__!I:_{e: c-ngrign to pSr haS ll+ Pirg
LC D Co^nxreckeJ
zy 16 LcD
/
lf ow S
\,Colu"vtlrE
Vs s Gxouvr J
$". -+5V Porlrex SuPPIY
vnn porire'r S uf Ply +" corrbco\ c ovrtxu'SF
RS Reg se\ect, selecr .^;In -::
i:;:
*l ,r
R/W=o -td-6tox'ib€ ,RIi.:l {i,-6 xer-d
EN e x ahle
Do -D= rl",e I -bi L &o\il bu s
LcD iov",^r*a.d coJe s +o.ble
code Cor.nxartd tD
(u ex; Lc D am str u ctiorr Feg i s tez
I
clea* drspl^U scyeey!
9
Reh"x".t hor^,.(
+ bCcfavn€9t CLL1rSoy f shlft cuYSoY to lett)
6 lYr Cxevn e"n L ,l r, :righk-
c sh;Ft- d;splaJ rrigh b
+ fr
le# I
I D)'s lau
P oFF ) CUYSdir oFF
A lt
AFF /t'ON
C I, dN J ,, oFF
tr
ON
'r b llrEilg
tr rl
ofrt I t' blintsin5
lo
sAtpt C uz 36v Posrbiorr to let f
t+ .n;g h e
tt
ls shiPr evrbz^e disp)qU tu Lhe lelt
lc Ir rrfght_
2o Fo:r ce 4 U- TS 6z- begrllrnr1J ot
tn .1"F I,14
CO tt
d"J Ilte
38 L \ ioes a,n d 5x+ zna-Ltix
@
pro 3xavn to disPla3 ,yne$SaSe N O oln Lca oL Iixe l, poS. +
Vo
RS 8TT P9.o co
Rt^l ts}T Pz.t
BIT P g.L
EN
i
DTNrz Ro r t^ioi b
RET
?t" a.
P1.
?1"
i-l , I'
.ll"
P
Pl.
Pr.
Pl.r
_T
Pl'o &
c9
us in3 p6rrt 1- .
o?\ oN
&zO oPF
P-cogra.". to .l i sp\ o! ' dg c-i-- a'[ Vr,.l ,,,eS O -5 cortrrnurs I g o:y\
oir o ol r1 3F
.l-l
l- t
Oo tl o6
I
o-, Ol 58
c-_l
l- ol
-.
?-l 6l 0o tt +F
J
_t
(.' l-l I 6€.
o t
'l -
rj o I tl 6D
a5lrrj it
P\, A
o, o/p dor* to P J- '0t- &igP\
f4oV
ca ll d e lc-g 6ttb'ro
tl t\ rne
)
ftcRUu De'la 3
E (-.ala Po i<t k ^/
) ?.rr cae?re7r
]/uc D?T7 zo
\ ooP u"nH\ c otr'nteY
DTruz O,l Bo.cK )
ves\
gTMP sbo'Yk ) Ji gPlry ct'aFa covr bna
^-l
oelo3 Mov R?, o't-rn
DTtrZ RIr, ura'iL
u:alt
RET
rr 8051 Microprocessors and Microcontrollers 17 -107 Microcontroller 8051
17.14 Applications
5V
'19 P17 -7-
8
VC
XTALl P16 -E-
18
XTAL2
P1s -3- Return
P14 -V- Lines
P13
P12
T-
-z- I
-T-----t I
o @J@l@
tl I I .,,
P11
P10
P27
_
P26
P25
o---4 Q,)
-4
@
--4
o-4
P24
P 1.1 2 2 2
l4
P23 -N-
P22 @ @ @4 @
--4 --4
8051 P21
P20 -a1 - i
P 1.2 --d
P t 2 2
E-A/cC P07
o---d @
--4
o-4 @-4
P06 P 1.3 2 P 2 P
P05
RXD P04
TXD P03
P02
P01
P00 P1.7 P1.6 P1.5 P1
13
INTT FSH 29 I s.un Lines I
12 30
INM ALE
15 16
G T1 wR'
TO RD
limp agal
go1: mov 11, # Olh initialise counter 1
mov r0, #Oefh store word for column selection
mov r3, #04h initialise column counter
aga3: mov P1, r0 select onIY 1 column
mov a, P1 get the status of retum lines
jnb acc.0,disPlaY check bit 0 and if it is 0 jump to display
inc dPtr increment lookuP-table Pointer
jnb acc.l,disPlaY check bit 1 and if it is 1 jump to display
inc dPtr increment lookuP-table Pointer
jnb acc.2,disPlaY check bit 2 and if it is 2 iump to display
..,rin*mfi
NOTE:
Count EQU 13 (the EQU directive is used to assign a value to a variable. In this example When ever
assembler finds the name count it replaces it by 13)