67
UNI. R.NO-10007049 7676 Preface This report is based on my industrial trainin as a part o! my enineerin deree at ""#$#$ %IR$ &IN'% #%$T T$ ())* at +edhaa,i mbedded &ystems* %oshiarpur !or the period o! une /011 to uly /011. The report presents an ehausti,e outline on  Embedded Systems, 8051 microcontro ller & its various interfaces. $ll possibilities ha,e been tried !or main the eplanation as illustrati,e as possible. <<VIJAY KUMAR>> 1 2 3a e

6W 002 Training Report Draft

Embed Size (px)

Citation preview

Page 1: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 1/67

UNI. R.NO-100070497676

Preface

This report is based on my industrial trainin as a part o! my en ineerin de ree at

""#$#$ %IR$ &IN'% #%$TT$())* at +edhaa,i mbedded &ystems* %oshiarpur

!or the period o! une /011 to uly /011.

The report presents an e hausti,e outline on Embedded Systems, 8051

microcontroller & its various interfaces.

$ll possibilities ha,e been tried !or ma in the e planation as illustrati,e as possible.

<<VIJAY KUMAR>>

1 23 a e

Page 2: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 2/67

UNI. R.NO-100070497676

Table of Contents

1. $ no5led ement.

/. erti!i ate.

. Theory

a. Introdu tion to mbedded &ystems

b. omparison bet5een +i ropro essor 8 +i ro ontroller

. Introdu tion to 0:1 +i ro ontroller

4. 3ra ti al

a. &olderin Tips

b. ; 3o5er &upply

. Transistor as a &5it h

d. <or in 5ith =eil ompiler>$ssembler

e. ( ; Inter!a in

!. &5it h Inter!a in ? @ ternal InterruptA

. ( ; Inter!a in

:. +inor 3roBe t ;etails

a. Introdu tion to the proBe t

b. #lo ;ia ram

. omponent (ist

d. ir uit ;ia ram

e. Te hni al ;etails

6. #iblio raphy.

/ 2 3 a e

Page 3: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 3/67

UNI. R.NO-100070497676

1. Acknowledgements

I e press my sin ere than s to the mana ement o! our olle e !or i,in us the liberty

to hoose the most rele,ant industrial house !or our trainin pro ramme.

I am rate!ul to our 3rin ipal +r. $Bit &in h !or their e ellent o-ordination 5ith the

industry !or the Industrial Trainin and thus i,in us an opportunity to enhan e our

te hni al s ills in the sense o! industrial a ti,ity.

(ast but not the least* I am e tremely than !ul to +r. Co esh =alia* +r. 'ur5inder

&in h and the other en ineerin sta!! at + ;%$DI +# ;; ; &C&T +& !or

their mu h-needed help and !or de,elopin in me a pro!essional attitude.

$bo,e all* I than my !amily 8 !riends !or their mu h-needed help and in!ormation

o!!ered durin this period.

<<VIJAY KUMA !!

2 3 a e

Page 4: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 4/67

UNI. R.NO-100070497676

". T#eor$

".a Introd%ct&on to 'mbedded ($stems

I)T *+UCTI*)

$n mbedded produ t uses the mi ropro essor?or mi ro ontrollerA to do a spe i!i

tas only. $ printer is an e ample o! mbedded system sin e the pro essor inside it

per!orms one tas only namely ettin the data and printin it.In ontrast to this

3entium based 3 an be used !or any no. o! appli ations su h as 5ord pro essor*

print ser,er* ban teller terminal* ,ideo ame player* net5or ser,er or internet

terminal.

&o!t5are !or ,ariety o! appli ations an be loaded and run. O! ourse the reason a 3

an per!orm multiple tas is that it has R$+ memory and an operatin system that

loads the appli ation so!t5are into R$+ 8 lets the 3U run it. In an mbedded

system there is only one appli ation so!t5are that is typi ally burned into RO+. $n

63 ontains or is onne ted to ,arious mbedded 3rodu ts su h as eyboard*

printer* modem* ;is ontroller* &ound ard* ;-Rom ;ri,er* +ouse 8 so on. a h

one o! these peripherals has a mi ro ontroller inside it that per!orms only one tas .

Eor e ample inside e,ery mouse there is mi ro ontroller to per!orm the tas o! !indin the mouse position and sendin it to 3 .

$lthou h mi ro ontroller are pre!erred hoi e !or many mbedded systems* There are

times that a mi ro ontroller is inadeFuate !or the tas . Eor this reason in re ent years

many manu!a tures o! eneral purpose mi ropro essors su h as INT (* +otorolla*

$+; 8 yri ha,e tar eted their mi ropro essors !or the hi h end o! mbedded

mar et. <hile INT (* $+;* yri push their 6 pro essors !or both the embedded

and des top p mar et* +otorolla is determined to eep the 6 000 !amilies ali,e bytar etin it mainly !or hi h end o! embedded system.

One o! the most riti al needs o! the embedded system is to de rease po5er

onsumptions and spa e. This an be a hie,ed by inte ratin more !un tions into the

3U hips.

$ll the embedded pro essors based on the 6 and 6 0 0 ha,e lo5 po5er

onsumptions in additions to some !orms o! I>O* om port 8 RO+ all on a sin le

hip. In hi her per!orman e mbedded system the trend is to inte rate more 8 more

!un tion on the 3U hip 8 let the desi ner de ide 5hi h !eature he>she 5ants to use.

4 23 a e

Page 5: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 5/67

Page 6: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 6/67

Page 7: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 7/67

Page 8: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 8/67

UNI. R.NO-100070497676

stored in pro ram memory into odes* 5hi h the $(U an understand. The seFuen er

mana es the !lo5 o! data alon the mi ro ontroller s data bus. The 3U to

temporarily store ,ital data* 5hi h are ,olatile* uses re istersJ they an han e durin

pro ram e e ution. +ost mi ro ontroller re isters are memory-mapped* asso iated

5ith a memory lo ation* and an be used li e any other memory lo ation. Re isters

store the state o! the 3U. I! the ontents o! mi ro ontroller memory and the ontents

o! these re isters are sa,ed it is possible to suspend pro ram operation !or an

inde!inite period o! time and restart e a tly in the state 5hen the pro ram 5as

suspended. The number and names o! re isters ,aries drasti ally amon mi ro

ontrollers. %o5e,er there are ertain re isters* 5hi h are ommon to most mi ro

ontrollers* althou h the names may ,ary.

EI'J #(O = ;I$'R$+ OE 3UT#ese &ncl%de5

1. T7' (TACK P*I)T' 5 The sta pointer ontains the address o! the ne t

lo ation on the sta . The address in the sta pointer is de remented 5hen data is

pushed on the sta and in remented 5hen data is popped !rom the sta .

". T7' I)+'- '8I(T' 5 The inde re ister is used to spe i!y an address 5hen

ertain addressin modes are used. It is also no5n as the pointer re ister. The

+i ro hip de,i es use the name E&R ?!ile sele t re isterA.

2 3 a e

Page 9: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 9/67

Page 10: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 10/67

UNI. R.NO-100070497676

".c Introd%ct&on to ; =1 M&crocontroller5

AT;>C=1 /rom ATM' Cor3orat&on5

This popular 0:1 hip has on- hip RO+ in the !orm o! !lash memory. This is ideal

!or !ast de,elopment sin e !lash memory an be erased in se onds ompared to

t5enty minutes or more needed !or the earlier ,ersions o! the 0:1. To use the

$T 9 :1 to de,elop a mi ro ontroller-based system reFuires a RO+ burner that

supports !lash memoryJ %o5e,er* a RO+ eraser is not needed. Noti e that in !lash

memory you must erase the entire ontents o! RO+ in order to pro ram it a ain. The

3RO+ burner does this erasin o! !lash itsel! and this is 5hy a separate burner is not

needed. To eliminate the need !or a 3RO+ burner $tmel is 5or in on a ,ersion o!

the $T 9 :1 that an be pro rammed by the serial O+ port o! the 3 .

$tmel +i ro ontroller $T 9 :1

7ardware feat%res

40 pin I .

4 =bytes o! Elash.

1/ #ytes o! R$+.

/ I>O lines.

T5o16-#it Timer> ounters.

Ei,e Detor.

10 23 a e

Page 11: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 11/67

UNI. R.NO-100070497676

T5o-(e,el Interrupt $r hite ture.

Eull ;uple &erial 3ort.

On hip Os illator and lo ir uitry.

(oftware feat%res

#it +anipulations

&in le Instru tion +anipulation

&eparate 3ro ram $nd ;ata +emory

4 #an O! Temporary Re isters

;ire t* Indire t* Re ister and Relati,e $ddressin .

In addition* the $T 9 :1 is desi ned 5ith stati lo i !or operation do5n to Hero

!reFuen y and supports t5o so!t5are sele table po5er sa,in modes. The Idle +ode

stops the 3U 5hile allo5in the R$+* timer> ounters* serial port and interrupt

system to ontinue !un tionin . The 3o5er ;o5n +ode sa,es the R$+ ontents but

!reeHes the os illator disablin all other hip !un tions until the ne t hard5are reset.

The $tmel Elash de,i es are ideal !or de,elopin * sin e they an be repro rammed

easy and !ast. I! 5e need more ode spa e !or our appli ation* parti ularly !or

de,elopin 9 proBe ts 5ith lan ua e. $tmel o!!ers a broad ran e o! mi ro ontrollers based on the 0:1 ar hite ture* 5ith on- hip Elash pro ram memory.

11 2 3 a e

Page 12: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 12/67

UNI. R.NO-100070497676

1/ 2 3 a e

Page 13: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 13/67

UNI. R.NO-100070497676

PI) +'(C IPTI*) */ T7' AT;>C=" 56

0:1 !amily members ome in di!!erent pa a es su h ;I3?dual in line

pa a eA*KE3?Kuad !lat pa a eA* and (( ?leadless hip arrierA*they all ha,e 40

pins that are dedi ated to ,arious !un tions su h as I>O* R;* <R* address* data and

interrupts.

EI'J 3IN ;I$'R$+ OE T% 3 9 :1R;/

P&ns 16; JPort 1 J a h o! these pins an be on!i ured as an input or an output.

P&n >J '('T5 It is an input and is a ti,e hi h. Upon applyin a hi h pulse to this

pin the mi ro ontroller 5ill reset and terminate all a ti,ities. This is o!ten re!erred to

as a po5er on reset .$ ti,atin a po5er on reset 5ill ause all ,alues the re isters to

be lost. It 5ill set pro ram ounter to all 0s.In order !or the R & T input to be

e!!e ti,e it must ha,e a minimum duration o! t5o ma hine y les. In other 5ords the

hi h pulse must be hi h !or a minimum o! t5o ma hine y les be!ore it is allo5ed to

o lo5.

1 2 3 a e

Page 14: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 14/67

UNI. R.NO-100070497676

P&ns 1 61? J Port 95 &imilar to port 1* ea h o! these pins an ser,e as eneral input

or output. #esides* all o! them ha,e alternati,e !un tionsJ

P&n 1 5 -+ &erial asyn hronous ommuni ation input or &erial syn hronous

ommuni ation output.

P&n 115 T-+ &erial asyn hronous ommuni ation output or &erial syn hronous

ommuni ation lo output.

P&n 1"5 I)T Interrupt 0 input.

P&n 195 I)T1 Interrupt 1 input.

P&n 1:5 T Timer 0 lo input.

P&n 1=5 T1 Timer 1 lo input.

P&n 1@5 <rite to e ternal ?additionalA R$+.

P&n 1?5 + Read !rom e ternal R$+.

P&n 1;B 1>5 -TA "B -TA 1 JInternal os illator input and output. $ FuartH

rystal 5hi h spe i!ies operatin !reFuen y is usually onne ted to these pins. The

FuartH rystal os illator onne ted to LT$(1 and LT$(/ also needs t5o apa itors o! p! ,alue. One side o! ea h apa itor is onne ted to the round. &peed re!ers to the

ma imum os illator !reFuen y onne ted to LT$( .<hen the 0:1 is onne ted to a

rystal os illator is po5ered up 5e an obser,e the !reFuen y on the LT$(/ pin

usin the os illos ope.

P&n " 5 8)+ J'round.

P&ns "16";5 Port " JI! there is no intention to use e ternal memory then these port

pins are on!i ured as eneral inputs>outputs. In ase e ternal memory is used* the

hi her address byte* i.e. addresses $ -$1: 5ill appear on this port. ,en thou h

memory 5ith apa ity o! 64=b is not used* 5hi h means that not all ei ht port bits are

used !or its addressin * the rest o! them are not a,ailable as inputs>outputs.

P&n ">5 P(') JI! e ternal RO+ is used !or storin pro ram then a lo i Hero ?0A

appears on it e,ery time the mi ro ontroller reads a byte !rom memory.

P&n 9 5 A '5 $ddress (at h enable is an output pin and is a ti,e hi h.

14 23 a e

Page 15: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 15/67

UNI. R.NO-100070497676

<hen onne tin an 0 1 to e ternal memory* port 0 pro,ides both address and data.

In other 5ords the 0 1 multiple es address and data throu h port 0 to sa,e pins. The

$( pin is used !or demultiple in the address and data by onne tin to ' pin o! the

74(& 7 hip.

P&n 915 'A J $ 5hi h stands !or Me ternal a ess . It is an input pin and must be

onne ted to either D or 'N;.#y applyin lo i Hero to this pin* 3/ and 3 are

used !or data and address transmission 5ith no re ard to 5hether there is internal

memory or not. It means that e,en there is a pro ram 5ritten to the mi ro ontroller* it

5ill not be e e uted. Instead* the pro ram 5ritten to e ternal RO+ 5ill be e e uted.

#y applyin lo i one to the $ pin* the mi ro ontroller 5ill use both memories* !irst

internal then e ternal ?i! e istsA.

P&ns 9"69>J Port J 3ort 0 is also desi nated as $;0-$;7 allo5in it to be used

!or both address and data. <hen onne tin an 0:1> 1 to an e ternal memory* port 0

pro,ides both address and data. The 0:1 multiple es address and data throu h port 0

to sa,e pins. $( indi ates i! p0 has address $0-$7.in the 0:1 based systems 5here

there is no e ternal memory onne tion the pins o! 30 must be onne ted e ternally to

10 -ohm pull-up resistor. This is due to the !a t that 30 is an open drain* unli e 31* 3/

and 3

P&n : 5 D J @:D po5er supply .

Memor$ (3ace Allocat&on

Internal *M

The 9 :1 has 4= bytes o! on- hip RO+. This 4= bytes RO+ memory

has memory addresses o! 0000 to 0EEEh. 3ro ram addresses hi her than 0EEEh*

5hi h e eed the internal RO+ apa ity* 5ill ause the mi ro ontroller to

automati ally !et h ode bytes !rom e ternal memory. ode bytes an also be !et hed

e lusi,ely !rom an e ternal memory* addresses 0000h to EEEEh* by onne tin the

e ternal a ess pin to round. The pro ram ounter doesn t are 5here the ode isJ

the ir uit desi ner de ides 5hether the ode is !ound totally in internal RO+* totally

in e ternal RO+ or in a ombination o! internal and e ternal RO+.

1: 2 3 a e

Page 16: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 16/67

UNI. R.NO-100070497676

Internal AM

The 1/ 9 bytes o! R$+ inside the 0:1 are assi ned addresses 00 to 7Eh.

These 1/ bytes an be di,ided into three di!!erent roups as !ollo5sJ

• $ total o! / bytes !rom lo ations 00 to 1Eh are set aside !or re ister ban s andthe sta .

• $ total o! 16 bytes !rom lo ations /0h to /Eh are set aside !or bit addressable

read>5rite memory and instru tions.

• $ total o! 0 bytes !rom lo ations 0h to 7Eh are used !or read and 5rite

stora e* or 5hat is normally alled a s rat h pad. These 0 lo ations o! R$+

are 5idely used !or the purpose o! storin data and parameters by 0:1

pro rammers.

P *8 AMMI)8 M*+' */ ; =1 56

In pro rammin model o! 0:1 di!!erent types o! re isters are a,ailable and these

re isters are used to store temporarily data . The in!ormation ould be a byte o! data to

be pro essed or an address pointin to the data to be !et hed the maBority o! re isters

is 0:1 are -bit re isters.

ACCUMU AT* 0 '8I(T' A 5

$ umulator is a mathemati al re ister 5here all the arithmeti and lo i al operations

are done and a!ter e e ution o! instru tions the output data is stored in the re ister.

,ery bit o! this re ister is a essible.

, '8I(T' 5

# re ister is same as that o! a umulator o!. It is also an bit re ister and e,ery bit o!

this is a essible. This is also a mathemati al re ister # 5hi h is used mostly !or

multipli ation and di,ision.

P( 0P *8 AM (TATU( * + eg&ster5

3ro ram status 5ord re ister is an bit re ister. It is also re!erred to as the !la

re ister. $lthou h the 3&< re ister is bits 5ide* only 6 bits o! it are used by the

0:1. The unused bits are user-de!inable !la s.

16 23 a e

Page 17: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 17/67

UNI. R.NO-100070497676

Eour o! the !la s are alled onditional !la s* meanin that they indi ate some

onditions that result a!ter an instru tion is e e uted. These !our are C ? arryA* $

?au iliary arryA* 3 ?parityA and OD ?o,er!lo5A.

(P'CIA /U)CTI*) '8I(T' 0(/ M'M* Y

&pe ial Eun tion Re isters ?&ERsA are areas o! memory that ontrol spe i!i

!un tionality o! the 0:1 pro essor. Eor e ample* !our &ERs permit a ess to the

0:1s / input>output lines. $nother &ER allo5s a pro ram to read or 5rite to the

0:1s serial port. Other &ERs allo5 the user to set the serial baud rate* ontrol and

a ess timers* and on!i ure the 0:1s interrupt system.

(/ T$3es

$s mentioned in the hart itsel!* the &ERs that ha,e a blue ba round are &ERs

related to the I>O ports. The 0:1 has !our I>O ports o! bits* !or a total o! / I>O

lines. <hether a i,en I>O line is hi h or lo5 and the ,alues read !rom the line are

ontrolled by the &ERs in reen. The &ERs 5ith yello5 ba rounds are &ERs* 5hi h

in some 5ay ontrol the operation or the on!i uration o! some aspe t o! the 0:1.

Eor e ample* T ON ontrols the timers* & ON ontrols the serial port.

The remainin &ERs* 5ith reen ba rounds* are other &ERs. These &ERs an be

thou ht o! as au iliary &ERs in the sense that they donPt dire tly on!i ure the 0:1

but ob,iously the 0:1 annot operate 5ithout them. Eor e ample* on e the serial port

has been on!i ured usin & ON* the pro ram may read or 5rite to the serial port

usin the &#UE re ister.

(/ +'(C IPTI*)(

This se tion o,ers ea h o! the standard &ERs !ound in the abo,e &ER hart map.

P 0P* T B A++ '(( ; 7B ,IT6A++ '((A, ' 5

This is input>output port 0. a h bit o! this &ER orresponds to one o! the pins onthe mi ro ontroller. Eor e ample* bit 0 o! port 0 is pin 30.0* bit 7 is pin 30.7.

17 23 a e

Page 18: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 18/67

UNI. R.NO-100070497676

<ritin a ,alue o! 1 to a bit o! this &ER 5ill send a hi h le,el on the

orrespondin I>O pin 5hereas a ,alue o! 0 5ill brin it to a lo5 le,el.

(P 0(TACK P*I)T' B A++ '(( ;17 5

This is the sta pointer o! the mi ro ontroller. This &ER indi ates 5here the ne t

,alue to be ta en !rom the sta 5ill be read !rom in Internal R$+. I! you push a

,alue onto the sta * the ,alue 5ill be 5ritten to the address o! &3 @ 1. That is to say*

i! &3 holds the ,alue 07h* a 3U&% instru tion 5ill push the ,alue onto the sta at

address 0 h

+P 2+P7 0+ATA P*I)T' * 27I87B A++ '(('( ;"72;97 5

The &ERs ;3( and ;3% 5or to ether to represent a 16-bit ,alue alled the ;ata

3ointer. The data pointer is used in operations re ardin e ternal R$+ and some

instru tions in,ol,in ode memory. &in e it is an unsi ned t5o-byte inte er ,alue* it

an represent ,alues !rom 0000h to EEEEh ?0 throu h 6:*: : de imalA.

PC*) 0P* ' C*)T * B A++ '(('( ;?7 5

The 3o5er ontrol &ER is used to ontrol the 0:1Ps po5er ontrol modes. ertain

operation modes o! the 0:1 allo5 the 0:1 to o into a type o! sleep mode that

reFuires mu h less po5er. These modes o! operation are ontrolled throu h 3 ON.

$dditionally* one o! the bits in 3 ON is used to double the e!!e ti,e baud rate o! the

0:1Ps serial port.

TC*) 0TIM' C*)T * B A++ '(('( ;;7B ,IT6A++ '((A, ' J

The Timer ontrol &ER is used to on!i ure and modi!y the 5ay in 5hi h the

0:1Ps t5o timers operate. This &ER ontrols 5hether ea h o! the t5o timers is

runnin or stopped and ontains a !la to indi ate that ea h timer has o,er!lo5ed.

$dditionally* some non-timer related bits are lo ated in the T ON &ER. These

bits are used to on!i ure the 5ay in 5hi h the e ternal interrupts are a ti,ated

and also ontain the e ternal interrupt !la s* 5hi h are set 5hen an e ternal

interrupt has o urred.

1 2 3 a e

Page 19: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 19/67

UNI. R.NO-100070497676

TE1J Timer 1 o,er!lo5 !la .

TR1J Timer 1 run ontrol bit.

TE0J Timer 0 o,er!lo5 !la .

TR0J Timer 0 run ontrol bit.

I 1J ternal interrupt 1 ed e !la .

IT1J ternal interrupt 1 type !la .

I 0J ternal interrupt 0 ed e !la .

IT0J ternal interrupt 0 type !la .

TM*+ 0TIM' M*+'B A++ '(('( ;>7 5

The Timer +ode &ER is used to on!i ure the mode o! operation o! ea h o! the

t5o timers. Usin this &ER pro ram may on!i ure ea h timer to be a 16-bit

timer* an -bit auto reload timer* a 1 -bit timer* or t5o separate timers.

$dditionally* one may on!i ure the timers to only ount 5hen an e ternal pin is

a ti,ated or to ount e,ents that are indi ated on an e ternal pin.

19 23 a e

Page 20: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 20/67

UNI. R.NO-100070497676

T 2T7 0TIM' * 27I87B A++ '(('( ;A72;C7 5 These t5o

&ERs* ta en to ether* represent timer 0. Their e a t beha,ior depends on ho5 the

timer is on!i ured in the T+O; &ERG ho5e,er* these timers al5ays ount up.<hat is on!i urable is ho5 and 5hen they in rement in ,alue.

T 12T71 0TIM' 1 * 27I87B A++ '(('( ;,72;+7 5

These t5o &ERs* ta en to ether* represent timer 1. Their e a t beha,ior depends

on ho5 the timer is on!i ured in the T+O; &ERG ho5e,er* these timers al5ays

ount up. <hat is on!i urable is ho5 and 5hen they in rement in ,alue.

P1 0P* T 1B A++ '(( > 7B ,IT6A++ '((A, ' 5

This is input>output port 1. a h bit o! this &ER orresponds to one o! the pins on

the mi ro ontroller. Eor e ample* bit 0 o! port 1 is pin 31.0* bit 7 is pin 31.7.

<ritin a ,alue o! 1 to a bit o! this &ER 5ill send a hi h le,el on the

orrespondin I>O pin 5hereas a ,alue o! 0 5ill brin it to a lo5 le,el.

P( 0P *8 AM (TATU( * +B A++ '(('( + 7B ,IT6

A++ '((A, ' 5

The 3ro ram &tatus <ord is used to store a number o! important bits that are

set and leared by 0:1 instru tions. The 3&< &ER ontains the arry !la * the

au iliary arry !la * the o,er!lo5 !la * and the parity !la . $dditionally* the

3&< re ister ontains the re ister ban sele t !la s* 5hi h are used to sele t*

5hi h o! the R re ister ban s are urrently sele ted.

/0 2 3 a e

Page 21: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 21/67

UNI. R.NO-100070497676

ACC 0ACCUMU AT* B A++ '(('( ' 7B ,IT6A++ '((A, ' 5

The $ umulator is one o! the most used &ERs on the 0:1 sin e it is in,ol,ed in

so many instru tions. The $ umulator resides as an &ER at 0h* 5hi h means

the instru tion +OD $* Q/0h is really the same as +OD 0h* Q/0h. %o5e,er* it isa ood idea to use the !irst method sin e it only reFuires t5o bytes 5hereas the

se ond option reFuires three bytes.

, 0, '8I(T' B A++ '(('( / 7B ,IT6A++ '((A, ' 5

The # re ister is used in t5o instru tionsJ the multiply and di,ide

operations. The # re ister is also ommonly used by pro rammers as an

au iliary re ister to temporarily store ,alues.

,A(IC '8I(T' (56

T7' ACCUMU AT*

The $ umulator is a eneral re ister to a umulate the results o! a lar e number o!

instru tions. It an hold an -bit ?1-byteA ,alue and is the most ,ersatile re ister the

0:1 has due to the shear number o! instru tions that ma e use o! the a umulator.+ore than hal! o! the 0:1s /:: instru tions manipulate or use the a umulator in

some 5ay. Eor e ample* i! you 5ant to add the number 10 and /0* the resultin 0

5ill be stored in the $ umulator. On e you ha,e a ,alue in the $ umulator you may

ontinue pro essin the ,alue or you may store it in another re ister or in memory.

T7' +ATA P*I)T' 0+PT

The ;ata 3ointer ?;3TRA is the 0:1s only user-a essible 16-bit ?/-byteA re ister.

The $ umulator* R re isters* and # re ister are all 1-byte ,alues.

;3TR* as the name su ests* is used to point to data. It is used by a number o!

ommands* 5hi h allo5 the 0:1 to a ess e ternal memory. <hen the 0:1 a esses

e ternal memory* it 5ill a ess e ternal memory at the address indi ated by ;3TR.

<hile ;3TR is most o!ten used to point to data in e ternal memory* many

pro rammers o!ten ta e ad,anta e o! the !a t that it s the only true 16-bit re ister

/1 2 3 a e

Page 22: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 22/67

UNI. R.NO-100070497676

a,ailable. It is o!ten used to store /-byte ,alues* 5hi h ha,e nothin to do 5ith

memory lo ations.

T7' P *8 AM C*U)T' 0PC

The 3ro ram ounter ?3 A is a /-byte address* 5hi h tells the 0:1 5here the ne t

instru tion to e e ute is !ound in memory. <hen the 0:1 is initialiHed 3 al5ays

starts at 0000h and is in remented ea h time an instru tion is e e uted. It is important

to note that 3 isn t al5ays in remented by one. &in e some instru tions reFuire / or

bytes the 3 5ill be in remented by / or in these ases.

The 3ro ram ounter is spe ial in that there is no 5ay to dire tly modi!y its

,alue. That is to say* you an t do somethin li e 3 /4 0h. On the other hand* i!

you e e ute ( +3 /4 0h you ,e e!!e ti,ely a omplished the same thin .

It is also interestin to note that 5hile you may han e the ,alue o! 3 ?by

e e utin a Bump instru tion* et .A there is no 5ay to read the ,alue o! 3 .

T7' (TACK P*I)T' 0(P

The &ta 3ointer holds an -bit ?1-byteA ,alue. The &ta 3ointer is used to indi ate

5here the ne t ,alue to be remo,ed !rom the sta should be ta en !rom. <hen you

push a ,alue onto the sta * the 0:1 !irst in rements the ,alue o! &3 and then stores

the ,alue at the resultin memory lo ation. <hen you pop a ,alue o!! the sta * the

0:1 returns the ,alue !rom the memory lo ation indi ated by &3 and then de rements

the ,alue o! &3.

<hen the 0:1 is initialiHed &3 5ill be initialiHed to 07h. I! you immediately push a ,alue onto the sta * the ,alue 5ill be stored in Internal R$+ address 0 h.

Eirst the 0:1 5ill in rement the ,alue o! &3 ?!rom 07h to 0 hA and then 5ill store the

pushed ,alue at that memory address ?0 hA. &3 is modi!ied dire tly by the 0:1 by si

instru tionsJ 3U&%* 3O3* $ $((* ( $((* R T* and R TI. It is also used

intrinsi ally 5hene,er an interrupt is tri ere

// 2 3 a e

Page 23: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 23/67

Page 24: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 24/67

UNI. R.NO-100070497676

VAllow Fo&nts a m&n%te or so to cool down before $o% to%c# t#em.

V ork &n a well6Dent&lated area.

The smo e !ormed as you melt solder is mostly !rom the !lu and Fuite irritatin .

$,oid

breathin it by eepin you head to the side o!* not abo,e* your 5or .

V as# $o%r #ands after %s&ng solder.

&older ontains lead.

Pre3ar&ng t#e solder&ng &ron

VPlace t#e solder&ng &ron &n &ts stand and 3l%g &n.

The iron 5ill ta e a !e5 minutes to rea h its operatin temperature o! about 400 .

V+am3en t#e s3onge &n t#e stand.

The best 5ay to do this is to li!t it out the stand and hold it under a old tap !or a

moment* then sFueeHe to remo,e e ess 5ater. It should be damp* not drippin 5et.

V a&t a few m&n%tes for t#e solder&ng &ron to warm %3.

Cou an he i! it is ready by tryin to melt a little solder on the tip.

V &3e t#e t&3 of t#e &ron on t#e dam3 s3onge.

This 5ill lean the tip.

VMelt a l&ttle solder on t#e t&3 of t#e &ron.This is alled Ptinnin P and it 5ill help the heat to !lo5 !rom the iron s tip to the Boint.

It only needs to be done 5hen you plu in the iron* and o asionally 5hile solderin

i! you need to 5ipe the tip lean on the spon e.

Mak&ng soldered Fo&nts

V7old t#e solder&ng &ron l&ke a 3enB near t#e base of t#e #andle.

Ima ine you are oin to 5rite your nameW

Remember to ne,er tou h the hot element or tip.

VTo%c# t#e solder&ng &ron onto t#e Fo&nt to be made.

+a e sure it tou hes both the omponent lead and the tra .

%old the tip there !or a !e5 se onds and...

V/eed a l&ttle solder onto t#e Fo&nt.

It should !lo5 smoothly onto the lead and tra to !orm a ,ol ano shape. +a e sure

you apply the solder to the Boint* not the iron.V emoDe t#e solderB t#en t#e &ronB w#&le kee3&ng t#e Fo&nt st&ll.

/4 2 3 a e

Page 25: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 25/67

UNI. R.NO-100070497676

$llo5 the Boint a !e5 se onds to ool be!ore you mo,e the ir uit board.

VIns3ect t#e Fo&nt closel$.

It should loo shiny and ha,e a ,ol ano shape. I! not* you 5ill need to reheat it and

!eed in a little more solder. This time ensure that both the lead and tra are heated

!ully be!ore applyin solder.

9.b Power (%33l$

3o5er supplies are desi ned to on,ert hi h ,olta e $ mains to a suitable lo5

,olta e supply !or ele troni s ir uits and other de,i es. $ po5er supply an be

bro en do5n into a series o! blo s* ea h o! 5hi h per!orms a parti ular !un tion.

/or eEam3le a =V reg%lated s%33l$5

'ac# of t#e block #as &ts own f%nct&on as descr&bed below

1. Trans!ormer X steps do5n hi h ,olta e $ mains to lo5 ,olta e $ .

/. Re ti!ier X on,erts $ to ; * but the ; output is ,aryin .

. &moothin X smoothes the ; !rom ,aryin reatly to a small ripple.

4. Re ulator X eliminates ripple by settin ; output to a !i ed ,olta e.

T A)(/* M'

Trans!ormers on,ert $ ele tri ity !rom one ,olta e to another 5ith little loss o!

po5er. Trans!ormers 5or only 5ith $ and this is one o! the reasons 5hy

mains ele tri ity is $ . The t5o types o! trans!ormers

• &tep-up trans!ormers in rease ,olta e*

• &tep-do5n trans!ormers redu e ,olta e.

/: 2 3 a e

Page 26: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 26/67

UNI. R.NO-100070497676

Transformer

+ost po5er supplies use a step-do5n trans!ormer to redu e the dan erously

hi h mains ,olta e ?/ 0D in U=A to a sa!er lo5 ,olta e. The input oil is

alled the primary and the output oil is alled the se ondary. There is no

ele tri al onne tion bet5een the t5o oils* instead they are lin ed by an

alternatin ma neti !ield reated in the so!t-iron ore o! the trans!ormer. The

t5o lines in the middle o! the ir uit symbol represent the ore.

Trans!ormers 5aste ,ery little po5er so the po5er out is ?almostA eFual to the po5er

in. Note that as ,olta e is stepped do5n urrent is stepped up. The ratio o! the number

o! turns on ea h oil* alled the turn ratio* determines the ratio o! the ,olta es. $ step-

do5n trans!ormer has a lar e number o! turns on its primary ?inputA oil 5hi h is

onne ted to the hi h ,olta e mains supply* and a small number o! turns on its

se ondary ?outputA oil to i,e a lo5 output ,olta e.

T%rns rat&o G V3 G )3

Vs )s

And Power *%t G Power In

/6 2 3 a e

Page 27: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 27/67

UNI. R.NO-100070497676

Vs Is G V3 I3

#ere

V3 G 3r&mar$ 0&n3%t Doltage

)3 G n%mber of t%rns on 3r&mar$ co&l

I3 G 3r&mar$ 0&n3%t c%rrent

)s G n%mber of t%rns on secondar$ co&l

Is G secondar$ 0o%t3%t c%rrent

Vs G secondar$ 0o%t3%t Doltage

, I+8' 'CTI/I'

$ brid e re ti!ier an be made usin !our indi,idual diodes* but it is also a,ailable in

spe ial pa a es ontainin the !our diodes reFuired. It is alled a !ull-5a,e re ti!ier

be ause it uses all $ 5a,e ?both positi,e and ne ati,e se tionsA. 1.4D is used up in

the brid e re ti!ier be ause ea h diode uses 0.7D 5hen ondu tin and there are

al5ays t5o diodes ondu tin * as sho5n in the dia ram belo5. #rid e re ti!iers arerated by the ma imum urrent they an pass and the ma imum re,erse ,olta e they

an 5ithstand ?this must be at least three times the supply R+& ,olta e so the

re ti!ier an 5ithstand the pea ,olta esA. In this alternate pairs o! diodes ondu t*

han in o,er the onne tions so the alternatin dire tions o! $ are on,erted to the

one dire tion o! ; .

/7 2 3 a e

Page 28: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 28/67

UNI. R.NO-100070497676

OUTPUT – Full-wave Varying DC

(M**T7I)8

&moothin is per!ormed by a lar e ,alue ele trolyti apa itor onne ted a ross the; supply to a t as a reser,oir* supplyin urrent to the output 5hen the ,aryin

; ,olta e !rom the re ti!ier is !allin . The dia ram sho5s the unsmoothed

,aryin ; ?dotted lineA and the smoothed ; ?solid lineA. The apa itor har es

Fui ly near the pea o! the ,aryin ; * and then dis har es as it supplies urrent to

the output.

Note that smoothin si ni!i antly in reases the a,era e ; ,olta e to almost the pea

,alue ?1.4 Y R+& ,alueA. Eor e ample 6D R+& $ is re ti!ied to !ull 5a,e ; o!

about 4.6D R+& ?1.4D is lost in the brid e re ti!ierA* 5ith smoothin this

in reases to almost the pea ,alue i,in 1.4 Y 4.6 6.4D smooth ; .

&moothin is not per!e t due to the apa itor ,olta e !allin a little as it dis har es*

i,in a small ripple ,olta e. Eor many ir uits a ripple 5hi h is 10S o! the supply

,olta e is satis!a tory and the eFuation belo5 i,es the reFuired ,alue !or the

smoothin apa itor. $ lar er apa itor 5ill i,e !e5er ripples. The apa itor ,alue

must be doubled 5hen smoothin hal!-5a,e ; .

&moothin apa itor !or 10S ripple* : Y Io

Vs H f

#ere

C G smoot#&ng ca3ac&tance &n farads 0/

/ 2 3 a e

Page 29: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 29/67

UNI. R.NO-100070497676

Io G o%t3%t c%rrent from t#e s%33l$ &n am3s 0A

Vs G s%33l$ Doltage &n Dolts 0V B t#&s &s t#e 3eak Dal%e of t#e %nsmoot#ed

+C

f G fre %enc$ of t#e AC s%33l$ &n #ert 07 B = 7 &n t#e UK

'8U AT*

Dolta e re ulator I s are a,ailable 5ith !i ed ?typi ally :* 1/ and 1:DA or ,ariable

output ,olta es. They are also rated by the ma imum urrent they an pass. Ne ati,e

,olta e re ulators are a,ailable* mainly !or use in dual supplies. +ost re ulators

in lude some automati prote tion !rom e essi,e urrent ? o,erload prote tionPA and

o,erheatin ? thermal prote tionPA. +any o! the !i ed ,olta e re ulator I s has leads

and loo li e po5er transistors* su h as the 7 0: @:D 1$ re ulator sho5n on theri ht. They in lude a hole !or atta hin a heat sin i! ne essary.

ork&ng of Power (%33l$

• Transformer

/9 2 3 a e

Page 30: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 30/67

UNI. R.NO-100070497676

The lo5 ,olta e $ output is suitable !or lamps* heaters and spe ial $ motors. It is

not suitable !or ele troni ir uits unless they in lude a re ti!ier and a smoothin

apa itor.

• Transformer ect&f&er

The ,aryin ; output is suitable !or lamps* heaters and standard motors. It is not

suitable !or ele troni ir uits unless they in lude a smoothin apa itor.

• Transformer ect&f&er (moot#&ng

The smooth ; output has a small ripple. It is suitable !or most ele troni ir uits.

• Transformer ect&f&er (moot#&ng eg%lator

0 2 3 a e

Page 31: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 31/67

UNI. R.NO-100070497676

D 2

C 1

1 0 0 0 u f

1 N 4 0 0 7 + 5 V

V

L M 7 8 0 5

1 2

3

V I N V O U T

G

N

D

J 1

123

D 3

g n d

D 4

D 1

The re ulated ; output is ,ery smooth 5ith no ripple. It is suitable !or all ele troniir uits.

9.c Trans&stor as (w&tc#

Trans&stor am3l&f$ c%rrent * !or e ample they an be used to ampli!y the small

output urrent !rom a lo i I so that it an operate a lamp* relay or other hi h urrent

de,i e. In many ir uits a resistor is used to on,ert the han in urrent to a

han in ,olta e* so the transistor is bein used to am3l&f$ Doltage .

$ transistor may be used as a sw&tc# ?either !ully on 5ith ma imum urrent* or !ully

o!! 5ith no urrentA and as an am3l&f&er ?al5ays partly onA.

T$3es of trans&stor

There are t5o types o! standard transistors* )P) and

P)P * 5ith di!!erent ir uit symbols. The letters re!er tothe layers o! semi ondu tor material used to ma e the

transistor. +ost transistors used today are N3N be ause

this is the easiest type to ma e !rom sili on. I! you are

ne5 to ele troni s it is best to start by learnin ho5 to use N3N transistors.

The leads are labelled base ?#A* collector ? A and em&tter ? A.

Test&ng &n a s&m3le sw&tc#&ng c&rc%&t

1 2 3 a e

Transistor ir uit symbols

Page 32: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 32/67

UNI. R.NO-100070497676

onne t the transistor into the ir uit sho5n on the ri ht 5hi h uses the transistor as a

s5it h. The supply ,olta e is not riti al* anythin bet5een : and 1/D is suitable.

This ir uit an be Fui ly built on breadboard !or e ample. Ta e are to in lude the

10 resistor in the base onne tion or you 5ill destroy the transistor as you test itW

I! the transistor is O= the ( ; should li ht 5hen the s5it h is pressed and not li ht

5hen the s5it h is released.

To test a 3N3 transistor use the same ir uit but re,erse the ( ; and the supply

,olta e.

/&g5 3N3 and N3N transistor as a

s5it h .

/ 2 3 a e

Page 33: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 33/67

UNI. R.NO-100070497676

9.d ork&ng w&t# Ke&l Com3&ler2Assembler

1. Open =eil !rom the &tart menu

/. The Ei ure belo5 sho5s the basi names o! the 5indo5s re!erred in this do ument

(tart&ng a new Assembler ProFect

1. &ele t Ne5 3roBe t !rom the 3roBe t +enu.

2 3 a e

Page 34: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 34/67

UNI. R.NO-100070497676

/. Name the proBe t To le.a:1

. li on the &a,e #utton.

4. The de,i e 5indo5 5ill be displayed.

:. &ele t the part you 5ill be usin to test 5ith. Eor no5 5e 5ill use the ;allas

&emi ondu tor part ;& 9 4/0.6. ;ouble li on the ;allas &emi ondu tor.

4 2 3 a e

Page 35: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 35/67

UNI. R.NO-100070497676

7. & roll do5n and sele t the ;& 9 4/0 3art

. li O=

: 2 3 a e

Page 36: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 36/67

UNI. R.NO-100070497676

Creat&ng (o%rce /&le

o li Eile +enu and sele t Ne5.

o $ ne5 5indo5 5ill open up in the =eil I; .

6 2 3 a e

Page 37: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 37/67

UNI. R.NO-100070497676

o 5rite any ode on this !ile.

o li on Eile menu and sele t &a,e asZ

7 2 3 a e

Page 38: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 38/67

Page 39: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 39/67

Page 40: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 40/67

UNI. R.NO-100070497676

. li on 'roups>$dd Eiles tab

4. Under $,ailable 'roups sele t &our e 'roup 1

:. li $dd Eiles to 'roupZ button

40 23 a e

Page 41: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 41/67

UNI. R.NO-100070497676

6. han e !ile type to $sm &our e !ile?[.a[G [.sr A

7. li on to le.a:1. li $dd button

9. li lose #utton

10. li O= button 5hen you return to Tar et* 'roups* EilesZ dialo bo .

41 23 a e

Page 42: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 42/67

Page 43: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 43/67

UNI. R.NO-100070497676

. &ele t Tar et Tab

4. han e Ltal ?+hHA !rom :0.0 to 11.0:9/

4 2 3 a e

Page 44: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 44/67

Page 45: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 45/67

UNI. R.NO-100070497676

4: 2 3 a e

Page 46: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 46/67

UNI. R.NO-100070497676

9.e Interfac&ng '+5

'+ ,as&cs5

&g#t 'm&tt&ng +&odes or '+Ls * are amon the most 5idely used o! all the types o!

diodes a,ailable. They are the most ,isible type o! diode* that emits a !airly narro5

band5idth o! either ,isible olored li ht* in,isible in!ra-red or laser type li ht 5hen a

!or5ard urrent is passed throu h them. $ &g#t 'm&tt&ng +&ode or '+ as it is

more ommonly alled* is basi ally Bust a spe ialiHed type o! 3N-Bun tion diode* made

!rom a ,ery thin layer o! !airly hea,ily doped semi ondu tor material. <hen the diode

is Eor5ard #iased* ele trons !rom the semi ondu tors ondu tion band ombine 5ith

holes !rom the ,alen e band* releasin su!!i ient ener y to produ e photons o! li ht.#e ause o! this thin layer a reasonable number o! these photons an lea,e the Bun tion

and radiate a5ay produ in a olored li ht output.

Erom the table abo,e 5e an see that the main 3-type dopant used in the manu!a ture

o! (i ht mittin ;iodes is 'allium?'a* atomi number 1A and the main N-type

dopant used is $rseni ?$s* atomi number 1A i,in the resultin 'allium $rsenide

?'a$sA rystal stru ture* 5hi h has the hara teristi s o! radiatin si ni!i ant amounts

o! in!rared radiation !rom its Bun tion 5hen a !or5ard urrent is !lo5in throu h it.

#y also addin 3hosphorus ?3* atomi number 1:A* as a third dopant the o,erall

5a,elen th o! the emitted radiation is redu ed to i,e ,isible red li ht to the human

eye. Eurther re!inements in the dopin pro ess o! the 3N-Bun tion ha,e resulted in a

ran e o! olors a,ailable !rom red* oran e and amber throu h to yello5* and the

re ently de,eloped blue ( ; 5hi h is a hie,ed by inBe tin nitro en atoms into the

rystal stru ture durin the dopin pro ess.

46 23 a e

Page 47: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 47/67

UNI. R.NO-100070497676

&g#t 'm&tt&ng +&odes I6V C#aracter&st&cs.

(i ht mittin ;iode ?( ;A & hemati symbol and its I-D hara teristi s ur,es

sho5in the di!!erent olours a,ailable.

#e!ore a li ht emittin diode an emit any !orm o! li ht it needs a urrent to !lo5

throu h it* as it is a urrent dependant de,i e. $s the ( ; is to be onne ted in a

!or5ard bias ondition a ross a po5er supply it should be Current Limited usin a

series resistor to prote t it !rom e essi,e urrent !lo5. Erom the table abo,e 5e an

see that ea h ( ; has its o5n !or5ard ,olta e drop a ross the 3N-Bun tion and this

parameter 5hi h is determined by the semi ondu tor material used is the !or5ard

,olta e drop !or a i,en amount o! !or5ard ondu tion urrent* typi ally !or a

!or5ard urrent o! /0m$. In most ases ( ;s are operated !rom a lo5 ,olta e ;

supply* 5ith a series resistor to limit the !or5ard urrent to a suitable ,alue !rom say

:m$ !or a simple ( ; indi ator to 0m$ or more 5here a hi h bri htness li htoutput is needed.

'+ (er&es es&stance.

The series resistor ,alue R & is al ulated by simply usin *#mLs aw * no5in the

reFuired !or5ard urrent I E* the supply ,olta e D & and the e pe ted !or5ard ,olta e

drop o! the ( ;* D E at this urrent le,el as sho5n belo5.

47 23 a e

Page 48: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 48/67

UNI. R.NO-100070497676

'+ (er&es es&stor C&rc%&t

'Eam3le )o1.

$n amber oloured ( ; is to be onne ted to a :.0, stabilised po5er supply. Usin

the ir uit abo,e al ulate the series resistor reFuired to limit the !or5ard urrent to

less than 10m$.

,as&c c&rc%&t of ; =1 5

The 0:1 has on- hip os illator but reFuires e ternal lo to run it . +ost o!ten a

FuartH rystal os illator to inputs LT$(1?pin 19A and LT$(/?pin1 A . The KurtHrystal os illator to LT$(1 and LT$(/ also needs t5o apa itors o! 0p! ,alue .

One side o! ea h apa itor onne ted to the round as sho5n in i,en belo5 !i ure

O! basi ir uit .

3in 9 is the R & T pin . It is an input and a ti,e hi h?normally lo5A . Upon applyin

a hi h pulse to this pin*the mi ro ontroller 5ill reset and terminate all a ti,ities . This

O!ten re!erred to as a power on reset. $ ti,atin a po5er-on reset 5ill ause all ,alues

in the re ister to be lost. It 5ill set pro ram ounter to all 0s.

4 2 3 a e

Page 49: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 49/67

UNI. R.NO-100070497676

/&g5 ,as&c c&rc%&t of ; =1

,as&c 3rogram of ; =1 5

or 0000h

a ainJmo, 30*Q::h

l all delay

mo, 30*Q0aah

l all delay

lBmp a ain

delayJ mo, r0*Q0!!h

hereJ dBnH r0*here

ret

end

49 23 a e

Page 50: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 50/67

UNI. R.NO-100070497676

#y usin this pro ram* 5e he ed the ,olta e le,el o! 0:1 as per the instru tions

applied in the pro ram .

The 0:1 mi ro ontrollers an pro,ide only lo5 input urrent and sin e their pins are

on!i ured as outputs 5hen ,olta e le,el on them is eFual to 0* dire t onne tin to

( ;s is arried out as it is sho5n in !i ure ?(o5 urrent ( ;* athode is onne ted

to output pinA.The resistor used here is urrent limitin resistor.

:0 2 3 a e

Page 51: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 51/67

UNI. R.NO-100070497676

C&rc%&t +&agram5Interfac&ng of ; =1 w&t# '+5

Program of '+0bl&nk&ng 5

or 0000h

a ainJ mo, p0*Q0!!h

a all delay

mo, p0*Q00h

a all delay

sBmp a ain

delay J mo, r1*Q0!!h

repeatJ mo, r0*Q0!!h

here J dBnH r0*here

:1 2 3 a e

Page 52: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 52/67

UNI. R.NO-100070497676

dBnH r1*repeat

ret

end

,l&nk&ng %s&ng T&mer Interr%3t 3rogramm&ng5

or 0000h

mo, a*Q01h

setb ea

setb et1

mo, tl1*Q00h

mo, th1*Q00h

mo, tmod*Q10h

setb tr1

% R J mo, p0*a

& +3 % R

or 001bh

lr tr1

rr a

mo, tl1*Q00%

mo, th1*Q00%

:/ 2 3 a e

Page 53: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 53/67

UNI. R.NO-100070497676

setb tr1

rti

end

(w&tc# &nterfac&ng w&t# ; =15

(w&tc# 3rogramm&ng 5

: 2 3 a e

Page 54: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 54/67

UNI. R.NO-100070497676

or 0000h

hereJ Bnb p ./*led\on

Bnb p . *led\o!!

sBmp here

led\onJ mo, p/*Q0!!h

a all delay

sBmp here

led\o!!J mo, p/*Q00h

a all delay

sBmp here

delayJ mo, r0*Q0!!h

returnJ mo, r1*Q0!!h

loopJ dBnH r1*loop

dBnH r0*return

ret

end

(w&tc# 3rogramm&ng %s&ng eEternal &nterr%3t 5

:4 2 3 a e

Page 55: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 55/67

UNI. R.NO-100070497676

or 0000h

sBmp home

or 000 h

mo, p0*Q0!!h

reti

or 001 h

mo, p0*Q00h

reti

homeJsetb ea

setb it0

setb it1

setb e 0

setb e 1

hereJ sBmp here

end

:: 2 3 a e

Page 56: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 56/67

Page 57: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 57/67

UNI. R.NO-100070497676

% brid e lo i is basi ally pro,ide a !or5ard and re,erse lo i to the motor.

The H-Bridge Circuit:

This circuit kno n !s th" #$%ri&'" (n!)"& *or its to+o,o'ic!, si)i,!rit- to th"

,"tt"r .#./ is co))on,- us"& to &ri " )otors In this circuit t o o* *our

tr!nsistors !r" s","cti ",- "n!%,"& to contro, curr"nt *,o throu'h ! )otor

:7 2 3 a e

Page 58: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 58/67

UNI. R.NO-100070497676

O++osit" +!ir o* tr!nsistors (Tr!nsistor On" !n& Tr!nsistor Thr""/ is "n!%,"&

!,,o in' curr"nt to *,o throu'h th" )otor Th" oth"r +!ir is &is!%,"& !n& c!n

%" thou'ht o* !s out o* th" circuit

- &"t"r)inin' hich +!ir o* tr!nsistors is "n!%,"& curr"nt c!n %" )!&" to

*,o in "ith"r o* th" t o &ir"ctions throu'h th" )otor "c!us" +"r)!n"nt$

)!'n"t )otors r" "rs" th"ir &ir"ction o* turn h"n th" curr"nt *,o is

r" "rs"& this circuit !,,o s %i&ir"ction!, contro, o* th" )otor

:.g C+ Interfac&ng5

1 LCD Int"r*!cin' ith 8051 Microcontro,,"r4 Th" LCDis c!,,"& 2 16 %"c!us" it h!s 'ot 2 ,in"s o* 16 ch!r!ct"rs

1 1 & !nt!'"s o* LCD4 LCDs !r" *!st r"+,!cin' th" L D %!s"&

7$s"')"nt &is+,!-s %"c!us" o* *o,,o in' r"!sons4

! 9ric"s o* LCDs !r" co)in' &o n

% LCDs c!n !,so &is+,!- nu)%"rs ch!r!ct"rs : 'r!+hics

c ;"*r"sh contro,,"r is incor+or!t"& in th" LCD

1.2 Pin Description of LCD: Th" LCD h!s 'ot tot!, o* 16 +ins< th"

&"scri+tion o* th" 9ins is 'i "n %",o 4

: 2 3 a e

Page 59: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 59/67

UNI. R.NO-100070497676

1. Vss, Vcc, Vee 4 =hi," Vcc !n& Vss +ro i&" >5 !n& 'roun&

r"s+"cti ",- V"" is us"& *or contro,,in' LCD contr!st

2. RS register se!ect": Th"r" !r" t o "r- i)+ort!nt r"'ist"r insi&" th"

LCD Th" ;? +in is us"& *or th"ir s","ction I* ;?@0 th" instruction

co))!n& co&" r"'ist"r is s","ct"& !,,o in' th" us"r to s"n& !

co))!n& such !s c,"!r &is+,!- cursor !t ho)" "tc I* ;?@1 th" &!t!

r"'ist"r is s","ct"& !,,o in' th" us"r to s"n& &!t! to %" &is+,!-"& on

LCD

#. R$% Re&d$%rite": ;A= in+ut !,,o s th" us"r to rit" in*or)!tion to

LCD or r"!& in*or)!tion *ro) it Bor r"!&in' ;A=@1 !n& *or ritin'

+ur+os" ;A=@0

'. ( (n&)!e": Th" "n!%," +in is us"& %- th" LCD to ,!tch in*or)!tion

+r"s"nt"& to its D!t! +ins =h"n &!t! is su++,i"& to its &!t! +ins !

:9 2 3 a e

Page 60: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 60/67

UNI. R.NO-100070497676

hi'h to ,o +u,s" )ust %" !++,- to this +in in or&"r *or th" LCD to ,!tch

in th" &!t! +r"s"nt !t th" &!t! +ins

*. D+-D : Th" 8$%it &!t! +ins D0$D7 !r" us"& to s"n& in*or)!tion to th"

LCD or r"!& th" cont"nts o* LCD int"rn!, r"'ist"rs To &is+,!- ,"tt"r

!n& nu)%"rs " s"n& ?CII co&" *or th" ,"tt"r $ !$ !n& nu)%"rs

0$E to th"s" +ins hi," )!kin' ;?@1 =" !,so us" ;?@0 to ch"ck th"

%us- *,!' %it to s"" i* th" LCD is r"!&- to r"c"i " in*or)!tion D7 is th"

%us- *,!' i* D7 @ 1 it )"!ns LCD is %us- : i* D7 @ 0 it )"!ns LCD is

*r"" D!t! shou,& %" 'i "n to LCD on,- h"n LCD is *r""

1.# Circuit Di&gr& :

60 23 a e

Page 61: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 61/67

UNI. R.NO-100070497676

1.' LCD- Co &nd Codes:

1.* LCD Code:

org ++++h

o &,/#0h AA LCD is con*i'ur"& !s 2 ,in" 5 7 )!tri

&c&!! co &nd AA co))!n& su% routin" is c!,,"&

o &,/+( AA Dis+,!- ON cursor ON

&c&!! co &nd

LCD is initi!,i "&

o &,/+1h AA LCD is c,"!r"&

&c&!! co &nd

o &,/+ h AA ?hi*t &is+,!- ri'ht

&c&!! co &nd

61 23 a e

Page 62: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 62/67

UNI. R.NO-100070497676

)&c : o &,/0+h AA %rin' cursor to %"'innin' o* ,in"1

&c&!! co &nd

o &,/343 AA 9rint ,"tt"r FM on 1st s+!c" on ,in"1

&c&!! d&t&1 AA c!,, &!t!1 su%routin"

o &,/3(3 AA 9rint ,"tt"r F on 2 n& s+!c" on ,in"1

&c&!! d&t&1

o &,/3D3 AA 9rint ,"tt"r FD on 3r& s+!c" on ,in"1

&c&!! d&t&1

o &,/3H3

&c&!! d&t&1

AA9rints FM D# VI

o &,/353

on *irst ,in"

&c&!! d&t&1

o &,/353

&c&!! d&t&1

o &,/3V3

&c&!! d&t&1

o &,/363

&c&!! d&t&1

s7 p )&c AA cursor is )o "& to %"'innin' o* ,in"1 !n&

)"ss!'" is +rint"r !'!in

co &nd: &c&!! re&d8 AA it is ch"ck"& i* LCD is *r"" H

o p#,& AA &!t! is )o "& to +ort3 !s it is conn"ct"& to

&!t! +ins o* LCD

c!r p1.* AA ;? @ 0 (co))!n& r"'ist"r is s","ct"&/

c!r p1. AA ;= @ 0 &!t! is %"in' ritt"n to LCD

set) p1. AA #i'h to Lo +u,s" to n!%," *or ,!tchin' th"

&!t!

c!r p1.

ret

6/ 2 3 a e

Page 63: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 63/67

UNI. R.NO-100070497676

d&t&1: &c&!! re&d8 AA it is ch"ck"& i* LCD is *r""H

o p#,& AA &!t! is )o "& to +ort3 !s it is conn"ct"& to &!t!

+ins o* LCD

set) p1.* AA ;? @ 1 (&!t! r"'ist"r is s","ct"&/

c!r p1. AA ;= @ 0 &!t! is %"in' ritt"n to LCD

set) p1. AA #i'h to Lo +u,s" to n!%," *or ,!tchin' th" &!t!

c!r p1.

ret

re&d8: set) p#. $$ r"!&- +in o* LCD (D7/

c!r p1.*

set) p1.

repe&t:c!r p1.

set) p1.

7) p#. ,repe&t

ret

end

,% er56

%u "r or %""+"r is !n !u&io si'n!,in' &" ic" hich )!-%" )"ch!nic!, ","ctro)"ch!nic!, or 9i" o","ctric T-+ic!, us"s o* %u "rs

!n& %""+"rs inc,u&" !,!r)s ti)"rs !n& con*ir)!tion o* us"r in+ut such !s !)ous" c,ick or k"-strok"

T8pes:

1.4ech&nic&! o- %u "r is !n " !)+," o* ! +ur",- )"ch!nic!, %u "r

2.(!ectro ech&nic&!

!r,- &" ic"s "r" %!s"& on !n ","ctro)"ch!nic!, s-st") i&"ntic!, to

!n ","ctric %",, ithout th" )"t!, 'on' ?i)i,!r,- ! r",!- )!- %" conn"ct"& toint"rru+t its o n !ctu!tin' curr"nt c!usin' th" cont!cts to %u O*t"n th"s"

6 2 3 a e

Page 64: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 64/67

UNI. R.NO-100070497676

units "r" !nchor"& to ! !,, or c"i,in' to us" it !s ! soun&in' %o!r& Th"or& .%u "r. co)"s *ro) th" r!s+in' nois" th!t ","ctro)"ch!nic!, %u "rs)!&"

#.Pie9oe!ectric

9i" o","ctric &isk %""+"r +i" o","ctric ",")"nt )!- %" &ri "n %- !n osci,,!tin' ","ctronic circuit oroth"r !u&io si'n!, sourc" &ri "n ith ! +i" o","ctric !u&io !)+,i*i"r ?oun&sco))on,- us"& to in&ic!t" th!t ! %utton h!s %""n +r"ss"& !r" ! c,ick ! rin'or ! %""+

ses: nnunci!tor +!n",s

,"ctronic )"trono)"sG!)" sho sMicro ! " o "ns !n& oth"r hous"ho,& !++,i!nc"s

?+ortin' " "nts such !s %!sk"t%!,, '!)"s

Circuit Di&gr& :-

64 23 a e

'N;

Page 65: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 65/67

UNI. R.NO-100070497676

Bu99er Code :-

org ++++h

here:set) p2.2

&c&!! de!&8

c!r p2.2

&c&!! de!&8

s7 p here

de!&8: o r+,/+ffh

repe&t: o r1,/+ffh&g&in:d7n9, &g&ind7n9, repe&t

retend

6: 2 3 a e

Page 66: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 66/67

Page 67: 6W 002 Training Report Draft

8/10/2019 6W 002 Training Report Draft

http://slidepdf.com/reader/full/6w-002-training-report-draft 67/67

UNI. R.NO-100070497676

@.,&b&l&ogra3#$

1. ; by &anBee, 'upta.

/. 0:1 +i ro ontroller by =ennith $yala