You are on page 1of 74

SUMMER TRAINING PROJECT

REPORT
on

BY:

CHETNA SACHDEVA

PLC EN. NO.:752


JANUARY,2011
ACKNOWLEDGEMENT

First and foremost, I express my gratitude to my teacher Mr. B.P. Arun,


PLC Institute of Electronics, also our supervisor for his teaching and
consistent guidance at each and every step of my project. Without his
push and direction, this project would not have been completed.

Next, I thank Mr. Amit and Mr. Vimal, workshop assistants at PLC
Institute of Electronics for the vital practical assistance they rendered. I
am thankful to them especially for their consummate help in arranging
whatever I required for the project.

Lastly, I wish to express my sincere thanks to all my colleagues, friends


and family who helped me directly or indirectly in the completion of this
project.

Date: 16th November,2010


CERTIFICATE

This is to certify that CHETNA SACHDEVA, student of B.Tech


(Electronics and Communication Engineering) from MAHARAJA
SURAJMAL INSTITUTE OF TECHNOLOGY, GURU GODIND
SINGH INDRAPRASTHA UNIVERSITY has undergone 6 weeks of
training on EMBEDDED AND ROBOTICS using the 8051
microcontroller, from 6TH June 2010 to 25TH July 2010 under the
guidance of Mr. B.P.Arun, at the PLC Institute of Electronics.

Signature of Supervisor: _________________

Name of Supervisor: Mr.B.P. Arun

Date:
INTRODUCTION

We are living in the Embedded World. We are surrounded with many


embedded products and our daily life largely depends on the proper
functioning of these gadgets. Television, radio, CD player of our living
room, washing machine or microwave oven in our kitchen, card readers,
access controllers, palm devices of our work space enable us to do many
of our tasks very effectively. Apart from all these, many controllers
embedded in our car take care of car operations between the bumpers
and most of the times we tend to ignore all these controllers.

Theoretically, an embedded controller is a combination of a piece of


microprocessor based hardware and the suitable software to undertake a
specific task.

These days designers have many choices in microprocessors and


microcontrollers. Especially, in 8 bit and 32 bit, the available variety
really may overwhelm even an experienced designer. Selecting a right
microprocessor may turn out as the most difficult first step and it is
getting complicated as new devices continue to pop-up.

I have used 8051 microcontroller for my project, the very basic one.
Atmel’s AT89S52 is the most widely used in this category. This has
been used in my project.
TABLE OF CONTENTS

1. INTRODUCTION TO EMBEDDED SYSTEMS

2. INTRODUCTION TO 8051 MICROCONTROLLER

3. INTRODUCTION TO PROJECT

4. MECHANICAL AND ELECTRICAL STRUCTURE

5. ELECTRONICS STRUCTURE
5.1 8051 Microcontroller Module
5.2 DTMF Module
5.3 H-Bridge Module

6. SOFTWARE STRUCTURE
6.1 Installation and Usage of IDE software
6.2 Installation and Usage of PLC Burner
6.3 Program Code
6.4 Hardware Tools Used for Installation

7. BIBLIOGRAHY
EMBEDDED SYSTEMS

What is an Embedded System?

An embedded system is a computer system designed to perform one or a


few dedicated functions, often with real-time computing constraints. It is
embedded as part of a complete device often including hardware and
mechanical parts. In contrast, a general-purpose computer, such as a
personal computer, is designed to be flexible and to meet a wide range
of an end-user's needs. Embedded systems control many of the common
devices in use today.
Embedded systems are controlled by a main processing core that is
typically either a microcontroller or a digital signal processor (DSP).
Since the embedded system is dedicated to specific tasks, design
engineers can optimize it reducing the size and cost of the product and
increasing the reliability and performance. Some embedded systems are
mass-produced, benefiting from economies of scale.
Physically, embedded systems range from portable devices such as
digital watches and MP3 players, to large stationary installations like
traffic lights, factory controllers, or the systems controlling nuclear
power plants. Complexity varies from low, with a single microcontroller
chip, to very high with multiple units, peripherals and networks mounted
inside a large chassis or enclosure.
In general, "embedded system" is not an exactly defined term, as many
systems have some element of programmability. For example, handheld
computers share some elements with embedded systems such as the
operating systems and microprocessors which power them, but are not
truly embedded systems, because they allow different applications to be
loaded and peripherals to be connected.
ROBOTICS AND AUTOMATION

Robot
A robot is a virtual or mechanical artificial agent. In practice, it is
usually an electro-mechanical machine which is guided by computer or
electronic programming, and is thus able to do tasks on its own. Another
common characteristic is that by its appearance or movements, a robot
often conveys a sense that it has intent or agency of its own. In simple
terms, it is a machine associated with mechanical motion.
For example, washing machine, bikes, CD-ROM of a PC etc. are all
robots.
Robotics
The study of robots is robotics. Technically, robotics is the engineering
science and technology of robots, and their design, manufacture,
application, and structural disposition. Robotics is related to
electronics, mechanics, and software. Therefore, it is sometimes termed
as Mechatronics.
Automation
Automation is the use of technologies to reduce the need for human
work in the production of goods and services. Robotics is one of the
many ways to achieve this. The use of robots offers many advantages
such as reduced risk, increased accuracy and increased productivity.
MICROPROCESSOR VS
MICROCONTROLLER

Microprocessor and microcontroller are two popular terms in world of


computer. However, microprocessor and microcontroller has different
functions and features. These differences are explained below.

S.No. Microprocessor Microcontroller


1. Microprocessors generally Microcontrollers incorporate
require external program memory, RAM
components or circuits to memory and input/output
implement program port into one chip.
memory, RAM memory
and Input/output.
2. Microprocessors tend to be Microcontrollers are usually
designed to perform a wider designed to perform a small
set of general purpose set of specific functions, for
functions, for example, example as in the case of a
microprocessor in a PC Automatic Braking System
performs a wide range of which performs a small set of
tasks related to the general input processing function to
requirements of a PC such regulate the brakes on all four
as performing the necessary wheels.
calculations for a very wide
set of software applications,
performing Input/Output
for the main subsystems,
peripheral control and etc.

3. Intel's 8085, 80386,8089 Microchip's PIC series and


and Pentium are examples Atmel's AVR series, and
of microprocessors. AT89S52 etc are examples of
microcontrollers.
8051 MICROCONTROLLER

The 8051 is the first microcontroller of the MCS-51 family introduced


by Intel Corporation at the end of the 1970s. The 8051 family with its
many enhanced members enjoys the largest market share, estimated to
be about 40%, among the various microcontroller architectures. The
architecture of the 8051 family of microcontrollers is referred to as the
MCS-51 architecture, or sometimes simply as MCS-51. The
microcontrollers have an 8-bit data bus. They are capable of addressing
64K of program memory and a separate 64K of data memory. The 8051
has 4K of code memory implemented as on-chip Read Only Memory
(ROM). The 8051 has 128 bytes of internal Random Access Memory
(RAM). It has two timer/counters, a serial port, 4 general purpose
parallel input/output ports, and interrupt control logic with six sources of
interrupts. Besides internal RAM, the 8051 has various Special Function
Registers (SFR), which are the control and data registers for on-chip
facilities.
COMPARISON OF 8051 FAMILIES

Features 8031 8051 8052 89C1051 89C2051 89C4051


Total Pins 40 40 40 20 20 20
I/O Pins 32 32 32 15 15 15
ROM 0KB 4 KB 8 KB 1 KB 2 KB 4 KB
(in KB)
RAM 128 128 256 128 128 128
(in bytes)

Interrupt 6 6 8 6 6 6
Sources

Timers 2 2 3 2 2 2

Serial Port 1 1 1 1 1 1

DIFFERENCE BETWEEN 89C AND 89S SERIES


In 89C Series of microcontrollers, serial programming is used while in
89S Series of microcontrollers, parallel programming is used.
Parallel programming is faster than serial programming but requires a
larger number of wires. Since I was not very much concerned with the
speed of programming, I chose the 89S series.
BLOCK DIAGRAM OF 8051
MICROCONTROLLER
PIN DIAGRAM OF 8051 MICROCONTROLLER

PIN DESCRIPTION
PIN 9: PIN 9 is the reset pin which is used to reset the microcontroller’s
internal registers and ports upon starting up.

PINS 18 & 19: 8051 has a built-in oscillator amplifier. Hence, we need
to only connect a crystal at these pins to provide clock pulses to the
circuit.

PIN 40 and 20: Pins 40 and 20 are VCC and Ground respectively. The
8051 chip needs +5V, 500mA to function properly.
PIN 29: It is called PSEN. This is "program select enable". This pin is
used for parallel programming.

PIN 30: PIN 30 is called ALE (address latch enable), which is used
when multiple memory chips are connected to the controller and only
one of them needs to be selected. This pin is high when address needs to
be given to ports P0 and P2, otherwise for data it is kept low.

PIN 31: It is called EA(External Access). If external memory is


connected, then it should be connected to ground to indicate the
presence of external memory(RAM/ROM).

Ports
There are four 8-bit ports: P0, P1, P2 and P3.
PORT P1 (Pins 1 to 8): The port P1 is a general purpose input/output
port which can be used for a variety of interfacing tasks. The other ports
P0, P2 and P3 have dual roles or additional functions associated with
them based upon the context of their usage.

PORT P3 (Pins 10 to 17): PORT P3 acts as a normal I/O port, but Port
P3 has additional functions such as, serial transmit and receive pins, 2
external interrupt pins, 2 external counter inputs, read and write pins for
memory access.

PORT P2 (Pins 21 to 28): PORT P2 can also be used as a general


purpose 8-bit port when no external memory is present, but if external
memory access is required then PORT P2 will act as an address bus in
conjunction with PORT P0 to access external memory. PORT P2 acts as
A8-A15.

PORT P0 (pins 32 to 39): PORT P0 can be used as a general purpose


8-bit port when no external memory is present, but if external memory
access is required then PORT P0 acts as a multiplexed address and data
bus that can be used to access external memory in conjunction with
PORT P2. P0 acts as AD0-AD7.
INSTRUCTION SET OF 8051

• ACALL: Absolute Call


• ADD, ADDC: Add Accumulator (With Carry)
• AJMP: Absolute Jump
• ANL: Bitwise AND
• CJNE: Compare and Jump if Not Equal
• CLR: Clear Register
• CPL: Complement Register
• DA: Decimal Adjust
• DEC: Decrement Register
• DIV: Divide Accumulator by B
• DJNZ: Decrement Register and Jump if Not Zero
• INC: Increment Register
• JB: Jump if Bit Set
• JNZ: Jump if Accumulator Not Zero
• JZ: Jump if Accumulator Zero
• LCALL: Long Call
• LJMP: Long Jump
• MOV: Move Memory
• JBC: Jump if Bit Set and Clear Bit
• JC: Jump if Carry Set
• JMP: Jump to Address
• JNB: Jump if Bit Not Set
• JNC: Jump if Carry Not Set
• MUL: Multiply Accumulator by B
• NOP: No Operation
• ORL: Bitwise OR
• POP: Pop Value From Stack
• PUSH: Push Value Onto Stack
• RET: Return From Subroutine
• RETI: Return From Interrupt
• RL: Rotate Accumulator Left
• RR: Rotate Accumulator Right
• SETB: Set Bit
• SJMP: Short Jump
• SUBB: Subtract From Accumulator With Borrow
• SWAP: Swap Accumulator Nibbles
• XCH: Exchange Bytes
• XCHD: Exchange Digits
• XRL: Bitwise Exclusive OR
OBJECTIVE

The objective of this project is to design a Cellphone Controlled Robotic


Car. It is based on the technology DTMF, abbreviated for 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 dialing is known as touch
tone. DTMF assigns a specific frequency (consisting of two separate
tones) to each key so that it can easily be identified by the electronic
circuit.
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 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 tone (DTMF). Based on this tone received the robot takes the
appropriate action.
The received tone is processed by the AT89S52 microcontroller with the
help of DTMF decoder IC8870. The decoder decodes the DTMF tone in
to its equivalent binary digit and this binary number is sent to the
microcontroller, the microcontroller is preprogrammed to take a decision
for any given input and outputs its decision to motor drivers in order to
drive the motors for forward or backward motion or a turn. The
microcontroller in this project is programmed as follows:
On pressing 2, the robot will move forward.
On pressing 4, the robot will move left.
On pressing 6, the robot will move right.
On pressing 8, the robot will move backwards.
On pressing 5, the robot will stop.
SNAPSHOT OF THE PROJECT

8051 Module
Wheel

H-Bridge
Module

DTMF Cellphone
Module
LIST OF COMPONENTS AND TOOLS

The mechanical components used, their quantity and dimensions are


listed below.

S.No. Component Quantity Dimension


1. Chassis 1 L X B(in inches)
8X5
2. Wheel 4 Diameter(in cm)
7
3. Nut 12 2 inches long

4. Bolt 12 As per dimension


of nut
5. Clamps 4 As per size of
motors
6. Cellphone 1 ---------

The following tools were used to assemble the mechanical components.

S.No. Tool
1. Drilling Machine
2. Screw Driver
3. Hammer
Chassis
The sheet used for switches in household switching boards has
been used as the chassis of the robot.
The height of the robot is so adjusted that the wheels uniformly
touch the ground in order to make a smooth moving.

Wheels
The wheels are mechanically connected to the D.C. motors in
order to make the robot move.
The wheels are made up of rubber in order to increase the friction.

Nuts and Bolts


Nuts and bolts are used in order to mechanically couple the D.C.
motors and wheels to the base of the robot.

Clamps
The clamps are used in order to hold the D.C. motors. The clamps
provide efficient grip to the motors so that motors do not change
position while the robot is moving.
SELECTION OF MATERIAL

Selection of material is an important activity while making a project as it


decides how powerful and useful the project will be. The material is
selected as per the requirement of the project, how and where it is
intended to use. The reasons for selecting the material I have used in my
project are listed below:
1. I selected a chassis of dimension 8 inches X 5 inches because too
large a chassis causes the robot to topple and causes difficulty in
controlling it. Too small a chassis would not be able to accommodate all
the modules used and the cellphone required to operate the robot.
Therefore, an optimum size was selected.
2. I selected 12V, 200rpm Geared DC Motors, which is enough to drive
my robot. The speed these motors provide is an optimum one and hence
the selection.
3. The wheels were selected very carefully as I wanted the ones that do
not wear out easily so that I can drive my robot in almost all conditions.
ELECTRICAL ACTUATORS

DESCRIPTION OF A MOTOR
In any electric motor, operation is based on simple
electromagnetism. A current-carrying conductor generates a
magnetic field; when this is then placed in an external magnetic
field, it will experience a force proportional to the current in the
conductor, and to the strength of the external magnetic field.

Every DC motor has six basic parts -- axle, rotor (or armature),
stator, commutator, field magnet(s), and brushes. In most common
DC motors), the external magnetic field is produced by high-
strength permanent magnets1. The stator is the stationary part of
the motor -- this includes the motor casing, as well as two or more
permanent magnet pole pieces. The rotor (together with the axle
and attached commutator) rotates with respect to the stator. The
rotor consists of windings (generally on a core), the windings
being electrically connected to the commutator. The above
diagram shows a common motor layout -- with the rotor inside the
stator (field) magnets.
The geometry of the brushes, commutator contacts, and rotor
windings are such that when power is applied, the polarities of the
energized winding and the stator magnet(s) are misaligned, and the
rotor will rotate until it is almost aligned with the stator's field
magnets. As the rotor reaches alignment, the brushes move to the
next commutator contacts, and energize the next winding. Given
our example two-pole motor, the rotation reverses the direction of
current through the rotor winding, leading to a "flip" of the rotor's
magnetic field, driving it to continue rotating.

SPECIFICATION OF DC MOTOR
The electrical actuators used in the project are Geared DC Motors.
Their specification is as under.

Electrical Quantity Voltage Speed


Actuators Rating
Geared DC 4 12V 200rpm
Motor

ASSEMBLING AND TROUBLESHOOTING


1. The D.C. Motors are mechanically coupled to the base of the
robot using clamps. The grip of the motor to the clamp should be
and there should not be any loose bolting.
2. Wheels are mechanically coupled with the motors.
3. All the nuts and bolts must be tightly fitted after mechanical
coupling of motors and wheels.
MODULES USED

The following three modules have been used in the project:

S.No. MODULE NAME BRIEF DESCRIPTION


1. 8051 Module Brain of the Robo Car

2. DTMF Module Interprets signals from


mobile
3. H-Bridge Module Motor driver circuit

These modules are described in detail in the next sections.


8051 MODULE
The 8051 module is the BRAIN OF THE ROBOT. Further description
of the module is as follows.

SNAPSHOT Diodes 33 pF Capacitor

7805 Voltage
LED
Regulator

Pin
10 microF Connectors
Capacitors (Port0)

Port1

10K
Resistor
Port2

Port3

11.0592 MHz IC AT89S52


Crystal Oscillator on 40 Pin IC Base
It refers to the 0th pin of the port.

CIRCUIT DIAGRAM
LIST OF COMPONENTS

S.No. Component Quantity


1. Zero PCB 1
2. IC AT89S52 1
3. 40 Pin IC Base 1
4. 1N4007 Diodes 4
5. 11.0592MHz Quartz Crystal 1
6. 33 pF Capacitor 2
7. 10 microF Capacitor 2
8. 7805 Voltage Regulator 1
9. 1K Resistor 1
10. 5V Power Supply 1
11. LEDs 1
12. Pin Connectors As per
requirement

LIST OF TOOLS AND MATERIAL

S.No. Tool/Material
1. Soldering Machine
2. Solder Wire (flux)
3. Cutter
4. Tin Wire
TESTING AND DEBUGGING
This module was tested using the I/O Cards, USB Cables and PLC
Burner Kit. The following problems were faced during the course of
testing and were corrected accordingly.

1. On providing ground, the supply was getting OFF. This was due
to short-circuiting, which was removed using soldering machine.

2. Some ports were not showing any response on the I/O Cards.
This was due to short-circuiting of port pins, which was removed.

After the removal of above problems, the module worked properly and
was ready to be used in the project.
DTMF MODULE

This module has been used to decode the signals received from the
cellphone and to pass these decoded signals to the 8051 module,
which then acts accordingly. Further description of the module is as
follows.

BRIEF DESCRIPTION
Dual-tone multi-frequency (DTMF) signaling is used for
telecommunication signaling over analog telephone lines in the
voice-frequency band between telephone handsets and other
communications devices and the switching center. DTMF, also
known as touch-tone, are the audible sounds you hear when you
press keys on your phone.
The DTMF keypad is laid out in a 4 X 3 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 for each of the two frequencies (697 and 1209
hertz (Hz)). 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.

1209 Hz 1336 Hz 1447 Hz


697 Hz 1 2 3
770 Hz 4 5 6
852 Hz 7 8 9
941 Hz * 0 #
SNAPSHOT

Mica capacitor 22pF Capacitors


3.5791 MHz
Crystal
Oscillator

LEDs

Resistors

1K Resistors IC8870
on
18 Pin IC Base

CIRCUIT DIAGRAM
LIST OF COMPONENTS

S.No. Component Quantity


1. Zero PCB 1
2. IC 8870 1
3. 18 Pin IC Base 1
4. 3.5791MHz Crystal 1
Oscillator
5. 22 pF Capacitors 2
6. 1K Resistors 6
7. 10K Resistors 1
8. 22K Resistors 2
9. 100K Resistor 1
10. 320K Resistors 1
11. 5V Power Supply 1
12. LEDs 6
13. Pin Connectors As per
requirement

LIST OF TOOLS AND MATERIAL

S.No. Tool/Material
1. Soldering Machine
2. Solder Wire (flux)
3. Cutter
4. Tin Wire
TESTING AND DEBUGGING
This module was tested using a cellphone, whose earphones were
connected to the two input pins of the module. The following problems
were faced during the course of testing and were corrected accordingly.

1. Initially, on giving power supply the LED was not glowing and
I inferred that module is not receiving power. But later on it was
found that LED was defective, which was thus changed.

2. The module was not decoding the signals sent to it. It was due to
a missing connection and minor short-circuiting. It was corrected.

After the removal of above problems, the module worked properly and
was ready to be used in the project.
H-BRIDGE MODULE

This module is the motor driver circuit. It drives the motors


forward or backward on the basis of signals received from the
8051 module. Further description of the module follows.

BRIEF DESCRIPTION
An H-bridge is an electronic circuit which enables a voltage to be
applied across a load in either direction. These circuits are often used in
robotics and other applications to allow DC motors to run forwards and
backwards. H-bridges are available as integrated circuits, or can be built
from discrete components.

The H-Bridge arrangement is generally used to reverse the polarity of


the motor, but can also be used to 'brake' the motor, where the motor
comes to a sudden stop, as the motor's terminals are shorted, or to let the
motor 'free run' to a stop, as the motor is effectively disconnected from
the circuit.
The L293D is a quadruple half H-bridge bidirectional motor driver IC
that can drive current of up to 600mA with voltage range of 4.5 to 36
volts. It is suitable to drive small DC-Geared motors, bipolar stepper
motor etc.
SNAPSHOT

Power LED 5V LED


1K Resistor 12V 0V 5V

10K
Resistors

Pin
Connectors

Control Inputs

Motor
Inputs IC L293D
On
16 Pin IC Base

CIRCUIT DIAGRAM

 Basic Circuit Diagram of H-Bridge


 Circuit Diagram using ICL293D

The ICL293D has two internal H-Bridges.


LIST OF COMPONENTS

S.No. Component Quantity


1. Zero PCB 1
2. IC L293D 1
3. 16 Pin IC Base 1
4. 10K Resistors 4
5. 1K Resistors 2
6. 5V Power Supply 1
7. 12V Power Supply 1
8. LEDs 2
9. Pin Connectors As per
requirement

LIST OF TOOLS AND MATERIAL

S.No. Tool/Material
1. Soldering Machine
2. Solder Wire (flux)
3. Cutter
4. Tin Wire
TESTING AND DEBUGGING
This module was tested using DC Motors. The following problems were
faced during the course of testing and were corrected accordingly.

1. The module was not able to drive the motors as there was a
wrong connection, which was corrected by removing the soldering
first and then inserting a jumper.

After the removal of the above problem, the module worked properly
and was ready to be used in the project.
ASSEMBLING AND WORKING

All the above described modules are assembled to get the final project.
The final circuit diagram is as shown below.
WORKING OF THE ROBOT

The robot works as follows.

1. The modules are assembled as shown and power supply is given to


the robot.

2. A call is made to the cellphone attached to the robot, which is kept on


Auto Answer mode. Once the call is accepted, the robot can be
controlled by the cellphone that made a call to the robot.

3. In the course of the call, when a key is pressed the corresponding tone
is heard at the cellphone attached to the robot. This tone is sent to
DTMF Decoder(IC 8870) for decoding.

4. The decoded signals from this module are sent to 8051 module
(AT89S52) for interpretation. The microcontroller takes the decision on
this basis and passes signals to the motor driver circuit (L293D) to make
the motors turn accordingly.

5. The motors turn based on the signals received from the 8051 module
and thus, the robot moves in the desired direction with the help of
wheels attached to the motors.
FLOWCHART

START

A  P3

CMP with MOVE


“02” FORWARD

MOVE
CMP with
BACKWARD
“08” DD

CMP with
MOVE LEFT
“04”

CMP with MOVE


“06” RIGHT

CMP with
“05” STOP
INPUT/OUTPUT PIN DESCRIPTION

Port3 has been used as the Input Port and Port0 as the Output Port
in the project. Five pins of port3 (from P3.0 to P3.4) are required
to receive signals from the DTMF decoder. Four pins of port0
(from P0.0 to P0.3) are required to pass interpreted signals to the
motor driver circuit.
Port3 receives the decoded signals from DTMF Decoder and the
microcontroller interprets them and sends the output signals to
Port0. The motor driver circuit receives signals from this port and
accordingly controls the rotation of motors and wheels leading to
the desired movement of the robot.
The signals received at the input port as per the desired movement
of the robot and the signals passed onto the output port based on
the interpretation are depicted in the table below.

Robot Input Pins Output Pins


Movement P3.4 P3.3 P3.2 P3.1 P3.0 P0. P0.2 P.1 P0.0
3
Forward 1 0 0 1 0 1 0 1 0
Backward 1 1 0 0 0 0 1 0 1
Left 1 0 1 0 0 1 0 0 1
Right 1 0 1 1 0 0 1 1 0
Stop 1 0 1 0 1 1 1 1 1
0: High

1: Low
PROGRAM

Assembly Language Program Code

ORG 00H

MAIN: MOV A,P3

CJNE A,#11110010B,NXT
AJMP FWD

NXT: CJNE A,#11111000B,NXT1


AJMP BWD

NXT1: CJNE A,#11110100B,NXT2


AJMP LEFT

NXT2: CJNE A,#11110110B,NXT3


AJMP RIGHT

NXT3: CJNE A,#11110101B,MAIN


AJMP STOP

FWD: MOV P0,#11111010B


AJMP MAIN

BWD: MOV P0,#11110101B


AJMP MAIN

LEFT: MOV P0,#11111001B


AJMP MAIN

RIGHT: MOV P0,#11110110B


AJMP MAIN

STOP: MOV P0,#11111111B


AJMP MAIN
TOOLS USED

SOFTWARE TOOLS

The following software was used for the development of the


project:

1. 8051IDE

2. PLCIE Burner

Plc_8051.exe

8051IDE is used for writing the program code in Assembly


Language.

PLCIE Burner is used to burn the program on the


microcontroller.
8051IDE

INSTALLATION OF THE SOFTWARE

1. Open the contents of the CD. The following window will appear.
2. Double click on 8051. The following window will be displayed.

3. Double click on ”setup”. The installation window appears.


4. Click on “Next” and provide the user name and company name.

5. Again click on “Next” and installation window will appear.


6. Click on “Install” and the installation process will start.
7. Click on “Finish”. The installation completes here and the software is
ready to use.

1
3
2
2
1

USAGE OF THE SOFTWARE

The sample IDE window is shown below.

5
3

4
1. Window 1 is the main window where the program is written.
2. Window 2 shows the output window, which on the execution of the
program shows the errors occurred, warnings encountered and other
similar data. This is selected by pointing to ‘view’ ‘output’.
3. Window 3 shows the registers used along with their values. For
dynamic variation of these values and reflecting their values in the
memory, one needs to ‘Simulate’. This is selected by pointing to
‘view’ ‘Registers’.
4. Window 4 shows Port Window which shows the values acquired by
the ports. This window is also useful when simulating. This is
selected by pointing to ‘view’ ‘Ports’.
5. Window 5 shows the values of important internal variables including
Timers, TMOD, IE etc.

On writing the program in the program window, the program is


compiled (converted to .HEX file) by selecting ‘Assemble’
‘Assemble’. The errors, if any, as mentioned above, will be shown on
the output window.
On assembling the program, in the folder containing the file, the
following files are created:
FIL FIL FIL FIL
E1 E2 E3 E4

1. File 1 is a .ASM file and is the file in which you have written your
program.
2. File 2 is a .HEX file
3. File 3 is a shortcut to the .ASM file
4. File 4 is a .LST which contains all the commands, important
definitions of the labels and the addresses of each command.
PLC BURNER 51

INSTALLATION OF THE SOFTWARE


1. Open the contents of the CD and extract files to desktop.

2. Connect the development kit with the PC.


3. Select ‘Advanced’ option in the window that appears and click
on Next.

4. Specify the path of the drivers and click on Next.


5. The installation window appears and installation
starts.

6. Click on Finish. Installation completes here.


USAGE OF SOFTWARE

The sample window of PLCIE Burner is as shown.


The following steps describe how to use this software to burn a program
to AT89S52 microcontroller.
First of all, select the chip AT89S52 by clicking on “Chip” and then
selecting AT89S52 from the drop-down menu.

Then follow the following steps to burn the program.


1. Click on Open. A window will appear. Select the .HEX file you
wish to burn on the microcontroller and click Open.

2. A confirmation window will appear. Click OK.


3. Click on Write. The burning process will start. On
completion click Close.
HARDWARE TOOLS USED FOR BURNING
The following tools were used to burn the Assembly
Program on the microcontroller chip and testing it.

1. I/O Cards(2)

2. USB Cable and Connectors


3. PLC Burner Kit

Reset Switch
Power Section

ISP

LCD
Interface
USB
Input
BIBLIOGRAPHY

1. “8051 MICROCONTROLLER AND EMBEDDED SYSTEMS”


by Muhammad Ali Mazidi, Janice Ali Mazidi, Rolin D. Mckinley
2. “8051 MICROCONTROLLER” by K.J AYALA
3. en.wikipedia.org
4. www.8051tutorial.com
5. www.ikalogic.com

You might also like