Anti Aircraft Missile

Embed Size (px)

DESCRIPTION

own project

Citation preview

  • -1-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    CHAPTER I

    INTRODUCTION

    At the time of world war the military had found difficulties in tracing the

    enemies and their activities. This difficulty had lead to the invention of RADAR. To

    face new challenges in the present day situation in Military applications unmanned

    systems are more accurate, flexible and reliable. One such system is the

    MICROCONTROLLER BASED UNMANNED ANTI AIRCRAFT MISSILE

    WITH RADAR USING RF IDENTIFICATION.

    RADAR (Radio detection and Ranging), a remote detection system, is used to

    locate and identify objects. Radar signals bounce off objects in their path and the Radar

    system detects the echoes of signals that return. RADAR can determine a number of

    properties of a distant object, such as its distance, speed, direction of motion and shape.

    It can detect objects out of range of sight and works in all weather conditions, making it

    a vital and versatile tool for many industries.

    A radar system starts by sending out electromagnetic radiation, called the Signal.

    The signal bounces off objects in its path. When the radiation bounces back part of the

    signal returns to the Radar system; this echo is called the Return. The Radar system

    detects the Return and depending on the sophistication of the system, simply reports the

    detection or analyzes the signal for more information.

    RFID or Radio Frequency identification is a technology that enables the tracking

    or identification of objects using IC based tags with an RF circuit and antenna, and RF

    readers that "read" and in some case modify the information stored in the IC memory.

    Radio frequency identification (RFID) is a general term that is used to describe a

    system that transmits the identity (in the form of a unique serial number) of an object

    wirelessly, using radio waves.

    RFID technologies are grouped under the more generic Automatic Identification (Auto

    ID) technologies.

  • -2-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    The RF tags could be divided in two major groups:

    Passive tags: The power to activate the tag microchip is supplied by the reader

    through the tag antenna when the tag is in the interrogation zone of the reader, as is the

    timing pulse.

    Active RFID tags: Active RFID tags have a battery in them and are therefore more

    capable in terms of range and data handling.

    FREQUENCY USE:

    There are four commonly used frequencies:

    Low frequency (LF) 125/134.2 kHz

    High frequency (HF) 13.56 MHz

    Ultra high frequency (UHF) (including 869 and 915 MHz) and

    Microwave (at 2450 MHz, a band familiar to ISPs).

  • -3-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    CHAPTER II

    BLOCK DIAGRAM

    The block diagram and its brief description of the project work are explained in

    block wise and this block diagram consists the following blocks.

    AT THE TRANSMITTER END:

    Code generator

    2051 Micro controller

    RF transmitter

    AT THE RECEIVER END:

    RF Receiver

    Signal Amplifier

    Micro controller unit

    Power supply

    AT THE CONTROL UNIT:

    Micro controller unit

    Motor driver

    Stepper Motors

    Firing indicator

    RADAR

    Gun

    RS232 driver &pin

    PC

    Accessories

  • -4-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    BLOCK DIAGRAM OF TRANSMITTER SECTION:

    FIG 2.1

    POWER SUPPLY UNIT:

    FIG 2.2

  • -5-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    RECEIVER SECTION:

    FIG :2.3

    BLOCK DIAGRAM OF CONTROL SECTION:

    FIG 2.4

  • -6-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    DESCRIPTION OF BLOCK DIAGRAM

    TRANSMITTER UNIT:

    RF TRANSMITTER:

    This block generates a continuous frequency of 100MHz, which is used to form

    a permanent link between the transmitter and receiver, and this is known as carrier

    frequency. The output serial port is fed to this RF radio transmitter. This is a frequency

    modulated radio transmitter. The radiating power of the transmitter is 20mw, and it is

    designed using 2N3904 high frequency switching transistor.

    RECEIVER UNIT:

    POWER SUPPLY:

    Power supply unit provides +5V regulated power to the system. It consists of two

    parts Rectifier and Monolithic IC voltage regulators. Here the step down transformer of

    voltage ratio 230V/9-0-9V steps down 230VAC primary to 909V secondary and

    gives the secondary current up to 500mA, to the Rectifier. The output voltage of the

    rectifier then regulated to +5V using LM7805.

    RF RECEIVER:

    The RF receiver is designed with IC CXA1619BM/BS, which is AM/RF Radio

    receiver IC, operates at a local oscillator of 88 - 108MHz and is tuned with the

    transmitter. This IC consists of built in RF amplifier, a double balanced mixer, local

    oscillator, a two stage IF amplifier, a quadrature demodulator for a ceramic filter and an

    automatic frequency control. The built in RF amplifier, a part from the amplification of

    received RF signal, it also reduces the Noise figure, which could other wise be a

    problem because of the large band widths needed for RF. It also matches the input

    impedance of the radio receiver with the antenna.

    SIGNAL AMPLIFIER: Here a differential amplifier in series with a voltage follower

    constructed by using a Darlington pair. amplified to TTL level for follower

    constructed

  • -7-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    DESCRIPTION OF CONTROL SECTION:

    MICRO CONTROLLER UNIT:

    The AT89C51 is a low-power, high-performance CMOS 8-bit microcomputer with

    4K bytes of Flash programmable and erasable read only memory (EPROM). The device

    is manufactured using Atmels high-density nonvolatile memory technology and is

    compatible with the industry-standard MCS-51 instruction set and pinout. The on-chip

    Flash allows the program memory to be reprogrammed in-system or by a conventional

    nonvolatile memory programmer. By combining a versatile 8-bit CPU with Flash on a

    monolithic chip, the Atmel AT89C51 is a powerful microcomputer which provides a

    highly-flexible and cost-effective solution to many embedded control applications.

    FEATURES:

    Compatible with MCS-51 Products

    4K Bytes of In-System Reprogrammable Flash Memory

    . Endurance: 1,000 Write/Erase Cycles

    Fully Static Operation: 0 Hz to 24 MHz

    Three-level Program Memory Lock

    128 x 8-bit Internal RAM

    32 Programmable I/O Lines

    Two 16-bit Timer/Counters

    Six Interrupt Sources

    Programmable Serial Channel

    Low-power Idle and Power-down Modes

    PC BLOCK:

    The PC is having various I/O peripherals such as parallel port, serial (COM)

    port,

    USB port, modems etc. For our project we have taken serial (COM) port because in

    monoplex mode of communication, only one wire is sufficient. Here we can transmit

    single wire information, so we have chosen this port.

  • -8-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    A ninepin D type connector is placed at the rear panel of the PC through which

    we take data using an interfacing cable. For taking commands and transmitting the data,

    C language is used. A user friendly menu is created for better operation

    RS232:

    The MAX232 family of line drivers/receivers is intended for all EIA/TIA-232E

    and V.28/V.24 communications interfaces particularly applications where 12V is not

    available. These parts are especially useful in battery-powered systems, since their low-

    power shutdown mode reduces power dissipation to less than 5W. the features of these

    I.C. are Superior to Bipolar, Operate from Single +5V Power Supply, Meet All

    EIA/TIA-232E and V.28 Specifications, Multiple Drivers and Receivers, 2-State Driver

    and Receiver Outputs.

    MOTOR DRIVER:

    For driving of motor coils, we used IRF540 MOSFET, which are having low on-

    state resistance so that the dissipation is less, fast switching and low thermal resistance.

    This MOSFET is driven by BC547 transistor. For each motor four MOSFET sections

    are required.

    MOTORS:

    Unipolar stepper motors are used for moving the vehicle, because the driving

    circuit is simpler and yet it works well. It consists four windings and there are two

    driving methods are there. One is full step and other is half step. Full step moves 1.8

    and half step moves 0.9. The torque for full step driving is more compared to half step

    driving.

    FIRING INDICATOR:

    A red LED is used along with a buzzer, which is driven using BC547 transistors.

    Whenever a fire command given, LED blinks once and buzzer beeps.

  • -9-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    CHAPTER III

    CIRCUIT DIAGRAM

    FLIGHT SECTION:

    Fig:3.1

  • -10-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    RECEIVER SECTION:

  • -11-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    Driver Circuit

    Fig 3.2

  • -12-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    CHAPTER IV

    PRINCIPLE OF OPERATION

    In this system we are simulating the RADAR function with optical beam. We

    are providing an IR transmitter and receiver in place of RF transmitter and receiver. If

    any object, reflecting the IR rays back to receiver can be detected. The IR transmitter

    and receiver are placed on a rotating antenna to detect angle of the object. And we are

    placing an Rfid tags at each plane of our origin. A gun is placed along with radar. If our

    flight passes in front of radar, it sends its address through Rfid tag. The Rfid reader

    reads this code and sends to micro controller. If the code is matched, the gun will not

    fire. If some other planes pass, they are not able to produce the code, so as a result the

    gun aims at that plane and blasts it. LED and buzzer are interfaced to simulate firing.

    The scanning process can be seen in PC.

    A micro controller is used to supervise all these functions. All the peripherals

    like, stepper motor, RS232, IR transmitter and receiver, RF transmitter and receiver are

    interfaced to micro controller. Micro controller rotates the stepper motor in specified

    angles and gets the feed back from IR receiver in that position. This information is sent

    to PC via serial port to indicate the object at that particular angle in the monitor. Then

    another micro controller reads the RF digital code and sends the status to PC. If that

    code is not matched, PC sends back signal to micro controller to blast it. Then micro

    controller rotates the gun using another stepper motor and fires.

    RF receiver receives the signals using single Arial and gives demodulated o/p.

    This o/p signal is further conditioned using LM358 op-amp. The o/p of the receiver is

    very low, so its level is amplified using a Darlington pair. The o/p is fed to micro

    controller (AT89C51). The micro controller receives the serial data and accordingly

    drives the stepper motors and buzzer. Here we used uni-polar stepper motors, which

    will have four windings. Each winding is driven with MOSFET (IRF540) for better

    switching and lesser power dissipation. BC547 transistors are used to drive the

    MOSFET, because controller o/p is in the range of +5V and MOSFET is operating in

    the range of +12V. Full step mode is used for driving the stepper motor. In this mode,

    the rotating angle per step is 1.8 and torque is high.

  • -13-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    CHAPTER V

    DESCRIPTION OF MAIN COMPONENTS

    POWER SUPPLY:

    Fig 5.1Power supply

    Power supply unit provides 5V regulates power supply to the systems. It

    consists of two parts namely,

    1. Rectifier

    2. Monolithic voltage regulator

    Rectifier:

    Here the step down transformer 230-0v/9-0-9 and gives the secondary current up to

    500mA, to the Rectifier. The Transformer secondary is provided with a center tap.

    Hence the voltage V1 and V2 are equal and are having a phase difference of 1800. So it

    is anode of Diode D1 is positive with respect to the center tap, the anode of the other

    diode d2 will be negative with respect to the center tap. During the positive half cycle

    of the supply D1 conducts and current flows through the center tap D1 and load.

    During this period D2 will not conduct as its anode is at a negative potential. During

    the negative half cycle of the supply voltage, the voltage on the diode D2 will be

    positive and hence D2 conducts. The current flows through the transformer winding,

    Diode D2 and load. It is to be noted that the current i1 and i2 are flowing in the same

    direction in load.

  • -14-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    The average of the two current i1 and i2 flows through the load producing a voltage

    drop, which is the D.C. output voltage of the rectifier. Using capacitor filters the ripple

    in the out waveform can be minimized. The voltage can be regulated by using

    monolithic IC voltage regulators.

    Monolithic IC voltage regulator:

    A voltage regulator is a circuit that supplies a constant voltage regardless of

    changes in load currents. Although voltage regulators can be designed using op-amps, it

    is quicker and easier to use IC voltage regulators. Furthermore, IC voltage regulators are

    versatile and relatively inexpensive and are available with features such as

    programmable output, current/voltage boosting, internal short-circuit current limiting,

    thermal shutdown and floating operation for high voltage applications.

    Here we are using 7800 series voltage regulators. The 7800 series consists of 3-

    terminal +ve voltage regulators with seven voltage options. These ICs are designed as

    fixed voltage regulators and with adequate heat sinking can deliver output currents in

    excess of 1A. Although these devices do not require external components, such

    components can be used to obtain adjustable voltages and currents. For proper operation

    a common ground between input and output voltages is required. In addition, the

    difference between input and output voltages (Vi Vo) called drop out voltage, must be

    typically 1.5V even during the low point as the input ripple voltage. Further more, the

    capacitor Ci is required if the regulator is located an appreciable distance from a power

    supply filter. Even though Co is not needed, it may be used to improve the transient

    response of the regulator.

    Line regulation is defined as the change in output voltage for a change in the

    input voltage and is usually expressed in milli volts or as a percentage of Vo.

    Temperature stability or average temperature coefficient of output voltage (TCVo) is

    the change in output voltage per unit change in temperature and is expressed in either

    milli volts/C or parts per million (PPM/C). Ripple rejection is the measure of a

    regulators ability to reject ripple voltage. It is usually expressed in decibels. The

    smaller the values of line regulation, load regulation and temperature stability the better

    the regulation.

  • -15-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    8 BIT MICROCONTROLLERS - AT89C51

    The Micro controller is used for interface with FM receiver and stepper motors

    and it gives proper stepping pulses for vehicle movements, by receiving serial data from

    FM receiver.

    INTRODUCTION:

    Looking back into the history of microcomputers, one would at first come across

    the development of microprocessor i.e. the processing element, and later on the

    peripheral devices. The three basic elements-the CPU, I/O devices and memory-have

    developed in distinct directions. While the CPU has been the proprietary item, the

    memory devices fall into general-purpose category and the I/O devices may be grouped

    somewhere in-between.

    The AT89C51 is a low-power, high-performance CMOS 8-bit microcomputer

    with 4K bytes of Flash programmable and erasable read only memory (PEROM). The

    device is manufactured using Atmels high-density nonvolatile memory technology and

    is compatible with the industry-standard MCS-51 instruction set and pinout. The on-

    chip Flash allows the program memory to be reprogrammed in-system or by a

    conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU

    with Flash on a monolithic chip, the Atmel AT89C51 is a powerful microcomputer,

    which provides a highly flexible and cost-effective solution to many embedded control

    applications.

    The AT89C51 provides for 4k EPROM/ROM, 128 byte RAM and 32 I/O lines.

    It also includes a universal asynchronous receive-transmit (UART) device, two 16-bit

    timer/counters and elaborate interrupt logic. Lack of multiply and divide instructions

    which had been always felt in 8-bit microprocessors/micro controllers, has also been

    taken care of in the 89C51- Thus the 89C51 may be called nearly equivalent of the

    following devices on a single chip: 8085 + 8255 + 8251 + 8253 + 2764 + 6116.

    In short, the AT89C51 has the following on-chip facilities:

    4k ROM (EPROM on 8751)

    128 byte RAM32 input-output port lines

    Two, 16-bit timer/counters

    Six interrupt sources and

    On-chip clock oscillator and power on reset circuitry

  • -16-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    INTERNAL BLOCK DIAGRAM:

    Fig 5.2 AT89S51 internal block diagram

    SALIENT FEATURES:

    The 89C51 can be configured to bypass the internal 4 k ROM and run solely

    with external program memory.

    For this, its external access (EA) pin has to be grounded, which makes it

    equivalent to 8031. The program store enable (PSEN) signal acts as read pulse for

    program memory. The data memory is external only and a separate RD* signal is

    available for reading its contents.

  • -17-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    Use of external memory requires that three of its 8-bit ports (out of four) are

    configured to provide data/address multiplexed bus. Hi address bus and control signals

    related to external memory use. The RXD and TXD ports of UART also appear on pins

    10 and 11 of 8051 and 8031, respectively. The UART utilizes one of the internal timers

    for generation of baud rate. The crystal used for generation of CPU clock has therefore

    to be chosen carefully. The 11.0596 MHz crystals; available abundantly, can provide a

    baud rate of 9600.

    The 256-byte address space is utilized by the internal RAM and special function

    registers (SFRs) array which is separate from external data RAM space of 64k. The 00-

    7F space is occupied by the RAM and the 80 - FF space by the SFRs. The 128 byte

    internal RAM has been utilized in the following fashion:

    00-1F: Used for four banks of eight registers of 8-bit each. The four banks may be

    selected by software any time during the program.

    20-2F: The 16 bytes may be used as 128 bits of individually addressable locations.

    These are extremely useful for bit oriented programs.

    30- 7F: This area is used for temporary storage, pointers and stack. On reset, the stack

    starts at 08 and gets incremented during use.The list of special function registers along

    with their hex addresses is given:

    Addr

    .

    Port/Register

    80 P0 (Port 0)

    81 SP (stack pointer)

    82 DPH (data pointer High)

    83 DPL (data pointer Low)

    88 TCON (timer control)

    89 TMOD (timer mode)

    8A TLO (timer 0 low byte)

    8B TL1 (timer 1 low byte)

    8C TH0 (timer 0 high byte)

    8D TH1 (timer 1 high byte)

    90 P1 (port 1)

  • -18-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    98 SCON (serial control)

    99 SBUF (serial buffer)

    A0 P2 (port 2)

    A8 Interrupt enable (IE)

    B0 P3 (port 3)

    B8 Interrupt priority (IP)

    D0 Processor status word (PSW)

    E0 Accumulator (ACC)

    F0 B register

    AT89C51 SFR

    AT89C51 SERIAL PORT PINS:

    PIN ALTERNATE USE SFR

    P3.ORXD Serial data input SBUF

    P3.ITXD Serial data output SBUF

    P3.2INTO External interrupt 0 TCON-1

    P3.3INT1 External interrupt 1 TCON- 2

    P3.4TO External timer 0 input TMOD

    P3.5T1 External timer 1 input TMOD

    P3.6WR External memory write

    pulse

    ---------

    P3.7RD External memory read

    pulse

    ----

    AT89C51 serial port pins

    The two internal timers are wired to the system clock and prescaling factor is

    decided by the software, apart from the count stored in the two bytes of the timer

    control registers. One of the counters, as mentioned earlier, is used for generation of

    baud rate clock for the UART. It would be of interest to know that the 8052 have a third

    timer, which is usually used for generation of baud rate.

    The reset input is normally low and taking it high resets the micro controller, in

    the present hardware, a separate CMOS circuit has been used for generation of reset

    signal so that it could be used to drive external devices as well.

  • -19-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    WRITING THE SOFTWARE:

    The 89C51 has been specifically developed for control applications. As

    mentioned earlier, out of the 128 bytes of internal RAM, 16 bytes have been organized

    in such a way that all the 128 bits associated with this group may be accessed bit wise to

    facilitate their use for bit set/reset/test applications. These are therefore extremely useful

    for programs involving individual logical operations. One can easily give example of

    lift for one such application where each one of the floors, door condition, etc may be

    depicted by a single hit.

    The 89C51 has instructions for bit manipulation and testing. Apart from these, it

    has 8-bit multiply and divide instructions, which may be used with advantage. The

    89C51 has short branch instructions for 'within page' and conditional jumps, short jumps

    and calls within 2k memory space which are very convenient, and as such the controller

    seems to favor programs which are less than 2k byte long.

    Some versions of 8751 EPROM devices have a security bit which can be

    programmed to lock the device and then the contents of internal program EPROM

    cannot be read.

    The device has to be erased in full for further alteration, and thus it can only be

    reused but not copied. EEPROM and FLASH memory versions of the device are also

    available now.

    Memory consists of all memory locations, and addressing is nothing but

    selecting one of them. This means that we need to select the desired memory location on

    one hand, and on the other hand we need to wait for the contents of that location.

    Besides reading from a memory location, memory must also provide for writing onto it.

    This is done by supplying an additional line, called control line. We will designate this

    line as R/W (read/write). Control line is used in the following way: if r/w=1, reading is

    done, and if opposite is true then writing is done on the memory location.

    Registers are the memory locations whose role is to help with performing

    various mathematical operations or any other operations with data wherever data can be

    found. We have two independent entities (memory and CPU), which are interconnected,

    and thus any exchange of data is hindered, as well as its functionality. If, for example,

    we wish to add the contents of two memory locations and return the result again back to

    memory, we would need a connection between memory and CPU. Simply stated, we

    must have some way through data goes from one block to another.

  • -20-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    That way is called bus. Physically, it represents a group of 8, 16, or more

    wires. There are two types of buses: address and data bus. The first one consists of as

    many lines as the amount of memory we wish to address and the other one is as wide as

    data, in our case 8 bits or the connection line. First one serves to transmit address from

    CPU memory, and the second to connect all blocks inside the micro controller.

    Those locations weve just added are called ports. There are several types of

    ports: input, output or bi-directional ports. When working with ports, first of all it is

    necessary to choose which port we need to work with, and then to send data to, or take it

    from the port. When working with it the port acts like a memory location.

    Something is simply being written into or read from it, and it could be noticed on the

    pins of the micro-controller.

    AT89C2051 MICROCONTROLLER

    The AT89C2051 is a low-voltage, high-performance CMOS 8-bit

    microcomputer with 2K bytes of Flash programmable and erasable read-only memory

    (PEROM). The device is manufactured using Atmels high-density nonvolatile memory

    technology and is compatible with the industry-standard MCS-51 instruction set. By

    combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel

    AT89C2051 is a powerful microcomputer which provides a highly-flexible and cost-

    effective solution to many embedded control applications.

    The AT89C2051 provides the following standard features:

    2K bytes of Flash

    128 bytes of RAM

    15 I/O lines

    Two 16-bit timer/counters

    A five vector two-level interrupt architecture

    A full duplex serial port

    A precision analog comparator

    On-chip oscillator and clock circuitry

  • -21-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    In addition, the AT89C2051 is designed with static logic for operation down to

    zero frequency and supports two software selectable power saving modes. The Idle

    Mode stops the CPU while allowing the RAM, timer/counters, serial port and interrupt

    system to continue functioning. The power-down mode saves the RAM contents but

    freezes the oscillator disabling all other chip functions until the next hardware reset.

    INTERNAL BLOCK DIAGRAM:

    FIG 5.3 AT89C2051 internal block diagram

    SALIENT FEATURES:

    Compatible with MCS-51Products

    2K Bytes of Reprogrammable Flash Memory

    Endurance: 10,000 Write/Erase Cycles

    2.7V to 6V Operating Range

    Fully Static Operation: 0 Hz to 24 MHz

    Two-level Program Memory Lock

  • -22-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    128 x 8-bit Internal RAM

    15 Programmable I/O Lines

    Two 16-bit Timer/Counters

    Programmable Serial UART Channel

    Direct LED Drive Outputs

    On-chip Analog Comparator

    Low-power Idle and Power-down Modes

    Addr

    .

    Port/Register

    81 SP (stack pointer)

    82 DPL (data pointer Low)

    83 DPH (data pointer High)

    87 PCON

    88 TCON (timer control)

    89 TMOD (timer mode)

    8A TLO (timer 0 low byte)

    8B TL1 (timer 1 low byte)

    8C TH0 (timer 0 high byte)

    8D TH1 (timer 1 high byte)

    90 P1 (port 1)

    98 SCON (serial control)

    99 SBUF (serial buffer)

    A8 IE(Interrupt enable)

    B0 P3 (port 3)

    B8 IP(Interrupt priority)

    D0 PSW(Processor status word)

    E0 ACC(Accumulator)

    F0 B register

  • -23-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    AT89C2051 SERIAL PORT PINS:

    PIN ALTERNATE USE SFR

    P3.0RXD Serial data input SBUF

    P3.ITXD Serial data output SBUF

    P3.2INTO External interrupt 0 TCON-1

    P3.3INT1 External interrupt 1 TCON- 2

    P3.4TO External timer 0 input TMOD

    P3.5T1 External timer 1 input TMOD

    RF TRANSMITTER

    This block generates a continuous frequency of 100MHz, which is used to form

    a permanent link between the transmitter and receiver, and this is known as carrier

    frequency. The output of serial port is fed to this RF radio transmitter. This is a

    frequency modulated radio transmitter. The radiating power of the transmitter is

    20mw, and it is designed using BC 494 B high frequency switching transistor.

    The instantaneous frequency of the carrier is varied directly in accordance with

    the base band signal by means of a device known as VCO (Voltage Controlled

    Oscillator) one of implementing such a device is to use to sinusoidal oscillator having a

    relatively high-Q frequency. Determining Network and to control the oscillator by

    symmetrical incremental variation of the reactive components. Thus the serial data is

    modulated at 100MHz carrier.

    PIN DIAGRAM:

  • -24-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    FEATURES:

    433.92 MHz Frequency

    Low Cost

    1.5-12V operation

    11mA current consumption at 3V 4 dBm output power at 3V

    APPLICATIONS:

    Remote Lighting Controls

    Wireless Alarm and Security Systems

    Long Range RFID

    Automated Resource Management

    RF RECEIVER

    The RF receiver is designed with IC TEA5710, which is AM/RF Radio receiver

    IC, operates at a local oscillator of 88 - 108MHz and is tuned with the transmitter. This

    IC consists of built in RF amplifier, a double balanced mixer, local oscillator, a two

    stage IF amplifier, a quadrature demodulator and an automatic frequency control. The

    built in RF amplifier, apart from the amplification of received RF signal reduces the

    Noise figure, which could other wise be a problem because of the large band widths

    needed for RF.

    This radio receiver is used as a RF detector and limiter with minimum of

    external components. This IC includes cascaded stages of IF limiting and balanced

    product detector with a very low Harmonic distortion and high IF voltage gain.

    The RF receiver that operates at 100MHz will have an IF of 10.7 MHz and

    bandwidth of 200KHz.

    PIN DIAGRAM

  • -25-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    FEATURES:

    Low Cost

    5V operation

    Receiver Frequency: 433.92 MHZ

    IF Frequency: 1MHz

    APPLICATIONS:

    Car security system

    Sensor reporting

    Automation system

    Remote Lighting Controls

    STEPPER MOTOR DRIVES

    Fig 5.4 Stepper motor drive circuit

    When the output of the controller is high, the base current I flows in to base of

    the transistor, thus providing voltage drop more then 0.7V across the Ve junction, thus

    the transistor goes in to saturation mode. So the Ic is maximum and the voltage drop

    across the Vce junction is zero. I.e. the input to MOSFET is zero. So the MOSFET will

    not conduct and stepper motor coil will not energize.

    If the output of the controller is low, the base current I is zero, thus providing

    voltage drop less then 0.1V across the Ve junction, thus the transistor goes in to cut-off

    mode. So the Ic is minimum and the voltage drop across the Vce junction is maximum.

    I.e. the input to MOSFET is almost Vcc. So the MOSFET will conduct and stepper

    motor coil get energized.

  • -26-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    STEPPER MOTORS

    INTRODUCTION:

    Stepper Motors have several features which distinguish them from AC Motors,

    and DC Servo Motors.

    Brushless - Steppers are brush less Motors with contact brushes create sparks,

    undesirable in certain environments. (Space missions, for example.)

    Holding Torque - Steppers have very good low speed and holding torque.

    Steppers are usually rated in terms of their holding force (oz/in) and can even hold a

    position (to a lesser degree) without power applied, using magnetic 'detent' torque.

    Open loop positioning - Perhaps the most valuable and interesting feature of a

    stepper is the ability to position the shaft in fine predictable increments, without need to

    query the motor as to its position. Steppers can run 'open-loop' without the need for any

    kind of encoder to determine the shaft position. Closed loop systems- systems that feed

    back position information, are known as servo systems. Compared to servos, steppers

    are very easy to control, the position of the shaft is guaranteed as long as the torque of

    the motor is sufficient for the load, under all its operating conditions.

    Load Independent - The rotation speed of a stepper is independent of load,

    provided it has sufficient torque to overcome slipping. The higher rpm a stepper motor

    is driven, the more torque it needs, so all steppers eventually poop out at some rpm and

    start slipping. Slipping is usually a disaster for steppers, because the position of the

    shaft becomes unknown. For this reason, software usually keeps the stepping rate

    within a maximum top rate. In applications where a known RPM is needed under a

    varying load, steppers can be very handy.

    TYPES OF STEPPERS:

    Stepper Motors come in a variety of sizes, and strengths, from tiny floppy disk

    motors, to huge machinery steppers rated over 1000 oz in. There are two basic types of

    steppers-- bipolar and unipolar. The bipolar stepper has 4 wires have 5, 6 or 8 wires.

  • -27-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    MOTOR BASICS:

    The Unipolar Stepper motor has 2 coils, simple lengths of wound wire. The

    coils are identical and are not electrically connected. Each coil has a center tap - a wire

    coming out from the coil that is midway in length between its two terminals. You can

    identify the separate coils by touching the terminal wires together-- If the terminals of a

    coil are connected, the shaft becomes harder to turn. Because of the long length of the

    wound wire, it has a significant resistance (and inductance). The resistance from a

    terminal to the center tap is half the resistance from the two terminals of a coil. Coil

    resistance of half a coil is usually stamped on the motor; For example, '5 ohms/phase'

    indicates the resistance from center tap to either terminal of a coil. The resistance from

    terminal to terminal should be 10 ohms.

    FIG 5.5 Stepper motor coil diagram

    MOTOR CONTROL CIRCUITRY:

    FIG 5.6 Magnetic field diagram

    Current flowing through a coil produces a magnet field which attracts a

    permanent magnet rotor which is connected to the shaft of the motor. The basic

    principle of stepper control is to reverse the direction of current through the 2 coils of a

    stepper motor, in sequence, in order to influence the rotor.

  • -28-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    Since there are 2 coils and 2 directions, that gives us a possible 4-phase

    sequence. All we need to do is get the sequencing right and the motor will turn

    continuously. You may wonder how the stepper can achieve such fine stepping

    increments with only a 4-phase sequence. The internal arrangement of the motor is quite

    complex- the winding and core repeating around the perimeter of the motor many times.

    The rotor is advanced only a small angle either forward or reverse, and the 4-phase

    sequence is repeated many times before a complete revolution occurs.

    FIG 5.7 Stepper motor basic control diagram

    Let us return to the 4-phase sequence of reversing the current though the 2 coils.

    A Bipolar stepper controller achieves the current reversal by reversing the polarity at the

    two terminals of a coil. The Unipolar controller takes advantage of the center tap to

    achieve the current reversal with a clever trick -- The Center tap is tied to the positive

    supply, and one of the 2 terminals is grounded to get the current flowing one direction.

    The other terminal is grounded to reverse the current. Current can thus flow in both

    directions, but only half coils are energized at a time. Both terminals are never

    grounded at the same time, which would energize both coils, achieving nothing but a

    waste of power.

    CONCEPTUAL MODEL OF UNIPOLAR STEPPER MOTOR:

  • -29-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    With center taps of the windings wired to the positive supply, the terminals of

    each winding are grounded, in sequence, to attract the rotor, which is indicated by the

    arrow in the picture. (Remember that a current through a coil produces a magnetic

    field.) This conceptual diagram depicts a 90-degree step per phase.

    In a basic "Wave Drive" clockwise sequence, winding 1a is de-activated and

    winding 2a activated to advance to the next phase. The rotor is guided in this manner

    from one winding to the next, producing a continuous cycle. Note that if two adjacent

    windings are activated, the rotor is attracted mid-way between the two windings.

    The following table describes 3 useful stepping sequences and their relative

    merits. The sequence pattern is represented with 4 bits; a '1' indicates an energized

    winding. After the last step in each sequence the sequence repeats. Stepping backwards

    through the sequence reverses the direction of the motor.

    Table of Stepping Sequences:

    Sequence Name Description

    0001

    0010

    0100

    1000

    Wave

    Drive,

    One-

    Phase

    Consumes the least power. Only one phase is

    energized at a time. Assures positional accuracy

    regardless of any winding imbalance in the motor.

    0011

    0110

    1100

    1001

    Hi-

    Torque,

    Two-

    Phase

    Hi Torque - This sequence energizes two adjacent

    phases, which offers an improved torque-speed

    product and greater holding torque.

    0001

    0011

    0010

    0110

    0100

    1100

    1000

    1001

    Half-

    Step

    Half Step - Effectively doubles the stepping

    resolution of the motor, but the torque is not

    uniform for each step. (Since we are effectively

    switching between Wave Drive and Hi-Torque

    with each step, torque alternates each step.) This

    sequence reduces motor resonance, which can

    sometimes cause a motor to stall at a particular

    resonant frequency. Note that this sequence is 8

    steps.

  • -30-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    IDENTIFYING STEPPER MOTORS:

    F15 5.8 Stepper motor identification diagram

    Stepper motors have numerous wires, 4, 5, 6, or 8. When you turn the shaft you

    will usually feel a "notched" movement. Motors with 4 wires are probably bipolar

    motors and will not work with a Unipolar control circuit. The most common

    configurations are pictured above. You can use an ohm-meter to find the center tap -

    the resistance between the center and a leg is 1/2 that from leg to leg. Measuring from

    one coil to the other will show an open circuit, since the 2 coils are not connected.

    (Notice that if you touch all the wires together, with power off, the shaft is difficult to

    turn!)

    SHORTCUT FOR FINDING THE PROPER WIRING SEQUENCE:

    Connect the center tap(s) to the power source (or current-Limiting resistor.)

    Connect the remaining 4 wires in any pattern. If it doesn't work, you only need try these

    2 swaps...

    1 2 4 8 - arbitrary first wiring order

    1 2 8 4 - switch end pair

    1 8 2 4 - switch middle pair

    If the motor turns in the opposite direction from desired, reverse the wires so

    that ABCD would become DCBA.

  • -31-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    HEAT CONSIDERATIONS:

    Over-heating can be an early indicator of a problem or need for additional heat

    sinking. This is true of both the controller and motors. Components can be warm to the

    touch, but not so hot that you can't leave your finger on them for a few seconds.

    Motors are designed to be mounted in such a way that, heat is drawn away from

    the motors. This is usually accomplished with a metal mounting bracket. Motors that

    are not yet mounted may require some type of temporary heat sinking. Motors heat

    more running at the LOW speeds or in Hold Mode.

    If a component or motor is running too hot, try using the Wave Drive stepping

    mode only, if it still runs too hot, try heat sinking, and/or a fan. If it still runs too hot,

    something is wrong.

    FIRING INDICATOR

    FIG 5.9 Firing indicator circuit diagram

    The fire signal from micro controller is a pulse output of 1sec. i.e. the output is

    high for 1sec. When the output of the controller is high, the base current I flows in to

    base of the transistor, thus providing voltage drop more then 0.7V across the Ve

    junction, thus the transistor goes in to saturation mode. So the Ic is maximum and the

    LED will glow and simultaneously, buzzer gives a beep sound.

  • -32-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    IR TRANSMITTER AND RECEIVER

    FIG 5.10

    Infrared transmitter is one type of LED which emits infrared rays generally

    called IR Transmitter. Similarly IR Receiver is used to receive the IR rays transmitted

    by the IR transmitter. One important point is both IR transmitter and receiver should be

    placed straight line to each other.

    IR transmitter is used to release the IR light rays. These rays are collected by IR

    receiver. The IR receiver is connected with comparator. The comparator is constructed

    with LM358 operational amplifier. In the comparator circuit the reference voltage is

    given to non-inverting input terminal. The inverting terminal s connected to IR receiver.

    When any interrupt the IR rays between the IR transmitter and receiver, the IR receiver

    is not conducting. So the comparator inverting input voltage is higher then non-

    inverting input. So it sends an active low pulse to the MCU. When there is vehicle in

    between transmitter and receiver, IR rays are collected by receiver.

    In the first stage of LM358, the output of the op-amp is connected directly to

    inverting input so that it acts as a voltage follower or buffer. This will prevent any

    loading of signal by the next stage.

    In the second stage a variable voltage reference is connected to non-inverting

    input and signal is connected to inverting input. If the signal is lower then the reference

    the output will go high (+5V), or if the signal is higher then the reference then the

    output goes low (0V). Normally the signal level will be 2V for low and 2.5V for high.

    After comparator the output will be 0V for high input and +5Vfor low input i.e. the

    level is converted.

  • -33-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    PC INTERFACE SECTION

    RS-232 Connecter diagram

    The above shown connector known as 9-pin, D-type male connector used for

    RS232 connections. The pin description is given in the following table.

    Pin

    number

    Comm

    on

    Name

    RS23

    2

    name

    Description Sign

    al

    dire

    ctio

    n

    1 /CD CF Received line signal

    detector

    IN

    2 RXD BB Received data IN

    3 TXD BA Transmitted data OU

    T

    4 /DTR CD Data terminal ready OU

    T

    5 GND AB Signal ground --

    6 /DSR CC Data set ready IN

    7 /RTS CA Request to send OU

    T

    8 /CTS CB Clear to send IN

    9 -- CE Ring indicator IN

    RS-232 pin details

    1 2

    3

    4 5

    6

    7 8

    9

  • -34-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    We cannot simply connect our system to this terminal with out providing proper

    hand shaking signal. For communicating with RS-232 type equipment, the /RTS of the

    connector is simply looped into the /CTS, so /CTS will automatically be asserted when

    /RTS is asserted internally. Similarly the /DTR is looped into /DSR and /CD, so when

    PC asserts its /DTR output the /DSR and /CD inputs are automatically be asserted. They

    are necessary to get the PC and our system talk each other. The connection diagram is

    shown below.

    The MAX232 I.C convert input TTL level into RS-232C standard level and

    connected to PC through 9-pin D-type connector. Now discuss about standards of

    RS232 and Serial communication through RS232 .

    MAX232 CIRCUIT DIAGRAM:

    FIG 5.11 RS-232 Circuit diagram

  • -35-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    RS-232 logic levels are indicated by positive and negative voltages, rather than

    by the positive-only signals of 5V TTL and CMOS logic. At an RS-232 data output

    (TD), a logic 0 is defined as equal to or more positive than +5V, and a logic 1 is defined

    as equal to as or more negative than 5V. In other words, the signals use negative logic,

    where the more negative voltage is logic 1.

    RS-232 interface chips invert the signals. According to the standard, the logic

    level of an input between 3V and +3V is undefined.

  • -36-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    CHAPTER VI

    SOFTWARE IMPLEMENTATION

    ASSEMBLY PROGRAM:

    MASTER:

    ;---------------------------------------------------------------------------------------------------------

    --

    ;>

    ;> TITLE : RADAR SIMILATION WITH OPTICAL SENSOR

    ;> TARGET : AT89C51

    ;> VERSION : VER-01

    ;> STARTED : 05-03-2005

    ;>

    ;---------------------------------------------------------------------------------------------------------

    ;>

    ;> INCLUDES :

    $MOD51

    ;>

    ;---------------------------------------------------------------------------------------------------------

    ;>

    ;> HARD WARE DETAILS :

    ;> RADAR MOTOR CONTROL - P0.0 TO P0.3

    ;> GUN MOTOR CONTROL - P0.4 TO P0.7

    ;> COMMUNICATION O.K. IND - P1.0

    COK BIT P1.0

    ;> I.R.FEED BACK - P2.6

    IRF BIT P2.6

    ;> CODE MATCH INPUT - P1.7

    CMI BIT P1.7

    ;> ANTENNA HOME SENSOR - P2.7

    AHS BIT P2.7

  • -37-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    ;> GUN HOME SENSOR - P2.5

    GHS BIT P2.5

    ;> FIRING CONTROL - P3.7

    FNC BIT P3.7

    ;> FIRING CONTROL - P3.6

    FNC1 BIT P3.6

    ;> SLAVE RESET CONTROL - P3.4

    SRST BIT P3.4

    ;>

    ;---------------------------------------------------------------------------------------------------------

    ;>

    ;> FLAGS :

    KEY_RLS BIT 00H

    MOT_DIR BIT 01H

    SEND_ANG BIT 02H

    ENEMY BIT 03H

    ABS_LOCK BIT 04H

    ZERO_LOCK BIT 05H

    ;>

    ;---------------------------------------------------------------------------------------------------------

    ;>

    ;> VARIABLES :

    STEP_CNT DATA 30H

    MOT_FB DATA 32H

    RAD_CNTL DATA 33H

    RAD_CNTH DATA 34H

    GUN_CNTL DATA 35H

    GUN_CNTH DATA 36H

    ABS_CNTL DATA 37H

    ABS_CNTH DATA 38H

    STEP_CNTG DATA 39H

  • -38-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    P2_BUF DATA 3AH

    ROT_CNT1 DATA 3BH

    ROT_CNT2 DATA 3CH

    ;>

    ;---------------------------------------------------------------------------------------------------------

    ;>

    ;> VECTOR ADDRESESS:

    ORG 0000H

    ljmp INITIALISATION

    ORG 000BH

    reti

    ORG 0023H ; serial interrupt

    ; push ACC

    push PSW

    jbc RI, RECEIVE_DATA

    ajmp SKIP_CHKS

    RECEIVE_DATA:

    cpl COK

    mov MOT_FB, SBUF

    setb SEND_ANG

    SKIP_CHKS:

    pop PSW

    ; pop ACC

    reti

    ;>

    ;---------------------------------------------------------------------------------------------------------

  • -39-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    INITIALISATION:

    mov P0, #0FFH

    mov P1, #0FFH

    mov P2, #0FFH

    mov P3, #0FFH

    mov SP, #65H

    mov DPTR, #0400H

    mov TMOD, #21H

    anl pcon, #7fh ; set smod

    mov th1, #0FDh ; set TH1 for 9600 rate.

    mov scon, #050h ; set MODE 3, REN, TB8, TI. Clr SM2.

    mov IE, #90H

    setb TR1

    mov STEP_CNT, #00h

    mov STEP_CNTG, #00h

    clr MOT_DIR

    clr ABS_LOCK

    clr ZERO_LOCK

    mov ABS_CNTH, #00H

    mov ABS_CNTL, #00H

    mov GUN_CNTL, #00H

    mov GUN_CNTH, #00H

    mov RAD_CNTL, #00H

    mov RAD_CNTH, #00H

    mov ROT_CNT2, #00H

    mov ROT_CNT1, #00H

    lcall BRING_HOME

    orl P2_BUF, #0F0H

    lcall BRING_HOME_GUN

    orl P2_BUF, #0FFH

  • -40-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    mov P0, P2_BUF

    clr SRST

    mov SBUF, #0AAH

    CHAN0: jnb TI, CHAN0

    clr TI

    ;>

    ;---------------------------------------------------------------------------------------------------------

    ;>

    MAIN:

    jb IRF, ON_IR_IND

    clr P3.5

    ON_IR_IND:

    jnb IRF, OFF_IR_IND

    setb P3.5

    OFF_IR_IND:

    ; jnb SEND_ANG, MAIN

    ; clr SEND_ANG

    inc ROT_CNT1

    mov A, ROT_CNT1

    cjne A, #00H, SKIP_CY_CNT

    inc ROT_CNT2

    mov A, ROT_CNT2

    SKIP_CY_CNT:

    mov A, ROT_CNT2

    cjne A, #01H, CP_REV_CNT1

    mov A, ROT_CNT1

    cjne A, #2CH, CP_REV_CNT1

  • -41-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    CP_REV_CNT1:

    jc CP_REV_CNT

    jnb MOT_DIR, CP_REV_CNT2

    lcall BRING_HOME

    clr ENEMY

    setb FNC

    setb FNC1

    CP_REV_CNT2:

    cpl MOT_DIR

    mov ROT_CNT2, #00H

    mov ROT_CNT1, #00H

    CP_REV_CNT:

    jb MOT_DIR, MOVE_MOT_FD

    lcall MOVE_FRWD

    lcall DLY2

    inc RAD_CNTL

    mov A, RAD_CNTL

    cjne A, #00H, MOVE_MOT_FD

    inc RAD_CNTH

    MOVE_MOT_FD:

    jnb MOT_DIR, MOVE_MOT_BD

    lcall MOVE_REV

    lcall DLY2

    dec RAD_CNTL

    mov A, RAD_CNTL

    cjne A, #0FFH, MOVE_MOT_BD1

    dec RAD_CNTH

    MOVE_MOT_BD1:

    mov A, RAD_CNTH

  • -42-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    cjne A, #0FFH, MOVE_MOT_BD

    mov A, RAD_CNTL

    cjne A, #0FFH, MOVE_MOT_BD

    mov RAD_CNTL, #00H

    mov RAD_CNTH, #00H

    MOVE_MOT_BD:

    ; mov A, MOT_FB

    ; cjne A, #0BBH, MOVE_MOT_HM

    ; mov MOT_FB, #00H

    ; lcall BRING_HOME

    ; mov RAD_CNTL, #00H

    ; mov RAD_CNTH, #00H

    ;MOVE_MOT_HM:

    ; mov A, MOT_FB

    ; cjne A, #0CCH, STOP_FIRING

    ; mov MOT_FB, #00H

    ; clr ENEMY

    ; setb FNC

    ; setb FNC1

    ;STOP_FIRING:

    mov A, GUN_CNTH

    cjne A, ABS_CNTH, DONT_FIRE_GUN

    mov A, GUN_CNTL

    cjne A, ABS_CNTL, DONT_FIRE_GUN

    orl P2_BUF, #0FH

    orl P0, #0FH

    jnb ENEMY, DONT_FIRE_ON

    cpl FNC

    cpl FNC1

  • -43-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    DONT_FIRE_ON:

    ljmp DONT_SEND_INF

    DONT_FIRE_GUN:

    jc MOVE_GUN_FOR

    jnc MOVE_GUN_REV

    MOVE_GUN_FOR:

    setb FNC

    setb FNC1

    lcall MOVE_G_FRWD

    inc GUN_CNTL

    mov A, GUN_CNTL

    cjne A, #00H, MOVE_GUN_REV1

    inc GUN_CNTH

    MOVE_GUN_REV1:

    ljmp DONT_SEND_INF

    MOVE_GUN_REV:

    setb FNC

    setb FNC1

    lcall MOVE_G_REV

    dec GUN_CNTL

    mov A, GUN_CNTL

    cjne A, #0FFH, DEC_GUN_CNT1

    dec GUN_CNTH

    DEC_GUN_CNT1:

    mov A, GUN_CNTH

    cjne A, #0FFH, DONT_SEND_INF

    mov A, GUN_CNTL

    cjne A, #0FFH, DONT_SEND_INF

    mov GUN_CNTL, #00H

    mov GUN_CNTH, #00H

  • -44-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    DONT_SEND_INF:

    jb ABS_LOCK, RESET_GUN

    mov A, ABS_CNTH

    cjne A, #00H, RESET_GUN

    mov A, ABS_CNTL

    cjne A, #00H, RESET_GUN

    setb ABS_LOCK

    lcall BRING_HOME_GUN

    orl P2_BUF, #0FH

    mov P1, P2_BUF

    mov GUN_CNTL, #00H

    mov GUN_CNTH, #00H

    RESET_GUN:

    jb IRF, SEND_NO_INT

    cpl P1.4

    jb CMI, LOAD_ENEMY

    setb ENEMY

    mov ABS_CNTL, RAD_CNTL

    mov ABS_CNTH, RAD_CNTH

    clr ABS_LOCK

    mov A, #06H

    mov C, MOT_DIR

    mov ACC.7, C

    mov SBUF, A

    LOAD_ENEMY:

    jnb CMI, LOAD_FRIEND

    clr ENEMY

    mov A, #05H

    mov C, MOT_DIR

  • -45-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    mov ACC.7, C

    mov SBUF, A

    LOAD_FRIEND:

    CHAN1: jnb TI, CHAN1

    clr TI

    SEND_NO_INT:

    jnb IRF, SEND_INT

    cpl P1.4

    mov A, #01H

    mov C, MOT_DIR

    mov ACC.7, C

    mov SBUF, A

    CHAN2: jnb TI, CHAN2

    clr TI

    SEND_INT:

    lcall DLY3

    ljmp MAIN

    ;>

    ;---------------------------------------------------------------------------------------------------------

    ;>

    MOVE_FRWD:

    mov DPTR, #STEP_RUN

    mov A, STEP_CNT

    movc A, @A+dptr

    mov P2_BUF, P0

    anl P2_BUF, #0FH

    orl P2_BUF, A

    mov P0, P2_BUF

    inc STEP_CNT

  • -46-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    mov A, STEP_CNT

    cjne A, #08h, NOTCH1

    mov STEP_CNT, #00h

    NOTCH1:

    lcall DLY1

    ret

    ;>

    ;---------------------------------------------------------------------------------------------------------

    ;>

    MOVE_REV:

    mov DPTR, #STEP_RUN

    mov A, STEP_CNT

    movc A, @A+dptr

    mov P2_BUF, P0

    anl P2_BUF, #0FH

    orl P2_BUF, A

    mov P0, P2_BUF

    dec STEP_CNT

    mov A, STEP_CNT

    cjne A, #0FFh, NOTCH2

    mov STEP_CNT, #07h

    NOTCH2:

    lcall DLY1

    ret

    ;>

    ;---------------------------------------------------------------------------------------------------------

    ;>

    BRING_HOME:

    mov DPTR, #STEP_RUN

    mov A, STEP_CNT

  • -47-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    movc A, @A+dptr

    mov P2_BUF, P0

    anl P2_BUF, #0FH

    orl P2_BUF, A

    mov P0, P2_BUF

    dec STEP_CNT

    mov A, STEP_CNT

    cjne A, #0FFh, NOTCH3

    mov STEP_CNT, #07h

    NOTCH3:

    lcall DLY2

    jnb AHS, BRING_HOME

    mov STEP_CNT, #00h

    ret

    ;>

    ;---------------------------------------------------------------------------------------------------------

    ;>

    MOVE_G_FRWD:

    mov DPTR, #STEP_GUN

    mov A, STEP_CNTG

    movc A, @A+dptr

    mov P2_BUF, P0

    anl P2_BUF, #0F0H

    orl P2_BUF, A

    mov P0, P2_BUF

    inc STEP_CNTG

    mov A, STEP_CNTG

    cjne A, #08h, NOTCH4

    mov STEP_CNTG, #00h

  • -48-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    NOTCH4:

    lcall DLY1

    ret

    ;>

    ;---------------------------------------------------------------------------------------------------------

    ;>

    MOVE_G_REV:

    mov DPTR, #STEP_GUN

    mov A, STEP_CNTG

    movc A, @A+dptr

    mov P2_BUF, P0

    anl P2_BUF, #0F0H

    orl P2_BUF, A

    mov P0, P2_BUF

    dec STEP_CNTG

    mov A, STEP_CNTG

    cjne A, #0FFh, NOTCH5

    mov STEP_CNTG, #07h

    NOTCH5:

    lcall DLY1

    ret

    ;>

    ;---------------------------------------------------------------------------------------------------------

    ;>

    BRING_HOME_GUN:

    mov DPTR, #STEP_GUN

    mov A, STEP_CNTG

    movc A, @A+dptr

    mov P2_BUF, P0

    anl P2_BUF, #0F0H

  • -49-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    orl P2_BUF, A

    mov P0, P2_BUF

    dec STEP_CNTG

    mov A, STEP_CNTG

    cjne A, #0FFh, NOTCH6

    mov STEP_CNTG, #07h

    NOTCH6:

    lcall DLY2

    jnb GHS, BRING_HOME_GUN

    mov STEP_CNTG, #00h

    ret

    ;>

    ;---------------------------------------------------------------------------------------------------------

    ;>

    DLY1:

    mov r4, #02h

    GONE1: mov r5, #02h

    OUT1: mov r6, #10h

    IN1: djnz r6, IN1

    djnz r5, OUT1

    djnz r4, GONE1

    RET

    DLY2:

    mov r4, #05h

    GONE2: mov r5, #07h

    OUT2: mov r6, #00h

    IN2: djnz r6, IN2

    djnz r5, OUT2

    djnz r4, GONE2

    RET

  • -50-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    DLY3:

    mov r4, #02h

    GONE3: mov r5, #04h

    OUT3: mov r6, #0B0h

    IN3: djnz r6, IN3

    djnz r5, OUT3

    djnz r4, GONE3

    RET

    ;>

    ;---------------------------------------------------------------------------------------------------------

    --

    ORG 0400H

    STEP_RUN:

    db 090H

    db 010H

    db 050H

    db 040H

    db 060H

    db 020H

    db 0A0H

    db 080H

    STEP_GUN:

    db 09H

    db 01H

    db 05H

    db 04H

    db 06H

    db 02H

    db 0AH

    db 08H

    END

  • -51-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    RFID TRANSMITTER:

    ;---------------------------------------------------------------------------------------------------------

    ;>

    ;> TITLE : RFID TAG

    ;> TARGET : AT89C2051

    ;> STARTED : 18-06-2009

    ;>

    ;---------------------------------------------------------------------------------------------------------

    ;>

    ;> INCLUDES :

    $MOD51

    ;>

    ;---------------------------------------------------------------------------------------------------------

    ;>

    ;> VECTOR ADDRESESS:

    ORG 0000H

    ljmp RESET

    ORG 0023H

    RETI

    ;>

    ;---------------------------------------------------------------------------------------------------------

    ;>

    RESET:

    mov P3, #0FFH

    mov P1, #0FFH

    mov sp, #65H ; init stack pointer

    anl PCON, #7FH ; CLR SMOD BIT

    mov TMOD, #21H ; TIMER 1 IN MODE 2

    mov TH1, #0E8H ; SET BAUD RATE AS 1200

    mov SCON, #50H

    ; SERIAL MODE 1 AND RECEIVE ENABLE

  • -52-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    mov IE, #90H ; ENABLE SERIAL INTERRUPT

    setb TR1 ; RUN TIMER 1

    ;>

    ;---------------------------------------------------------------------------------------------------------

    ;>

    MAIN:

    cpl P3.2

    mov SBUF, #055H

    CHAN1: jnb TI, CHAN1

    clr TI

    lcall SERL_DLY1

    mov SBUF, #055H

    CHAN2: jnb TI, CHAN2

    clr TI

    lcall SERL_DLY1

    mov SBUF, #0AAH ; AA IS HEADER

    CHAN3: jnb TI, CHAN3

    clr TI

    lcall SERL_DLY1

    mov A, P1

    mov SBUF, A

    CHAN4: jnb TI, CHAN4

    clr TI

    lcall SERL_DLY1

    mov A, P1

    xrl A, #0AAH

    mov SBUF, A

  • -53-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    CHAN5: jnb TI, CHAN5

    clr TI

    lcall SERL_DLY1

    ljmp MAIN

    ;>

    ;---------------------------------------------------------------------------------------------------------

    --

    ;>

    SERL_DLY1:

    mov R6, #05H

    SOUT1: mov R7, #00H

    SIN1: djnz R7, SIN1

    djnz R6, SOUT1

    RET

    ;>

    ;---------------------------------------------------------------------------------------------------------

    --

    ;>

    END

    RFID RECEIVER:

    ;---------------------------------------------------------------------------------------------------------

    ;>

    ;> TITLE : Radar with RFid

    ;> TARGET : AT89C2051

    ;> STARTED : 24-12-2005

    ;>

    ;---------------------------------------------------------------------------------------------------------

    ;>

    ;> INCLUDES :

    $MOD51

    ;>

    ;---------------------------------------------------------------------------------------------------------

  • -54-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    ;>

    ;> FLAGS :

    ;>

    ;---------------------------------------------------------------------------------------------------------

    ;>

    ;> VARIABLES :

    COMMD DATA 30H

    CHK_SUM DATA 31H

    TMP_VAL DATA 32H

    SERL_CNT DATA 33H

    ;>

    ;---------------------------------------------------------------------------------------------------------

    ;>

    ;> VECTOR ADDRESESS:

    ORG 0000H

    ljmp RESET

    ORG 000BH ; TIMER 0 interrupt

    push ACC

    push PSW

    inc SERL_CNT

    mov A, SERL_CNT

    cjne A, #30D, RESET_CNT

    mov SERL_CNT, #00H

    mov COMMD, #0FFH

    RESET_CNT:

    pop PSW

    pop ACC

    reti

    ORG 0023H ; serial interrupt

    push ACC

    push PSW

  • -55-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    cpl P3.5

    jbc RI, RECEIVE_DATA

    ajmp SKIP_CHKS

    RECEIVE_DATA:

    mov A, SBUF

    cjne A, #055H, CHEK_NEXT0

    mov R0, #00H

    ljmp SKIP_CHKS

    CHEK_NEXT0:

    cjne A, #0AAH, CHEK_NEXT1

    clr P3.4

    mov R0, #01H

    ljmp SKIP_CHKS

    CHEK_NEXT1:

    cjne R0, #01H, CHEK_NEXT2

    mov R0, #02H

    mov TMP_VAL, A

    ljmp SKIP_CHKS

    CHEK_NEXT2:

    cjne R0, #02H, SKIP_CHKS

    mov R0, #00H

    mov CHK_SUM, A

    mov A, #0AAH

    xrl A, TMP_VAL

    cjne A, CHK_SUM, SKIP_CHKS

    mov SERL_CNT, #00H

    mov COMMD, TMP_VAL

    setb P3.4

    SKIP_CHKS:

    pop PSW

  • -56-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    pop ACC

    reti

    ;>

    ;---------------------------------------------------------------------------------------------------------

    ;>

    RESET:

    mov P1, #0FFH ; move all ports HIGH

    mov P3, #0FFH

    anl PCON, #7FH

    mov SCON, #50H

    mov TMOD, #21H

    mov IE, #92H

    mov TH1, #0F4H

    mov TH0, #00H

    mov TL0, #00H

    setb TR1

    setb TR0

    mov SERL_CNT, #00H

    ;>

    ;---------------------------------------------------------------------------------------------------------

    ;>

    MAIN:

    cpl P3.7

    mov A, COMMD

    anl A, #0F0H

    swap A

    cjne A, #05H, CODE_COMP

    CODE_COMP:

    jc CODE_NOT_OK

  • -57-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    clr P3.2

    clr P3.3

    ljmp MAIN

    CODE_NOT_OK:

    setb P1.2

    setb P1.3

    ljmp MAIN

    ;>

    ;---------------------------------------------------------------------------------------------------------

    --

    ;>

    end

    C PROGRAM:

    #include

    #include

    #include

    #include

    #include

    #define COM1 0

    #define DATA_READY 0x100

    #define TRUE 1

    #define FALSE 0

    #define SETTINGS (_COM_9600 | _COM_NOPARITY | _COM_STOP1 |

    _COM_CHR8)

    void screen(); /* DISPLAYS RECTANGLES AND LETTERS*/

    char ch;

    int maxx,maxy;

    int i;

    int main(void)

  • -58-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    {

    int in, out, status = 0, send;

    int bks, prs;

    int cnt, flt;

    int angl = 300, dir = 0;

    int scnt = 0, mont, clr_cnt = 0;

    struct arccoordstype arcinfo;

    struct arccoordstype arcinfo1;

    struct time tm;

    char string[5];

    int errorcode;

    int gdriver=DETECT, gmode;

    initgraph(&gdriver, &gmode, "C:\\TC\\BGI");

    errorcode = graphresult();

    if (errorcode != grOk)

    {

    printf("Graphics error: %s\n", grapherrormsg(errorcode));

    printf("Press any key to halt:");

    getch();

    exit(1); /* terminate with an error code */

    }

    maxx = getmaxx();

    maxy = getmaxy();

    screen();

    _bios_serialcom(_COM_INIT, COM1, SETTINGS);

    _bios_serialcom(_COM_SEND, COM1, 0xFF);

    while(!kbhit())

    {

    flushall();

  • -59-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    // gotoxy(2,2);printf("%x %d ",angl, dir);

    for(cnt = 0; cnt = 0)

    {

    if((out & 0x0F) == 0x05)scnt = 1;

    if((out & 0x0F) == 0x06)scnt = 2;

    if((out & 0x0F) == 0x01)scnt = 0;

    if((out & 0xF0) == 0x00)dir = 0;

    if((out & 0xF0) == 0x80)dir = 1;

    // gotoxy(1,1);printf("%x ",out);

    if(dir == 0)

    {

    mont = 1;

    angl++;

    if(angl == 361)angl = 0;

    if(angl == 241){dir = 1;delay(500);break;}

    setcolor(LIGHTGRAY);

    arc(maxx/2, maxy/2, angl, angl + 1, 125);

    getarccoords(&arcinfo);

    setcolor(BLUE);

    line(maxx/2, maxy/2, arcinfo.xstart, arcinfo.ystart);

    setcolor(LIGHTGRAY);

    arc(maxx/2, maxy/2, angl - 1, angl, 125);

    getarccoords(&arcinfo);

    arc(maxx/2, maxy/2, angl - 1, angl, 100);

  • -60-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    getarccoords(&arcinfo1);

    setcolor(LIGHTGRAY);

    line(maxx/2, maxy/2, arcinfo.xstart, arcinfo.ystart);

    if(scnt == 2)setcolor(LIGHTRED);

    if(scnt == 1)setcolor(LIGHTGREEN);

    line(arcinfo1.xstart, arcinfo1.ystart, arcinfo.xstart,

    arcinfo.ystart);

    setcolor(LIGHTGRAY);

    setcolor(DARKGRAY);

    circle(maxx/2, maxy/2, 20);

    setcolor(WHITE);

    arc(maxx/2, maxy/2, 45, 225, 20);

    delay(20);

    }

    if(dir == 1)

    {

    mont = 1;

    angl--;

    if(angl == -1)angl = 360;

    if(angl == 299){dir =

    0;_bios_serialcom(_COM_SEND, COM1, 0xBB);delay(500);flt = 0;break;}

    setcolor(LIGHTGRAY);

    arc(maxx/2, maxy/2, angl, angl - 1, 125);

    getarccoords(&arcinfo);

    setcolor(BLUE);

    line(maxx/2, maxy/2, arcinfo.xstart, arcinfo.ystart);

    setcolor(LIGHTGRAY);

    arc(maxx/2, maxy/2, angl + 1, angl, 125);

    getarccoords(&arcinfo);

    arc(maxx/2, maxy/2, angl + 1, angl, 100);

  • -61-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    getarccoords(&arcinfo1);

    setcolor(LIGHTGRAY);

    line(maxx/2, maxy/2, arcinfo.xstart, arcinfo.ystart);

    if(scnt == 2)setcolor(LIGHTRED);

    if(scnt == 1)setcolor(LIGHTGREEN);

    line(arcinfo1.xstart, arcinfo1.ystart, arcinfo.xstart,

    arcinfo.ystart);

    setcolor(LIGHTGRAY);

    // for(i = 0; i

  • -62-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    sprintf(string, "%2d:%02d:%02d",tm.ti_hour, tm.ti_min, tm.ti_sec);

    setcolor(LIGHTGRAY);

    bar(27,maxy-64,maxx-427,maxy-27);

    setcolor(RED);

    settextstyle(0,0,2);

    outtextxy(50,maxy-50,string);

    if(flt == 0)

    {

    setcolor(LIGHTGRAY);

    bar(238,maxy-65,maxx-25,maxy-25);

    }

    }

    }

    flushall();

    if (kbhit())if (getch() == '\x1B')break;

    }

    return 0;

    }

    void screen()

    {

    cleardevice();

    setfillstyle(SOLID_FILL,LIGHTGRAY);

    bar(1,1,maxx,maxy);

    setcolor(WHITE);

    rectangle(2,2,maxx,maxy);

    setcolor(DARKGRAY);

    line(1,maxy,maxx,maxy);

    line(maxx,1,maxx,maxy);

    setcolor(BLUE);

    rectangle(1,1,maxx-1,maxy-1);

    setcolor(DARKGRAY);

  • -63-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    line(1,maxy,maxx,maxy);

    line(maxx,1,maxx,maxy);

    //BORDER

    setcolor(DARKGRAY);

    rectangle(13,13,maxx-13,maxy-13);

    setcolor(WHITE);

    line(13,maxy-13,maxx-13,maxy-13);

    line(maxx-13,13,maxx-13,maxy-13);

    setcolor(BLACK);

    rectangle(14,14,maxx-14,maxy-14);

    setcolor(BLACK);

    line(15,15,maxx-15,15);

    //HEADING

    setcolor(WHITE);

    rectangle(15,16,maxx-15,77);

    setcolor(DARKGRAY);

    line(15,77,maxx-15,77);

    line(maxx-15,16,maxx-15,77);

    setcolor(DARKGRAY);

    line(15,78,maxx-16,78);

    line(maxx-15,16,maxx-15,78);

    setcolor(BLACK);

    line(15,79,maxx-15,79);

    setcolor(WHITE);

    rectangle(15,80,maxx-15,maxy-15);

    setcolor(DARKGRAY);

    line(15,maxy-15,maxx-15,maxy-15);

    line(maxx-15,80,maxx-15,maxy-15);

    //MAIN WINDOW

    setcolor(DARKGRAY);

    rectangle(22,87,maxx-22,maxy-75);

    setcolor(WHITE);

  • -64-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    line(22,maxy-75,maxx-22,maxy-75);

    line(maxx-22,87,maxx-22,maxy-75);

    setcolor(WHITE);

    rectangle(24,89,maxx-24,maxy-77);

    setcolor(DARKGRAY);

    line(24,maxy-77,maxx-24,maxy-77);

    line(maxx-24,89,maxx-24,maxy-77);

    setcolor(BLACK);

    rectangle(23,88,maxx-23,maxy-76);

    //STATUS BAR

    setcolor(DARKGRAY);

    rectangle(235,maxy-68,maxx-22,maxy-22);

    setcolor(WHITE);

    line(235,maxy-22,maxx-22,maxy-22);

    line(maxx-22,maxy-68,maxx-22,maxy-22);

    setcolor(WHITE);

    rectangle(237,maxy-66,maxx-24,maxy-24);

    setcolor(DARKGRAY);

    line(237,maxy-24,maxx-24,maxy-24);

    line(maxx-24,maxy-66,maxx-24,maxy-24);

    setcolor(BLACK);

    rectangle(236,maxy-67,maxx-23,maxy-23);

    //TIME BAR

    setcolor(DARKGRAY);

    rectangle(22,maxy-68,maxx-422,maxy-22);

    setcolor(WHITE);

    line(22,maxy-22,maxx-422,maxy-22);

    line(maxx-422,maxy-68,maxx-422,maxy-22);

    setcolor(WHITE);

    rectangle(24,maxy-66,maxx-424,maxy-24);

  • -65-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    setcolor(DARKGRAY);

    line(24,maxy-24,maxx-424,maxy-24);

    line(maxx-424,maxy-66,maxx-424,maxy-24);

    setcolor(BLACK);

    rectangle(23,maxy-67,maxx-423,maxy-23);

    settextstyle(1,0,0);

    setcolor(DARKGRAY);

    // multx = 2; divx = 1; /* 2:1 */

    // multy = 3; divy = 2; /* 3:2 */

    // setusercharsize(int 2, int 1, int 3, int 2);

    // setusercharsize(int div2 , int 1, int 3, int 1);

    // setusercharsize(3,1,3,2);

    outtextxy(23,36," UNMANNED ANTI AIR CRAFT MISSLE ");

    setcolor(WHITE);

    outtextxy(20,33," UNMANNED ANTI AIR CRAFT MISSLE ");

    // setcolor(11);

    // outtextxy(17,28," UNMANNED ANTI AIR CRAFT MISSLE ");

    setcolor(DARKGRAY);

    settextstyle(0,0,2);

    setcolor(DARKGRAY);

    line(385, 355, 393, 372);

    line(maxx/2 +135, maxy/2 , maxx/2 +150, maxy/2);

    line(maxx/2 +70, 125 , maxx/2 +80, 110);

    line(maxx/2 -62, 120 , maxx/2 -70, 105);

    line(maxx/2 -135, maxy/2 , maxx/2 -150, maxy/2);

    line(252, 355, 244, 373);

    outtextxy(395,375,"0");

    outtextxy(maxx/2 +160, maxy/2 - 5,"60");

    outtextxy(maxx/2 +90, 95,"120");

    outtextxy(maxx/2 -125, 95,"180");

  • -66-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    outtextxy(105, maxy/2 - 5,"240");

    outtextxy(maxx/2 -125, 375,"300");

    setcolor(WHITE);

    line(386, 356, 394, 373);

    line(maxx/2 +136, maxy/2+1 , maxx/2 +151, maxy/2+1);

    line(maxx/2 +71, 126 , maxx/2 +81, 111);

    line(maxx/2 -61, 121 , maxx/2 -69, 106);

    line(maxx/2 -134, maxy/2+1 , maxx/2 -149, maxy/2+1);

    line(253, 356, 245, 374);

    outtextxy(396,376,"0");

    outtextxy(maxx/2 +161, maxy/2 - 4,"60");

    outtextxy(maxx/2 +91, 96,"120");

    outtextxy(maxx/2 -124, 96,"180");

    outtextxy(106, maxy/2 - 4,"240");

    outtextxy(maxx/2 -124, 376,"300");

    setcolor(WHITE);

    circle(maxx/2, maxy/2, 130);

    setcolor(DARKGRAY);

    arc(maxx/2, maxy/2, 45, 225, 130);

    setcolor(LIGHTGRAY);

    for(i = 0; i

  • -67-

    ANTI AIRCRAFT MISSILE

    A.A.N.M. & V.V.R.S.R.POLYTECHNIC, GUDLAVALLERU

    CHAPTER VII

    LIST