EXPT NO: 1 DATE: 8.7.13
ARCHITECTURE OF 8051 MICROCONTROLLER
Aim: To stu! "#out t$% "&'$it%'tu&% "&'$it%'tu&% o( 8051 mi'&o'o)t&o**%&. mi'&o'o)t&o**%&. I)t&ou'tio): T$% 8051 Mi'&o'o)t&o**%& +"s %si,)% i) 1-80s #! I)t%*. Its (ou)"tio) +"s o) H"&/"& A&'$it%'tu&% ") +"s %/%*o% &i)'i"**! (o& #&i),i), i)to *"! i) Em#%% !st%ms. At (i&st it +"s '&%"t% #! m%")s o( NMO t%'$)o*o,! #ut "s NMO t%'$)o*o,! )%%s mo&% o+%& to (u)'tio) t$%&%(o&% I)t%* &%2i)t%)% Mi'&o'o)t&o**%& 8051 %m*o!i), CMO t%'$)o*o,! ") " )%+ %itio) '"m% i)to %ist%)'% +it$ " *%tt%& 4C i) t$% tit*% )"m% (o& i**ust&"tio): 80C51.
T$%&% "&% t+o #us%s i) 8051 Mi'&o'o)t&o**%& o)% (o& &o,&"m ") ot$%& (o& "t". As " &%su*t it $"s t+o sto&",% &ooms (o& #ot$ &o,&"m ") "t" o( 6 #! 8 si9%. T$% mi'&o'o)t&o**%& 'om&is% o( 8 #it "''umu*"to& 8 #it &o'%ssi), u)it. It "*so 'o)sists o( 8 #it ; &%,ist%& "s m"
F%"tu&%s o( 8051 mi'&o'o)t&o**%&: mi'&o'o)t&o**%&:
T$% (%"tu&%s o( 8051 mi'&o'o)t&o**%& mi'&o'o)t&o**%& "&%:2 •
It is 8 #it Mi'&o Co)t&o**%&
•
It $"s o) '$i os'i**"to& ") '*o'= ,%)%&"to& 'i&'uit +it$ o%&"ti), (&%>u%)'! 1?MH9.
•
It $"s o) '$i # ROM +$i'$ '") #% %")% u to 6 =#
•
It $"s 1?8 #!t%s o( o) '$i RAM
•
It $"s &%,ist%& #")=s: #")= 0 #")= 1 #")= ? ") #")= 3. E"'$ &%,ist%& #")= 'o)sists o( 8 &%,ist%&.
•
16 m%mo&! *o'"tio) o( "t" m%mo&! "&% #it@#!t% "&%ss"#*%
•
T$% "t" m%mo&! '") #% %")% uto 6=# 1
•
It $"s "&"**%* I@O o&t: o&t0 o&t1 o&t? o&t3. E"'$ o&t is 82#it i&%'tio)"* I@O o&t. E"'$ o&t is #it@#!t% "&%ss"#*%.
•
It $"s t+o 16 #it mu*ti2mo% &o,&"mm"#*% tim%&@'ou)t%& tim%&@'ou)t%&
•
It $"s mu*ti2mo% $i,$ s%% &o,&"mm"#*% (u** u*% s%&i"* o&t.
•
It $"s 5 $"&+"&% i)t%&&ut: 3 i)t%&)"* i)t%&&ut ") ? %t%&)"* i)t%&&ut. A** 5 i)t%&&ut "&% o%&"t% i) t+o &io&it! *%/%*
•
It $"s o) '$i o+%& s"/i), 'i&'uit o%&"t% o%&"t% i) t+o mo%s: 1. i*% mo% ?. Po+%& o+) mo%.
•
It $"s 11 s%'i"* (u)'tio) &%,ist%&.
•
It $"s 111 i)st&u'tio)s 6 i)st&u'tio)s "&% si),*% '!'*%.
•
It $"s o) '$i ;oo*%") &o'%sso& (o& si),*% #it m")iu*"tio).
;*o'= Di",&"m o( 8051 Mi'&o'o)t&o**%&: Mi'&o'o)t&o**%&: T$% #o'= i",&"m o( 8051 mi'&o'o)t&o**%& is %*"i)% #%*o+: CPU (Central Processor Unit): T$% C%)t&"* P&o'%sso& U)it o& CPU is t$% mi) o( ")! &o'%ssi), m"'$i)%. It s'&uti)i9%s ") m")",%s "** &o'%ss%s t$"t "&% '"&&i% out i) t$% Mi'&o'o)t&o**%&. Us%& $"s )o o+%& o/%& t$% (u)'tio)i), o( CPU. It i)t%&&%ts &o,&"m &i)t% i) sto&",% s"'% ROMB ") '"&&i%s out "** o( t$%m ") o t$% &o<%'t% ut!.
Interrupts: I)t%&&ut is " su#2&outi)% '"** t$"t &%"s t$% Mi'&o'o)t&o**%&s Mi'&o'o)t&o**%&s =%! (u)'tio) o&
T$% Mi'&o2'o)t&o**%& 8051 '") #% "ss%m#*% i) su'$ " m"))%& t$"t it mom%)t"&i*! stos o& #&%"= t$% 'o&% &o,&"m "t t$% $"%)i), o( i)t%&&ut. $%) su#2&outi)% t"s= is (i)is$% t$%) t$% im*%m%)t"tio) o( 'o&% &o,&"m 3
i)iti"t%s "utom"ti'"**! "s usu"*. T$%&% "&% 5 i)t%&&ut su*i%s i) 8051 Mi'&o'o)t&o**%& t+o out o( (i/% "&% %&i$%&"* i)t%&&uts t+o "&% tim%& i)t%&&uts ") o)% is s%&i"* o&t i)t%&&ut.
Memory:
Mi'&o2'o)t&o**%& )%%s " &o,&"m +$i'$ is " s%t o( 'omm")s. T$is &o,&"m %)*i,$t%)s Mi'&o'o)t&o**%& to %&(o&m &%'is% t"s=s. T$%s% &o,&"ms )%% " sto&",% s"'% o) +$i'$ t$%! '") #% "''umu*"t% ") i)t%&&%t #! Mi'&o'o)t&o**%& to "'t uo) ")! s%'i(i' &o'%ss. T$% m%mo&! +$i'$ is #&ou,$t i)to *"! to "''umu*"t% t$% &o,&"m o( Mi'&o'o)t&o**%& is &%'o,)i9% "s P&o,&"m m%mo&! o& 'o% m%mo&!. I) 'ommo) *"),u",% its "*so =)o+) "s R%" O)*! M%mo&! o& ROM.
Mi'&o2'o)t&o**%& Mi'&o2'o) t&o**%& "*so )%%s " m%mo&! to "m"ss "t" o& o%&")s (o& t$% s$o&t t%&m. T$% sto&",% s"'% +$i'$ is %m*o!% to mom%)t"&i*! "t" sto&",% (o& (u)'tio)i), is "'=)o+*%,% "s D"t" M%mo&! ") +% %m*o! R")om A''%ss M%mo&! o& RAM (o& t$is &i)'i*% &%"so). Mi'&o'o)t&o**%& 8051 'o)t"i)s 'o% m%mo&! o& &o,&"m m%mo&! so t$"t it $"s ; Rom ") it "*so 'om&is% o( "t" m%mo&! RAMB o( 1?8 #!t%s.
Bus: Fu)"m%)t"**! ;us is " ,&ou o( +i&%s +$i'$ (u)'tio)s "s " 'ommu)i'"tio) '")"* o& m%") (o& t$% t&")s(%& D"t". T$%s% #us%s 'om&is% o( 8 16 o& mo&% '"#*%s. As " &%su*t " #us '") #%"& 8 #its 16 #its "** to,%t$%&. T$%&% "&% t+o t!%s o( #us%s:
1. Address Bus: Bus: Mi'&o'o)t&o**%& 8051 'o)sists o( 16 #it "&%ss #us. It is #&ou,$t i)to *"! to "&%ss m%mo&! ositio)s. It is "*so uti*i9% to t&")smit t$% "&%ss (&om C%)t&"* P&o'%ssi), U)it to M%mo&!.
2. Data Bus: Mi'&o'o Mi'&o'o)t&o**%& )t&o**%& 8051 'om&is% o( 8 #its "t" #us. It is %m*o!% to '"&t "t". 5
Oscillator: Mi'&o'o)t&o**%& 8051 'o)sists o( ") o)2'$i os'i**"to& +$i'$ toi*s "s " tim% sou&'% (o& CPU C%)t&"* P&o'%ssi), U)itB. As t$% &ou'ti/it! t$ums o( os'i**"to& "&% st%"! "s " &%su*t it ("'i*it"t%s $"&mo)i9% %m*o!m%)t o( "** i%'%s o( 8051 Mi'&o'o)t&o**%&. Inputoutput Port: Mi'&o2'o)t&o**%& 8051 'o)sists o( i)ut@outut o&ts to u)it% it to ot$%& %&i$%&"*s. !imersCounters: Mi'&o2'o)t&o**%& 8051 is i)'o&o&"t% +it$ t+o 16 #it 'ou)t%&s tim%&s. T$% 'ou)t%&s "&% s%"&"t% i)to 8 #it &%,ist%&s. T$% tim%&s "&% uti*i9% (o& m%"su&i), t$% i)t%&/"*s to (i) out u*s% +it$ %t'. "pecial #unction $e%isters ("#$s) %'i"* Fu)'tio) R%,ist%&s FRsB "&% " so&t o( 'o)t&o* t"#*% us% (o& &u))i), ") mo)ito&i), t$% o%&"tio) o( t$% mi'&o'o)t&o**%&. E"'$ o( t$%s% &%,ist%&s "s +%** "s %"'$ #it t$%! i)'*u% $"s its )"m% "&%ss i) t$% s'o% o( RAM ") &%'is%*! %(i)% u&os% su'$ "s tim%& 'o)t&o* i)t%&&ut 'o)t&o* s%&i"* 'ommu)i'"tio) 'o)t&o* %t'. E/%) t$ou,$ t$%&% "&% 1?8 m%mo&! *o'"tio)s i)t%)% to #% o''ui% #! t$%m t$% #"si' 'o&% s$"&% #! "** t!%s o( 8051 mi'&o'o)t&o**%&s $"s o)*! ?1 su'$ &%,ist%&s. R%st o( *o'"tio)s "&% i)t%)tio)"**! *%(t u)o''ui% i) o&%& to %)"#*% t$% m")u("'tu&%&s to (u&t$%& %/%*o mi'&o'o)t&o**%&s mi'&o'o)t&o**%&s =%%i), t$%m 'om"ti#*% +it$ t$% &%/ious /%&sio)s. A $e%ist $e %ister er (Accum (A ccumulat ulator) or) A &%,ist%& is " ,%)%&"*2u&os% ,%)%&"*2u&os% &%,ist%& us% (o& sto&i), i)t%&m%i"t% &%su*ts o#t"i)% u&i), o%&"tio). P&io& to %%'uti), ") i)st&u'tio) uo) ")! )um#%& o& o%&") it is )%'%ss"&! to sto&% it i) t$% "''umu*"to& (i&st. A** &%su*ts o#t"i)% (&om "&it$m%ti'"* o%&"tio)s %&(o&m% #! t$% ALU "&% sto&% i) t$% "''umu*"to&. D"t" to #% mo/% (&om o)% &%,ist%& to ")ot$%& must ,o t$&ou,$ t$% "''umu*"to&. I) ot$%& +o&s t$% A &%,ist%& is t$% most 7
'ommo)*! us% &%,ist%& ") it is imossi#*% to im",i)% " mi'&o'o)t&o**%& +it$out it. Mo&% t$") $"*( i)st&u'tio)s us% #! t$% 8051 mi'&o'o)t&o**%& us% som%$o+ t$% "''umu*"to&. B $e%ister Mu*ti*i'"tio) ") i/isio) '") #% %&(o&m% o)*! uo) )um#%&s sto&% i) t$% A ") ; &%,ist%&s. A** ot$%& i)st&u'tio)s i) t$% &o,&"m '") us% t$is &%,ist%& "s " s"&% "''umu*"to& AB. $ $e%isters ($&'$) T$is is " 'ommo) )"m% (o& 8 ,%)%&"*2u&os% &%,ist%&s R0 R1 R? ...R7B. E/%) t$ou,$ t$%! "&% )ot t&u% FRs t$%! %s%&/% to #% is'uss% $%&% #%'"us% o( t$%i& u&os%. T$%! o''u! #")=s +it$i) RAM. imi*"& to t$% "''umu*"to& t$%! "&% us% (o& t%mo&"&! sto&i), /"&i"#*%s ") i)t%&m%i"t% &%su*ts u&i), o%&"tio). $i'$ o)% o( t$%s% #")=s is to #% "'ti/% %%)s o) t+o #its o( t$% P R%,ist%&. A'ti/% #")= is " #")= t$% &%,ist%&s o( +$i'$ "&% 'u&&%)t*! us%. Pro%ram "tatus ord (P") $e%ister P &%,ist%& is o)% o( t$% most imo&t")t FRs. It 'o)t"i)s s%/%&"* st"tus #its t$"t &%(*%'t t$% 'u&&%)t st"t% o( t$% CPU. ;%si%s t$is &%,ist%& 'o)t"i)s C"&&! #it Aui*i"&! C"&&! t+o &%,ist%& #")= s%*%'t #its O/%&(*o+ (*", "&it! #it ") us%&2%(i)"#*% st"tus (*",. P ' Parity *it. *it. I( " )um#%& sto&% i) t$% "''umu*"to& is %/%) t$%) t$is #it +i** #% "utom"ti'"**! s%t 1B ot$%&+is% it +i** #% '*%"&% 0B. It is m"i)*! us% u&i), "t" t&")smit ") &%'%i/% /i" s%&i"* 'ommu)i'"tio). - Bit 1. This bit is intended to be used in the future versions of microcontrollers. OV Overflow occurs when the result of an arithmetical operation is larger than 255 and cannot be stored in one register. Overflow condition causes the OV bit to be set (1. Otherwise! it will be cleared (". -
#$"! #$1 - #egister ban% select bits. These two bits are used to select one of four register ban%s of #&'. #&'. B setting and clearing these bits! registers #"-#) #"-#) are stored in one of four ban%s of #&'. *" - *lag ". This is a general-purpose bit available for use. &+ - &u,iliar &u,iliar +arr *lag is is used for B+ operations operations onl. onl. + - +arr *lag is the (ninth au,iliar bit used for all arithmetical operations and shift instructions. Data Pointer $e%ister (DP!$) DPTR &%,ist%& is )ot " t&u% o)% #%'"us% it o%s)t $!si'"**! %ist. It 'o)sists o( t+o s%"&"t% &%,ist%&s: DPH D"t" Poi)t%& Hi,$B ") D"t" Poi)t%& Lo+B. Fo& t$is &%"so) it m"! #% t&%"t% "s " 162#it &%,ist%& o& "s t+o i)%%)%)t 82 #it &%,ist%&s. T$%i& 16 #its "&% &im"&i*! us% (o& %t%&)"* m%mo&! "&%ssi),. ;%si%s t$% DPTR R%,ist%& is usu"**! us% (o& sto&i), "t" ") i)t%&m%i"t% &%su*ts. "tac+ Pointer ("P) $e%ister A /"*u% sto&% i) t$% t"'= Poi)t%& oi)ts to t$% (i&st (&%% st"'= "&%ss ") %&mits st"'= "/"i*"#i*it!. t"'= us$%s i)'&%m%)t t$% /"*u% i) t$% t"'= Poi)t%& #! 1. Li=%+is% st"'= os %'&%m%)t its /"*u% #! 1. Uo) ")! &%s%t ") o+%&2o) t$% /"*u% 7 is sto&% i) t$% t"'= Poi)t%& +$i'$ m%")s t$"t t$% s"'% o( RAM &%s%&/% (o& t$% st"'= st"&ts "t t$is *o'"tio). I( ")ot$%& /"*u% is +&itt%) to t$is &%,ist%& t$% %)ti&% t"'= is mo/% to t$% )%+ m%mo&! *o'"tio). P&, P1, P2, P- ' Inputoutput $e%isters I( )%it$%& %t%&)"* m%mo&! )o& s%&i"* 'ommu)i'"tio) s!st%m "&% us% t$%) o&ts +it$i) tot"* o( 3? i)ut@outut i)s "&% "/"i*"#*% (o& 'o))%'tio) to %&i$%&"* %)/i&o)m%)t. E"'$ #it +it$i) t$%s% o&ts "((%'ts t$% st"t% ") %&(o&m")'% o( "&o&i"t% i) o( t$% mi'&o'o)t&o**%&. T$us #it *o,i' st"t% is &%(*%'t% o) "&o&i"t% i) "s " /o*t",% 0 o& 5 B ") /i'% /%&s" /o*t",% o) " i) &%(*%'ts t$% st"t% o( "&o&i"t% o&t #it. 11
E*")"tio) o) 8051 Pi) Di",&"m: T$% 8051 i) i",&"m is %*"i)% #%*o+: Pins 1 /:' &%'o,)i9% /:' &%'o,)i9% "s Po&t 1. Po&t 1 is " om%sti'"**! u**% u >u"si #i i&%'tio)"* I)ut@outut o&t.
Pin 0:' As m"% '*%"& &%/ious*! REET i) is uti*i9% to s%t t$% mi'&o2 'o)t&o**%& 8051 to its &im"&! /"*u%s +$%&%"s t$% mi'&o2'o)t&o**%& is (u)'tio)i), o& "t t$% %"&*! #%,i))i), o( "*i'"tio). T$% REET i) $"s to #% s%t %*%/"t% (o& t+o m"'$i)% &ot"tio)s.
Pins 1& 1:' &%'o,)i9% 1:' &%'o,)i9% "s Po&t 3. T$is o&t "*so su*i%s " )um#%& o( ot$%& (u)'tio)s su'$ "s tim%& i)ut i)t%&&uts s%&i"* 'ommu)i'"tio) i)i'"to&s TDRD 'o)t&o* i)i'"to&s (o& outsi% m%mo&! i)t%&("'i), R RD %t'. T$is is " om%sti' u** u o&t +it$ >u"si #i i&%'tio)"* o&t +it$i).
Pins 1/ and 10:' T$%s% "&% %m*o!% (o& i)t%&("'i), ") out%& '&!st"* to ,i/% s!st%m '*o'=.
Pin 2&:' Tit*% 2&:' Tit*% "s ss it s!m#o*i9%s ,&ou) 0 B "sso'i"tio). Pins' 21'2/:' 21'2/:' &%'o,)i9% "s Po&t ? P ?.0 P ?.7B ot$%& t$") s%&/i), "s I)ut@outut o&t s%)io& o&%& "&%ss #us i)i'"to&s "&% mu*ti*%% +it$ t$is >u"si #i i&%'tio)"* o&t.
Pin' 20:' P&o,&"m 20:' P&o,&"m to&% E)"#*% o& PEN is %m*o!% to i)t%&&%t si,) (&om out%& &o,&"m m%mo&!.
Pin'-&:' Et%&)"* Pin'-&:' Et%&)"* A''%ss o& EA i)ut is %m*o!% to %&mit o& &o$i#it out%& m%mo&! i)t%&("'i),. I( t$%&% is )o out%& m%mo&! )%% t$is i) is &",,% $i,$ #! *i)=i), it to ''.
13
Pin'-1:' A&%ss L"t'$ E)"#*% o& ALE is #&ou,$t i)to *"! to %2mu*ti*% Pin'-1:' t$% "&%ss "t" i)i'"tio) o( o&t 0 (o& out%& m%mo&! i)t%&("'i),B.
Pins -2'-0: &%'o,)i9% "s Po&t 0 P0.0 to P0.7B ot$%& t$") s%&/i), "s I)ut@outut o&t *o+ o&%& "t" "&%ss #us si,)"*s "&% mu*ti*%% +it$ t$is o&t to &o/i% t$% us% o( out%& m%mo&! i)t%&("'i),B. T$is i) is " #i i&%'tio)"* I)ut@outut o&t t$% si),*% o)% i) mi'&o'o)t&o**%& 8051B ") out%& u** u &%sisto&s "&% )%'%ss"&! to uti*i9% t$is o&t "s I)ut@outut.
Pin'&: t%&m% Pin'&: t%&m% "s '' is t$% '$i%( o+%& su*!. ;! ") *"&,% it is G5 DC. Cou)t%&s ") Tim%&s: !MOD $e%ister (!imer Mode) T$% TMOD &%,ist%& s%*%'ts t$% o%&"tio)"* mo% o( t$% tim%&s T0 ") T1. As s%%) i) (i,u&% t$% *o+ #its #it0 2 #it3B &%(%& to t$% tim%& 0 +$i*% t$% $i,$ #its #it 2 #it7B &%(%& to t$% tim%& 1. T$%&% "&% o%&"tio)"* mo%s ") %"'$ o( t$%m is %s'&i#%. %s'&i#%. !imer Control (!CO) $e%ister TCON &%,ist%& is "*so o)% o( t$% &%,ist%&s +$os% #its "&% i&%'t*! i) 'o)t&o* o( tim%& o%&"tio). O)*! #its o( t$is &%,ist%& "&% us% (o& t$is u&os% +$i*% &%st o( t$%m is us% (o& i)t%&&ut 'o)t&o*. Po3er Control (PCO) $e%ister T$% u&os% o( t$% R%,ist%& PCON #its is: •
MOD ;"u &"t% is t+i'% "s mu'$ $i,$%& #! s%tti), t$is #it.
•
F1 %)%&"*2u&os% #it "/"i*"#*% (o& us%B.
•
F1 %)%&"*2u&os% #it "/"i*"#*% (o& us%B.
•
F0 %)%&"*2u&os% #it "/"i*"#*% (o& us%B.
•
PD ;! s%tti), t$is #it t$% mi'&o'o)t&o**%& mi'&o'o)t&o**%& %)t%&s t$% /ower t$% /ower own mo%. own mo%.
•
IDL ;! s%tti), t$is #it t$% mi'&o'o)t&o**%& mi'&o'o)t&o**%& %)t%&s t$% idle mo%. idle mo%.
15
8051 Mi'&o'o)t&o**%& Mi'&o'o)t&o**%& A*i'"tio)s: T$% mi'&o'o)t&o**%& 8051 $"s #%%) i) "*i'"tio) i) " *"&,% "mou)t o( m"'$i)%s &i)'i"**! #%'"us% it is sim*% to i)'o&o&"t% i) " &o<%'t o& to "ss%m#*% " m"'$i)% "&ou) it. T$% (o**o+i), "&% t$% =%! sots o( sot*i,$t:
4ner%y
Mana%ement: Com%t%)t
m%"su&i),
%/i'%
s!st%ms
"i
i)
'"*'u*"ti), %)%&,! 'o)sumtio) i) om%sti' ") i)ust&i"*i9% "*i'"tio)s. T$%s% m%t%& s!st%ms "&% &%"&% 'om%t%)t #! i)t%,&"ti), mi'&o'o) mi'&o'o)t&o**%&s. t&o**%&s. !ouc5 screens: screens: A $i,$ %,&%% o( mi'&o'o)t&o**%& su*i%&s i)t%,&"t% tou'$ s%)si), "#i*iti%s i) t$%i& %si,)s. T&")so&t"#*% %/i'%s su'$ "s m%i" *"!%&s ,"mi), %/i'%s '%** $o)%s "&% som% i**ust&"tio)s o( mi'&o2 'o)t&o**%& i)t%,&"t% +it$ tou'$ s%)si), s'&%%)s. Automo*iles: T$% mi'&o'o)t& mi'&o'o)t&o**%& o**%& 8051 is'o/%&s #&o" &%'o,)itio) i) su*!i), "utomo#i*% so*utio)s. T$%! "&% %t%)si/%*! uti*i9% i) $!#&i moto& /%$i'*%s to 'o)t&o* %),i)% /"&i"tio)s. I) "itio) +o&=s su'$ "s '&uis% o+%& ")
")ti2#&"=%
m%'$")ism
$"s
'&%"t%
it
mo&%
'""#*%
+it$
t
%$"m"*,"m"tio) o( mi'&o2'o)t mi'&o2'o)t&o**%&s. &o**%&s.
Medical De6ices: H")! m%i'i)"* ,",%ts su'$ "s ,*u'os% #*oo &%ssu&% mo)ito&s #&i), i)to *"! mi'&o2'o)t&o**%&s to ut o) /i%+ t$% m%"su&%m%)ts "s " &%su*t o((%&i), $i,$%& %%)"#i*it! i) ,i/i), 'o&&%'t m%i'"* &%su*ts.
R%su*t: T$us t$% "&'$it%'tu&% o( 8051 mi'&o'o)t& mi'&o'o)t&o**%& o**%& +"s stui%.
17
8051 ;LOC DIARAM
8051 PIN DIARAM
?
FLA ;IT AND ;IT AND THE P REITER
TMOD Tim%&@Cou)t%& Mo% 'o)t&o* R%,ist%&B
•
•
• •
•
•
ATE1 %)"#*%s ") is"#*%s Tim%& 1 #! m%")s o( " si,)"* #&ou,$t to t$% INT1 i) P3.3B: 1 2 Tim%& 1 o%&"t%s o)*! i( t$% INT1 #it is s%t. 0 2 Tim%& 1 o%&"t%s &%,"&*%ss &%,"&*%ss o( t$% *o,i' st"t% o( t$% INT1 #it. C@T1 s%*%'ts u*s%s to #% 'ou)t% u #! t$% tim%&@'ou)t%& 1: 1 2 Tim%& 'ou)ts u*s%s #&ou,$t to t$% T1 i) P3.5B. 0 2 Tim%& 'ou)ts u*s%s (&om i)t%&)"* os'i**"to&. T1M1 T1M0t$%s% t+o #its s%*%'t t$% o%&"tio)"* mo% o( t$% Tim%& 1. ATE0 %)"#*%s ") is"#*%s Tim%& 1 usi), " si,)"* #&ou,$t to t$% INT0 i) P3.?B: 1 2 Tim%& 0 o%&"t%s o)*! i( t$% INT0 #it is s%t. 0 2 Tim%& 0 o%&"t%s &%,"&*%ss &%,"&*%ss o( t$% *o,i' st"t% o( t$% INT0 #it. C@T0 s%*%'ts u*s%s to #% 'ou)t% u #! t$% tim%&@'ou)t%& 0: 1 2 Tim%& 'ou)ts u*s%s #&ou,$t to t$% T0 i) P3.B. 0 2 Tim%& 'ou)ts u*s%s (&om i)t%&)"* os'i**"to&. T0M1 T0M0t$%s% t+o #its s%*%'t t$% o%&"tio)"* mo% o( t$% Tim%& 0.
Tim%& Co)t&o* TCONB R%,ist%&
TF1 #it is "utom"ti'"**! s%t o) t$% Tim%& 1 o/%&(*o+. TR1 #it %)"#*%s t$% Tim%& 1. 1 2 Tim%& 1 is %)"#*%. 0 2 Tim%& 1 is is"#*%. TF0 #it is "utom"ti'"**! s%t o) t$% Tim%& 0 o/%&(*o+. TR0 #it %)"#*%s t$% tim%& 0. 1 2 Tim%& 0 is %)"#*%. 0 2 Tim%& 0 is is"#*%.
• •
• •
%&i"* Po&t Co)t&o* CONB R%,ist%&
M0 2 %&i"* o&t mo% #it 0 is us% (o& s%&i"* o&t mo% s%*%'tio). M1 2 %&i"* o&t mo% #it 1. M? 2 %&i"* o&t mo% ? #it "*so =)o+) "s mu*ti&o'%sso& 'ommu)i'"tio) %)"#*% #it. $%) s%t it %)"#*%s mu*ti&o'%sso& 'ommu)i'"tio) 'ommu)i'"tio) i) mo% ? ") 3 ") %/%)tu"**! mo% 1. It s$ou* #% '*%"&% i) mo% 0. REN 2 R%'%tio) E)"#*% #it %)"#*%s s%&i"* &%'%tio) +$%) s%t. $%) '*%"&% s%&i"* &%'%tio) is is"#*%. T;8 2 T&")smitt%& #it 8. i)'% "** &%,ist%&s "&% 82#it +i% t$is #it so*/%s t$% &o#*%m o( t&")smitti), t$% -t$ #it i) mo%s ? ") 3. It is s%t to t&")smit *o,i' 1 i) t$% -t$ #it. R;8 2 R%'%i/%& #it 8 o& t$% -t$ #it &%'%i/% i) mo%s ? ") 3. C*%"&% #! $"&+"&% i( -t$ #it &%'%i/% is *o,i' 0. %t #! $"&+"&% i( -t$ #it &%'%i/% is *o,i' 1. TI2 T&")smit I)t%&&ut (*", is "utom"ti'"**! s%t "t t$% mom%)t t$% *"st #it o( o)% #!t% is s%)t. Its " si,)"* to t$% &o'%sso& t$"t t$% *i)% is "/"i*"#*% (o& " )%+ #!t% t&")smit. It must #% '*%"&% (&om +it$i) t$% so(t+"&%. • • •
•
•
•
•
6
RI 2 R%'%i/% I)t%&&ut (*", is "utom"ti'"**! s%t uo) o)% #!t% &%'%i/%. It si,)"*s t$"t #!t% is &%'%i/% ") s$ou* #% &%" >ui'=*! &io& to #%i), &%*"'% #! " )%+ "t". T$is #it is "*so '*%"&% (&om +it$i) t$% so(t+"&%. •
Po+%& Co)t&o* PCONB &%,ist%&
IE R%,ist%& I)t%&&ut E)"#*%B
EA 2 ,*o#"* i)t%&&ut %)"#*%@is"#*%: 0 2 is"#*%s "** i)t%&&ut &%>u%sts. &%>u%sts. 1 2 %)"#*%s "** i)i/iu"* i)t%&&ut &%>u%sts. E 2 %)"#*%s o& is"#*%s s%&i"* i)t%&&ut:
• •
0 2 UART s!st%m '"))ot ,%)%&"t% ") i)t%&&ut. i)t%&&ut. 1 2 UART s!st%m %)"#*%s ") i)t%&&ut. ET1 2 #it %)"#*%s o& is"#*%s Tim%& 1 i)t%&&ut: • •
0 2 Tim%& 1 '"))ot ,%)%&"t% ") i)t%&&ut. i)t%&&ut. 1 2 Tim%& 1 %)"#*%s ") i)t%&&ut. EX1 2 #it %)"#*%s o& is"#*%s %t%&)"* 1 i)t%&&u i )t%&&ut: t: • •
0 2 '$"),% o( t$% i) INT0 *o,i' st"t% '"))ot ,%)%&"t% ") i)t%&&ut. 1 2 %)"#*%s ") %t%&)"* i)t%&&ut i)t%&&ut o) t$% i) INT0 st"t% '$"),%. ET0 2 #it %)"#*%s o& is"#*%s tim%& 0 i)t%&&ut: • •
0 2 Tim%& 0 '"))ot ,%)%&"t% ") i)t%&&ut. i)t%&&ut. 1 2 %)"#*%s tim%& 0 i)t%&&ut. EX0 2 #it %)"#*%s o& is"#*%s %t%&)"* 0 i)t%&&u i )t%&&ut: t: • •
• •
0 2 '$"),% o( t$% INT1 i) *o,i' st"t% '"))ot ,%)%&"t% ") i)t%&&ut. 1 2 %)"#*%s ") %t%&)"* i)t%&&ut o) t$% i) INT1 st"t% '$"),%
8
10
1?
1
16