INDEX
CONTENTS
PAGE NO
3.1.2 Architecture
3.1.3 Pin Description
3.4
3.5
3.6
Conveyor Belt
Robotic ARM
Controller
5. CONCLUSION
6. BIBILOGRAPHY
Overview:
Industries such and packaging and manufacturing unit with multiple and large scale
manufacturing may often require systems to guide the designed product to the next unit like the
assembling or the building or the packing etc. There are also cases where these designed
products have to be counted. In either of these cases or both we would be in need of conveyors.
Our project will be designed and implemented according to the requirement of the unit or can be
configured according to the existing set up of the factory.
Implementation:
In our project we will have two parallel conveyor belt unit running around a constant
speed. Now on both of the sides it will be enable with two robotic arm units. These are capable
of rotating both horizontally and vertically 360 degrees. Now the first unit will be placing the
object and the second unit will be receiving the object. In order to make the execution of the
system smooth we have a bit of electronics involved in it. We may use either a 555 timer ic or a
small range microcontroller to control or to synchronize the movements of both the units. The
system can also be enhanced to count the number of objects with modification in the circuitry.
This project will be reducing the stress of packing units and can be used in wide range of
industries like the molding, packing, assembling, drying and much more.
Components used:
1.
2.
3.
4.
5.
Conveyor belt
Motor
Motor drivers
Robotic arms
Power supply units
SYSTEM DESIGN:
ROBOT
IC
ARM 1
CONVEYOR BELT 1
CONTROL
UNIT
CONVEYOR BELT 2
ROBOT
IC
ARM 2
POWER
SUPPLY
MICRO
CONTROLLER
MOTOR
DRIVER
S
RF
RECEIVER
ROBOTIC
ARM 2
ROBOTIC
ARM 1
Belt Conveyor
The belt conveyor is an endless belt moving over two end pulleys at fixed positions and
used for transporting material horizontally or at an incline up or down. The main components of
a belt conveyor are.
1. The belt that forms the moving and supporting surface on which the conveyed material
rides. It is the tractive element. The belt should be selected considering the material to
be transported.
2. The idlers, which form the supports for the carrying and return stands of the belt.
3. The pulleys that support and move the belt and controls its tension.
4. The drive that imparts power to one or more pulleys to move the belt and its loads.
The structure that supports and maintains the alignments of the idlers and pulleys and support
the driving machinery
Conveyor belts are widely used in mineral industry. Underground mine transport, opencast mine
transport and processing plants deploy conveyor belts of different kinds to adopt the specific job
requirements. The main advantages of conveyor belt system are:
1. A wider range of material can be handled which pause problems in other transportation
means. Belt conveyor can be used for abrasive, wet, dry, sticky or dirty material. The lump
size of the transported material is limited by the width of the belt. Belts up to 2500 mm wide
are used in mining industry.
2. Higher capacity can be handled than any other form of conveyor at a considerably lower cost
per tonne kilometre. Conveyor belts with capacity of 11000t/h and even higher can be
deployed to match with higher capacity mining machinery.
3. Longer distances can be covered more economically than any other transportation system. A
single belt conveyor or a series of belt conveyors can do this. Belt conveyors can be adopted
for cross-country laying.
4. By the use of many forms of ancillary equipment such as mobile trippers or spreaders bulk
material can be distributed and deposited whenever required.
5. Many other functions can be performed with the basic conveying like weighing, sorting,
picking, sampling, blending, spraying, cooling, drying etc.
6. Structurally it is one of the lightest forms of conveying machine. It is comparatively cheaper
and supporting structures can be used for many otherwise impossible structures such as
crossing rivers, streets and valleys.
7. The belt conveyor can be adopted for special purposes (fire resistant, wear resistant, corrosion
resistant, high angle negotiation etc.) and can be integrated with other equipment.
8. It can be horizontal, incline or decline or combination of all.
9. Minimum labour is required for the operation and maintenance of belt conveyor system.
10.
In underground mine transport, belt conveyor can be used in thin seams as it eliminates
the rock works that might otherwise be required to gain haulage height. Moreover, belt
conveyor can provide continuous haulage service from pit bottom to the surface.
Level or inclined Conveyor receiving material at tail end and discharging at head end.
Level Conveyor receiving material at any point through travelling Hopper and discharging at
head end.
Level and inclined Conveyor receiving material at and near tail end, having vertical curve to
incline, and discharging at head end.
Level and inclined Conveyor with chute. Material received from bins too close to elevated head
end to permit use of vertical curve.
Inclined and level Conveyor receiving material at tail end and discharging from level section
through a movable Tripper.
Level Conveyor on raised structure with double-wing Tripper forming storage piles on both sides
of Conveyor.
Inclined Conveyor receiving material at tail end and discharging at several points through a
series of fixed Trippers.
Skirt clamps,
Skirt clamps are used for eliminating loading point spillage at the conveyor loading and transfer
points. The skirt rubber used for this should be selected considering its hardness with respect to
the top cover of the belt. As it will be requiring adjustments after wear so the fixing arrangement
should be simple, easily accessible and less time consuming.
Pulley lagging
Pulley laggings are necessary for better traction and to eliminate belt slippage.
CONVEYOR BELT MAINTENANCE TOOLS
To save time and money, and to simplify routine belt maintenance procedures, proper service and
maintenance tools should be procured. Some examples are:
MULTIPLE RIVET DRIVING TOOLS
This tool is used for mechanical belt fastening.This easy-to-use, portable tool makes multiple
rivet driving simple and fast. Some tools have drive rods that can drive five rivets
simultaneously.
BELT CUTTER
Belt cutters are designed to enhance operator safety. Some belt cutters are chain-driven, doubleedged safety blade and are shielded from operator contact. Such blade can be driven from either
end of the cutter and cuts in both directions.
during starting and stopping. For variable speed conveyor belt slip monitoring consists of
a speed sensor that measures the belt speed and compares with the speed reference sent to
the drive system. When the belt speed is below 80% of the intended speed the conveyor
drive is tripped. A method to adjust and test belt slip is normally provided in the belt
control system.
4. Take-up Overtravel : Overtravel limit switches can be placed at the far extremes of the
counterweight or take up device travel. In a gravity counterweight take-up, the top
overtravel switch trip may suggest a jammed conveyor belt condition. A bottom
overtravel switch may indicate belt stretch, or a broken belt fabric flight. Excessive takeup motion during starting and stopping indicate that the type of drive control is either
inadequate or that is not working properly.
5. Transfer Chute Plug: If the conveyor transfers material through a transfer chute, the
transfer chute plug monitors blocked flow as blocked flow may damage the conveyor
belt. Under blocked condition the transfer chute plug switch trips the conveyor drive.
6. Bin Level Control: If the conveyor belt is used to fill bins or stock piles over dumping
may damage the belt. Bin level sensors protect the belt from probable beltdamage.
Simple hanging tilt switch or analogue devices like ultrasonic, radar or laser devices may
be used.
7. Pull-chord Stop Switches: These are emergency switches that can be actuated by pulling
a chord provided along the belt conveyor.
8. Rip Detectors: Rip detectors provide belt protection in case of a rip or tear of the belt.
Simple rip detector is spill switch located below the conveyor near the loading point.
There are complex rip switches available, which require periodic maintenance.
9. Fire Detection: Thermal trip switches are provided with smoke sensors, CO sensors or
fibre optic temperature sensors.
10. Dust Sprays: Water or chemical based dust suppressing system can eliminate or reduce
dust problems in certain special conveyor belt installations
Belt Controls
The belt control involves the following:
Stop/start: At single or multiple stations.
Start warning: Audible or visual signal for pre-start warning
Interlock: The sequence control between the master and slave conveyors.
Telemetry: Distribution of belt control and information over significant distance.
Lockout: Physical lockout of the all motive power sources.
HISTORY
In the earliest years of computers in the 1930-40s, computers were sometimes dedicated
to a single task, but were far too large and expensive for most kinds of tasks performed by
embedded computers of today. Over time however, the concept of programmable controllers
evolved from traditional electromechanical sequencers, via solid d
computer technology.
One of the first recognizably modern embedded systems was the Apollo Guidance
Computer, developed by Charles Stark Draper at the MIT Instrumentation Laboratory. At the
project's inception, the Apollo guidance computer was considered the riskiest item in the Apollo
project as it employed the then newly developed monolithic integrated circuits to reduce the size
and weight. An early mass-produced embedded system was the Autonetics D-17 guidance
computer for the Minuteman missile, released in 1961. It was built from transistor logic and had
a hard disk for main memory. When the Minuteman II went into production in 1966, the D-17
was replaced with a new computer that was the first high-volume use of integrated circuits. This
program alone reduced prices on quad nand gate ICs from $1000/each to $3/each, permitting
their use in commercial products.
Since these early applications in the 1960s, embedded systems have come down in price
and there has been a dramatic rise in processing power and functionality. The first
microprocessor for example, the Intel 4004 was designed for calculators and other small systems
but still required many external memory and support chips. In 1978 National Engineering
Manufacturers Association released a "standard" for programmable microcontrollers, including
almost any computer-based controllers, such as single board computers, numerical, and eventbased controllers.
CHARACTERISTIC FEATURES
Embedded systems are designed to do some specific task, rather than be a generalpurpose computer for multiple tasks. Some also have real-time performance constraints
that must be met, for reason such as safety and usability; others may have low or no
performance requirements, allowing the system hardware to be simplified to reduce costs.
Embedded systems are not always separate devices. Most often they are physically builtin to the devices they control.
The software written for embedded systems is often called firmware, and is stored in
read-only memory or Flash memory chips rather than a disk drive. It often runs with
limited computer hardware resources: small or no keyboard, screen, and little memory.
User interfaces
Embedded systems range from no user interface at all dedicated only to one task to full
user interfaces similar to desktop operating systems in devices such as PDAs.
Simple systems
Simple embedded devices use buttons, Leds, and small character- or digit-only displays, often
with a simple menu system.
CPU platforms
Embedded processors can be broken into two broad categories: ordinary microprocessors (P)
and microcontrollers (C), which have many more peripherals on chip, reducing cost and size.
Contrasting to the personal computer and server markets, a fairly large number of basic CPU
architectures are used; there are Von Neumann as well as various degrees of Harvard
architectures, RISC as well as non-RISC and VLIW; word lengths vary from 4-bit to 64-bits and
beyond (mainly in DSP processors) although the most typical remain 8/16-bit. Most architecture
comes in a large number of different variants and shapes, many of which are also manufactured
by several different companies.
PERIPHERALS
Embedded Systems talk with the outside world via peripherals, such as:
Synchronous Serial Communication Interface: I2C, JTAG, SPI, SSC and ESSI
In addition to the CPU and memory hierarchy, there are a variety of interfaces that enable the
system to measure, manipulate, and otherwise interact with the external environment. Some
differences with desktop computing may be:
The human interface may be as simple as a flashing light or as complicated as real-time
robotic vision.
The diagnostic port may be used for diagnosing the system that is being controlled -- not
just for diagnosing the computer.
Special-purpose field programmable (FPGA), application specific (ASIC), or even nondigital hardware may be used to increase performance or safety.
Software often has a fixed function, and is specific to the application.
I.
Real-life systems:
II.
Mission-critical system
Dual-redundant hardware
Real-life systems:
III.
Mission-critical system
Real-life systems:
o High-rise elevators
o Large-building air handling
o Public transit systems
IV.
Personal safety
Real-life systems
SOFTWARE TOOLS
HARDWARE TOOLS
2.4 DESCRIPTION
What is this Embedded System?
The computer you use to compose your mails, or create a document or analyze the
database is known as the standard desktop computer. These desktop computers are manufactured
to serve many purposes and applications.
You need to install the relevant software to get the required processing facility. So, these
desktop computers can do many things. In contrast, embedded controllers carryout a specific
work for which they are designed. Most of the time, engineers design these embedded controllers
with a specific goal in mind. So these controllers cannot be used in any other place.
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/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 a most difficult first step and it is getting
complicated as new devices continue to pop-up very often.
In the 8 bit segment, the most popular and used architecture is Intel's 8031. Market
acceptance of this particular family has driven many semiconductor manufacturers to develop
something new based on this particular architecture. Even after 25 years of existence,
semiconductor manufacturers still come out with some kind of device using this 8031 core.
Communications applications
"Five-nines" availability, CompactPCI hot swap support, and hard real-time response
LynxOS delivers on these key requirements and more for today's carrier-class systems. Scalable
kernel configurations, distributed computing capabilities, integrated communications stacks, and
fault-management facilities make LynxOS the ideal choice for companies looking for a single
operating system for all embedded telecommunications applicationsfrom complex central
controllers to simple line/trunk cards.
Lynux Works Jumpstart for Communications package enables OEMs to rapidly
develop mission-critical communications equipment, with pre-integrated, state-of-the-art, data
networking and porting software componentsincluding source code for easy customization.
The Lynx Certifiable Stack (LCS) is a secure TCP/IP protocol stack designed
especially for applications where standards certification is required.
Designers of industrial and process control systems know from experience that
LynuxWorks operating systems provide the security and reliability that their industrial
applications require.
From ISO 9001 certification to fault-tolerance, POSIX conformance, secure
partitioning and high availability, we've got it all. Take advantage of our 20 years of
experience.
In the Literature discussing microprocessors, we often see the term Embedded System.
Microprocessors and Microcontrollers are widely used in embedded system products. An
embedded system product uses a microprocessor (or Microcontroller) to do one task only. A
printer is an example of embedded system since the processor inside it performs one task only;
namely getting the data and printing it. Contrast this with a Pentium based PC. A PC can be used
for any number of applications such as word processor, print-server, bank teller terminal, Video
game, network server, or Internet terminal. Software for a variety of applications can be loaded
and run. Of course the reason a pc can perform myriad tasks is that it has RAM memory and an
operating system that loads the application software into RAM memory and lets the CPU run it.
In an Embedded system, there is only one application software that is typically burned into
ROM. An x86 PC contains or is connected to various embedded products such as keyboard,
printer, modem, disk controller, sound card, CD-ROM drives, mouse, and so on. Each one of
these peripherals has a Microcontroller inside it that performs only one task. For example, inside
every mouse there is a Microcontroller to perform the task of finding the mouse position and
sending it to the PC. Table 1-1 lists some embedded products.
In this project work the micro-controller is playing a major role. Micro-controllers were
originally used as components in complicated process-control systems.
However, because of
their small size and low price, Micro-controllers are now also being used in regulators for
individual control loops. In several areas Micro-controllers are now outperforming their analog
counterparts and are cheaper as well.
The purpose of this project work is to present control theory that is relevant to
the analysis and design of Micro-controller system with an emphasis on basic
concept and ideas. It is assumed that a Microcontroller with reasonable software is
available for computations and simulations so that many tedious details can be left
to the Microcontroller. The control system design is also carried out up to the stage
of implementation in the form of controller programs in assembly language OR in CLanguage.
3.1.1 INTRODUCTION
A Micro controller consists of a powerful CPU tightly coupled with memory, various I/O
interfaces such as serial port, parallel port timer or counter, interrupt controller, data acquisition
interfaces-Analog to Digital converter, Digital to Analog converter, integrated on to a single
silicon chip.
If a system is developed with a microprocessor, the designer has to go for external
memory such as RAM, ROM, EPROM and peripherals. But controller is provided all these
facilities on a single chip. Development of a Micro controller reduces PCB size and cost of
design.
One of the major differences between a Microprocessor and a Micro controller is that a controller
often deals with bits not bytes as in the real world application.
4 i/o ports
Why AT 8051?
The system requirements and control specifications clearly rule out the use of 16, 32 or
64 bit micro controllers or microprocessors. Systems using these may be earlier to implement
due to large number of internal features. They are also faster and more reliable but, 8-bit micro
controller satisfactorily serves the above application. Using an inexpensive 8-bit Microcontroller
will doom the 32-bit product failure in any competitive market place.
Coming to the question of why to use AT8051 of all the 8-bit microcontroller available in
the market the main answer would be because it has 4 Kb on chip flash memory which is just
sufficient for our application. The on-chip Flash ROM allows the program memory to be
reprogrammed in system or by conventional non-volatile memory Programmer. Moreover
ATMEL is the leader in flash technology in todays market place and hence using AT 8051 is the
optimal solution.
Types of memory:
The 8051 have three general types of memory. They are on-chip memory, external Code
memory and external Ram. On-Chip memory refers to physically existing memory on the micro
controller itself. External code memory is the code memory that resides off chip. This is often in
the form of an external EPROM. External RAM is the Ram that resides off chip. This often is in
the form of standard static RAM or flash RAM.
a) Code memory
Code memory is the memory that holds the actual 8051 programs that is to be run. This
memory is limited to 64K. Code memory may be found on-chip or off-chip. It is possible to have
4K of code memory on-chip and 60K off chip memory simultaneously. If only off-chip memory
is available then there can be 64K of off chip ROM. This is controlled by pin provided as EA
b) Internal RAM
The 89C51 have a bank of 128 of internal RAM. The internal RAM is found on-chip. So
it is the fastest Ram available. And also it is most flexible in terms of reading and writing.
Internal Ram is volatile, so when 8051 is reset, this memory is cleared. 128 bytes of internal
memory are subdivided. The first 32 bytes are divided into 4 register banks. Each bank contains
8 registers. Internal RAM also contains 128 bits, which are addressed from 20h to 2Fh. These
bits are bit addressed i.e. each individual bit of a byte can be addressed by the user. They are
numbered 00h to 7Fh. The user may make use of these variables with commands such as SETB
and CLR.
FLASH MEMORY:
Flash memory is used in digital cellular phones, digital cameras, LAN switches, PC
Cards for notebook computers, digital set-up boxes, embedded controllers, and other devices.
Memory Type
Features
FLASH
Low-cost,
ROM
Read-Only Memory
SRAM
Memory
EEPROMorE2PROM
Electrically
Erasable
Programmable
high-density,
high-speed
Read-Only Memory
DRAM
power
Flash memory is a nonvolatile memory using NOR technology, which allows the user to
electrically program and erase information. Intel Flash memory uses memory cells similar to
an EPROM, but with a much thinner, precisely grown oxide between the floating gate and the
source (see Figure 2). Flash programming occurs when electrons are placed on the floating gate.
The charge is stored on the floating gate, with the oxide layer allowing the cell to be electrically
erased through the source. Intel Flash memory is an extremely reliable nonvolatile memory
architecture.
Port 0:
Port 0 is an 8-bit open-drain bi-directional I/O port. As an output port, each pin can sink
eight TTL inputs. When ones are written to port 0 pins, the pins can be used as high impedance
inputs. Port 0 may also be configured to be the multiplexed low order address/data bus during
accesses to external program and data memory. In this mode P0 has internal pull-ups. Port 0 also
receives the code bytes during Flash programming, and outputs the code bytes during program
verification. External pull-ups are required during program verification.
Port 1:
Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1 output buffers
can sink/source four TTL inputs. When 1s are written to Port 1 pins they are pulled high by the
internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled
low will source current (IIL) because of the internal pull-ups. Port 1 also receives the low-order
address bytes during Flash programming and verification.
Port 2:
Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 2 output buffers
can sink/source four TTL inputs. When 1s are written to Port 2 pins they are pulled high by the
internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled
low will source current (IIL) because of the internal pull-ups. Port 2 emits the high-order address
byte during fetches from external program memory and during accesses to external data
memories that use 16-bit addresses (MOVX @DPTR). In this application, it uses strong internal
pull-ups when emitting 1s. During accesses to external data memories that use 8-bit addresses
(MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register. Port 2 also
receives the high-order address bits and some control signals during Flash programming and
verification.
Port 3:
Port 3 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 3 output buffers
can sink/source four TTL inputs. When 1s are written to Port 3 pins they are pulled high by the
internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled
low will source current (IIL) because of the pull-ups.
Port 3 also serves the functions of various special features of the AT89C51 as listed below:
Port 3 also receives some control signals for Flash programming and verification
RST:
Reset input. A high on this pin for two machine cycles while the oscillator is running
resets the device.
ALE/PROG:
Address Latch Enable output pulse for latching the low byte of the address during
accesses to external memory. This pin is also the program pulse input (PROG) during Flash
programming. In normal operation ALE is emitted at a constant rate of 1/6the oscillator
frequency, and may be used for external timing or clocking purposes. Note, however, that one
ALE pulse is skipped during each access to external Data Memory.
If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is
active only during a MOVX or MOVC instruction. Otherwise, the pin is pulled high. Setting the ALEdisable bit has no effect if the microcontroller is in external execution mode.
PSEN:
Program Store Enable is the read strobe to external program memory. When the AT89C51
is executing code from external program memory, PSEN is activated twice each machine cycle,
except that two PSEN activations are skipped during each access to external data memory.
EA/VPP:
External Access Enable EA must be strapped to GND in order to enable the device to
fetch code from external program memory locations starting at 0000H up to FFFFH.
Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset.
EA should be strapped to VCC for internal program executions. This pin also receives the 12volt programming enable voltage (VPP) during Flash programming, for parts that require 12-volt
VPP.
XTAL1:
Input to the inverting oscillator amplifier and input to the internal clock operating circuit.
XTAL2:
It is the Output from the inverting oscillator amplifier.
Oscillator Characteristics:
XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier
which can be configured for use as an on-chip oscillator, as shown in Figs 6.2.3. Either a quartz
crystal or ceramic resonator may be used. To drive the device from an external clock source,
XTAL2 should be left unconnected while XTAL1 is driven as shown in Figure 6.2.4.There are no
requirements on the duty cycle of the external clock signal, since the input to the internal
clocking circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high
and low time specifications must be observed.
Notes:
1. Under steady state (non-transient) conditions, IOL must be externally
Limited as follows:
Ports 1, 2, 3: 15 mA
If IOL exceeds the test condition, VOL may exceed the related specification. Pins are
not guaranteed to sink current greater than the listed test conditions.
REGISTERS:
In the CPU, registers are used to store information temporarily. That information could
be a byte of data to be processed, or an address pointing to the data to be fetched. The vast
majority of 8051 registers are 8bit registers. In the 8051 there is only one data type: 8bits. The
8bits of a register are shown in the diagram from the MSB (most significant bit) D7 to the LSB
(least significant bit) D0. With an 8-bit data type, any data larger than 8bits must be broken into
8-bit chunks before it is processed. Since there are a large number of registers in the 8051, we
will concentrate on some of the widely used general-purpose registers and cover special registers
in future chapters.
D7 D6 D5 D4 D3 D2 D1 D0
The most widely used registers of the 8051 are A (accumulator), B, R0, R1, R2, R3, R4,
R5, R6, R7, DPTR (data pointer), and PC (program counter). All of the above registers are 8bits, except DPTR and the program counter. The accumulator, register A, is used for all
arithmetic and logic instructions.
example, register A has address E0h, and register B has been ignited the address F0H, as shown
in table.
The following two points should noted about the SFR addresses.
1. The Special function registers have addresses between 80H and FFH.
These
addresses are above 80H, since the addresses 00 to 7FH are addresses of RAM
memory inside the 8051.
2. Not all the address space of 80H to FFH is used by the SFR. The unused locations
80H to FFH are reserved and must not be used by the 8051 programmer.
Regarding direct addressing mode, notice the following two points: (a) the address value
is limited to one byte, 00-FFH, which means this addressing mode is limited to accessing RAM
locations and registers located inside the 8051. (b) If you examine the l st file for an assembly
language program, you will see that the SFR registers names are replaced with their addresses as
listed in table.
Symbol
Name
Address
ACC
Accumulator
0E0H
B register
0F0H
PSW
0D0H
SP
Stack pointer
81H
DPTR
DPL
Low byte
82H
DPH
High byte
83H
P0
Port0
80H
P1
Port1
90H
P2
Port2
0A0H
P3
Port3
0B0H
IP
Interrupt
priority 0B8H
IE
control
Interrupt
enable 0A8H
TMOD
control
Timer/counter
TCON
control
Timer/counter control
T2CON
Timer/counter
T2MOD
control
Timer/counter mode2 0C9H
TH0
control
Timer/counter
TL0
byte
Timer/counter 0 low 8AH
TH1
byte
Timer/counter 1 high 8DH
TL1
byte
Timer/counter 1 low 8BH
TH2
byte
Timer/counter 2 high 0CDH
TL2
byte
Timer/counter 2 low 0CCH
RCAP2H
byte
T/C 2 capture register 0CBH
RCAP2L
high byte
T/C 2 capture register 0CAH
SCON
SBUF
PCON
low byte
Serial control
Serial data buffer
Power control
mode
89H
88H
2 0C8H
0high 8CH
98H
99H
87H
A Register (Accumulator)
This is a general-purpose register which serves for storing intermediate results during operating.
A number (an operand) should be added to the accumulator prior to execute an instruction upon
it. Once an arithmetical operation is performed by the ALU, the result is placed into the
accumulator. If a data should be transferred from one register to another, it must go through
accumulator. For such universal purpose, this is the most commonly used register that none
microcontroller can be imagined without (more than a half 8051 microcontroller's instructions
used use the accumulator in some way).
B Register
B register is used during multiply and divide operations which can be performed only upon
numbers stored in the A and B registers. All other instructions in the program can use this register
as a spare accumulator (A).
This is a common name for the total 8 general purpose registers (R0, R1, and R2 ...R7).
Even they are not true SFRs, they deserve to be discussed here because of their purpose. The
bank is active when the R registers it includes are in use. Similar to the accumulator, they are
used for temporary storing variables and intermediate results. Which of the banks will be active
depends on two bits included in the PSW Register. These registers are stored in four banks in the
scope of RAM.
The following example best illustrates the useful purpose of these registers. Suppose that
mathematical operations on numbers previously stored in the R registers should be performed:
(R1+R2) - (R3+R4). Obviously, a register for temporary storing results of addition is needed.
Everything is quite simple and the program is as follows:
A total of 32bytes of RAM are set aside for the register banks and stack. These 32
bytes are divided into 4 banks of registers in which each bank has registers, R0-R7. RAM
locations 0 to 7 are set aside for bank 0 of R0-R7 where R0 is RAM location 0, R1 is RAM
location 1, and R2 is location 2, and so on, until memory location7, which belongs to R7 of
bank0. The second bank of registers R0-R7 starts at RAM location 08 and goes to location 0FH.
The third bank of R0-R7 starts at memory location 10H and goes to location 17H. Finally, RAM
locations 18H to 1FH are set aside for the fourth bank of R0-R7. Fig shows how the 32 bytes are
allocated into 4 banks.
As we can see from fig 1, the bank 1 uses the same RAM space as the stack. This is a
major problem in programming the 8051. we must either not use register bank1, or allocate
another area of RAM for the stack.
Fig:
This is one of the most important SFRs. The Program Status Word (PSW) contains
several status bits that reflect the current state of the CPU. This register contains: Carry bit,
Auxiliary Carry, two register bank select bits, Overflow flag, parity bit, and user-definable status
flag. The ALU automatically changes some of registers bits, which is usually used in regulation
of the program performing.
P - Parity bit. If a number in accumulator is even then this bit will be automatically set (1),
otherwise it will be cleared (0). It is mainly used during data transmission and receiving via
serial communication.
- Bit 1. This bit is intended for the future versions of the microcontrollers, so it is not supposed to
be here.
OV Overflow occurs when the result of arithmetical operation is greater than 255 (decimal), so
that it cannot be stored in one register. In that case, this bit will be set (1). If there is no overflow,
this bit will be cleared (0).
RS0, RS1 - Register bank selects bits. These two bits are used to select one of the four register
banks in RAM. By writing zeroes and ones to these bits, a group of registers R0-R7 is stored in
one of four banks in RAM.
RS1
RS2
Space in RAM
Bank0 00h-07h
Bank1 08h-0Fh
Bank2 10h-17h
Bank3 18h-1Fh
The stack is a section of RAM used by the CPU to store information temporarily. This
information could be data or an address. The CPU needs this storage area since there are only a
limited number of registers.
words, a register is pushed onto the stack to save it and popped off the stack to retrieve it. The
job of the SP is very critical when push and pop actions are performed.
In case that external memory and serial communication system are not in use then, 4 ports within
total of 32 input-output lines are available to the user for connection to peripheral environment.
Each bit inside these ports corresponds to the appropriate pin on the microcontroller. This means
that logic state written to these ports appears as a voltage on the pin (0 or 5 V). Naturally, while
reading, the opposite occurs voltage on some input pins is reflected in the appropriate port bit.
The state of a port bit, besides being reflected in the pin, determines at the same time whether it
will be configured as input or output. If a bit is cleared (0), the pin will be configured as output.
In the same manner, if a bit is set to 1 the pin will be configured as input. After reset, as well as
when turning the microcontroller ON, all bits on these ports are set to one (1). This means that
the appropriate pins will be configured as inputs.
Program counter:
The important register in the 8051 is the PC (Program counter). The program counter
points to the address of the next instruction to be executed. As the CPU fetches the OPCODE
from the program ROM, the program counter is incremented to point to the next instruction. The
program counter in the 8051 is 16bits wide. This means that the 8051 can access program
addresses 0000 to FFFFH, a total of 64k bytes of code. However, not all members of the 8051
have the entire 64K bytes of on-chip ROM installed, as we will see soon.
Types of instructions
Depending on operation they perform, all instructions are divided in several groups:
Arithmetic Instructions
Branch Instructions
Logical Instructions
The first part of each instruction, called MNEMONIC refers to the operation an instruction
performs (copying, addition, logical operation etc.). Mnemonics commonly are shortened form
of name of operation being executed. For example:
INCR1
LJMP
;
LAB5
Increment
;Long
Jump
R1
LAB5
(increment
(long
jump
to
register
address
specified
R1)
as
LAB5)
JNZ LOOP ;Jump if Not Zero LOOP (if the number in the accumulator is not 0, jump to address
specified as LOOP)
Another part of instruction, called OPERAND is separated from mnemonic at least by one empty
space and defines data being processed by instructions. Some instructions have no operand; some
have one, two or three. If there is more than one operand in instruction, they are separated by
comma. For example:
RET
(return
from
sub-routine)
JZ TEMP - (if the number in the accumulator is not 0, jump to address specified as TEMP)
ADD
A,R3
(add
R3
and
accumulator)
CJNE A,#20,LOOP - (compare accumulator with 20. If they are not equal, jump to address
specified
as
LOOP)
Arithmetic instructions
These instructions perform several basic operations (addition, subtraction, division,
multiplication etc.) After execution, the result is stored in the first operand. For example:
ADD A, R1 - The result of addition (A+R1) will be stored in the accumulator.
Arithmetical Instructions
Mnemonic
Description
Byte
Oscillator
ADD A,Rn
ADD A,Rx
ADD A,@Ri
ADD A,#X
ADDC A,Rn
Number
1
2
1
2
1
Period
1
2
1
2
1
Branch Instructions
There are two kinds of these instructions:
Unconditional jump instructions: After their execution a jump to a new location from
where the program continues execution is executed.
Branch Instruction
Mnemonic
Description
Byte
Oscillator
ACALL
Number
2
Period
3
adr11
LCALL
adr16
RET
RETI
AJMP adr11
1
1
2
4
4
3
LJMP adr16
Memory space
Jump to any address located within 64 K byte Program
Memory space
Description
MOV A,Rn
MOV A,Rx
MOV A,@Ri
MOV A,#X
Logical Instructions
These instructions perform logical operations between corresponding bits of two registers. After
execution, the result is stored in the first operand.
Logical Instructions
Mnemonic
Description
ANL A,Rn
ANL A,Rx
ANL A,@Ri
ANL A,#X
Similar to logical instructions, these instructions perform logical operations. The difference is
that these operations are performed on single bits.
Logical operations on bits
Mnemonic
Description
CLR C
CLR bit
SETB C
SETB bit
CPL C
CPL bit
TIMERS
On-chip timing/counting facility has proved the capabilities of the microcontroller for
implementing the real time application. These includes pulse counting, frequency measurement,
pulse width measurement, baud rate generation, etc,. Having sufficient number of timer/counters
may be a need in a certain design application. The 8051 has two timers/counters. They can be
used either as timers to generate a time delay or as counters to count events happening outside
the microcontroller. Let discuss how these timers are used to generate time delays and we will
also discuss how they are been used as event counters.
The 16-bit register of Timer 0 is accessed as low byte and high byte. the low byte
register is called TL0(Timer 0 low byte)and the high byte register is referred to as TH0(Timer 0
high byte).These register can be accessed like any other register, such as A,B,R0,R1,R2,etc.for
example, the instruction MOV TL0, #4Fmoves the value 4FH into TL0,the low byte of Timer
0.These registers can also be read like any other register.
TIMER 1 REGISTERS
Timer 1 is also 16-bit register is split into two bytes, referred to as TL1 (Timer 1 low
byte) and TH1 (Timer 1 high byte).these registers are accessible n the same way as the register of
Timer 0.
TMOD (timer mode) REGISTER
Both timers TIMER 0 and TIMER 1 use the same register, called TMOD, to set the
various timer operation modes. TMOD is an 8-bit register in which the lower 4 bits are set aside
for Timer 0 and the upper 4 bits for Timer 1.in each case; the lower 2 bits are used to set the
timer mode and the upper 2 bits to specify the operation.
MODES:
M1, M0:
M0 and M1 are used to select the timer mode. There are three modes: 0, 1, 2.Mode 0 is
a 13-bit timer, mode 1 is a 16-bit timer, and mode 2 is an 8-bit timer. We will concentrate on
modes 1 and 2 since they are the ones used most widely. We will soon describe the
characteristics of these modes, after describing the reset of the TMOD register.
GATE:
Gate
control
when
set.
The
timer/counter
is
enabled
only
While the INTx pin is high and the TRx control pin is Set. When cleared, the timer is enabled.
C/T: Timer or counter selected cleared for timer operation (Input from internal system clock).set
for counter Operation (input TX input pin).
M1
Mode bit 1
M0
Mode bit 0
M1
M0
MODE
0
Operating Mode
13-bit timer mode
8-bit timer/counter THx with TLx as
5 - Bit pre-scaler.
0
C/T (clock/timer)
This bit in the TMOD register is used to decide whether the timer is used as a delay generator
or an event counter. If C/T=0, it is used as a timer for time delay generation. The clock source for
the time delay is the crystal frequency of the 8051.this section is concerned with this choice. The
timers use as an event counter is discussed in the next section.
Serial Communication:
Computers can transfer data in two ways: parallel and serial. In parallel data transfers,
often 8 or more lines (wire conductors) are used to transfer data to a device that is only a few feet
away. Examples of parallel data transfer are printers and hard disks; each uses cables with many
wire strips. Although in such cases a lot of data can be transferred in a short amount of time by
using many wires in parallel, the distance cannot be great. To transfer to a device located many
meters away, the serial method is used. In serial communication, the data is sent one bit at a
time, in contrast to parallel communication, in which the data is sent a byte or more at a time.
Serial communication of the 8051 is the topic of this chapter.
communication capability built into it, there by making possible fast data transfer using only a
few wires.
If data is to be transferred on the telephone line, it must be converted from 0s and 1s to
audio tones, which are sinusoidal-shaped signals. A peripheral device called a modem, which
stands for modulator/demodulator, performs this conversion.
Serial data communication uses two methods, asynchronous and synchronous. The
synchronous method transfers a block of data at a time, while the asynchronous method transfers
a single byte at a time.
In data transmission if the data can be transmitted and received, it is a duplex
transmission. This is in contrast to simplex transmissions such as with printers, in which the
computer only sends data. Duplex transmissions can be half or full duplex, depending on
whether or not the data transfer can be simultaneous. If data is transmitted one way at a time, it
is referred to as half duplex. If the data can go both ways at the same time, it is full duplex. Of
course, full duplex requires two wire conductors for the data lines, one for transmission and one
for reception, in order to transfer and receive data simultaneously.
Asynchronous serial communication and data framing
The data coming in at the receiving end of the data line in a serial data transfer is all 0s
and 1s; it is difficult to make sense of the data unless the sender and receiver agree on a set of
rules, a protocol, on how the data is packed, how many bits constitute a character, and when the
data begins and ends.
Start and stop bits
Asynchronous serial data communication is widely used for character-oriented
transmissions, while block-oriented data transfers use the synchronous method.
In the
asynchronous method, each character is placed between start and stop bits. This is called
framing.
In the data framing for asynchronous communications, the data, such as ASCII
characters, are packed between a start bit and a stop bit. The start bit is always one bit, but the
stop bit can be one or two bits. The start bit is always a 0 (low) and the stop bit (s) is 1 (high).
RS232 Standards
To allow compatibility among data communication equipment made by various
manufacturers, an interfacing standard called RS232 was set by the Electronics Industries
Association (EIA) in 1960. In 1963 it was modified and called RS232A. RS232B AND RS232C
were issued in 1965 and 1969, respectively. Today, RS232 is the most widely used serial I/O
interfacing standard. This standard is used in PCs and numerous types of equipment. However,
since the standard was set long before the advert of the TTL logic family, its input and output
voltage levels are not TTL compatible. In RS232, a 1 is represented by -3 to -25V, while a 0 bit
is +3 to +25V, making -3 to +3 undefined.
microcontroller system we must use voltage converters such as MAX232 to convert the TTL
logic levels to the RS232 voltage levels, and vice versa. MAX232 IC chips are commonly
referred to as line drivers.
RS232 pins
RS232 cable, commonly referred to as the DB-25 connector. In labeling, DB-25P refers
to the plug connector (male) and DB-25S is for the socket connector (female). Since not all the
pins are used in PC cables, IBM introduced the DB-9 Version of the serial I/O standard, which
uses 9 pins only, as shown in table.
Pin Functions:
Pin
1
2
3
4
5
6
7
8
9
Description
Data carrier detect (DCD)
Received data (RXD)
Transmitted data (TXD)
Data terminal ready(DTR)
Signal ground (GND)
Data set ready (DSR)
Request to send (RTS)
Clear to send (CTS)
Ring indicator (RI)
Note: DCD, DSR, RTS and CTS are active low pins.
The method used by RS-232 for communication allows for a simple connection of three lines:
Tx, Rx, and Ground. The three essential signals for 2-way RS-232
The
The 8051 has two pins that are used specifically for transferring and receiving
data serially. These two pins are called TXD and RXD and a part of the port 3 group (P3.0 and
P3.1). Pin 11 of the 8051 is assigned to TXD and pin 10 is designated as RXD. These pins are
TTL compatible; therefore, they require a line driver to make them RS232 compatible. One such
line driver is the MAX232 chip.
MAX232 converts from RS232 voltage levels to TTL voltage levels, and vice
versa. One advantage of the MAX232 chip is that it uses a +5V power source which, is the same
as the source voltage for the 8051. In the other words, with a single +5V power supply we can
power both the 8051 and MAX232, with no need for the power supplies that are common in
many older systems. The MAX232 has two sets of line drivers for transferring and receiving
data. The line drivers used for TXD are called T1 and T2, while the line drivers for RXD are
designated as R1 and R2. In many applications only one of each is used.
INTERRUPTS
A single microcontroller can serve several devices. There are two ways to do that:
INTERRUPTS or POLLING.
POLLING:
In polling the microcontroller continuously monitors the status of a given device; when
the status condition is met, it performs the service .After that, it moves on to monitor the next
device until each one is serviced. Although polling can monitor the status of several devices and
serve each of them as certain condition are met.
INTERRUPTS:
In the interrupts method, whenever any device needs its service, the device notifies the
microcontroller by sending it an interrupts signal. Upon receiving an interrupt signal, the
microcontroller interrupts whatever it is doing and serves the device. The program associated
with the interrupts is called the interrupt service routine (ISR).or interrupt handler.
INTERRUPTS Vs POLLING:
of memory location set aside to hold the addresses of ISR and is called the Interrupt Vector
Table. Shown below:
S.No.
INTERRUPT
ROM LOCATION
PIN
(HEX)
FLAG
CLEARING
1.
Reset
0000
Auto
2.
External hardware
0003
P3.2 (12)
Auto
3.
Interrupt 0
Timers 0 interrupt
000B
4.
(TF0)
External hardware
0013
Auto
P3.3 (13)
Auto
Interrupt 1(INT1)
5.
Timers 1 interrupt
001B
Auto
6.
(TF1)
Serial COM (RI
0023
Programmer
and TI)
clears it
In reality, only five interrupts are available to the user in the 8051, but many manufacturers data
sheets state that there are six interrupts since they include reset .the six interrupts in the 8051 are
allocated as above.
1. Reset. When the reset pin is activated, the 8051 jumps to address location 0000.this is the
power-up reset.
2. Two interrupts are set aside for the timers: one for Timer 0 and one for Timer 1.Memory
location 000BH and 001BH in the interrupt vector table belong to Timer 0 and Timer 1,
respectively.
3. Two interrupts are set aside for hardware external harder interrupts. Pin number 12(P3.2)
and 13(P3.3) in port 3 are for the external hardware interrupts INT0 and
INT1,respectively.These external interrupts are also referred to as EX1 and EX2.Memory
location 0003H and 0013H in the interrupt vector table are assigned to INT0 and INT1,
respectively.
4. Serial communication has a single interrupt that belongs to both receive and transmit. The
interrupt vector table location 0023H belongs to this interrupt.
Notice that a limited number of bytes are set aside for each interrupt. For example, a
total of 8 bytes from location 0003 to 000A is set aside for INT0, external hardware interrupt
0.similarly,a total of 8 bytes from location 00BH to 0012H is reserved for TF0, Timer 0 interrupt.
If the service routine for a given interrupt is short enough to fit in the memory space allocated to
it, it is placed in the vector table; otherwise, and an LJMP instruction is placed in the vector table
to point to the address of the ISR. In that rest of the bytes allocated to that interrupt are unused.
From the above table also notice that only three bytes of ROM space are assigned to the
reset pin. they are ROM address location 0,1 and2.address location 3 belongs to external
hardware interrupt 0.for this reason, in our program we put the LJMP as the first instruction and
redirect the processor away from the interrupt vector table, as shown below
1. It finishes the instruction it is executing and saves the address of the next instruction (PC)
on the stack.
2. It also saves the current status of all the interrupts internally (i.e., not on the stack).
3. It jumps to a fixed location in memory called the interrupt vector table that holds the
address of the interrupts service routine.
4. The microcontroller gets the address of the ISR from the interrupt vector table and jumps
to it. It starts to execute the interrupt service subroutine until it reaches the last instruction
of the subroutine, which is RETI (return from interrupt).
5. Upon executing the RETI instruction, the microcontroller returns to the place where it
was interrupted. First, it gets the program counter (PC) address from the stack by popping
the top two bytes of the stack into the PC. Then it starts to execute from that address.
Notice from step 5 the critical role of the stack. For this reason, we must be careful in
manipulating the stack contents in the ISR. Specifically, in the ISR, just as in any CALL
subroutine, the number of pushes and pops must be equal.
D7
D6
D5
EA
ET0
EA
IE.7
D4
D3
-EX0
ET2
D2
D1
ES
D0
ET1
EX1
--
IE.6
ET2
IE.5
ES
IE.4
ET1
IE.3
EX1
IE.2
ET0
IE.1
EX0
IE.0
3.2.1 TRANSFORMER
A transformer is an electrical device which is used to convert electrical power from one
electrical circuit to another without change in frequency.
Transformers convert AC electricity from one voltage to another with
little loss of power. Transformers work only with AC and this is one of the
reasons why mains electricity is AC. Step-up transformers increase in output
voltage, step-down transformers decrease in output voltage. Most power
supplies use a step-down transformer to reduce the dangerously high mains
voltage to a safer low voltage.
the power out is (almost) equal to the power in. Note that as voltage is
stepped down current is stepped up.
each coil, called the turns ratio, determines the ratio of the voltages. A stepdown transformer has a large number of turns on its primary (input) coil
which is connected to the high voltage mains supply, and a small number of
turns on its secondary (output) coil to give a low output voltage.
3.2.2 RECTIFIER
A circuit, which is used to convert a.c to dc, is known as RECTIFIER. The process of
conversion a.c to d.c is called rectification
TYPES OF RECTIFIERS:
Type of Rectifier
Half wave
Parameter
Full wave
Bridge
Number
of
diodes
2Vm
Vm
PIV of diodes
Vm
D.C
voltage
output
Vm/
2Vm/
2Vm/
Vdc, at
0.318Vm
0.636Vm
0.636Vm
no-load
Ripple factor
Ripple
frequency
Rectification
1.21
0.482
0.482
2f
2f
efficiency
Transformer
0.406
0.812
0.812
Utilization
0.287
0.693
0.812
Factor(TUF)
RMS voltage Vrms
Vm/2
Vm/2
Vm/2
Full-wave Rectifier:
From the above comparisons we came to know that full wave bridge rectifier as more
advantages than the other two rectifiers. So, in our project we are using full wave bridge rectifier
circuit.
Bridge Rectifier:
A bridge rectifier makes use of four diodes in a bridge arrangement to achieve full-wave
rectification. This is a widely used configuration, both with individual diodes wired as shown
and with single component bridges where the diode bridge is wired internally.
A bridge rectifier makes use of four diodes in a bridge arrangement as shown in fig(a) to
achieve full-wave rectification. This is a widely used configuration, both with individual diodes
wired as shown and with single component bridges where the diode bridge is wired internally.
Operation:
During positive half cycle of secondary, the diodes D2 and D3 are in forward biased
while D1 and D4 are in reverse biased as shown in the fig(b). The current flow direction is
shown in the fig (b) with dotted arrows.
During negative half cycle of secondary voltage, the diodes D1 and D4 are in forward
biased while D2 and D3 are in reverse biased as shown in the fig(c). The current flow direction
is shown in the fig (c) with dotted arrows.
3.2.4 FILTER
A Filter is a device, which removes the a.c component of rectifier output but allows the
d.c component to reach the load.
Capacitor Filter:
We have seen that the ripple content in the rectified output of half wave rectifier is 121% or
that of full-wave or bridge rectifier or bridge rectifier is 48% such high percentages of ripples is
not acceptable for most of the applications. Ripples can be removed by one of the following
methods of filtering:
(a) A capacitor, in parallel to the load, provides an easier by pass for the ripples voltage though
it due to low impedance. At ripple frequency and leave the d.c.to appears the load.
(b) An inductor, in series with the load, prevents the passage of the ripple current (due to high
impedance at ripple frequency) while allowing the d.c (due to low resistance to d.c)
(c) various combinations of capacitor and inductor, such as L-section filter
section filter,
multiple section filter etc. which make use of both the properties mentioned in (a) and (b) above.
Two cases of capacitor filter, one applied on half wave rectifier and another with full wave
rectifier.
C = *3*f*r*Rl
Where,
f = supply frequency,
r = ripple factor,
Rl = load resistance
Note: In our circuit we are using 1000microfarads.
3.2.4 REGULATOR
Voltage regulator ICs is available with fixed (typically 5, 12 and 15V) or variable
output voltages. The maximum current they can pass also rates them. Negative voltage regulators
are available, mainly for use in dual supplies. Most regulators include some automatic protection
from excessive current ('overload protection') and overheating ('thermal protection'). Many of
the fixed voltage regulator ICs have 3 leads and look like power transistors, such as the 7805
+5V 1A regulator shown on the right. The LM7805 is simple to use. You simply connect the
positive lead of your unregulated DC power supply (anything from 9VDC to 24VDC) to the
Input pin, connect the negative lead to the Common pin and then when you turn on the power,
you get a 5 volt supply from the output pin.
78XX:
The Bay Linear LM78XX is integrated linear positive regulator with three terminals. The
LM78XX offer several fixed output voltages making them useful in wide range of applications.
When used as a zener diode/resistor combination replacement, the LM78XX usually results in an
effective output impedance improvement of two orders of magnitude, lower quiescent current.
The LM78XX is available in the TO-252, TO-220 & TO-263packages
Features:
Output Current of 1.5A
Output Voltage Tolerance of 5%
Internal thermal overload protection
Internal Short-Circuit Limited
No External Component
Output Voltage 5.0V, 6V, 8V, 9V, 10V, 12V, 15V, 18V, 24V
Offer in plastic TO-252, TO-220 & TO-263
Direct Replacement for LM78XX
POTENTIOMETER
Fig: Potentiometer
A potentiometer informally a pot, is a three-terminal resistor with a sliding contact that forms
an adjustable voltage divider. If only two terminals are used, one end and the wiper, it acts as a
variable resistor or rheostat.
A potentiometer measuring instrument is essentially a voltage divider used for measuring electric
potential (voltage); the component is an implementation of the same principle, hence its name.
Potentiometers are commonly used to control electrical devices such as volume controls on audio
equipment. Potentiometers operated by a mechanism can be used as position transducers, for
example, in a joystick. Potentiometers are rarely used to directly control significant power (more
than a watt), since the power dissipated in the potentiometer would be comparable to the power
in the controlled load.
TRANSISTOR:
Assorted discrete transistors. Packages in order from top to bottom: TO-3, TO-126, TO-92, SOT23
A transistor is a semiconductor device used to amplify and switch electronic signals and
electrical power. It is composed of semiconductor material with at least three terminals for
connection to an external circuit. A voltage or current applied to one pair of the transistor's
terminals changes the current flowing through another pair of terminals. Because the controlled
(output) power can be higher than the controlling (input) power, a transistor can amplify a signal.
Today, some transistors are packaged individually, but many more are found embedded in
integrated circuits.
The transistor is the fundamental building block of modern electronic devices, and is ubiquitous
in modern electronic systems. Following its development in the early 1950s the transistor
revolutionized the field of electronics, and paved the way for smaller and cheaper radios,
calculators, and computers, among other things.
RESISTOR:
into the board. In automated assembly the leads are cut and
formed.
where I is the current through the conductor in units of amperes, V is the potential difference
measured across the conductor in units of volts, and R is the resistance of the conductor in units
of ohms.The ratio of the voltage applied across a resistor's terminals to the intensity of current
in the circuit is called its resistance, and this can be assumed to be a constant (independent of the
voltage) for ordinary resistors working within their ratings.
Resistors are common elements of electrical networks and electronic circuits and are
ubiquitous in electronic equipment. Practical resistors can be made of various compounds and
films, as well as resistance wire (wire made of a high-resistivity alloy, such as nickel-
chrome). Resistors are also implemented within integrated circuits, particularly analog
devices, and can also be integrated into hybrid and printed circuits.
The electrical functionality of a resistor is specified by its resistance: common commercial
resistors are manufactured over a range of more than nine orders of magnitude. When
specifying that resistance in an electronic design, the required precision of the resistance may
require attention to the manufacturing tolerance of the chosen resistor, according to its
specific application. The temperature coefficient of the resistance may also be of concern
in some precision applications. Practical resistors are also specified as having a maximum
power rating which must exceed the anticipated power dissipation of that resistor in a particular
circuit: this is mainly of concern in power electronics applications. Resistors with higher power
ratings are physically larger and may require heat sinks. In a high-voltage circuit, attention
must sometimes be paid to the rated maximum working voltage of the resistor.
CAPACITOR:
This article is about the electronic component. For the physical phenomenon, see capacitance.
For an overview of various kinds of capacitors, see types of capacitor.
3.1 MAX232
The data which we are entering in to the hyper terminal editor is available at the COM1
port. Then the data enters in to the MAX232 voltage converter via the RS232 cable. The
MAX232 converts the voltage levels of the RS232 to the TTL level and then sends to the UART
of the microcontroller. So the main duty of the max232 is for the voltage conversions.
The MAX232 from Maxim was the first IC which in one package contains the necessary
drivers (two) and receivers (also two), to adapt the RS-232 signal voltage levels to TTL logic. It
became popular, because it just needs one voltage (+5V) and generates the necessary RS-232
voltage levels (approx. -10V and +10V) internally. This greatly simplified the design of circuitry.
Circuitry designers no longer need to design and build a power supply with three voltages (e.g.
-12V, +5V, and +12V), but could just provide one +5V power supply, e.g. with the help of a
simple 78x05 voltage converter.
The MAX232 has a successor, the MAX232A. The ICs are almost identical, however, the
MAX232A is much more often used (and easier to get) than the original MAX232, and the
MAX232A only needs external capacitors 1/10th the capacity of what the original MAX232
needs.
It should be noted that the MAX 232(A) is just a driver/receiver. It does not generate the
necessary RS-232 sequence of marks and spaces with the right timing, it does not decode the RS232 signal, it does not provide a serial/parallel conversion. All it does is to convert signal
voltage levels. Generating serial data with the right timing and decoding serial data has to be
done by additional circuitry, e.g. by a 16550 UART or one of these small micro controllers (e.g.
Atmel AVR, Microchip PIC) getting more and more popular.
The MAX232 and MAX232A were once rather expensive ICs, but today they are cheap.
It has also helped that many companies now produce clones (ie. Sipex). These clones sometimes
need different external circuitry, e.g. the capacities of the external capacitors vary. It is
recommended to check the data sheet of the particular manufacturer of an IC instead of relying
on Maxim's original data sheet.
The original manufacturer (and now some clone manufacturers, too) offers a large series
of similar ICs, with different numbers of receivers and drivers, voltages, built-in or external
capacitors, etc. E.g. The MAX232 and MAX232A need external capacitors for the internal
voltage pump, while the MAX233 has these capacitors built-in. The MAX233 is also between
three and ten times more expensive in electronic shops than the MAX232A because of its
internal capacitors. It is also more difficult to get the MAX233 than the garden variety
MAX232A.
A Typical Application
The MAX 232(A) has two receivers (converts from RS-232 to TTL voltage levels) and two
drivers (converts from TTL logic to RS-232 voltage levels). This means only two of the RS-232
signals can be converted in each direction. The old MC1488/1498 combo provided four drivers
and receivers.
Typically a pair of a driver/receiver of the MAX232 is used for
TX and RX
There are not enough drivers/receivers in the MAX232 to also connect the DTR, DSR, and
DCD signals. Usually these signals can be omitted when e.g. communicating with a PC's serial
interface. If the DTE really requires these signals either a second MAX232 is needed, or some
other IC from the MAX232 family can be used (if it can be found in consumer electronic shops
at all). An alternative for DTR/DSR is also given below.
Maxim's data sheet explains the MAX232 family in great detail, including the pin
configuration and how to connect such an IC to external circuitry. This information can be used
as-is in own design to get a working RS-232 interface. Maxim's data just misses one critical
piece of information: How exactly to connect the RS-232 signals to the IC. So here is one
possible example:
MAX232 to RS232 DB9 Connection as a DCE
MAX232 Pin Nbr. MAX232 Pin Name Signal Voltage DB9 Pin
7
T2out
CTS
RS-232
R2in
RTS
RS-232
R2out
RTS
TTL
n/a
10
T2in
CTS
TTL
n/a
11
T1in
TX
TTL
n/a
12
R1out
RX
TTL
n/a
13
R1in
TX
RS-232
14
T1out
RX
RS-232
15
GND
GND
In addition one can directly wire DTR (DB9 pin 4) to DSR (DB9 pin 6) without going through
any circuitry. This gives automatic (brain dead) DSR acknowledgment of an incoming DTR
signal.
Sometimes pin 6 of the MAX232 is hard wired to DCD (DB9 pin 1). This is not
recommended. Pin 6 is the raw output of the voltage pump and inverter for the -10V voltage.
Drawing currents from the pin leads to a rapid breakdown of the voltage, and as a consequence
to a breakdown of the output voltage of the two RS-232 drivers. It is better to use software which
doesn't care about DCD, but does hardware-handshaking via CTS/RTS only.
The circuitry is completed by connecting five capacitors to the IC as it follows. The
MAX232 needs 1.0F capacitors, the MAX232A needs 0.1F capacitors. MAX232 clones show
similar differences. It is recommended to consult the corresponding data sheet. At least 16V
capacitor types should be used. If electrolytic or tantalic capacitors are used, the polarity has to
be observed. The first pin as listed in the following table is always where the plus pole of the
capacitor should be connected to.
MAX232(A) external Capacitors
Capacitor + Pin - Pin Remark
C1
C2
C3
16
C4
GND 6
C5
16
GND
+5V: Pin 16
GND:
FEATURES
APPLICATIONS
TIA/EIA-232-F
Battery-Powered Systems
Terminals
Modems
Computers
Description/ordering information
GEAR MOTOR
Gear motors are complete motive force systems consisting of an electric motor and a
reduction gear train integrated into one easy-to-mount and -configure package. This greatly
reduces the complexity and cost of designing and constructing power tools, machines and
appliances calling for high torque at relatively low shaft speed or RPM. Gear motors allow the
use of economical low-horsepower motors to provide great motive force at low speed such as in
lifts, winches, medical tables, jacks and robotics. They can be large enough to lift a building or
smallenoughtodriveatinyclock.
Operation Principle
Most synchronous AC electric motors have output ranges of from 1,200 to 3,600 revolutions per
minute. They also have both normal speed and stall-speed torque specifications. The reduction
gear trains used in gear motors are designed to reduce the output speed while increasing the
torque. The increase in torque is inversely proportional to the reduction in speed. Reduction
gearing allows small electric motors to move large driven loads, although more slowly than
larger electric motors. Reduction gears consist of a small gear driving a larger gear. There may be
several sets of these reduction gear sets in a reduction gear box.
Speed Reduction
Sometimes the goal of using a gear motor is to reduce the rotating shaft speed of a motor in the
device being driven, such as in a small electric clock where the tiny synchronous motor may be
spinning at 1,200 rpm but is reduced to one rpm to drive the second hand, and further reduced in
the clock mechanism to drive the minute and hour hands. Here the amount of driving force is
irrelevant as long as it is sufficient to overcome the frictional effects of the clock mechanism.
Torque Multiplication
Another goal achievable with a gear motor is to use a small motor to generate a very large force
albeit at a low speed. These applications include the lifting mechanisms on hospital beds, power
recliners, and heavy machine lifts where the great force at low speed is the goal.
Motor Varieties
Most industrial gear motors are AC-powered, fixed-speed devices, although there are fixed-gearratio, variable-speed motors that provide a greater degree of control. DC gear motors are used
primarily in automotive applications such as power winches on trucks, windshield wiper motors
and power seat or power window motors.
Many Applications
What power can openers, garage door openers, stair lifts, rotisserie motors, timer cycle knobs on
washing machines, power drills, cake mixers and electromechanical clocks have in common is
that they all use various integrations of gear motors to derive a large force from a relatively small
electric motor at a manageable speed. In industry, gear motor applications in jacks, cranes, lifts,
clamping, robotics, conveyance and mixing are too numerous to count.
SPECIFICATIONS
Thermal Shutdown
High-Noise-Immunity Inputs
APPLICATIONS
This IC is basically a Motor driver. It consists of four inputs, four outputs, four grounds
and two enables for each motors. We can drive two motors using single L293D chip.
The below is the Truth table or the function table of the L293D motor driver.
Pin 1Pin 2
Pin 7
Function
High Low
High
Turn clockwise
High High
Low
Turn anti-clockwise
High Low
Low
Stop
High High
High
Stop
Low Not applicableNot applicableStop
ABOUT SOFTWARE
Softwares used are:
Vision3 adds many new features to the Editor like Text Templates, Quick Function
Navigation, and Syntax Coloring with brace high lighting Configuration Wizard for dialog based
startup and debugger setup. Vision3 is fully compatible to Vision2 and can be used in parallel
with Vision2.
What is Vision3?
Vision3 is an IDE (Integrated Development Environment) that helps you write, compile,
and debug embedded programs. It encapsulates the following components:
A project manager.
A make facility.
Tool configuration.
Editor.
A powerful debugger.
To help you get started, several example programs (located in the \C51\Examples,
\C251\Examples, \C166\Examples, and \ARM\...\Examples) are provided.
o HELLO is a simple program that prints the string "Hello World" using the Serial
Interface.
o MEASURE is a data acquisition system for analog and digital systems.
o TRAFFIC is a traffic light controller with the RTX Tiny operating system.
o SIEVE is the SIEVE Benchmark.
o DHRY is the Dhrystone Benchmark.
o WHETS is the Single-Precision Whetstone Benchmark.
Additional example programs not listed here are provided for each device architecture.
6. Select Project - Options and set the tool options. Note when you select the target device
from the Device Database all special options are set automatically. You typically only
need to configure the memory map of your target hardware. Default memory model
settings are optimal for most applications.
7. Select Project - Rebuild all target files or Build target.
Vision2 is a standard Windows application and started by clicking on the program icon.
To create a new project file select from the Vision2 menu.
Project New Project. This opens a standard Windows dialog that asks you
for the new project file name.
We suggest that you use a separate folder for each project. You can simply use the icon
Create New Folder in this dialog to get a new empty folder. Then select this folder and enter the
file name for the new project, i.e. Project1. Vision2 creates a new project file with the name
PROJECT1.UV2 which contains a default target and file group name. You can see these names
in the Project.
Window Files.
Now use from the menu Project Select Device for Target and select a CPU for your project.
The Select Device dialog box shows the Vision2 device database. Just select the micro
controller you use. We are using for our examples the Philips 80C51RD+ CPU. This selection
sets necessary tool options for the 80C51RD+ device and simplifies in this way the tool
Configuration.
Typical, the tool settings under Options Target are all you need to start a new application. You
may translate all source files and line the application with a click on the Build Target toolbar
icon. When you build an application with syntax errors, Vision2 will display errors and warning
messages in the Output Window Build page. A double click on a message line opens the source
file on the correct location in a Vision2 editor window. Once you have successfully generated
your application you can start debugging.
After you have tested your application, it is required to create an Intel HEX file to
download the software into an EPROM programmer or simulator. Vision2 creates HEX files
with each build process when Create HEX files under Options for Target Output is enabled.
You may start your PROM programming utility after the make process when you specify the
program under the option Run User Program #1.
CPU Simulation
Vision2 simulates up to 16 Mbytes of memory from which areas can be mapped for
read, write, or code execution access. The Vision2 simulator traps and reports illegal memory
access.
In addition to memory mapping, the simulator also provides support for the integrated
peripherals of the various 8051 derivatives. The on-chip peripherals of the CPU you have
selected are configured from the Device.
Database selection
you have made when you create your project target. Refer to page 58 for more
Information about selecting a device. You may select and display the on-chip peripheral
components using the Debug menu. You can also change the aspects of each peripheral using the
controls in the dialog boxes.
Start Debugging
You start the debug mode of Vision2 with the Debug Start/Stop Debug Session command.
Depending on the Options for Target Debug Configuration, Vision2 will load the application
program and run the startup code Vision2 saves the editor screen layout and restores the screen
layout of the last debug session. If the program execution stops, Vision2 opens an editor
window with the source text or shows CPU instructions in the disassembly window. The next
executable statement is marked with a yellow arrow. During debugging, most editor features are
still available.
For example, you can use the find command or correct program errors. Program source text of
your application is shown in the same windows. The Vision2 debug mode differs from the edit
mode in the following aspects:
The Debug Menu and Debug Commands described on page 28 are Available. The
Disassembly Window
The Disassembly window shows your target program as mixed source and assembly program or
just assembly code. A trace history of previously executed instructions may be displayed with
Debug View Trace Records. To enable the trace history, set Debug Enable/Disable Trace
Recording.
If you select the Disassembly Window as the active window all program step commands work on
CPU instruction level rather than program source lines. You can select a text line and set or
modify code breakpoints using toolbar buttons or the context menu commands.
You may use the dialog Debug Inline Assembly to modify the CPU instructions.
That allows you to correct mistakes or to make temporary changes to the target program you are
debugging.
1.
2.
3.
4.
5.
Save the Project by typing suitable project name with no extension in u r own folder
sited in either C:\ or D:\
6.
7.
8.
9.
10.
Then Click on OK
11.
12.
13.
14.
Now double click on the Target1, you would get another option Source group 1 as
shown in next page.
15.
Click on the file option from menu bar and select new
16.
The next screen will be as shown in next page, and just maximize it by double
clicking on its blue boarder.
17.
18.
For a program written in Assembly, then save it with extension . asm and for C
based program save it with extension .C
19.
Now right click on Source group 1 and click on Add files to Group
Source
20.
Now you will get another window, on which by default C files will appear.
21.
Now select as per your file extension given while saving the file
22.
23.
Now Press function key F7 to compile. Any error will appear if so happen.
24.
25.
26.
Then Click OK
27.
Now Click on the Peripherals from menu bar, and check your required port
as shown in fig below
28.
29.
30.
Express PCB
Express PCB is a Circuit Design Software and PCB manufacturing service. One can learn
almost everything you need to know about Express PCB from the help topics included with the
programs given.
Details:
Express PCB, Version 5.6.0
5. CONCLUSION
Integrating features of all the hardware components used have developed it. Presence of
every module has been reasoned out and placed carefully thus contributing to the best working of
the unit.
Secondly, using highly advanced ICs and with the help of growing technology
the project has been successfully implemented.
6. BIBLIOGRAPHY
& Applications
-Ramesh S.Gaonkar
Electronic Components
-D.V.Prasad
Wireless Communications
- Theodore S. Rappaport
Mobile Tele Communications
- William C.Y. Lee
www.national.com
www.atmel.com
www.microsoftsearch.com
www.geocities.com
http://tycho.usno.navy.mil/gpscurr.html