You are on page 1of 62

The project report on

Diploma
In
Electronics and communication engineering
Dept.of electronics and communication
engineering

A Project work submitted in partial fulfillment of the requirements for the


Award of the Degree of

BACHELOR OF ENGINEERING
IN
ELECTRONICS & COMMUNICATION ENGINEERING
BY

CONTENTS
CHAPTER-1
EMBEDDED SYSTEMS
1.1 Introduction to Embedded system..............8
1.2 Processors........9
1.2.1 Digital signal processors..9
1.2.2 Applications of Specific Integrated Circuits9
1.2.3 Microprocessors.10
1.2.4 Micro controllers10
1.2.5 Introduction to Applications Of Embedded System..12
1.2.6 List of Applications of Embedded Systems...12
CHAPTER-2
PROJECT DESCRIPTION
2.1 Description..15
2.2 Project outline.17
2.3 Interfaces used.17
2.4 Software used..17
2.5 Cell phone Operated Robot.17
2.6 Overview Of Project1
CHAPTER-5
POWER SUPPLY
5.1 Introduction37
5.2. Description37
5.2.1 Transformer...37
5.2.2 Rectifier.37

5.2.3 Filtering Unit.38


5.2.4 Regulators..38
5.2.5 Technical details39
5.2.6 Features..39
CHAPTER-6
DTMF DECODER
6.1 Introduction.40
6.2 History.40
6.3 MT8870 DTMF Decoder.44
6.4 DTMF Decoder46
6.4.1 Working of Ic MT 887046
6.5 DTMF data output ...47
CHAPTER-7
DC MOTOR
7.1 Introduction..48
7.2 Types of dc motor .48
7.2.1working of dc motor ..49
7.2.2Dc series motor..50
7.2.3 Technical specification.52
7.3 LM293D.52
7.3.1 Features 54
7.3.2 Technical details55
CHAPTER-8
SOFTWARE
8.1 software configuration...56
8.2 programming the ATmega16.58
8.3 programming procedure.58
8.4 code60
CONCLUSION..62
BIBLIOGRAPHY..63

ABSTRACT

The Project CELL PHONE OPERATED LAND ROVER


USING 8051 MICROCONTROLLER is used to control the
Robot in Remote areas also. Conventionally, wireless-controlled
robots use RF circuits, which have the drawbacks of limited
working range, limited frequency range and limited control. Use of
a mobile phone for robotic control can overcome these limitations.
It provides the advantages of robust control, working range as large
as the coverage area of the service provider, no interference with
other controllers and up to twelve controls.
In this project, the robot is controlled by a mobile phone that
makes a call to the mobile phone attached to the robot. In the
course of a call, if any button is pressed, a tone corresponding to
the button pressed is heard at the other end of the call. This tone is
called dual-tone multiple-frequency (DTMF) tone. The robot
perceives this DTMF tone with the help of the phone stacked in the
robot and operates.

CHAPTER 1

EMBEDDED SYSTEMS
1.1 INTRODUCTION TO EMBEDDED SYSTEMS
Embedded systems are the systems which performs a specific or a pre-defined
task. It is the combination of hardware and software. It is nothing but a computer inside a
product. It is a programmable hardware design nothing but an electronic chip.
A general-purpose definition of embedded systems is that they are devices
used to control, monitor or assist the operation of equipment, machinery or plant.
Embedded reflects the fact that they are an integral part of the system. In many cases
their embedded ness may be such that their presence is far from obvious to the casual
observer and even the equipment for sometime before being able to conclude that an
embedded control system was involved in its functioning. At the other extreme a generalpurpose computer may be used to control the operation of a large complex processing
plant, and its presence will be obvious.
All embedded systems include computers or microprocessors. Some of these
computers are how ever very simple systems as compared with a personal computer.
The very simplest embedded systems are capable of performing only single
functions to meet single functions to meet a single predetermined purpose. In more
complex systems an application program that enables the embedded system to be used for
a particular purpose in a specific application determines the functioning of the embedded
systems. The ability to have programs means that the same embedded system can be used
for a variety of purposes. In some cases a microprocessor may be designed in such way
that application software for a particular purpose can be added to the basic software in a
second process, after which it is not possible to make further changes. The applications
software on such processors is sometimes referred to as firmware.
The simplest devices consist of a single microprocessor (often called a chip),
which may itself be packaged with other chips in a hybrid systems or Application
Specific Integrated Circuit (ASIC). Its input comes from a detector or sensor and its
output goes to a switch or activator which (for example) may start or stop the operation
of a machine or, operating a value, may control the flow of fuel to an engine.

1.2 PROCESSORS:
Processors are the ones which performs some specific task or operation.
These are divided in to several types like:
1. Digital Signal Processors.
2. Application Specific Integrated Circuits.
3. Micro Processors.
4. Micro Controllers.
1.2.1 Digital Signal Processors:
This is a one which performs scientific and mathematical Calculations. The
output of this type of processors will be in floating point values. Hence, we can get
accurate values as outputs.
Best example of a Digital Signal Processors will be Weather Forecasting.
1.2.2 Applications specific Integrated Circuits:
As the name itself specifies, this is integrated circuit designed for a specific
application. IC designed for one specific application cannot be used in other applications.
Best Example for ASIC will be Cell phone card.
1.2.3 Microprocessors:
These are the ones which perform arithmetic and logical operations.
Block Diagram of Microprocessor:

Arithmetic and logical unit performs arithmetical and logical calculations.


Control unit controls all the peripheral devices connected to the microprocessors.
Memory is a one which is used to store some data or information.
Best Example for a microprocessor will be our Personal Computer.
1.2.4 Micro Controllers:
These are the ones which are similar to that of a microprocessor which performs
arithmetic and logical calculations. These have additional advantage to that it is having
additional inbuilt features like:

1.
2.
3.
4.
5.
6.

Electrically Erasable Programmable Read Only Memory (EEPROM)


Universal Synchronous Asynchronous Receiver and Transmitter (USART).
Analog to Digital Converter (ADC).
Digital to Analog Converter (DAC).
Oscillators.
Timers.

7. Many others.
The output of a microcontroller is a always in integer format only. It cannot provide
accurate values or floating point values.
Best Example for Micro Controller will be Traffic Light Controller.
Out of all these Processors, we are using Micro Controllers.
Coming to the software point of View, we have many software languages. Out of all, we
are using Assembly Level Language to load the program in to the controller.
ALP coding is done and loaded into the microcontroller. These are different
companies that manufacture Microcontrollers like Atmel, Motorola, Intel, Philips, PIC,
etc.
We are using Atmel manufactured microcontrollers. Atmel Company manufactures
different series of microcontrollers like
AT89C, AT90S, ATMega, ATCAN. Here we are using ATMega Microcontrollers.
Again in ATMega we are having different ATMega 8, ATMega 8515, ATMega 16,
ATMega 32,
AT Mega 162v, etc.Here, in this project we are using AT89c51 Microcontroller.
1.2.5 Introduction to applications of Embedded System:
Embedded Controllers may be found in many different kinds of system and are used
for many different applications. The list, which follows, is a indicative rather than
exhaustive. An item in the list may be relevant to a particular company because either
(a) It is or involves a core process or product,
(b) It is or involves an ancillary function or services performed by the company or
(c) It refers to a product or services provided by a contractor under some form of
agreement and the vulnerability of the supplier may need to be considered.
1.2.6 List of Applications of Embedded Systems:
(a) Manufacturing and process control:
Manufacturing plants.
Water and sewage systems.
Power stations.
Power grid systems.
Oil refineries and related storage facilities.
Bottling plants.
Automated factories.
Simulators.
Test equipment for control system development, maintenance and testing.
(b) Construction industry:
Surveying and location Equipment.
Construction Plant.
(c) Transport:
Aero planes
Trains and Buses.
Marine craft (known cases include: radar mapping; ballast monitoring; cargo
loading; ship main control system)

Automobiles
Fuel services.
Air Traffic Control Systems.
Signaling system.
Radar Systems.
Traffic Lights.
Ticketing systems and Machines.
Car Parking and other meters.
(d) Buildings and premises:
Electrically supply- supply, measurement, control, protection.
Backing lighting and generators.
Fire control systems.
Heating and ventilating systems.
Lifts Elevators, escalators.
Security Systems.
Security Cameras.
Door locks.
(e) Domestic service:
Catering.
Cleaning.
(f) Communications:
Telephone.
Cable systems.
Telephone switches.
Satellites.
(g) Office systems and mobile management:
Telephone systems
Faxes and Copier.
Time recording systems.
Mobile telephones
Still and Video Cameras.
(h) Banking, Finance and Commercial:
Automated teller systems.
Credit card Systems.
Point of scale systems including scanner / cash systems.

CHAPTER-2
2.1 DESCRIPTION;
CELL
PHONE
OPERATED
LAND
ROVER
USING
8051
MICROCONTROLLER is used to control the Robot in Remote areas also.
Conventionally, wireless-controlled robots use RF circuits, which have the drawbacks of
limited working range, limited frequency range and limited control. Use of a mobile
phone for robotic control can overcome these limitations. It provides the advantages of
robust control, working range as large as the coverage area of the service provider, no
interference with other controllers and up to twelve controls.
In this project, the robot is controlled by a mobile phone that makes a
call to the mobile phone attached to the robot. In the course of a call, if any button is
pressed, a tone corresponding to the button pressed is heard at the other end of the call.
This tone is called dual-tone multiple-frequency (DTMF) tone. The robot perceives this
DTMF tone with the help of the phone stacked in the robot and operated
BLOCK DIAGRAM:-

RIGHT
MOTOR

DTMF
DECODER

8051
Controller

MOTOR
DRIVER

RELAYS
LEFT
MOTOR

The Figure shows the block diagram and cicuit diagram of the microcontroller- RELAYS
based robot. The important components of this robot are DTMF decoder, Microcontroller
and motor driver.

An MT8870 series DTMF decoder is used here. All types of the MT8870
series use digital counting techniques to detect and decode all the sixteen DTMF tone
pairs into a four-bit code output. The built -in dial tone rejection circuit eliminated the
need for pre- filtering. When the input signal given at pin2 (IN-) single ended input
configuration is recognized to be effective, the correct four bit decode signal of the
DTMF tone is transferred to Q1(pin11) through Q4(pin14) outputs.
The ATmega 16 is a low power, 8 bit, CMOS micro-controller based on the
AVR enhanced RISC architecture. It provides the following feature: 16kb of in system
programmable flash memory with read write capabilities, 512bytes of EEPROM, 1KB
SRAM, 32 general purpose input/output lines. 32 general purpose working registers.
All the 32 registers are directly connected to the arithmetic logic unit, allowing two
independent registers to be accessed in one signal instruction executed in one clock cycle.
The resulting architecture is more code efficient. Outputs from port pins PD0 through
PD3 and PD7 of the micro-controller are fed to inputs IN1 through IN4 and enable pins
(EN1 and EN2) of motor driver L293d respectively, to drive geared motors. Switch S1 is
used for manual reset.
2.2 PROJECT OUTLINE: A brief introduction to internal architecture of micro-controller.
An over view of programming of micro-controller.
An overview on C language.
An overview on mechanical arrangement.
DTMF interfacing with micro-controller.
2.3 INTERFACES USED: Serial communication used for downloading the hex code.
DTMF circuit interface.
L293D interfacing.
DC motor interfacing.
2.4 SOFTWARES USED: A Cross compiler for compiling and linking the code written for 8051
Serial communication software for downloading code to 8051
Operating system: Windows XP.
2.5 CELL PHONE OPERATED ROBOT:Conventionally, Wireless-controlled robots use of circuits, which have the
drawbacks of limited working range, limited frequency range and the limited control. Use
of a mobile phone for robotic control can overcome these limitations. It provides the
advantage of robust control, working range as large as the coverage area of the service
provider, no interference with other controllers and up to twelve controllers.
Although the appearance and the capabilities of robots vary vastly, all robots
share the feature of a mechanical, movable structure under some form of control. The
Control of robot involves three distinct phases: perception, processing and action.
Generally, the preceptors are sensors mounted on the robot , processing is done by the onboard micro-controller or processor, and the task is performed using motors or with some
other actuators.

2.6 OVERVIEW OF THE PROJECT:In this project the robot, is controlled by a mobile phone that makes call to the mobile
phone attached to the robot in the course of the call, if any button is pressed control
Corresponding to the button pressed is heard at the other end of the call. This tone is
called dual tone multi frequency tome (DTMF) robot receives this DTMF tone with
the help of phone stacked in the robot.
The received tone is processed by the atmega16 microcontroller with the help of
DTMF decoder MT8870 the decoder decodes the DTMF tone in to its equivalent binary
digit and this binary number is send to the microcontroller, the microcontroller is
preprogrammed to take a decision for any give input and outputs its decision to motor
drivers in order to drive the motors for forward or backward motion or a turn.
The mobile that makes a call to the mobile phone stacked in the robot acts as a remote. It
does not require the construction of receiver and transmitter units.
DTMF signaling is used for telephone signaling over the line in the voice _
frequency band to the call switching center. The version of DTMF used for telephone
dialing is known as touch _tone .DTMF assigns a specific frequency (consisting of two
separate tones) to each keys that it can easily be identified by the electronic circuit.

CHAPTER-3
MICROCONTROLLER
a. MICROCONTROLLER:
A microcontroller is an integrated chip with minimum
required devices. The microcontroller includes a CPU: ALU, PC,SP
and registers, RAM, ROM, I/O ports, and timers like a standard
computer, but because they are designed to execute only a single
specific task to control a single system, they are much smaller and
simplified so that they can include all the functions required on a
single chip.

Fig 2.1: Microcontroller Block Diagram.


Most microcontrollers will also combine other devices such as:

A Timer module to allow the microcontroller to perform tasks


for certain time periods.
A serial I/O port to allow data to flow between the
microcontroller and other devices such as a PC or another
microcontroller.

An ADC to allow the microcontroller to accept analogue input


data for processing.

A BLOCK DIAGRAM OF MICROCONTROLLER (EXPANDED)


ALU

TIMER/COUNTER

I/O
PORTS

ACCUMULATOR
REGISTERS
INTERNAL
ROM

INTERNAL
RAM

STACK POINTER

I/O
PORTS
INTERNAL
CIRCUITS
CLOCK
CIRCUIT

PROGRAM COUNTER
Fig 2.2: Functional Block Diagram of Microcontroller.

2. MICROCONTROLLER Vs MICROPROCESSOR:
1. A microcontroller is meant to be more self-contained and
independent, and functions as a tiny, dedicated computer than
microprocessor.
2. The microcontroller may function as a computer with addition of
external digital parts; the microprocessor must have many additional
parts to be operational.
3. Most microprocessors have many operational codes (opcodes) for
moving data from external memory to the CPU; microcontrollers may
have one or two.
4. Microcontrollers are designed by using CMOS (complementary
metal oxide semiconductor) technology, an efficient fabrication

technique that uses less power and is more immune to power spikes
than other techniques.
3. ADVANTAGES OF MICROCONTROLLERS:
Their powerful, cleverly chosen electronics is able to control a
variety of processes and devices (industrial automatics, voltage,
temperature, engines, etc) independently or by means of I/O
instruments such as switches, buttons, sensors, LCD screens, relays
etc.
4. TYPES OF 8051 MICROCONTROLLER:
The 8051 has the widest range of variants of any embedded
controller on the market. The smallest device is the Atmel 89c1051,
a 20 Pin FLASH variant with 2 timers, UART, 20mA. The fastest
parts are from Dallas, with performance close to 10 MIPS! The most
powerful chip is the Intel Technologies 80C517A, with 32 Bit ALU, 2
UARTS, 2K RAM, PLCC84 package, 8 x 16 Bit PWMs, and other
features.
Among the MAJOR manufacturers are:
AMD Enhanced 8051 parts (no longer producing 80x51
parts)
Atmel - FLASH and semi-custom parts
Cygnal - Fastest 8051 with Flash with 12-bit 1LSB A/D.
20MHz
internal clock
Dallas
-Fast variant. Also battery backed
Intel
-8051 through 80C51GB / 80C51Sl. They invented the
8051
ISSI
-IS80C51/31 runs up to 40MHz
Matra
- 80C154, low voltage static variants
OKI
-80C154, mask parts
Philips
-87C748 thru 89c588, mostly old legacy 8051 parts
from
Signetics.
Infineon -80C501 through 80C517A, and a wide variety of CAN
devices.
SMC
- COM20051 with ARCNET token bus network
engine
SSI
- 80x52, 2 x HDLC variant for MODEM use

Microcontroller Architectural Block Diagram:

Atmel At89c51 Pin out and Description:


The smallest current device is the ATMEL 89c51, a 40 Pin FLASH
variant with 2 timers, UART, 500mA. ATMEL was the first with
standard FLASH, and with more program cycles than other custom
FLASH. These parts compete with OTP and MASK product on price,
but eliminate inventory problems and the hidden costs of OTP
development.
Why we go for AT89C51?
The AT89C51 is a low power, high performance CMOS 8-bit
microcontroller with 4Kbytes of Flash programmable and erasable
read only memory (PEROM). This device is compatible with the
industry standard 8051 instruction set and pinout. The on-chip Flash
allows the program memory to be quickly reprogrammed using a
nonvolatile memory programmer such as the PG302 (with the ADT87
adapter). By combining an industry standard 8-bit CPU with Flash on
a monolithic chip, the 8951 is a powerful microcomputer which
provides a highly flexible and cost effective solution to many
embedded control applications.
Features of AT89C51:
1. It is a 8-bit microcontroller.
2. It has a flash memory of 4KB for storing the program.
3. It has RAM of 128 bytes.
4. It has 32 I/O ports .
-Port 0 (pin 39 to pin 32).
-Port 1 (pin 1 to pin 8).
-Port 2 (pin 21 to pin 28).
-Port 3 (pin 10 to pin 17).
5. It has four register banks.
6. It has two 16-bit timers.
- Timer 0
- Timer 1
7. It has full duplex asynchronous serial port.
8. It can support up to 64KB of external memory with the help of PC
and DPTR.
9. It has 16-bit address bus.
10. Six interrupts with two priority levels
-2 general purpose interrupts (INT0, INT1).
-4 preprogrammed interrupt ( Timer0,Timer1,Serial interrupt, Reset
interrupt).
11. Wide range of frequency of operation (0 to 24 MHz).

12. It will operate on 5V dc supply.


13. It can support maximum of 500mA of current.
In addition, the 8951 is designed with static logic for operation
down to zero frequency and supports two software selectable power
saving modes. The Idle Mode stops the CPU while allowing the RAM,
timer/counters, serial port and interrupt system to continue
functioning. The Power Down Mode saves the RAM contents but
freezes the oscillator disabling all other chip functions until the next
hardware reset.

PINOUT DIAGRAM:

Fig : Microcontroller Pin Diagram.

.18: Port 1: Each of these pins can be used as either input or


output. Also, pins 1 and 2 (P1.0 and P1.1) have special functions
associated with Timer 2.
.9: Reset Signal: High logical state on this input halts the MCU and
clears all the registers. Bringing this pin back to logical state zero
starts the program anew as if the power had just been turned on. In
another words, positive voltage impulse on this pin resets the MCU.
Depending on the device's purpose and environs, this pin is usually
connected to the push-button, reset-upon-start circuit or a brown out
reset circuit. The image shows one simple circuit for safe reset upon
starting the controller. It is utilized in situations when power fails to
reach its optimal voltage.

Fig : Reset Circuit


.10-17: Port 3: As with Port 1, each of these pins can be used as
universal input or output. However, each pin of Port 3 has an
alternative function:
.Pin 10: RXD - Serial input for asynchronous communication or serial
output for synchronous communication.
Pin 11: TXD - Serial output for asynchronous communication or
clock output for synchronous communication
Pin 12: INT0 - Input for interrupt 0
Pin 13: INT1 - Input for interrupt 1

Pin 14: T0 - Clock input of counter 0


Pin 15: T1 - Clock input of counter 1
Pin 16: WR - Signal for writing to external (add-on) RAM memory
Pin 17: RD - Signal for reading from external RAM memory
18-19: X2 and X1: Input and output of internal oscillator. Quartz
crystal controlling the frequency commonly connects to these pins.
Capacitances within the oscillator mechanism (see the image) are
not critical and are normally about 30pF. New MCUs work at
frequencies from 0Hz to 50MHz+.

Fig : Clock Circuit.


.20: GND: Ground
21- 28: Port 2: If external memory is not present, pins of Port 2 act
as universal input/output. If external memory is present, then these
pins serve as the location of the higher address byte, i.e. addresses
A8 A15. It is important to note that in cases when not all the 8 bits
are used for addressing the memory (i.e. memory is smaller than
64kB), the rest of the unused bits are not available as input/output.
29: PSEN: MCU activates this bit (brings to low state) upon each
reading of byte (instruction) from program memory. If external ROM
is used for storing the program, PSEN is directly connected to its
control pins.
30: ALE: Before each reading of the external memory, MCU sends
the lower byte of the address register (addresses A0 A7) to port
P0 and activates the output ALE. External register (74HCT373 or
74HCT375 circuits are common), memorizes the state of port P0
upon receiving a signal from ALE pin, and uses it as part of the
address for memory chip. During the second part of the mechanical
MCU cycle, signal on ALE is off, and port P0 is used as Data Bus. In

this way, by adding only one cheap integrated circuit, data from port
can be multiplexed and the port simultaneously used for transferring
both addresses and data.
31: EA: Bringing this pin to the logical state zero designates the
ports P2 and P3 for transferring addresses regardless of the
presence of the internal memory. This means that even if there is a
program loaded in the MCU it will not be executed, but the one from
the external ROM will be used instead. Conversely, bringing the pin
to the high logical state causes the controller to use both memories,
first the internal, and then the external (if present).
32-39: Port 0: Similar to Port 2, pins of Port 0 can be used as
universal input/output, if external memory is not used. If external
memory is used, P0 behaves as address output (A0 A7) when
ALE pin is at high logical level, or as data output (Data Bus) when
ALE pin is at low logical level.
40: VCC: Power +5V
INPUT OUTPUT (I/O) PORTS:
Every MCU from 8051 family has 4 I/O ports of 8 bits each. This
provides the user with 32 I/O lines for connecting MCU to the
environs.
Port 0:
Port 0 has two fold role: if external memory is used, it contains
the lower address byte (A0-A7), otherwise all bits of the port are
either input or output. Another feature of this port comes to play when
it has been designated as output. Port 0 lacks the "pull up" resistor
(resistor with +5V on one end). Therefore, to get one (5V) on the
output, external "pull up" resistor needs to be added for connecting
the pin to the positive pole.
Port 1:
This is "true" I/O port, devoid of dual function characteristic for
Port 0. Having the "pull up" resistor, Port 1 is fully compatible with
TTL circuits.
Port 2:
When using external memory, this port contains the higher address
byte (addresses A8A15). Otherwise, it can be used as universal I/O
port.

Port 3:
Beside its role as universal I/O port, each pin of Port 3 has an
alternate function. In order to use one of these functions, the pin in
question has to be designated as input, i.e. the appropriate bit of
register P3 needs to be set. From a hardware standpoint, Port 3 is
similar to Port 0.
Memory in 8051 Microcontroller:
The 8051 has three very general types of memory. The memory
types
are illustrated in the following figure: On-Chip Memory,
External Code Memory, and External RAM.

Fig : Memory Block Diagram.


On-Chip Memory refers to any memory (Code, RAM, or other)
that physically exists on the microcontroller itself. External Code
Memory is code (or program) memory that resides off-chip. This is
often in the form of an external EPROM. External RAM is RAM
memory that resides off-chip. This is often in the form of standard
static RAM or flash RAM.
During the runtime, microcontroller uses two different types of
memory: one for holding the program being executed (ROM
memory), and the other for temporary storage of data and auxiliary
variables (RAM memory).
ROM memory:
In this MCU contain 4 kilobytes of the flash memory on the
chip. It is of EEPROM. We can use 12v to program MCU. This option

is cost-effective only for large series. The main purpose of ROM is to


store the programs to be executed.
RAM memory:
RAM is used for storing temporary data and auxiliary results
generated during the runtime. Apart from that, RAM comprises a
number of registers: hardware counters and timers, I/O ports, buffer
for serial connection, etc. With older versions, RAM spanned 256
locations, while new models feature additional 128 registers. First 256
memory locations form the basis of RAM (addresses 0 FFh) of
every 8051 MCU. Locations that are available to the user span
addresses from 0 to 7Fh, i.e. first 128 registers, and this part of RAM
is split into several blocks as can be seen in the following figure.

Fig: Ram Memory.


The main purpose of RAM is to provide synchronization between
ROM and CPU so as to increase the speed of microcontroller.

Bit Memory:
The 8051, being a communications-oriented microcontroller,
gives the user the ability to access a number of bit variables. These
variables may be either 1 or 0. There are 128 bit variables available
to the user, numbered 00h through 7Fh.
Special Function Register (SFR) Memory:
Special Function Registers (SFRs) are areas of memory that
control specific functionality of the 8051 processor. It may appear that
SFR is part of Internal Memory. However, when using this method of
memory access (its called direct address), any instruction that has an
address of 00h through 7Fh refers to an Internal RAM memory
address; any instruction with an address of 80h through FFh refers to
an SFR control register.
Register Banks:
General Purpose registers:
The 8051 uses 8 "R" registers which are used in many of its
instructions. These "R" registers are numbered from 0 through 7 (R0,
R1, R2, R3, R4, R5, R6, and R7). These registers are generally used
to assist in manipulating values and moving data from one memory
location to another.
SFR Registers (Special Function Registers):
SFR registers can be seen as a sort of control panel for
managing and monitoring the microcontroller.

Fig : Special Function Registers.


TIMERS:
The 8051 comes equipped with two timers, both of which may
be controlled, set, read, and configured individually. The 8051 timers
have three general functions:
1) Keeping time and/or calculating the amount of time between
events,
2) Counting the events themselves, or
3) Generating baud rates for the serial port.
USING TIMERS TO MEASURE TIME:
Obviously, one of the primary uses of timers is to measure time.
When a timer is used to measure time it is also called an "interval
timer" since it is measuring the time of the interval between two
events. .

Timer SFRs:
The 8051 has two timers which each function essentially the
same way. One timer is TIMER0 and the other is TIMER1. The two
timers share two SFRs (TMOD and TCON) which control the timers,
and each timer also has two SFRs dedicated solely to itself (TH0/TL0
and TH1/TL1).
An SFR has a numeric address. It is often useful to know the
numeric address that corresponds to an SFR name. When you enter
the name of an SFR into an assembler, it internally converts it to a
number.
THE TMOD SFR (Timer Mode):
The TMOD SFR is used to control the mode of operation of
both timers. Each bit of the SFR gives the microcontroller specific
information concerning how to run a timer. The high four bits (bits 4
through 7) relate to Timer 1 whereas the low four bits (bits 0 through
3) perform the exact same functions, but for timer 0.

The individual bits of TMOD have the following functions:


Bit Name Explanation of Function
When this bit is set the timer will only
run when INT1 (P3.3) is high. When
7 GATE1
this bit is clear the timer will run
regardless of the state of INT1.
When this bit is set the timer will
count events on T1 (P3.5). When this
6 C/T1
bit is clear the timer will be
incremented every machine cycle.
5 T1M1 Timer mode bit (see below)
4 T1M0 Timer mode bit (see below)
When this bit is set the timer will only
run when INT0 (P3.2) is high. When
3 GATE0
this bit is clear the timer will run
regardless of the state of INT0.

Timer
1

1
1
1
0

2 C/T0
1 T0M1
0 T0M0

When this bit is set the timer will


count events on T0 (P3.4). When this
0
bit is clear the timer will be
incremented every machine cycle.
Timer mode bit (see below)
0
Timer mode bit (see below)
0

The Four bits (two for each timer) are used to specify a mode of
operation. modes of operation are:
TxM1 TxM0 Timer Mode
Description of Mode
0
0
0
13-bit Timer.
0
1
1
16-bit Timer
1
0
2
8-bit auto-reload
1
1
3
Split timer mode
.
The TCON SFR:
There is one more SFR that controls the two timers and
provides valuable information about them. The TCON SFR has the
following structure:

TCON (88h) SFR:


Bit
Bit Name
Explanation of Function
Timer
Address
7 TF1 8Fh
Timer 1 Overflow. This bit is set by 1

6 TR1

8Eh

5 TF0

8Dh

4 TR0

8Ch

the microcontroller when Timer 1


overflows.
Timer 1 Run. When this bit is set
Timer 1 is turned on. When this bit is 1
clear Timer 1 is off.
Timer 0 Overflow. This bit is set by
the microcontroller when Timer 0 0
overflows.
Timer 0 Run. When this bit is set
Timer 0 is turned on. When this bit is 0
clear Timer 0 is off.

Only four bits of SFR are used for timers, the remaining four are used
for interrupts.

CIRCUIT DIAGRAM

CHAPTER-5
POWER SUPPLY
5.1 Introduction: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 ICs
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. . Microcontroller operates at +5v DC and
also for other ICs and displays. A 220v ac to 12-0-12v transformer is used and for
rectification, four diodes IN4007 are connected for rectification of the step down ac
supply. Filter capacitor of 1000Uf is used. It is regulated to +5v using a regulator 7805.
0.1 UF capacitor is used for filtration of high frequency noise. The power supply circuit is
shown below.
5.2 DESCRIPTION:5.2.1 Transformer:A bridge rectifier coupled with a step down transformer is used for our design. The
voltage rating of transformer used is 0-12V and the current rating is 500mA. When AC
voltage of 230V is applied across the primary winding an output AC voltage of 12V is
obtained. One alteration of input causes the top of transformer to be positive and the
bottom negative. The next alteration will temporarily cause the reverse.
5.2.2 Rectifier: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 at one direction at proper

POWER SUPPLY CIRCIUT


biasing condition. Bridge rectifiers of 4 diodes are used to achieve full wave rectification.
Two diodes will conduct during the negative cycle and the other two will conduct during
the positive half cycle.
5.2.3 Filtering unit:Filter circuit which is usually a capacitor acts as a surge arrester always follows
the rectifier unit. This capacitor is also called as a decoupling capacitor or a bypass
capacitor, is used not only to short the ripple with frequency to ground but also leave the
frequency of the DC to appear at the output.
5.2.4 Regulators: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 DC
voltage 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
line voltage. With a regulator connected to DC output, the voltage can be maintained
within a close tolerant region of the desired output. IC 7805 and 7812 regulators are used
in this project for providing a DC voltage of +5V and +12V respectively.
5.2.5 Technical Details:Transformer: 230/12 volts step down transformer, 1 ampere
Diodes:
IN 4007
Voltage regulators: 78L Series 7812: The 7812 supplies 12 volts at 2 amp maximum
with an input of 13-25 volts
7805: The 7805 supplies 5 volts at 1 amp maximum with an input of 7-25 volts

Electrolytic Capacitors: 100pF, 330pF and 100F, power rating of 25V.


5.2.6 Features: Gives a well regulated +12V and +5V output voltages
Built in overheating protection shuts down output when regulator IC gets too hot.
Very stable output voltages, reliable operation
The circuit has overload and thermal protection.

CHAPTER-6
DTMF DECODER
6.1 INTRODUCTION:Dual-tone multi-frequency (DTMF) signaling is used for telephone signaling over the
line in the voice-frequency band to the call switching center. The version of DTMF used
for telephone tone dialing is known by the trademarked term Touch-Tone, and is
standardized by ITU-T Recommendation Q.23. Other multi-frequency systems are used
for signaling internal to the telephone network
6.2 HISTORY:In the time preceding the development of DTMF, telephone systems employed a
system commonly referred to as pulse (Dial Pulse or DP in the USA) or loop disconnect
(LD) signaling to dial numbers, which functions by rapidly disconnecting and connecting
the calling party's telephone line, similar to flicking a light switch on and off. The
repeated connection and disconnection, as the dial spins, sounds like a series of clicks.
The exchange equipment counts those clicks or dial pulses to determine the called
number. Loop disconnect range was restricted by telegraphic distortion and other
technical problems, and placing calls over longer distances required either operator
assistance (operators used an earlier kind of multi-frequency dial) or the provision of
subscriber trunk dialing equipment.
DTMF was developed at Bell Labs in order to allow dialing signals to dial long-distance
numbers, potentially over nonwire links such as microwave radio relay links or satellites.
For a few non crossbar offices, encoder/decoders were added that would convert the older
pulse signals into DTMF tones and play them down the line to the remote end office. At
the remote site another encoder/decoder could decode the tones and perform pulse
dialing, for example Strowger switches. It was as if you were connected directly to that
end office, yet the signaling would work over any sort of link. This idea of using the
existing network for signaling as well as the message is known as in-band signaling.
It was clear even in the late 1950s when DTMF was being developed that the future
of switching lay in electronic switches, as opposed to the electromechanical crossbar
systems then in use. Either switching system could use either dial system, but DTMF
promised shorter holding times, which was more important in the larger and more
complex registers used in crossbar systems. In this case pulse dialing made no sense at
any point in the circuit, and plans were made to roll DTMF out to end users as soon as
possible. Tests of the system occurred in the early 1960s, where DTMF became known as
Touch Tone. Though Touch Tone phones were already in use in a few places, they were
vigorously promoted at the 1964 New York World's Fair.

The Touch Tone system also introduced a standardized keypad layout. After testing 18
different layouts, they eventually chose the one familiar to us today, with 1 in the upperleft and 0 at the bottom. The adding-machine layout, with 1 in the lower-left was also
tried, but at that time few people used adding machines, and having the 1 at the "start" (in
European language reading order) led to fewer typing errors. In retrospect, many people
consider that this was a mistake. With the widespread introduction of computers and bank
machines, the phone keyboard has become "oddball", causing mistakes.
In another sense, DTMF was obsolete a decade after it was instituted, as FSK methods
with fewer frequencies became cheaper, faster and more reliable. However, the technical
complexities of digital filtering were more expensive to deal with than junking an
adequate system.
#, *, A, B, C, and D
The engineers had envisioned phones being used to access computers, and surveyed a
number of companies to see what they would need for this role. This led to the addition
of the number sign (#) and star (*) keys (also known as Humphries),[citation needed] as
well as a group of keys for menu selection: A, B, C and D. In the end, the lettered keys
were dropped from most phones, and it was many years before the Humphries became
widely used for vertical service codes such as *67 in the United States and Canada to
suppress caller ID.
Public payphones that accept credit cards use these additional codes to send the
information from the magnetic strip.
The U.S. military also used the letters, relabeled, in their now defunct Autovon phone
system. Here they were used before dialing the phone in order to give some calls priority,
cutting in over existing calls if need be. The idea was to allow important traffic to get
through every time. The levels of priority available were Flash Override (A), Flash (B),
Immediate (C), and Priority (D), with Flash Override being the highest priority. Pressing
one of these keys gave your call priority, overriding other conversations on the network.
Pressing C, Immediate, before dialing would make the switch first look for any free lines,
and if all lines were in use, it would disconnect any non-priority calls, and then any
priority calls. Flash Override will kick every other call off the trunks between the origin
and destination. Consequently, it is limited to the White House Communications Agency.
Precedence dialing is still done on the military phone networks, but using number
combinations (Example: Entering 93 before a number is a priority call) rather than the
separate tones.
Present-day uses of the A, B, C and D keys on telephone networks are few, and exclusive
to network control. For example, the A key is used on some networks to cycle through
different carriers at will (thereby listening in on calls). Their use is probably prohibited by
most carriers. The A, B, C and D tones are used in amateur radio phone patch and
repeater operations to allow, among other uses, control of the repeater while connected to
an active phone line.

DTMF tones are also used by some cable television networks and radio networks to
signal the local cable company/network station to insert a local advertisement or station
identification. These tones were often heard during a station ID preceding a local ad
inserts. Previously, terrestrial television stations also used DTMF tones to shut off and
turn on remote transmitters.
DTMF tones are also sometimes used in caller ID systems to transfer the caller ID
information, however in the USA only Bell 202 modulated FSK signaling is used to
transfer the data.
Keypad
The DTMF keypad is laid out in a 44 matrix, with each row representing a low
frequency, and each column representing a high frequency. Pressing a single key such as
'1' will send a sinusoidal tone of the two frequencies 697 and 1209 hertz (Hz). The
original keypads had levers inside, so each button activated two contacts. The multiple
tones are the reason for calling the system multifrequency. These tones are then decoded
by the switching center to determine which key was pressed.
DTMF keypad frequencies
Click here for 8051 Microcontroller FORUM
697 Hz
770 Hz
852 Hz
941 Hz

1209 Hz
1
4
7
*

1336 Hz
2
5
8
0

1477 Hz
3
6
9
#

1633 Hz
A
B
C
D

6.3 MT 8870 DTMF decoder:IC MT8870/KT3170 serves as DTMF decoder. This IC takes DTMF signal
coming via telephone line and converts that signal into respective BCD number. It uses
same oscillator frequency used in the remote section so same crystal oscillator with
frequency of 3.85M Hz is used in this IC.
Working of IC MT8870:
The MT-8870 is a full DTMF Receiver that integrates both band split filter and
decoder functions into a single 18-pin DIP. Its filter section uses switched capacitor
technology for both the high and low group filters and for dial tone rejection. Its decoder
uses digital counting techniques to detect and decode all 16 DTMF tone pairs into a 4-bit
code. External component count is minimized by provision of an on-chip differential

input amplifier, clock generator, and latched tri-state interface bus. Minimal external
components required include a low-cost 3.579545 MHz crystal, a timing resistor, and a
timing capacitor. The MT-8870-02 can also inhibit the decoding of fourth column digits.
MT-8870 operating functions include a band split filter that separates the high and low
tones of the received pair, and a digital decoder that verifies both the frequency and
duration of the received tones before passing the resulting 4-bit code to the output bus.
The low and high group tones are separated by applying the dual-tone signal to the inputs
of two 6th order switched capacitor band pass filters with bandwidths that correspond to
the bands enclosing the low and high group tones.
Figure (F).Block diagram of IC MT8870
The filter also incorporates notches at 350 and 440 Hz, providing excellent dial
tone rejection. Each filter output is followed by a single-order switched capacitor section
that smoothes the signals prior to limiting. Signal limiting is performed by high gain
comparators provided with hysteresis to prevent detection of unwanted low-level signals
and noise. The MT-8870 decoder uses a digital counting technique to determine the
frequencies of the limited tones and to verify that they correspond to standard DTMF
frequencies. When the detector recognizes the simultaneous presence of two valid tones
(known as signal condition), it raises the Early Steering flag (ESt). Any subsequent loss
of signal condition will cause Est. to fall. Before a decoded tone pair is registered, the
receiver checks for valid signal duration (referred to as character- recognition-condition).
This check is performed by an external RC time constant driven by ESt.
A short delay to allow the output latch to settle, the delayed steering output flag (StD)
goes high, signaling that a received tone pair has been registered. The contents of the

output latch are made available on the 4-bit output bus by raising the three state control
input (OE) to logic high. Inhibit mode is enabled by a logic high input to pin 5 (INH). It
inhibits the detection of 1633 Hz. The output code will remain the same as the previous
detected code. On the M- 8870 models, this pin is tied to ground (logic low).The input
arrangement of the MT-8870 provides a differential input operational amplifier as well as
a bias source (VREF) to bias the inputs at mid-rail. Provision is made for connection of a
feedback resistor to the op-amp output (GS) for gain adjustment. The internal clock
circuit is completed with the addition of a standard 3.579545 MHz crystal. The input
arrangement of the MT-8870 provides a differential input operational amplifier as well as
a bias source (VREF) to bias the inputs at mid-rail. Provision is made for connection of a
feedback resistor to the op-amp output (GS) for gain adjustment. The internal clock
circuit is completed with the addition of a standard 3.579545 MHz crystal.

6.4 DTMF decoder: IC MT8870/KT3170 serves as DTMF decoder.


This IC takes DTMF signal coming via telephone line and converts that signal into
respective BCD number.
It uses same oscillator frequency used in the remote section so same crystal oscillator
with frequency of 3.85M Hz is used in this IC.

6.4.1 Working of IC MT8870:The MT-8870 is a full DTMF Receiver that integrates both band split filter and decoder
functions into a single 18-pin DIP. Its filter section uses switched capacitor technology
for both the high and low group filters and for dial tone rejection. its decoder uses digital
counting techniques to detect and decode all 16 DTMF tone pairs into a 4-bit code. To
reject common-mode noise signals, a balanced differential amplifier input is used .The
internal clock circuit is completed with the addition of a standard 3.5795MHZ crystal
oscillator
The input arrangement of the MT-8870 provides a differential input operational amplifier
as well as a bias source (VREF) to bias the inputs at mid-rail. Provision is made for
connection of a feedback resistor to the op-amp output (GS) for gain adjustment.
DTMF keypad frequencies
697 Hz
770 Hz
852 Hz
941 Hz

1209 Hz 1336 Hz 1477 Hz1633 Hz


1
2
3
A
4
5
6
B
7
8
9
C
*
0
#
D

6.5 DTMF data output:Low group


697
697
697
770
770
770
852
852
852
941
941
941
697
770
852
941

High group
1209
1336
1477
1209
1336
1477
1209
1336
1477
1209
1336
1477
1633
1633
1633
1633

Digit
1
2
3
4
5
6
7
8
9
0
*
#
A
B
C
D

D3
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
0

D2
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0

D1
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0

D0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0

CHAPTER-7
DC MOTORS:
7.1 INTRODUCTION:DC motors are widely used in industrial and consumer applications. In many cases,
absolute precision in movement is not an issue but precise speed control is. How ever
there are also applications that do require precise positioning.
DC motors combined with feedback for either position or speed are called Servo motors.
As this feedback mechanism has an edge over other closed loop systems when it comes
to position control, we use DC motors in commissioning the lift. Some more important
features of DC motor that accentuates its implementation are
High output power relative to motor size and weight
High efficiency. Can approach 90% at light load conditions
High torque to inertia ratio. Can rapidly accelerate loads
Has reserve power and torque
Excellent speed control, Effective braking.
The last advantage is certainly subtle because, the motor though for short periods is used
frequently.
7.2 Types of DC Motors:Depending upon the connection of the field circuit DC machines can be classified in to
four categories.
SHUNT WOUND
SERIES WOUND
COMPOUND WOUND
SEPARATELY EXITED
Considering the requirement of lift, we need high torque at low speeds as the elevator
moves vertically against gravity. So by observing our requirements, DC series motor
becomes the best choice for our application.
7.2.1 Working of DC Motor:A brief account on the working of DC motor is described below.
The DC motor has two basic parts: the rotating part that is called the armature and the
stationary part that includes coils of wire called the field coils. The stationary part is also
called the stator. The armature is made of coils of wire wrapped around the core, and the
core has an extended shaft that rotates on bearings. The termination points are called the
commutator, and this is where the brushes make electrical contact to bring electrical
current from the stationary part to the part rotating of the machine. As the armature
begins to move, the north pole of the armature comes closer to the south pole of the field,
and the south pole of the armature is coming closer to the north pole of the field. As the

two unlike poles near each other, they begin to attract. This attraction becomes stronger
until the North Pole moves directly in line with the fields South Pole, and its South Pole
moves directly in line with fields poles. When the opposite poles area at their strongest
attraction, the armature will be locked up and will resist further attempts to continue
spinning. For the armature to continue its rotation, the armatures polarity must be
switched. For this reason the armature must be a coil and a set of commutator segments
must be added to provide a means of making contact between the rotating member and
the stationary member. One commutator segment is provided for each terminal of the
magnetic coil. Since this armature has only one coil, it will have only two terminals, so
the commutator has two segments. Since the armature is now a coil of wire, it will need
DC current flowing through it to become magnetized. This presents another problem;
since the armature will be rotating, the DC voltage wires cannot be connected directly to
the armature coil. A stationary set of carbon brushes is used to make contact to the
rotating armature. The brushes ride on the commutator segments to make a contact so that
current will flow through the armature coil. This is a simple two pole motor that is used
primarily for instructional purposes. Since the motor has only two poles, the motor will
operate rather roughly and not provide too much torque. Additional field poles and
armature poles must be added to the motor for it to become useful for industry. Now as
described earlier, the DC motor suits the lift applications, the electrical working of the
motor is given below
7.2.2 DC Series Motor:Where there is a wide variation in load or where the motor must start under a heavy
load, series motors have desirable features not found in shunt motors. The series wound
motor is used where high starting torque and varying speed is desired. The armature and
the series field are connected in series. With high armature and field currents, it has a
very high starting torque and is well suited for starting heavy loads.

DC MOTOR

DCMOTOR
Notice that the series field is in series with the armature windings. When the motor is first
started, with the negligible effects of the counter EMF, current flow through the armature
is high. Since the armature and the series field are in series, the current in the armature is
the same current through the series winding.
Large current develops a very strong magnetic field and results in an extremely high
torque, Conversely, if the motor is operating at rated speed, the counter EMF will be very
high, and the current in the series field winding and armature is reduced proportionally
.This means that the series motor can develop a very high torque and respond to increase
in loading (reductions in armature RPM) rapidly. The series motor will continue to
increase in speed as long as there is more torque developed that is necessary to turn the
load. This additional torque is called acceleration torque.
When a series motor is heavily loaded, it slows and produces more torque. As the load is
removed, the motor increases in speed. If the load is suddenly removed from the series
motor, the accelerating torque is just enough to continue to increase the motors speed.
The continuously increasing speed can destroy motor.
7.2.3 Technical Specification:Voltage: 12V DC
Speed : 30 rpm
Current:2 Amp
The motor is interfaced to the microcontroller through LM293D.
7.3 LM293D:The L293D is an IC designed for driving individuals loads, such as motors and
solenoids form logic signals. This IC is used for back emf protection and current
amplification. The chip has 4 push-pull channels, and each pair has an enabling input, and

integral clamping (fly back) diodes. Each channel can source or sink up to 600mA
continuous current. A push-pull channel consists of two transistors, a PNP and an NPN, in
which the collectors and bases of the two devices are connected. In this arrangement,
when a logic-level signal is applied to common base, one of the transistors will be
saturated and the other cut-off. This arrangement allows the channel to either source
(push) or sink (pull) current from the common collector junction, hence the name pushpull If two channels are used, a dc motor can be driven bi-directionally from the power
supply of single polarity. The L293D is a 4-channel push-pull driver chip with integral
clamping diodes. The chip needs +5V to operate and +Vs (the supply for the device to be
driven by the chip), where Vs must be between 5 and 36V (in this circuit Vs is +12V).
The channels are enabled by applying +5V to the enable 1 pin. If logic high is applied to
pin2 (IN 1), pin3 (OUT 1) will go high (to about 1.4V lower than Vs). If a logic low is
applied to
pin 2, pin 3 will go low (to about 1.2V above ground). Pins 6 and 7 operate in like
fashion.

CONNECTIN DIAGRAM OF L293D IC

BLOCK DIAGRAM OF L293D IC


Pin 1 of the L293D is enable input for the channels 1 and 2. When pin 1 is taken to logic
high, the pair of the channels is enabled, meaning that they are made operational. Thus
if a logic high is applied to pin 2 (input 1), pin3 (output 1) will go high (to about 1.4V
lower than Vs ) if a logic low is applied to pin 2, pin 3 will go low (to about 1.2V above
ground) when pin 1 is taken to logic low, the two channels are disabled , which means
that the outputs effectively disconnected from the circuit.
Motor Operation Based On Driver

INPUT1/OUTPUT1

INPUT2/OUTPUT2

OPERATION

Motor will not move

Motor moves in
clockwise Direction

Motor moves in
anticlockwise Direction

Motor will not move

Motor Operation Based On Driver


In this way the DC motor is rotated in clockwise and anti clockwise direction so that the
lift can be moved from floor to floor in both directions.
7.3.1 Features: Output Current 1A per channel
Peak output current 2A per channel
Inhibit facility
High Noise Immunity
Separate Logic supply
Over Temperature Protection
7.3.2Technical Details:
Maximum Voltage Supply(VSS): 36V

Maximum Input Voltage(VC): 7V

Maximum Peak output current: 2A

Total Power Dissipation: 5W at 800C

Input Low Voltage: -0.3 to 1.5V

Input high voltage: 2.3 to 7V

Low Voltage Input Current :-10 A

High Voltage Input current: 100 A

5.1 ABOUT KEIL:


Keil Software provides you with software development tools for the 8051
family of microprocessors. With the Keil tools, you can generate embedded
applications for multitude of 8051 derivatives. Throughout this project we refer
to these tools as the 8051 development tools. However, they support all
derivatives and variants of the 8051microcontrollerFamily.
The Keil Software 8051 development tools listed below are the programs
used to compile your C code, assemble your assembler source files, link your
program together, create HEX files, and debug your target program.

Vision2 for Windows Integrated Development Environment: combines


project Management, Source Code Editing, and Program Debugging in one
powerful environment.

C51 ANSI Optimizing C Cross Compiler: creates relocatable object


modules from your C source code,


A51 Macro Assembler: creates re locatable object modules from your
8051 assembler source code,

BL51 Linker/Locator: combines relocatable object modules created by the


compiler and assembler into the final absolute object module,

LIB51 Library Manager: combines object modules into a library which may
be used by the linker,

OH51 Object-HEX Converter: creates Intel HEX files from absolute object
modules,

RTX-51 real-time operating system: simplifies the design of complex, time


critical software projects.
They are designed for the professional software developer, but any level of
programmer can use them to get the most out of the 8051 hardware.
5.2 GETTING STARTED AND CREATING APPLICATIONS:
EVALUATION KITS AND PRODUCTION KITS:
Keil Software provides two types of kits in which our tools are delivered.
The EK51 Evaluation Kit includes evaluation versions of our 8051 tools along
With this users guide. The tools in the evaluation kit let you generate these
applications up to 2 Kbytes in size. You may use this kit to evaluate for the
effectiveness of our 8051 tools and to generate small target applications.
The 8051 Production Kits discussed in Product Overview topic section,
include the unlimited versions of our 8051 tools along with this users guide and
the full manual set. The production kits also include 1 year of free technical
support and product updates
5.2.1 TYPES OF USERS:
This manual addresses three types of users:
1) Evaluation users
2) New users and
3) Experienced users.
5.2.2 EVALUATION USERS:
Evaluation users are those users who have not yet purchased the software but
have requested the evaluation package to get a better feel for what the tools do
and how they perform. The evaluation package includes evaluation tools that are
limited to 2 Kbytes along with several sample programs that provide real-world
applications created for the 8051 microcontroller family. Even if you are only an
evaluation user, take the time to read this manual. It explains how to install the
software, provides you with an overview of the development tools, and
introduces the sample programs.

5.3 NEW USERS:


New users are those users who are purchasing 8051 development tools
for the first time. The included software provides you with the latest development
tool
technology, manuals, and sample programs. If you are new to the 8051 or the
tools, take the time to review the sample programs described in this manual.
they provide a quick tutorial and help new or inexperienced users quickly get
started.
5.3.1 EXPERIENCED USERS:
Experienced users are those users who have previously used the Keil
8051
development tools and is now upgrading to the latest version. The software
included with a product upgrade contains the latest development tools and
sample programs.
5.3.2 DEVELOPMENT TOOLS:
This chapter discusses the features and advantages of the 8051
development
tools available from Keil Software. We have designed our tools to help you
quickly and successfully complete your job. They are easy to use and are
guaranteed to help you achieve your design goals.
These development tools are meant for easy user under standing and
easy endurance of user. These are an integrated part of this IDE (INTEGRATED
DEVELOPMENT ENVIRONMENT)

5.4 VISION2 INTEGRATED DEVELOPMENT ENVIRONMENT:


Vision2 is a standard Windows application. Vision2 is integrated
software development platform that combines a robust editor, project manager,
and make facility. Vision2 supports all of the Keil tools for the 8051 including the
C
compiler, macro assembler, linker/locator, and object-HEX converter. Vision2
helps expedite the development process of your embedded applications by
providing the following:

Full-featured source code editor,


Device Database for pre-configuring the development tool setting,
Project manager for creating and maintaining your projects,

Integrated make facility for assembling, compiling, and linking your


embedded applications,
Dialogs for all development tool settings,
True integrated source-level Debugger with high-speed CPU and
peripheral simulator.
Advanced GDI interface for software debugging in the target hardware
and for connection to Monitor-51.
Links to development tools manuals, device datasheets & users guides.
The Vision2 debugging features are only available in the PK51 and DK51 tool
kits.

5.4.1 ABOUT THE ENVIRONMENT:


The Vision2 screen provides you with a menu bar for command entry, a
tool bar where you can rapidly select command buttons, and windows for source
files, dialog boxes, and information displays. Vision2 lets you simultaneously
open and view multiple source files.
5.4.2 MENU COMMANDS, TOOLBARS AND SHORTCUTS:
The menu bar provides you with menus for editor operations, project
maintenance, development tool option settings, program debugging, window
selection and manipulation, and on-line help. With the toolbar buttons you can
rapidly execute operations. The commands can be reached also with
configurable keyboard shortcuts. The following tables give you an overview of
the Vision2 commands and the default shortcuts.
5.4.3 C51 OPTIMIZING C CROSS COMPILER:
For 8051 microcontroller applications, the Keil C51 Cross Compiler offers a
way to program in C which truly matches assembly programming in terms of
code efficiency and speed. The Keil C51 is not a universal C compiler adapted
for the 8051. It is a dedicated C compiler that generates extremely fast and
compact code. The Keil C51 Compiler implements the ANSI standard for the C
language. Use of a high-level language such as C has many advantages over
assembly language programming:

The Vision IDE from Keil, combines project management, make facilities,
source code editing, program debugging, and complete simulation in one
powerful environment. Vision helps you get programs working faster than ever
while providing an easy-to-use development platform. The editor and debugger
are integrated into a single application and provide a seamless embedded project
development environment.

5.4.5 vision Provides Unique Features Like:

The Device Database which automatically sets the assembler, compiler,


and linker options for the chip you select. This prevents you from wasting
your time configuring the tools and helps you get started writing code
faster.
A robust Project manager which lets you create several different
configurations of your target from a single project file. Only the Keil
Vision IDE allows you to create an output file for simulating, an output file
for debugging with an emulator, and an output file for programming an
EPROM--all from the same Project file.
An integrated make facility with automatic dependency generation. You
don't have to figure out which header files and include files are used by
which source files. The Keil compilers and assemblers do that
automatically.
Interactive error correction. As you project compiles, errors and warnings
appear in an output window. You may make corrections to the files in your
project while Vision continues to compile in the background. Line
numbers associated with each error or warning are automatically
resynchronized when you make changes to the source.

The Keil 8051 Development Tools are designed to solve the complex problems
facing embedded software developers.
When starting a new project, simply select the microcontroller you use from the
Device Database and the Vision IDE sets all compiler, assembler, linker, and
memory options for you.
Numerous example programs are included to help you get started with the most
popular embedded 8051 devices.
The Keil Vision Debugger accurately simulates on-chip peripherals (IC, CAN,
UART, SPI, Interrupts, I/O Ports, A/D Converter, D/A Converter, and PWM
Modules) of your 8051 device. Simulation helps you understand hardware
configurations and avoids time wasted on setup problems. Additionally, with
simulation, you can write and test applications before target hardware is
available.
When you are ready to begin testing your software application with target
hardware, use the MON51, MON390, MONADI, or FlashMON51 Target Monitors,
the ISD51 In-System Debugger, or the ULINK USB-JTAG Adapter to download
and test program code on your target system.
5.5 ADVANTAGES:

Knowledge of the processor instruction set is not required, rudimentary


knowledge of the memory structure of the 8051 CPU is desirable (but not
Necessary).

Details like register allocation and addressing of the various memory


types and data types are managed by the compiler.
Programs get a formal structure and can be divided into separate
functions. This leads to better program structure.
The ability to combine variable selection with specific operations improves
program readability.
Keywords and operational functions can be used that more nearly
resemble the human thought process.
Programming and program test time is drastically reduced which
increases your efficiency.
The C run-time library contains many standard routines such as:
formatted output, numeric conversions and floating point arithmetic.
Existing program parts can be more easily included into new programs,
because of the comfortable modular program construction techniques.
The language C is a very portable language (based on the ANSI standard)
that enjoys wide popular support, and can be easily obtained for most
systems. This means that existing program investments can be quickly
adapted to other processors as needed.

5.6 USING KEIL:

Step1: Open the keil window and go to project in the menu and create new
project

Step2: Enter a file name for the project and save it in the required location.
Step3: Select the required device from the target.

Step4: Open a text file to write the required code

Step5: Save the text file in the required location with .asm extension

step6: Browse the required asm file and add the asm file to the target

Step7: Select the required file and build the target

Step8: Compile the code and check for any errors occurred or warnings
encountered.

Step9: If no errors and warnings occurred then go to debug mode as shown

Step10: Open the required ports from the menu-peripherals-I/O ports.

Step11: Now run the code either in step-by-step mode or single step mode and
check the Ports and other peripherals used in the code.

6.1 PROGRAMMING THE CHIP:


The chip can be programmed using INTELLIGENT UNIVERSAL
PROGRAMMER from Advantech, which connects to PCs parallel port. The
LabTool-48UXP features a 48-pin universal pin driver and an expandable
TTL pin driver, an on-board processor lets it handle todays (and tomorrows)
complicated DIP-type silicon PLDs, microprocessors and high density
memory
chips.
The LabTool-48XP is developed for both laboratory and mass-production
applications. It supports over 7000 different devices, including PAL, GAL,
CPLD, EPLD, PEEL, MAX, MACH, pLSI, microprocessors, EPROM, series
EPROM, PROM and Flash memory.
The LabTool-48XP performs device insertion and contact checks before it
programs each device. It can detect poor pin contact and incorrect insertion,
thus saving expensive chip damage due to operator error. Many EPROM
and Flash memories have a built-in device and manufacturer ID. The
LabTool-48XP can read this information, making it useful when working with
secondhand chips and devices that have had their part number removed.

6.1 Intelligent Universal Programmer


6.2 FEATURES OF IUP:

High Speed USB port interface.


Supports 5V, 3.3V & 1.8V Devices

Less that 2 seconds per M bit Programming speed

No adapter required for DIL devices up to 48-pin.

48-pin universal pin driver and current limit

Device insertion / continuity check

Supports Windows 95/98, Windows 2000, Windows XP & NT

3 years hardware warranty.

FREE software updates via the web.

Serialization for Memory and Micro's

Memory buffer H / L byte swap

Project file save and load function

User Selectable verify VCC with one or two-pass verify voltage

Automatic file format detection and conversion

Pin swapping table provided for all adapters

Universal adapters, for example one 44 pin PLCC adapter will


program 44 pin memory and micro devices.

6.3 Universal pin driver--True universal programming


The MOSFET logic controls the programmer's pin switches, so each pin
can supply Vcc, Vpp or ground. Pins can also be configured for TTL
high/low levels with pull-high/pull-low, high-speed clock and tri-state. This
advanced pin design lets you program any DIP device up to 48 pins
without an adapter. It also ensures support for the full range of silicon
technologies on the market--today and tomorrow.
6.3.1 Unbeatable programming speed
The LabTool-48's on-board intelligence reduces system overhead to a
minimum.
The LabTool-48XP can program an 32-Mbit FLASH device in less than 60
seconds. The LabTool-48UXP is very quick, making it much more
productive with today's high-density, multi-megabit memory devices.
The LabTool-48UXP is much faster than its competitors, making it much
more productive with today's high density, multi-megabit memory devices.
6.3.2 Device insertion and contact checks--No mistakes!
The LabTool-48UXP performs device insertion and contact checks before
it programs each device. It can detect poor pin contact and devices
inserted upside down or in the wrong position. This function protects your
pocketbook by preventing expensive chip damage due to operator error.
6.3.3 EPROM and Flash memory ID detection

Many EPROMs and Flash memories have a burnt-in device ID and


manufacturer ID. The LabTool-48UXP can read the device's ID to
determine its vendor and product number. This feature is especially useful
with second-user chips and devices that have had their part number
accidentally (or intentionally!) removed.
6 .4 AUTO-SENSING AND SELF-PROGRAMMING
To meet mass-production requirements the LabTool-48UXP has
implemented new patented technology in both its hardware and software.
After entering the Mass-production Mode, the production line operator
inserts a device into the ZIF socket. An LED on the LabTool-48UXP will
indicate if the device is programmed successfully and the operator simply
removes it and replaces it with a new one. No formal training is necessary
adding flexibility and saving time and money. In addition, the LabTool-48's
auto-sensing feature ensures the device has been inserted correctly and
then automatically programs the device. Furthermore, in the massproduction mode the system keyboard is automatically disabled
preventing the operator from making any inadvertent mistakes.
6.4.1 Memory buffer auto Increment
If your memory devices need individual serial numbers, the LabTool48UXP has an Auto Increment function, This simply increments the serial
numbers in the buffer each time a new device is inserted. This saves time
and money. The LabTool-48UXP has everything you need in one package:
48-pin driver, socket and complete device support library. You don't need
to order separate device libraries.
6.4.2 User-selectable verify voltage, one- or two-pass verification
The LabTool-48UXP lets you select the verify voltage after you have
programmed the device, e.g., 5 V, 5 V -10%, 5 V +10%. This feature
ensures that your device has been programmed properly, preventing
failures due to programming errors and ensuring data retention.
6.4.3 Easy operation--Get to work immediately
The programming software's easy-to-use graphical interface eliminates
your learning curve--you don't need the manual! You can simply type the
device vendor's name and part number, the software will select the proper
driver automatically; you don't need to search one by one through long
lists of devices.
6.4.4 Project file save option
You can save a configuration project file which contains the device
selection, the buffer data and all the programming setup options, This file
can be called upon at any time for future use without having to go through
the setting up procedure again.

6.4.5 Non-DIP device support through versatile converters


The LabTool-48's universal pin driver capability lets it program all 48-pin
DIP devices without DIP-to-DIP adapters, including all single-chip
microcontrollers. The market, however, offers many choices besides DIP
devices, such as PLCCs, SOPs, TSOPs, QFPs and SDIPs. We have
developed over 40 different converters to support this special-Package
devices. The LabTool-48's universal pin driver significantly reduces the
number of converters required, reducing your cost for future expansion, for
example, a single 44-pin PLCC adapter lets it program all 44-pin PLCC
devices.
6.4.6 File format conversion
JEDEC, POF, Binary, Intel HEX, Intel EXT HEX, Motorola S and HP
64000ABS
6.5 SYSTEM REQUIREMENTS
6.5.1 Operating system:
Windows: Windows 95, 98, 2000, ME, NT & XP.
Processor: 386, 486, Pentium or better.
8 MB RAM minimum, 8 MB recommended.
Hard disk with 8 MB free space.
Spare USB Port or Parallel port interface with EPP mode.
General
Dimensions: 31cm x 17 cm x 4cm, Weight:1.9Kg
Power: 100 to 240 VAC, auto-switching
Freq. range: 47 to 63 Hz
Power consumption: 25 W
Operating temperature: 5 to 45C (41 to 113F)
CE & LVD Certified

CHAPTER-8
SOFTWARE

#include<reg51.h>
void main(void)
{
unsigned int k, h;
while (1)
{
k =~P0;
h=k & 0x0F;
switch (h)
{
case 0x02:
{
P2=0x89;
break;
}
case 0x08:
{
P2=0x86;

break;
}
case 0x04:
{
P2=0x85;
break;
}
case 0x06:
{
P2=0x8A;
break;
}
case 0x05:
{
P2=0x00;
break;
}
}
}
}

CONCLUSION
The Project CELL PHONE OPERATED LAND ROVER USING 8051
MICROCONTROLLER is used to control the Robot in Remote areas also.
Conventionally, wireless-controlled robots use RF circuits, which have the drawbacks of
limited working range, limited frequency range and limited control. Use of a mobile
phone for robotic control can overcome these limitations. It provides the advantages of
robust control, working range as large as the coverage area of the service provider, no
interference with other controllers and up to twelve controls.
In this project, the robot is controlled by a mobile phone that makes a
call to the mobile phone attached to the robot. In the course of a call, if any button is
pressed, a tone corresponding to the button pressed is heard at the other end of the call.
This tone is called dual-tone multiple-frequency (DTMF) tone. The robot perceives this

DTMF tone with the help of the phone stacked in the robot and operates. The proposed
robo can further be extended by utilizing the 3G features which can be used to monitor
the robots action by simply making a call.

By kiran