project report microcontroller

Upload: sharth-kumar

Post on 03-Jun-2018

267 views

Category:

Documents


3 download

TRANSCRIPT

  • 8/12/2019 Project Report microcontroller

    1/33

    CHAPTER-1

    INTRODUCTION

    A remote control vehicle is defined as any mobile device that is controlled by a means that does not

    restrict its motion with an origin external to the device. A remote control vehicle differs from a robot in

    that the RCV is always controlled by a human and takes no positive action autonomously. In this Proect!

    the mobile phone which is in the hands of the user acts as a remote where as the "and Rover acts as a

    RCV. #he obective of Video $urveillance is accomplished using this RCV.

    1.1 Background:

    1) Histor o! r"#ot" contro$$"d %"&ic$"s: #he %irst Remote Control Vehicle I Precision &uided 'eapon

    was a propeller(driven radio controlled boat! built by )ikola #esla in *+,+! is the original prototype of allmodern(day uninhabited aerial vehicles and precision guided weapons. It was Powered by lead(acid

    batteries and an electric drive motor. #he vessel was designed to be maneuvered alongside a target using

    instructions received from a wireless remote( control transmitter.

    #here was a prominent use of RCVs in the $econd 'orld 'ar. -uring 'orld 'ar II in the uropean

    #heater the /.$. Air %orce experimented with three basic forms radio( control guided weapons. In each

    case! the weapon would be directed to its target by a crew member on a control plane. #he first weapon

    was essentially a standard bomb fitted with steering controls. #he next evolution involved the fitting of abomb to a glider airframe. #he third class of guided weapon was the remote controlled 0(*1.

    2ver the years! RCVs have taken many transformations3 they have used various technologies to meet the

    re4uirements of the fast growing technological world. #he present day RCVs employ technologies like R%!

    IR! satellite communication etc with a sophisticated technical touch.

    1.' DT( T"c&no$og

    -ual(tone multi(fre4uency 5-#6%7 signaling is used for telecommunication signaling over

    analog telephone lines in the voice(fre4uency band to the call switching center. #he version of -#6% used

    for telephone tone dialing is known by the trademarked term #ouch(#one. It is developed as a very reliable

    alternative to pulse dialing. #ouch(#one system using the telephone keypad gradually replaced the use of

    rotary dial and has become the industry standard for landline service. R% and IR technologies for remote

    control have drawbacks of limited working range and limited fre4uency range. #hus! for remote

  • 8/12/2019 Project Report microcontroller

    2/33

    communication -#6% signal can replace R% and IR signals for the advantage of simplicity! audibility and

    working range which is as large as the coverage area of service provider.

    1) DT( k"*ad:#he -#6% keypad is laid out in a 898 matrix! with each row representing a low

    fre4uency! and each column representing a high fre4uency. #he -#6% signal is a direct algebraicsummation! in real time! of the amplitudes of two sine 5cosine7 waves of two different fre4uencies! one

    corresponding to the row and the other corresponding to the column. #he fre4uencies may not vary more

    than :*.+; from their nominal fre4uency! or the switching center will ignore the signal. #he multiple

    tones are the reason for calling the system multifre4uency. #he -#6% tone assignments are as shown in

    %ig.

  • 8/12/2019 Project Report microcontroller

    3/33

    xample> If the ?*@ key is pressed! then the tone is composed of the fre4uencies ,1B 5 corresponding to

    the row7 and *

  • 8/12/2019 Project Report microcontroller

    4/33

    processes the data according to the control software to generate the control signal for the -C motor to

    rotate in the desired direction. #he 6otor -river assists to provide the re4uired current to drive the motors.

    III. CIRCUIT DIA/RA(

    A. Co#*on"nts us"d

    1) +"#iconductors:IC* F B#,*1D -#6% decoder! IC< ( +DG* microcontroller! ICE ( "

  • 8/12/2019 Project Report microcontroller

    5/33

    %ig.8 Circuit -iagram

  • 8/12/2019 Project Report microcontroller

    6/33

    B. Circuit Diagra# "*$anation

    #he important components of this rover are a -#6% decoder! 6icrocontroller and motor driver.

    A B#,*1D series -#6% decoder is used here. All types of the B#,*1D series use digital counting

    techni4ues to detect and decode all the * -#6% tone pairs into a 8(bit code output. #he built(in dial tone

    reection circuit eliminates the need for pre(filtering. Input to the -#6% decoder is given through the

    audio ack. Bere the #IP corresponds to positive of the audio ack and ring corresponds to negative of the

    same. 'hen the input signal given at pin< 5I)(7 correct 8(bit decoded signal of the -#6% tone is

    transferred to K* 5pin **7 through K8 5pin *87.#able II shows the -#6% data output table of B#,*1D. K*

    through K8 outputs of the -#6% decoder 5IC*7 are connected to port pins PAD ( PAE of +DG*

    microcontroller 5IC

  • 8/12/2019 Project Report microcontroller

    7/33

    I2. HARD3ARE CO(PONENT+4 +PECIICATION

    A. 2o$tag" r"gu$ator

    A voltage regulator is designed to automatically maintain a constant voltagelevel. A voltage

    regulator may be a simple Lfeed(forwardL design or may include negative feedback control loops. It may

    use an electromechanical mechanism! or electronic components. -epending on the design! it may be used

    to regulate one or more ACor -Cvoltages.

    lectronic voltage regulators are found in devices such as computerpower supplieswhere they

    stabilie the -C voltages used by the processor and other elements. In automobile alternatorsand

    centralpower station generator plants! voltage regulators control the output of the plant. In an electric

    power distributionsystem! voltage regulators may be installed at a substation or along distribution lines so

    that all customers receive steady voltage independent of how much power is drawn from the line.

    *7 ("asur"s o! %o$tag" r"gu$ator 5ua$it: #he output voltage can only be held roughly constant3 the

    regulation is specified by two measurements>

    "oad regulation is the change in output voltage for a given change in load current 5for example>

    Ltypically *G mV! maximum *DD mV for load currents between G mA and *.8 A! at some specified

    temperature and input voltageL7.

    "ine regulation or input regulation is the degree to which output voltage changes with input

    5supply7 voltage changes ( as a ratio of output to input change 5for example Ltypically *E mVMVL7! or

    the output voltage change over the entire specified input voltage range 5for example Lplus or minus

  • 8/12/2019 Project Report microcontroller

    8/33

    1+DG is a voltage regulator integrated circuit. It is a member of 1+xx series of fixed linear voltage

    regulator ICs. #he voltage source in a circuit may have fluctuations and would not give the fixed

    voltage output. #he voltage regulator IC maintains the output voltage at a constant value. #he xx in

    1+xx indicates the

    %ig.G. IC 1+DG voltage regulator

    #A0" I

    PI) C2)%I&/RA#I2) 2% IC1+DG

    B. DT( d"cod"r

    -#6% decoder used in this proect is B#,*1D.

    Pin )o %unction )ame* Input voltage 5GV(*+V7 Input

    < &round 5DV7 &roundE Regulated output3 GV 58.+V(

    G.

  • 8/12/2019 Project Report microcontroller

    9/33

    1) "atur"s:

    2perating voltage>

  • 8/12/2019 Project Report microcontroller

    10/33

    %ig..Pin configuration

    2) Pin d"scri*tion:

    VP (2perational amplifier non(inverting input.

    V) (2perational amplifier inverting input.

    &$ (2perational amplifier output terminal

    VR% (Reference voltage output! normally V--M

    Port Pin A$t"rnat" unction:-

    PE.D Rx- 5serial input port7

    PE.* #x- 5serial output port7

    PE.< I)#D 5external interrupt7

    PE.E I)#* 5external interrupt7

    PE.8 #D 5#imerMCounter D external input7

    PE.G #* 5#imerMCounter * external input7

    PE. 'R 5external -ata 6emory write strobe7

    PE.1 R- 5external -ata 6emory read strobe7

    #he alternate functions can only be activated if the corresponding bit latch in the port $%R contains a *.

    2therwise the port pin remains at D.

    +*"cia$ unction R"gist"rs >+Rs):-

  • 8/12/2019 Project Report microcontroller

    21/33

    A 6ap of the on(chip memory area called the $pecial %unction Register 5$%R7 space is shown in

    %igure.

    In the $%Rs not all of the addresses are occupied. /noccupied addresses are not implemented on the

    chip. Read accesses to these addresses will in general return random data! and write accesses will have no

    effect. /ser software should not write *s to these unimplemented locations! since they may be used in

    other +DCG* %amily derivative products to invoke new features. #he functions of the $%Rs are described

    in the text that follows.

    Accu#u$ator:

    ACC is the Accumulator register. #he mnemonics for Accumulator($pecific instructions! however!

    refer to the Accumulator simply as A.

    B R"gist"r:

    #he 0 register is used during multiply and divide operations. %or other instructions it can be treated as

    another scratch pad register.

  • 8/12/2019 Project Report microcontroller

    22/33

    Progra# +tatus 3ord:

    #he P$' register contains program status information as detailed in %igure.

    BIT +0(BO UNCTION:-

    P$'.1 CS Carry flag.

    P$'. AC Auxiliary Carry flag. 5%or 0C- operations.7

    P$'.G %D %lag D. 5Available to the user for general purposes.7

    P$'.8 R$* Register bank select control bit *.

    $etMcleared by software to determine working register bank.

    P$'.E R$D Register bank select control bit D.$etMcleared by software to determine working register bank.

    P$'.< 2V 2verflow flag.

    P$'.* T /ser(definable flag.

    P$'.D P Parity flag.

    $etMcleared by hardware each instruction cycle to indicate an oddMeven

    )umber of Uone bits in the Accumulator! i.e.! even parity.

    NOTE:#he contents of 5R$*! R$D7 enable the working register banks as follows>

    5D! D7T 0ank D 5DDBFD1B7

    5D! *7T 0ank * 5D+BFDfB7

    5*! D7T 0ank < 5*DBF*1B7

    5*! *7T 0ank E 5*+BF*1B7

    +tack Point"r:-

  • 8/12/2019 Project Report microcontroller

    23/33

    #he $tack Pointer register is + bits wide. It is incremented before data is stored during P/$B and

    CA"" executions. 'hile the stack may reside anywhere in on(chip RA6! the $tack Pointer is initialied

    to D1B after a reset. #his causes the stack to begin at locations D+B.

    Data Point"r:- #he -ata Pointer 5-P#R7 consists of a high byte 5-PB7 and a low byte 5-P"7. Its intended function

    is to hold a *(bit address. It may be manipulated as a *(bit register or as two independent +(bit registers.

    +"ria$ Data Bu!!"r:-

    #he $erial 0uffer is actually two separate registers! a transmit buffer and a receive buffer. 'hen data

    is moved to $0/%! it goes to the transmit buffer and is held for serial transmission. 56oving a byte to

    $0/% is what initiates the transmission.7 'hen data is moved from $0/%! it comes from the receive

    buffer.

    Ti#"r R"gist"rs Basic to 78C91:-

    Register pairs 5#BD! #"D7! and 5#B*! #"*7 are the *(bit Counting registers for #imerMCounters D

    and *! respectively.

    Contro$ R"gist"r !or t&" 78C91:-

    $pecial %unction Registers IP! I! #62-! #C2)! $C2)! and PC2) contain control and status bits

    for the interrupt system! the #imerMCounters! and the serial port. #hey are described in later sections.

    Basic R"gist"rs:-

    A number of +DG< registers can be considered Lbasic.L Very little can be done without them and a detailed

    explanation of each one is warranted to make sure the reader understands these registers before getting into

    more complicated areas of development.

    T&" Accu#u$ator:-

    #he Accumulator! as its name suggests! is used as a general register to accumulate the results of a large

    number of instructions. It can hold an +(bit 5*(byte7 value and is the most versatile register the +DG< has

    due to the sheer number of instructions that make use of the accumulator. 6ore than half of the +DG

  • 8/12/2019 Project Report microcontroller

    24/33

    %or example! if you want to add the number *D and

  • 8/12/2019 Project Report microcontroller

    25/33

    #he concept of register banks adds a great level of flexibility to the +DG

    interrupts 5well talk about interrupts later7. Bowever! always remember that the register banks really

    reside in the first E< bytes of Internal RA6.

    T&" B R"gist"r:-

    #he L0L register is very similar to the Accumulator in the sense that it may hold an +(bit 5*(byte7

    value. #he L0L register is only used implicitly by two +DG< instructions> 6/" A0 and -IV A0. #hus! if

    you want to 4uickly and easily multiply or divide A by another number! you may store the other number in

    L0L and make use of these two instructions. Aside from the 6/" and -IV instructions! the L0L register

    are often used as yet another temporary storage register much like a ninth LRL register.

    T&" Progra# Count"r:-

    #he Program Counter 5PC7 is a #here is one trick that may be used

    to determine the current value of PC. #his trick will be covered in a later chapter.

    T&" Data Point"r:-

    #he -ata Pointer 5-P#R7 is the +DG

  • 8/12/2019 Project Report microcontroller

    26/33

    'hile -P#R is most often used to point to data in external memory or code memory! many developers

    take advantage of the fact that its the only true *(bit register available. It is often used to store

  • 8/12/2019 Project Report microcontroller

    27/33

    R"gist"r-+*"ci!ic Instructions:-

    $ome instructions are specific to a certain register. %or example! some instructions always operate on the

    Accumulator! or -ata Pointer! etc.! so no address byte is needed to point to it. #he opcode itself does that.

    Instructions that refer to the Accumulator as A assemble as accumulator specific opcodes.I##"diat" Constants:-

    #he value of a constant can follow the opcode in Program 6emory.

    %or example!

    62V A! Z*DD

    "oads the Accumulator with the decimal number *DD. #he same number could be specified in hex digits as

    8B.

    Ind""d Addr"ssing:-

    2nly program 6emory can be accessed with indexed addressing! and it can only be read. #his addressing

    mode is intended for reading look(up tables in Program 6emory A *(bit base register 5either -P#R or

    the Program Counter7 points to the base of the table! and the Accumulator is set up with the table entry

    number. #he address of the table entry in Program 6emory is formed by adding the Accumulator data to

    the base pointer. Another type of indexed addressing is used in the Ucase ump instruction. In this case the

    destination address of a ump instruction is computed as the sum of the base pointer and the Accumulator

    data.

    E. Diod"

    In electronics! a diode is a two(terminal electronic component that conducts electric current in only

    one direction. #he term usually refers to a semiconductor diode! the most common type today! which is a

    crystal of semiconductor connected to two electrical terminals! a P() unction. A vacuum tube diode! now

    little used! is a vacuum tube with two electrodes3 a plate and a cathode. #he most common function of a

    diode is to allow an electric current in one direction 5called the diode@s forward direction7 while blocking

    current in the opposite direction 5the reverse direction7. #hus! the diode can be thought of as an electronic

    version of a check valve. #his unidirectional behavior is called rectification! and is used to convert

  • 8/12/2019 Project Report microcontroller

    28/33

    alternating current to direct current! and remove modulation from radio signals in radio receivers.

    Bowever! diodes can have more complicated behavior than this simple on(off action! due to their complex

    non(linear electrical characteristics! which can be tailored by varying the construction of their P()

    unction. #hese are exploited in special purpose diodes that perform many different functions. -iodes are

    used to regulate voltage 5[ener diodes7! electronically tune radio and #V receivers 5varactor diodes7!generate radio fre4uency oscillations 5tunnel diodes7! and produce light 5light emitting diodes7.

    -iodes were the first semiconductor electronic devices. #he discovery of crystals rectifying abilities

    was made by &erman physicist %erdinand 0raun in *+18. #he first semiconductor diodes! called cats

    whisker diodes were made of crystals of minerals such as galena. #oday most diodes are made of silicon!

    but other semiconductors such as germanium are sometimes used.

    %ig.*D. -iode symbol

  • 8/12/2019 Project Report microcontroller

    29/33

    %ig.**. V(I Characteristics of a diode

    #he *)8DD* series 5or *)8DDD series7 is a family of popular *.D A general purpose silicon rectifier

    diodes commonly used in AC adapters for common household appliances. 0locking voltage varies from

    GD to *DDD volts. #his diode is made in an axial(lead -2(8* plastic package.

    #hese are fairly low(speedrectifier diodes! being inefficient for s4uare waves of more than *G kB. #he series was second sourced by

    many manufacturers. #he *)8DDD series were in the 6otorola $ilicon Rectifier Bandbook in *,! as

    replacements for *)

  • 8/12/2019 Project Report microcontroller

    30/33

    *+

  • 8/12/2019 Project Report microcontroller

    31/33

    Po;"r: #he power output of a rotary electric motor is>

    'here P is the power in watts! rpm is the shaft speed in revolutions per minute and # is

    the tor4ue in )m

    E!!ici"nc: #o calculate a motors efficiency! the mechanical output power is divided by the

    electrical input power>

    'here is energy conversion efficiency! is electrical input power! and is mechanical output

    power.E7 (otor dri%"r:#he output of a 6icrocontroller is not sufficient to drive -C motors3 hence a motor

    driver "

  • 8/12/2019 Project Report microcontroller

    32/33

    %ig.*

  • 8/12/2019 Project Report microcontroller

    33/33

    disabled! and their outputs are off and in a high(impedance state. #he "