SATISH REPORT

download SATISH REPORT

of 41

Transcript of SATISH REPORT

  • 8/7/2019 SATISH REPORT

    1/41

    CHAPTER 1

    INTRODUCTION

    1.1 ABOUT SOFTWARE PIRACY:

    The software product duplication is generally called as the piracy. Starting from operatingsystem to the audio player software we are getting the original as well as the pirated version

    .this is because main theme behind them is found and copy its duplicate and release them

    cheaper rate.

    Initially the producer tried to prevent piracy by law such patent ,copy right protection .but it

    is worth full protect our product at online retail with this copyright protection .hence they

    went for soft key that is producer can lock product by series of number.

    This was also came to end by hackers .they first found they key and logic behind it and

    unlock the original product with the duplicate key.

    1.2 OUR PROJECT:

    To prevent the software piracy we can adapt a new technique. That is providing software

    with unique hard ware key .here the key code is encrypted into this small chip.

    That chip can be used as key to unlock the software .unique thing of our project is

    encrypted code into hardware, hence the code cannot be found by hacker .the software will

    only work when the key plugged to the computer. Our key is a plug and play device and

    will not the user to make another copy of the software when key is plugged .the softwarewill not work when key is unplugged

    1.3 PLUG AND PLAY DEVICES:

    The hardware can be interface to the computer with any supporting installation of new

    software. The plug and play devices does not need the to install any program into the

    computer to support the device.

    The windows support plug and play devices hence no need any extra software to support

    our hard ware key

    1.4 SPECIFICATION:

    The hardware and software specification of our project are as follows;

    1.4.1 HARDWARE REQUIREMENTS:

    1. AT89S51 microcontroller

  • 8/7/2019 SATISH REPORT

    2/41

    2.5v power supply

    3. LCD display

    4. RS232 connector

    1.4.2 LANGUAGES USED:

    Embedded c, assembly languages.

    1.4.3 SOFTWARE USED:

    1. Keil compiler

    2. Flash programmer

    3. Orcad

    CHAPTER 2

    PROCESSING UNIT

    2.1 ABOUT DESIGN:

    Our project is to interface with computer hence first this it must be plug and play for easy

    interfacing. And size of our project must be small.

    BLOCK DIAGRAM

    LCD DISPLAY

    AT89S51 MICROCONTROLLER UNIT

    UNIT

    POWER SUPPLY

  • 8/7/2019 SATISH REPORT

    3/41

    RS232

    FINGER PRINT SENSOR

    COMPUTER

    FIG: 2.1.1 BLOCK DIAGRAM

    2.2 MICROCONTROLLER:

    When using a microprocessor the size and cost of the circuit will become greater. This is

    because the microprocessor does not contain an internal memory timers and etc. whenproviding an external memory, timer etc will make the size our project huge and this would

    our project cost to rise high. Hence we selected micro controller [1].

    2.3 EMBEDDED SYSTEM:

    We decided our project size must be compact, hence we preferred embedded system [1] .we

    can also use VLSI but programming step become complex. And needs very huge memory

    and also the size would become greater.

    2.4 PLUG AND PLAY DEVICE:

  • 8/7/2019 SATISH REPORT

    4/41

    If any hardware is interfaced with computer the supporting software must be installed .this

    makes computer interfacing tough .windows can support any plug and play devices without

    installing support software. Hence our project interfacing becomes easier .main thing

    behind plug and play is flash memory if we use flash memory to program our interfacing

    will become easier.

    2.5 RS232:

    Serial communication is basically the transmission or reception of data one bit at a time.

    Today's computers generally address data in bytes or some multiple thereof. A byte

    contains 8 bits. A bit is basically either a logical 1 or zero. Every character on this page is

    actually expressed internally as one byte. The serial port is used to convert each byte to a

    stream of ones and zeroes as well as to convert a streams of ones and zeroes to bytes. The

    serial port contains a electronic chip called a Universal Asynchronous Receiver/Transmitter

    (UART) that actually does the conversion.

    2.6 LCD:

    The BPP-420 and -440 work like a simple serial-receive terminals. They display text in a 4-

    line format on a high-contrast, supertwist LCD Module. They understand common control

    characters like carriage returns, linefeeds, tabs, backspace, etc. Special characters allow

    cursor

    Positioning, backlight control, and the unique big-character mode shown above

    2.7 FINGER PRINT SENSOR:

    FIM10-LV (Fingerprint Identification Module) is an evolutionary standalone fingerprint

    recognition module consisted of optic sensor and processing board. Its voltage is so low

    (3.3V) enough to implement a series of 23,000 authentication consuming 4 piece of AA

    batteries and executes average 1.2 seconds of high speed authentication. As CPU and highly

    upgraded algorithm are embedded into a module, it provides high recognition ratio even to

    small-size, wet, dry, calloused fingerprint.

    POWER SUPPLY

    As we all know any invention of latest technology cannot be activated without the Sourceof power. So in this fast moving world we deliberately need a proper power source which

    will be apt for a particular requirement. All the electronic components starting from diode

    to Intel IC s only work with a DC supply ranging from -+5V to -+12V.We are utilizing for

    the same, the cheapest and commonly available energy source of 230V 50Hz and stepping

    down, rectifying, filtering and regulating the voltage. This will be dealt briefly in the forth-

    coming sections

  • 8/7/2019 SATISH REPORT

    5/41

    CHAPTER 3

    HARDWARE AND SOFTWARE DESCRIPTION

    3.1 INTRODUCTION:

    The generic microcontroller architecture sports a Harvard architecture, which contains two

    separate buses for both program and data. So, it has two distinctive memory spaces of 64K

    X 8 size for both program and data. It is based on an 8 bit central processing unit with an 8bit Accumulator and another 8 bit B register as main processing blocks. Other portions of

    the architecture include few 8 bit and 16 bit registers and 8 bit memory locations.

    Each device has some amount of data RAM built in the device for internal processing. This

    area is used for stack operations and temporary storage of data.

    This base architecture is supported with on chip peripheral functions like I/O ports,

    timers/counters, versatile serial communication port. So it is clear that this architecture was

    designed to cater many real time embedded needs

    Now you may be wondering about the non mentioning of memory space meant for the

    program storage, the most important part of any embedded controller. Originally this 8031

    architecture was introduced with on chip one time programmable version of Program

    Memory of size 4K X 8. Intel delivered all these microcontrollers (8051) with users

    program fused inside the device. The memory portion was mapped at the lower end of the

    Program Memory area. But, after getting devices, customers couldnt change any thing in

    their program code, which was already made available inside during device fabrication.

    3.2 DIFFERENCES BETWEEN MICROCONTROLLER AND

    MICROPROCESSOR:

    Microprocessors have many instructions for moving data from external memory to internal

    memory. But microcontrollers have a few such instructions.

    Microprocessors have less bit handling instructions, but microcontrollers have many such

    instructions.

    Microprocessors are concerned with rapid movement of code and data from external

    memory. But Microcontroller is concerned with that of bits within the chip.

  • 8/7/2019 SATISH REPORT

    6/41

    Of course Microprocessor needs additional chips for memory, parallel port, timer etc and

    microcontroller needs no such external ports [2].

    3.3 PIN CONFIGURATION AND ARCHITECTURE OF AT89S51:

  • 8/7/2019 SATISH REPORT

    7/41

    FIG:3.3.1 PIN CONFIGURATION

  • 8/7/2019 SATISH REPORT

    8/41

    3.3.1ARCHITECTURE OF AT89S51:

  • 8/7/2019 SATISH REPORT

    9/41

    FIG: 3.3.2 ARCHITECTUREOF AT89S51

    3.4 FEATURES OF AT89S51:

    The following list gives the features of the microcontroller architecture:

    Optimized 8 bit CPU for control applications.

    Extensive Boolean processing capabilities.

    64K Program Memory address space.

    64K Data Memory address space.

    128 bytes of on chip Data Memory.

    32 Bi-directional and individually addressable I/O lines.

    Two 16 bit timer/counters.

    Full Duplex UART, On-chip clock oscillator.6-source / 5-vector interrupt structure with priority levels.

    3.5 MICROCONTROLLER CLOCK:

    Microcontroller has an on-chip oscillator

    It needs an external crystal

    Crystal decides the operating frequency of the 8051

    FIG 3.5.1: CLOCK

  • 8/7/2019 SATISH REPORT

    10/41

    3.6 MICRO CONTROLLER RESET

    RESET is an active High input

    When RESET is set to High, Microcontroller goes back to the power on statePower-On Reset

    Push PB and active High on RSTRelease PB, Capacitor discharges and RST goes low

    RST must stay high for a min of 2 machine cycles

    FIG 3.6.1: RESET CIRCUITRY

    3.7 CENTRAL PROCESSING UNIT

    The CPU is the brain of the microcontrollers reading users programs and executing the

    expected task as per instructions stored there in. Its primary elements are an 8 bit Arithmetic

    Logic Unit (ALU), Accumulator (Acc), few more 8 bit registers, B register, Stack Pointer

    (SP), Program Status Word (PSW) and 16 bit registers, Program Counter (PC) and Data

    Pointer Register (DPTR).

    3.7.1 THE ACCUMULATOR:

    If worked with any other assembly language you will be familiar with the concept of an

    accumulator register. The Accumulator, as its name suggests, is used as a general register to

  • 8/7/2019 SATISH REPORT

    11/41

    accumulate the results of a large number of instructions. It can hold an 8-bit (1-byte) value

    and is the most versatile register the 8051 has due to the sheer number of instructions that

    make use of the accumulator. More than half of the 8052s 255 instructions manipulate or

    use the Accumulator in some way.

    3.7.2 THE "R" REGISTERS:

    The "R" registers are sets of eight registers that are named R0, R1, through R7. These

    registers are used as auxiliary registers in many operations. To continue with the above

    example, perhaps you are adding 10 and 20. The original number 10 may be stored in the

    Accumulator whereas the value 20 may be stored in, say, register R4. To process the

    addition you would execute the command:

    As mentioned earlier, there are four sets of R registers, register bank 0, 1, 2, and 3. When

    the 8051 is first powered up, register bank 0 (addresses 00h through 07h) is used by default.

    In this case, for example, R4 is the same as Internal RAM address 04h. However, your

    program may instruct the 8052 to use one of the alternate register banks;

    i.e., register banks 1, 2, or 3. In this case, R4 will no longer be the same as Internal RAM

    address 04h. For example, if your program instructs the 8051 to use register bank 1, register

    R4 will now be synonymous with Internal RAM address 0Ch. If you select register bank 2,

    R4 is synonymous with 14h, and if you select register bank 3 it is synonymous with address

    1Ch.

    The concept of register banks adds a great level of flexibility to the 8051, especially when

    dealing with interrupts (we'll talk about interrupts later). However, always remember that

    the register banks really reside in the first 32 bytes of Internal RAM.

    3.7.3 THE "B" REGISTER:

    The "B" register is very similar to the Accumulator in the sense that it may hold an 8-bit (1-

    byte) value. The "B" register is only used implicitly by two 8051 instructions: MUL AB and

    DIV AB. Thus, if you want to quickly and easily multiply or divide A by another number,

    you may store the other number in "B" and make use of these two instructions.

    Aside from the MUL and DIV instructions, the B register are often used as yet another

    temporary storage register much like a ninth "R" register.

    3.7.4 THE PROGRAM COUNTER (PC):

    The Program Counter (PC) is a 2-byte address that tells the 8051 where the next instruction

    to execute is found in memory. When the 8052 is initialized PC always starts at 0000h and

    is incremented each time an instruction is executed. It is important to note that PC isnt

  • 8/7/2019 SATISH REPORT

    12/41

    always incremented by one. Since some instructions are 2 or 3 bytes in length the PC will

    be incremented by 2 or 3 in these cases.

    The Program Counter is special in that there is no way to directly modify its value. That is

    to say, you cant do something like PC=2430h. On the other hand, if you execute LJMP

    2430h youve effectively accomplished the same thing.

    It is also interesting to note that while you may change the value of PC (by executing a

    jump instruction, etc.) there is no way to read the value of PC. That is to say, there is no

    way to ask the 8051 "What address are you about to execute?" As it turns out, this is not

    completely true: There is one trick that may be used to determine the current value of PC.

    3.7.5 THE DATA POINTER (DPTR):

    The Data Pointer (DPTR) is the 8051 is only user-accessible 16-bit (2-byte) register. The

    Accumulator, "R" registers, and "B" register are all 1-byte values. The PC just described is

    a 16-bit value but isnt directly user-accessible as a working register.

    DPTR, as the name suggests, is used to point to data. It is used by a number of commands

    that allow the 8051 to access external memory. When the 8052 accesses external memory it

    accesses the memory at the address indicated by DPTR.

    While DPTR 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 16-bit register available. It is

    often used to store 2-byte values that have nothing to do with memory locations.

    3.7.6 THE STACK POINTER (SP):

    The Stack Pointer, like all registers except DPTR and PC, may hold an 8-bit (1-byte) value.

    The Stack Pointer is used to indicate where the next value to be removed from the stack

    should be taken from. When you push a value onto the stack, the 8051 first increments the

    value of SP and then stores the value at the resulting memory location. When you pop a

    value off the stack, the 8051 returns the value from the memory location indicated by SP

    and then decrements the value of SP.

    This order of operation is important. When the 8051 is initialized SP will be initialized to

    07h. If you immediately push a value onto the stack, the value will be stored in InternalRAM address 08h. This makes sense taking into account what was mentioned two

    paragraphs above: First the 8051 will increment the value of SP (from 07h to 08h) and then

    will store the pushed value at that memory address (08h).

    SP is modified directly by the 8051 by six instructions: PUSH, POP, ACALL, LCALL,

    RET, and RETI. It is also used intrinsically whenever an interrupt is triggered.

  • 8/7/2019 SATISH REPORT

    13/41

    3.7.7 INPUT / OUTPUT PORTS:

    Microcontroller I/O port structure is extremely versatile and flexible. The device has 32 I/O

    pins configured as four eight bit parallel ports (P0, P1, P2 and P3). Each pin can be used as

    an input or as an output under the software control. These I/O pins can be accessed directly

    by memory instructions during program execution to get required flexibility.

    These port lines can be operated in different modes and all the pins can be made to do many

    different tasks apart from their regular I/O function executions. Instructions, which access

    external memory, use port P0 as a multiplexed address/data bus. At the beginning of an

    external memory cycle, low order 8 bits of the address bus are output on P0. The same pins

    transfer data byte at the later stage of the instruction execution.

    Also, any instruction that accesses external Program Memory will output the higher order

    byte on P2 during read cycle. Remaining ports, P1 and P3 are available for standard I/O

    functions. But all the 8 lines of P3 support special functions: Two external interrupt lines,

    two counter inputs, serial ports two data lines and two timing control strobe lines aredesigned to use P3 port lines. When you dont use these special functions, you can use

    corresponding port lines as a standard I/O.

    Even within a single port, I/O operations may be combined in many ways. Different pins

    can be configured as input or outputs independent of each other or the same pin can be used

    as an input or as output at different times. You can comfortably combine I/O operations and

    special operations for Port 3 lines.

    3.7.8 TIMERS / COUNTERS:

    Microcontroller has two 16 bit Timers/Counters capable of working in different modes.

    Each consists of a High byte and a Low byte which can be accessed under software.

    There is a mode control register and a control register to configure these timers/counters in

    number of ways.

    These timers can be used to measure time intervals, determine pulse widths or initiate

    events with one microsecond resolution up to a maximum of 65 millisecond (corresponding

    to 65, 536 counts). Use software to get longer delays. Working as counter, they can

    accumulate occurrences of external events (from DC to 500 KHz) with 16 bit precision.

  • 8/7/2019 SATISH REPORT

    14/41

    FIG:3.7.1:TIMER/COUNTER MODES

    3.8 MICROCONTROLLER PIN FUNCTIONS:

    3.8.1 I/O PORTS (P0, P1, P2, P3):

    Of the 40 pins of the typical 8052, 32 of them are dedicated to I/O lines that have a one-to-

    one relation with SFRs P0, P1, P2, and P3. The developer may raise and lower these lines

    by writing 1s or 0s to the corresponding bits in the SFRs. Likewise; the current state of

    these lines may be read by reading the corresponding bits of the SFRs.

    All of the ports have internal pull-up resistors except for port 0.

    3.8.2 PORT 0:

  • 8/7/2019 SATISH REPORT

    15/41

    Port 0 is dual-function in that it in some designs port 0s I/O lines are available to the

    developer to access external devices while in other designs it is used to access external

    memory. If the circuit requires external RAM or ROM, the microcontroller will

    automatically use port 0 to clock in/out the 8-bit data word as well as the low 8 bits of the

    address in response to a MOVX instruction and port 0 I/O lines may be used for other

    functions as long as external RAM isnt being accessed at the same time. If the circuit

    requires external code memory, the microcontroller will automatically use the port 0 I/O

    lines to access each instruction that is to be executed. In this case, port 0 cannot be utilized

    for other purposes since the state of the I/O lines are constantly being modified to access

    external code memory.

    Note that there are no pull-up resistors on port 0, so it may be necessary to include your

    own pull-up resistors depending on the characteristics of the parts you will be driving via

    port 0.

    3.8.3 PORT 1:

    Port 1 consists of 8 I/O lines that you may use exclusively to interface to external parts.

    Unlike port 0, typical derivatives do not use port 1 for any functions themselves. Port 1 is

    commonly used to interface to external hardware such as LCDs, keypads, and other devices.

    With 8052 derivatives, two bits of port 1 are optionally used as described for extended timer

    2 functions. These two lines are not assigned these special functions on 8051s since 8051s

    dont have a timer 2. Further, these lines can still be used for your own purposes if you

    dont need these features of timer 2.

    P1.0 (T2): If T2CON.1 is set (C/T2), then timer 2 will be incremented whenever there is a

    1-0 transition on this line. With C/T2 set, P1.0 is the clock source for timer 2. P1.1 (T2EX):If timer 2 is in auto-reload mode and T2CON.3 (EXEN2) is set, a 1-0 transition on this line

    will cause timer 2 to be reloaded with the auto-reload value. This will also cause the

    T2CON.6 (EXF2) external flag to be set, which may cause an interrupt if so enabled.

    3.8.4 PORT 2:

    Like port 0, port 2 is dual-function. In some circuit designs it is available for accessing

    devices while in others it is used to address external RAM or external code memory. When

    the MOVX @DPTR instruction is used, port 2 is used to output the high byte of the

    memory address that is to be accessed. In these cases, port 2 may be used to access otherdevices as long as the devices are not being accessed at the same time a MOVX instruction

    is using port 2 to address external RAM. If the circuit requires external code memory, the

    microcontroller will automatically use the port 2 I/O lines to access each instruction that is

    to be executed. In this case, port 2 cannot be utilized for other purposes since the state of the

    I/O lines are constantly being modified to access external code memory.

    3.8.5 PORT 3:

  • 8/7/2019 SATISH REPORT

    16/41

    Port 3 consists entirely of dual-function I/O lines. While the developer may access all these

    lines from their software by reading/writing to the P3 SFR, each pin has a pre-defined

    function that the microcontroller handles automatically when configured to do so and/or

    when necessary. P3.0 (RXD): The UART/serial port uses P3.0 as the receive line. In circuit

    designs that will be using the microcontrollers internal serial port, this is the line into

    which serial data will be clocked. Note that when interfacing an 8052 to an RS-232 port that

    you may not connect this line directly to the RS-232 pin; rather, you must pass it through a

    part such as the MAX232 to obtain the correct voltage levels. This pin is available for any

    use the developer may assign it if the circuit has no need to receive data via the integrated

    serial port.

    P3.1 (TXD): The UART/serial port uses P3.1 as the transmit line. In circuit designs that

    will be using the microcontrollers internal serial port, this is the line that the

    microcontroller will clock out all data which is written to the SBUF SFR. Note that when

    interfacing an 8052 to an RS-232 port that you may not connect this line directly to the RS-

    232 pin; rather, you must pass it through a part such as the MAX232 to obtain the correct

    voltage levels. This pin is available for any use the developer may assign it if the circuit has

    no need to transmit data via the integrated serial port.

    P3.2 (-INT0): When so configured, this line is used to trigger an External 0 Interrupt.

    This may either be low-level triggered or may be triggered on a 1-0 transition. Please see

    the chapter on interrupts for details. This pin is available for any use the developer may

    assign it if the circuit does not need to trigger an external 0 interrupt.

    P3.3 (-INT1): When so configured, this line is used to trigger an External 1 Interrupt.

    This may either be low-level triggered or may be triggered on a 1-0 transition. Please see

    the chapter on interrupts for details. This pin is available for any use the developer may

    assign it if the circuit does not need to trigger an external 1 interrupt.

    P3.4 (T0): When so configured, this line is used as the clock source for timer 0. Timer 0

    will be incremented either every instruction cycle that T0 is high or every time there is a 1-0

    transition on this line, depending on how the timer is configured. Please see the chapter on

    timers for details. This pin is available for any use the developer may assign it if the circuit

    does not to control timer 0 externally.

    P3.5 (T1): When so configured, this line is used as the clock source for timer 1. Timer 1

    will be incremented either every instruction cycle that T1 is high or every time there is a 1-0

    transition on this line, depending on how the timer is configured. Please see the chapter on

    timers for details. This pin is available for any use the developer may assign it if the circuit

    does not to control timer 1 externally.

    P3.6 (-WR): This is external memory write strobe line. This line will be asserted low by the

    microcontroller whenever a MOVX instruction writes to external RAM. This line should be

  • 8/7/2019 SATISH REPORT

    17/41

    connected to the RAMs write (-W) line. This pin is available for any use the developer

    may assign it if the circuit does not write to external RAM using MOVX.

    P3.7 (-RD): This is external memory write strobe line. This line will be asserted low by the

    microcontroller whenever a MOVX instruction writes to external RAM. This line should be

    connected to the RAMs write (-W) line. This pin is available for any use the developer

    may assign it if the circuit does not read from external RAM using MOVX.

    3.8.6 OSCILLATOR INPUTS (XTAL1, XTAL2):

    The 8052 is typically driven by a crystal connected to pins 18 (XTAL2) and 19 (XTAL1).

    Common crystal frequencies are 11.0592 MHz as well as 12 MHz, although many newer

    derivatives are capable of accepting frequencies as high as 40 MHz.

    While a crystal is the normal clock source, this isnt necessarily the case. A TTL clock

    source may also be attached to XTAL1 and XTAL2 to provide the microcontrollers clock.

    3.8.7 RESET LINE (RST):

    Pin 9 is the master reset line for the microcontroller. When this pin is brought high for two

    instruction cycles, the microcontroller is effectively reset. SFRs, including the I/O ports, are

    restored to their default conditions and the program counter will be reset to 0000h. Keep in

    mind that Internal RAM is not affected by a reset. The microcontroller will begin executing

    code at 0000h when pin 9 returns to a low state.

    The reset line is often connected to a reset button/switch that the user may press to reset the

    circuit. It is also common to connect the reset line to a watchdog IC or a supervisor IC (suchas MAX707). The latter is highly recommended for commercial and professional designs

    since traditional resistor-capacitor networks attached to the reset line, while often sufficient

    for students or hobbyists, are not terribly reliable.

    3.8.8 ADDRESS LATCH ENABLE (ALE):

    The ALE at pin 30 is an output-only pin that is controlled entirely by the microcontroller

    and allows the microcontroller to multiplex the low-byte of a memory address and the 8-bit

    data itself on port 0. This is because, while the high-byte of the memory address is sent

    On port 2, port 0 is used both to send the low byte of the memory address and the data

    itself. This is accomplished by placing the low-byte of the address on port 0, exerting ALE

    high to latch the low-byte of the address into a latch IC (such as the 74HC573), and then

    placing the 8 data-bits on port 0. In this way the 8052 is able to output a 16-bit address and

    an 8-bit data word with 16 I/O lines instead of 24.

  • 8/7/2019 SATISH REPORT

    18/41

    The ALE line is used in this fashion both for accessing external RAM as well as for

    accessing instructions in external code memory. When your program is executed from

    external code memory, ALE will pulse at a rate of 1/6th that of the oscillator frequency.

    Thus if the oscillator is operating at 11.0592 MHz, ALE will pulse at a rate of 1,843,200

    times per second. The only exception is when the MOVX instruction is executed one ALE

    pulse is missed in lieu of a pulse on WR or RD.

    3.8.9 PROGRAM STORE ENABLE (-PSEN):

    The Program Store Enable (PSEN) line at pin 29 is exerted low automatically by the

    microcontroller whenever it accesses external code memory. This line should be attached to

    the Output Enable (-OE) pin of the EPROM that contains your code memory.

    PSEN will not be exerted by the microcontroller and will remain in a high state if your

    program is being executed from internal code memory.

    3.8.10 EXTERNAL ACCESS (-EA):

    The External Access (-EA) line at pin 31 is used to determine whether the 8052 will execute

    your program from external code memory or from internal code memory. If EA is tied high

    (connected to +5V) then the microcontroller will execute the program it finds in internal/on-

    chip code memory. If EA is tied low (to ground) then it will attempt to execute the program

    it finds in the attached external code memory EPROM. Of course, your EPROM must be

    properly connected for the microcontroller to be able to access your program in external

    code memory.

    3.9 SERIAL COMMUNICATION:

    Serial communication is basically the transmission or reception of data one bit at a time.

    Today's computers generally address data in bytes or some multiple thereof. A byte

    contains 8 bits. A bit is basically either a logical 1 or zero. Every character on this page is

    actually expressed internally as one byte. The serial port is used to convert each byte to a

    stream of ones and zeroes as well as to convert stream of ones and zeroes to bytes. The

    serial port contains an electronic chip called a Universal Asynchronous

    Receiver/Transmitter (UART) that actually does the conversion.

    The serial port has many pins. We will discuss the transmit and receive pin first.Electrically speaking, whenever the serial port sends a logical one (1) a negative voltage is

    effected on the transmit pin. Whenever the serial port sends a logical zero (0) a positive

    voltage is affected. When no data is being sent, the serial port's transmit pin's voltage is

    negative (1) and is said to be in a MARK state. Note that the serial port can also be forced

    to keep the transmit pin at a positive voltage (0) and is said to be the SPACE or BREAK

    state. (The terms MARK and SPACE are also used to simply denote a negative voltage (1)

    or a positive voltage (0) at the transmit pin respectively).

  • 8/7/2019 SATISH REPORT

    19/41

    When transmitting a byte, the UART (serial port) first sends a START BIT which is a

    positive voltage (0), followed by the data (general 8 bits, but could be 5, 6, 7, or 8 bits)

    followed by one or two STOP BITs which is a negative(1) voltage. The sequence is

    repeated for each byte sent. Figure 1 shows a diagram of what a byte transmission would

    look like.

    FiIG: 3.9.1 BYTE TRANSMISSIONS

    At this point you may want to know what the duration of a bit is. In other words, how long

    does the signal stay in a particular state to define a bit?, The answer is simple. It is

    dependent on the baud rate. The baud rate is the number of times the signal can switch

    states in one second. Therefore, if the line is operating at 9600 baud, the line can switch

    states 9,600 times per second.

    This means each bit has the duration of 1/9600 of a second or about100sec.

    When transmitting a character there are other characteristics other than the baud rate that

    must be known or that must be setup. These characteristics define the entire interpretation

    of the data stream.

    The first characteristic is the length of the byte that will be transmitted. This length in

    general can be anywhere from 5 to 8 bits.

    The second characteristic is parity. The parity characteristic can be even, odd, mark, space,

    or none. If even parity, then the last data bit transmitted will be a logical 1 if the data

    transmitted had an even amount of 0 bits. If odd parity, then the last data bit transmitted will

    be a logical 1 if the data transmitted had an odd amount of 0 bits. If MARK parity, then the

    last transmitted data bit will always be a logical 1. If SPACE parity, then the last

    transmitted data bit will always be a logical 0. If no parity then there is no parity bit

    transmitted.

    The third characteristic is the amount of stop bits. This value in general is 1 or 2.

    Assume we want to send the letter 'A' over the serial port. The binary representation of the

    letter 'A' is 01000001. Remembering that bits are transmitted from least significant bit

  • 8/7/2019 SATISH REPORT

    20/41

    (LSB) to most significant bit (MSB), the bit stream transmitted would be as follows for the

    line characteristics 8 bits, no parity, 1 stop bit, and 9600 baud.

    LSB (0 1 0 0 0 0 0 1 0 1) MSB

    The above represents (Start Bit) (Data Bits) (Stop Bit)

    To calculate the actual byte transfer rate simply divide the baud rate by the number of bits

    that must be transferred for each byte of data. In the case of the above example, each

    character requires 10 bits to be transmitted for each character. As such, at 9600 baud, up to

    960 bytes can be transferred in one second.

    The above discussion was concerned with the "electrical/logical" characteristics of the data

    stream. We will expand the discussion to line protocol.

    Serial communication can be half duplex or full duplex. Full duplex communication meansthat a device can receive and transmit data at the same time. Half duplex means that the

    device cannot send and receive at the same time. It can do them both, but not at the same

    time. Half duplex communication is all but outdated except for a very small focused set of

    applications.

    Half duplex serial communication needs at a minimum two wires, signal ground and the

    data line. Full duplex serial communication needs at a minimum three wires, signal ground,

    transmit data line, and receive data line. The RS232 specification governs the physical and

    electrical characteristics of serial communications. This specification defines several

    additional signals that are asserted (set to logical 1) for information and control beyond thedata signals and signal ground.

    These signals are the Carrier Detect Signal (CD), asserted by modems to signal a successful

    connection to another modem, Ring Indicator (RI), asserted by modems to signal the phone

    ringing, Data Set Ready (DSR), asserted by modems to show their presence, Clear To Send

    (CTS), asserted by modems if they can receive data, Data Terminal Ready (DTR), asserted

    by terminals to show their presence, Request To Send (RTS), asserted by terminals if they

    can receive data. The section RS232 Cabling describes these signals and how they are

    connected.

    The above paragraph alluded to hardware flow control. Hardware flow control is a method

    that two connected devices use to tell each other electronically when to send or when not to

    send data. A modem in general drops (logical 0) its CTS line when it can no longer receive

    characters. It re-asserts it when it can receive again. A terminal does the same thing instead

    with the RTS signal. Another method of hardware flow control in practice is to perform the

    same procedure in the previous paragraph except that the DSR and DTR signals are used

  • 8/7/2019 SATISH REPORT

    21/41

    for the handshake.

    Note that hardware flow control requires the use of additional wires. The benefit to this

    however is crisp and reliable flow control. Another method of flow control used is known

    as software flow control. This method requires a simple 3 wire serial communication link,

    transmit data, receive data, and signal ground. If using this method, when a device can nolonger receive, it will transmit a character that the two devices agreed on. This character is

    known as the XOFF character. This character is generally a hexadecimal 13. When a device

    can receive again it transmits an XON character that both devices agreed to. This character

    is generally a hexadecimal 11.

    3.9.1 COMPATIBILTY ISSUES:

    If you read about null modems, this three wire null modem cable is often talked about. Yes,

    it is simple but can we use it in all circumstances? There is a problem, if either of the two

    devices checks the DSRorCD inputs. These signals normally define the ability of the otherside to communicate. As they are not connected, their signal level will never go high. This

    might cause a problem.

    The same holds for the RTS/CTS handshaking sequence. If the software on both sides is

    well structured, the RTS output is set high and then a waiting cycle is started until a ready

    signal is received on the CTS line. This causes the software to hang because no physical

    connection is present to either CTS line to make this possible. The only type of

    communication which is allowed on such a null modem line is data-only traffic on the cross

    connected Rx/Tx lines.

    This does however not mean, that this null modem cable is useless. Communication links

    like present in the Norton Commander program can use this null modem cable. This null

    modem cable can also be used when communicating with devices which do not have

    modem control signals like electronic measuring equipment etc.

    As you can imagine, with this simple null modem cable no hardware flow control can be

    implemented. The only way to perform flow control is with software flow control using the

    XOFF and XON characters.

    3.9.2 MAX232:

    This acts as an level shifter in interfacing an high voltage device with low voltage device,

    for example when a computer interfaces with an microcontroller. The computer out through

    an Ethernet card is 12v,the microcontroller works at 5v.this max 232 interfaces them and

    voltage between them is adjusted by this max232 [1].

  • 8/7/2019 SATISH REPORT

    22/41

    The MAX232 is a dual driver/receiver that includes a capacitive voltage generator to supply

    EIA-232 voltage levels from a single 5-V supply. Each receiver converts EIA-232 inputs to

    5-V TTL/CMOS levels. These receivers have a typical threshold of 1.3 V and a typical

    hysteresis of 0.5 V, and can accept 30-V inputs. Each driver converts TTL/CMOS input

    levels into EIA-232 levels. The driver, receiver, and voltage-generator functions are

    available as cells in the Texas Instruments Lin ASIC library.

    FIG: 3.9.5.1: MAX 232

    3.10 LCD Introduction

    FIG3.10.1 LCD

    3.10.1EASY TO USE DATA DISPLAYS:

    The BPP-420 and -440 work like a simple serial-receive terminals. They display text in a 4-line format on a high-contrast, supertwist LCD Module. They understand common control

    characters like carriage returns, linefeeds, tabs, backspace, etc. Special characters allow

    cursor

    Positioning, backlight control, and the unique big-character mode shown above.

  • 8/7/2019 SATISH REPORT

    23/41

    The displays will even drive a (customer-provided) piezo buzzer for audio alerts.

    Interfacing is easyjust connect +5V, ground, and serial data (RS-232 or inverted TTL

    level, no parity, 8 data bits, 1 stop bit). The 4x20 display supports data rates of 2400 and

    9600 bps; the 4x40 accepts 1200, 2400, 4800, and 9600 bps. Data rates are set by

    configuration switches.

    You already know how to program for these displays, since they understand a sensiblesubset of the ASCII control characters. The manuals include program examples for the

    BASIC Stamps

    I and II, plus PC BASIC.

    3.10.2 COMPATIBILITY AND FEATURES:

    The BPP-420 and BPP-440 use identical sets of control characters, making the transition

    from one display to another a snap. Theyre also compatible with the text-mode instructions

    for our graphics displays. And the BPP-420 can emulate our simpler LCD Serial Backpackinterface.

    For compatibility with our older 4x20 displays. New features in the current release (rev 3.0

    or higher) of these products include big-alpha

    Capability (letters AZ added to large-character mode), a right-alignment instruction for

    easy data-field formatting, and a larger serial buffer.

    FIG:3.10.2 LCD SERIAL INTERFACE

    BPI-216s consist of a supertwist 2x16 LCD with a serial interface factory installed. For new

    applications, consider our ILM-216 for the best mix of price and features. But the BPI-216

    is the right choice if you require the smallest footprint, lowest current draw, or compatibility

    with existing Backpack applications[2].

  • 8/7/2019 SATISH REPORT

    24/41

    2400/9600 baud serial input

    Lowest current draw: 2 - 3mA

    Simple protocol prints text, passes instructions to LCD

    Display of choice for BASIC Stamp applications

    10s of thousands sold!

    3.11 FINGER PRINT SENSOR:

    FIM10-LV (Fingerprint Identification Module) is an evolutionary standalone fingerprint

    recognition module consisted of optic sensor and processing board. Its voltage is so

    low(3.3V) enough to implement a series of 23,000 authentication consuming 4 piece of AA

    batteries and executes average 1.2 seconds of high speed authentication. As CPU and highly

    upgraded algorithm are embedded into a module, it provides high recognition ratio even to

    small-size, wet, dry, calloused fingerprint.

    Due to technologies of simple and robust hardware design and including keypad function of

    the existed DK in one board, it can be executed to develop viable applications and perform

    user enrollment and authentication needed for fingerprint recognition without a connection

    to PC.

    3.11.1 FEATURES:

    Built-in fingerprint authentication.

    Various authentication using 1:1/1: N matching and Password.

    Convenient DK without a connection to PC.

    Accurate authentication ratio even to small-size/wet/dry fingerprint.

    Fast acquisition of difficult finger types under virtually any condition.

    Economical due to low voltage consumption

    3.11.2 APPLICATIONS:

    Door Lock System

    Safe BoxSimple Access Controller

    Vehicle Control

    POWER SUPPLY

    As we all know any invention of latest technology cannot be activated without the

    Source of power. So in this fast moving world we deliberately need a proper power

    source which will be apt for a particular requirement. All the electronic components

    starting from diode to Intel IC s only work with a DC supply ranging from -+5V to -

    +12V.We are utilizing for the same, the cheapest and commonly available energy

  • 8/7/2019 SATISH REPORT

    25/41

    source of 230V 50Hz and stepping down, rectifying, filtering and regulating the

    voltage. This will be dealt briefly in the forth-coming sections.

    3.12.1 BLOCK DIAGRAM:

    FIG3.14.1.1 POWER SUPPLY

    3.12.2 RECTIFIER UNIT:

    In the power supply unit, rectification is normally achieved using a solid state diode. Diode

    has the property that will let the electron flow easily in one direction at proper biasing

    condition. As AC is applied to the diode, only electrons flow when the anode and cathode isnegative. Reversing the polarity of voltage will not permit electron flow.

    A commonly used circuit for supplying large amounts of DC power is the bridge rectifier. A

    bridge rectifier of four diodes (4*IN4007) are used to achieve full wave rectification. Two

    diodes will conduct during negative cycle and the other two will conduct during the positive

    half cycle. The DC voltage appearing across the output terminals of the bridge rectifier will

  • 8/7/2019 SATISH REPORT

    26/41

    be somewhat less than 90% of the applied RMS value. Normally one alteration of the input

    voltage will reverse the polarities.

    Opposite ends of the transformer will therefore always be 180 degree out of phase with

    each other. For a positive cycle, two diodes are connected to the positive voltage at the top

    winding and only one diode conducts. At the same time one of the other two diodes

    conducts for the negative voltage that is applied from the bottom winding due to theforward bias for that diode. In this circuit due to positive half cycle D1 & D2 will conduct

    to give 10.8V pulsating DC. The DC output has a ripple frequency of 100Hz.

    Since each alteration produces a resulting output pulse, frequency =2*50Hz. The output

    obtained is not a pure DC and therefore filtration has to be done.

    3.12.3 FILTER UNIT:

    Filter circuits which are usually capacitors acting as a surge arrester always follow the

    rectifier unit. This capacitor is also called as a decoupling capacitor or a bypassingcapacitor, is used not only to short the ripple with frequency of 120Hz to ground but also

    to leave the frequency of the DC to appear at the output. A load resistor R1 is connected so

    that reference to the ground is maintained.C1R1 is for bypassing ripples.C2R2 is used as a

    low pass filter, i.e. it passes only low frequency signals and bypasses high frequency

    signals. The load resistor should be 1% to 2.5% of the load.

    3.12.4 VOLTAGE REGULATOR:

    The voltage regulators play an important role in any power supply unit. The primary

    purpose of a regulator is to aid the rectifier and filter circuit in providing a constant DCvoltage to the device. Power supplies without regulators have an inherent problem of

    changing DC voltage values due to variations in the load or due to fluctuations in the AC

    liner voltage. With a regulator connected with the DC output, the voltage can be maintained

    within a close tolerant region of the desired output.

  • 8/7/2019 SATISH REPORT

    27/41

    4. CHAPTER

    SOFTWARE DESCRIPTION

  • 8/7/2019 SATISH REPORT

    28/41

    4.1 STEPS TO PROGRAM:

    We prefer embedded c as our programming language. For simplicity if we use the VHDL

    the program length would become large and the large memory will be required. The

    compilation of program becomes easy in embedded c.

    We are using KEIL compiler software to create and compile the software. This software canact as an editor compiler, assembler. Hence we prefer KEIL compiler.

    We first create the coding our program, the we debug them the compilation is done

    We run the program and check the out put .then the code is translated to assembly language

    program. Then the assembly language code is embedded to the system using flash

    programmer.

    4.2 EMBEDDED SYSTEM:

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

    few dedicated functions. It is usually ''embedded'' as part of a complete device including

    hardware and mechanical parts. In contrast, a general-purpose computer, such as a personal

    computer, can do many different tasks depending on programming. Embedded systems

    have become very important today as they control many of the common devices we use.

    Since the embedded system is dedicated to specific tasks, design engineers can optimize it,

    reducing the size and cost of the product, or increasing the reliability and performance.

    Some embedded systems are mass-produced, benefiting from economies of scale.

    Physically, embedded systems range from portable devices such as digital watches and

    MP3 players, to large stationary installations like factory controllers, or the systems

    controlling nuclear power plans. Complexity varies from low, with a single microcontroller

    chip, to very high with multiple units, peripherals and networks mounted inside a large

    chassis or enclosure.

    In general, "embedded system" is not an exactly defined term, as many systems have some

    element of programmability. For example, 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 differentapplications to be loaded and peripherals to be connected.

    The embedded c program is shown;

    #include

    #include

  • 8/7/2019 SATISH REPORT

    29/41

    void serial_init(void);

    unsigned char trans,ch;

    void delay2(int);

    void delay1(int);

    void main()

    {

    serial_init();

    EA=1;

    ES=1;

    while(1)

    {

    if(trans ==1)

    {

    SBUF = 0x42;

    delay2(1);

    trans =0;

    }

    if(trans ==2)

    {

    SBUF = 0x44;

    delay2(1);

    trans =0;

    }

  • 8/7/2019 SATISH REPORT

    30/41

    if(trans ==3)

    {

    SBUF = 0x46;

    delay2(1);

    trans =0;

    }

    if(trans ==4)

    {

    SBUF = 0x48;

    delay2(1);

    trans =0;

    }

    }

    }

    void serial_init(void)

    {

    TMOD =0x20;

    TH1=0xFD;

    SCON=0x50;

    TR1=1;

    }

    void delay2(int n)

    {

  • 8/7/2019 SATISH REPORT

    31/41

    int i;

    for(i=0;i

  • 8/7/2019 SATISH REPORT

    32/41

    trans =3;

    break;

    case 0x47:

    trans =4;

    break;

    case 0x49:

    trans =5;

    break;

    }

    SCON = 0x50;

    }

    }

    4.3 KEIL SOFTWARE:

    Keil Software makes C compilers, macro assemblers, real-time kernels, debuggers,

    simulators, integrated environments, and evaluation boards for the 8051, 251, ARM, and

    XC16x/C16x/ST10 microcontroller families.

    Keil Software is pleased to announce simulation support for the Atmel ARM family of

    microcontrollers. The Keil Vision Debugger simulates the complete ARM instruction-set

    as well as the on-chip peripherals for each device in the AT91 ARM/Thumb

    microcontroller family. The integrated simulator provides complete peripheral simulation.

    Other new features in the Vision Debugger include:

    An integrated Software Logic Analyzer that measures I/O signals as well as program

    variables and helps developers create complex signal processing algorithms.

    An Execution Profiler that measures time spent in each function, source line, and assembler

    instruction. Now developers can find exactly where programs spend the most time.

    "Using nothing more than the provided simulation support and debug scripts, developers

    can create a high-fidelity simulation of their actual target hardware and environment. No

    extra hardware or test equipment is required. The Logic Analyzer and Execution Profiler

  • 8/7/2019 SATISH REPORT

    33/41

    will help developers when it comes time to develop and tune signaling algorithms." said Jon

    Ward, President of Keil Software USA, Inc.

    4.4 VISUAL BASIC:

    The Microsoft VB programming system for windows is an exciting advance for anyone

    who is involved in writing window base applications.VB lets you take full advantage of the

    window graphical environment to built powerful application quickly.

    As more people began to use computers the isotonic and complicated languages used for

    programming became more of an obstacle. A language called BASIC was developed to

    counteract this. Its simplicity made it easy for the users to write amazing programs.

    Over the years this programming language was enhanced and developed. The demand forfaster, simpler, smaller and easy to use software led to the development of Microsoft quick

    Base. This was in line with the programming language technology of the 1980s but an

    even bigger change was on the horizon namely, graphical user interface (GUI).

    Although this environment was like a boon to the user, life was suddenly a lot together for

    programmers. A simple program to display a message on the screen, which could be written

    in four lines in MSDOS, now, ran to two or three pages.

    4.5 PROGRAMMING FOR WINDOW WITH VB:

    The VB programming system packages up the complexity of windows in a truly amazing

    way. It provides simplicity and ease of use without sacrificing performance or the graphical

    features that make window such a pleasant environment to work in Menus, fonts, dialog,

    boxes etc are easily designed and these features require no more than a few lines of

    programming to control.

    It is one of the first languages to support event driven programming a style of program

    especially suited to graphical user interface. The aim in modern computer application is to

    have the user in charge.

    Instead of writing a program that plots out every step in precise order, the programmer

    writes a program that responds the users action like choosing a command, moving the

    mouse etc. Instead of writing on large program, the programmer creates an application,

    which is a collection of cooperating many programs.

    This project has been done with a virtual view of the traction of the train. It represents the

    animated view of the moving train with boogies with the multimedia effects etc.

  • 8/7/2019 SATISH REPORT

    34/41

    4.6 FEATURES:

    Improved performance

    Visual data access with the data control so that it is possible to create data browsing

    application without writing code.

    A new OLE (object linking and embedding) control

    A collection of common dialog boxes that streamline common user interface tasks.

    The flow chart of program is shown.

    F LOW CHART:

  • 8/7/2019 SATISH REPORT

    35/41

    NO

    FIG:2.3.1

    YES

    NO

  • 8/7/2019 SATISH REPORT

    36/41

    YES

    NO

    YES

    NO

  • 8/7/2019 SATISH REPORT

    37/41

    NO

    YES

    Verify authentication and login into the software

    The program code for hardware key verification is shown below

    Private blnStatus As Boolean

  • 8/7/2019 SATISH REPORT

    38/41

    Dim i

    Private Sub Comm_OnComm()

    Dim strDataBuf As String

    Select Case Comm.CommEvent

    Case comEvReceive

    strDataBuf = strDataBuf & Comm.Input

    Call handleinput(strDataBuf)

    If blnStatus = True Then Exit Sub

    End Select

    End Sub

    Private Sub handleinput(strDataBuf As String)

    txtCode.Text = txtCode.Text & strDataBuf

    If txtCode.Text = "SECRET CODE1000123451357" Then

    txtCode.Text = ""

    For i = 0 To 9

    On Error Resume Next

    pbrStatus.Value = pbrStatus.Value + 1

    Sleep (300)

    Next i

    KeyOk

    If blnStatus = True Then Exit Sub

    End If

    End Sub

  • 8/7/2019 SATISH REPORT

    39/41

    Private Sub Form_Load()

    intPortId = InputBox("Enter Comm Port Number to which device is connected ", "Choose

    Comm Port", 1)

    If intPortId = 0 Then

    Exit Sub

    End If

    With Comm

    .CommPort = intPortId

    .Handshaking = 0

    .RThreshold = 1

    .SThreshold = 10

    .RTSEnable = True

    .InputMode = comInputModeText

    .Settings = "9600,n,8,1"

    .PortOpen = True

    .InputLen = 1

    End With

    tmrVerify.Enabled = True

    Comm.Output = "C"

    End Sub

    Private Sub KeyOk()

    txtCode.Text = ""

    Me.Hide

  • 8/7/2019 SATISH REPORT

    40/41

    mdiMain.Show

    blnStatus = True

    End Sub

  • 8/7/2019 SATISH REPORT

    41/41

    5. CONCLUSION

    Our project much better than any other piracy preventing project, because to pirate we

    know the key of software, then can find sequence of key using few keys .but here key code

    is encrypted using embedded system, hence hacker can never find the key and logic behind

    it .

    our project key is like an hardware key for bike and lock, hence where is no key the

    software will not open. If there is it will not allow the to duplicate it by making an other

    copy of it. Hence never software can be pirated i.e. cannot make any other duplicate copy of

    it.

    SCOPE OF OUR FURTHER DEVOPEMENT:

    We can also lock any other important files and folders in our computer by mentioning the

    .exe extension address of the folder or file. Hence any one user can using key withpassword can only access the folder. Hence information theft can also be avoided in any

    organization.

    Further our project code can also be written in flash memory pen drive alike device .this

    would become small in size and need no installation of supporting soft wares for our key

    1