You are on page 1of 98

A PROJECT REPORT

ON
LASER COMMUNICATION
Bachelor of Technology
In
Electronics & Communication
2011-2012
Project Incharge : Submitted By:
Mr. Saurabh Sharma Akshat Mitta !0"2#2$100%&
Miss. S'ati Singh (eha Singh !0"2#2$102)&
Shrey Agar'a !0"2#2$10$#&
Mudit *ander
!0"2#2$1+0+&
Bharti ,oshi !0"2#221010&
-e.artment o/ 0ectronics 1 2ommunication
M00*34 I(S4I4340 56 4027(5859:;
M00*34 !3.P.&
20*4I6I2A40
This is to certify that or! hich is "eing #resente$ in the #ro%ect
entitle$ LASER COMMUNICATION su"mitte$ "y Mr& Akshat Mitta
Miss& (eha Singh' Mr& Shrey Agar'a' Mr& Mudit *ander' Miss& Bharti
,oshi stu$ent of final year B&Tech& In ELECTRONICS &
COMMUNICATION in #artial fulfillment of the re(uirement for aar$ of
the $egree of B&Tech in ELECTRONICS & COMMUNICATION is a recor$
of stu$ents or! carrie$ out "y them un$er my gui$ance an$ su#er)ision&
As #er the can$i$ates $eclaration this or! has not "een su"mitte$
elsehere for the aar$ of any other $egree&

-ated: 2< A.ri 2012 Signature of *ro%ect +ui$e
Pace: Meerut (ame, Miss& Sati Singh
-esignation, 80243*0*

Signature of *ro%ect Incharge Signature of -&O&.
A2=(5>80-90M0(4
?Enthusiasm is the feet of all progresses, with it there is
accomplishment and without it there are only slits alibis.@

Ac!nole$gment is not a ritual "ut is certainly an im#ortant thing for
the successful com#letion of the #ro%ect& At the time hen e ere ma$e to
!no a"out the #ro%ect' it as really )ery tough to #rocee$ further as e
ere to $e)elo# the same on a #latform' hich as ne to us& More so' the
co$ing #art seeme$ so tric!y that it seeme$ to "e im#ossi"le for us to
com#lete the or! ithin the gi)en $uration&
/e really feel in$e"te$ in ac!nole$ging the organi0ational su##ort
an$ encouragement recei)e$ from the management of our college.
The tas! of $e)elo#ing this system oul$ not ha)e "een #ossi"le
ithout the constant hel# of our mentors& /e ta!e this o##ortunity to
e1#ress our #rofoun$ sense of gratitu$e an$ res#ect to those ho hel#e$ us
throughout the $uration of this #ro%ect&
/e e1#ress our gratitu$e to Mr. Saurabh Sharma !7.5.-;MI4& Miss.
S'ati Singh!8ecturer;MI4&& /e oul$ again li!e to than! all of them for
gi)ing their )alua"le time to us in $e)elo#ing this #ro%ect&
-ated:2< A.ri 2012 Mr& A!shat Mittal
Pace: Meerut Miss& Neha Singh
Mr& Shrey Agaral
Mr& Mu$it Ran$er
Miss& Bharti 2oshi

TABLE OF CONTENTS
INTRODUCTION
PLATFORM USED
AIM OF THE PROJECT
BLOCK DIAGRAM
WORKING OF THE PROJECT
CIRCUIT DIAGRAM
COMPONENT LIST
CIRCUIT DESCRIPTION
PCB LAYOUT
STEPS FOR MAKING PCB
PROGRAMMING
SENSING UNIT DESCRIPTION
COMPONENTS DESCRIPTION
APPLICATION
CONCLUSION
REFERENCE
Intro$uction

I(4*5-324I5( ,

Laser communications systems are ireless connections through the
atmos#here& They or! similarly to fi"er o#tic lin!s' e1ce#t the "eam is
transmitte$ through free s#ace& /hile the transmitter an$ recei)er must
re(uire line3of3sight con$itions' they ha)e the "enefit of eliminating the nee$
for "roa$cast rights an$ "urie$ ca"les& Laser communications systems can "e
easily $e#loye$ since they are ine1#ensi)e' small' lo #oer an$ $o not
re(uire any ra$io interference stu$ies& The carrier use$ for the transmission
signal is ty#ically generate$ "y a laser $io$e& To #arallel "eams are
nee$e$' one for transmission an$ one for rece#tion& .ue to "u$get
restrictions' the system im#lemente$ in this #ro%ect is only one ay&
This #ro%ect is microcontroller "ase$ Laser communication system
use$ for the successful transmission of $ata& In this #ro%ect using to
microcontroller 'e are transmitting $ata from one en$ using laser
transmitter an$ at other en$ recei)e$ "y laser recei)er hich is connecte$ to
the #in of microcontroller 'here the transmitte$ as ell as recei)e$ $ata
$is#laye$ on lc$ &
Platform used
7ard'are reAuirements ,
1& Microcontroller AT45C67
2& L.R
$& LM8496 Regulator
+& *oer Su##ly
)& Resistors
%& Ca#acitors
<& Transistors
"& LI:UI. CR;STAL .IS*LA;
#& Transformer
10& Connectors
11) Laser Transmitter
12) Laser Recei)er
1$& Sitch
So/t'are reAuirements :
1& Assem"ler of ATMEL microcontroller series
2& *A.S for *CB $esigning
AIM OF THE
PROJECT
The Aim of this #ro%ect is to $esign a communication system through
Laser'a laser $io$e at the transmitting en$ act as a trans$user to con)ert the
$igital $ata into laser form an$ transmitte$ 'at the recei)ing en$ a laser
transistor con)ert the laser $ata into $igital form &
-ere the moti)e of using Laser is that /hile the transmitter an$
recei)er must re(uire line3of3sight con$itions' they ha)e the "enefit of
eliminating the nee$ for "roa$cast rights an$ "urie$ ca"les& Laser
communications systems can "e easily $e#loye$ since they are ine1#ensi)e'
small' lo #oer an$ $o not re(uire any ra$io interference stu$ies&
Block diagram
Laser communication
TRANSMITTER
TRANSMITTER
LASER DIODE
SUPPLY
SECTION

MICRO
CONTROLLER
89C51
Commun!"#o
n
DISPLAY SECTION
USING
LCD
Receiver

MICRO CONTROLLER
89C51
RECEI$ER
LDR
DISPLAY SECTION
USING
LCD
SUPPLY
SECTION
WORKING OF
THE PROJECT

There are to microcontroller one at sen$ing en$ an$ the other at
recei)ing en$ &Laser transmitter is connecte$ to the #in of the
microcontroller at the sen$ing en$ an$ the LASER recei)er is
connecte$ to microcontroller at recei)er en$&hene)er a #erson is
ishing to sen$ the $ata the microcontroller ma!e the laser transmitter
to sen$ the fre(uency corres#on$ing to that $ata an$ at recei)er en$
that fre(uency can change to the original $ata form hich ill $is#lay
on the lc$ connecte$ to the #in of the microcontroller&in this ay the
function of transmitting the $ata through laser recei)er an$
transmitter ha)e "een com#lete$&

CIRCUIT
DIAGRAM
Attach the hard
copy of the ckt
da!ra"
Component list
Attach hard copy of
Component list
CIRCUIT
DE#CRIPTION
POWER SPPL! SECTION"
Co$%%t% of&
1% RLMT Connector &&& I# ' " !onn(!#o) u'(* #o !onn(!#
#+( '#(, *o-n #)"n'.o)m() #o #+( /)*0( )(!#.()%
1% Bri#$e Recti%ier &&& I# ' " .u22 -"3( )(!#.() u'(* #o
!on3()# "! n#o *! 4 9&153 "! m"*( /5 #)"n'.o)m() '
!on3()#(* n#o *! -#+ #+( +(2, o. )(!#.()%
6% Ca&acitor" &&&&&I# ' "n (2(!#)o25#! !","!#o) o.
)"#n0 1777M865$ u'(* #o )(mo3( #+( ),,2('% C","!#o)
' #+( !om,on(n# u'(* #o ,"'' #+( "! "n* /2o!9 #+( *!%
:% Re$u'ator" &&&&LM;875 ' u'(* #o 03( " .<(* 53
)(0u2"#(* 'u,,25%
5% Ca&acitor" &&&&&I# ' "0"n "n (2(!#)o25#! !","!#o)
17M8=53 u'(* .o) .2#()n0 #o 03( ,u)( *!%
=% Ca&acitor" &&&&& I# ' "n !()"m! !","!#o) u'(* #o
)(mo3( #+( ',9(' 0(n()"#(* -+(n .)(>u(n!5 '
+0+?',9('@%
So #+( ou#,u# o. 'u,,25 '(!#on ' 53 )(0u2"#(* *!%
MICROCONTROLLER SECTION"
R(>u)(' #+)(( !onn(!#on' #o /( 'u!!(''.u225 *on( .o)
#A' o,()"#on #o /(0n%
1% ()v su&&'*" T+' B53 'u,,25 ' )(>u)(* .o) #+(
!on#)o22() #o 0(# '#")# -+!+ ' ,)o3*(* .)om #+( ,o-()
'u,,25 '(!#on% T+' 'u,,25 ' ,)o3*(* "# ,n no%61"n*
:7 o. #+( 89!51 !on#)o22()%
1% Cr*sta' Osci''ator" A !)5'#"2 o'!22"#o) o. 11 MHC '
!onn(!#(* "# ,n no%194<1 "n* ,n no%184<1 #o 0(n()"#(
#+( .)(>u(n!5 .o) #+( !on#)o22()% T+( !)5'#"2 o'!22"#o)
-o)9' on ,(Co(2(!#)! (..(!#%T+( !2o!9 0(n()"#(* '
u'(* #o *(#()mn( #+( ,)o!(''n0 ',((* o. #+(
!on#)o22()% T-o !","!#o)' ")( "2'o !onn(!#(* on( (n*
-#+ #+( o'!22"#o) -+2( #+( o#+() (n* ' !onn(!#(* -#+
#+( 0)oun*% A' # ' )(!omm(n*(* n #+( /oo9 #o
!onn(!# #-o !()"m! !","!#o) o. 17 ,.D:7,. #o
'#"/2C( #+( !2o!9 0(n()"#(*%
6% Reset section" I# !on''#' o. "n )! n(#-o)9
!on''#n0 o. 17M865$ !","!#o) "n* on( )(''#"n!( o.
19% T+' '(!#on ' u'(* #o )('(# #+( !on#)o22()
!onn(!#(* "# ,n no%9 o. AT89!51%
+ISPLA! SECTION"
LC+,LI-I+ CR!STAL +ISPLA!)
EMICROCONTROLLER BASED LCD DISPLAYF 4#+' ,)oG(!# ' "n (m/(**(*
,)oG(!# % Em/(**(* ' #+( !om/n"#on o. 'o.#-")( "n* +")*-")( /(.o)(
*('0nn0 "n5 (m/(**(* ,)oG(!# # ' #+( .)'# '#(, #o *('0n #+( ,)o,()
+")*-")( .o) #+( *(')(* ",,2!"#on% H()( -( ")( n#()."!n0 #+( LCD4
LIHUID CRYSTAL DISPLAY -#+ #+( M!)o!on#)o22()4 -( ")( u'n0 ATMEL
'()(' 51 !on#)o22() 89!51 !on#)o22()% I# ' " :7 ,n IC4 #+( .)'# '#(, -+2(
*('0nn0 +")*-")( ' #o *('0n #+( )(>u)(* ,o-() 'u,,25 "' #+(
!on#)o22() o,()"#(' on B5 3 'u,,25 'o .)'# -( +"3( #o *('0n #+(
)(0u2"#(* 'u,,25 -#+ #+( +(2, o. #)"n'.o)m()4 )(0u2"#o) "n* .2#()n0
!","!#o)%
N(<# '#(, ' #+( n(!(''")5 !onn(!#on' o. #+( !on#)o22() 29( )('(# "n*
#+( !)5'#"2 o'!22"#o) .o) )('(##n0 "n* ',((* )(',(!#3(25%
T+(n !om(' #+( LCD n#()."!n0 4-( ")( u'n0 1=<1 LCD .o) *',2"54 ,n
no% ; #o 1: ")( #+( *"#" 2n(' o. #+( LCD -+!+ +"' #o /( n#()."!(* -#+
#+( m!)o!on#)o22() n,u#8ou#,u# ,n'% Po)# ,7 +"' /((n u'(* .o) #+(
n#()."!n0 o. *"#" 2n('%
Sn!( #+( *',2"5 /(!om(' 3()5 ("'5 -+(n -( u'( m!)o!on#)o22() +(n!(
-( +"3( m"*( #+' ,)oG(!# "n* -( +"3( #)(* #o '+o- *..()(n# *',2"5
u'n0 #+( '-#!+%
RELA! SECTION"
RELAY ' "n 'o2"#o) "n* "n (2(!#)!"2 '-#!+% T+( )(2"5 u'(*
' 11$&5A%To !on#)o2 #+( o,()"#on o. )(2"5 "n NPN #)"n''#o)
BC5:; +"' /((n u'(*% W+(n(3() +0+ '0n"2 !om(' "# #+(
/"'( o. NPN #)"n''#o) # ' '-#!+(* on "n* -+(n(3() 2o-
"))3(' # ' '-#!+(* o..% B"'( o. #+( #)"n''#o) ' !onn(!#(*
-#+ #+( I8O ,n o. #+( m!)o!on#)o22()% B"'( )(''#"n!( o. 195
' !onn(!#(* "# #+( /"'( o. #+( #)"n''#o)% W+(n(3() 2o- '
'(n'(* "# #+( ,n o. m!)o!on#)o22() #)"n''#o) 0(#' o.. "n*
#+( ou#,u# o. #+( !o22(!#o) /(!om(' +0+ "n* #+( )(2"5 -+!+
' !onn(!#(* "# #+( ou#,u# o. #+( !o22(!#o) /(!om(' o..% T+(
)(3()'( "!#on o. # #"9(' ,2"!( -+(n +0+ ' '(n'(* "# #+(
,n o. m!)o!on#)o22()%

T+' '(!#on "2'o !on''#' o. ,u22 u, I ,u22 *o-n )(''#"n!(%
A 191 )(''#"n!( ' u'(* "' ,u22 u,% In "n5 !"'( -+(n mo)(
#+"n 53 !om(' #+(n ,u22 u, )(''#"n!( 'n9' #+( (<!(''
3o2#"0( I m"n#"n' 53% I. ,u22 u, ' no# u'(* #+(n #+( 113 o.
)(2"5 !"n *"m"0( #+( ,)o!(''o) -+(n #+( #)"n''#o) BC5:;
' on% A ,u22 *o-n )(''#o) o. 3"2u( 191 ' "2'o u'(*%
PC' (A)OUT
Attach the hard
copy of the
co"po$e$t
*ayo+t
Attach the hard
copy of the pc,
*ayo+t
#TEP# FOR
MAKING PC'
P)(,")( #+( 2"5ou# o. #+( !)!u# ?,o'#3(@%
Cu# #+( ,+o#o.2m ?'20+#25 /00()@ o. #+( 'C( o. #+( 2"5ou#%
P2"!( #+( 2"5ou# n #+( ,+o#o,)n#() m"!+n( -#+ #+(
,+o#o.2m "/o3( #% M"9( 'u)( #+"# #+( /)om*( ?*")9@ '*( o.
#+( .2m ' n !on#"!# -#+ #+( 2"5ou#%
S-#!+ on #+( m"!+n( /5 ,)(''n0 #+( ,u'+ /u##on .o) 5 '(!%
D, #+( .2m n #+( 'o2u#on ,)(,")(* ?*(3(2o,()@ /5 m<n0 #+(
!+(m!"2' A I B n (>u"2 >u"n##(' n -"#()%
No- !2("n #+( .2m /5 ,2"!n0 # n #+( #)"5 !on#"nn0 -"#() .o)
1 mn%
A.#() #+'4 *, #+( .2m n #+( .<() 'o2u#on .o) 1 mn% no- #+(
n(0"#3( o. #+(
C)!u# ' )("*5%
No- -"'+ # un*() #+( .2o-n0 -"#()%
D)5 #+( n(0"#3( n #+( ,+o#o!u)( m"!+n(%
T"9( #+( PCB /o")* o. #+( 'C( o. #+( 2"5ou# "n* !2("n # -#+
'#((2 -oo2 #o m"9( #+( 'u)."!( 'moo#+%
No- *, #+( PCB n #+( 2>u* ,+o#o)(''#4 -#+ #+( +(2, o. *,
!o"# m"!+n(%
No- !2, #+( PCB n(<# #o #+( n(0"#3( n #+( ,+o#o !u)(
m"!+n(4 *)5n0 .o) ",,)o<m"#( 17&11 mnu#(%
No- ,2"!( #+( n(0"#3( on #+( #o, o. #+( PCB n #+( U$
m"!+n(4 '(# #+( #m() .o) "/ou# 1%5 mnu#( "n* '-#!+ on #+(
U$ 20+# "# #+( #o,%
T"9( #+( LPR *(3(2o,() n " !on#"n() "n* )0o)ou'25 mo3( #+(
PCB n #%
A.#() #+'4 -"'+ # -#+ -"#() 3()5 0(n#25%
T+(n ",,25 LPR *5( on # -#+ #+( +(2, o. " *)o,,() 'o #+"# # '
!om,2(#(25 !o3()(* /5 #%
No- !2"m, #+( PCB n #+( (#!+n0 m"!+n( #+"# !on#"n' .())!
!+2o)*( 'o2u#on .o) "/ou# 17 mnu#('%
A.#() (#!+n04 -"'+ #+( PCB -#+ -"#()4 -,( # " *)5 !2o#+
'o.#25%
Fn"225 )u/ #+( PCB -#+ " '#((2 -oo24 "n* #+( PCB ' )("*5%

Pro!ra""$!
Attach hard
copy of
pro!ra""$!
#EN#ING UNIT
DE#CRIPTION
Laser transmitter
Laser receiver
A aser diode is a laser here the acti)e me$ium is a semicon$uctor similar
to that foun$ in a light3emitting $io$e& The most common an$ #ractical ty#e
of laser $io$e is forme$ from a #3n %unction an$ #oere$ "y in%ecte$ electric
current& These $e)ices are sometimes referre$ to as injection laser diodes to
$istinguish them from <o#tically= pumped laser diodes' hich are more
easily manufacture$ in the la"oratory&

4heory o/ o.eration
A laser $io$e' li!e many other semicon$uctor $e)ices' is forme$ "y $o#ing a
)ery thin layer on the surface of a crystal afer& The crystal is $o#e$ to
#ro$uce an n3ty#e region an$ a #3ty#e region' one a"o)e the other' resulting
in a p3n %unction' or $io$e&
Laser $io$es form a su"set of the larger classification of semicon$uctor p3n
%unction $io$es& As ith any semicon$uctor p3n %unction $io$e' forar$
electrical "ias causes the to s#ecies of charge carrier > holes an$ electrons
> to "e ?in%ecte$? from o##osite si$es of the p3n %unction into the $e#letion
region' situate$ at its heart& -oles are in%ecte$ from the p3$o#e$' an$
electrons from the n3$o#e$' semicon$uctor& <A $e#letion region' $e)oi$ of
any charge carriers' forms automatically an$ una)oi$a"ly as a result of the
$ifference in chemical #otential "eteen n3 an$ p3ty#e semicon$uctors
here)er they are in #hysical contact&=
As charge in%ection is a $istinguishing feature of $io$e lasers as com#are$ to
all other lasers' $io$e lasers are tra$itionally an$ more formally calle$
?in%ection lasers&? <This terminology $ifferentiates $io$e lasers' e&g&' from
flashlam#3#um#e$ soli$ state lasers' such as the ru"y laser& Interestingly'
hereas the term ?soli$3state? as e1tremely a#t in $ifferentiating 7569s3era
semicon$uctor electronics from earlier generations of )acuum electronics' it
oul$ not ha)e "een a$e(uate to con)ey unam"iguously the uni(ue
characteristics $efining 75@9s3era semicon$uctor lasers&= /hen an electron
an$ a hole are #resent in the same region' they may recom"ine or
?annihilate? ith the result "eing s#ontaneous emission A i&e&' the electron
may re3occu#y the energy state of the hole' emitting a #hoton ith energy
e(ual to the $ifference "eteen the electron an$ hole states in)ol)e$& <In a
con)entional semicon$uctor %unction $io$e' the energy release$ from the
recom"ination of electrons an$ holes is carrie$ aay as #honons' i&e&' lattice
)i"rations' rather than as #hotons&= S#ontaneous emission gi)es the laser
$io$e "elo lasing threshol$ similar #ro#erties to an LE.& S#ontaneous
emission is necessary to initiate laser oscillation' "ut it is one among se)eral
sources of inefficiency once the laser is oscillating&
The $ifference "eteen the #hoton3emitting semicon$uctor laser an$
con)entional #honon3emitting <non3light3emitting= semicon$uctor %unction
$io$es lies in the use of a $ifferent ty#e of semicon$uctor' one hose
#hysical an$ atomic structure confers the #ossi"ility for #hoton emission&
These #hoton3emitting semicon$uctors are the so3calle$ ?$irect "an$ga#?
semicon$uctors& The #ro#erties of silicon an$ germanium' hich are single3
element semicon$uctors' ha)e "an$ga#s that $o not align in the ay nee$e$
to allo #hoton emission an$ are not consi$ere$ ?$irect&? Other materials'
the so3calle$ com#oun$ semicon$uctors' ha)e )irtually i$entical crystalline
structures as silicon or germanium "ut use alternating arrangements of to
$ifferent atomic s#ecies in a chec!er"oar$3li!e #attern to "rea! the
symmetry& The transition "eteen the materials in the alternating #attern
creates the critical ?$irect "an$ga#? #ro#erty& +allium arseni$e' in$ium
#hos#hi$e' gallium antimoni$e' an$ gallium nitri$e are all e1am#les of
com#oun$ semicon$uctor materials that can "e use$ to create %unction
$io$es that emit light&
.iagram <not to scale= of a sim#le laser $io$e' such as shon a"o)e&
In the a"sence of stimulate$ emission <e&g&' lasing= con$itions' electrons an$
holes may coe1ist in #ro1imity to one another' ithout recom"ining' for a
certain time' terme$ the ?u##er3state lifetime? or ?recom"ination time?
<a"out a nanosecon$ for ty#ical $io$e laser materials=' "efore they
recom"ine& Then a near"y #hoton ith energy e(ual to the recom"ination
energy can cause recom"ination "y stimulate$ emission& This generates
another #hoton of the same fre(uency' tra)elling in the same $irection' ith
the same #olari0ation an$ #hase as the first #hoton& This means that
stimulate$ emission causes gain in an o#tical a)e <of the correct
a)elength= in the in%ection region' an$ the gain increases as the num"er of
electrons an$ holes in%ecte$ across the %unction increases& The s#ontaneous
an$ stimulate$ emission #rocesses are )astly more efficient in $irect
"an$ga# semicon$uctors than in in$irect "an$ga# semicon$uctorsB therefore
silicon is not a common material for laser $io$es&
As in other lasers' the gain region is surroun$e$ ith an o#tical ca)ity to
form a laser& In the sim#lest form of laser $io$e' an o#tical a)egui$e is
ma$e on that crystal surface' such that the light is confine$ to a relati)ely
narro line& The to en$s of the crystal are clea)e$ to form #erfectly
smooth' #arallel e$ges' forming a Ca"ry>*Drot resonator& *hotons emitte$
into a mo$e of the a)egui$e ill tra)el along the a)egui$e an$ "e
reflecte$ se)eral times from each en$ face "efore they are emitte$& As a light
a)e #asses through the ca)ity' it is am#lifie$ "y stimulate$ emission' "ut
light is also lost $ue to a"sor#tion an$ "y incom#lete reflection from the en$
facets& Cinally' if there is more am#lification than loss' the $io$e "egins to
?lase?&
Some im#ortant #ro#erties of laser $io$es are $etermine$ "y the geometry of
the o#tical ca)ity& +enerally' in the )ertical $irection' the light is containe$
in a )ery thin layer' an$ the structure su##orts only a single o#tical mo$e in
the $irection #er#en$icular to the layers& In the lateral $irection' if the
a)egui$e is i$e com#are$ to the a)elength of light' then the a)egui$e
can su##ort multi#le lateral o#tical mo$es' an$ the laser is !non as ?multi3
mo$e?& These laterally multi3mo$e lasers are a$e(uate in cases here one
nee$s a )ery large amount of #oer' "ut not a small $iffraction3limite$
"eamB for e1am#le in #rinting' acti)ating chemicals' or #um#ing other ty#es
of lasers&
In a##lications here a small focuse$ "eam is nee$e$' the a)egui$e must
"e ma$e narro' on the or$er of the o#tical a)elength& This ay' only a
single lateral mo$e is su##orte$ an$ one en$s u# ith a $iffraction3limite$
"eam& Such single s#atial mo$e $e)ices are use$ for o#tical storage' laser
#ointers' an$ fi"er o#tics& Note that these lasers may still su##ort multi#le
longitu$inal mo$es' an$ thus can lase at multi#le a)elengths
simultaneously&
The a)elength emitte$ is a function of the "an$3ga# of the semicon$uctor
an$ the mo$es of the o#tical ca)ity& In general' the ma1imum gain ill occur
for #hotons ith energy slightly a"o)e the "an$3ga# energy' an$ the mo$es
nearest the gain #ea! ill lase most strongly& If the $io$e is $ri)en strongly
enough' a$$itional side modes may also lase& Some laser $io$es' such as
most )isi"le lasers' o#erate at a single a)elength' "ut that a)elength is
unsta"le an$ changes $ue to fluctuations in current or tem#erature&
.ue to $iffraction' the "eam $i)erges <e1#an$s= ra#i$ly after lea)ing the
chi#' ty#ically at E9 $egrees )ertically "y 79 $egrees laterally& A lens must
"e use$ in or$er to form a collimate$ "eam li!e that #ro$uce$ "y a laser
#ointer& If a circular "eam is re(uire$' cylin$rical lenses an$ other o#tics are
use$& Cor single s#atial mo$e lasers' using symmetrical lenses' the
collimate$ "eam en$s u# "eing elli#tical in sha#e' $ue to the $ifference in
the )ertical an$ lateral $i)ergences& This is easily o"ser)a"le ith a re$ laser
#ointer&
The sim#le $io$e $escri"e$ a"o)e has "een hea)ily mo$ifie$ in recent years
to accommo$ate mo$ern technology' resulting in a )ariety of ty#es of laser
$io$es' as $escri"e$ "elo&
MI2*525(4*5880* A4"#2)1
6eatures
F Com#ati"le ith MCS367G *ro$ucts
F 4H Bytes of In3System Re #rogramma"le Clash Memory
F En$urance, 7'999 /riteIErase Cycles
F Cully Static O#eration, 9 -0 to JK M-0
F Three3le)el *rogram Memory Loc!
F J6@ 1 43"it Internal RAM
F EJ *rogramma"le IIO Lines
FThree 7@3"it TimerICounters
F Eight Interru#t Sources
F *rogramma"le Serial Channel
F Lo3#oer I$le an$ *oer3$on Mo$es
.ESCRI*TION
The AT45C6J is a lo3#oer' high3#erformance CMOS 43"it microcom#uter 4H"ytes of
Clash #rogramma"le an$ erasa"le rea$ only memory <*EROM=& The $e)ice is
manufacture$ using Atmel Ls high3$ensity non)olatile memory technology an$ is
com#ati"le ith the in$ustry stan$ar$ 49C67 an$ 49C6J instruction set an$ #in out&
The on3chi# Clash allos the #rogram memory to "e re#rogramme$
in3system or "y a Con)entional non)olatile memory #rogrammer& By
com"ining a )ersatile 43"it C*U ith Clash on a monolithic chi#' the Atmel
AT45C6J is a #oerful microcom#uter that #ro)i$es a highly fle1i"le an$
cost3effecti)e solution to many em"e$$e$ control a##lication&
4he A4"#2)2 .roBides the /oo'ing standard /eatures: "= bytes o/ 6ash; 2)%
bytes o/ *AM; $2 IC5 ines; three 1%-bit timerCcounters; a siD-Bector t'o-eBe
interru.t architecture; a /u-du.eD seria .ort; on-chi. osciator; and cock
circuitry. In addition; the A4"#2)2 is designed 'ith static ogic /or o.eration do'n
to Eero /reAuency and su..orts t'o so/t'are seectabe .o'er saBing modes. 4he
Ide Mode to.s the 2P3 'hie ao'ing the *AMF timerCcounters; seria .ort; and
interru.t system to continue /unctioning.
The *oer3$on mo$e sa)es the RAM contents "ut Cree0es the
oscillator' $isa"ling all other chi# functions until the ne1t har$are reset
&
Pin -escri.tion
G22
Su##ly )oltage&
9(-
+roun$&
Port 0
Port 0 is an "-bit o.en drain bi-directiona IC5 .ort. As an out.ut .ort; each .in can
sink eight 448 in.uts. >hen 1s are 'ritten to .ort 0 .ins; the .ins can be used as
high im.edance in.uts.
*ort 9 can also "e configure$ to "e the multi#le1e$ lo or$er a$$ressI$ata
"us $uring accesses to e1ternal #rogram an$ $ata memory& In this mo$e' *9
has internal #ull3u#s &
*ort 9 also recei)es the co$e "ytes $uring Clash #rogramming an$ out#uts
the co$e "ytes $uring #rogram )erification& E1ternal #ull3u#s are re(uire$
$uring #rogram )erification&
Port 1
*ort 7 is an 43"it "i3$irectional IIO #ort ith internal #ull3u#s& The *ort 7
out#ut "uffers can sin!Isource four TTL in#uts& /hen 7s are ritten to *ort
7 #ins' they are #ulle$ high "y the internal #ull3u#s an$ can "e use$ as
in#uts& As in#uts' *ort 7 #ins that are e1ternally "eing #ulle$ lo ill source
current <IIL= "ecause of the internal #ull3u#s&
In a$$ition' *7&9 an$ *7&7 can "e configure$ to "e the timerIcounter J e1ternal count in#ut
<*7&9ITJ= an$ the timerIcounter J trigger in#ut <*7&7ITJEM=' res#ecti)ely' as shon in the
folloing ta"le&
*ort 7 also recei)es the lo3or$er a$$ress "ytes $uring
Port 2
*ort J is an 43"it "i3$irectional IIO #ort ith internal #ull3u#s& The *ort J
out#ut "uffers can sin!Isource four TTL in#uts& /hen 7s are ritten to *ort
J #ins' they are #ulle$ high "y the internal #ull3u#s an$ can "e use$ as
in#uts& As in#uts' *ort J #ins that are e1ternally "eing #ulle$ lo ill source
current <IIL= "ecause of the internal #ull3u#s& *ort J emits the high3or$er
a$$ress "yte $uring fetches from e1ternal #rogram memory an$ $uring
accesses to e1ternal $ata memory that use 7@3"it a$$resses <MONM O
.*TR=& In this a##lication' *ort J uses strong internal #ull3u#s hen
emitting 7s& .uring accesses to e1ternal $ata memory that use 43"it
a$$resses <MONM O RI=' *ort J emits the contents of the *J S#ecial
Cunction Register& *ort J also recei)es the high3or$er a$$ress "its an$ some
control signals $uring Clash #rogramming an$ )erification&
Port $
*ort E is an 43"it "i3$irectional IIO #ort ith internal #ull3u#s& The *ort E
out#ut "uffers can sin!Isource four TTL in#uts& /hen 7s are ritten to *ort
E #ins' they are #ulle$ high "y the internal #ull3u#s an$ can "e use$ as
in#uts& As in#uts' *ort E #ins that are e1ternally "eing #ulle$ lo ill source
current <IIL= "ecause of the #ull3u#s& *ort E also ser)es the functions of
)arious s#ecial features of the AT45C67' as shon in the folloing ta"le&
*ort E also recei)es some control signals for Clash #rogramming&
*S4
*eset in.ut. A high on this .in /or t'o machine cyces 'hie the osciator is running
resets the deBice.
A80CP*59
A$$ress Latch Ena"le is an out#ut #ulse for latching the lo "yte of the a$$ress $uring
accesses to e1ternal memory& This #in is also the #rogram #ulse in#ut <*RO+= $uring Clash
#rogramming& In normal o#eration' ALE is emitte$ at a constant rate of 7I@ the oscillator
fre(uency an$ may "e use$ for e1ternal timing or cloc!ing #ur#oses& Note' hoe)er' that
one ALE #ulse is s!i##e$ $uring each access to e1ternal $ata memory& If $esire$' ALE
o#eration can "e $isa"le$ "y setting "it 9 of SCR location 4E-& /ith the "it set' ALE is
acti)e only $uring a MONM or MONC instruction& Otherise' the #in is ea!ly #ulle$
high& Setting the ALE3$isa"le "it has no effect if the micro controller is in e1ternal
e1ecution mo$e&
PS0(
*rogram Store Ena"le is the rea$ stro"e to e1ternal #rogram memory& /hen the AT45C6J
is e1ecuting co$e from e1ternal #rogram memory' *SEN is acti)ate$ tice each machine
cycle' e1ce#t that to *SEN acti)ations are s!i##e$ $uring each access to e1ternal $ata
memory&
EA/VPP
E1ternal Access Ena"le& EA must "e stra##e$ to +N. in or$er to ena"le the
$e)ice to fetch co$e from e1ternal #rogram memory locations starting at
9999- u# to CCCC-&
Note' hoe)er' that if loc! "it 7 is #rogramme$' EA ill "e internally
latche$ on reset&
EA shoul$ "e stra##e$ to NCC for internal #rogram e1ecutions& This #in
also recei)es the 7J3)olt #rogramming ena"le )oltage <N**= $uring Clash
#rogramming hen 7J3)olt #rogramming is selecte$&
H4A81
In#ut to the in)erting oscillator am#lifier an$ in#ut to the internal cloc! o#erating circuit&
H4A82
Out#ut from the in)erting oscillator am#lifier &
S.ecia 6unction *egisters
A ma# of the on3chi# memory area calle$ the S#ecial Cunction Register
<SCR= s#ace is shon in Ta"le 7&
(ote that not a o/ the addresses are occu.ied; and unoccu.ied addresses may not
be im.emented on the chi.. *ead accesses to these addresses 'i in genera return
random data; and 'rite accesses 'i haBe an indeterminate e//ect. 3ser so/t'are
shoud not 'rite 1s to these unisted ocations; since they may be used in /uture .rod
ne' /eatures. In that case; the reset or inactiBe Baues o/ the ne' bits 'i a'ays be
0.
Timer 2 Registers
Control an$ status "its are containe$ in registers TJCON <shon in Ta"le J=
an$ TJMO. <shon in Ta"le K= for Timer J& The register #air <RCA*J-'
RCA*JL= are the Ca#tureIReloa$ registers for Timer J in 7@3"it ca#ture
mo$e or 7@3"it auto3reloa$ mo$e&
Interru.t *egisters
The in$i)i$ual interru#t ena"le "its are in the IE register& To #riorities can "e set for each
of the si1 interru#t sources in the I* register& Instructions that use in$irect a$$ressing
access the u##er 7J4 "ytes of RAM& Cor e1am#le' the folloing in$irect a$$ressing
instruction' here R9 contains 9A9-' accesses the $ata "yte at a$$ress 9A9-' rather than
*J <hose a$$ress is 9A9-=&
MON OR9' P$ata
Note that stac! o#erations are e1am#les of in$irect a$$ressing' so the u##er 7J4 "ytes of
$ata RAM are a)ail a)aila"le as stac! s#ace&
4imer 0 and 1
Timer 9 an$ Timer 7 in the AT45C6J o#erate the same ay as Timer 9 an$ Timer 7 in the
T45C67&
4imer 2
Timer J is a 7@3"it TimerICounter that can o#erate as either a timer or an
e)ent counter& The ty#e of o#eration is selecte$ "y "it CITJ in the SCR
TJCON <shon in Ta"le J=&Timer J has three o#erating mo$es, ca#ture'
auto3reloa$ <u# or $on counting=' an$ "au$ rate generator& The mo$es are
selecte$ "y "its in TJCON' as shon in Ta"le E&Timer J consists of to 43
"it registers' T-J an$ TLJ& In the Timer function' the TLJ register is
incremente$ e)ery machine cycle& Since a machine cycle consists of 7J
oscillator #erio$s' the count rate is 7I7J of the oscillator in#ut #in' TJ& In this
function' the e1ternal in#ut is sam#le$ $uring S6*J of e)ery machine cycle&
/hen the sam#les sho a high in one cycle an$ a lo in the ne1t cycle' the
count is incremente$& The ne count )alue a##ears in the register $uring
SE*7 of the cycle folloing the one in hich
the transition as $etecte$& Since to machine cycles <JK oscillator #erio$s=
are re(uire$ to recogni0e a 73to39 transition' the ma1imum count rate is 7IJK
of the oscillator fre(uency& To ensure that a gi)en le)el is sam#le$ at least
once "efore it changes' the le)el shoul$ "e hel$ for at least one full machine
cycle&
2a.ture Mode
In the ca#ture mo$e' to o#tions are selecte$ "y "it EMENJ in TJCON& If EMENJ Q 9'
Timer J is a 7@3"it timer or counter hich u#on o)erflo sets "it TCJ in TJCON&This "it
can then "e use$ to generate an interru#t& If EMENJ Q 7' Timer J #erforms the same
o#eration' "ut a 73to39 transition at e1ternal in#ut TJEM also causes the current )alue in
T-J an$ TLJ to "e ca#ture$ into CA*J- an$ RCA*JL' res#ecti)ely& In a$$ition' the
transition at TJEM causes "it EMCJ in TJCON to "e set& The EMCJ "it' li!e TCJ' can
generate an interru#t& The ca#ture mo$e is illustrate$ in Cigure 7&
Auto-reoad !3. or -o'n 2ounter&
Timer J can "e #rogramme$ to count u# or $on hen configure$ in its 7@3"it auto3reloa$
mo$e& This feature is in)o!e$ "y the.CEN <.on Counter Ena"le= "it locate$ in the SCR
TJMO. <see Ta"le K=& U#on reset' the .CEN "it is set to 9 so that timer J ill $efault to
count u#& /hen .CEN is set' Timer J can count u# or $on' $e#en$ing on the )alue of the
TJEM #in&
Cigure J shos Timer J automatically counting u# hen .CEN Q 9& In this mo$e' to
o#tions are selecte$ "y "itEMENJ in TJCON& If EMENJ Q 9' Timer J counts u# to
9CCCC- an$ then sets the TCJ "it u#on o)erflo& The o)erflo also causes the timer
registers to "e reloa$e$ ith the 7@3"it )alue in RCA*J- an$ RCA*JL& The )alues in
Timer in Ca#ture Mo$eRCA*J- an$ RCA*JL are #reset "y softare& If EMENJ Q 7' a 7@3
"it reloa$ can "e triggere$ either "y an o)erflo or "y a 73to39 transition at e1ternal in#ut
TJEM& This transition also sets the EMCJ "it& Both the TCJ an$ EMCJ "its can generate an
interru#t if ena"le$& Setting the .CEN "it ena"les Timer J to count u# or $on' as shon
in Cigure E& In this mo$e' the TJEM #in controls
the $irection of the count& A logic 7 at TJEM ma!es Timer J count u#& The
timer ill o)erflo at 9CCCC- an$ set the TCJ "it& This o)erflo also
causes the 7@3"it )alue in RCA*J- an$ RCA*JL to "e reloa$e$ into the
timer registers' T-J an$ TLJ' res#ecti)ely& A Logic 9 at TJEM ma!es Timer
J count $on& The timer un$erflos hen T-J an$ TLJ e(ual the )alues
store$ in RCA*J- an$ RCA*JL& The un$erflo sets the TCJ "it an$ causes
9CCCC- to "e reloa$e$ into the timer Registers& The EMCJ "it toggles
hene)er Timer J o)erflos or un$erflos an$ can "e use$ as a 78th "it of
resolution& In this o#erating mo$e' EMCJ $oes not flag an interru#t&
Baud *ate 9enerator
Timer J is selecte$ as the "au$ rate generator "y setting TCLH an$Ior RCLH
in TJCON <Ta"le J=& Note that the "au$ rates for transmit an$ recei)e can "e
$ifferent if Timer J is use$ for the recei)er or transmitter an$ Timer 7 is
use$ for the other function& Setting RCLH an$Ior TCLH #uts Timer J into
its "au$ rate generator mo$e' as shon in CigureK& The "au$ rate generator
mo$e is similar to the auto3reloa$ mo$e' in that a rollo)er in T-J causes the
Timer J registers to "e reloa$e$ ith the 7@3"it )alue in registers RCA*J-
an$ RCA*JL' hich are #reset "y softare&
The "au$ rates in Mo$es 7 an$ E are $etermine$ "y TimerJLs o)erflo rate accor$ing to
the folloing e(uation&
The Timer can "e configure$ for either timer or counter o#eration& In most a##lications' it
is configure$ for timer o#eration <C*ITJ Q 9=& The timer o#eration is $ifferent for Timer J
hen it is use$ as a "au$ rate generator& Normally' as a timer' it increments e)ery machine
cycle <at 7I7J the oscillator fre(uency=& As a "au$ rate generator' hoe)er' it increments
e)ery state time <at 7IJ the oscillator fre(uency=& The "au$ rate formula is gi)en "elo&
here <RCA*J-' RCA*JL= is the content of RCA*J- an$ RCA*JL ta!en as a 7@3"it
unsigne$ integer& Timer J as a "au$ rate generator is shon in Cigure K& This figure is )ali$
only if RCLH or TCLH Q 7 in TJCON& Note that a rollo)er in T-J $oes not set TCJ an$
ill not generate an interru#t& Note too' that if EMENJ is set' a 73to39 transition in TJEM
ill set EMCJ "ut ill not cause a reloa$ from <RCA*J-' RCA*JL= to <T-J' TLJ=& Thus
hen Timer J is in use as a "au$ rate generator' TJEM can "e use$ as an e1tra e1ternal
interru#t&
Note that hen Timer J is running <TRJ Q 7= as a timer in the "au$ rate
generator mo$e' T-J or TLJ shoul$ not "e rea$ from or ritten to& Un$er
these con$itions' the Timer is incremente$ e)ery state time' an$ the results
of a rea$ or rite may not "e accurate& The RCA*J registers may "e rea$
"ut shoul$ not "e ritten to' "ecause a rite might o)erla# a reloa$ an$
cause rite an$Ior reloa$ errors& The timer shoul$ "e turne$ off <clear TRJ=
"efore accessing the Timer J or RCA*J registers&
Programmabe 2ock 5ut
A 69R $uty cycle cloc! can "e #rogramme$ to come out on *7&9' as shon
in Cigure 6& This #in' "esi$es "eing a regular IIO #in' has to alternate
functions& It can "e #rogramme$ to in#ut the e1ternal cloc! for
TimerICounter J or to out#ut a 69R $uty cycle cloc! ranging from @7 -0 to
K M-0 at a 7@ M-0 o#erating fre(uency& To configure the TimerICounter J
as a cloc! generator' "it CITJ <TJCON&7= must "e cleare$ an$ "it TJOE
<TJMO.&7= must "e set& Bit TRJ <TJCON&J= starts an$ sto#s the timer& The
cloc!3out fre(uency $e#en$s on the oscillator fre(uency an$ the reloa$ )alue
of Timer J ca#ture registers <RCA*J-' RCA*JL=' as shon in the
folloing e(uation&
In the cloc!3out mo$e' Timer J roll3o)ers ill not generate an interru#t& This
"eha)ior is similar to hen Timer J is use$ as a "au$3rate generator& It is
#ossi"le to use Timer J as a "au$3rate generator an$ a cloc! generator
simultaneously& Note' hoe)er' that the "au$3rate an$ cloc!3out
Cre(uencies cannot "e $etermine$ in$e#en$ently from one another since
they "oth use RCA*J- an$ RCA*JL&
3A*4
The UART in the AT45C6J o#erates the same ay as the UART in the AT45C67&
Interru.ts
The AT45C6J has a total of si1 interru#t )ectors, to e1ternal interru#ts <INT9 an$ INT7='
three timer interru#ts <Timers 9' 7' an$ J=' an$ the serial #ort interru#t& These interru#ts are
all shon in Cigure @&Each of these interru#t sources can "e in$i)i$ually ena"le$ or
$isa"le$ "y setting or clearing a "it in S#ecial Cunction Register IE& IE also contains a
glo"al $isa"le "it' EA' hich $isa"les all interru#ts at once&
Note that Ta"le shos that "it #osition IE&@ is unim#lemente$& In the
AT45C67' "it #osition IE&6 is also unim#lemente$& User softare shoul$ not
rite 7s to these "it #ositions' since they may "e use$ in future AT45
#ro$ucts& Timer J interru#t is generate$ "y the logical OR of "its TCJ an$
EMCJ in register TJCON& Neither of these flags is cleare$ "y har$are
hen the ser)ice routine is )ectore$ to& In fact' the ser)ice routine may ha)e
to $etermine hether it as TCJ or EMCJ that generate$ the interru#t' an$
that "it ill ha)e to "e cleare$ in softare& The Timer 9 an$ Timer 7 flags'
TC9 an$ TC7' are set at S6*J of the cycle in hich the timers o)erflo& The
)alues are then #olle$ "y the circuitry in the ne1t cycle& -oe)er' the Timer
J flag' TCJ' is set at SJ*J an$ is #olle$ in the same cycle in hich the timer
o)erflos&
5sciator 2haracteristics
H4A81 and H4A82 are the in.ut and out.ut; res.ectiBey; o/ an inBerting am.i/ier
that can be con/igured /or use as an on-chi. osciator; as sho'n in 6igure <. 0ither
a AuartE crysta or ceramic resonator may be used. 4o driBe the deBice /rom an
eDterna cock source; H4A82 shoud be e/t
Un connecte$ hile MTAL7 is $ri)en' as shon in Cigure 4&There are no re(uirements on
the $uty cycle of the e1ternal cloc! signal' since the in#ut to the internal cloc!ing circuitry
is through a $i)i$e3"y3to fli#3flo#' "ut minimum an$ ma1imum )oltage high an$ lo
time s#ecifications must "e o"ser)e$&
Ide Mode
In i$le mo$e' the C*U #uts itself to slee# hile all the on chi# #eri#herals
remain acti)e& The mo$e is in)o!e$ "y softare& The content of the on3chi#
RAM an$ all the s#ecial functions registers remain unchange$ $uring this
mo$e& The i$le mo$e can "e terminate$ "y any ena"le$ interru#t or "y a
har$are reset&
Note that hen i$le mo$e is terminate$ "y a har$are reset' the $e)ice
normally resumes #rogram e1ecution from here it left off' u# to to
machine cycles "efore the internal reset algorithm ta!es control& On3chi#
har$are inhi"its access to internal RAM in this e)ent' "ut access to the #ort
#ins is not inhi"ite$& To eliminate the #ossi"ility of an une1#ecte$ rite to a
#ort #in hen i$le mo$e is terminate$ "y a reset' the instruction folloing
the one that in)o!es i$le mo$e shoul$ not rite to a #ort #in or to e1ternal
memory&
Po'er-do'n Mode
In the #oer3$on mo$e' the oscillator is sto##e$' an$ the instruction that
in)o!es #oer3$on is the last instruction e1ecute$& The on3chi# RAM an$
S#ecial Cunction Registers retain their )alues until the #oer3$on mo$e is
terminate$& The only e1it from #oer3$on is a har$are reset& Reset
re$efines the SCR s "ut $oes not change the on3chi# RAM& The reset shoul$
not "e culti)ate$ "efore NCC is restore$ to its normal o#erating le)el an$
must "e hel$ acti)e long enough to allo the oscillator to restart an$
sta"ili0e&
AC Characteristics
Un$er o#erating con$itions' loa$ ca#acitance for *ort 9' ALEI*RO+' an$
*SEN Q 799 #CB loa$ ca#acitance for all other
out#uts Q 49 #C&
Note, 7& AC In#uts $uring testing are $ri)en at NCC 3 9&6N
for a logic 7 an$ 9&K6N for a logic 9& Timing measurements
are ma$e at NI- min& for a logic 7 an$ NIL ma1&
for a logic 9&
6oat >aBe/orms<7=
Note, 7& Cor timing #ur#oses' a #ort #in is no longer floating
hen a 799 mN change from loa$ )oltage occurs& A
#ort #in "egins to float hen a 799 mN change from
the loa$e$ NO-INOL le)el occurs&
Com#onent $escri#tion
Trans%ormers
A transformer is a $e)ice that transfers electrical energy from one circuit to
another "y magnetic cou#ling ithout re(uiring relati)e motion "eteen its
#arts& It usually com#rises to or more cou#le$ in$ings' an$' in most
cases' a core to concentrate magnetic flu1& A transformer o#erates from the
a##lication of an alternating )oltage to one in$ing' hich creates a time3
)arying magnetic flu1 in the core& This )arying flu1 in$uces a )oltage in the
other in$ings& Narying the relati)e num"er of turns "eteen #rimary an$
secon$ary in$ings $etermines the ratio of the in#ut an$ out#ut )oltages'
thus transforming the )oltage "y ste##ing it u# or $on "eteen circuits&
1%8%1Basic .rinci.e

The #rinci#les of the transformer are illustrate$ "y consi$eration of a
hy#othetical i$eal transformer consisting of to in$ings of 0ero resistance
aroun$ a core of negligi"le reluctance& A )oltage a##lie$ to the #rimary
in$ing causes a current' hich $e)elo#s a magnetomoti)e force <MMC= in
the core& The current re(uire$ to create the MMC is terme$ the magnetising
currentB in the i$eal transformer it is consi$ere$ to "e negligi"le& The MMC
$ri)es flu1 aroun$ the magnetic circuit of the core&
6igure 2%: 4he idea trans/ormer as a circuit eement
An electromoti)e force <EMC= is in$uce$ across each in$ing' an effect
!non as mutual in$uctance& The in$ings in the i$eal transformer ha)e no
resistance an$ so the EMCs are e(ual in magnitu$e to the measure$ terminal
)oltages& In accor$ance ith Cara$aySs la of in$uction' they are
#ro#ortional to the rate of change of flu1,
an$
0Auation <: 0M6 induced in .rimary and secondary 'indings
here,
an$ are the in$uce$ EMCs across #rimary an$ secon$ary in$ings'
an$ are the num"ers of turns in the #rimary an$ secon$ary in$ings'
an$ are the time $eri)ati)es of the flu1 lin!ing the #rimary an$
secon$ary in$ings&
In the i$eal transformer' all flu1 #ro$uce$ "y the #rimary in$ing also lin!s
the secon$ary' an$ so ' from hich the ell3!non transformer
e(uation follos,
0Auation ": 4rans/ormer 0Auation
The ratio of #rimary to secon$ary )oltage is therefore the same as the ratio
of the num"er of turnsB alternati)ely' that the )olts3#er3turn is the same in
"oth in$ings& The con$itions that $etermine Transformer or!ing in STE*
U* or STE* .O/N mo$e are,
Ns T N#
0Auation #: 2onditon /or S40P 3P
Ns U N#
0Auation 10: 2onditon /or S40P -5>(
*ecti/ier
A bridge recti/ier is an arrangement of four $io$es connecte$ in a "ri$ge
circuit as shon "elo' that #ro)i$es the same #olarity of out#ut )oltage for
any #olarity of the in#ut )oltage& /hen use$ in its most common
a##lication' for con)ersion of alternating current <AC= in#ut into $irect
current <.C= out#ut' it is !non as a "ri$ge rectifier& The "ri$ge rectifier
#ro)i$es full a)e rectification from a to ire AC in#ut <sa)ing the cost of
a center ta##e$ transformer= "ut has to $io$e $ro#s rather than one
re$ucing efficiency o)er a center ta# "ase$ $esign for the same out#ut
)oltage&
6igure #: Schematic o/ a bridge recti/ier
The essential feature of this arrangement is that for "oth #olarities of the
)oltage at the "ri$ge in#ut' the #olarity of the out#ut is constant&
2.2.1 Basic 5.eration
/hen the in#ut connecte$ at the left corner of the $iamon$ is #ositi)e ith
res#ect to the one connecte$ at the right han$ corner' current flos to the
right along the u##er colore$ #ath to the out#ut' an$ returns to the in#ut
su##ly )ia the loer one&
/hen the right han$ corner is #ositi)e relati)e to the left han$ corner'
current flos along the u##er colore$ #ath an$ returns to the su##ly )ia the
loer colore$ #ath&
m,o)#"n# /(!"u'( #+( /)*0( "2on( 'u,,2(' "n ou#,u#
3o2#"0( o. .<(* ,o2")#5 /u# ,u2'"#n0 m"0n#u*(%
Fi$ure 11" Bri#$e Recti%ier 2it0 smoot0en out&ut
T+( .un!#on o. #+' !","!#o)4 9no-n "' " L'moo#+n0
!","!#o)L ?'(( "2'o .2#() !","!#o)@ ' #o 2(''(n #+( 3")"#on
n ?o) L'moo#+L@ #+( )"- ou#,u# 3o2#"0( -"3(.o)m .)om #+(
/)*0(% On( (<,2"n"#on o. L'moo#+n0L ' #+"# #+( !","!#o)
,)o3*(' " 2o- m,(*"n!( ,"#+ #o #+( AC !om,on(n# o. #+(
ou#,u#4 )(*u!n0 #+( AC 3o2#"0( "!)o''4 "n* AC !u))(n#
#+)ou0+4 #+( )(''#3( 2o"*% In 2('' #(!+n!"2 #()m'4 "n5 *)o,
n #+( ou#,u# 3o2#"0( "n* !u))(n# o. #+( /)*0( #(n*' #o /(
!"n!(22(* /5 2o'' o. !+")0( n #+( !","!#o)% T+' !+")0(
.2o-' ou# "' "**#on"2 !u))(n# #+)ou0+ #+( 2o"*% T+u' #+(
!+"n0( o. 2o"* !u))(n# "n* 3o2#"0( ' )(*u!(* )(2"#3( #o
-+"# -ou2* o!!u) -#+ou# #+( !","!#o)% In!)("'(' o. 3o2#"0(
!o))(',on*n025 '#o)( (<!('' !+")0( n #+( !","!#o)4 #+u'
mo*()"#n0 #+( !+"n0( n ou#,u# 3o2#"0( 8 !u))(n#%
T+( !","!#o) "n* #+( 2o"* )(''#"n!( +"3( " #5,!"2 #m(
!on'#"n# M RC -+()( C "n* R ")( #+( !","!#"n!( "n* 2o"*
)(''#"n!( )(',(!#3(25% A' 2on0 "' #+( 2o"* )(''#o) ' 2")0(
(nou0+ 'o #+"# #+' #m( !on'#"n# ' mu!+ 2on0() #+"n #+(
#m( o. on( ),,2( !5!2(4 #+( "/o3( !on.0u)"#on -22 ,)o*u!(
" -(22 'moo#+(* DC 3o2#"0( "!)o'' #+( 2o"* )(''#"n!(% In
'om( *('0n'4 " '()(' )(''#o) "# #+( 2o"* '*( o. #+(
!","!#o) ' "**(*% T+( 'moo#+n0 !"n #+(n /( m,)o3(* /5
"**n0 "**#on"2 '#"0(' o. !","!#o)N)(''#o) ,")'4 o.#(n
*on( on25 .o) 'u/&'u,,2(' #o !)#!"2 +0+&0"n !)!u#' #+"#
#(n* #o /( '(n'#3( #o 'u,,25 3o2#"0( no'(%
4o'ta$e Re$u'ators
A vo'ta$e re$u'ator ' "n (2(!#)!"2 )(0u2"#o) *('0n(* #o
"u#om"#!"225 m"n#"n " !on'#"n# 3o2#"0( 2(3(2% I# m"5 u'(
"n (2(!#)om(!+"n!"2 m(!+"n'm4 o) ,"''3( o) "!#3(
(2(!#)on! !om,on(n#'% D(,(n*n0 on #+( *('0n4 # m"5 /(
u'(* #o )(0u2"#( on( o) mo)( AC o) DC 3o2#"0('% W#+ #+(
(<!(,#on o. '+un# )(0u2"#o)'4 "22 3o2#"0( )(0u2"#o)' o,()"#(
/5 !om,")n0 #+( "!#u"2 ou#,u# 3o2#"0( #o 'om( n#()n"2
.<(* )(.()(n!( 3o2#"0(% An5 *..()(n!( ' "m,2.(* "n* u'(*
#o !on#)o2 #+( )(0u2"#on (2(m(n#% T+' .o)m' " n(0"#3(
.((*/"!9 '()3o !on#)o2 2oo,% I. #+( ou#,u# 3o2#"0( ' #oo 2o-4
#+( )(0u2"#on (2(m(n# ' !omm"n*(* #o ,)o*u!( " +0+()
3o2#"0(% Fo) 'om( )(0u2"#o)' . #+( ou#,u# 3o2#"0( ' #oo
+0+4 #+( )(0u2"#on (2(m(n# ' !omm"n*(* #o ,)o*u!( "
2o-() 3o2#"0(O +o-(3()4 m"n5 Gu'# '#o, 'ou)!n0 !u))(n# "n*
*(,(n* on #+( !u))(n# *)"- o. -+"#(3() # ' *)3n0 #o ,u22
#+( 3o2#"0( /"!9 *o-n% In #+' -"54 #+( ou#,u# 3o2#"0( '
+(2* )ou0+25 !on'#"n#% T+( !on#)o2 2oo, mu'# /( !")(.u225
*('0n(* #o ,)o*u!( #+( *(')(* #)"*(o.. /(#-((n '#"/2#5
"n* ',((* o. )(',on'(%
23531 LM617 ,61Termina' A#8usta9'e Re$u'ator)
+escri&tion
T+( LM61; ' "n "*Gu'#"/2( #+)((&#()mn"2 ,o'#3(&3o2#"0(
)(0u2"#o) !","/2( o. 'u,,25n0 mo)( #+"n 1%5 A o3() "n
ou#,u#&3o2#"0( )"n0( o. 1%1 $ #o 6; $% I# ' (<!(,#on"225 ("'5
#o u'( "n* )(>u)(' on25 #-o (<#()n"2 )(''#o)' #o '(# #+(
ou#,u# 3o2#"0(% Fu)#+()mo)(4 /o#+ 2n( "n* 2o"* )(0u2"#on
")( /(##() #+"n '#"n*")* .<(*
)(0u2"#o)'% T+( LM61; ' ,"!9"0(* n #+( KC ?TO&117AB@ "n*
KTE ,"!9"0('4 -+!+ ")( ("'5 #o +"n*2( "n* u'(% In "**#on
#o +"3n0 +0+() ,().o)m"n!( #+"n .<(* )(0u2"#o)'4 #+'
*(3!( n!2u*(' on&!+, !u))(n# 2m#n04 #+()m"2 o3()2o"*
,)o#(!#on4 "n* '".(&o,()"#n0&")(" ,)o#(!#on% A22 o3()2o"*
,)o#(!#on )(m"n' .u225 .un!#on"24 (3(n . #+( ADJUST
#()mn"2 ' *'!onn(!#(*%
Fi$ure 1:J TOP IC vie2 o% LM 617
T+( LM61; ' 3()'"#2( n #' ",,2!"#on'4 n!2u*n0 u'(' n
,)o0)"mm"/2( ou#,u# )(0u2"#on "n* 2o!"2 on&!")*
)(0u2"#on% O)4 /5 !onn(!#n0 " .<(* )(''#o) /(#-((n #+(
ADJUST "n* OUTPUT #()mn"2'4 #+( LM61; !"n .un!#on "' "
,)(!'on !u))(n# )(0u2"#o)% An o,#on"2 ou#,u# !","!#o) !"n
/( "**(* #o m,)o3( #)"n'(n# )(',on'(% T+( ADJUST
#()mn"2 !"n /( /5,"''(* #o "!+(3( 3()5 +0+ ),,2(&
)(G(!#on )"#o'4 -+!+ ")( *..!u2# #o "!+(3( -#+ '#"n*")*
#+)((&#()mn"2 )(0u2"#o)'% T+( LM61; ' !+")"!#()C(* .o)
o,()"#on o3() #+(
3)#u"2 Gun!#on #(m,()"#u)( )"n0( o. 7PC #o 115PC%
Fi$ure 17" A#8usta9'e 4o'ta$e Re$u'ator
23532 LM7;.) ,61Termina' Fi<e# 4o'ta$e Re$u'ator)
T+( MC;8QQ8LM;8QQ8MC;8QQA '()(' o. #+)(( #()mn"2
,o'#3( )(0u2"#o)' ")( "3"2"/2( n #+(
TO&1178D&PAK ,"!9"0( "n* -#+ '(3()"2 .<(* ou#,u#
3o2#"0('4 m"9n0 #+(m u'(.u2 n " -*( )"n0( o.
",,2!"#on'% E"!+ #5,( (m,2o5' n#()n"2 !u))(n# 2m#n04
#+()m"2 '+u# *o-n "n* '".( o,()"#n0 ")(" ,)o#(!#on4
m"9n0 # (''(n#"225 n*('#)u!#/2(% I. "*(>u"#( +("# 'n9n0
' ,)o3*(*4 #+(5 !"n *(23() o3() 1A ou#,u# !u))(n#%
A2#+ou0+ *('0n(* ,)m")25 "' .<(* 3o2#"0( )(0u2"#o)'4
#+('( *(3!(' !"n /( u'(* -#+ (<#()n"2 !om,on(n#' #o
o/#"n "*Gu'#"/2( 3o2#"0(' "n* !u))(n#'%
Fi$ure 1;" Interna' 9'oc= +ia$ram
Fi$ure 1> " Fi<e# Out&ut Re$u'ator
Features
R Ou#,u# Cu))(n# u, #o 1A
R Ou#,u# $o2#"0(' o. 54 =4 84 94 174 114 154 184 1:$
R T+()m"2 O3()2o"* P)o#(!#on
R S+o)# C)!u# P)o#(!#on
R Ou#,u# T)"n''#o) S".( O,()"#n0 A)(" P)o#(!#on
Li?ui# cr*sta' #is&'a*,LC+)
A li(ui$ crystal $is#lay <commonly a""re)iate$ LC.= is a thin' .2"# $is#lay
$e)ice ma$e u# of any num"er of color or monochrome #i1els arraye$ in
front of a light source or reflector& It is #ri0e$ "y engineers "ecause it uses
)ery small amounts of electric #oer' an$ is therefore suita"le for use in
"attery3#oere$ electronic $e)ices& Each #i1el of an LC. consists of a layer
of #er#en$icular molecules aligne$ "eteen to trans#arent electro$es' an$
to #olari0ing filters' the a1es of #olarity of hich are #er#en$icular to each
other& /ith no li(ui$ crystal "eteen the #olari0ing filters' light #assing
through one filter oul$ "e "loc!e$ "y the electro$es& The surfaces of the
electro$es that are in contact ith the li(ui$ crystal material are treate$ so as
to align the li(ui$ crystal molecules in a #articular $irection& This treatment
ty#ically consists of a thin #olymer layer that is uni$irectionally ru""e$
using a cloth <the $irection of the li(ui$ crystal alignment is $efine$ "y the
$irection of ru""ing=& Before a##lying an electric fiel$' the orientation of the
li(ui$ crystal molecules is $etermine$ "y the alignment at the surfaces& In a
tiste$ nematic $e)ice <the most common li(ui$ crystal $e)ice=' the surface
alignment $irections at the to electro$es are #er#en$icular' an$ so the
molecules arrange themsel)es in a helical structure' or tist& Because the
li(ui$ crystal material is "irefringent' light #assing through one #olari0ing
filter is rotate$ "y the li(ui$ crystal heli1 as it #asses through the li(ui$
crystal layer' alloing it to #ass through the secon$ #olari0e$ filter& -alf of
the light is a"sor"e$ "y the first #olari0ing filter' "ut otherise the entire
assem"ly is trans#arent& /hen a )oltage is a##lie$ across the electro$es' a
tor(ue acts to align the li(ui$ crystal molecules #arallel to the electric fiel$'
$istorting the helical structure <this is resiste$ "y elastic forces since the
molecules are constraine$ at the surfaces=& This re$uces the rotation of the
#olari0ation of the inci$ent light' an$ the $e)ice a##ears gray& If the a##lie$
)oltage is large enough' the li(ui$ crystal molecules are com#letely
untiste$ an$ the #olari0ation of the inci$ent light is not rotate$ at all as it
#asses through the li(ui$ crystal layer& This light ill then "e #olari0e$
#er#en$icular to the secon$ filter' an$ thus "e com#letely "loc!e$ an$ the
#i1el ill a##ear "lac!& By controlling the )oltage a##lie$ across the li(ui$
crystal layer in each #i1el' light can "e alloe$ to #ass through in )arying
amounts' corres#on$ingly illuminating the #i1el& /ith a tiste$ nematic
li(ui$ crystal $e)ice it is usual to o#erate the $e)ice "eteen crosse$
#olari0ers' such that it a##ears "right ith no a##lie$ )oltage& /ith this
setu#' the $ar! )oltage3on state is uniform& The $e)ice can "e o#erate$
"eteen #arallel #olari0ers' in hich case the "right an$ $ar! states are
re)erse$&
Both the li(ui$ crystal material an$ the alignment layer material contain
ionic com#oun$s& If an electric fiel$ of one #articular #olarity is a##lie$ for
a long #erio$ of time' this ionic material is attracte$ to the surfaces an$
$egra$es the $e)ice #erformance& This is a)oi$e$ "y a##lying either an
alternating current' or "y re)ersing the #olarity of the electric fiel$ as the
$e)ice is a$$resse$ <the res#onse of the li(ui$ crystal layer is i$entical'
regar$less of the #olarity of the a##lie$ fiel$=& /hen a large num"er of
#i1els is re(uire$ in a $is#lay' it is not feasi"le to $ri)e each $irectly since
then each #i1el oul$ re(uire in$e#en$ent electro$es& Instea$' the $is#lay is
multiplexed. In a multi#le1e$ $is#lay' electro$es on one si$e of the $is#lay
are grou#e$ an$ ire$ together <ty#ically in columns=' an$ each grou# gets
its on )oltage source& On the other si$e' the electro$es are also grou#e$
<ty#ically in ros=' ith each grou# getting a )oltage sin!& The grou#s are
$esigne$ so each #i1el has a uni(ue' unshare$ com"ination of source an$
sin!& The electronics or the softare $ri)ing the electronics then turns on
sin!s in se(uence' an$ $ri)es sources for the #i1els of each sin!&
6igure 20:82- Pictoria Gie'
2.).1 82- Standards
Cre(uently' an 4967 #rogram must interact ith the outsi$e orl$ using
in#ut an$ out#ut $e)ices that communicate $irectly ith a human "eing& One
of the most common $e)ices attache$ to an 4967 is an LC. $is#lay& Some
of the most common LC.s connecte$ to the 4967 are 7@1J an$ J91J
$is#lays& This means 7@ characters #er line "y J lines an$ J9 characters #er
line "y J lines' res#ecti)ely& Cortunately' a )ery #o#ular stan$ar$ e1ists
hich allos us to communicate ith the )ast ma%ority of LC.s regar$less
of their manufacturer& The stan$ar$ is referre$ to as -.KK849U' hich
refers to the controller chi# hich recei)es $ata from an e1ternal source <in
this case' the 4967= an$ communicates $irectly ith the LC.&
2.).2 ++<"0 Standard
The KK849 stan$ar$ re(uires E control lines as ell as either K or 4 IIO lines
for the $ata "us& The user may select hether the LC. is to o#erate ith a K3
"it $ata "us or an 43"it $ata "us& If a K3"it $ata "us is use$ the LC. ill
re(uire a total of 8 $ata lines <E control lines #lus the K lines for the $ata
"us=& If an 43"it $ata "us is use$ the LC. ill re(uire a total of 77 $ata lines
<E control lines #lus the 4 lines for the $ata "us=&
The three control lines are referre$ to as 0(' *S' an$ *>&
The 0( line is calle$ ?Ena"le&? This control line is use$ to tell the LC. that
you are sen$ing it $ata& To sen$ $ata to the LC.' your #rogram shoul$ ma!e
sure this line is lo <9= an$ then set the other to control lines an$Ior #ut
$ata on the $ata "us& /hen the other lines are com#letely rea$y' "ring 0(
high <7= an$ ait for the minimum amount of time re(uire$ "y the LC.
$atasheet <this )aries from LC. to LC.=' an$ en$ "y "ringing it lo <9=
again&
The *S line is the ?Register Select? line& /hen RS is lo <9=' the $ata is to
"e treate$ as a comman$ or s#ecial instruction <such as clear screen' #osition
cursor' etc&=& /hen RS is high <7=' the $ata "eing sent is te1t $ata hich
soul$ "e $is#laye$ on the screen& Cor e1am#le' to $is#lay the letter ?T? on
the screen you oul$ set RS high&
The *> line is the ?Rea$I/rite? control line& /hen R/ is lo <9=' the
information on the $ata "us is "eing ritten to the LC.& /hen R/ is high
<7=' the #rogram is effecti)ely (uerying <or rea$ing= the LC.& Only one
instruction <?+et LC. status?= is a rea$ comman$& All others are rite
comman$s33so R/ ill almost alays "e lo&Cinally' the $ata "us consists
of K or 4 lines <$e#en$ing on the mo$e of o#eration selecte$ "y the user=& In
the case of an 43"it $ata "us' the lines are referre$ to as .B9' .B7' .BJ'
.BE' .BK' .B6' .B@' an$ .B8&
2.).$ An 0Dam.e 7ard'are 2on/iguration
As eS)e mentione$' the LC. re(uires either 4 or 77 IIO lines to
communicate ith& Cor the sa!e of this tutorial' e are going to use an 43"it
$ata "us33so eSll "e using 77 of the 4967Ss IIO #ins to interface ith the
LC.&A sam#le #sue$o3schematic of ho the LC. ill "e connecte$ to the
4967&
6igure 21: Schematic 5/ 82- inter/acing 'ith microcontroer
As you can see' eS)e esta"lishe$ a 73to37 relation "eteen a #in on the
4967 an$ a line on the KK849 LC.& Thus as e rite our assem"ly #rogram
to access the LC.' e are going to e(uate constants to the 4967 #orts so that
e can refer to the lines "y their KK849 name as o##ose$ to *9&7' *9&J' etc&
LetSs go ahea$ an$ rite our initial e(uates,
-B0 0I3 P1.0
-B1 0I3 P1.1
-B2 0I3 P1.2
-B$ 0I3 P1.$
-B+ 0I3 P1.+
-B) 0I3 P1.)
-B% 0I3 P1.%
-B< 0I3 P1.<
0( 0I3 P$.<
*S 0I3 P$.%
*> 0I3 P$.)
-A4A 0I3 P1
-a)ing esta"lishe$ the a"o)e e(uates' e may no refer to our IIO lines "y
their KK849 name& Cor e1am#le' to set the R/ line high <7=' e can e1ecute
the folloing insutrction,
S04B *>
2.).+ 7anding the 0( 2ontro 8ine
As e mentione$ a"o)e' the EN line is use$ to tell the LC. that you are
rea$y for it to e1ecute an instruction that youS)e #re#are$ on the $ata "us an$
on the other control lines& Note that the EN line must "e raise$Iloere$
"eforeIafter each instruction sent to the LC. regar$less of hether that
instruction is rea$ or rite' te1t or instruction& In short' you must alays
mani#ulate EN hen communicating ith the LC.& EN is the LC.Ss ay of
!noing that you are tal!ing to it& If you $onSt raiseIloer EN' the LC.
$oesnSt !no youSre tal!ing to it on the other lines&
Thus' "efore e interact in any ay ith the LC. e ill alays "ring the
0( line lo ith the folloing instruction,
28* 0(
An$ once eS)e finishe$ setting u# our instruction ith the other control
lines an$ $ata "us lines' eSll alays "ring this line high,
S04B 0(
The line must "e left high for the amount of time re(uire$ "y the LC. as
s#ecifie$ in its $atasheet& This is normally on the or$er of a"out J69
nanosecon$s' "ut chec! the $atasheet& In the case of a ty#ical 4967 running
at 7J M-0' an instruction re(uires 7&94 microsecon$s to e1ecute so the EN
line can "e "rought lo the )ery ne1t instruction& -oe)er' faster
microcontrollers <such as the .S45CKJ9 hich e1ecutes an instruction in 59
nanosecon$s gi)en an 77&965J Mh0 crystal= ill re(uire a num"er of NO*s
to create a $elay hile EN is hel$ high& The num"er of NO*s that must "e
inserte$ $e#en$s on the microcontroller you are using an$ the crystal you
ha)e selecte$& The instruction is e1ecute$ "y the LC. at the moment the EN
line is "rought lo ith a final CLR EN instruction&
Programming 4i.: The LC. inter#rets an$ e1ecutes our comman$ at the
instant the 0( line is "rought lo& If you ne)er "ring 0( lo' your
instruction ill ne)er "e e1ecute$& A$$itionally' hen you "ring 0( lo
an$ the LC. e1ecutes your instruction' it re(uires a certain amount of time
to e1ecute the comman$& The time it re(uires to e1ecute an instruction
$e#en$s on the instruction an$ the s#ee$ of the crystal hich is attache$ to
the KK849Ss oscillator in#ut&
2.).) 2hecking the Busy Status o/ the 82-
As #re)iously mentione$' it ta!es a certain amount of time for each
instruction to "e e1ecute$ "y the LC.& The $elay )aries $e#en$ing on the
fre(uency of the crystal attache$ to the oscillator in#ut of the KK849 as ell
as the instruction hich is "eing e1ecute$& /hile it is #ossi"le to rite co$e
that aits for a s#ecific amount of time to allo the LC. to e1ecute
instructions' this metho$ of ?aiting? is not )ery fle1i"le& If the crystal
fre(uency is change$' the softare ill nee$ to "e mo$ifie$& A$$itionally' if
the LC. itself is change$ for another LC. hich' although KK849
com#ati"le' re(uires more time to #erform its o#erations' the #rogram ill
not or! until it is #ro#erly mo$ifie$& A more ro"ust metho$ of
#rogramming is to use the ?+et LC. Status? comman$ to $etermine hether
the LC. is still "usy e1ecuting the last instruction recei)e$&
The ?+et LC. Status? comman$ ill return to us to ti$"its of informationB
the information that is useful to us right no is foun$ in .B8& In summary'
hen e issue the ?+et LC. Status? comman$ the LC. ill imme$iately
raise .B8 if itSs still "usy e1ecuting a comman$ or loer .B8 to in$icate
that the LC. is no longer occu#ie$& Thus our #rogram can (uery the LC.
until .B8 goes lo' in$icating the LC. is no longer "usy& At that #oint e
are free to continue an$ sen$ the ne1t comman$&
Since e ill use this co$e e)ery time e sen$ an instruction to the LC.' it
is useful to ma!e it a su"routine&
LetSs rite the co$e,
>AI4J82-:
28* 0( B Start LC. comman$
28* *S B ItSs a comman$
S04B *> B ItSs a rea$ comman$
M5G -A4A;K066h B Set all #ins to CC initially
S04B 0( B Cloc! out comman$ to LC.
M5G A;-A4A B Rea$ the return )alue
,B A22.<;>AI4J82- B If "it 8 high' LC. still "usy
28* 0( B Cinish the comman$
28* *> B Turn off R/ for future comman$s
*04
Thus' our stan$ar$ #ractice ill "e to sen$ an instruction to the LC. an$
then call our >AI4J82- routine to ait until the instruction is com#letely
e1ecute$ "y the LC.& This ill assure that our #rogram gi)es the LC. the
time it nee$s to e1ecute instructions an$ also ma!es our #rogram com#ati"le
ith any LC.' regar$less of ho fast or slo it is&
Programming 4i.: The a"o)e routine $oes the %o" of aiting for the LC.'
"ut ere it to "e use$ in a real a##lication a )ery $efinite im#ro)ement
oul$ nee$ to "e ma$e, as ritten' if the LC. ne)er "ecomes ?not "usy? the
#rogram ill effecti)ely ?hang'? aiting for .B8 to go lo& If this ne)er
ha##ens' the #rogram ill free0e& Of course' this shoul$ ne)er ha##en an$
'onLt ha##en hen the har$are is or!ing #ro#erly& But in a real
a##lication it oul$ "e ise to #ut some !in$ of time limit on the $elay33for
e1am#le' a ma1imum of J6@ attem#ts to ait for the "usy signal to go lo&
This oul$ guarantee that e)en if the LC. har$are fails' the #rogram
oul$ not loc! u#&
2.).% InitiaiEing the 82-
Before you may really use the LC.' you must initiali0e an$ configure it&
This is accom#lishe$ "y sen$ing a num"er of initiali0ation instructions to the
LC.& The first instruction e sen$ must tell the LC. hether eSll "e
communicating ith it ith an 43"it or K3"it $ata "us& /e also select a 614
$ot character font& These to o#tions are selecte$ "y sen$ing the comman$
E4h to the LC. as a comman$& As you ill recall from the last section' e
mentione$ that the *S line must "e lo if e are sen$ing a comman$ to the
LC.& Thus' to sen$ this E4h comman$ to the LC. e must e1ecute the
folloing 4967 instructions,
28* *S
M5G -A4A; K$"h
S04B 0(
28* 0(
82A88 >AI4J82-
Programming 4i.: The LC. comman$ E4h is really the sum of a num"er
of o#tion "its& The instruction itself is the instruction J9h <?Cunction set?=&
-oe)er' to this e a$$ the )alues 79h to in$icate an 43"it $ata "us #lus 94h
to in$icate that the $is#lay is a to3line $is#lay&
/eS)e no sent the first "yte of the initiali0ation se(uence& The secon$ "yte
of the initiali0ation se(uence is the instruction 9Eh& Thus e must re#eat the
initiali0ation co$e from a"o)e' "ut no ith the instruction&
Thus the the ne1t co$e segment is,
28* *S
M5G -A4A; K00h
S04B 0(
28* 0(
82A88 >AI4J82-
Programming 4i.: The comman$ 9Eh is really the instruction 94h #lus 9Kh
to turn the LC. on& To that an a$$itional 9Jh is a$$e$ in or$er to turn the
cursor on&
The last "yte e nee$ to sen$ is use$ to configure a$$itional o#erational
#arameters of the LC.& /e must sen$ the )alue 9@h&
28* *S
M5G -A4A; K0%h
S04B 0(
28* 0(
82A88 >AI4J82-
Programming 4i.: The comman$ 9@h is really the instruction 9Kh #lus 9Jh
to configure the LC. such that e)ery time e sen$ it a character' the cursor
#osition automatically mo)es to the right&
So' in all' our initiali0ation co$e is as follos,
I(I4J82-:
28* *S
M5G -A4A; K$"h
S04B 0(
28* 0(
82A88 >AI4J82-
28* *S
M5G -A4A; K00h
S04B 0(
28* 0(
82A88 >AI4J82-
28* *S
M5G -A4A; K0%h
S04B 0(
28* 0(
82A88 >AI4J82-
*04
-a)ing e1ecute$ this co$e the LC. ill "e fully initiali0e$ an$ rea$y for us
to sen$ $is#lay $ata to it&
2.).< 2earing the -is.ay
/hen the LC. is first initiali0e$' the screen shoul$ automatically "e cleare$
"y the KK849 controller& -oe)er' itSs alays a goo$ i$ea to $o things
yourself so that you can "e com#letely sure that the $is#lay is the ay you
ant it& Thus' itSs not a "a$ i$ea to clear the screen as the )ery first o#reation
after the LC. has "een initialie0$&
An LC. comman$ e1ists to accom#lish this function& Not su#risingly' it is
the comman$ 97h& Since clearing the screen is a function e )ery li!ely ill
ish to call more than once' itSs a goo$ i$ea to ma!e it a su"routine,
280A*J82-:
28* *S
M5G -A4A; K01h
S04B 0(
28* 0(
82A88 >AI4J82-
*04
-o that eS)e ritten a ?Clear Screen? routine' e may clear the LC. at
any time "y sim#ly e1ecuting an 82A88 280A*J82-&
Programming 4i.: E1ecuting the ?Clear Screen? instruction on the LC.
also #ositions the cursor in the u##er left3han$ corner as e oul$ e1#ect&
2.)." >riting 4eDt to the 82-
No e get to the real meat of hat eSre trying to $o, All this effort is
really so e can $is#lay te1t on the LC.& Really' eSre #retty much $one&
Once again' riting te1t to the LC. is something eSll almost certainly ant
to $o o)er an$ o)er33so letSs ma!e it a su"routine&
>*I40J40H4:
S04B *S
M5G -A4A; A
S04B 0(
28* 0(
82A88 >AI4J82-
*04
The >*I40J40H4 routine that e %ust rote ill sen$ the character in the
accumulator to the LC. hich ill' in turn' $is#lay it& Thus to $is#lay te1t
on the LC. all e nee$ to $o is loa$ the accumulator ith the "yte to
$is#lay an$ ma!e a call to this routine& *retty easy' huhV
2.).# A Program: M70885 >5*8-M
No that e ha)e all the com#onent su"routines ritten' riting the classic
?-ello /orl$? #rogram33hich $is#lays the te1t ?-ello /orl$? on the LC.
is a relati)ely tri)ial matter& Consi$er,
82A88 I(I4J82-
82A88 280A*J82-
M5G A;KL7L
82A88 >*I40J40H4
M5G A;KL0L
82A88 >*I40J40H4
M5G A;KL8L
82A88 >*I40J40H4
M5G A;KL8L
82A88 >*I40J40H4
M5G A;KL5L
82A88 >*I40J40H4
M5G A;KL L
82A88 >*I40J40H4
M5G A;KL>L
82A88 >*I40J40H4
M5G A;KL5L
82A88 >*I40J40H4
M5G A;KL*L
82A88 >*I40J40H4
M5G A;KL8L
82A88 >*I40J40H4
M5G A;KL-L
82A88 >*I40J40H4
The a"o)e ?-ello /orl$? #rogram shoul$' hen e1ecute$' initiali0e the
LC.' clear the LC. screen' an$ $is#lay ?-ello /orl$? in the u##er left3
han$ corner of the $is#lay&
2.).10 2ursor Positioning
The a"o)e ?-ello /orl$? #rogram is sim#listic in the sense that it #rints its
te1t in the u##er left3han$ corner of the screen& -oe)er' hat if e ante$
to $is#lay the or$ ?-ello? in the u##er left3han$ corner "ut ante$ to
$is#lay the or$ ?/orl$? on the secon$ line at the tenth characterV This
soun$s sim#le33an$ actually' it is sim#le& -oe)er' it re(uires a little more
un$erstan$ing of the $esign of the LC.&
The KK849 contains a certain amount of memory hich is assigne$ to the
$is#lay& All the te1t e rite to the KK849 is store$ in this memory' an$ the
KK849 su"se(uently rea$s this memory to $is#lay the te1t on the LC. itself&
This memory can "e re#resente$ ith the folloing ?memory ma#?,
6igure 22: Memory Ma..ing in 82-
In the a"o)e memory ma#' the area sha$e$ in "lue is the )isi"le $is#lay& As
you can see' it measures 7@ characters #er line "y J lines& The num"ers in
each "o1 is the memory a$$ress that corres#on$s to that screen #osition&
Thus' the first character in the u##er left3han$ corner is at a$$ress 99h& The
folloing character #osition <character PJ on the first line= is a$$ress 97h'
etc& This continues until e reach the 7@th character of the first line hich is
at a$$ress 9Ch& -oe)er' the first character of line J' as shon in the
memory ma#' is at a$$ress K9h& This means if e rite a character to the last
#osition of the first line an$ then rite a secon$ character' the secon$
character ill not a##ear on the secon$ line& That is "ecause the secon$
character ill effecti)ely "e ritten to a$$ress 79h33"ut the secon$ line
"egins at a$$ress K9h& Thus e nee$ to sen$ a comman$ to the LC. that
tells it to #osition the cursor on the secon$ line& The ?Set Cursor *osition?
instruction is 49h& To this e must a$$ the a$$ress of the location here e
ish to #osition the cursor& In our e1am#le' e sai$ e ante$ to $is#lay
?/orl$? on the secon$ line on the tenth character #osition& Referring again
to the memory ma#' e see that the tenth character #osition of the secon$
line is a$$ress KAh& Thus' "efore riting the or$ ?/orl$? to the LC.' e
must sen$ a ?Set Cursor *osition? instruction33the )alue of this comman$
ill "e 49h <the instruction co$e to #osition the cursor= #lus the a$$ress
KAh& 49h W KAh Q CAh& Thus sen$ing the comman$ CAh to the LC. ill
#osition the cursor on the secon$ line at the tenth character #osition,
28* *S
M5G -A4A;K02Ah
S04B 0(
28* 0(
82A88 >AI4J82-
The a"o)e co$e ill #osition the cursor on line J' character 79& To $is#lay
?-ello? in the u##er left3han$ corner ith the or$ ?/orl$? on the secon$
line at character #osition 79 %ust re(uires us to insert the a"o)e co$e into our
e1isting ?-ello /orl$? #rogram&
This results in the folloing,
82A88 I(I4J82-
82A88 280A*J82-
M5G A;KL7L
82A88 >*I40J40H4
M5G A;KL0L
82A88 >*I40J40H4
M5G A;KL8L
82A88 >*I40J40H4
M5G A;KL8L
82A88 >*I40J40H4
M5G A;KL5L
82A88 >*I40J40H4
28* *S
M5G -A4A;K02Ah
S04B 0(
28* 0(
82A88 >AI4J82-
M5G A;KL>L
82A88 >*I40J40H4
M5G A;KL5L
82A88 >*I40J40H4
M5G A;KL*L
82A88 >*I40J40H4
M5G A;KL8L
82A88 >*I40J40H4
M5G A;KL-L
82A88 >*I40J40H4

*08A:S
Circuit sym"ol for a relay
Relays
*hotogra#hs X Ra#i$ Electronics
A relay is an electrically o#erate$ sitch& Current floing through the coil
of the relay creates a magnetic fiel$' hich attracts a le)er an$ changes the
sitch contacts& The coil current can "e on or off so relays ha)e to sitch
#ositions an$ they are $ou"le thro <changeo)er= sitches&
Relays allo one circuit to sitch a secon$ circuit that can "e com#letely
se#arate from the first& Cor e1am#le a lo )oltage "attery circuit can use a
relay to sitch a JE9N AC mains circuit& There is no electrical connection
insi$e the relay "eteen the to circuits' the lin! is magnetic an$
mechanical&
The coil of a relay #asses a relati)ely large current' ty#ically E9mA for a
7JN relay' "ut it can "e as much as 799mA for relays $esigne$ to o#erate
from loer )oltages& Most ICs <chi#s= cannot #ro)i$e this current an$ a
transistor is usually use$ to am#lify the small IC current to the larger )alue
re(uire$ for the relay coil& The ma1imum out#ut current for the #o#ular 666
timer IC is J99mA so these $e)ices can su##ly relay coils $irectly ithout
am#lification&
Relays are usually S*.T or .*.T "ut they can ha)e many more sets
of sitch contacts' for e1am#le relays ith K sets of changeo)er contacts are
rea$ily a)aila"le& Cor further information a"out sitch contacts an$ the
terms use$ to $escri"e them #lease see the #age on sitches&
Most relays are $esigne$ for *CB mounting "ut you can sol$er ires
$irectly to the #ins #ro)i$ing you ta!e care to a)oi$ melting the #lastic case
of the relay&
The su##lierSs catalogue shoul$ sho you the relaySs connections& The coil
ill "e o")ious an$ it may "e connecte$ either ay roun$& Relay coils
#ro$uce "rief high )oltage Ss#i!esS hen they are sitche$ off an$ this can
$estroy transistors an$ ICs in the circuit& To #re)ent $amage you must
connect a #rotection $io$e across the relay coil&
The animate$ #icture shos a or!ing relay ith its coil an$ sitch
contacts& ;ou can see a le)er on the left "eing attracte$ "y magnetism hen
the coil is sitche$ on& This le)er mo)es the sitch contacts& There is one
set of contacts <S*.T= in the foregroun$ an$ another "ehin$ them' ma!ing
the relay .*.T&
The relaySs sitch connections are usually la"ele$ COM' NC an$ NO,
COM Q Common' alays connect to this' it is the mo)ing #art of the
sitch&
NC Q Normally Close$' COM is connecte$ to this hen the relay coil
is off&
NO Q Normally O#en' COM is connecte$ to this hen the relay coil is
on&
Connect to COM an$ NO if you ant the sitche$ circuit to "e on
hen the relay coil is on&
Connect to COM an$ NC if you ant the sitche$ circuit to "e on
hen the relay coil is off&
2hoosing a reay
;ou nee$ to consi$er se)eral features hen choosing a relay,
1% Physica siEe and .in arrangement
If you are choosing a relay for an e1isting *CB you ill nee$ to
ensure that its $imensions an$ #in arrangement are suita"le& ;ou
shoul$ fin$ this information in the su##lierSs catalogue&
1% 2oi Botage
The relaySs coil )oltage rating an$ resistance must suit the circuit
#oering the relay coil& Many relays ha)e a coil rate$ for a 7JN
su##ly "ut 6N an$ JKN relays are also rea$ily a)aila"le& Some relays
o#erate #erfectly ell ith a su##ly )oltage hich is a little loer
than their rate$ )alue&
6% 2oi resistance
The circuit must "e a"le to su##ly the current re(uire$ "y the relay
coil& ;ou can use OhmSs la to calculate the current,
Relay coil current Q
Su##ly )oltage
Coil resistance
6or eDam.e, A 7JN su##ly relay ith a coil resistance of K99 #asses a
current of E9mA& This is OH for a 666 timer IC <ma1imum out#ut current
J99mA=' "ut it is too much for most ICs an$ they ill re(uire a transistor to
am#lify the current&

:% S'itch ratings !Botage and current&
The relaySs sitch contacts must "e suita"le for the circuit they are to
control& ;ou ill nee$ to chec! the )oltage an$ current ratings& Note
that the )oltage rating is usually higher for AC' for e1am#le, ?6A at
JKN .C or 7J6N AC?&
5% S'itch contact arrangement !SP-4; -P-4 etc&
Most relays are S*.T or .*.T hich are often $escri"e$ as ?single
#ole changeo)er? <S*CO= or ?$ou"le #ole changeo)er? <.*CO=&
25MPA*IS5( B04>00( 4*A(SIS45*S 1 *08A:S
AdBantages o/ reays:
Relays can sitch AC an$ .C' transistors can only sitch .C&
Relays can sitch high )oltages' transistors cannot&
Relays are a "etter choice for sitching large currents <T 6A=&
Relays can sitch many contacts at once&

-isadBantages o/ reays:
Relays are "ul!ier than transistors for sitching small currents&
Relays cannot sitch ra#i$ly <e1ce#t ree$ relays=' transistors can
sitch many times #er secon$&
Relays use more #oer $ue to the current floing through their coil&
Relays re(uire more current than many chi#s can #ro)i$e' so a lo #oer
transistor may "e nee$e$ to sitch the current for the relaySs coil&
Crystal Oscillator
It is often re(uire$ to #ro$uce a signal hose fre(uency or #ulse rate is )ery
sta"le an$ e1actly !non& This is im#ortant in any a##lication here
anything to $o ith time or e1act measurement is
crucial& It is relati)ely sim#le to ma!e an oscillator that #ro$uces some sort
of a signal' "ut another matter to #ro$uce one of relati)ely #recise fre(uency
an$ sta"ility& AM ra$io stations must ha)e a carrier fre(uency accurate
ithin 79-0 of its assigne$ fre(uency' hich may "e from 6E9 to 7879 !-0&
SSB ra$io systems use$ in the -C range <J3E9 M-0= must "e ithin 69 -0
of channel fre(uency for acce#ta"le )oice (uality' an$ ithin 79 -0 for "est
results& Some $igital mo$es use$ in ea! signal communication may re(uire
fre(uency sta"ility of less than 7 -0 ithin a #erio$ of se)eral minutes& The
carrier fre(uency must "e !non to fractions of a hert0 in some cases& An
or$inary (uart0 atch must ha)e an oscillator accurate to "etter than a fe
#arts #er million& One #art #er million ill result in an error of slightly less
than one half secon$ a $ay' hich oul$ "e a"out E minutes a year& This
might not soun$ li!e much' "ut an error of 79 #arts #er million oul$ result
in an error of a"out a half an hour #er year& A cloc! such as this oul$ nee$
resetting a"out once a month' an$ more often if you are the #unctual ty#e& A
#rogramme$ NCR ith a cloc! this far off coul$ miss the recor$ing of #art
of a TN sho& Narro "an$ SSB communications at N-C an$ U-C
fre(uencies still nee$ 69 -0 fre(uency accuracy& At KK9 M-0' this is
slightly more than 9&7 #art #er million&
Or$inary L3C oscillators using con)entional in$uctors an$ ca#acitors can
achie)e ty#ically 9&97 to 9&7 #ercent fre(uency sta"ility' a"out 799 to 7999
-0 at 7 M-0& This is OH for AM an$ CM "roa$cast recei)er a##lications
an$ in other lo3en$ analog recei)ers not re(uiring high tuning accuracy& By
careful $esign an$ com#onent selection' an$ ith rugge$ mechanical
construction' &97 to 9&997R' or e)en "etter <&9996R= sta"ility can "e
achie)e$& The "etter figures ill un$ou"te$ly em#loy tem#erature
com#ensation com#onents an$ regulate$ #oer su##lies' together ith
en)ironmental control <goo$ )entilation an$ am"ient tem#erature regulation=
an$ Y"attleshi#Z mechanical construction& This has "een $one in some
communications recei)ers use$ "y the military an$ commercial -C
communication recei)ers "uilt in the 7569375@6 era' "efore the i$es#rea$
use of $igital fre(uency synthesis& But these recei)ers ere e1tremely
e1#ensi)e' large' an$ hea)y& Many mo$ern consumer gra$e AM' CM' an$
shorta)e recei)ers em#loying crystal controlle$ $igital fre(uency synthesis
ill $o as ell or "etter from a fre(uency sta"ility stan$#oint&
An oscillator is "asically an am#lifier an$ a fre(uency selecti)e fee$"ac!
netor! <Cig 7=& /hen' at a #articular fre(uency' the loo# gain is unity or
more' an$ the total #haseshift at this fre(uency is 0ero' or some multi#le of
E@9 $egrees' the con$ition for oscillation is satisfie$' an$ the circuit ill
#ro$uce a #erio$ic a)eform of this fre(uency& This is usually a sine a)e'
or s(uare a)e' "ut triangles' im#ulses' or other a)eforms can "e
#ro$uce$& In fact' se)eral $ifferent a)eforms often are simultaneously
#ro$uce$ "y the same circuit' at $ifferent #oints& It is also #ossi"le to ha)e
se)eral fre(uencies #ro$uce$ as ell' although this is generally un$esira"le&
CA*ACITOR
A ca.acitor or condenser is a #assi)e electronic com#onent consisting of a
#air of con$uctors se#arate$ "y a $ielectric <insulator=& /hen a #otential
$ifference <)oltage= e1ists across the con$uctors' an electric fiel$ is #resent
in the $ielectric& This fiel$ stores energy an$ #ro$uces a mechanical force
"eteen the con$uctors& The effect is greatest hen there is a narro
se#aration "eteen large areas of con$uctor' hence ca#acitor con$uctors are
often calle$ #lates&
An i$eal ca#acitor is characteri0e$ "y a single constant )alue' ca#acitance'
hich is measure$ in fara$s& This is the ratio of the electric charge on each
con$uctor to the #otential $ifference "eteen them& In #ractice' the $ielectric
"eteen the #lates #asses a small amount of lea!age current& The con$uctors
an$ lea$s intro$uce an e(ui)alent series resistance an$ the $ielectric has an
electric fiel$ strength limit resulting in a "rea!$on )oltage&
Ca#acitors are i$ely use$ in electronic circuits to "loc! the flo of $irect
current hile alloing alternating current to #ass' to filter out interference'
to smooth the out#ut of #oer su##lies' an$ for many other #ur#oses& They
are use$ in resonant circuits in ra$io fre(uency e(ui#ment to select #articular
fre(uencies from a signal ith many fre(uencies&
4heory o/ o.eration
Main article, Ca#acitance
Charge se#aration in a #arallel3#late ca#acitor causes an internal electric
fiel$& A $ielectric <orange= re$uces the fiel$ an$ increases the ca#acitance&
A sim#le $emonstration of a #arallel3#late ca#acitor
A ca#acitor consists of to con$uctors se#arate$ "y a non3con$ucti)e
region&The non3con$ucti)e su"stance is calle$ the $ielectric me$ium'

You might also like