Anda di halaman 1dari 38

EEAST SIX WEEKS REPORT

Company Profile

Technology changes drastically within the counts of time and it have become vicissitude of
life. To survive in the air of cutthroat competition, one needs to be fully cognizant with the
changing trends of the technology, the needs of the clients and the employers, in brief,
with almost all the aspects o f the industry. There is great demand for system designing
engineers working on the embedded systems. This demand is going to rise further in the
coming years. Other factor favorable for this is the incursion of foreign especially
American companies in India.
EEAST is a complete R & D Organization dedicated to provide Electronics and
Advanced Software Products and Solutions to its Clients. Achieving the needs of our
customer and converting their ideas to real models is our motto. We are working in the field of
Embedded Systems, Automation and Advanced System design for the last four years with the
vision of becoming a center of Excellence to provide Solutions, Services and Training in
various fields of technologies.
EEAST has the distinction of being a pioneer among the embedded companies in India,
engaged in imparting high-end training in all aspects of Embedded Systems Design and
Project development in various fields of engineering and technology for graduates,
undergraduates and postgraduates of the appropriate discipline, the training at EEAST is not
merely passing knowledge but build intelligence among the participants to achieve goals in
their life by thoroughly exposing them to industrial environment and projects. We work
on overall development of our employees and trainees.
EEAST is an organization providing advanced projects, complete electronic solutions in
development systems like microprocessor, micro - controllers, wireless communications,
optical fiber communications, real time operating systems, digital signal processing,
Embedded Systems and Micro - Sensors including software solution, solutions in C, C++,
Java, .Net, Visual, C++ Visual basic, embedded C and Embedded LINUX. We have been
roviding projects and solutions professionally to various industries, academically to
innumerable number of students. In our endeavor for excellence and manpower
developments in this field, we are providing on these technologies specially customized for
individual needs.

EEAST SIX WEEKS REPORT

Introduction
Microcontroller are widely used in Embedded System products. An Embedded product uses
the microprocessor(or microcontroller) to do one task & one task only. A printer is an example
of Embedded system since the processor inside it perform one task only namely getting the
data and printing it. Contrast this with Pentium based PC. A PC can be used for any no. of
applications such as word processor, print server, bank teller terminal, video game player,
network server or internet terminal. Software for variety of applications can be loaded and run.
Of course the reason a PC can perform multiple task is that it has RAM memory and an
operating system that loads the application software into RAM & lets the CPU run it. In and
Embedded system there is only one application software that is typically burn into ROM. An
x86PC Contain or its connected to various Embedded Products such as keyboard, printer,
modem, Disc controller, Sound card, CD-Rom Driver, Mouse & so on. Each one of these
peripherals as a microcontroller inside it that performs only one task. For example inside every
mouse there is microcontroller to perform the task of finding the mouse position and sending it
to PC.
Although microcontroller are preferred choice for many Embedded systems, There are times
that a microcontroller is inadequate for the task. For this reason in recent years many
manufactures of general purpose microprocessors such as INTEL, Motorolla, AMD & Cyrix
have targeted their microprocessors for the high end of Embedded market. While INTEL,
AMD, Cyrix push their x86 processors for both the embedded and desktop pc market,
Motorolla is determined to keep the 68000 families alive by targeting it mainly for high end of
embedded system.
One of the most critical needs of the embedded system is to decrease power consumptions and
space. This can be achieved by integrating more functions into the CPU chips. All the
embedded processors based on the x86 and 680x0 have low power consumptions in additions
to some forms of I/O, Com port & ROM all on a single chip. In higher performance Embedded
system the trend is to integrate more & more function on the CPU chip & let the designer
decide which feature he/she wants to use.

EEAST SIX WEEKS REPORT

MICROPROCESSOR (MPU)
A microprocessor is a general-purpose digital computer central processing
unit (CPU). Although popularly known as a computer on a chip is in no
sense a complete digital computer. The block diagram of a microprocessor
CPU is shown, which contains an arithmetic and logical unit (ALU), a
program counter (PC), a stack pointer (SP),some working registers, a clock
timing circuit, and interrupt circuits.

ARITHMETIC
AND
LOGICAL UNIT

ACCUMULATOR
WORKING REGISTERS
PROGRAM
COUNTER

STACK
POINTER

CLOCK
CIRCUIT

INTERRUPT
CIRCUITS

BLOCK DIAGRAM OF A MICROPROCESSOR

EEAST SIX WEEKS REPORT

MICROCONTROLLERS (MCU)
Figure shows the block diagram of a typical microcontroller, which is a true
computer on a chip. The design incorporates all of the features found in
micro-processor CPU: ALU, PC, SP, and registers. It also added the other
features needed to make a complete computer: ROM, RAM, parallel I/O,
serial I/O, counters, and clock circuit.

ALU

TIMER / COUNTER

I/O
PORT

ACCUMULATOR
I/O
PORT

REGISTERS

INTERNAL
RAM

INTERNAL
ROM

Interrupt
Circuits
CLOCK
CIRCUIT

ALU

PROGRAM COUNTER

BLOCK DIAGRAM OF A MICROCONTROLLER

EEAST SIX WEEKS REPORT

MICROCONTROLLER ARCHITECTURE
VARIOUS MICROCONTROLLERS


First microcontroller is 8031

FEATURES
(i) It is Intels product. Neither a microprocessor nor a microcontroller.
(ii) It is a 8-bit controller.
(iii) Internally no ROM is provided i.e. code is outside the chip.

Second microcontroller is 8051

FEATURES
(i) It is a first complete 8-bit microcontroller.
(ii) It is a name of a family. In which the instruction set, pin configuration,
architecture are same, only memory storage capacity is different.
(iii) Internally PROM (programmable read only memory) is provided so it
called one time programmable (OTP).

Third microcontroller is AT89C51

FEATURES
(i) It is a similar to 8051 microcontroller i.e. having same instruction set,
pin configuration, architecture.
(ii) It is a also 8-bit microcontroller. Its cost is only Rs10 more than 8051.
(iii) It uses EPROM (erasable programmable read only memory) or
FLASH memory.
(iv) it is Multiple time programmable (MTP)i.e. 1000 times. So it is better
than 8051.

ATMEL 89C51
It is a low-power, high-performance CMOS 8-bit microcomputer with 4K bytes of Flash
programmable and erasable read only memory (PEROM). The device is manufactured using
Atmels high-density nonvolatile memory technology and is compatible with the industrystandard MCS-51 instruction set and pin out. The on-chip Flash allows the program memory to
be reprogrammed in system or by a conventional nonvolatile memory programmer. By
combining a versatile 8- bit CPU with Flash on a monolithic chip, the Atmel AT89C51 is a
powerful microcomputer, which provides a highly flexible and cost-effective solution to many
embedded control applications

EEAST SIX WEEKS REPORT

THE 8051 MICROCONTROLLER


The 8051 provides the following standard features: 4Kbytes of ROM, 128 bytes of RAM,
32 I/O lines, two 16-bit timer/counters, a five vector two-level interrupt architecture, a full
duplex serial port, on-chip oscillator and clock circuitry. In addition, the 8051 is designed
with static logic for operation down to zero frequency and supports two software selectable
power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/
counters, serial port and interrupt system to continue functioning. The Power Down Mode
saves the RAM contents but freezes the oscillator disabling all other chip functions until
the next hardware reset.

The 8051 Microcontrollers Architecture consists of these


specific features

Eight-bit CPU with registers A (the accumulator) & B.

Sixteen-bit program counter (PC) and data pointer (DPTR).

Eight-bit program status word (PSW).

Eight-bit stack pointer (SP).

Internal ROM or EPROM (8751) of 0(8031) to 4K (8051).

Internal RAM of 128 bytes.


1. Four register banks, each containing eight registers.
2. Sixteen bytes, which may be addressed at the bit level.
3. Eight bytes of general-purpose data memory.

Thirty two I/O pins arranged as four-bit ports P0 P3.

Two 16-bit Timer/Counters T0 and T1.

Full duplex serial data receiver/transmitter (SBUF).

Control registers TCON, TMOD, SCON, PCON, IP and IE.

Two external and three internal interrupt sources.


Oscillator and clock circuits

EEAST SIX WEEKS REPORT

PIN DESCRIPTION

VCC -- Supply voltage.

GND -- Ground.

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 1s are written to port 0
pins, the pins can be used as high impedance inputs. Port0 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 ROM
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
Port1 output buffers can sink/source four TTL inputs. When 1s are written
to Port1 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 ROM programming and verification.

EEAST SIX WEEKS REPORT

Port 2 -- Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. The
Port2 output buffers can sink/source four TTL inputs. When 1s are written
to Port2 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. Port2 emits the highorder address byte during fetches from external program memory and
during accesses to external data memory that use 16-bit addresses
(MOVX @ DPTR). In this application it uses strong internal pull-ups when
emitting 1s. During accesses to external data memory 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
Port3 output buffers can sink/source four TTL inputs. When 1s are written
to Port3 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 receives some
control signals for ROM programming and verification. Port 3 also serves
the functions of various special features of the 8051.

Port Pin Alternate Functions


P3.0 RXD (serial input port)
P3.1 TXD (serial output port)
P3.2 INT0 (external interrupt 0)
P3.3 INT1 (external interrupt 1)
P3.4 T0 (timer 0 external input)
P3.5 T1 (timer 1 external input)
P3.6 WR (external data memory write strobe)
P3.7 RD (external data memory read strobe)

EEAST SIX WEEKS REPORT

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 ROM programming. In
normal operation ALE is emitted at a constant rate of 1/6 the oscillator
frequency, and may be used for external timing or clocking purposes.
Note, however, that one ALE pulse is skipped during each access to
external Data Memory. If desired, ALE operation can be disabled by
setting bit 0 of SFR location 8EH. With the bit set, ALE is active only
during a MOVX or MOVC instruction. Otherwise, the pin is weakly
pulled high. Setting the ALE - disable bit has no effect if the
microcontroller is in external execution mode.

PSEN -- Program Store Enable is the read strobe to external program


memory. When the 8051 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 12-volt programming enable voltage (VPP)
during Flash programming, for parts that require12-volt VPP.

XTAL1Input to the inverting oscillator amplifier and input to the


internal clock operating circuit.

XTAL2-- Output from the inverting oscillator amplifier.

EEAST SIX WEEKS REPORT

Memory Organization
There are two types of memory in microprocessor devices.

Program Memory

Data Memory

Each memory type has different addressing mechanism, different control signals and different
function. The Program Memory (ROM or EPROM) is extremely large, read only and nonvolatile. This has a 16-bit address bus, whose elements are accessed by program counter or
instructions that generates 16-bit address.
The Data Memory is a read/write memory space, which is smaller and hence quicker than
program memory. It goes into random state when the electric power is applied. On chip data
RAM is used for variables, which are determined or may change while program is running.

Up to 64KB of
External
ROM/PROM

Up to
60KB of
External
ROM/
PROM

Up to 64KB of
External
RAM

4KB of
Internal
ROM/
EPROM

SFRs and
128 bytes
RAM

Program Memory

Data Memory
Memory Mapping

EEAST SIX WEEKS REPORT

VARIOUS REGISTERS

THE PROGRAM STATUS WORD(PSW)


SF REGISTER

CY

AC

FO
5

RS1
4

RS0
3

OV

___
1

Bit Description
P
 Bit No.

Bit description

BIT

SYMBOL

FUNCTION

CY

AC

Carry flag used in arithmetics, jump, rotate, and rotat


and Boolean instructions.
Auxiliary Carry flag; used for BCD arithmetic.

FO

User Flag 0

RS1

Register Bank Select Bit 1

RS0

Register Bank Select Bit 0


RS1 RS0
0 0
0 1
1 0
1 1

Select Register bank 0


Select Register bank 1
Select Register bank 2
Select Register bank 3

OV

Overflow flag, used in arithmetic instruction.

___

Reserved for future use

Parity Flag; shows parity of register A

EEAST SIX WEEKS REPORT

SPECIAL FUNCTION REGISTERS

The 8051 operations that do not use the internal 128-byte Ram addresses
from 00h to 7Fh are done by a group of specific internal register, each
called a special function register (SFR).

NAME
A
B

FUNCTION

INTERNALRAM ADD.

ACCUMULATOR
ARITHMETIC

0E0
0F0

DPH
DPL

ADDRESSING EXTERNAL MEMORY


ADDRESSING EXTERNAL MEMORY

83
82

IE
IP
P0

INTERRUPT ENABLE CONTROL


INTERRUPT PRIORITY
INPUT/OUTPUT PORT LATCH

0A8
0B8
80

P1
P2
P3
PCON
PSW

INPUT/OUTPUT PORT LATCH


INPUT/OUTPUT PORT LATCH
INPUT/OUTPUT PORT LATCH
POWER CONTROL
PROGRAM STATUS WORD

90
0A0
0B0
87
0D0

SCON
SBUF

SERIAL PORT CONTROL


SERIAL PORT DATA BUFFER

98
99

WHAT
SP IS INTERNETWORK?
STACK POINTER
TMOD
TCON
TL0

TIMER/COUNTER MODE CONTROL


TIMER/COUNTER MODE CONTROL
TIMER 0 LOW BYTE

81
89
88
8A

TH0
TL1

TIMER 0 HIGH BYTE


TIMER 1 LOW BYTE

8C
8B

TH1

TIMER 0 HIGH BYTE

8D

EEAST SIX WEEKS REPORT

TIMER MODE CONTROL REGISTER(TMOD)


SFR

][

TIMER1

GATE
7

C/T
6

M1
5

M0
4

TIMER0

GATE
3
2

C/T
1

M1
0

M0
Bits
Bit No.

BIT DESCRIPTION
The various bits of TMOD register are explained below:

BIT

SYMBOL

FUNCTION

7/3

GATE

OR gate enable bit which controls RUN/STOP of Timer I/O.

6/2

C/T

Set to 1 by program to make timer I/O act as a counter by


counting pulses from external input pin3.5(T1) or 3.4(T0).

5/1

M1

Timer/Counter operating mode select bit1. Set /Cleared by


program to select mode.

4/0

M0

Timer/Counter operating mode select bit0. Set/Cleared by


program to select mode.

TMOD is not bit addressable.

EEAST SIX WEEKS REPORT

TIMER CONTROL (TCON)

TF1 TR1
7

TF0
5

TR0
4

IE1

IT1

IE0

IT0
Bits
Bit No.

BIT DESCRIPTION
The various bits of TCON registers are explained below:

BIT

SYMBOL

FUNCTION

TF1

Timer 1 overflow flag.

TR1

Timer 1 RUN control bit.

TF0

Timer 0 overflow flag.

TR0

Timer 0 RUN control bit.

IE1

External interrupt 1 edge flag.

IT1

External interrupt 1 single type control bit.

IE0

External interrupt 0 edge flag.

IT0

External interrupt 1 single type control bit.

EEAST SIX WEEKS REPORT

ADDRESSING MODES
The various addressing mode are immediate, register, direct and indirect.
Data is stored at a source address and moved (copied) to a destination
address. The ways by which these addresses are specified are called the
addressing modes. The 8051 mnemonics are written with the (data)
destination address named first, followed by the source address.

1. Immediate Addressing Mode

Instruction using #

Next bytes are data

source of
data only

2. Register Addressing Mode

Instruction using R0 to R7
Register R0 to R7 in current bank

Source or
destination of data

3. Direct Addressing Mode


Instruction using a RAM address
Address in RAM

Source or destination
data

4. Indirect Addressing Mode


Instruction using @ R0 or @R1
Register R0 or R1 in current bank Address of
data
Address in RAM

Source or destination
data

EEAST SIX WEEKS REPORT

Keil Software
Keil software is used for the software implementation of the developed system. Vision2
Integrated Development Environment is an IDE that encapsulates a project manager, make
facility, tool configuration, editor and a powerful debugger. Vision2 is used to write and
compile the programs using the tools. It can transfer the assembly language as well as, C code
into the hex file. Keil software consists of a Linker Control File, Map File, Project Target,
Source File Group, Toolset. Linker Control File

i) Linker control file


It is a text file that Vision passes to the linker when linking. The control file includes all
directives and names of object files and library files to include in the output file.

ii) Map File


The Map File is a listing file generated by the linker.

iii) Project Target:


In a project, a target is an executable program that is generated. A project may generate a
target that runs on an 8051. Targets may be created for builds with no optimization and for
builds with full optimization.

iv) Source File Group:


In a project, a group is a number of source files that compose the project target. Although you
may individually specify the toolset options for a file, a group lets you apply the same options
to a group of source files. The options for a group may be different from the options for the
target.

v) Toolset:
A toolset include an assembler, compiler, linker, HEX converter, debugger, and the other
associated tools for a particular device family like the 8051. All of the tools or programs in a
toolset are dedicated to generating target code for a specific family of chips [27].
To evaluate the software for correct operation the file was programmed into the
microcontroller on the relevant development board. Programming of the microcontroller was
achieved using the VPL-SPROG programmer. It is a handy serial programmer. This permits
hexadecimal files to be loaded into the microcontroller. Initially the microcontroller was
programmed by removing it from the socket on the board and inserting it into the multi-pin
socket on the programmer.
Section 4.2 describes the programming model and instruction set and section 4.3 describes the
algorithm.

EEAST SIX WEEKS REPORT

Power Supply
The power supply supplies the required energy for both the microcontroller and the associated
circuits. It is the most essential part of the circuit because to run its constituent ICs circuit has
to be provided with power. These ICs can run on DC power. Hence the required D.C supply
has to be generated. The main parts of a power supply unit and their function are as follows:

D1

LM7805

1N4007

1000uf

D2
3
2
1

gnd

VOUT

+5V

C1

J1

VIN

GND

V
D3

D4

Power supply schematic

DESCRIPTION
Power supply is the main requirement of every project. The various parts of a

power supply

are explained below:

Transformer: The function of the transformer is to step down the voltage level from
the available A.C.220V to the desired voltage. The 9-0-9 rating of the transformer upon
the requirements of the ICs in the circuit is used. The secondary has a center tapping
which forms the neutral terminal.

Bridge rectifier: The function of the rectifier is to convert the alternating voltage
signal into a unidirectional one. This function is provided by semiconductor diodes
connected in bridge configuration. Diodes 1N4007 are used as rectifier.

Ripple Rejection: The output voltage of the rectifier is unidirectional but pulsating. A
capacitor of 1000f is used for ripple rejection.

Regulation: To obtain a constant voltage specific ICs are used as voltage regulator.
Voltage regulator LM7805 is used. These ICs have three terminals an input, an output
and a ground terminal.

EEAST SIX WEEKS REPORT


LCD Display
Liquid crystal displays (LCD) are widely used in recent years as compares to LEDs.
This is due to the declining prices of LCD, the ability to display numbers, characters and
graphics, incorporation of a refreshing controller into the LCD, their by relieving the CPU
of the task of refreshing the LCD and also the ease of programming for characters and
graphics. HD 44780 based LCDs are most commonly used.
LCD pin description
The LCD discuss in this section has the most common connector used for the Hitatchi
44780 based LCD is 14 pins in a row and modes of operation and how to program and

16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1

Gnd
Vcc
D7
D6
D5
D4
D3
D2
D1
D0
E
R/W
RS
Contrast
Vcc
Gnd

16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1

interface with microcontroller is describes in this section.

LCD Pin Description Diagram

VCC, VSS, VEE


The voltage VCC and VSS provided by +5V and ground respectively while VEE is
used for controlling LCD contrast. Variable voltage between Ground and Vcc is used to
specify the contrast (or "darkness") of the characters on the LCD screen.
RS (register select)
There are two important registers inside the LCD. The RS pin is used for their selection as
follows. If RS=0, the instruction command code register is selected, then allowing to user
to send a command such as clear display, cursor at home etc.. If RS=1, the data register is
selected, allowing the user to send data to be displayed on the LCD.
R/W (read/write)

EEAST SIX WEEKS REPORT


The R/W (read/write) input allowing the user to write information from it. R/W=1, when it
read and R/W=0, when it writing.
EN (enable)
The enable pin is used by the LCD to latch information presented to its data pins. When
data is supplied to data pins, a high power, a high-to-low pulse must be applied to this pin
in order to for the LCD to latch in the data presented at the data pins.
D0-D7 (data lines)
The 8-bit data pins, D0-D7, are used to send information to the LCD or read the contents of
the LCDs internal registers. To displays the letters and numbers, we send ASCII codes for
the letters A-Z, a-z, and numbers 0-9 to these pins while making RS =1. There are also
command codes that can be sent to clear the display or force the cursor to the home
position or blink the cursor.
We also use RS =0 to check the busy flag bit to see if the LCD is ready to receive the
information. The busy flag is D7 and can be read when R/W =1 and RS =0, as follows: if
R/W =1 and RS =0, when D7 =1(busy flag =1), the LCD is busy taking care of internal
operations and will not accept any information. When D7 =0, the LCD is ready to receive
new information.
14.7 Interfacing of micro controller with LCD display
In most applications, the "R/W" line is grounded. This simplifies the application
because when data is read back, the microcontroller I/O pins have to be alternated between
input and output modes. In this case, "R/W" to ground and just wait the maximum amount
of time for each instruction (4.1 msecs for clearing the display or moving the cursor/display
to the "home position", 160 usecs for all other commands) and also the application
software is simpler, it also frees up a microcontroller pin for other uses. Different LCD
execute instructions at different rates and to avoid problems later on (such as if the LCD is
changed to a slower unit). Before sending commands or data to the LCD module, the
Module must be initialized. Once the initialization is complete, the LCD can be written to
with data or instructions as required. Each character to display is written like the control
bytes, except that the "RS" line is set. During initialization, by setting the "S/C" bit during
the "Move Cursor/Shift Display" command, after each character is sent to the LCD, the

EEAST SIX WEEKS REPORT


cursor built into the LCD will increment to the next position (either right or left). Normally,
the "S/C" bit is set (equal to "1")

Interfacing of Microcontroller with LCD

EEAST SIX WEEKS REPORT


ANALOG TO DIGITAL CONVERTER
The ADC (0808) data acquisition component is a monolithic CMOS device with 8-bit
analog to digital converter, 8-channel multiplexer and microprocessor compatible control logic.
The Pin diagram for the ADC 0809 is shown in figure 3.5

IN3

28

IN2

IN4

27

IN1

IN5

26

IN6

25

IN0
ADD A

IN7

24

ADD B

START

23

ADD C

EOC
2-5

22

ALE

21

2-1 MSB

OUTPUT ENABLE
CLOCK

20

2-2

10

19

2-3

VCC

11

18

2-4

VREF (+)

12

17

GND

13

16

2-8 LSB
VREF (+)

Some of the specifications of ADC (0808) are, Resolution of 8 bits, 100 s Conversion
time, Radiometric Conversion, Monotonic Over the entire A/D Conversion Range, No
Missing Codes, Clock range 50 to 800 kHz. It is Easy Interface to all Microprocessors,
Microcontroller and Operates ratio metrically or with 5 VDC or analog span adjusted
voltage reference. The 8bit A /D converter uses successive approximation as the
conversion technique. The converter features a high impedance chopper stabilized
comparator, a 256R voltage divider with analog switch tree and a successive approximation
register.

The 8-channel multiplexer can directly access any of 8-single-ended analog

signals. The device eliminates the need for external zero and full-scale adjustments. Easy
interfacing to microprocessor, microcontroller is provided by the latched and decoded
multiplexer address inputs and latched TTL Tri-State outputs.

Incorporating the most

desirable aspects of several A/D conversion techniques has optimized the design of the
ADC 0808. The ADC 0808 offers high speed, high accuracy, minimal temperature

EEAST SIX WEEKS REPORT


dependence, excellent long term accuracy and repeatability, and consume minimum power.
These features make this device ideally suited to applications from process and machine
control to consumer and automotive applications. The 8-channel multiplexer can be
controlled by a microcontroller through a 3-bit address decoder with address load to select
any one of eight single-ended analog switches connected directly to the comparator.
Channel 0 of the multiplexer has been selected permanently by grounding the address pins
of multiplexer in the electronics hardware i.e. Pin no. 23, Pin no. 24 and Pin no. 25. The
comparison and the converting methods used eliminate the possibility of missing codes,
nonmonotonicity, and the need for zero or full-scale adjustment. Also featured are latched
3-state outputs from the SAR and latched inputs to the multiplexer address decoder. The
single 5V supply and low power requirements make the ADC 0808 especially useful for a
wide variety of applications. Ratio metric conversion is made possible by access to the
reference voltage input terminals. The ADC 0809 are characterized for operation from 40
0 C to 85 0 C. The ADC 0809/0808 contains a network with 256-300W resistors in series.
Analog switch taps are made at the junction of each resistor and at each end of the network.
In operation, a reference of 5V is applied across the network of 256 resistors. An analog
input VIN is first compared to the center point of the ladder via the appropriate switch. If
VIN is larger than VREF / 2, the internal logic changes the switch points and now
compares VIN and VREF. This process, known as successive approximation, continues
until the best match of VIN and VREF is made. N defines a specific tap of the resistor
network. When the conversion is complete, the logic loads a binary word corresponding to
this tap into the output latch and an end of conversion (EOC) logic level appears. The
output latch holds this data valid until a new conversion is completed and new data is
loaded into the latches. The data transfer occurs in about 100ns so that valid data is present
virtually all the time in the latches. The data outputs are activated when the output enable is
high, and in TRI-STATE when output enable is low. The enable delay time is
approximately 100ns.each conversion requires 40 clock periods. The device may be
operated in the free running mode by connecting the start conversion line to the end of
conversion line. However, to ensure start-up under all possible conditions, an external start
conversion pulse is required during power up conditions.

The EOC line (pin 7) will be in

the low state for a maximum of 40 clock periods to indicate busy. A START pulse that
occurs while the A/D is BUSY will reset the SAR and start a new conversion with the EOC
signal remaining in the low state until the end of this new conversion. When the conversion

EEAST SIX WEEKS REPORT


is complete, the EOC line will go to the high voltage state. An additional 4 clock periods
must be allowed to elapse after EOC goes high, before a new conversion cycle is requested.
Start conversion pulses that occurs during this last 4 clock period interval may be ignored.
This is a problem only for high conversion rates and keeping the number of conversions
per second less than fCLOCK/44 automatically guarantees proper operation. For example,
for an 800 KHz clock approximately 18,000 conversions per second are allowed. The
reference applied across the 256 networks determines the analog input range. A reference
voltage of 5V is applied to the pin number 12 of the ADC 0808. Since the conversion
completes with in 256 steps. By using VREF = 5V, each step have voltage of 20mv as 5 /
256 = 20mv.The pin numbers 1, 2, 3, 4, 5, 26, 27, 28 of the ADC 0808 describes the 8
multiplexer channels. Any channel can be selected by using three address bits ADDA (pin
25), ADDB (pin 24), ADDC (pin 23). In the hardware channel (INO) pin number 26 is
selected permanently by grounding ADDA, ADDB, ADDC.
The 8-bit digital output we are getting at the pin numbers 21, 20, 19, 18, 8, 15, 14, 17 of
ADC 0808 are connected to port 2 of the 8051 microcontroller. Pin10 of ADC 0809 is for
CLK input. Since ADC 0808 have clock between 50 KHz to 800 KHz. A reference of 5V
is provided at pin12 of ADC 0809. Pin number 16 is grounded and pin 22 is (ALE). ADC
(0808) is low cost IC, cost only RS. 125/- and easily available.

Block diagram of Analog to Digital Converter 0808

13.3 555 TIMER:

EEAST SIX WEEKS REPORT

The 555 Timer is used to provide frequency to ADC. The 555 timer IC was first introduced
around 1971 by the signetics corporation as the SE555/NE555 and was called The IC Time
Machine and was also the very first and only commercial timer IC available. It provided
circuit designers with the relatively cheep, stable and user friendly IC for both monostable and
astable applications. The 555 timer use on both analog and digital electronics techniques to
perform its function, but if we consider its o/p only it can be thought of as a digital device. The
o/p of 555 timer can be in one of the two states at any time, which mean it is a digital O/p.

LOW is also known as space for logic 0.

HIGH is also known as mark for logic 1.

13.3.1 Pin Description of 555 TIMER:


Power supply:
Pin 8 is used to connect the positive power supply (Vs) to the 555. This can be any voltage
between 3V and 15V DC, but is commonly 5V DC when working with digital ICs. Pin 1 is the
0V connection to the power supply.
Trigger and Reset Inputs:
Pin 2 is called the trigger input as it is this input that sets the output to the high state. Pin 4 is
called the reset input as it is this input that resets the o/p to the low state. Both pins may be
connected to push buttons to control the operation of the 555.Sometimes the reset input is not
used in a circuit, in which case it is connected directly to Vs to that unwanted resetting cant
occur.
Threshold and discharge:

EEAST SIX WEEKS REPORT


Pins 6 and7 (and sometimes the Trigger i/p, pin2) are used to set up the timing aspect of the
555 IC. They are normally connected to a combination of resistors and a capacitor.
Offset:
Pin 5 can be used to alter the timing aspect of the 555 IC in applications such as frequency
modulation.
Output:
Pin 3 is the digital output of the 555.It can be connected directly to the inputs of other digital
ICs, or it can control other devices with the help of a few extra components.
-

6
22
START
ALE

25
24
23
A0
A1
A2

13

ADC0809

30

11

EA/VPP

AT89C52

U?

20

OE
EOC

ALE/PROG

29

CLK

C?
CAP NP

PSEN

10
11
12
13
14
15
16
17

9
7

31

CRYSTAL

XTAL1
XTAL2
RST

P3.0/RXD
P3.1/TXD
P3.2/INTO
P3.3/INT1
P3.4/TO
P3.5/T1
P3.6/WR
P3.7/RD

SW3

REF+
REF-

Y?

P1.0/T2
P1.1/T2-EX
P1.2
P1.3
P1.4
P1.5
P1.6
P1.7

SW2

21
22
23
24
25
26
27
28

10

19
18
9

SW1

P2.0/A8
P2.1/A9
P2.2/A10
P2.3/A11
P2.4/A12
P2.5/A13
P2.6/A14
P2.7/A15

12
16

1
2
3
4
5
6
7
8

VCC

40

P0.0/AD0
P0.1/AD1
P0.2/AD2
P0.3/AD3
P0.4/AD4
P0.5/AD5
P0.6/AD6
P0.7/AD7

17
14
15
8
18
19
20
21

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

39
38
37
36
35
34
33
32

D0
D1
D2
D3
D4
D5
D6
D7

U?

LCD

CON16

IN0
IN1
IN2
IN3
IN4
IN5
IN6
IN7

J?

26
27
28
1
2
3
4
5

Buzzer

+ 2

C?

LM555

R?
R

7805

+
0

CV

VOUT

TR

VIN

U?

4 4

1
T?

TRANSFORMER

220V AC

0-12V
1

THR

VS+ VOUT

DIS

LM 35
1

Output 5V DC

Title
<Title>

DIODE BRIDGE
Size
A
Date:

Document Number
<Doc>
Friday , May 18, 2007

Rev
<Rev Code>
Sheet

of

EEAST SIX WEEKS REPORT


Interfacing of MCU with LED:A light-emitting diode (LED) is a semiconductor diode that emits incoherent narrowspectrum light when electrically biased in the forward direction of the p-n junction. This effect
is a form of electroluminescence.
An LED is usually a small area source, often with extra optics added to the chip that shapes its
radiation pattern. The color of the emitted light depends on the composition and condition of
the semiconducting material used, and can be infrared, visible, or near-ultraviolet. An LED can
be used as a regular household light source

VCC
D1
LED
D2
U?

LED
39
38
37
36
35
34
33
32

D3
LED
D4

1
2
3
4
5
6
7
8

LED
D5
LED

Y?

19
18
9

CRY STAL

31

D6
LED
D7

C?
CAP NP

R1
R
D8
LED

Device interfacing with MCU

P1.0/T2
P1.1/T2-EX
P1.2
P1.3
P1.4
P1.5
P1.6
P1.7
XTAL1
XTAL2
RST

P2.0/A8
P2.1/A9
P2.2/A10
P2.3/A11
P2.4/A12
P2.5/A13
P2.6/A14
P2.7/A15
P3.0/RXD
P3.1/TXD
P3.2/INTO
P3.3/INT1
P3.4/TO
P3.5/T1
P3.6/WR
P3.7/RD
PSEN
ALE/PROG

EA/VPP

AT89C52

LED

40

P0.0/AD0
P0.1/AD1
P0.2/AD2
P0.3/AD3
P0.4/AD4
P0.5/AD5
P0.6/AD6
P0.7/AD7

20

21
22
23
24
25
26
27
28
10
11
12
13
14
15
16
17
29
30

EEAST SIX WEEKS REPORT

Figure no 2.15: Electromagnetic Solenoid Valve

The electromagnetic relay consists of a multi-turn coil, wound on an iron core, to form an electromagnet. When
the coil is energised, by passing current through it, the core becomes temporarily magnetised. The magnetised
core attracts the iron armature. The armature is pivoted which causes it to operate one or more sets of contacts.
When the coil is de-energised the armature and contacts are released. The coil can be energised from a low power
source such as a transistor while the contacts can switch high powers such as the mains supply. The relay can also
be situated remotely from the control source. Relays can generate a very high voltage across the coil when
switched off. This can damage other components in the circuit. To prevent this a diode is connected across the
coil.

As there are always some chances of high voltage spikes back from the switching circuit i.e. heater so an
optocoupler/isolator MCT2e is used. It provides and electrical isolation between the microcontroller and the
heater. MCT2e is a 6-pin IC with a combination of optical transmitter LED and an optical receiver as
phototransistor. Microcontroller is connected to pin no 2 of MCT2e through a 470-ohm resistor. Pin no.1 is given
+5V supply and pin no.4 is grounded.
To handle the current drawn by the heater a power transistor BC-369 is used as a current driver. Pin no.5 of
optocoupler is connected to the base of transistor. It takes all its output to Vcc and activates the heater through
relay circuit. The electromagnetic relay consists of a multi-turn coil, wound on an iron core, to form an
electromagnet. When the coil is energized, by passing current through it, the core becomes temporarily
magnetized. The magnetized core attracts the iron armature. The armature is pivoted which causes it to operate
one or more sets of contacts. When the coil is de-energised the armature and contacts are released. Relays can
generate a very high voltage across the coil when switched off. This can damage other components in the circuit.
To prevent this a diode is connected across the coil. Relay has five points. Out of the 2 operating points one is
permanently connected to the ground and the other point is connected to the collector side of the power transistor.

EEAST SIX WEEKS REPORT


When Vcc reaches the collector side i.e. signal is given to the operating points the coil gets magnetized and attracts
the iron armature. The iron plate moves from normally connected (NC) position to normally open (NO) position.
Thus the heater gets the phase signal and is ON. To remove the base leakage voltage when no signal is present a
470-ohm resistance is used.

J4
phase
5 NC
3

D11

4
1
2

6
5

VCC
2
R2

From P3.0 of
microcontroller

4
MCT2E

R4
BC-369

1
2

RELAY
VCC

NO

HEATER

EEAST SIX WEEKS REPORT


Controlling the Seven Segment Display

The diagram below illustrates an arrangement showing


how a seven segment display can be interfaced along with
switch inputs.

Note the RA0 and RA1 port bits are connected to


both the A1, A0 Switches, the transistor drivers to select the display
digits.

To drive the display, the RA0 and RA1 bits are configured as
outputs.To input from the two switches, the RA0 and RA1 bits
are configured as inputs. The two 10K resistors prevent
damage to the port when configured as outputs and a switch
is closed.
30

EEAST SIX WEEKS REPORT


 USER INTERFACE

The user interface is the aggregate of means by which people (the users)
Interact with a particular machine, device, computer program or other
complex tool (the system). The user interface provides means of: * Input,
allowing the users to control the system* & Output, allowing the system
to inform the users (also referred to as feedback). A good user interface
makes it easy for users to do what they want to do.
The junction between a user and a computer program. An interface is a
set of commands or menus through which a user communicates with a
program. A command-driven interface is one in which you enter
commands. A menu-driven interface is one in which you select command
choices from various menus displayed on the screen. The user interface
is one of the most important parts of any program because it determines
how easily you can make the program do what we want to. It is widely
accepted that the user interface can make a critical difference in the
perceived utility of a system regardless of the system's performance.

D.C. MOTOR
Working Principle:
The principle upon which the d.c. motor works is very simple . If a
current carrying conductor is placed in a magnetic field, mechanical
force is experienced on the conductor, the direction of which is given
by the Fleming's left hand rule and hence the conductor moves in the
direction of force. The magnitude of the mechanical force experienced
on the conductor is given by:
F = B Ic Lc newtons

where B is the field strength in teslas ,

EEAST SIX WEEKS REPORT


Ic is the current flowing through the conductor in amperes
and Lc is the length of the conductor in metres.

When the motor is connected to the d.c. supply mains a direct


current passes through the brushes and the
commutator to the armature winding ; while it passes through the
commutator it is converetd into a.c. so that the group of conductors
under successive field poles carry currrent in the opposite direction.
Also the direction of the currrent in the individual conductors reverse
as they pass away from the influence of one pole to that of the next.

The split phase arrangement of the motor creates two fluxes B1and B2 which
induces voltage around them in the rotor and under the influence of these induced
voltages current flows in the rotor. The current i1 produced by flux B1 reacts with flux
B2 and develops force F1.The quantities are going to be expressed as :

B1=B1max . sin(wt)
B2=B2max . sin(wt + )
It may be assumed with negligible error thet the paths in which the
rotor current flow has negligible self-inductance and hence the rotor
currents are in phase with their respective voltages.
i1(db1/dt)=.B1max.cos wt

EEAST SIX WEEKS REPORT

i2(db2/dt)=K. B2 max.cos (wt +X)

Since the two forces (f1and f2 ) developed are in opposition

.Therefore the net force F acting on the movable element is given as:
F=F2-F1(B2.i1-i2.b1)
F=K B1 max.B2 max sin r)
EMF Equation:
Back EMF, Eb=Flux *ZNP/60A
where
Z= total number of armature cunductors
N= Speed in r.p.m
P= total number of poles
A= Total number of parallel paths.
V= Eb + IaRa
.
Ia= (V - Eb)/Ra
where
V = Terminal voltage
Ia= Armature current

EEAST SIX WEEKS REPORT

Ra= Armature resistance


Eb= back e.m.f.
Types of D.C. motor:

(i) Permanent magnet motors: It consists of an armature and one or

several permanent magnets encircling the armature . Field coils are


usually notrequired. However some of these motors do have coils
wound on the poles .
If they exist , these coils are intended only for recharging the magnets
in the event that they loose their strength.

(ii) Seperately excited D.C. motors: These motors have field coils

similar to those of a shunt wound machine, but the armature and field
coils are fed from diferent supply sources and may have different
voltage ratings.

(iii) Series wound D.C. motor: As the name indicates, the field coils,

EEAST SIX WEEKS REPORT

consisting of few turns of a thick wire are connected in series with the
armature. The cross-sectional area of the wire used for the field has to
be fairly large to carry the armature current ,but owing to the higher
current , the number of turns of wire in them need not be large.

(iv) Shunt wound D.C. motor: These motors are so named because

they basically operate with field coils connected in parallel with the
armature.
The field winding consists of a large number of turns of comparatively
fine wire so as to provide large resistance. The field current is much
less than the armature current, sometimes as low as 5%.

(v) Compound wound D.C. motor : A compound wound D.C.

motor has both shunt and series field coils. The shunt field is normally
stronger of the two. Compound wound motors are of two types:.
(a) Cumalative compound wound motor.
(b) Differential compound wound motor.

EEAST SIX WEEKS REPORT

EEAST SIX WEEKS REPORT

Stepper Motor
Motion Control, in electronic terms, means to accurately control the movement of an object based on either speed,
distance, load, inertia or a combination of all these factors. There are numerous types of motion control systems,
including; Stepper Motor, Linear Step Motor, DC Brush, Brushless, Servo, Brushless Servo and more.
A stepper motor is an electromechanical device which converts electrical pulses into discrete mechanical
movements. Stepper motor is a form of ac. motor .The shaft or spindle of a stepper motor rotates in discrete step
increments when electrical command pulses are applied to it in the proper sequence. The motors rotation has
several direct relationships to these applied input pulses. The sequence of the applied pulses is directly related to
the direction of motor shafts rotation. The speed of the motor shafts rotation is directly related to the frequency of
the input pulses and the length of rotation is directly related to the number of input pulses applied [39].
For every input pulse, the motor shaft turns through a specified number of degrees, called a step. Its
working principle is one step rotation for one input pulse. The range of step size may vary from 0.72 degree to 90
degree. In position control application, if the number of input pulses sent to the motor is known, the actual
position of the driven job can be obtained.
A stepper motor differs from a conventional motor (CM) as under:

a.

Input to SM is in the form of electric pulses whereas input to a CM is invariably from a constant voltage
source.

b.

A CM has a free running shaft whereas shaft of SM moves through angular steps.

c.

In control system applications, no feedback loop is required when SM is used but a feedback loop is
required when CM is used.

d.

A SM is a digital electromechanical device whereas a CM is an analog electromechanical device [40].

3.12.1Open Loop Operation


One of the most significant advantages of a stepper motor is its ability to be accurately controlled in an open loop
system. Open loop control means no feedback information about position is needed. This type of control
eliminates the need for expensive sensing and feedback devices such as optical encoders. Control position is
known simply by keeping track of the input step pulses [39].
Every stepper motor has a permanent magnet rotor (shaft) surrounded by a stator. The most common
stepper motor has four stator windings that are paired with a center-tapped common. This type of stepper motor is
commonly referred to as a four- phase stepper motor. The center tap allows a change of current direction in each
of two coils when a winding is grounded, thereby resulting in a polarity change of the stator. Notice that while a
conventional motor shaft runs freely, the stepper motor shaft moves in a fixed repeatable increment which allows
one to move it to a precise position. This repeatable

EEAST SIX WEEKS REPORT

Fig 3.20: Rotor Alignment

fixed movement is possible as a result of basic magnetic theory where poles of the Same polarity repel and
opposite poles attract. The direction of the rotation is dictated by the stator poles. The stator poles are determined
by the current sent through the wire coils. As the direction of the current is changed, the polarity is also changed
causing the reverse motion of the rotor. The stepper motor used here has a total of 5 leads: 4 leads representing the
four stator windings and 1 common for the center tapped leads. As the sequence of power is applied to each stator
winding, the rotor will rotate. There are several widely used sequences where each has a different degree of
precision. Table shows the normal 4-step sequence. For clockwise go for step 1 to 4 & for counter clockwise go
for step 4 to 1.

Winding A

1
2
3

Winding C

Winding B

Winding D

Fig 3.21: Stator Windings Configuration

Step

Winding A

Winding B

Winding C

Winding D

EEAST SIX WEEKS REPORT


3

Table 3.6: Input Sequence to the Windings

3.12.2 Step Angle & Steps per Revolution


Movement associated with a single step, depends on the internal construction of the motor, in particular the
number of teeth on the stator and the rotor. The step angle is the minimum degree of rotation associated with a
single step.
Step per revolution is the total number of steps needed to rotate one complete rotation or 360 degrees (e.g., 180
steps * 2 degree = 360) [31].
Since the stepper motor is not ordinary motor and has four separate coils, which have to be energized
one by one in a stepwise fashion. We term them as coil A, B, C and D. At a particular instant the coil A should get
supply and then after some delay the coil B should get a supply and then coil C and then coil D and so on the
cycle continues. The more the delay is introduced between the energizing of the coils the lesser is the speed of the
stepper motor and vice versa.

Anda mungkin juga menyukai