mrb06 bomb detection robot

Upload: csjain1

Post on 03-Jun-2018

233 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/12/2019 Mrb06 Bomb Detection Robot

    1/84

    INDEX

    CHAPTER 1. ABSTRACT

    CHAPTER2.INTRODUCTION TO EMBEDED SYSTEMS

    2.1 INTRODUCTION

    2.2 APPLICATIONS OF EMBEDDED SYSTEMS

    CHAPTER 3. INTRODUCTION TO MICROCNTROLLER

    3.1 AT89C51

    3.2 FEATURES

    3.3 TIMERS

    3.4 SERIAL COMMUNICATION

    3.5 INTERRUPTS

    CHAPTER 4. POWER SUPPLY

    CHAPTER 5. SPECIFIED TECHNOLOGY

    5.1L293D

    5.2DC MOTOR

    CHAPTER 6. SOFTWARE DEVELOPMENT

    CHAPTER 7. CONCLUSION

    7.1 CONCLUSION

    7.2 REFERENCE

  • 8/12/2019 Mrb06 Bomb Detection Robot

    2/84

  • 8/12/2019 Mrb06 Bomb Detection Robot

    3/84

    BOMB DETECTION ROBOT

    The pree!" #!$e!"#%! pr%$#&e ' #(p)e '!& re)'"#$e)* )%+ ,%" +'* %- per-%r(#! '

    (e"') %r /%(/ &e"e,"#%! "e" %! "he "e" *"e( "% &e"er(#!e +he"her %r !%" "he *"e( # 0/e,""% /%(/ ep)%#%!. The (e"') &e"e,"%r +#)) /e -#e& #! "he pre&e"er(#!e& 're' "% ,he, "he

    p%#/#)#"* %- ' (e"') %r ' /%(/. I- "here # '! e#"e!,e %- (e"') #! "h'" 're' "he (e"') &e"e,"%r

    #&e!"#-#e "he (e"') '!& #!"#('"e "h# "% "he ,%!"r%))#! 0!#". S#!,e "he h0('! ,'!!%" e!"er #!"%

    "he 're' +here "here "he /%(/ %r (e"') # pree!" ' R%/%" # e(p)%*e& "% (%$e #! "he #(0)'"e&

    e!$#r%!(e!" '!& ,%!"#!0%0)* (%!#"%r "he "'"0 %- "he (e"') &e"e,"%r #! "h'" p'r"#,0)'r 're'.

    The *"e( # e!"#re)* '! '0"%('"e& &e#!. The (#,r%,%!"r%))er p)'* ' $#"') r%)e #! "h#

    pr%e,". The ,%!"r%))#! e,"#%! +#)) /e -#e& "% "he r%/%". The ,%!"r%))#! ,%!"'#! "he

    (#,r%,%!"r%))er (e"') &e"e,"%r '!& "he /0er ,#r,0#".

    The (#,r%,%!"r%))er ,%!"#!0%0)* (%!#"%r "he %0"p0" %- "he (e"') &e"e,"%r. I- '!* (e"')

    # -%0!& "he (e"') &e"e,"%r re,%!#e #" '!& #" %0"p0" ,h'!e #((e'"e)*. The

    (#,r%,%!"r%))er &e"e," "h# '!& #((e'"e)* ')er" "he /0er.

    SOFTWARE AND HARDWARE TOOLS

    S!"#$%&' T!!()

    1. 6e#) ,%(p#)er

    2. Or,'&.

    H%&*$%&' T!!()

    1. M#,r%,%!"r%))er AT89S52.

    2. Me"') &e"e,"%r.3. B0er ,#r,0#"

    4. DC (%"%r '!& L293D -%r R%/%".

  • 8/12/2019 Mrb06 Bomb Detection Robot

    4/84

    B(!+, *-%&%/

  • 8/12/2019 Mrb06 Bomb Detection Robot

    5/84

    CHAPTER 2

    INTRODUCTION TO EMBEDDED SYSTEM

    2. INTRODUCTION TO EMBEDDED SYSTEM

  • 8/12/2019 Mrb06 Bomb Detection Robot

    6/84

    An embedded system is a special-purpose computer system designed to perform one or

    a few dedicated functions, sometimes with real-time computing constraints !t is usually

    embedded as part of a complete de"ice including hardware and mechanical parts !n contrast, a

    general-purpose computer, such as a personal computer, can do many different tas#s

    depending on programming Embedded systems ha"e become "ery important today as they

    control many of the common de"ices we use

    $ince the embedded system is dedicated to specific tas#s, design engineers can

    optimi%e it, reducing the si%e and cost of the product, or increasing the reliability and

    performance $ome embedded systems are mass-produced, benefiting from economies of

    scale

    Physically, embedded systems range from portable de"ices such as digital watches and

    &P' players, to large stationary installations li#e traffic lights, factory controllers, or the systems

    controlling nuclear power plants Comple(ity "aries from low, with a single microcontroller chip,

    to "ery high with multiple units, peripherals and networ#s mounted inside a large chassis or

    enclosure

    !n general, )embedded system) is not an e(actly defined term, as many systems ha"e

    some element of programmability *or e(ample, Handheld computers share some elements

    with embedded systems + such as the operating systems and microprocessors which power

    them + but are not truly embedded systems, because they allow different applications to be

    loaded and peripherals to be connected

    An embedded system is some combination of computer hardware and software, either

    fi(ed in capability or programmable, that is specifically designed for a particular #ind of

    application de"ice !ndustrial machines, automobiles, medical euipment, cameras, household

    appliances, airplanes, "ending machines, and toys as well as the more ob"ious cellular phone

    and P.A/ are among the myriad possible hosts of an embedded system Embedded systems

    that are programmable are pro"ided with a programming interface, and embedded systems

    programming is a speciali%ed occupation

    Certain operating systems or language platforms are tailored for the embedded mar#et,

    such as Embedded 0a"a and 1indows P Embedded Howe"er, some low-end consumer

    products use "ery ine(pensi"e microprocessors and limited storage, with the application and

    operating system both part of a single program The program is written permanently into the

  • 8/12/2019 Mrb06 Bomb Detection Robot

    7/84

    system3s memory in this case, rather than being loaded into RA& random access memory/, as

    programs on a personal computer are

    2.1 APPLICATIONS OF EMBEDDED SYSTEM

    1e are li"ing in the Embedded 1orld 4ou are surrounded with many embedded

    products and your daily life largely depends on the proper functioning of these gadgets

    Tele"ision, Radio, C. player of your li"ing room, 1ashing &achine or &icrowa"e 5"en in your

    #itchen, Card readers, Access Controllers, Palm de"ices of your wor# space enable you to do

    many of your tas#s "ery effecti"ely Apart from all these, many controllers embedded in your car

    ta#e care of car operations between the bumpers and most of the times you tend to ignore all

    these controllers

    !n recent days, you are showered with "ariety of information about these embedded

    controllers in many places All #inds of maga%ines and 6ournals regularly dish out details about

    latest technologies, new de"ices7 fast applications which ma#e you belie"e that your basic

    sur"i"al is controlled by these embedded products 8ow you can agree to the fact that these

    embedded products ha"e successfully in"aded into our world 4ou must be wondering about

    these embedded controllers or systems 1hat is this Embedded $ystem9

    The computer you use to compose your mails, or create a document or analy%e the

    database is #nown as the standard des#top computer These des#top computers are

    manufactured to ser"e many purposes and applications

    4ou need to install the rele"ant software to get the reuired processing facility $o, these

    des#top computers can do many things !n contrast, embedded controllers carryout a specific

    wor# for which they are designed &ost of the time, engineers design these embedded

    controllers with a specific goal in mind $o these controllers cannot be used in any other place

    Theoretically, an embedded controller is a combination of a piece of microprocessor based

    hardware and the suitable software to underta#e a specific tas#

    These days designers ha"e many choices in microprocessors:microcontrollers

    Especially, in ; bit and '2 bit, the a"ailable "ariety really may o"erwhelm e"en an e(perienced

    designer $electing a right microprocessor may turn out as a most difficult first step and it is

    getting complicated as new de"ices continue to pop-up "ery often

  • 8/12/2019 Mrb06 Bomb Detection Robot

    8/84

    !n the ; bit segment, the most popular and used architecture is !ntel3s ;

  • 8/12/2019 Mrb06 Bomb Detection Robot

    9/84

    Ele"troni" a!!li"ation and "on&%er de'i"e

    As the number of powerful embedded processors in consumer de"ices continues to rise, the

    Blue Cat@ ?inu(@ operating system pro"ides a highly reliable and royalty-free option for

    systems designers

    And as the wireless appliance re"olution rolls on, web-enabled na"igation systems, radios,

    personal communication de"ices, phones and P.As all benefit from the cost-effecti"e

    dependability, pro"en stability and full product life-cycle support opportunities associated with

    Blue Cat embedded ?inu( Blue Cat has teamed up with industry leaders to ma#e it easier to

    build ?inu( mobile phoneswith 0a"a integration

    *or ma#ers of low-cost consumer electronic de"ices who wish to integrate the ?yn(5$ real-

    time operating system into their products, we offer special &$RP-based pricing to reduce

    royalty fees to a negligible portion of the de"ice3s &$RP

    Ind&trial a&to%ation and !ro"e "ontrol o#t$are

    .esigners of industrial and process control systems#now from e(perience that ?ynu(1or#s

    operating systems pro"ide the security and reliability that their industrial applications

    reuire*rom !$5 D

  • 8/12/2019 Mrb06 Bomb Detection Robot

    10/84

    CHAPTER '

    !8TR5.CT!58 T5 &!CR5C58TR5??ER$

  • 8/12/2019 Mrb06 Bomb Detection Robot

    11/84

    MICRO CONTROLLER ()C*1

    I0#&!*+#-!0

    A M#,r% ,%!"r%))er ,%!#" %- ' p%+er-0) CPU "#h")* ,%0p)e& +#"h (e(%r* $'r#%0 IO

    #!"er-',e 0,h ' er#') p%r" p'r'))e) p%r" "#(er %r ,%0!"er #!"err0p" ,%!"r%))er &'"' ',0##"#%!

    #!"er-',eA!')% "% D##"') ,%!$er"er D##"') "% A!')% ,%!$er"er #!"er'"e& %! "% ' #!)e

    #)#,%! ,h#p.

    I- ' *"e( # &e$e)%pe& +#"h ' (#,r%pr%,e%r "he &e#!er h' "% % -%r e"er!')

    (e(%r* 0,h ' RAM ROM EPROM '!& per#pher'). B0" ,%!"r%))er # pr%$#&e& ')) "hee

    -',#)#"#e %! ' #!)e ,h#p. De$e)%p(e!" %- ' M#,r% ,%!"r%))er re&0,e PCB #e '!& ,%" %-

    &e#!.

    O!e %- "he ('%r --ere!,e /e"+ee! ' M#,r%pr%,e%r '!& ' M#,r% ,%!"r%))er # "h'" '

    ,%!"r%))er %-"e! &e') +#"h /#" !%" /*"e ' #! "he re') +%r)& 'pp)#,'"#%!.

    I!"e) h' #!"r%&0,e& ' -'(#)* %- M#,r% ,%!"r%))er ,'))e& "he MCS51.

    T' M%!& F'%#&')

    C%(p'"#/)e +#"h MCS51 pr%&0,"

    4 B*"e %- #!*"e( Repr%r'(('/)e -)'h (e(%r*

    F0))* "'"#, %per'"#%!: ;

  • 8/12/2019 Mrb06 Bomb Detection Robot

    12/84

    controller satisfactorily ser"es the abo"e application sing an ine(pensi"e ;-bit &icrocontroller

    will doom the '2-bit product failure in any competiti"e mar#et place

    C%(#! "% "he 0e"#%! %- +h* "% 0e AT89C51 %- ')) "he 8/#" (#,r%,%!"r%))er '$'#)'/)e

    #! "he ('re" "he ('#! '!+er +%0)& /e /e,'0e #" h' 4 6/ %! ,h#p -)'h (e(%r* +h#,h # 0"0--#,#e!" -%r %0r 'pp)#,'"#%!. The %!,h#p F)'h ROM '))%+ "he pr%r'( (e(%r* "% /e

    repr%r'((e& #! *"e( %r /* ,%!$e!"#%!') !%!$%)'"#)e (e(%r* Pr%r'((er. M%re%$er

    ATMEL # "he )e'&er #! -)'h "e,h!%)%* #! "%&'*@ ('re" p)',e '!& he!,e 0#! AT 89C51 #

    "he %p"#(') %)0"#%!.

    AT()C*1 MICROCONTROLLER ARC-ITECTURE

    The ;DC>= architecture consists of these specific featuresG

    Eight bit CP with registers A the accumulator/ and B

    $i(teen-bit program counter PC/ and data pointer .PTR/

    Eight- bit stac# pointer P$1/

    Eight-bit stac# pointer $p/

    !nternal R5& or EPR5& ;>=/ of

  • 8/12/2019 Mrb06 Bomb Detection Robot

    13/84

    *ig G *unctional bloc# diagram of micro controller

    T,e ()C*1 o"illator and "lo"/

    The he'r" %- "he 89C51 ,#r,0#"r* "h'" e!er'"e "he ,)%, p0)e /* +h#,h ')) "he #!"er!')

    ')) #!"er!') %per'"#%! 're *!,hr%!#e&. P#! TAL1 A!& TAL2 # pr%$#&e& -%r ,%!!e,"#! '

    re%!'!" !e"+%r "% -%r( '! %,#))'"%r. T*p#,'))* ' 0'r" ,r*"') '!& ,'p',#"%r 're e(p)%*e&.

    The ,r*"') -re0e!,* # "he /'#, #!"er!') ,)%, -re0e!,* %- "he (#,r%,%!"r%))er. The

    ('!0-',"0rer ('e 89C51 &e#! "h'" r0! '" pe,#-#, (#!#(0( '!& ('#(0( -re0e!,#e

    "*p#,'))* 1 "% 1 M

  • 8/12/2019 Mrb06 Bomb Detection Robot

    14/84

    O,#))'"%r '!& "#(#! ,#r,0#"

    Ty!e o# %e%ory/

    The ;DC>= ha"e three general types of memory They are on-chip memory, e(ternal

    Code memory and e(ternal Ram 5n-Chip memory refers to physically e(isting memory on the

    micro controller itself E(ternal code memory is the code memory that resides off chip This is

    often in the form of an e(ternal EPR5& E(ternal RA& is the Ram that resides off chip This

    often is in the form of standard static RA& or flash RA&

    a0 Code %e%ory

    Code memory is the memory that holds the actual ;DC>= programs that is to be run

    This memory is limited to FI Code memory may be found on-chip or off-chip !t is possible to

    ha"e FI of code memory on-chip and

  • 8/12/2019 Mrb06 Bomb Detection Robot

    15/84

    0 Internal RAM

    The ;DC>= ha"e a ban# of =2; of internal RA& The internal RA& is found on-chip $o it

    is the fastest Ram a"ailable And also it is most fle(ible in terms of reading and writing !nternal

    Ram is "olatile, so when ;DC>= is reset, this memory is cleared =2; bytes of internal memory

    are subdi"ided The first '2 bytes are di"ided into F register ban#s Each ban# contains ;

    registers !nternal RA& also contains =2; bits, which are addressed from 2

  • 8/12/2019 Mrb06 Bomb Detection Robot

    16/84

    architecture7 low power7 high reliability

    ROM

    Read-5nly &emory

    &ature, high-density, reliable, low cost7

    time-consuming mas# reuired, suitable

    for high production with stable code

    SRAM

    $tatic Random-Access &emory

    Highest speed, high-power, low-density

    memory7 limited density dri"es up cost

    EPROM

    Electrically Programmable Read-5nly

    &emory

    High-density memory7 must be e(posed

    to ultra"iolet light for erasure

    EEPROMorE2PROM

    Electrically Erasable Programmable

    Read-5nly &emory

    Electrically byte-erasable7 lower

    reliability, higher cost, lowest density

    DRAM

    .ynamic Random Access &emory

    High-density, low-cost, high-speed,

    high-power

    Te",ni"al O'er'ie$ o# Fla, Me%ory

    *lash memory is a non"olatile memory using 85R technology, which allows the user to

    electrically program and erase information !ntel@ *lash memory uses memory cells similar to

    an EPR5&, but with a much thinner, precisely grown o(ide between the floating gate and the

    source *lash programming occurs when electrons are placed on the floating gate The charge

    is stored on the floating gate, with the o(ide layer allowing the cell to be electrically erased

    through the source !ntel *lash memory is an e(tremely reliable non"olatile memory

    architecture

  • 8/12/2019 Mrb06 Bomb Detection Robot

    17/84

    F# 8: P#! 'r'( %- AT89C51

    Pin De"ri!tion/

    CC/ $upply "oltage

    3ND/ Lround

    Port 4/

    P%r" ; # '! 8/#" %pe!&r'#! /#re,"#%!') IO p%r". A '! %0"p0" p%r" e',h p#! ,'! #!

    e#h" TTL #!p0". he! %!e@ 're +r#""e! "% p%r" ; p#! "he p#! ,'! /e 0e& ' h#h #(pe&'!,e

    #!p0". P%r" ; ('* ')% /e ,%!-#0re& "% /e "he (0)"#p)ee& )%+ %r&er '&&re&'"' /0 &0r#!

    ',,ee "% e"er!') pr%r'( '!& &'"' (e(%r*. I! "h# (%&e P; h' #!"er!') p0))0p. P%r" ; ')%

    re,e#$e "he ,%&e /*"e &0r#! F)'h pr%r'((#! '!& %0"p0" "he ,%&e /*"e &0r#! pr%r'(

    $er#-#,'"#%!. E"er!') p0))0p 're re0#re& &0r#! pr%r'( $er#-#,'"#%!.

  • 8/12/2019 Mrb06 Bomb Detection Robot

    18/84

    Port 1/

    P%r" 1 # '! 8/#" /#re,"#%!') IO p%r" +#"h #!"er!') p0))0p. The P%r" 1 %0"p0" /0--er

    ,'! #!%0r,e -%0r TTL #!p0". he! 1 're +r#""e! "% P%r" 1 p#! "he* 're p0))e& h#h /* "he

    #!"er!') p0))0p '!& ,'! /e 0e& ' #!p0". A #!p0" P%r" 1 p#! "h'" 're e"er!'))* /e#! p0))e&)%+ +#)) %0r,e ,0rre!" IIL /e,'0e %- "he #!"er!') p0))0p. P%r" 1 ')% re,e#$e "he )%+%r&er

    '&&re /*"e &0r#! F)'h pr%r'((#! '!& $er#-#,'"#%!.

    Port 2/

    P%r" 2 # '! 8/#" /#re,"#%!') IO p%r" +#"h #!"er!') p0))0p. The P%r" 2 %0"p0" /0--er

    ,'! #!%0r,e -%0r TTL #!p0". he! 1 're +r#""e! "% P%r" 2 p#! "he* 're p0))e& h#h /* "he

    #!"er!') p0))0p '!& ,'! /e 0e& ' #!p0". A #!p0" P%r" 2 p#! "h'" 're e"er!'))* /e#! p0))e&)%+ +#)) %0r,e ,0rre!" IIL /e,'0e %- "he #!"er!') p0))0p. P%r" 2 e(#" "he h#h%r&er '&&re

    /*"e &0r#! -e",he -r%( e"er!') pr%r'( (e(%r* '!& &0r#! ',,ee "% e"er!') &'"'

    (e(%r#e "h'" 0e 1/#" '&&ree MO GDPTR. I! "h# 'pp)#,'"#%! #" 0e "r%! #!"er!')

    p0))0p +he! e(#""#! 1. D0r#! ',,ee "% e"er!') &'"' (e(%r#e "h'" 0e 8/#" '&&ree

    MO G RI P%r" 2 e(#" "he ,%!"e!" %- "he P2 Spe,#') F0!,"#%! Re#"er. P%r" 2 ')%

    re,e#$e "he h#h%r&er '&&re /#" '!& %(e ,%!"r%) #!') &0r#! F)'h pr%r'((#! '!&

    $er#-#,'"#%!.

    Port 5/

    Port ' is an ;-bit bi-directional !:5 port with internal pull-ups The Port ' output buffers

    can sin#:source four TT? inputs 1hen =s are written to Port ' pins they are pulled high by the

    internal pull-ups and can be used as inputs As inputs, Port ' pins that are e(ternally being

    pulled low will source current !!?/ because of the pull-ups

    Port ' also ser"es the functions of "arious special features of the AT;DC>= as listed belowG

    Port ' also recei"es some control signals for *lash programming and "erification

  • 8/12/2019 Mrb06 Bomb Detection Robot

    19/84

    Tab 2= Port pins and their alternate functions

    RST/

    Reset input A high on this pin for two machine cycles while the oscillator is running

    resets the de"ice

    ALE6PRO3/

    A&&re L'",h E!'/)e %0"p0" p0)e -%r )'",h#! "he )%+ /*"e %- "he '&&re &0r#!

    ',,ee "% e"er!') (e(%r*. Th# p#! # ')% "he pr%r'( p0)e #!p0" PROH &0r#! F)'h

    pr%r'((#!. I! !%r(') %per'"#%! ALE # e(#""e& '" ' ,%!"'!" r'"e %- 1"he %,#))'"%r

    -re0e!,* '!& ('* /e 0e& -%r e"er!') "#(#! %r ,)%,#! p0rp%e. N%"e h%+e$er "h'" %!e

    ALE p0)e # #ppe& &0r#! e',h ',,e "% e"er!') D'"' Me(%r*.

    !f desired, A?E operation can be disabled by setting bit < of $*R location ;EH 1ith the bit set,

    A?E is acti"e only during a &5M or &5MC instruction 5therwise, the pin is pulled high

    $etting the A?E-disable bit has no effect if the microcontroller is in e(ternal e(ecution mode

    PSEN/

    Pr%r'( S"%re E!'/)e # "he re'& "r%/e "% e"er!') pr%r'( (e(%r*. he! "he

    AT89C51 # ee,0"#! ,%&e -r%( e"er!') pr%r'( (e(%r* PSEN # ',"#$'"e& "+#,e e',h

    (',h#!e ,*,)e e,ep" "h'" "+% PSEN ',"#$'"#%! 're #ppe& &0r#! e',h ',,e "% e"er!') &'"'

    (e(%r*.

  • 8/12/2019 Mrb06 Bomb Detection Robot

    20/84

    EA6PP/

    E(ternal Access Enable EA must be strapped to L8. in order to enable the de"ice to

    fetch code from e(ternal program memory locations starting at

  • 8/12/2019 Mrb06 Bomb Detection Robot

    21/84

    *ig D 5scillator Connections

    *ig =< E(ternal Cloc# .ri"e Configuration

    N!#'):

    2 nder steady state non-transient/ conditions, !5? must be e(ternally

    limited as followsG

    &a(imum !5? per port pin G =< mA

    &a(imum !5? per ;-bit port G Port < G 2 mA

    Ports =, 2, 'G => mA

    &a(imum total !5? for all output pinsG = mA

  • 8/12/2019 Mrb06 Bomb Detection Robot

    22/84

    !f !5? e(ceeds the test condition, M5? may e(ceed the related specification Pins are

    not guaranteed to sin# current greater than the listed test conditions

    2. &inimum MCC for Power-down is 2M

    RE3ISTERS/

    !n the CP, registers are used to store information temporarily That information could

    be a byte of data to be processed, or an address pointing to the data to be fetched The "ast

    ma6ority of ;= registers are ;bit registers !n the ;= there is only one data typeG ;bits

    The ;bits of a register are shown in the diagram from the &$B most significant bit/ . to the

    ?$B least significant bit/ .

  • 8/12/2019 Mrb06 Bomb Detection Robot

    23/84

    1. The Spe,#') -0!,"#%! re#"er h'$e '&&ree /e"+ee! 8;< '!& FF

  • 8/12/2019 Mrb06 Bomb Detection Robot

    24/84

    8

    T2&5

    .

    Timer:counter mode2 control

  • 8/12/2019 Mrb06 Bomb Detection Robot

    25/84

    #". O!,e '! 'r#"h(e"#,') %per'"#%! # pre-%r(e& /* "he ALU "he re0)" # p)',e& #!"% "he

    ',,0(0)'"%r. I- ' &'"' h%0)& /e "r'!-erre& -r%( %!e re#"er "% '!%"her #" (0" % "hr%0h

    ',,0(0)'"%r. F%r 0,h 0!#$er') p0rp%e "h# # "he (%" ,%((%!)* 0e& re#"er "h'" !%!e

    (#,r%,%!"r%))er ,'! /e #('#!e& +#"h%0" (%re "h'! ' h')- 8;51 (#,r%,%!"r%))er@ #!"r0,"#%!

    0e& 0e "he ',,0(0)'"%r #! %(e +'*.

    B Re8iter

    B re#"er # 0e& &0r#! (0)"#p)* '!& $#&e %per'"#%! +h#,h ,'! /e per-%r(e& %!)* 0p%!

    !0(/er "%re& #! "he A '!& B re#"er. A)) %"her #!"r0,"#%! #! "he pr%r'( ,'! 0e "h#

    re#"er ' ' p're ',,0(0)'"%r A.

    *ig =2G B register

    .uring programming, each of registers is called by name so that their e(act address is

    not so important for the user .uring compiling into machine code series of he(adecimal

    numbers recogni%ed as instructions by the microcontroller/, PC will automatically, instead of

    registersN name, write necessary addresses into the microcontroller

    R Re8iter 9R4:R;0

  • 8/12/2019 Mrb06 Bomb Detection Robot

    26/84

    *ig ='GRA&

    Th# # ' ,%((%! !'(e -%r "he "%"') 8 e!er') p0rp%e re#"er R; R1 '!& R2 ...R7.

    E$e! "he* 're !%" "r0e SFR "he* &eer$e "% /e ,0e& here /e,'0e %- "he#r p0rp%e. The

    /'! # ',"#$e +he! "he R re#"er #" #!,)0&e 're #! 0e. S#(#)'r "% "he ',,0(0)'"%r "he* 're

    0e& -%r "e(p%r'r* "%r#! $'r#'/)e '!& #!"er(e'"e re0)". h#,h %- "he /'! +#)) /e ',"#$e

    &epe!& %! "+% /#" #!,)0&e& #! "he PS Re#"er. Thee re#"er 're "%re& #! -%0r /'! #! "he

    ,%pe %- RAM.

    The -%))%+#! e'(p)e /e" #))0"r'"e "he 0e-0) p0rp%e %- "hee re#"er. S0pp%e "h'"

    ('"he('"#,') %per'"#%! %! !0(/er pre$#%0)* "%re& #! "he R re#"er h%0)& /e per-%r(e&:

    R1JR2 ? R3JR4. O/$#%0)* ' re#"er -%r "e(p%r'r* "%r#! re0)" %- '&"#%! # !ee&e&.

    E$er*"h#! # 0#"e #(p)e '!& "he pr%r'( # ' -%))%+:

    MOV A R38 Me'!: (%$e !0(/er -r%( R3 #!"% ',,0(0)'"%r

    ADD A R48 Me'!: '&& !0(/er -r%( R4 "% ',,0(0)'"%r re0)" re('#! #! ',,0(0)'"%r

    MOV R5 A8 Me'!: "e(p%r'r#)* (%$e "he re0)" -r%( ',,0(0)'"%r #!"% R5

    MOV A R18 Me'!: (%$e !0(/er -r%( R1 #!"% ',,0(0)'"%r

    ADD A R28 Me'!: '&& !0(/er -r%( R2 "% ',,0(0)'"%r

    SUBB A R58 Me'!: 0/"r'," !0(/er -r%( R5 "here 're R3JR4

  • 8/12/2019 Mrb06 Bomb Detection Robot

    27/84

    (4*1 Re8iter Ban and Sta"

    RAM %e%ory !a"e allo"ation in t,e (4*1

    There are =2; bytes of RA& in the ;= The =2; bytes of RA& inside the ;= are

    assigned addresses

  • 8/12/2019 Mrb06 Bomb Detection Robot

    28/84

    !f RA& locations

  • 8/12/2019 Mrb06 Bomb Detection Robot

    29/84

    *ig =>G ;= Register Ban#s and their RA& Addresses

    PS+ Re8iter 9Pro8ra% Stat& +ord0

    *ig =G P$1 register

    Th# # %!e %- "he (%" #(p%r"'!" SFR. The Pr%r'( S"'"0 %r& PS ,%!"'#!

    e$er') "'"0 /#" "h'" re-)e," "he ,0rre!" "'"e %- "he CPU. Th# re#"er ,%!"'#!: C'rr* /#"

    A0#)#'r* C'rr* "+% re#"er /'! e)e," /#" O$er-)%+ -)' p'r#"* /#" '!& 0er&e-#!'/)e "'"0

    -)'. The ALU '0"%('"#,'))* ,h'!e %(e %- re#"er@ /#" +h#,h # 00'))* 0e& #! re0)'"#%!

    %- "he pr%r'( per-%r(#!.

  • 8/12/2019 Mrb06 Bomb Detection Robot

    30/84

    P 9 P%&-#: ;-#I- ' !0(/er #! ',,0(0)'"%r # e$e! "he! "h# /#" +#)) /e '0"%('"#,'))* e" 1

    %"her+#e #" +#)) /e ,)e're& ;. I" # ('#!)* 0e& &0r#! &'"' "r'!(##%! '!& re,e#$#! $#'

    er#') ,%((0!#,'"#%!.

    < B-# 1.Th# /#" # #!"e!&e& -%r "he -0"0re $er#%! %- "he (#,r%,%!"r%))er % #" # !%" 0pp%e& "%

    /e here.

    OV O='&"(!$%,,0r +he! "he re0)" %- 'r#"h(e"#,') %per'"#%! # re'"er "h'! 255 &e,#(') %

    "h'" #" ,'! !%" /e "%re& #! %!e re#"er. I! "h'" ,'e "h# /#" +#)) /e e" 1. I- "here # !%

    %$er-)%+ "h# /#" +#)) /e ,)e're& ;.

    RS> RS1 9 R'-)#'& ;%0, )'('+#) ;-#). Thee "+% /#" 're 0e& "% e)e," %!e %- "he -%0r re#"er

    /'! #! RAM. B* +r#"#! er%e '!& %!e "% "hee /#" ' r%0p %- re#"er R;R7 # "%re& #!

    %!e %- -%0r /'! #! RAM.

    RS1 RS2 S!a"e in RAM

    < < Ban#<

  • 8/12/2019 Mrb06 Bomb Detection Robot

    31/84

    Thee re#"er 're !%" "r0e %!e /e,'0e "he* &% !%" ph*#,'))* e#". The* ,%!#" %-

    "+% ep'r'"e re#"er: DP< D'"' P%#!"er

  • 8/12/2019 Mrb06 Bomb Detection Robot

    32/84

    H!$ )#%+,) %&' %++'))'* -0 #' @>51

    I- "he "', # ' e,"#%! %- RAM "here (0" /e re#"er #!#&e "he CPU "% p%#!" "% #".

    The re#"er 0e& "% ',,e "he "', # ,'))e& "he SP S"', p%#!" Re#"er. The "', p%#!"er #!

    "he 8;51 # %!)* 8 /#" +#&eK +h#,h (e'! "h'" #" ,'! "'e $')0e %- ;; "% FF

  • 8/12/2019 Mrb06 Bomb Detection Robot

    33/84

    +e ,'! ,h'!e "he SP "% p%#!" "% RAM )%,'"#%! 3;7F

  • 8/12/2019 Mrb06 Bomb Detection Robot

    34/84

    T:') !" -0)#&+#-!0)

    Depe!! %! %per'"#%! "he* per-%r( ')) #!"r0,"#%! 're $#&e& #! e$er') r%0p:

    Arithmetic !nstructions

    Branch !nstructions

    .ata Transfer !nstructions

    ?ogical !nstructions

    ?ogical !nstructions with bits

    The -#r" p'r" %- e',h #!"r0,"#%! ,'))e& MNEMONIC re-er "% "he %per'"#%! '! #!"r0,"#%!

    per-%r( ,%p*#! '&"#%! )%#,') %per'"#%! e",.. M!e(%!#, ,%((%!)* 're h%r"e!e& -%r(

    %- !'(e %- %per'"#%! /e#! ee,0"e&. F%r e'(p)e:

    INC R17 !ncrement R= increment register R=/

    LJMP LAB5 7?ong 0ump ?AB> long 6ump to address specified as ?AB>/

    JNZ LOOP 70ump if 8ot ero ?55P if the number in the accumulator is not

  • 8/12/2019 Mrb06 Bomb Detection Robot

    35/84

    Arit,%eti" intr&"tion

    Thee #!"r0,"#%! per-%r( e$er') /'#, %per'"#%! '&"#%! 0/"r',"#%! $##%!

    (0)"#p)#,'"#%! e",. A-"er ee,0"#%! "he re0)" # "%re& #! "he -#r" %per'!&. F%r e'(p)e:

    ADD A, R1 The result of addition AQR=/ will be stored in the accumulator

    Arit,%eti"al Intr&"tion

    Mne%oni" De"ri!tionByte

    N&%er

    O"illator

    Period

    A.. A,Rn Add R Register to accumulator = =

    A.. A,R(Add directly addressed R( Register to

    accumulator2 2

    A.. A,RiAdd indirectly addressed Register to

    accumulator= =

    A.. A,S Add number to accumulator 2 2

    A..C A,Rn Add R Register with Carry bit to accumulator = =

    Bran", Intr&"tion

    There 're "+% #!& %- "hee #!"r0,"#%!:

    U0+!0*-#-!0%( / -0)#&+#-!0)

    A-"er "he#r ee,0"#%! ' 0(p "% ' !e+ )%,'"#%! -r%( +here "he pr%r'( ,%!"#!0e

    ee,0"#%! # ee,0"e&.

    C!0*-#-!0%( / -0)#&+#-!0)

  • 8/12/2019 Mrb06 Bomb Detection Robot

    36/84

    I- %(e ,%!"#%! # (e" ? ' 0(p # ee,0"e&. O"her+#e "he pr%r'( !%r('))*

    pr%,ee& +#"h "he !e" #!"r0,"#%!.

    Bran", Intr&"tion

    Mne%oni" De"ri!tionByte

    N&%er

    O"illator

    Period

    ACA?? adr==Call subroutine located at address within 2 I byte

    Program &emory space2 '

    ?CA?? adr=Call subroutine located at any address within F I

    byte Program &emory space' F

    RET Return from subroutine = F

    RET! Return from interrupt routine = F

    A0&P adr==0ump to address located within 2 I byte Program

    &emory space2 '

    ?0&P adr=0ump to any address located within F I byte

    Program &emory space' F

    Data Tran#er Intr&"tion

    Thee #!"r0,"#%! (%$e "he ,%!"e!" %- %!e re#"er "% '!%"her %!e. The re#"er +h#,h

    ,%!"e!" # (%$e& re('#! 0!,h'!e&. I- "he* h'$e "he 0--# MO "he &'"' #

    e,h'!e& +#"h e"er!') (e(%r*.

    Data Tran#er Intr&"tion

    Mne%oni" De"ri!tionByte

    N&%er

    Cy"le

    N&%er

    &5M A,Rn &o"e R register to accumulator = =

  • 8/12/2019 Mrb06 Bomb Detection Robot

    37/84

    &5M A,R(&o"e directly addressed R( register to

    accumulator2 2

    &5M A,Ri&o"e indirectly addressed register to

    accumulator

    = =

    &5M A,S &o"e number to accumulator 2 2

    Lo8i"al Intr&"tion

    Thee #!"r0,"#%! per-%r( )%#,') %per'"#%! /e"+ee! ,%rrep%!! /#" %- "+%

    re#"er. A-"er ee,0"#%! "he re0)" # "%re& #! "he -#r" %per'!&.

    Lo8i"al Intr&"tion

    Mne%oni" De"ri!tionByte

    N&%er

    Cy"le

    N&%er

    A8? A,Rn ?ogical A8. between accumulator and R register = =

    A8? A,R(?ogical A8. between accumulator and directly

    addressed register R(

    2 2

    A8? A,Ri?ogical A8. between accumulator and indirectly

    addressed register= =

    A8? A,S ?ogical A8. between accumulator and number 2 2

    Lo8i"al O!eration on Bit

    S#(#)'r "% )%#,') #!"r0,"#%! "hee #!"r0,"#%! per-%r( )%#,') %per'"#%!. The

    --ere!,e # "h'" "hee %per'"#%! 're per-%r(e& %! #!)e /#".

    Lo8i"al o!eration on it

    Mne%oni" De"ri!tion Byte Cy"le

  • 8/12/2019 Mrb06 Bomb Detection Robot

    38/84

    N&%er N&%er

    C?R C Clear Carry bit = =

    C?R bit Clear directly addressed bit 2 2

    $ETB C $et Carry bit = =

    $ETB bit $et directly addressed bit 2 2

    CP? C Complement Carry bit = =

    CP? bit Complement directly addressed bit 2 2

    TIMERS

    5n-chip timing:counting facility has pro"ed the capabilities of the microcontroller for

    implementing the real time application These includes pulse counting, freuency measurement,

    pulse width measurement, baud rate generation, etc, Ha"ing sufficient number of

    timer:counters may be a need in a certain design application The ;= has two

    timers:counters They can be used either as timers to generate a time delay or as counters to

    count e"ents happening outside the microcontroller ?et discuss how these timers are used to

    generate time delays and we will also discuss how they are been used as e"ent counters

    PRO3RAMMIN3 (4*1 TIMERS

    The ;= has timersG Timer < and Timer=they can be used either as timers or as e"ent

    counters ?et us first discuss about the timersN registers and how to program the timers to

    generate time delays

    BASIC RI3ISTERS OF T-E TIMER

    Both Timer < and Timer = are = bits wide $ince the ;= has an ;-bit architecture,

    each =-bit timer is accessed as two separate registers of low byte and high byte

    TIMER 4 RE3ISTERS

  • 8/12/2019 Mrb06 Bomb Detection Robot

    39/84

    The =-bit register of Timer < is accessed as low byte and high byte The low byte

    register is called T?

  • 8/12/2019 Mrb06 Bomb Detection Robot

    40/84

    MODES/

    M1< M4/

    &< and &= are used to select the timer mode There are three modesG Bit pre-scaler

    4 1 1 =-bit timer mode

    =-bit timer:counters TH( withT?( are Cascaded7 there is no

    prescaler

    1 < 2 ;-bit auto reload

    ;-bit auto reload

  • 8/12/2019 Mrb06 Bomb Detection Robot

    41/84

    timer:counter7TH( Holds a

    "alue that is to be reloaded

    into T?( each time it

    o"erflows

    1 1 5 $plit timer mode

    C6T 9"lo"6ti%er0

    This bit in the T&5. register is used to decide whether the timer is used as a delay

    generator or an e"ent counter !f C:T

  • 8/12/2019 Mrb06 Bomb Detection Robot

    42/84

    $erial data communication uses two methods, asynchronous and synchronous The

    synchronous method transfers a bloc# of data at a time, while the asynchronous method

    transfers a single byte at a time

    !n data transmission if the data can be transmitted and recei"ed, it is a duple(

    transmission This is in contrast to simple( transmissions such as with printers, in which the

    computer only sends data .uple( transmissions can be half or full duple(, depending on

    whether or not the data transfer can be simultaneous !f data is transmitted one way at a time, it

    is referred to as half duple( !f the data can go both ways at the same time, it is full duple( 5f

    course, full duple( reuires two wire conductors for the data lines, one for transmission and one

    for reception, in order to transfer and recei"e data simultaneously

    Ayn",rono& erial "o%%&ni"ation and data #ra%in8

    The data coming in at the recei"ing end of the data line in a serial data transfer is all

  • 8/12/2019 Mrb06 Bomb Detection Robot

    43/84

    The data transfer rate of gi"en computer system depends on communication ports

    incorporated into that system *or e(ample, the early !B&PC:T could transfer data at the rate

    of =M, while

    a < bit is Q' to Q2>M, ma#ing -' to Q' undefined *or this reason, to connect any R$2'2 to a

    microcontroller system we must use "oltage con"erters such as &A2'2 to con"ert the TT?

    logic le"els to the R$2'2 "oltage le"els, and "ice "ersa &A2'2 !C chips are commonly

    referred to as line dri"ers

    RS252 !in

    RS232 ,'/)e # ,%((%!)* re-erre& "% ' "he DB25 ,%!!e,"%r. I! )'/e)#! DB25P

    re-er "% "he p)0 ,%!!e,"%r (')e '!& DB25S # -%r "he %,e" ,%!!e,"%r -e(')e. S#!,e !%"

    ')) "he p#! 're 0e& #! PC ,'/)e IBM #!"r%&0,e& "he DB9 er#%! %- "he er#') IO "'!&'r&

    +h#,h 0e 9 p#! %!)* ' h%+! #! "'/)e.

    1 2 3 4 5

    7 8 9

    5ut of computer and e(posed end of cable/

    *ig 2=G .B-D pin connector

    Pin *unctionsG

  • 8/12/2019 Mrb06 Bomb Detection Robot

    44/84

    P#! De,r#p"#%!

    1 D'"' ,'rr#er &e"e," DCD

    2 Re,e#$e& &'"' RD

    3 Tr'!(#""e& &'"' TD

    4 D'"' "er(#!') re'&*DTR

    5 S#!') r%0!& HND D'"' e" re'&* DSR

    7 Re0e" "% e!& RTS

    8 C)e'r "% e!& CTS

    9 R#! #!,'"%r RI

    N%"e:DCD DSR RTS'!&CTS're ',"#$e )%+ p#!.

    The (e"h%& 0e& /* RS232 -%r ,%((0!#,'"#%! '))%+ -%r ' #(p)e ,%!!e,"#%! %- "hree )#!e:

    T R '!& Hr%0!&. The "hree ee!"#') #!') -%r 2+'* RS232

    C%((0!#,'"#%! 're "hee:

    TXD: ,'rr#e &'"' -r%( DTE "% "he DCE.

    RXD: ,'rr#e &'"' -r%( DCE "% "he DTE

    SG: #!') r%0!&

    (4*1 "onne"tion to RS252

    The R$2'2 standard is not TT? compatible7 therefore, it reuires a line dri"er such as

    the &A2'2 chip to con"ert R$2'2 "oltage le"els to TT? le"els, and "ice "ersa The interfacing

    of ;= with R$2'2 connectors "ia the &A2'2 chip is the main topic

    The ;= has two pins that are used specifically for transferring and recei"ing data

    serially These two pins are called T. and R. and a part of the port ' group P'< and P'=/

    Pin == of the ;= is assigned to T. and pin =< is designated as R. These pins are TT?

    compatible7 therefore, they reuire a line dri"er to ma#e them R$2'2 compatible 5ne such line

    dri"er is the &A2'2 chip

    &A2'2 con"erts from R$2'2 "oltage le"els to TT? "oltage le"els, and "ice "ersa

    5ne ad"antage of the &A2'2 chip is that it uses a Q>M power source which, is the same as

    the source "oltage for the ;= !n the other words, with a single Q>M power supply we can

    power both the ;= and &A2'2, with no need for the power supplies that are common in

  • 8/12/2019 Mrb06 Bomb Detection Robot

    45/84

    many older systems The &A2'2 has two sets of line dri"ers for transferring and recei"ing

    data The line dri"ers used for T. are called T= and T2, while the line dri"ers for R. are

    designated as R= and R2 !n many applications only one of each is used

    E(/e&&e&

    C%!"r%))er

    RD

    TD

    TD

    RD2

    3

    5

    HND

    MA 232

    *!L 22 GC588ECT!8L UC to PC using &A 2'2

    INTERRUPTS

    A #!)e (#,r%,%!"r%))er ,'! er$e e$er') &e$#,e. There 're "+% +'* "% &% "h'":

    INTERRUPTS %r POLLINH.

    POLLIN3/

    I! p%))#! "he (#,r%,%!"r%))er ,%!"#!0%0)* (%!#"%r "he "'"0 %- ' #$e! &e$#,eK +he!

    "he "'"0 ,%!"#%! # (e" #" per-%r( "he er$#,e .A-"er "h'" #" (%$e %! "% (%!#"%r "he !e"

    &e$#,e 0!"#) e',h %!e # er$#,e&. A)"h%0h p%))#! ,'! (%!#"%r "he "'"0 %- e$er') &e$#,e '!&

    er$e e',h %- "he( ' ,er"'#! ,%!"#%! 're (e".

    INTERRUPTS/

    I! "he #!"err0p" (e"h%& +he!e$er '!* &e$#,e !ee& #" er$#,e "he &e$#,e !%"#-#e "he

    (#,r%,%!"r%))er /* e!! #" '! #!"err0p" #!'). Up%! re,e#$#! '! #!"err0p" #!') "he

  • 8/12/2019 Mrb06 Bomb Detection Robot

    46/84

    (#,r%,%!"r%))er #!"err0p" +h'"e$er #" # &%#! '!& er$e "he &e$#,e. The pr%r'( '%,#'"e&

    +#"h "he #!"err0p" # ,'))e& "he #!"err0p" er$#,e r%0"#!e ISR.%r #!"err0p" h'!&)er.

    INTERRUPTS POLLIN3/

    The '&$'!"'e %- #!"err0p" # "h'" "he (#,r%,%!"r%))er ,'! er$e ('!* &e$#,e

    !%" ')) "he '(e "#(e %- ,%0reK e',h &e$#,e ,'! e" "he '""e!"#%! %- "he (#,r%,%!"r%))er /'e&

    ! "he pr#%r#"* '#!e& "% #". The p%))#! (e"h%& ,'!!%" '#! pr#%r#"* #!,e #" ,he, ')) &e$#,e

    #! r%0!&r%/#! -'h#%!. M%re #(p%r"'!")* #! "he #!"err0p" (e"h%& "he (#,r%,%!"r%))er ,'! ')%

    #!%re (' ' &e$#,e re0e" -%r er$#,e. Th# # ''#! !%" p%#/)e +#"h "he p%))#! (e"h%&.

    The (%" #(p%r"'!" re'%! "h'" "he #!"err0p" (e"h%& # pre-er'/)e # "h'" "he p%))#! (e"h%&

    +'"e (0,h %- "he (#,r%,%!"r%))er@ "#(e /* p%))#! &e$#,e "h'" &% !%" !ee& er$#,e. S% #!

    %r&er "% '$%#& "*#! &%+! "he (#,r%,%!"r%))er #!"err0p" 're 0e&.

    INTERRUPT SERICE ROUTINE

    *or e"ery interrupt, there must be an interrupt ser"ice routine !$R/, or interrupt

    handler 1hen an interrupt is in"o#ed, the microcontroller runs the interrupts ser"ice routine *or

    e"ery interrupt, there is a fi(ed location in memory that holds the address of its !$R The group

    of memory location set aside to hold the addresses of !$R and is called the !nterrupt Mector

    Table $hown belowG

    Interr&!t e"tor Tale #or t,e (4*1/

    S.No. INTERRUPT ROM LOCATION 9-E70 PIN FLA3

    CLEARIN3

    = Reset

  • 8/12/2019 Mrb06 Bomb Detection Robot

    47/84

    2 E(ternal hardware

    !nterrupt "olts and output "oltage of > "olts !t has a current rating of = amp

    although lower current models are a"ailable !ts output "oltage is fi(ed at >

  • 8/12/2019 Mrb06 Bomb Detection Robot

    59/84

    that pro"ide both positi"e and negati"e regulated "oltages, since the ;(( series can3t regulate

    negati"e "oltages in such a system

    The ; O ; is one of the most common and well-#nown of the ;(( series regulators, as it3s

    small component count and medium-power regulated >M ma#e it useful for powering TT?

    de"ices

    Tale 2.1. S!e"i#i"ation o# IC;(4*

    SPECIFICATIONS IC ;(4*

    Mout >M

    Mein- Mout.ifference >M - 2XC

    5utput !ma( =A

  • 8/12/2019 Mrb06 Bomb Detection Robot

    60/84

    CHAPTER >

    $PEC!*!E. TECH85?5L4

  • 8/12/2019 Mrb06 Bomb Detection Robot

    61/84

    L293D MOTOR DRIVE

    FeaturesThe L293D is a popular motor driver IC that is usable from 6 to12V, at up to 1A totaloutput curret! "# itself, the IC is some$hat diffcult to $ire ad use, but the CompactL293D %otor Driver ma&es it much more coveiet to use!

    Board Special Features 'our motor directio idicator L(D) )chott (%'*protectio diodes

    )oc&et pi coectors for eas# lo+ic iterfaci+

    (able pis are user accessible!

    L298 Features

  • 8/12/2019 Mrb06 Bomb Detection Robot

    62/84

  • 8/12/2019 Mrb06 Bomb Detection Robot

    63/84

  • 8/12/2019 Mrb06 Bomb Detection Robot

    64/84

    DC MOTOR

    DC (%"%r 're ,%!-#0re& #! ('!* "*pe '!& #e #!,)0! /r0h )e er$% '!& e'r

    (%"%r "*pe. A (%"%r ,%!#" %- ' r%"%r '!& ' per('!e!" ('!e"#, -#e)& "'"%r. The ('!e"#,

    -#e)& # ('#!"'#!e& 0#! e#"her per('!e!" ('!e" %r e)e,"r%('!e"#, +#!!. DC (%"%r

    're (%" ,%((%!)* 0e& #! $'r#'/)e pee& '!& "%r0e.

    M%"#%! '!& ,%!"r%) ,%$er ' +#&e r'!e %- ,%(p%!e!" "h'" #! %(e +'* 're

    0e& "% e!er'"e '!&%r ,%!"r%) (%"#%!. Are' +#"h#! "h# ,'"e%r* #!,)0&e /e'r#! '!&

    /0h#! ,)0",he '!& /r'e ,%!"r%) '!& &r#$e &r#$e ,%(p%!e!" e!,%&er '!& re%)$e

    I!"er'"e& (%"#%! ,%!"r%) )#(#" +#",he )#!e'r ',"0'"%r )#!e'r '!& r%"'r* (%"#%!

    ,%(p%!e!" )#!e'r p%#"#%! e!#! (%"%r /%"h AC '!& DC (%"%r %r#e!"'"#%! p%#"#%!

    e!#! p!e0('"#, '!& p!e0('"#, ,%(p%!e!" p%#"#%!#! "'e )#&e '!& 0#&e p%+er

    "r'!(##%! (e,h'!#,') e') )#p r#! %)e!%#& pr#!.

    M%"%r 're "he &e$#,e "h'" pr%$#&e "he ',"0') pee& '!& "%r0e #! ' &r#$e

    *"e(. Th# -'(#)* #!,)0&e AC (%"%r "*pe #!)e '!& (0)"#ph'e (%"%r 0!#$er') er$%

    (%"%r #!&0,"#%! *!,hr%!%0 '!& e'r (%"%r '!& DC (%"%r /r0h )e er$% (%"%r '!&

    e'r (%"%r ' +e)) ' )#!e'r "epper '!& '#r (%"%r '!& (%"%r ,%!"',"%r '!& "'r"er.

    I! '!* e)e,"r#, (%"%r %per'"#%! # /'e& %! #(p)e e)e,"r%('!e"#(. A ,0rre!",'rr*#!,%!&0,"%r e!er'"e ' ('!e"#, -#e)&K +he! "h# # "he! p)',e& #! '! e"er!') ('!e"#, -#e)& #"

    +#)) eper#e!,e ' -%r,e pr%p%r"#%!') "% "he ,0rre!" #! "he ,%!&0,"%r '!& "% "he "re!"h %- "he

    e"er!') ('!e"#, -#e)&. A *%0 're +e)) '+'re %- -r%( p)'*#! +#"h ('!e" ' ' #&

    %pp%#"e N%r"h '!& S%0"h p%)'r#"#e '""r'," +h#)e )#e p%)'r#"#e N%r"h '!& N%r"h S%0"h '!&

    S%0"h repe). The #!"er!') ,%!-#0r'"#%! %- ' DC (%"%r # &e#!e& "% h'r!e "he ('!e"#,

    http://dc-motors.globalspec.com/Industrial-Directory/motorshttp://dc-motors.globalspec.com/Industrial-Directory/motors
  • 8/12/2019 Mrb06 Bomb Detection Robot

    65/84

    #!"er',"#%! /e"+ee! ' ,0rre!",'rr*#! ,%!&0,"%r '!& '! e"er!') ('!e"#, -#e)& "% e!er'"e

    r%"'"#%!') (%"#%!.

    Le" "'r" /* )%%#! '" ' #(p)e 2p%)e DC e)e,"r#, (%"%r here re& repree!" ' ('!e"

    %r +#!! +#"h ' QN%r"hQ p%)'r#'"#%! +h#)e ree! repree!" ' ('!e" %r +#!! +#"h '

    QS%0"hQ p%)'r#'"#%!.

    E$er* DC (%"%r h' # /'#, p'r" ')e r%"%r '..'. 'r('"0re "'"%r ,%((0"'"%r -#e)&

    ('!e" '!& /r0he. I! (%" ,%((%! DC (%"%r '!& ')) "h'" Be'(er +#)) ee "he

    e"er!') ('!e"#, -#e)& # pr%&0,e& /* h#h"re!"h per('!e!" ('!e"1. The "'"%r # "he

    "'"#%!'r* p'r" %- "he (%"%r "h# #!,)0&e "he (%"%r ,'#! ' +e)) ' "+% %r (%re

    per('!e!" ('!e" p%)e p#e,e. The r%"%r "%e"her +#"h "he ')e '!& '""',he& ,%((0"'"%r

    r%"'"e +#"h repe," "% "he "'"%r. The r%"%r ,%!#" %- +#!! e!er'))* %! ' ,%re "he

    +#!! /e#! e)e,"r#,'))* ,%!!e,"e& "% "he ,%((0"'"%r. The '/%$e 'r'( h%+ '

    ,%((%! (%"%r )'*%0" +#"h "he r%"%r #!#&e "he "'"%r -#e)& ('!e".

    The geometry of the brushes, commutator contacts, and rotor windings

    are such that when power is applied, the polarities of the energi%ed winding and the

    stator magnets/ are misaligned, and the rotor will rotate until it is almost aligned with

    the stator3s field magnets As the rotor reaches alignment, the brushes mo"e to the

    ne(t commutator contacts, and energi%e the ne(t winding Li"en our e(ample two-

    pole motor, the rotation re"erses the direction of current through the rotor winding,

    leading to a )flip) of the rotor3s magnetic field, and dri"ing it to continue rotatingI! re') )#-e "h%0h DC (%"%r +#)) ')+'* h'$e (%re "h'! "+% p%)e "hree # '

    $er* ,%((%! !0(/er. I! p'r"#,0)'r "h# '$%#& Q&e'& p%"Q #! "he ,%((0"'"%r. Y%0 ,'!

    #('#!e h%+ +#"h %0r e'(p)e "+%p%)e (%"%r #- "he r%"%r # e',")* '" "he (#&&)e %- #"

    r%"'"#%! per-e,")* ')#!e& +#"h "he -#e)& ('!e" #" +#)) e" Q"0,Q "here. Me'!+h#)e +#"h '

    "+%p%)e (%"%r "here # ' (%(e!" +here "he ,%((0"'"%r h%r" %0" "he p%+er 0pp)* #.e.

  • 8/12/2019 Mrb06 Bomb Detection Robot

    66/84

    /%"h /r0he "%0,h /%"h ,%((0"'"%r ,%!"'," #(0)"'!e%0)*. Th# +%0)& /e /'& -%r "he

    p%+er 0pp)* +'"e e!er* '!& &'('e (%"%r ,%(p%!e!" ' +e)). Ye" '!%"her

    '&$'!"'e %- 0,h ' #(p)e (%"%r # "h'" #" +%0)& eh#/#" ' h#h '(%0!" %- "%r0e r#pp)eQ

    "he '(%0!" %- "%r0e #" ,%0)& pr%&0,e # ,*,)#, +#"h "he p%#"#%! %- "he r%"%r.

    $o since most small .C motors are of a three-pole design, let3s tin#er with the

    wor#ings of one "ia an interacti"e animation 0a"a$cript reuired/G

    Y%0)) !%"#,e ' -e+ "h#! -r%( "h# !'(e)* %!e p%)e # -0))* e!er#e& '" ' "#(e

    /0" "+% %"her 're Qp'r"#'))*Q e!er#e&. A e',h /r0h "r'!#"#%! -r%( %!e ,%((0"'"%r

    ,%!"'," "% "he !e" %!e ,%#) -#e)& +#)) r'p#&)* ,%))'pe ' "he !e" ,%#) -#e)& +#)) r'p#&)*

    ,h're 0p "h# %,,0r +#"h#! ' -e+ (#,r%e,%!&. e)) ee (%re '/%0" "he e--e," %- "h#

    )'"er /0" #! "he (e'!"#(e *%0 ,'! ee "h'" "h# # ' re," re0)" %- "he ,%#) +#!! er#e

    +#r#!:

  • 8/12/2019 Mrb06 Bomb Detection Robot

    67/84

    There pr%/'/)* !% /e""er +'* "% ee h%+ '! '$er'e &, (%"%r # p0" "%e"her "h'! /*

    0" %pe!#! %!e 0p. U!-%r"0!'"e)* "h# # "e%0 +%r ' +e)) ' re0#r#! "he &e"r0,"#%! %- '

    per-e,")* %%& (%"%r.

  • 8/12/2019 Mrb06 Bomb Detection Robot

    68/84

    CHAPTER6

    SOFTWARE DEVELOPMENT

    SOFT+ARE

    V-)-!03

    YMision' is an !.E !ntegrated .e"elopment En"ironment/ that helps you write, compile, and

    debug embedded programs !t encapsulates the following componentsG

    A pro6ect manager

    A ma#e facility

    Tool configuration

    Editor

    A powerful debugger

    To help you get started, se"eral e(ample programs located in the ?C*1?E>a%!le,

    ?C2*1?E>a%!le, ?C1@@?E>a%!le, and?ARM?...?E>a%!le/ are pro"ided

  • 8/12/2019 Mrb06 Bomb Detection Robot

    69/84

    -ELLOis a simple program that prints the string )Hello 1orld) using the $erial !nterface

    B-(*-0 %0 A(-+%#-!0 -0 V-)-!02

    To build compile, assemble, and lin#/ an application in YMision2, you mustG

    = $elect Pro6ect - for e(ample, 1@@?E7AMPLES?-ELLO?-ELLO.U2/

    2 $elect Pro6ect - Rebuild all target files or Build target

    YMision2 compiles, assembles, and lin#s the files in your pro6ect

    C&'%#-0 Y!& O$0 A(-+%#-!0 -0 V-)-!02

    To "reate a ne$ !roe"t in iion2< yo& %&tG

    = $elect Pro6ect - 8ew Pro6ect

    2 $elect a directory and enter the name of the pro6ect file

    ' $elect Pro6ect - $elect .e"ice and select an ;=, 2>=, or C=(:$T=< de"ice from the

    .e"ice .atabaseZ

    F Create source files to add to the pro6ect

    > $elect Pro6ect - Targets, Lroups, *iles, Add:*iles, select $ource Lroup=, and add the

    source files to the pro6ect

    $elect Pro6ect - 5ptions and set the tool options 8ote when you select the target de"ice

    from the .e"ice .atabaseZ all special options are set automatically 4ou typically only

    need to configure the memory map of your target hardware .efault memory model

    settings are optimal for most applications

    $elect Pro6ect - Rebuild all target files or Build target

    D';-0 %0 A(-+%#-!0 -0 V-)-!02

    To debug an application created using YMision2, you mustG

    = $elect .ebug - $tart:$top .ebug $ession

    2 se the $tep toolbar buttons to single-step through your program 4ou may enter 3G select de"ice foer target

    14. Then Clic# on J5IK

    11. The *ollowing fig will appear

  • 8/12/2019 Mrb06 Bomb Detection Robot

    76/84

    *ig 'G Copy ;= startup code

    12. Then Clic# either 4E$ or 85[[[mostly J85K

    15. 8ow your pro6ect is ready to $E

    1. 8ow double clic# on the Target=, you would get another option J$ource group =K

    as shown in ne(t page

    *ig 'G $ource group =

  • 8/12/2019 Mrb06 Bomb Detection Robot

    77/84

    1*. Clic# on the file option from menu bar and select JnewK

    *ig '; new file

    1@. The ne(t screen will be as shown in ne(t page, and 6ust ma(imi%e it by double

    clic#ing on its blue boarder

    *ig 'DG 5pened new file

    1;. 8ow start writing program in either in JCK or JA$&K

  • 8/12/2019 Mrb06 Bomb Detection Robot

    78/84

    1(. *or a program written in Assembly, then sa"e it with e(tension J asmK and for

    JCK based program sa"e it with e(tension J CK

    *ig F

  • 8/12/2019 Mrb06 Bomb Detection Robot

    79/84

    F# 42: A&! -#)e "% "he %0r,e r%0p

    21. N%+ e)e," ' per *%0r -#)e e"e!#%! #$e! +h#)e '$#! "he -#)e

    22. C)#, %!)* %!e "#(e %! %p"#%! ADD

    23. N%+ Pre -0!,"#%! e* F7 "% ,%(p#)e. A!* err%r +#)) 'ppe'r #- % h'ppe!.

    *ig F' Compilation

    24. I- "he -#)e ,%!"'#! !% err%r "he! pre C%!"r%)JF5 #(0)"'!e%0)*.

  • 8/12/2019 Mrb06 Bomb Detection Robot

    80/84

    25. The !e+ +#!&%+ # ' -%))%+

    F# 44: /0#)!

    26. The! C)#, O6

    27. N%+ C)#, %! "he Per#pher') -r%( (e!0 /'r '!& ,he, *%0r re0#re& p%r" '

    h%+! #! -# /e)%+

    *ig F> G $electing the Ports to be "isuali%ed

    2@. Dr' "he p%r" ' #&e '!& ,)#, #! "he pr%r'( -#)e.

  • 8/12/2019 Mrb06 Bomb Detection Robot

    81/84

    F# 4:"'r" &e/0#!

    2. N%+ eep Pre#! -0!,"#%! e* F11 )%+)* '!& %/er$e.

    3>. Y%0 're r0!!#! *%0r pr%r'( 0,,e-0))*.

  • 8/12/2019 Mrb06 Bomb Detection Robot

    82/84

    C-APTER ;

    CONCLUSION

    The pro6ect JBOMB DETECTION ROBOThas been successfully designed and tested

    !ntegrating features of all the hardware components used ha"e de"eloped it Presence of e"ery

  • 8/12/2019 Mrb06 Bomb Detection Robot

    83/84

    module has been reasoned out and placed carefully thus contributing to the best wor#ing of the

    unit

    $econdly, using highly ad"anced !CNs and with the help of growing technology the pro6ect has

    been successfullyimplemented

    REFERENCES

    ;=-&!CR5C58TR5??ER A8. E&BE..E. $4$TE&$

    &ohd &a%idi

    The 8;51 M#,r% ,%!"r%))er Ar,h#"e,"0re Pr%r'((#! App)#,'"#%!

  • 8/12/2019 Mrb06 Bomb Detection Robot

    84/84