BATCH9 (1-32)

Embed Size (px)

Citation preview

  • 7/27/2019 BATCH9 (1-32)

    1/74

    ABSTRACT

    The proposed project work aims at the automation in identification of student, and

    maintaining their attendance which is one of the important tasks in college. In earlier days,

    attendance is taken manually and entered to the computer by a programmer. But in case of

    large number it becomes difficult and clumsy. So to automate it, RFIDs are used.

    To detect the RFID tags, a software program is developed in a micro controller chip

    such that the micro controller along with the RF module detects the RFID tags. Whenever the

    RF tag comes into the vicinity of the RF reader, the micro controller grabs the 10 digit

    Hexadecimal code stored in the tag and sends it to the GSM modem.

  • 7/27/2019 BATCH9 (1-32)

    2/74

    CHAPTER-1

    INTRODUCTION

    The proposed project is designed to identify a person and to mark his/her attendance

    along with timing information automatically, thereby reducing the manual effort to a

    considerable extent. Hence the project RF-ID BASED ATENDANCE SYSTEM.

    Now a days as student irregularity has been increased to a greater extent, it has

    become a big subject for maintaining their details and identifying them in marking

    attendance. Hence the need has come out, thus this project work has taken up which serves

    the purpose of automation. By detecting RFID tag, the RF module marks the attendanceautomatically.

    This project work is basically related to radio frequency communication. As we know

    the modern communication plays a dominant role in the communication revolution. The

    proposed project work is aimed to use radio frequency communication between RFID tag and

    RFID module where the identification is performed.

    This is innovative project work introduced in the field of wireless communication.

    Radio Frequency communication is utilized in this project work to make a link between tag

    and the reader. The reader part may be located at any of the staff rooms and the monitoring is

    done by the head of the department.

    This project throws more exposure on the radio frequency communication. As we

    know today, the modern communication plays a dominant role in modern civilization. Now a

    days, with the advancement of the technology particularly in the field of wireless

    communication, of day to day living have become a part of information and we find wireless

    communication system at many applications.

  • 7/27/2019 BATCH9 (1-32)

    3/74

    CHAPTER-2

    THEORITICAL BACKGROUND

    2.1HISTORY OF RFID:

    In 1946 Leon Theremin invented an espionage tool for the soviet union which

    retransmitted incident radio waves with audio information. Sound waves vibrated a

    diaphragm which slightly altered the shape of the resonator, which modulated the reflected

    radio frequency. Even though this device was a passive convert listening device not an

    identification tag, it has been attributed as a predecessor to RFID technology. The technology

    used in RFID has been around since the early 1920s according to one source (although the

    same source states that RFID systems have been around just since the late 1960s).

    Similar technology, such as the IFF transponder invented by the United Kingdom in

    1939, was routinely used by the allies in world war-II to identify aircraft as friend or foe.

    Transponders are still used by military and commercial aircraft to this day.

    Another early work exploring RFID is the landmark 1948 paper by Harry Stockman,

    titled "Communication by Means of Reflected Power" (Proceedings of the IRE, pp 1196

    1204, October 1948). Stockman predicted that "considerable research and development work

    has to be done before the remaining basic problems in reflected-power communication are

    solved, and before the field of useful applications is explored."

    Mario Cardullo's in 1973 was the first true ancestor of modern RFID; a passive radio

    transponder with memory. The initial device was passive, powered by the interrogating

    signal, and was demonstrated in 1971 to the New York Port Authority and other potential

    users and consisted of a transponder with 16 bit memory for use as a toll device. The basic

    Cardullo patent covers the use of RF, sound and light as transmission medium. The original

    business plan presented to investors in 1969 showed uses in transportation (automotive

    vehicle identification, automatic toll system, electronic license plate, electronic manifest,

    vehicle routing, vehicle performance monitoring), banking (electronic check book, electronic

    credit card), security (personnel identification, automatic gates, surveillance) and medical

    (identification, patient history).

  • 7/27/2019 BATCH9 (1-32)

    4/74

    A very early demonstration of reflected power (modulated backscatter) RFID tags,

    both passive and semi-passive, was done by Steven Depp, Alfred Koelle and Robert Freyman

    at the Los Alamos Scientific Laboratory in 1973. The portable system operated at 915 MHz

    and used 12 bit tags. This technique is used by the majority of today's UHF and microwave

    RFID tags.The first patent to be associated with the abbreviation RFID was granted to

    Charles Walton in 1983

    2.2 RFID TAGS:

    RFID tags come in three general varieties:- passive, active, or semi-passive (also

    known as battery-assisted). Passive tags require no internal power source, thus being pure

    passive devices (they are only active when a reader is nearby to power them), whereas semi-

    passive and active tags require a power source, usually a small battery.

    To communicate, tags respond to queries generating signals that must not create

    interference with the readers, as arriving signals can be very weak and must be told apart.

    Besides backscattering, load modulation techniques can be used to manipulate the reader's

    field. Typically, backscatter is used in the far field, whereas load modulation applies in the

    near field, within a few wavelengths from the reader.

    Frequency

    Ranges

    LF

    125KHzHF

    13.56MHzUHF

    868-915MHz

    Micro wave

    2.45&5.8GHz

    Tag power

    source

    Generally passive tagsonly using inductive

    coupling

    Generally passivetags only using

    inductive orcapacitive coupling

    Active tags withintegral battery or

    passive tags usingcapacitive storageE-field coupling

    Active tags withintegral battery or

    passive tags usingcapacitive storageE-field coupling

    Data rate Slower Moderate Fast Fast

    Ability to read

    near metal or

    wet surfaces

    Better Moderate Poor Worse

    Applications Access control &security identifying

    widgets throughmanufacturing

    processes

    Library booksidentification

    Access controlemployee IDs

    Supply chaintracking highway

    Toll tags

    Highway toll tagsidentification ofprivate vehiclefleet in/out of a

    yard

    Table:2.2. Various factors of RF-Id tags

    http://en.wikipedia.org/wiki/Backscatterhttp://en.wikipedia.org/w/index.php?title=Load_modulation&action=edit&redlink=1http://en.wikipedia.org/wiki/Far_fieldhttp://en.wikipedia.org/wiki/Nearfieldhttp://en.wikipedia.org/wiki/Nearfieldhttp://en.wikipedia.org/wiki/Far_fieldhttp://en.wikipedia.org/w/index.php?title=Load_modulation&action=edit&redlink=1http://en.wikipedia.org/wiki/Backscatter
  • 7/27/2019 BATCH9 (1-32)

    5/74

    PASSIVE:

    Passive RFID tags have no internal power supply. The minute electrical current

    induced in the antenna by the incoming radio frequency signal provides just enough power

    for the CMOS integrated circuit in the tag to power up and transmit a response. Most passive

    tags signal bybackscattering the carrier wave from the reader. This means that the antenna

    has to be designed both to collect power from the incoming signal and also to transmit the

    outbound backscatter signal. The response of a passive RFID tag is not necessarily just an ID

    number; the tag chip can contain non-volatile, possibly writable EEPROM for storing data.

    Passive tags have practical read distances ranging from about 10 cm (4 in.) (ISO

    14443 ) up to a few meters (Electronic Product Code (EPC) and ISO 18000-6), depending onthe chosen radio frequency and antenna design/size. Due to their simplicity in design they are

    also suitable for manufacture with a printing process for the antennas. The lack of an onboard

    power supply means that the device can be quite small: commercially available products exist

    that can be embedded in a sticker, or under the skin in the case of low frequency RFID tags.

    In 2007, the Danish Company RFID sec developed a passive RFID with privacy

    enhancing technologies built-in including built-in firewall access controls, communication

    encryption and a silent mode ensuring that the consumer at point of sales can get exclusive

    control of the key to control the RFID. The RFID will not respond unless the consumer

    authorizes it, the consumer can validate presence of a specific RFID without leaking

    identifiers and therefore the consumer can make use of the RFID without being trackable or

    otherwise leak information that represents a threat to consumer privacy.

    ACTIVE:

    Unlike passive RFID tags, active RFID tags have their own internal power source,

    which is used to power the integrated circuits and broadcast the signal to the reader. Active

    tags are typically much more reliable (i.e. fewer errors) than passive tags due to the ability for

    active tags to conduct a "session" with a reader. Active tags, due to their onboard power

    supply, also transmit at higher power levels than passive tags, allowing them to be more

    effective in "RF challenged" environments like water (including humans/cattle, which are

    mostly water), metal (shipping containers, vehicles), or at longer distances, generating strong

    responses from weak requests (as opposed to passive tags, which work the other way around).

    http://en.wikipedia.org/wiki/CMOShttp://en.wikipedia.org/wiki/Integrated_circuithttp://en.wikipedia.org/wiki/Backscatterhttp://en.wikipedia.org/wiki/Carrier_wavehttp://en.wikipedia.org/wiki/Non-volatilehttp://en.wikipedia.org/wiki/EEPROMhttp://en.wikipedia.org/wiki/ISO_14443http://en.wikipedia.org/wiki/ISO_14443http://en.wikipedia.org/wiki/Electronic_Product_Codehttp://en.wikipedia.org/wiki/List_of_ISO_standardshttp://en.wikipedia.org/wiki/Integrated_circuithttp://en.wikipedia.org/wiki/Integrated_circuithttp://en.wikipedia.org/wiki/List_of_ISO_standardshttp://en.wikipedia.org/wiki/Electronic_Product_Codehttp://en.wikipedia.org/wiki/ISO_14443http://en.wikipedia.org/wiki/ISO_14443http://en.wikipedia.org/wiki/EEPROMhttp://en.wikipedia.org/wiki/Non-volatilehttp://en.wikipedia.org/wiki/Carrier_wavehttp://en.wikipedia.org/wiki/Backscatterhttp://en.wikipedia.org/wiki/Integrated_circuithttp://en.wikipedia.org/wiki/CMOS
  • 7/27/2019 BATCH9 (1-32)

    6/74

    In turn, they are generally bigger and more expensive to manufacture, and their potential

    shelf life is much shorter.

    Many active tags today have practical ranges of hundreds of meters, and a battery life

    of up to 10 years. Some active RFID tags include sensors such as temperature logging which

    have been used to monitor the temperature of perishable goods like fresh produce or certain

    pharmaceutical products. Other sensors that have been married with active RFID include

    humidity, shock/vibration, light, radiation, temperature, and atmospherics like ethylene.

    Active tags typically have much longer range (approximately 500 m/1500 feet) and larger

    memories than passive tags, as well as the ability to store additional information sent by the

    transceiver. The United States Department of Defense has successfully used active tags to

    reduce logistics costs and improve supply chain visibility for more than 15 years.

    SEMI-PASSIVE:

    Semi-passive tags are similar to active tags in that they have their own power source,

    but the battery only powers the microchip and does not broadcast a signal. The RF energy is

    reflected back to the reader like a passive tag. An alternative use for the battery is to store

    energy from the reader to emit a response in the future, usually by means ofbackscattering.

    The battery-assisted receive circuitry of semi-passive tags lead to greater sensitivity

    than passive tags, typically 100 times more. The enhanced sensitivity can be leveraged as

    increased range (by a factor 10) and/or as enhanced read reliability.

    The enhanced sensitivity of semi-passive tags place higher demands on the reader,

    because an already weak signal is backscattered to the reader. For passive tags, the reader-to-

    tag link usually fails first. For semi-passive tags, the reverse (tag-to-reader) link usually fails

    first.

    Semi-passive tags have three main advantages

    1) Greater sensitivity than passive tags

    2) Better battery life than active tags.

    3) Can perform active functions under its own power, even when no reader is present.

    http://en.wikipedia.org/wiki/Backscatteringhttp://en.wikipedia.org/wiki/Backscattering
  • 7/27/2019 BATCH9 (1-32)

    7/74

    The following figure shows the circuit diagram of RF reader

    Fig:2.2.Circuit diagram of a RF reader

  • 7/27/2019 BATCH9 (1-32)

    8/74

    CHAPTER-3

    BLOCK DIAGRAM

    The block diagram consists of three sections

    1.

    Power supply section2. RF reader section3. RF tag section

    Fig:3.0. Block diagram of RF-ID attendance system

    In the power supply section, the AC power (230-0-230V) from the transformer is

    converted into 122 volts after passing through full wave rectifier (16.8V). We are using a

    2200F capacitor for removing the ripples.

    Then it is passed through a voltage regulator (IC7805) which provides a fixed output

    voltage 5volts. This acts as power supply to all the components in the reader section.

    In the absence of power supply, a battery is used to provide supply to the external

    RAM and real time clock (RTC DS1302 IC). In the tag section which consists of RF tag. RF

    tag consists of antenna and memory chip. The memory chip contains a unique Hexadecimal

    code. Unique means every tag contains a different code.

  • 7/27/2019 BATCH9 (1-32)

    9/74

    Whenever the tag is placed at a vicinity of 10Cms from the reader section the RF

    module in reader section generates carrier frequency of 125 KHz that is transmitted by

    transmitter antenna. This induces an Electro Magnetic field in the transponder. Therefore the

    chip in the transponder gets excited and sends a unique hexadecimal code through the

    antenna (TK5530) to the transmitter antenna.

    Through the multiplexer, the code is sent to microcontroller or personal computer. In

    the personal computer, all the details corresponding to the tag are noted. If the tag is invalid

    that is its details are not feeded in the computer, the reader recognizes that the tag is invalid

    tag. Otherwise, the corresponding tag holders in-time will be noted, when the holder swipes

    card again, out-time will be noted. The same tag should not swipe more than one time with in

    a period of 60seconds. This time limit is to avoid the misleading of in-time and out-time at a

    time due to confirm swipes of the tag holder.

    Not only the in-time and out-time, the details contain information about his bio-data,

    number of leaves, salary payments and other details.

    Through the microcontroller, it is send through latches (HC573) to the external RAM

    for storing the information (hexadecimal code). Through the microcontroller, it is send

    through latches to transistor pack (ULN 2003) for giving buzzer indication and LED

    indication, to give the identification that the code in the tag is read by the reader. The tag

    hexadecimal code can also be seen through the display section.

    Hence a reset switch is used, to indicate whether reader or personal computer to work.

    The vicinity between the reader and tag can also be increased, but complexion of the circuit

    increases to a greater extent.

    One crystal is used for RTC, and the crystal frequency is 32.768KHZ. Another crystal

    is used for microcontroller, and the frequency is around 11MHz (11.09MHz).

  • 7/27/2019 BATCH9 (1-32)

    10/74

    CHAPTERE-4

    CIRCUIT DESCRIPTION

    4.1 MICROCONTROLLER:

    Microprocessors and microcontrollers stem from the basic idea. The contrast between

    a microcontroller and a microprocessor is best exemplified by the fact that most

    microprocessors have many operational codes (opcodes) for moving data from external

    memory to the CPU; microcontrollers have one or two. Microprocessors have one or two

    types of bit handling instructions; microcontrollers will have many. The microprocessor is

    concerned with rapid movement of code and data from external addresses to the chip; the

    microcontroller is concerned with rapid movement of bits within the chip. The

    microcontroller can function as a computer with the addition of no external digital parts; the

    microprocessor must have additional parts to be operational.

    DESCRIPTION:

    The AT89C52 is a low power, high performance CMOS 8-bit microcontroller with

    8K bytes of in-system programmable Flash memory. The device is manufactured using

    Atmels high-density nonvolatile memory technology and is compatible with the industry

    standard 80C51 instruction set and pin out. The on-chip Flash allows the program memory to

    be reprogrammed in-system or by a conventional nonvolatile memory programmer.

    In addition, the AT89C52 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, timers/counters, serial port and interrupt system to

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

    oscillators, disabling all other chip functions until the next interrupt or hardware reset.

  • 7/27/2019 BATCH9 (1-32)

    11/74

    PIN CONFIGURATION:

    Fig:4.1.1. Pin configuration of AT89C52

    PIN DESCRIPTION:1. VCC

    Supply voltage +5V

    2. GNDGround.

    3. PORT 0:

    Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can

    sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high

    impedance inputs. Port 0 can also be configured to be the multiplexed low order address/data

    bus during access to external program and data memory. In this mode, P0 has internal pull-

  • 7/27/2019 BATCH9 (1-32)

    12/74

    ups. Port 0 also receives the code bytes during Flash programming and outputs the code bytes

    during program verification. External pull-ups are required during program verification.

    4. PORT 1:

    Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The port 1 output

    buffers can sink/source four TTL inputs. When 1s are written to port 1 pins, they are pulled

    high by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are

    externally being pulled low will source current (IIL) because of the internal pull-ups. In

    addition, P1.0 and P1.1 can be configured to be the timer or counter 2 external count input

    (P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX), respectively as shown in the

    following table. Port 1 also receives the low-order address bytes during Flash programming

    and verification

    Table4.1.2. Port1 alternate functions

    5. PORT 2:

    Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The port 2 output

    buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled

    high by the internal pull-ups and can be used as inputs. As inputs, port 2 pins that are

    externally being pulled low will source current (IIL) because of the internal pull-ups. Port 2

    emits the high-order address byte during fetches from external program memory and during

    access to external data memory that uses 16-bitaddresses (MOVX @ DPTR). In this

    application, port 2 uses strong internal pull-ups when emitting 1s. During access to external

  • 7/27/2019 BATCH9 (1-32)

    13/74

    data memory that uses 8-bit addresses (MOVX @ RI), port 2 emits the contents of the P2

    Special Function Register. Port 2 also receives the high-order address bits and some control

    signals during Flash programming and verification.

    6. PORT 3:

    Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The port 3 output

    buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled

    high by the internal pull-ups and can be used as inputs. As inputs, port 3pins that are

    externally being pulled low will source current (IIL) because of the pull-ups. Port 3 also

    serves the functions of various special features of the AT89C52, as shown in the following

    table. Port 3 also receives some control signals for Flash programming and verification.

    Table4.1.3. Port3 alternate functions

    RST:

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

    resets the device. This pin drives High for 96 oscillator periods after the Watchdog times out.

    The DISTRO bit in SFR AUXR (address 8EH) can be used to disable this future. In the

    default state of bit DISTRO, the RESET HIGH out feature is enabled.

    ALE/PROG:

    Address Latch Enable (ALE) is an output pulse for latching the low byte of the

    address access to external memory. This pin is also the program pulse input (PROG) duringFlash programming. In normal operation, ALE is emitted at a constant rate of 1/6 the

  • 7/27/2019 BATCH9 (1-32)

    14/74

    oscillator frequency and may be used for external timing or clocking purposes. Note

    however, that one ALE pulse is skipped during each access to external data memory. If

    desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set,

    ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly

    pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external

    execution mode.

    PSEN:

    Program Store Enable (PSEN) is the read strobe to external program memory. When

    the AT89C52 is executing code from external programming memory, PSEN is activated

    twice each machine cycle, except that two PSEN activations are skipped during each access

    to external data memory.

    PROGRAM COUNTER:

    Program counter is a 16-bit register and is used to hold the address of a byte in

    memory. Program instruction bytes are fetched from locations in memory that are addressed

    by the PC. Program ROM may be on the chip at addresses 0000H to 0FFFH, external to the

    chip for the address that exceed 0FFFH, are totally external for all addresses from 0000H to

    FFFFH. The PC is automatically increment after every instruction byte is fetched and may

    also be altered by certain instructions. The PC is the only register that does not have an

    internal device.

    SPECIAL FUNCTION REGISTERS (SFR):

    The 128 bytes of on-chip additional RAM locations from 80H to FFH are reserved for

    the special functions and therefore these are called as special function registers SFRs. These

    SFRs are used for control or to show the status of various functions done by the 89C52

    microcontroller. All SFRs are directly addressable and can be read or written to as well. Note

    that SFRs space is only reserved for the special functions and cannot be used for any otherpurposes. Some SFRs are bit addressable and allow their individual bits to be set or cleared

    by instructions.

  • 7/27/2019 BATCH9 (1-32)

    15/74

    Fig:4.1.4. Special function registers

    DUAL DATA POINTER:

    To facilitate accessing both internal and external data memory, two banks of 16-bit

    Data Pointer Registers are provided: DP0 at SFR address locations 82H-83H and DPI at 84H-

    85H. Bit DPS=0 in SFR AUXR1 selects DP0 and DPS=1 selects DP1. The DPTR register is

    made up of 8-bit registers, named DPH and DPL. The user should always initialize the DPS

    bit to the appropriate value before accessing the respective Data Pointer Register.

    CRYSTAL OSCILLATOR:

    XTAL1 and XTAL2 are the input and output, respectively of an inverting amplifier

    that can be configured for use as an on-chip oscillator. Either a quartz crystal or ceramic

    resonator may be used. To drive the device from an external clock source, XTAL2 should be

    left unconnected while XTAL1 is driven; there are no requirements on the duty cycle of the

    external clock signal, since the input to the internal clocking circuitry is through a divide-by-

    two flip-flop, but minimum and maximum voltage high and low time specifications must be

    observed.

  • 7/27/2019 BATCH9 (1-32)

    16/74

    Fig:4.1.5Crystal oscillator

    MEMORY ORGANISATION:

    PROGRAM MEMORY:

    The 80C51 has separate address spaces for program and data memory. The Program

    memory can be up to 64K bytes long. The lower 4K can reside on-chip. The 80C51 can

    address up to 64K bytes of data memory to the chip. The MOVX instruction is used to access

    the external data memory.

    The 80C51 has 128 bytes of on-chip RAM, plus a number of Special Function

    Registers (SFRs). The lower 128 bytes of RAM can be accessed either by direct addressing

    (MOV Data addr) or by indirect addressing (MOV @Ri).

    :

  • 7/27/2019 BATCH9 (1-32)

    17/74

    Fig:4.1.6Direct and indirect address area

    The 128 bytes of RAM which can be accessed by both direct and indirect addressing

    can be divided into three segments as listed below.

    1.Register Banks 0-3:

    Locations 0 through IFH(32 bytes). The device after reset defaults to register bank 0.

    To use the other register banks, the user must select them in software. Each register bank

    contains eight 1-byte registers 0 through 7. Reset initializes the stack pointer to location 07H

    and it is incremented once to start from location 08H, which is the first register (R0) of the

    second register bank. Thus, in order to use more than one register bank, the SP should be

    initialized to a different location of the RAM where it is not used for data storage (i.e., the

    higher part of the RAM).

    2. Bit Addressable area:

    16 bytes have assigned for this segment, 20H-2FH. Each one of the 128 bits of this

    segment can be directly addressed (0-7FH). The bits can be referred to in two ways, both of

    which are acceptable by most assemblers. One way is refer to their Address (i.e., 0-7FH). The

    other way is with reference to bytes 20H to 2FH. Thus, bits 0-7 can also be referred to as bits20.0-20.7 and bits 8-FH are the same as 21.0-21.7, and so on. Each of the 16 bytes in this

    segment can also be addressed as a byte.

    2. Scratch Pad Area:

    30H through 7FH are available to the user as data RAM. However, if the stack pointer

    has been initialized to this area, enough bytes should be left aside to prevent SP data

    destruction.

  • 7/27/2019 BATCH9 (1-32)

    18/74

    Fig:4.1.7. Scratch Pad area

    4.2 MAX232 IC:

    DESCRIPTION:

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

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

    TIA/EIA-232-F inputs to 5-V TTL/CMOS levels. These receivers have a typical threshold

    of 1.3V, a typical hysteresis of 0.5V, and can accept 30-V inputs. Each driver converts

    TTL/CMOS input levels into TIA/EIA-232F levels. The driver, receiver, and voltage-

    generator functions are available as cells in the Texas Instruments LinASIC library.

    PIN DIAGRAM:

  • 7/27/2019 BATCH9 (1-32)

    19/74

    Fig:4.2. Pin diagram of MAX232

    4.3 TK5530 IC:

    DESCRIPTION:

    The TK5530 is a complete transponder, with implements all important functions for

    immobilizer and identification systems. It consists of a plastic cube which accommodates the

    read-only Identification Integral Circuits (IDIC) e5530 and the antenna is realized by a LC-

    circuit.

    The identifying data are stored in a 128bit PROM on the e5530, realized as an array

    of laser-programmable fuses. The logic block diagram for the e5530 is shown in figure. The

    data are sent bit-serially as a code.Any attempt to fake the base station with a wrong

    transponder can be recognized immediately.

    Fig:4.3. TK5530 IC System block diagram

  • 7/27/2019 BATCH9 (1-32)

    20/74

    4.4 U2270B IC:

    DESCRIPTION:

    The U2270B is an IC for IDIC read/write base stations in contact less identificationand immobilizer stations.

    The IC incorporates the energy-transfer circuit to supply the transponder. It consists

    of an on-chip power supply, oscillator and a coil driver optimized for automotive-specific

    distances. It also includes all signal-processing circuits which are necessary to transform the

    small input signal into a microcontroller-compatible signal.

    SYSTEM BLOCK DIAGRAM:

    Fig:4.4.U2270B IC System block diagram

    4.5 RF MODULE:

    CY8C0104/05 RFID Module has tremendous features if compared with any 125KHz

    RFID chips or modules in the market. It is the easiest way to go with 125KHz RFID

    applications and most important the cheapest one in the RFID industry. Stunning

    characteristics of the chip/module will help you to design your product just in few weeks or

    even few days. Traditional RFID reader chips in the market are just analog front-end chips

    and the designers need to know about the RFID concept and should be able to write

    complicated decode algorithms for the demodulated signal by using external microcontroller.

    CY8C0104/05 have analog front-end and microcontroller combined in one chip/module. The

    designers never need to know about decode algorithms or RFID concept so that it results in

    profoundly shorter design time if compared with the traditional 125KHz RFID ICs in the

    market. Moreover all these advantages come with cheaper and more reasonable prices.

  • 7/27/2019 BATCH9 (1-32)

    21/74

    CY8C0104/05 demodulates the Manchester RF 32/64 signal and decodes it automatically.

    The data retrieved from the transponder is ready to be processed inside the device or to be

    sent over I2C/ UART / SPI or custom protocols with GPIO.

    The user can control chip/module with an external device such as microcontroller, PC

    or handheld device with UART/I2C (requires free upgrade pack) or custom defined GPIO

    protocol. Alternatively, with its most unique feature, users can embed their own code into the

    module/chip so module/chip performs operations automatically, thus no external

    microcontroller is required.

  • 7/27/2019 BATCH9 (1-32)

    22/74

    CHAPTERE-5

    POWER SUPPLY SECTION

    5.1 RECTIFIER:

    Rectifier is a device used for converting A.C voltage into D.C voltage. Four diodes

    (IN 4007) are used for the present work which are connected in the form of a bridge circuit.

    Advantages of bridge rectifier are

    No center tap is required on transformer, hence cost is reduced. It is suitable for higher voltage applications. It has less PIV rating per diode

    5.2 FILTER CIRCUIT:

    The output of a rectifier is pulsating, i.e., it has a D.C value and some A.C variations

    known as ripples. In most of the electronic circuits or devices a very steady D.C output is

    required. This is achieved with the help of a device known as filter. Thus the device that

    converts the pulsating output of a rectifier into a steady D.C level is known as a filter.

    Following filter circuits are commonly used

    Series inductor filter Shunt capacitor filter LC filter CLC or pi filter

    5.3 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. Typical performance parameters for voltage regulators are

    line regulation, load regulation, temperature stability and ripple rejection. Further more IC

    voltage regulators are versatile and relatively inexpensive under available with features such

    as a programmable output, current or voltage boosting, internal short circuit current limiting,

    thermal shutdown and floating operation for high voltage applications.

    78XX series are three terminal, positive fixed voltage regulators. There are seven

    output voltage positions available such as 5, 6, 8, 12, 15, 18 and 24volts. In 78XX the last

  • 7/27/2019 BATCH9 (1-32)

    23/74

    two numbers (XX) indicate the output voltage. There are also available 79XX series of fixed

    output negative voltage regulators which are compliments to the 78XX series devices.

    Fig:5.3. Fixed Output Voltage Regulators

    The above figure shows the standard representation of monolithic voltage regulator.

    A capacitor Ci is usually connected between input terminal and ground to cancel the induci-

    tve effects due to long distribution leads. The output capacitor Co improves the transient res-ponse.

  • 7/27/2019 BATCH9 (1-32)

    24/74

    CHAPTER-6

    HARDWARE DETAILS

    ATMEL 89 C 51 :

    FEATURES:

    Compatible with MCS-51 Products. 4 Kbytes of In-System Reprogrammable Flash Memory

    Endurance: 1,000 Write/Erase Cycles.

    Fully Static Operation: 0Hz 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

    MAX232 IC:

    FEATURES:

    Meets or Exceeds TIA/EIA-232-F and ITU Recommendation V.28 Operates From a single 5-V power supply with1.0-F charge-pump

    capacitors

    Operates up to 120Kbits/sec Two drivers and two receivers 30-V input levels Low supply current8mA typical ESD protection exceeds JESD 22-2000-V human-body model (A114-A) Upgrade with improved ESD (15-KV HBM) and 0.1F charge-pump

    capacitors is available with the MAX202

  • 7/27/2019 BATCH9 (1-32)

    25/74

    TK5530 IC:FEATURES:

    Identification transponder in plastic cube.

    Basic component: e5530 IDIC. Includes coil and capacitor for tuned circuit antenna. Carrier frequency: 125 KHz.

    APPLICATIONS:

    Car immobilizer Access control Alarm system Other identification systems

    U2270B IC:

    FEATURES:

    Carrier frequency Fosc100KHz150KHz. Typical data rate up to 5Kbaud at125KHz. suitable for Manchester and Biphase modulation Power supply from car battery or from 5V regulated voltage. Optimized for car immobilizer applications. Tuning capability Microcontroller-compatible interface Low power consumption in standby mode Power-supply output for microcontroller.

    APPLICATIONS: Car immobilizers Animal identification Access control Process control

  • 7/27/2019 BATCH9 (1-32)

    26/74

    CHAPTER-7

    FABRICATION DETAILS

    The basic raw material in the manufacture of PCB is copper cladded laminate. The

    laminate consists of two or more layers insulating reinforced materials bonded together under

    heat and pressure by thermo setting resins used are phenolic or epoxy. The rein forced

    materials used are electrical grade paper or woven glass cloth. The laminates are

    manufactured by impregating thin sheets of rein forced materials (woven glass cloth or

    electrical grade paper) with the required resin (phenolic or epoxy). The laminates are divided

    into various grades by National Electrical Manufacturers Association (NEMA). The nominal

    overall thickness of laminate normally used in PCB industry is 1.6mm with copper cladding

    on one or two sides. The copper foil thickness is 35 Microns (0.035mm) OR 70 Microns

    (0.070mm).

    The next stage in PCB fabrication is artwork preparation. The artwork (Master

    drawing) is essentially a manufacturing tool used in the fabrication of PCBs. It defines the

    pattern to be generated on the board. Since the artwork is the first of many process steps in

    the Fabrication of PCBs. It must be very accurately drawn. The accuracy of the finished

    board depends on the accuracy of artwork. Normally, in industrial applications the artwork is

    drawn on enlarged scale and photographically reduced to require size. It is not only easy to

    draw the enlarged dimensions but also the errors in the art work correspondingly get reduced

    during photo reduction. For ordinary application of simple single sided boards artwork is

    made on ivory art paper using draft aids. After taping on an art paper and photography

    (Making the negative) the image of the photo given is transformed on silk screen for screen

    printing. After drying the paint, the etching process is carried out. This is done after drilling

    of the holes on the laminate as per the components layout. The etching is the process of

    chemically removing un-wanted copper from the board.The next stage after PCB fabrication is solder masking the board to prevent the tracks

    from corrosion and rust formation. Then the components will be assembled on the board as

    per the component layout.

    The next stage after assembling is the soldering the components. The soldering may

    be defined as process where in joining between metal parts is produced by heating to suitable

    temperatures using non-ferrous filter metals has melting temperatures below the melting

    temperature of the metals to be joined. This non-ferrous intermediate metal is called solder.

    The solders are the alloys of lead and tin.

  • 7/27/2019 BATCH9 (1-32)

    27/74

    CHAPTER-8

    ADVANTAGES AND APPLICATIONS

    8.1ADVANTAGES:

    Whether you are concerned with tracking inventory in a warehouse or Maintaining

    a fleet of vehicles. There is a clear need for a fully automated data capture and analysis

    System that will help you keep track of your valuable asserts and equipment.

    Active Wave RFID technologies provide unique solutions to difficult Logistical

    tracking of inventory or equipment- particularly in applications where optically based

    systems fail and when read/write capabilities are required. The technology is stable, and

    evolving, with open architectures increasingly available.

    Advantages of RFID technology:

    Provides product visibility in all stages of supply chain. Enables you to view past and present conditions of your inventories. Identifies products one by one not on type level. Enables on-time delivery.

    Enables you to control your products in all stages of supply chain. Provides high security. Minimizes errors.

    8.2 APPLICATIONS:

    Recent advances in radio frequency identification (RFID) technology have enabled

    the early adoption in many commercial applications like supply chain management, logistics

    and transportation but skeptics believe that although RFID has an advantage over plain

    vanilla bar-coding in logistics, it will take a while for it to become mainstream.

    Radio frequency identification (RFID) is a method of remotely storing and retrieving

    data using devices called RFID tags/transponders. An RFID tag is a small object, such as an

    adhesive sticker, that can be attached to or incorporated into a product. Simply put, RFID

    involves putting a small radio transmitter on a tag or a label with a unique identification

  • 7/27/2019 BATCH9 (1-32)

    28/74

    number (UIN) on it. When passed under a RFID reader, the number contained in the tag is

    transmitted to a computer, which matches it with corresponding data.

    RFID is used for various purposes - among others to tag merchandise at stores, to

    prevent shoplifting, to tag prescriptions, over-the-counter medicines, and hospital products

    and to help combat the illegal trafficking of counterfeit pharmaceutical products.

    But unlike barcodes, there is no global public body that governs the frequencies used

    for RFID. In principle, every country can set its own rules, but some standards have been

    made regarding RFID technology.

    Inventory Applications: Enterprises have to manage huge numbers of raw materials and

    products in production and supply chain processes. This management process is laborious,

    costly and complicated for especially big enterprises. Present product tracking systems are

    based on barcode system and require enormous amounts of labor, time and costs. With RFID

    based inventory control systems, real-time and accurate tracking

    ACCESS CONTROL SYSTEMS:

    Access control is among the fields where RFID technology is intensely used. Having

    an effective access control system becomes more and more important and necessary in

    buildings such as companies, enterprises and public institutions where many people enter andexit everyday. Conventional systems are generally based on barcode system and with these

    systems; ID or entrance cards can be read closely and one by one.

    OTHER RFID APPLICATIONS:

    With each passing day, usage of RFID increases throughout the world as well as in

    Turkey. InfoDif presents solutions which are innovative and respond to your needs in all

    fields with this technology which proved its advantages and safety. You can benefit from

    InfoDifs world standard RFID systems in several fields including shopping and livestock.

    SHOPPING WITH RFID:

    The wireless RFID technology provided by InfoDif enables consumers to make

    payments just with a wave of their payment cards. This technology not only shortens the time

    allocated for shopping but also enables enterprises to have more information about their

    customers and their shopping habits and patterns. Using this information, shopping centers

    http://www.infodif.com/RFID/envanteruygulamalari.aspxhttp://www.infodif.com/RFID/envanteruygulamalari.aspxhttp://www.infodif.com/RFID/geciskontrol.aspxhttp://www.infodif.com/RFID/digeruygulamalar.aspxhttp://www.infodif.com/RFID/alisveris.aspxhttp://www.infodif.com/RFID/alisveris.aspxhttp://www.infodif.com/RFID/digeruygulamalar.aspxhttp://www.infodif.com/RFID/geciskontrol.aspxhttp://www.infodif.com/RFID/envanteruygulamalari.aspx
  • 7/27/2019 BATCH9 (1-32)

    29/74

    can individualize their services for each customer and increase customer satisfaction and

    loyalty, reduce costs and increase profitability. RFID is safer than conventional payment

    methods and customers feel more secure and comfortable.

    No card number is stored on RFID tags; they have just an ID number which can only

    be read by an assigned reader. Payment cards with RFID tags are safer than credit cards

    because any card number or information about the user is not printed on the card.

    AIRLINE BAGGAGE TRACKING :

    RFID system can be integrated to existing baggage labels, control desk printers and

    classification devices. With RFID technology, all baggage can be scanned automatically in

    groups regardless of their types.

    With InfoDifs RFID smart labels, secure and economic identification and tracking of

    baggage and passenger-baggage verification can be ensured.

    RFID IN ANIMAL IDENTIFICATION:

    RFID technology is used for tracking millions of livestock animals throughout the

    world. RFID is used in identifying, counting and tracking meat and dairy animals, valuable

    domestic animals and laboratory animals used in long lasting and expensive experiments.

    RFID IN PHARMACY:

    The pharmaceutical industry faces logistic product returns due to overstocking or

    expiry. The pharmaceutical industry seeks a better way to track drugs in all stages of supply

    chain; from production to delivery to pharmacies. RFID is considered to be the most efficientway to ensure accuracy and validity of data in this sector and solve all these problems and

    losses. RFID will increase the quality and security of products in this sector and costs will be

    reduced.

    PARKING LOT APPLICATIONS:

    InfoDif provides parking lot managers with RFID based parking lot access control

    solutions which are time and cost effective. These systems which are secure and automatic

    http://www.infodif.com/RFID/hayvancilik.aspxhttp://www.infodif.com/RFID/ecza.aspxhttp://www.infodif.com/RFID/otopark.aspxhttp://www.infodif.com/RFID/otopark.aspxhttp://www.infodif.com/RFID/ecza.aspxhttp://www.infodif.com/RFID/hayvancilik.aspx
  • 7/27/2019 BATCH9 (1-32)

    30/74

    can be used in parking lots in the city as well as in parking lots in airports, universities,

    hospitals and companies.

    RFID tags and readers can be integrated to existing parking lot access control systems

    thus installation, operation and maintenance of this new system does not require high costs.

    DOCUMENT TRACKING:

    Smart tags which are among the products provided by InfoDif improve and ease management

    of important documents in various sectors such as insurance and legal sectors. Besides, RFID

    technology prevents severe problems which may be caused by loss of important documents

    and files. RFID speeds up the workflow with fast and easy document tracking.

    RFID BENEFITS VS. BARCODE:

    The optical nature of barcode requires labels to be "seen" by the Lasers. That line-

    of-sight Between label and reader is often difficult, impractical, or even impossible to achieve

    in industrial environments. In order to function properly, a barcode reader must have clean,

    clear optics, the label must be clean and free of abrasion, and the reader and label must be

    properly oriented with respect to each other. RFID technology enables tag reading from a

    greater distance, even in harsh environments.

    In addition, the information imprinted on a barcode is fixed and cannot be changed.

    ActiveWave RFID tags, on the other hand, have electronic memory similar to what is in your

    computer or digital camera to store information about the inventory or

    equipment. This information can be dynamically updated.

    8.3 THE ADVANTAGES OF RFID VS. BARCODE TECHNOLOGY:

    No line of sight requirement. The tag can stand a harsh environment. Long read range.Wireless identification (even without line-of-sight contact) is

    possible

    It is able to penetrate through different materials like cardboard boxes, timber, etc. The memory can be read and re-written without limit. Several transponders can be identified in less than one second. It is possible to read many transponders simultaneously. It is resistant against environmental influences.

    http://www.infodif.com/RFID/belge.aspxhttp://www.infodif.com/RFID/belge.aspx
  • 7/27/2019 BATCH9 (1-32)

    31/74

    The shape and colour of the transponders is adaptable. Transponders can be integrated completely into a product. High security is guaranteed through copy protection and encryption High data retention up to 10 years It has an integrated data memory on which product data can be stored. Information can be stored on the tag without using a data base. RFID tagged objects can be read more than 20 times faster than the barcode

    technology.

    RFID tagged objects can also be read even if they are soiled heavily. The placing of the RFID tagged objects is less problematic in contrast to the barcode

    technology. It is sufficient that the object is situated within the range of the reader.

    Portable database Multiple tag read/write. Tracking people, items, and equipment in realtime.

  • 7/27/2019 BATCH9 (1-32)

    32/74

    CONCLUSION

    The project report RFID BASED ATTENDANCE SYSTEM is completed

    successfully. Identification has become an integral part of person in this century. There is a

    greater demand for reliable and accurate identification.

    Hence in this project we have implemented RFIDs. In the earlier days we have used

    bar codes but they are unreliable. Various faults in the earlier days identification has been

    analyzed thoroughly.

    The main advantage of implementing staff identification using micro controller is

    that the digital output can be directly connected to any P.C. and can monitor it continuously.

    We hope that this project would be very useful in future for student as well as staffidentification.

    Basically this project work comes under communication. But it is applicable to

    schools, colleges, companies. This type of design is very well suited in the field of

    communication.

    Since it is a demonstration unit, the range between RF antenna and Tag is limited to

    10Cms, because, in this project work a low power transmitter is used and the limitation being

    the power transmitted by the RF antenna. However by increasing the power radiating

    capacity of the antenna the range can be increased and by using parallel readers tracking of

    the RF card is also possible.

  • 7/27/2019 BATCH9 (1-32)

    33/74

    REFERENCES

    8051 Micro Controller, II Edition, PENRAM InternationalBy Kenneth, J Ayala

    OpAmps and Linear Integrated Circuits, IV Edition PearsonBy Ramakant A Gayakwad

    Programming and Customizing 8051 Micro Controller, II EditionBy Myke Predko

    Principles of Communication Systems TATA McGraw Hill, II EditionBy Taub and Schilling

    Radio frequency Identification Fundamentals and ApplicationsBy John Wiley and Sons.

    JOURNALS:

    ELECTRONICS FOR U IEEE JOURNALS

    WEBSITES:

    www.atmel.com

    www.google.com

    www.wikipedia.org

    http://www.atmel.com/http://www.google.com/http://www.google.com/http://www.atmel.com/
  • 7/27/2019 BATCH9 (1-32)

    34/74

    PROGRAM CODE

    ;THIS IS RF BACKUP READER PROGRAM

    ;P0 = DATA

    ;P1.0 = RTC DATA;P1.1 = RTC CLK;P1.2 = RTC RST

    ;P1.3 =;P1.4 =;P1.5 = BUZZ;P1.6 = LED1;P1.7 = LED2

    ;P2.0 = LSB STRB;P2.1 = MSB STRB;P2.2 = DSP DATA STRB;P2.3 = - CS;P2.4 = ENABLE -CS

    ;P2.7 = RS;P2.6 = R/W;P2.5 = EN

    ;P3.2= DATA SEL :01-PC,10-RFRD;P3.3= DATA SEL

    ;P3.4= PC IRQ

    ;P3.5= -OE;P3.6= RD/-WR;P3.7=

    ; DATA FROM SEC TO YEAR,WEEK (40H TO 4CH);25H TIME FLAG 01= NOT REQ,02 = REQ

    TXD MACROJNB TI,$CLR TIMOV SBUF,R6MACEND

    RXD MACROJNB RI,$CLR RIMOV R7,SBUFMACEND

  • 7/27/2019 BATCH9 (1-32)

    35/74

    ;--TIME DATE DISPLAY --TDISP MACRO

    LCALL READLCALL CON

    LCALL CON1LCALL ASSEMLCALL DISPMACEND

    NOP2 MACRONOPNOPNOPMACEND

    ;********************************************

    ORG 0LJMP START0

    ORG 0050H

    START0:

    MOV P0,#FFHMOV P1,#FFHMOV P2,#F0HMOV P3,#FFH

    CLR P2.0CLR P2.1CLR P2.2CLR P2.3

    CLR P1.5CLR P1.6

    CLR P1.7;*******************************LCALL SPINI;MOV R6,#00H;TXD;LCALL XDEL

    ;*******************************LCALL LCDINILCALL HEADLCALL SSEC

    QQ12: JB P1.4,QQ13LCALL DEL

  • 7/27/2019 BATCH9 (1-32)

    36/74

    JB P1.4,QQ12LCALL RTCINI

    LCALL TAILQQ13: TDISP

    LCALL SEC

    QQXX: JB P3.4,RFRELCALL DELJB P3.4,QQXXLCALL PCCOMMX

    VERIF:QQ11: JB P3.4,RFRE

    JB P3.4,QQ11LJMP PCCOM

    RFRE: LJMP RFREAD;---------------------------PCCOM:

    MOV SP,#20HCLR P3.2SETB P3.3

    NOP2

    CLR RILCALL XRXDCJNE R4,#01H,VERIF

    CLR AMOV A,R1MOV R7,A

    CJNE R7,#01H,PCT1LJMP PCREAD

    PCT1: CJNE R7,#02H,PCT2

    LJMP PCWRITE

    PCT2: CJNE R7,#03H,PCT3LJMP PCFORMAT

    PCT3: CJNE R7,#04H,PCT4LJMP PCTDUP

    PCT4: CJNE R7,#05H,PCT5LJMP PCTDRD

    PCT5: CJNE R7,#06H,PCT6LJMP PCINI

  • 7/27/2019 BATCH9 (1-32)

    37/74

    PCT6: CJNE R7,#07H,PCT7LJMP PCREADB

    PCT7: CJNE R7,#08H,PCT8

    LJMP AAAAAAPCT8: CJNE R7,#09H,PCT9

    LJMP AAAAAAPCT9: CJNE R7,#0AH,PCT10

    LJMP AAAAAA

    PCT10:AAAAAA: ;MOV R6,#FEH

    ;TXDLJMP VERIF

    HHHH: LJMP HHHH;---------------------------------------PCREAD:

    LCALL XRXDCJNE R4,#01H,PCREADRMOV A,R1MOV 60H,A

    LCALL XRXDCJNE R4,#01H,PCREADRMOV A,R1MOV 61H,A

    MOV R0,#70HPCTX: LCALL RAMRD

    ;TXDMOV A,R6MOV @R0,AINC 61HINC R0CJNE R0,#80H,PCTX

    LCALL RAMCON;----------------MOV R0,#70H

    NLTXT: MOV A,@R0MOV R6,ATXDINC R0CJNE R0,#7BH,NLTXT

    MOV R0,#30H

    NLTXTN: MOV A,@R0MOV R6,A

  • 7/27/2019 BATCH9 (1-32)

    38/74

    TXDINC R0CJNE R0,#3AH,NLTXTN;-------------------

    PCREADR: LJMP VERIF;------------------------PCREADB:

    LCALL XRXDCJNE R4,#01H,PCREADRMOV A,R1MOV 60H,ALCALL XRXDCJNE R4,#01H,PCREADRMOV A,R1MOV 61H,A

    LCALL RAMRDTXDLJMP VERIF

    ;-------------------------RAMCON:

    MOV A,7BHMOV 30H,A

    MOV A,7CHMOV 31H,A

    MOV A,7DHMOV 32H,A

    MOV A,7EHMOV 33H,A

    MOV A,7FHMOV 34H,A

    LCALL CON

    ;---------MOV A,41HADD A,#30HMOV 30H,A

    MOV A,40HADD A,#30HMOV 31H,A

    MOV A,43HADD A,#30H

    MOV 32H,A

  • 7/27/2019 BATCH9 (1-32)

    39/74

    MOV A,42HADD A,#30HMOV 33H,A

    MOV A,45H

    ADD A,#30HMOV 34H,A

    MOV A,44HADD A,#30HMOV 35H,A

    MOV A,47HADD A,#30HMOV 36H,A

    ;LCALL WRD

    MOV A,46HADD A,#30HMOV 37H,A

    MOV A,49HADD A,#30HMOV 38H,A

    MOV A,48HADD A,#30HMOV 39H,A

    RET

    ;--------- RAMRD ---------RAMRD:

    MOV P0,61HSETB P2.0

    NOP2

    CLR P2.0

    MOV P0,60HSETB P2.1

    NOP2CLR P2.1

    MOV P0,#FFHNOP2

    SETB P3.6 ;-WE

    NOP2CLR P2.4 ;-CE

  • 7/27/2019 BATCH9 (1-32)

    40/74

    NOP2SETB P2.3

    NOP2CLR P3.5 ;-OE

    NOP2

    MOV R6,P0SETB P3.5SETB P2.4CLR P2.3

    NOP2RET

    ;*************************************PCWRITE:

    LCALL XRXDCJNE R4,#01H,PCWRITERMOV A,R1

    MOV 60H,A

    LCALL XRXDCJNE R4,#01H,PCWRITERMOV A,R1MOV 61H,A

    LCALL XRXDCJNE R4,#01H,PCWRITERMOV A,R1MOV 62H,A

    MOV R0,#00HLCALL RAMWRTXD

    PCWRITER: LJMP VERIF

    ;--------- RAMRD ---------RAMWR:

    MOV P0,60H

    SETB P2.1NOP2CLR P2.1

    MOV P0,61HSETB P2.0

    NOP2CLR P2.0

    MOV P0,62HNOP2

    SETB P3.5 ;-OE

  • 7/27/2019 BATCH9 (1-32)

    41/74

    NOP2CLR P2.4 ;-CE

    NOP2SETB P2.3

    NOP2

    CLR P3.6 ;-WENOP2SETB P3.6

    NOP2SETB P3.5SETB P2.4CLR P2.3

    NOP2;---------- READ AFTER WRITE --------MOV P0,#FFH

    NOP2

    SETB P3.6 ;-WENOP2CLR P2.4 ;-CE

    NOP2SETB P2.3

    NOP2CLR P3.5 ;-OE

    NOP2MOV R6,P0SETB P3.5SETB P2.4CLR P2.3

    NOP2RET

    ;**************** TOTAL DATA DEL....PCFORMAT:

    LCALL XRXDCJNE R4,#01H,PCFORMATRMOV A,R1MOV 61H,ACJNE A,#FEH,PCFORMATR

    LCALL FORDIS

    ;----------WRITING ALL ZEROS-------------

    MOV 60H,#00HMOV 61H,#00HMOV 62H,#00HMOV DPTR,#0000H

    RAMNXT0:MOV 60H,DPHMOV 61H,DPLLCALL RAMWR

    CJNE R6,#00H,PCFORMATRINC DPTR

  • 7/27/2019 BATCH9 (1-32)

    42/74

    MOV A,DPHCJNE A,#80H,RAMNXT0

    ;--------- WRITING ALL ONES --------------

    MOV 60H,#00HMOV 61H,#00HMOV 62H,#FFHMOV DPTR,#0000H

    RAMNXT: MOV 60H,DPHMOV 61H,DPLLCALL RAMWRCJNE R6,#FFH,PCFORMATRINC DPTRMOV A,DPHCJNE A,#80H,RAMNXT

    MOV 60H,#00HMOV 61H,#10HMOV 62H,#01HLCALL RAMWRCJNE R6,#01H,PCFORMATRMOV 60H,#00HMOV 61H,#11HMOV 62H,#00HLCALL RAMWRCJNE R6,#00H,PCFORMATRMOV R6,#00HTXDLCALL FOROKLCALL SECLCALL PCCOMMXLJMP VERIF

    PCFORMATR: MOV R6,#01HTXDLCALL FORFAIL

    LCALL SECLCALL PCCOMMXLJMP VERIF

    ;*****************************************PCTDUP:

    MOV R0,#50HPCT: LCALL XRXD

    CJNE R4,#01H,PCTDUPRCLR AMOV A,R1

    MOV @R0,AINC R0

  • 7/27/2019 BATCH9 (1-32)

    43/74

    CJNE R0,#5DH,PCTLJMP WRITE

    PCTDUPR:LJMP VERIF;************** TIME DATE READ ************

    PCTDRD:LCALL TAILLCALL READLCALL CONLCALL CON1LCALL ASSEMLCALL DISPMOV R0,#50H

    PCTDX: MOV A,@R0ADD A,#30HMOV R6,A

    TXDNOP2INC R0CJNE R0,#5DH,PCTDXLCALL SECLCALL PCCOMMXLJMP VERIF

    ;******* RTC INI **********************

    PCINI:LCALL RTCINILCALL TAILLCALL SECLCALL READLCALL CONLCALL CON1LCALL ASSEMLCALL DISPLCALL SECLCALL PCCOMMX

    LJMP VERIF;****************************************;************ RF REDER MODULE ***********RFREAD:

    SETB P3.2CLR P3.3

    NOP2CLR RI

    LCALL RFCOMMXRFNXT1: MOV R0,#6FH

    RFNXT: LCALL XRXDCJNE R4,#01H,RTRT1

  • 7/27/2019 BATCH9 (1-32)

    44/74

    CLR AMOV A,R1MOV @R0,AINC R0CJNE R0,#7CH,RFNXT

    ;..................CLR AMOV A,6FHCJNE A,#02H,SWIPEA

    CLR AMOV A,7BHCJNE A,#03H,SWIPEA;..................LCALL RFSTORECLR RI

    LCALL OTXDLJMP RFNXT1

    SWIPEA: LCALL SWIPECLR RILJMP RFNXT1

    RTRT1: LCALL RFCOMMXCLR RI

    RTRT: JB RI,RFNXT1

    JB P3.4,RTRTLCALL DELJB P3.4,RTRTLJMP QQ12

    ;------------------------------OTXD:

    LCALL DEL

    CLR P3.2SETB P3.3

    LCALL DEL

    MOV A,50HMOV 60H,AMOV A,51HMOV 61H,A

    MOV R0,#70HOPCTX: LCALL RAMRD

    ;TXDMOV A,R6

    MOV @R0,AINC 61H

  • 7/27/2019 BATCH9 (1-32)

    45/74

    INC R0CJNE R0,#80H,OPCTX

    ;----------------MOV R0,#70H

    ONLTXT: MOV A,@R0MOV R6,ATXDINC R0CJNE R0,#7BH,ONLTXT

    LCALL RAMCON

    MOV R0,#30HONLTXTN: MOV A,@R0

    MOV R6,A

    TXDINC R0CJNE R0,#3BH,ONLTXTN

    SETB P3.2CLR P3.3LCALL DEL

    CLR RIRET

    ;------------------------------RFSTORE: ;50H,51H HOLDS ADDRESS

    LCALL READLCALL CONLCALL CON1LCALL ASSEM

    MOV 7AH,#FFHCLR AMOV A,62H

    MOV 7BH,A

    CLR AMOV A,61HMOV 7CH,A

    CLR AMOV A,63HMOV 7DH,A

    CLR AMOV A,64HMOV 7EH,A

  • 7/27/2019 BATCH9 (1-32)

    46/74

    CLR AMOV A,66HMOV 7FH,A

    ;------------------ ADD READ

    MOV 60H,#00HMOV 61H,#10HLCALL RAMRDMOV 50H,R6

    MOV 60H,#00HMOV 61H,#11HLCALL RAMRDMOV 51H,R6

    ;-------------------MEM FULL VERIFICATION

    CLR AMOV A,50HCJNE A,#7FH,NXTMEM

    CLR AMOV A,51HCJNE A,#F0H,NXTMEMLCALL MEMFULLLCALL BP3SECLCALL SECLCALL BP3SECLCALL SECLCALL BP3SECRET

    ;------------------- WRITENXTMEM: MOV DPH,50H

    MOV DPL,51H;-------------------

    CLR AMOV A,50H

    MOV 60H,A

    CLR AMOV A,51HMOV 61H,A

    MOV R0,#70HRFNXTW: MOV A,@R0

    MOV 62H,ALCALL RAMWRMOV A,R6

    CJNE A,62H,RFERRINC 61H

  • 7/27/2019 BATCH9 (1-32)

    47/74

    INC R0INC DPTRCJNE R0,#80H,RFNXTW;------------------- RAM ADD UPDATE

    ;--------------------MOV 60H,#00HMOV 61H,#10HCLR AMOV A,DPHMOV 62H,ALCALL RAMWRMOV A,R6CJNE A,62H,RFERR

    MOV 60H,#00H

    MOV 61H,#11HCLR AMOV A,DPLMOV 62H,ALCALL RAMWRMOV A,R6CJNE A,62H,RFERRLCALL DISCLR

    LJMP IDINFIDINFR: LCALL BP1SEC

    RET

    RFERR: LCALL RAMERRRET

    ;****************************************IDINF:

    CLR p2.7CLR p2.6MOV P0,#80HLCALL WRI

    ;MOV DPH,#1CH;MOV DPL,#20H;LCALL TLINE

    MOV A,50HMOV 30H,ALCALL ACONMOV A,41HMOV P0,ALCALL WRD

    MOV A,40HMOV P0,A

  • 7/27/2019 BATCH9 (1-32)

    48/74

    LCALL WRD

    MOV A,51HMOV 30H,ALCALL ACON

    MOV A,41HMOV P0,ALCALL WRDMOV A,40HMOV P0,ALCALL WRD

    MOV P0,#3AHLCALL WRD

    ;----------

    CLR p2.7CLR p2.6MOV P0,#86HLCALL WRI

    MOV R1,#70HRTKL:

    CLR AMOV A,@R1MOV P0,ALCALL WRDINC R1CJNE R1,#7CH,RTKL

    CLR p2.7CLR p2.6MOV P0,#C0HLCALL WRI

    MOV A,7BH

    MOV 30H,A

    MOV A,7CHMOV 31H,A

    MOV A,7DHMOV 32H,A

    MOV A,7EHMOV 33H,A

    MOV A,7FHMOV 34H,A

  • 7/27/2019 BATCH9 (1-32)

    49/74

    LCALL CON;---------MOV A,41HADD A,#30H

    MOV P0,ALCALL WRD

    MOV A,40HADD A,#30HMOV P0,ALCALL WRD

    MOV P0,#3AHLCALL WRD

    MOV A,43HADD A,#30HMOV P0,ALCALL WRD

    MOV A,42HADD A,#30HMOV P0,ALCALL WRD

    MOV P0,#20HLCALL WRDMOV P0,#20HLCALL WRD

    MOV A,45HADD A,#30HMOV P0,ALCALL WRD

    MOV A,44H

    ADD A,#30HMOV P0,ALCALL WRD

    MOV P0,#2DHLCALL WRD

    MOV A,47HADD A,#30HMOV P0,ALCALL WRD

    MOV A,46H

  • 7/27/2019 BATCH9 (1-32)

    50/74

    ADD A,#30HMOV P0,ALCALL WRD

    MOV P0,#2DH

    LCALL WRD

    MOV A,49HADD A,#30HMOV P0,ALCALL WRD

    MOV A,48HADD A,#30HMOV P0,ALCALL WRD

    LJMP IDINFR

    ;-------------------------------BP1SEC: SETB P1.6

    MOV R5,#02HZM1: MOV R6,#FFHZM2: MOV R7,#FFHZM3: DJNZ R7,ZM3

    CPL P1.5DJNZ R6,ZM2DJNZ R5,ZM1CLR P1.6CLR P1.5RET

    BP3SEC: SETB P1.6MOV R5,#06H

    YM1: MOV R6,#FFHYM2: MOV R7,#FFHYM3: DJNZ R7,YM3

    CPL P1.5

    DJNZ R6,YM2DJNZ R5,YM1CLR P1.6CLR P1.5RET

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

    RAMERR: MOV DPH,#1CHMOV DPL,#10HLCALL TLINEMOV DPH,#1BH

    MOV DPL,#A0HLCALL BLINE

  • 7/27/2019 BATCH9 (1-32)

    51/74

    RET

    DISCLR: MOV DPH,#1BHMOV DPL,#A0HLCALL TLINE

    MOV DPH,#1BHMOV DPL,#A0HLCALL BLINERET

    PCCOMMX:SETB P1.7LCALL SECCLR P1.7LCALL SEC

    SETB P1.7LCALL SECCLR P1.7LCALL SEC

    SETB P1.7LCALL SECCLR P1.7LCALL SECSETB P1.7

    MOV DPH,#1BHMOV DPL,#C0HLCALL TLINEMOV DPH,#1BHMOV DPL,#A0HLCALL BLINERET

    RFCOMMX:CLR P1.7MOV DPH,#1BH

    MOV DPL,#D0HLCALL TLINEMOV DPH,#1BHMOV DPL,#A0HLCALL BLINERET

    FORDIS: MOV DPH,#1BHMOV DPL,#E0HLCALL TLINEMOV DPH,#1BHMOV DPL,#A0H

    LCALL BLINERET

  • 7/27/2019 BATCH9 (1-32)

    52/74

    FOROK: MOV DPH,#1BHMOV DPL,#F0HLCALL TLINE

    MOV DPH,#1BHMOV DPL,#A0HLCALL BLINERET

    FORFAIL: MOV DPH,#1CHMOV DPL,#00HLCALL TLINEMOV DPH,#1BHMOV DPL,#A0HLCALL BLINERET

    SWIPE: MOV DPH,#1CHMOV DPL,#30HLCALL TLINEMOV DPH,#1BHMOV DPL,#A0HLCALL BLINERET

    MEMFULL: MOV DPH,#1CHMOV DPL,#40HLCALL TLINEMOV DPH,#1BHMOV DPL,#A0HLCALL BLINERET

    ;****************************************RTCINI: SETB P1.2

    LCALL DELCLR P1.1

    LCALL DEL

    MOV R0,#8EHLCALL CWRRD

    MOV R0,#00HLCALL CWRRD

    CLR P1.2LCALL DEL1

    ;****************************

    SETB P1.2LCALL DEL

  • 7/27/2019 BATCH9 (1-32)

    53/74

    CLR P1.1LCALL DEL

    MOV R0,#80HLCALL CWRRD

    MOV R0,#00HLCALL CWRRD

    CLR P1.2LCALL DEL1

    ;*****************************SETB P1.2LCALL DELCLR P1.1LCALL DEL

    MOV R0,#84HLCALL CWRRD

    MOV R0,#00HLCALL CWRRD

    CLR P1.2LCALL DEL1MOV R0,#50H

    IIOO: MOV @R0,#00HINC R0CJNE R0,#5CH,IIOOMOV 5CH,#01HLCALL WRITERET

    ;****************************XMTOP: LCALL LCDINI

    SETB P1.2LCALL DEL

    CLR P1.1LCALL DEL

    MOV R0,#90HLCALL CWRRD

    MOV R0,#A5HLCALL CWRRDCLR P1.2LCALL DEL1

    ;*********** MAIN MODULE ******************YMTOP: LCALL TAIL

  • 7/27/2019 BATCH9 (1-32)

    54/74

    LCALL READLCALL CONLCALL CON1LCALL ASSEMLCALL DISP

    LJMP YMTOP;******************************************;**** DATA READ IN BURST MODE *****

    READ: SETB P1.2LCALL DELCLR P1.1LCALL DEL

    MOV R0,#BFHLCALL CWRRD

    LCALL DATARMOV 30H,R6

    LCALL DATARMOV 31H,R6

    LCALL DATARMOV 32H,R6

    LCALL DATARMOV 33H,R6

    LCALL DATARMOV 34H,R6

    LCALL DATARMOV 35H,R6

    LCALL DATARMOV 36H,R6

    LCALL DATARMOV 37H,R6

    CLR P1.1CLR P1.2RET

    ;*********** READ END ******************;*********** WRITE ******************WRITE:

    MOV A,51H

    SWAP AADD A,50H

  • 7/27/2019 BATCH9 (1-32)

    55/74

    MOV 60H,A

    MOV A,53HSWAP AADD A,52H

    MOV 61H,A

    MOV A,55HSWAP AADD A,54HMOV 62H,A

    MOV A,57HSWAP AADD A,56HMOV 63H,A

    MOV A,59HSWAP AADD A,58HMOV 64H,A

    MOV A,5BHSWAP AADD A,5AHMOV 66H,A

    MOV A,5CH ;WEEKMOV 65H,A

    SETB P1.2LCALL DELCLR P1.1LCALL DEL

    MOV R0,#BEHLCALL CWRRD

    MOV R0,60HLCALL CWRRDMOV R0,61HLCALL CWRRDMOV R0,62HLCALL CWRRDMOV R0,63HLCALL CWRRDMOV R0,64HLCALL CWRRD

    MOV R0,65HLCALL CWRRD

  • 7/27/2019 BATCH9 (1-32)

    56/74

    MOV R0,66HLCALL CWRRDMOV R0,#00HLCALL CWRRD

    CLR P1.1LCALL DEL1CLR P1.2LCALL DEL1

    LCALL TAILLCALL READLCALL CONLCALL CON1LCALL ASSEMLCALL DISP

    LCALL SEC3LCALL PCCOMMXLJMP VERIF

    ;RET;*********** WRITE END ******************

    BSEC: MOV PSW,#10HMOV R5,#02H

    BM1: MOV R6,#FFHBM2: MOV R7,#FFHBM3: DJNZ R7,BM3

    DJNZ R6,BM2DJNZ R5,BM1MOV PSW,#00HDJNZ R4,BSEC

    SETB P2.4MOV R4,6BH

    CSEC: MOV PSW,#10H

    MOV R5,#04HCM1: MOV R6,#FFHCM2: MOV R7,#FFHCM3: DJNZ R7,CM3

    DJNZ R6,CM2DJNZ R5,CM1MOV PSW,#00HDJNZ R4,CSECRET

    ;************ SECOND ***************

    CON: CLR AMOV A,30H

  • 7/27/2019 BATCH9 (1-32)

    57/74

    ANL A,#7FHMOV 30H,AANL A,#0FHMOV 40H,AMOV A,30H

    SWAP AANL A,#0FHMOV 41H,A

    ;************ MIN ***************CLR AMOV A,31HANL A,#7FHMOV 31H,AANL A,#0FHMOV 42H,A

    MOV A,31HSWAP AANL A,#0FHMOV 43H,A

    ;************ HOUR ***************CLR AMOV A,32HANL A,#7FHMOV 32H,AANL A,#0FHMOV 44H,AMOV A,32HSWAP AANL A,#0FHMOV 45H,A

    ;************ DAY ***************CLR AMOV A,33HANL A,#7FHMOV 33H,AANL A,#0FH

    MOV 46H,AMOV A,33HSWAP AANL A,#0FHMOV 47H,A

    ;************ MON ***************CLR AMOV A,34HANL A,#7FHMOV 34H,A

    ANL A,#0FHMOV 48H,A

  • 7/27/2019 BATCH9 (1-32)

    58/74

    MOV A,34HSWAP AANL A,#0FHMOV 49H,A

    ;************ YEAR ***************CLR AMOV A,36HANL A,#7FHMOV 36H,AANL A,#0FHMOV 4AH,AMOV A,36HSWAP AANL A,#0FHMOV 4BH,A

    ;************ WEEK ***************CLR AMOV A,35HANL A,#07HMOV 4CH,ARET

    ACON: ;30H SOURCE/ 40H LSB ASCII,41H MSB ASCII

    CLR AMOV A,30HMOV 30H,AANL A,#0FHADD A, #30HMOV 40H,A

    CJNE A,#3AH,A1MOV 40H,#41H

    A1: CJNE A,#3BH,A2MOV 40H,#42H

    A2: CJNE A,#3CH,A3

    MOV 40H,#43HA3: CJNE A,#3DH,A4MOV 40H,#44H

    A4: CJNE A,#3EH,A5MOV 40H,#45H

    A5: CJNE A,#3FH,A6MOV 40H,#46H

    A6:MOV A,30HSWAP AANL A,#0FH

    ADD A,#30HMOV 41H,A

  • 7/27/2019 BATCH9 (1-32)

    59/74

    CJNE A,#3AH,GA1MOV 41H,#41H

    GA1: CJNE A,#3BH,GA2MOV 41H,#42H

    GA2: CJNE A,#3CH,GA3MOV 41H,#43H

    GA3: CJNE A,#3DH,GA4MOV 41H,#44H

    GA4: CJNE A,#3EH,GA5MOV 41H,#45H

    GA5: CJNE A,#3FH,GA6MOV 41H,#46H

    GA6: RET

    ;###################################

    ;********* WRITE 1BYTE INTO RTC **********

    CWRRD:CLR AMOV A,R0MOV 20H,A

    JNB 00H,DB0SETB P1.0LCALL CLKPLJMP K1

    DB0: CLR P1.0LCALL CLKP;--------------

    K1: JNB 01H,DB1SETB P1.0LCALL CLKPLJMP K2

    DB1: CLR P1.0LCALL CLKP

    ;--------------K2: JNB 02H,DB2

    SETB P1.0LCALL CLKPLJMP K3

    DB2: CLR P1.0LCALL CLKP

    ;--------------K3: JNB 03H,DB3

  • 7/27/2019 BATCH9 (1-32)

    60/74

    SETB P1.0LCALL CLKPLJMP K4

    DB3: CLR P1.0

    LCALL CLKP

    ;--------------K4: JNB 04H,DB4

    SETB P1.0LCALL CLKPLJMP K5

    DB4: CLR P1.0LCALL CLKP

    ;--------------K5: JNB 05H,DB5

    SETB P1.0LCALL CLKPLJMP K6

    DB5: CLR P1.0LCALL CLKP

    ;--------------K6: JNB 06H,DB6

    SETB P1.0LCALL CLKPLJMP K7

    DB6: CLR P1.0LCALL CLKP;--------------

    K7: JNB 07H,DB7SETB P1.0

    LCALL CLKPLJMP K8

    DB7: CLR P1.0LCALL CLKP

    K8: RET

    CLKP:mov r4,#02H

    djnz r4,$

  • 7/27/2019 BATCH9 (1-32)

    61/74

    SETB P1.1

    mov r4,#02Hdjnz r4,$

    CLR P1.1RET

    ;*********** DATA 1 BYTE READ MODULE ******

    DATAR:MOV R0,#00H

    LCALL CLKRLCALL CLKRLCALL CLKR

    LCALL CLKRLCALL CLKRLCALL CLKRLCALL CLKRLCALL CLKR

    CLR AMOV A,R0MOV R6,ARET

    CLKR:CLR P1.1mov r4,#02H ;DELAYdjnz r4,$

    MOV R1,P1CLR AMOV A,R1ANL A,#01H

    MOV R1,A

    CLR AMOV A,R0ADD A,R1RR AMOV R0,A

    SETB P1.1mov r4,#02Hdjnz r4,$

    RET

  • 7/27/2019 BATCH9 (1-32)

    62/74

    ;***********************************;####################################;************************************DISP:

    CLR p2.7CLR p2.6MOV P0,#86HLCALL WRI

    MOV A,45H ;10 HRCLR CADD A,#30HMOV P0,ALCALL WRD

    MOV A,44H ; HRCLR CADD A,#30HMOV P0,ALCALL WRD

    MOV P0,#3AHLCALL WRD

    MOV A,43H ;10 MINCLR CADD A,#30HMOV P0,ALCALL WRD

    MOV A,42H ;MINCLR CADD A,#30HMOV P0,ALCALL WRD

    MOV P0,#3AHLCALL WRD

    MOV A,41H ;10 SECCLR CADD A,#30HMOV P0,ALCALL WRD

    MOV A,40H ;SECCLR C

    ADD A,#30HMOV P0,A

  • 7/27/2019 BATCH9 (1-32)

    63/74

    LCALL WRD

    CLR p2.7CLR p2.6MOV P0,#C4H

    LCALL WRI

    MOV A,47H ;10 DAYCLR CADD A,#30HMOV P0,ALCALL WRD

    MOV A,46H ; DAYCLR CADD A,#30H

    MOV P0,ALCALL WRD

    MOV P0,#B0HLCALL WRD

    MOV A,49H ;10 MONCLR CADD A,#30HMOV P0,ALCALL WRD

    MOV A,48H ;MONCLR CADD A,#30HMOV P0,ALCALL WRD

    MOV P0,#B0HLCALL WRD

    MOV A,4BH ;10 YCLR CADD A,#30HMOV P0,ALCALL WRD

    MOV A,4AH ;YCLR CADD A,#30HMOV P0,A

    LCALL WRD;----------------------

  • 7/27/2019 BATCH9 (1-32)

    64/74

    MOV P0,#20HLCALL WRD

    WDIS:MOV P0,#CDH

    LCALL WRI

    WDIST: MOV R0,4CH

    CJNE R0,#01H,W1MOV P0,#53HLCALL WRDMOV P0,#55HLCALL WRDMOV P0,#4EHLCALL WRD

    W1: CJNE R0,#02H,W2MOV P0,#4DHLCALL WRDMOV P0,#4FHLCALL WRDMOV P0,#4EHLCALL WRD

    W2: CJNE R0,#03H,W3MOV P0,#54HLCALL WRDMOV P0,#55HLCALL WRDMOV P0,#45HLCALL WRD

    W3: CJNE R0,#04H,W4MOV P0,#57HLCALL WRDMOV P0,#45HLCALL WRDMOV P0,#44HLCALL WRD

    W4: CJNE R0,#05H,W5MOV P0,#54HLCALL WRDMOV P0,#48HLCALL WRDMOV P0,#55HLCALL WRD

    W5: CJNE R0,#06H,W6MOV P0,#46HLCALL WRD

    MOV P0,#52HLCALL WRD

  • 7/27/2019 BATCH9 (1-32)

    65/74

    MOV P0,#49HLCALL WRD

    W6: CJNE R0,#07H,W7MOV P0,#53HLCALL WRD

    MOV P0,#41HLCALL WRDMOV P0,#54HLCALL WRD

    W7: CJNE R0,#08H,W8MOV P0,#44HLCALL WRDMOV P0,#45HLCALL WRDMOV P0,#4CH

    LCALL WRDW8:

    CJNE R0,#09H,W9MOV P0,#43HLCALL WRDMOV P0,#4FHLCALL WRDMOV P0,#50HLCALL WRD

    W9:CJNE R0,#0AH,W10MOV P0,#52HLCALL WRDMOV P0,#2EHLCALL WRDMOV P0,#54HLCALL WRD

    W10:CJNE R0,#0BH,W11MOV P0,#49HLCALL WRD

    MOV P0,#4EHLCALL WRDMOV P0,#54HLCALL WRD

    W11:RET

    ;******** DISP END **************

    ASSEM: MOV A,51HSWAP A

    ADD A,50HMOV 60H,A

  • 7/27/2019 BATCH9 (1-32)

    66/74

    MOV A,53HSWAP AADD A,52HMOV 61H,A

    MOV A,55HSWAP AADD A,54HMOV 62H,A

    MOV A,57HSWAP AADD A,56HMOV 63H,A

    MOV A,59HSWAP AADD A,58HMOV 64H,A

    MOV A,5BHSWAP AADD A,5AHMOV 66H,A

    MOV A,5CH ;WEEKMOV 65H,ARET

    ASSEM1: MOV A,51HSWAP AADD A,50HMOV 61H,A

    MOV A,53HSWAP A

    ADD A,52HMOV 62H,A

    MOV A,55HSWAP AADD A,54HMOV 63H,ARET

    SETS: SETB p1.5SETB p1.6

    SETB p1.7LCALL DEL1

  • 7/27/2019 BATCH9 (1-32)

    67/74

    RET

    CON1: MOV R0,#50HMOV R1,#40H

    NTXW:CLR AMOV A,@R1ANL A,#0FHMOV @R0,AINC R0INC R1CJNE R0,#5DH,NTXWRET

    ;************ DELAYS ***********

    DEL:mov r4,#0AHdjnz r4,$RET

    DDEL: MOV R5,#03HEDR: mov r4,#FFH

    djnz r4,$djnz r5,EDRRET

    ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX;********** LCD INI ****************LCDINI:

    CLR P0.0CLR P0.1CLR P0.2

    CLR P2.5

    CLR p2.7CLR p2.6MOV P0,#30HLCALL WRI

    CLR p2.7CLR p2.6MOV P0,#30HLCALL WRI

    CLR p2.7

    CLR p2.6

  • 7/27/2019 BATCH9 (1-32)

    68/74

    MOV P0,#30HLCALL WRI

    CLR p2.7CLR p2.6

    MOV P0,#38HLCALL WRI

    CLR p2.7CLR p2.6MOV P0,#01HLCALL WRI

    CLR p2.7CLR p2.6MOV P0,#01H

    LCALL WRI

    CLR p2.7CLR p2.6MOV P0,#01HLCALL WRI

    CLR p2.7CLR p2.6MOV P0,#02HLCALL WRI

    CLR p2.7CLR p2.6MOV P0,#0CHLCALL WRI

    CLR p2.7CLR p2.6MOV P0,#1CHLCALL WRI

    CLR p2.7CLR p2.6MOV P0,#38HLCALL WRI

    CLR p2.7CLR p2.6MOV P0,#06HLCALL WRICLR p2.7

    CLR p2.6MOV P0,#01H

  • 7/27/2019 BATCH9 (1-32)

    69/74

    LCALL WRI

    RET;*********** HEADER WRITE ***************HEAD:

    CLR p2.7CLR p2.6MOV P0,#80HLCALL WRI

    MOV DPTR,#1B00HMOV R7,#00H

    KL:CLR AMOVC A,@A+DPTRMOV P0,A

    LCALL WRDINC DPTRINC R7CJNE R7,#10H,KL

    CLR p2.7CLR p2.6MOV P0,#C0HLCALL WRI

    KL1:CLR AMOVC A,@A+DPTRMOV P0,ALCALL WRDINC DPTRINC R7CJNE R7,#20H,KL1

    LCALL SSECRET

    TAIL:CLR p2.7CLR p2.6MOV P0,#80HLCALL WRIMOV DPTR,#1B20HMOV R7,#00H

    XKL:CLR A

    MOVC A,@A+DPTRMOV P0,A

  • 7/27/2019 BATCH9 (1-32)

    70/74

    LCALL WRDINC DPTRINC R7CJNE R7,#10H,XKL

    CLR p2.7CLR p2.6MOV P0,#C0HLCALL WRI

    XKL1:CLR AMOVC A,@A+DPTRMOV P0,ALCALL WRDINC DPTR

    INC R7CJNE R7,#20H,XKL1LCALL DEL1RET;----------------------------

    TLINE: CLR p2.7CLR p2.6MOV P0,#80HLCALL WRI;MOV DPTR,#1B00HMOV R7,#00H

    TKL:CLR AMOVC A,@A+DPTRMOV P0,ALCALL WRDINC DPTRINC R7CJNE R7,#10H,TKLRET

    BLINE: CLR p2.7CLR p2.6MOV P0,#C0HLCALL WRI;MOV DPTR,#1B00HMOV R7,#00H

    BKL:CLR AMOVC A,@A+DPTRMOV P0,A

    LCALL WRDINC DPTR

  • 7/27/2019 BATCH9 (1-32)

    71/74

    INC R7CJNE R7,#10H,BKLRET

    ;******** INSTRUCTION /DATA WRITE *********

    WRI:SETB P2.2MOV R0,#7FHDJNZ R0,$CLR P2.2

    SETB P2.5MOV R0,#FFHDJNZ R0,$CLR P2.5

    MOV R0,#FFHDJNZ R0,$RET

    WRD: SETB P2.2MOV R0,#7FHDJNZ R0,$CLR P2.2

    SETB p2.7 ; REGISTERCLR p2.6 ;READ WRITESETB P2.5 ;ENABLEMOV R0,#FFHDJNZ R0,$CLR P2.5CLR p2.6CLR p2.7MOV R0,#FFHDJNZ R0,$RET

    ;******************************

    DEL1: MOV R7,#FFHDJNZ R7,$RET

    SEC: MOV R5,#02HM1: MOV R6,#FFHM2: MOV R7,#FFHM3: DJNZ R7,M3

    DJNZ R6,M2DJNZ R5,M1

    RET

  • 7/27/2019 BATCH9 (1-32)

    72/74

    SEC3: MOV R5,#0BHM13: MOV R6,#FFHM23: MOV R7,#FFHM33: DJNZ R7,M33

    DJNZ R6,M23

    DJNZ R5,M13RET

    SSEC: MOV R5,#1FHSM1: MOV R6,#FFHSM2: MOV R7,#FFHSM3: DJNZ R7,SM3

    DJNZ R6,SM2DJNZ R5,SM1RET

    ;************** UART PORT INT *************

    ;******* 9600bps,8BIT,NO PARITY ***********

    SPINI:MOV A,#00HMOV TCON,#40HMOV TMOD,#20HMOV SCON,#52HMOV IE,#9AHMOV TH1,#FDHMOV TL1,#FDHRET

    ;********************************************

    XDEL:mov r4,#0FHdjnz r4,$RET

    XDEL1: mov r4,#0FHdjnz r4,$RET

    XDEL2: MOV R5,#5FHGB: mov r4,#FFH

    djnz r4,$DJNZ R5,GBRET

    ;********************************;R4 IS STATUS,R1 REG DATA

    XRXD: MOV R4,#00HMOV R7,#08H

    XAE: MOV R6,#FFH

    XAD: MOV R5,#FFHXAB:

  • 7/27/2019 BATCH9 (1-32)

    73/74

    JNB RI,XACCLR RIMOV R1,SBUF

    MOV A,R1

    MOV R6,ATXD

    MOV R4,#01H ;STATUS CHK #01 OK,#02 NOT OK;MOV 25H,#01HRET

    XAC: DJNZ R5,XABDJNZ R6,XADDJNZ R7,XAEMOV R4,#02H

    ;MOV 25H,#02HRET

    ;*********** DISPLAY FORMAT **************EDIS:

    CLR A;MOV A,60HMOV A,@R1SWAP AANL A,#0FHCLR CADD A,#30HMOV 65H,AMOV P0,R7LCALL WRILCALL XDELMOV P0,65HLCALL WRD

    CLR A;MOV A,60HMOV A,@R1

    ANL A,#0FHCLR CADD A,#30HMOV 65H,AINC R7MOV P0,R7LCALL WRILCALL XDELMOV P0,65HLCALL WRD

    RET**********************************************************

  • 7/27/2019 BATCH9 (1-32)

    74/74