Sei sulla pagina 1di 58

CHAPTER 1.

OVERVIEW

1
1.1 INTRODUCTION

Data acquisition is the process of gathering signals from the measurement sources and
digitizing those signals for storage and analysis. The data of the real world are translated into signals
that can be manipulated by the computer. A Data acquisition system comprises of signal source, signal
connection, signal conditioning and signal measurement. Signal source is a transducer to measure
physical phenomena. Signal conditioning is the process of amplification, filtering and isolation.

1.2 AIM OF THE PROJECT:

This Project deals with development of multi-channel analog data though a PC. It uses an
ADC acd0808 to convert from analog to digital. A microcontroller to control the ADC and send data
to mobile through at the baud rate of 9600. And a MAX 232 chip to convert the RS232 signal. The
ADC0808 and ADC0809 each consists of an analog signal multiplexer, an 8-bit successive-
approximation converter, and related control and output circuitry. The analog multiplexer selects 1 of
8 single-ended input channels as determined by the address decoder.

1.3 METHODOLOGY:

Here microcontroller generates three bit data and applies it to the ADC. Using these bits as
selection bits it selects a channel among the available eight channels.This ADC consists a 8 to 1
multiplexer. so analog signal generated by the sensors will be converted into digital form.This digital
signal is given to the PC via MAX232.
Since serial communication is used for communication with PC the logical levels to be
changed. This is done by MAX232.The result will be displayed on a display system.

2
1.4 IMPORTANCE AND APPLICATIONS:

The existing project can be used for limited purpose, which it can be further improved to its
next generation for a large number of appliances.
1.Automatic control of out door lighting system using light dependant resistor as a sensing element.
2.Door locking system using digital gadget locking.

3
CHAPTER 2. DESCRIPTION OF COMPONENTS

2.1 POWER SUPPLY CIRCUIT:

There are many types of power supply. Most are designed to convert high voltage AC
mains electricity to a suitable low voltage supply for electronics circuits and other devices. A power
supply can by broken down into a series of blocks, each of which performs a particular function. They

4
are Transformer, Rectifier, Smoothing component and Regulator. The power supply circuit generating
5V and 12V DC voltages is shown in figure.

FIGURE 1.1: CIRCUIT DIAGRAM OF A REGULATED POWER SUPPLY

The components of the power supply circuit are described below along with output
graph.

Transformer:

5
A transformer steps down high voltage AC mains to low voltage AC. Here we are using a
center-tap transformer of 18v-0-18v, 1A. The transformer output is given to the rectifier circuit. The
transformer component with its output voltage is shown in figure 1.3.

FIGURE 1.2: TRANSFORMER OUTPUT VOLTAGE

Rectifier:

A rectifier converts AC to DC, but the DC output is varying. There are several types of
rectifiers; here we use a bridge rectifier.

The Bridge rectifier is a circuit, which converts an ac voltage to dc voltage using both
half cycles of the input ac voltage. The Bridge rectifier circuit is shown in the figure 1.4. The circuit
has four diodes connected to form a bridge. The ac input voltage is applied to the diagonally opposite
ends of the bridge. The load resistance is connected between the other two ends of the bridge.

For the positive half cycle of the input ac voltage, diodes D1 and D3 conduct, whereas
diodes D2 and D4 remain in the OFF state. The conducting diodes will be in series with the load
resistance RL and hence the load current flows through RL. For the negative half cycle of the input ac
voltage, diodes D2 and D4 conduct whereas D1 and D3 remain OFF. The conducting diodes D2 and
D4 will be in series with the load resistance RL and hence the current flows through RL in the same
direction as in the previous half cycle. Thus a bi-directional wave is converted into unidirectional.

6
FIGURE 1.3: RECTIFIER DIAGRAM

The output waveform of the rectifier is shown in figure.

The varying DC output is suitable for lamps, heaters and standard motors. It is not suitable for
electronic circuits unless they include a smoothing capacitor.

7
Regulator:

Regulator eliminates ripple by setting DC output to a fixed voltage. Voltage regulators ICs are
available with fixed (typically 5, 12 and 15V) or variable output voltages. Negative voltage regulators
are also available. We have used 2 regulators in the power supply circuitry namely 7805 and 7812 for
5v and 12v dc voltage. At the output of the regulator, a 0.1µf capacitor is used in order to avoid any
high frequency voltage spikes at the output.

2.2 AT89C52 MICRO-CONTROLLER

FEATURES:

 Compatible with MCS-51TM Products


 8 Kbytes of In-System Reprogram able Flash Memory- Endurance: 1,00Write/Erase Cycles
 Fully Static Operation: 0 Hz to 24 MHz
 Three-Level Program Memory Lock
 256 x 8-Bit Internal RAM
 32 Programmable I/O Lines
 Three 16-Bit Timer/Counters
 Eight Interrupt Sources
 Programmable Serial Channel
 Low Power Idle and Power Down Modes

DESCRIPTION:
The AT89C52 is a low-power, high-performance CMOS 8-bit microcomputer with 4
Kbytes of Flash Programmable and Erasable Read Only Memory (PEROM). The device is
manufactured using Atmel’s high-density non-volatile memory technology and is compatible with the

8
industry standard MCS-51Ô instruction set and pin out. The on-chip Flash allows the program
memory to be reprogrammed in-system or by a conventional non-volatile memory programmer. By
combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C52 is a powerful
microcomputer, which provides a highly flexible and cost effective solution to many embedded
control applications.
2.2.1 ARCHITECTURE OF AT89C52:

9
2.2.2 PIN CONFIGURATION:

Pin Description:

Fig.2.1Pin Diagram Of 8052

10
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. 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
memory that uses 16-bit addresses (MOVX @ DPTR). In this application, it uses strong internal pull-
ups when emitting 1s. During accesses to external data memory that uses 8-bit addresses (MOVX @
RI); Port 2 emits the contents of the P2 Special Function Register. Port 2 also receives the high-order
address bits and some control signals during Flash programming and verification.

11
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 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)
WR (external data memory Write
P3.6
strobe)
RD (external data memory read
P3.7
strobe)

Table 2.1. Pin Functions Of Port 3


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/6 the oscillator frequency, and may be used
for external timing or clocking purposes. Note, however, that one ALE pulse is skipped during each

12
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 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 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 require 12-volt VPP.

XTAL1:
Input to the inverting oscillator amplifier and input to the internal clock operating circuit.

XTAL2:
Output from the inverting oscillator amplifier

13
2.2.3 MEMORY ORGANIZATION:

The 89c52 micro controller has separate address for program memory and data
memory. The logical separation of program and data memory allows the data memory to
be accessed by 8-bit address, which can be quickly stored and manipulated by an 8-bit
CPU. Nevertheless, 16-bit data memory address can also be generated through the DPTR
register. Program memory (ROM, EPROM) can only be read, not written to. There can
be up to 64k bytes if program memory the lowest 4k bytes of program are on chip. In the
ROM less versions, all program memory is external. The read strobe for external program
is the PSEN (program store enable). Data memory (RAM) occupies a separate address
space from program memory the lowest 128 bytes of data memory are on chip. Up to 64
bytes of external RAM can be addressed in the external data memory space. In the ROM
less version, the lowest 128bytes of data memory are on chip. The CPU generates read
and write signals, RD and WR, as needed during external data memory access. External
program memory may be combined if desired by applying the RD and PSEN signals to
the inputs of an AND gate and using the output of the gate as the read strobe to the
external program/data memory.

The 128 byte of RAM are divided into 3 segments

a). Register banks 0 – 3 (00 – 1FH)


b). Bit addressable area (20H – 2FH)
c). Scratch pad area (30H – 7FH)

If the SP is initialized to this area enough bytes should be left aside


to prevent SP data destruction.

14
Register Banks:

The 8051 use 8 "R" registers, which are used in many of its instructions. These
"R" registers are numbered from 0 through 7 (R0, R1, R2, R3, R4, R5, R6, and R7).
These registers are generally used to assist in manipulating values and moving data from
one memory location to another.

For example: To add the value of R4 to the Accumulator, we would execute the
following instruction.

ADD A, R4

Thus if the Accumulator (A) contained the value 6 and R4 contained the value 3,
the Accumulator would contain the value 9 after this instruction was executed. However,
as the memory map shows, the "R" Register R4 is really part of Internal RAM.
Specifically, R4 is address 04h. This can be seeing in the bright green section of the
memory map. Thus the above instruction accomplishes the same thing as the following
operation:
ADD A, 04h

This instruction adds the value found in Internal RAM address 04h to the value of
the Accumulator, leaving the result in the Accumulator. Since R4 is really Internal RAM
04h, the above instruction effectively accomplished the same thing.

2.2.5 SPECIAL FUNCTION REGISTERS:


A and B REGISTERS:
They are used during math and logically operations. The register A is also
used for all data transfers between the micro controller and memory. The B register
is used during multiplication and divided operations. For other instructions it can be
treated as another scratch pad register.

PSW: It contains math flags; user flags F0 and register select bits RS1 and RS0
to determine the working register bank.

Fig.2.2 Program Status Word

15
STACK AND STACK POINTER:
Stack is used to hold and retrieve data quickly. The 8 – bit SP is incremented
before data is stored during PUSH and CALL executions. While the stack may reside any
where in on-chip RAM, the SP is initialized to 07H after the stack to begin at
manipulated as a 16 – bit register or as two independent 8 – bit registers.

PC:
It addresses the memory locations that program instructions are to be fetched. It is
the only register that does not have any internal address.

FLAGS:
They are 1 – bit register provided to store the results of certain program
instructions. Other instructions can test the conditions of the flags and make the decisions
accordingly. To conveniently address, they are grouped inside the PSW and PCON.
The micro controller has 4 main flags: carry(c), auxiliary carry (AC), over
flow (OV), parity (P) and 3 general-purpose flags: F0, GF0 and GF1.

PORTS:
All ports are bi-directional; each consists of a latch, an output driver and an input buffer.
P0, P1, P2 and P3 are the SFR latches ports 0, 1, 2 and 3 respectively. The main functions
of each port are mentioned below.

Port0: input/output bus port, address output port and data input/output port.
Port1: Quasi-bi-directional input/output port.
Port2: Quasi-bi-directional input/output port and address output port.
Port3: Quasi-bi-directional input/output port and control input/output pin.

16
SBUF:
The microcontroller has serial transmission circuit that uses SBUF register to hold
data. It is actually two separate registers, a transmit buffer and a receive buffer register.
When data is moved to SBUF, it goes to transmit buffer, where it is held for serial
transmission and when it is moved from SBUF, it comes from the receive buffer.

TIMER REGISTER:
Register pairs (TH0, TL1), (TH1, TL1) are the 16-bit counter registers for
timer/counters 0 and 1.

CONTROL REGISTERS:
SFR’s, IP, TMOD, SCON, and PCON contain control and status bits for the
interrupt system, Timers/counters and the serial port.

2.2.6 OSCILLATOR AND CLOCK CIRCUIT:


This circuit generates the clock pulses by which all internal operations are
synchronized. For the microcontroller to yield standard baud rates, the crystal frequency
is chosen as 11.059MHz.

RESET:
The reset switch is the RST pin of the microcontroller, which is the input to a
Schmitt trigger. It is accomplished by holding the RST pin HIGH for at least two
machine cycles while the oscillator frequency is running the CPU responds by generating
an internal reset

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 Figure 1. Either a
quartz crystal or ceramic resonator may be used.

17
To drive the device from an external clock source, XTAL2 should be left unconnected
while XTAL1 is driven as shown in Figure 2. 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.

Figure2.3: Oscillator Connections

2.3 ADDRESSING MODES:

An "addressing mode" refers to how you are addressing a given memory location. In
summary, the addressing modes are as follows, with an example of each:

Immediate Addressing MOV A, #20h


Direct Addressing MOV A, 30h
Indirect Addressing MOV A, @R0
External Direct MOVX A, @DPTR
Code Indirect MOVC A, @A+DPTR

Table.2.2 Addressing Modes


2.4 TIMERS:

The 8051 come equipped with two timers, both of which may be controlled, set,
read, and configured individually.

18
The 8051 timers have three general functions:

1. Keeping time and/or calculating the amount of time between events.


2. Counting the events themselves.
3. Generating baud rates for the serial port.

The three timer uses are distinct so we will talk about each of them separately.
The first two uses will be discussed in this chapter while the use of timers for baud rate
generation will be discussed in the chapter relating to serial ports.

TIMER SFRs:

As mentioned before, the 8051 have two timers, one timer is TIMER0 and the
other is TIMER1. The two timers share two SFRs (TMOD and TCON), which control the
timers, and each timer also has two SFRs dedicated solely to itself (TH0/TL0 and
TH1/TL1).

We’ve given SFRs names to make it easier to refer to them, but in reality an SFR
has a numeric address. It is often useful to know the numeric address that corresponds to
an SFR name.

The SFRs relating to timers are:

SFR Name Description SFR Address


TH0 Timer 0 High Byte 8Ch
TL0 Timer 0 Low Byte 8Ah
TH1 Timer 1 High Byte 8Dh
TL1 Timer 1 Low Byte 8Bh
TCON Timer Control 88h
TMOD Timer Mode 89h

Table2.3 SFR Descriptions

When you enter the name of an SFR into an assembler, it internally converts it to
a number. For example, the command:

MOV TH0, #25h;

Moves the value 25h into the TH0 SFR. However, since TH0 is the same as SFR

address 8Ch this command is equivalent to:

MOV 8Ch, #25h;

19
Now, back to the timers. First, lets talk about Timer 0.

Timer 0 has two SFRs: TH0 and TL0.

You may just think of this as the high and low byte of the timer. That is to say,
when Timer 0 has a value of 0, both TH0 and TL0 will contain 0. When Timer 0 has the
value 1000, TH0 will hold the high byte of the value (3 decimal) and TL0 will contain the
low byte of the value (232 decimal). Reviewing low/high byte notation, recall that you
must multiply the high byte by 256 and add the low byte to calculate the final value. That
is to say:

TH0*256+TL0=1000
3 * 256 + 232 = 1000

Timer 1 works the exact same way, but its SFRs are TH1 and TL1.

TMOD SFR:

The TMOD SFR is used to control the mode of operation of both timers. Each bit
of the SFR gives the specific information concerning how to run a timer. The high four
bits (bits 4 through 7) relate to Timer 1. Whereas the lower four bits (bits 0 through 3)
perform the exact function, for timer 0.

The individual bits of TMOD have the following functions:

TMOD (89h) SFR

Bit Name Explanation of Function Timer


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

20
INT0 (P3.2) is high. When this bit is clear the timer
will run regardless of the state of INT0.
When this bit is set the timer will count events on
2 C/T0 T0 (P3.4). When this bit is clear the timer will be 0
incremented every machine cycle.
1 T0M1 Timer mode bit (see below) 0
0 T0M0 Timer mode bit (see below) 0

As you can see in the above chart, four bits (two for each timer) are used to
specify a mode of operation. The modes of operation are:

TxM1 TxM0 Timer Mode Description of Mode


0 0 0 13-bit Timer.
0 1 1 16-bit Timer
1 0 2 8-bit auto-reload
1 1 3 Split timer mode

Table2.4 Timer modes


13-bit Time Mode (mode 0):

Timer mode "0" is a 13-bit timer. When the timer is in 13-bit mode, TLx will
count from 0 to 31. When TLx is incremented from 31, it will "reset" to 0 and increment
THx. Thus, effectively, only 13 bits of the two-timer bytes are being used: bits 0-4 of
TLx and bits 0-7 of THx. This also means, the timer can only contain 8192 values. If you
set a 13-bit timer to 0, it will overflow back to zero 8192 machine cycles later.

16-bit Time Mode (mode 1):

Timer mode "1" is a 16-bit timer. This is a very commonly used mode. It
functions just like 13-bit mode except that all 16 bits are used.

TLx is incremented from 0 to 255. When TLx is incremented from 255, it resets
to 0 and causes THx to be incremented by 1. Since this is a full 16-bit timer, the timer
may contain up to 65536 distinct values. If you set a 16-bit timer to 0, it will overflow
back to 0 after 65,536 machine cycles.

8-bit Time Mode (mode 2):

Timer mode "2" is an 8-bit auto-reload mode. What is that, you may ask? Simple.
When a timer is in mode 2, THx holds the "reload value" and TLx is the timer itself.

21
Thus, TLx starts counting up. When TLx reaches 255 and is subsequently incremented,
instead of resetting to 0 (as in the case of modes 0 and 1), it will be reset to the value
stored in THx.

Split Timer Mode (mode 3):

Timer mode "3" is a split-timer mode. When Timer 0 is placed in mode 3, it


essentially becomes two separate 8-bit timers. That is to say, Timer 0 is TL0 and Timer 1
is TH0. Both timers count from 0 to 255 and overflow back to 0.

TCON SFR:

Finally, there’s one more SFR that controls the two timers and provides valuable
information about them.

The TCON SFR has the following structure:

TCON (88h) SFR

Bit
Bit Name Explanation of Function Timer
Address
Timer 1 Overflow. The micro controller sets this bit
7 TF1 8Fh 1
when Timer 1 overflows.
Timer 1 Run. When this bit is set Timer 1 is turned on.
6 TR1 8Eh 1
When this bit is clear Timer 1 is off.
Timer 0 Overflow. The micro controller sets this bit
5 TF0 8Dh 0
when Timer 0 overflows.
Timer 0 Run. When this bit is set Timer 0 is turned on.
4 TR0 8Ch 0
When this bit is clear Timer 0 is off.

As you may notice, we’ve only defined 4 of the 8 bits. That’s because the other 4
bits of the SFR don’t have anything to do with timers, they have to do with Interrupts and
they will be discussed in the chapter that addresses interrupts.

A new piece of information in this chart is the column "bit address." This is
because this SFR is "bit-addressable." What does this mean? It means if you want to set
the bit TF1.which is the highest bit of TCON--you could execute the command:

MOV TCON, #80h

22
Or, since the SFR is bit-addressable, you could just execute the command:

SETB TF1.

This has the benefit of setting the high bit of TCON without changing the value of

any of the other bits of the SFR. Usually when you start or stop a timer you don’t

want to modify the other values in TCON, so you take advantage of the fact that the

SFR is bit-addressable.

Initializing a Timer:

Now that we’ve discussed the timer-related SFRs we are ready to write code that
will initialize the timer and start it running.

As you’ll recall, we first must decide what mode we want the timer to be in. In
this case, we want a 16-bit timer that runs continuously.

We must first initialize the TMOD SFR. Since we are working with timer 0 we
will be using the lowest 4 bits of TMOD. The first two bits, GATE0 and C/T0 are both 0
since we want the timer to be independent of the external pins. 16-bit mode is timer mode
1 so we must clear T0M1 and set T0M0. Effectively, the only bit we want to turn on is bit
0 of TMOD. Thus to initialize the timer, we execute the instruction:

MOV TMOD, #01h.

Timer 0 is now in 16-bit timer mode. However, the timer is not running. To start
the timer running we must set the TR0 bit we can do that by executing the instruction:

SETB TR0.

Upon executing these two instructions timer 0 will immediately begin counting,
being incremented once every machine cycle (every 12 crystal pulses).

2.5 INTERRUPTS:
The micro controller provides 6 interrupt sources, 2 external interrupts, 2 timer
interrupts and a serial port interrupt and a reset. The external interrupts (INT0 & INT1)
can each be either level activated or transition activated depending on bits IT0 and IT1 in

23
register TCON. The flags that actually generate these interrupts are IE0 & IE1 bits in
TCON.
TF0 and TF1 generate the timer 0 & 1 interrupts, which are set by a roll over in
their respective timer/counter registers. When a timer interrupt is generated the on-chip
hardware clears the flag that generated it when the service routine is vectored to.
The serial port interrupt is generated by logical OR of R1 & T1. Neither of these
flags is cleared by hardware when service routine is vectored to. In fact, the service
routine itself determines whether R1 & T1 generated the interrupt, and the bit is cleared
in the software.
Upon reset, all interrupts are disabled, meaning that none will be responded to
by the micro controller if they are activated. The interrupts must be enabled by software
in order for the micro controller to respond to them.

2.5.1 SERIAL INTERRUPTS:

Serial Interrupts are slightly different than the rest of the interrupts. This is due to
the fact that there is two interrupt flags: RI and TI. If either flag is set, a serial interrupt is
triggered. As you will recall from the section on the serial port, the RI bit is set when a
byte is received by the serial port and the TI bit is set when a byte has been sent.

This means that when your serial interrupt is executed, it may have been triggered
because the RI flag was set or because the TI flag was set or because both flags were set.
Thus, your routine must check the status of these flags to determine what action is
appropriate. Also, since the 8051 does not automatically clear the RI and TI flags you
must clear these bits in your interrupt handler.

24
CHAPTER 3. SERIAL COMMUNICATION

One of the 8051s many powerful features is its integrated UART, otherwise
known as a serial port. The fact that the 8051 have an integrated serial port means that
you may very easily read and write values to the serial port.

However, we do not have to do this. Instead, we simply need to configure the


serial ports operation mode and baud rate. Once configured, all we have to do is write to

25
an SFR to write a value to the serial port or read the same SFR to read a value from the
serial port. The 8051 will automatically let us know when it has finished sending the
character we wrote and will also let us know whenever it has received a byte so that we
can process it.

3.1 SETTING THE SERIAL PORT MODE:

The first things we must do when using the 8051s integrated serial port is,
obviously, configure it. This lets us tell the 8051 how many data bits we want, the baud
rate we will be using, and how the baud rate will be determined. First, let’s present the
"Serial Control" (SCON) SFR and define what each bit of the SFR represents:

Bit Name Bit Address Explanation of Function


7 SM0 9Fh Serial port mode bit 0
6 SM1 9Eh Serial port mode bit 1.
5 SM2 9Dh Multiprocessor Communications Enable (explained later)
4 REN 9Ch Receiver Enable. This bit must be set in order to receive characters.
3 TB8 9Bh Transmit bit 8. The 9th bit to transmit in mode 2 and 3.
2 RB8 9Ah Receive bit 8. The 9th bit received in mode 2 and 3.
1 TI 99h Transmit Flag. Set when a byte has been completely transmitted.
0 RI 98h Receive Flag. Set when a byte has been completely received.

Additionally, it is necessary to define the function of SM0 and SM1 by an additional


table:

SM0 SM1 Serial Mode Explanation Baud Rate


0 0 0 8-bit Shift Register Oscillator / 12
0 1 1 8-bit UART Set by Timer 1 (*)
1 0 2 9-bit UART Oscillator / 64 (*)
1 1 3 9-bit UART Set by Timer 1 (*)

Table.3.1 Serial Mode Setting

(*) Note: The baud rate indicated in this table is doubled if PCON.7 (SMOD) is set.

26
The SCON SFR allows us to configure the Serial Port. The first four bits (bits 4
through 7) are configuration bits.

Bits SM0 and SM1 let us set the serial mode to a value between 0 and 3. The four
modes are defined in the chart im immediately above. As you can see, selecting the Serial
Mode selects the mode of operation (8-bit/9-bit, UART or Shift Register) and also
determines how the baud rate will be calculated. In modes 0 and 2 the baud rate is fixed
based on the oscillator’s frequency. In modes 1 and 3 the baud rate is variable based on
how often Timer 1 overflows.

The next bit, SM2, is a flag for "Multiprocessor communication." Generally,


whenever a byte has been received the 8051 will set the "RI" (Receive Interrupt) flag.
This lets the program know that a byte has been received and that it needs to be
processed. However, when SM2 is set the "RI" flag will only be triggered if the 9th bit
received was a "1". That is to say, if SM2 is set and a byte is received whose 9th bit is
clear, the RI flag will never be set. This can be useful in certain advanced serial
applications. For now it is safe to say that you will almost always want to clear this bit so
that the flag is set upon reception of any character.

The next bit, REN, is "Receiver Enable." This bit is very straightforward: If you
want to receive data via the serial port, set this bit. You will almost always want to set
this bit.

The last four bits (bits 0 through 3) are operational bits. They are used when
actually sending and receiving data, they are not used to configure the serial port.

The TB8 bit is used in modes 2 and 3. In modes 2 and 3, a total of nine data bits
are transmitted. The first 8 data bits are the 8 bits of the main value, and the ninth bit is
taken from TB8. If TB8 is set and a value is written to the serial port, the data bits will be
written to the serial line followed by a "set" ninth bit. If TB8 is clear the ninth bit will be
"clear."

The RB8 also operates in modes 2 and 3 and functions essentially the same way
as TB8, but on the reception side. When a byte is received in modes 2 or 3, a total of nine
bits are received. In this case, the first eight bits received are the data of the serial byte
received and the value of the ninth bit received will be placed in RB8.

TI (Transmit Interrupt) is bit 1 of the SCON register. This is an extremely


important flag bit in the SCON register. When the 8051 finish the transfer of the 8-bit
character, it raises the TI flag to indicate that it is ready to transfer another byte. The TI
bit is raised at the beginning of the stop bit.

Finally, the RI bit means "Receive Interrupt." It functions similarly to the "TI"
bit, but it indicates that a byte has been received. That is to say, whenever the 8051 have

27
received a complete byte it will trigger the RI bit to let the program know that it needs to
read the value quickly, before another byte is read.

3.2 SETTING THE SERIAL PORT BAUD RATE:

Once the Serial Port Mode has been configured, as explained above, the program
must configure the serial ports baud rate. This only applies to Serial Port modes 1 and 3.
The Baud Rate is determined based on the oscillator’s frequency when in mode 0 and 2.
In mode 0, the baud rate is always the oscillator frequency divided by 12. This means if
you’re crystal is 11.059 MHz; mode 0 baud rate will always be 921,583 baud. In mode 2
the baud rate is always the oscillator frequency divided by 64, so a 11.059Mhz crystal
speed will yield a baud rate of 172,797.

In modes 1 and 3, the baud rate is determined by how frequently timer 1


overflows. The more frequently timer 1 overflows, the higher the baud rate. There are
many ways one can cause timer 1 to overflow at a rate that determines a baud rate, but
the most common method is to put timer 1 in 8-bit auto-reload mode (timer mode 2) and
set a reload value (TH1) that causes Timer 1 to overflow at a frequency appropriate to
generate a baud rate.

To determine the value that must be placed in TH1 to generate a given baud rate,
we may use the following equation (assuming PCON.7 is clear).

TH1 = 256 - ((Crystal / 384) / Baud)

If PCON.7 is set then the baud rate is effectively doubled, thus the equation becomes:

TH1 = 256 - ((Crystal / 192) / Baud)

3.3 MAX-232:

Since the RS-232 is not compatible with today’s microprocessors and micro
controllers, we need a line driver to convert the RS_232’s signals to TTL voltage levels
that will be acceptable to 89C52’s TxD and RxD pins.

One example of such a converter is MAX-232 from maxim corp. the MAX232
converts RS232 voltage levels to TTL voltage levels and vice versa.

28
. FIGURE 3.1: PIN DESCRIPTION

29
3.4 INTERFACING OF MAX-232 WITH AT89C52:

FIG: 3.2. Interfacing RS232 with8052

3.5 ABSOLUTE MAXIMUM RATINGS:

• Input supply voltage range, Vcc: -0.3 to 6V


• Positive output supply voltage range: VS + Vcc: -3 to 15V
• Negative output supply voltage range: VS -0.3V to -15V
• Input voltage range, VI: Driver: -3VtoVcc+0.3V
• Receiver: 30V
• Output voltage range, Vo: T1out, T2out VS -0.3V to VS+ +0.3V
• R1out,R2out: -0.3V to Vcc +0.3V
• Short-circuit duration, T1out,T2out: unlimited
• Package thermal impedance, D package: 113 C/W
• Storage temperature range, Tstg: -65 to 150 c.

30
CHAPTER 4. ANALOG TO DIGITAL CONVERTERS

31
Digital circuitry can be connected to sensor devices if they are inherently digitalized
by themselves. Switches, relays, and encoders are easily interfaced with gate circuits due
to the on/off nature of their signals. However, when analog devices are involved,
interfacing is needed to translate analog signals into digital quantities. When data
acquisition hardware receives an analogue signal from sensor it converts it to a voltage. It
then digitizes it with an analogue-to-digital converter, ready for transfer to a computer.

Characteristic parameters for A-D converters are: resolution, sample and hold
acquisition time, linearity, throughput etc. some of the specifications are defined below:

Resolution: Resolution defines the smallest change in the input voltage that can be
detected and encoded by the ADC. Resolution of the A-D converter is the number of
steps the input range is divided into. The resolution is usually expressed by the number of
bits in its output code (n) and the number of steps is 2 to the power n.

Sample and Hold Acquisition Time: A sample and hold circuit freezes the analogue
input voltage at the moment the sample is required. This voltage is held constant whilst
the A-D converter digitizes it. The acquisition time is the time between releasing the hold
state and the output of the sample circuit settling to the new input voltage value.

Throughput: Throughput is the maximum rate at which the A-D converter can output
data values. In general it will be the inverse of the sum of conversion time and acquisition
time. Conversion time is the time taken by an ADC to produce the valid digital output
corresponding to the analog input. Throughput can be increased by using a pipelined A-D
converter, so a second conversion can start while the first is still in progress.

Accuracy: Absolute accuracy or error of an ADC at a given output code is defined as the
difference between the corresponding theoretical analog value and the actual input
voltage required to produce that code.
There are many types of ADC’s such as Flash, Dual slope integrating, Successive
approximation, Delta-sigma etc.

32
4.1 HARDWARE DESIGN

4.1.1 DATA ACQUISITION SYSTEM

ADC0808 is the data acquisition component with an 8-bit analog-to-


digital converter, 8-channel multiplexer and microprocessor compatible control logic.
The 8-bit 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 ADC0808
offers high speed, high accuracy, minimal temperature dependence and minimal power
consumption. The pin diagram of ADC0808 is shown in figure 4.1

FIGURE 4.1: PIN DIAGRAM OF ADC0808

ADC0808 contains an 8-channel single-ended analog signal multiplexer.


A particular input channel is selected by using the address decoder. The input states for
the address lines are used to select the required channel. The address is latched into the
decoder on the low-to-high transition.

33
The main component of this single chip data acquisition system is its 8-bit analog-to-
digital converter. This converter is designed to give fast, accurate, and repeatable
conversions over a wide range of temperatures. The converter is partitioned into three
major sections: the 256R ladder network, the successive approximation register, and the
comparator.

Successive approximation register counts by trying all values of bits, starting with
most significant bit and finishing at the least significant bit. Throughout the count
process, the register monitors the comparator's output to see if the binary count is less
than or greater than the analog signal input, adjusting the bit values accordingly. The A/D
converter's successive approximation register (SAR) is reset on the positive edge of the
start conversion (SC) pulse. The conversion is begun on the falling edge of the start
conversion pulse. A conversion in process will be interrupted by receipt of a new start
conversion pulse. Continuous conversion may be accomplished by tying the end of-
conversion (EOC) output to the SC input. End-of-conversion will go low between 0 and 8
clock pulses after the rising edge of start conversion. The block diagram of ADC0808 is
shown in figure.

The successive approximation register (SAR) performs 8 iterations to approximate the


input voltage. For any SAR type converter, n iterations are required for an n-bit
converter. To supply clock to the ADC0808 we are using 555 timers in Astable mode.

4.1.2 555 TIMER:


"555" integrated circuit is used for time-delay and oscillator functions. In
the time-delay or monostable mode of operation, the timed interval is controlled by a
single external resistor and capacitor network. In the astable mode of operation, the
frequency and duty cycle may be independently controlled with two external resistors and
a single external capacitor. The internal circuit diagram of 555 timer IC is shown in
figure 4.4.

34
FIG 4.2 : 555 TIMER

The threshold and trigger levels are normally two-thirds and one-third,
respectively, of VCC. These levels can be altered by use of the control voltage terminal.
When the trigger input falls below the trigger level, the flip-flop is set and the output goes
high. If the trigger input is above the trigger level and the threshold input is above the
threshold level, the flip-flop is reset and the output is low. RESET can override all other
inputs and can be used to initiate a new timing cycle. When RESET goes low, the flip-
flop is reset and the output goes low. Whenever the output is low, a low-impedance path
is provided between DISCH and ground.

Operation of Astable circuit:

The circuit diagram of a 555 timer configured in Astable mode is shown in


figure 4.5.With the output high (+Vcc) the capacitor C1 is charged by current flowing
through R1 and R2. The threshold and trigger inputs monitor the capacitor voltage and
when it reaches 2/3Vs (threshold voltage) the output becomes low and the discharge pin is
connected to 0V.

35
FIGURE 4.3: ASTABLE CIRCUIT

The capacitor now discharges with current flowing through R2 into the
discharge pin. When the voltage falls to 1/3Vs (trigger voltage) the output becomes high
again and the discharge pin is disconnected, allowing the capacitor to start charging again
.This cycle repeats continuously unless the reset input is connected to 0V, thus producing
a square wave with a time period of 0.7 (R1+2R2) C1. The square wave generated by
the Astable circuit of 555 timer is given to the 10th pin of ADC0808 to drive the clock.

36
CHAPTER 5. SENSORS

37
Sensors are the devices which are used to sense different parameters .The sensed
signal is converted into our required type with the help of transducers. Potentiometers can
be used to detect variations in voltage and resistance. With proper arrangement they can
also detect variations in angular displacement. It converts variations in all parameters in
terms of voltage. We have to use proper calibrations to convert these voltage variations
back into physical phenomenon. Variations in temperature can be detected and measured
using various types of temperature sensors such as RTDS, thermocouples, ultrasonic and
thermistors. In this project, we are using LM35 sensor which is a thermistor. For
measuring humidity, we are using SYH-2 and potentiometers.

5.1 TEMPERATURE SENSOR

The LM35 series are precision integrated-circuit temperature sensors, whose output
voltage is linearly proportional to the Celsius (Centigrade) temperature. The LM35 thus
has an advantage over linear temperature sensors calibrated in ° Kelvin, as the user is not
required to subtract a large constant voltage from its output to obtain convenient
Centigrade scaling. The LM35 does not require any external calibration or trimming to
provide typical accuracies of ±¼°C at room temperature and ±¾°C over a full -55 to
+150°C temperature range. Low cost is assured by trimming and calibration at the wafer
level. The LM35's low output impedance, linear output, and precise inherent calibration
make interfacing to readout or control circuitry especially easy. It can be used with single
power supplies, or with plus and minus supplies. As it draws only 60 µA from its supply,
it has very low self-heating, less than 0.1°C in still air. The LM35 is rated to operate over
a -55° to +150°C temperature range, while the LM35C is rated for a -40° to +110°C
range (-10° with improved accuracy). The LM35 series is available packaged in hermetic
TO-46 transistor packages, while the LM35C, LM35CA, and LM35D are also available
in the plastic TO-92 transistor package. The LM35D is also available in an 8-lead surface
mount small outline package and a plastic TO-220 package.

38
5.1.1 FEATURES:

 Calibrated directly in ° Celsius (Centigrade)


 Linear + 10.0 mV/°C scale factor
 0.5°C accuracy guarantee able (at +25°C)
 Rated for full -55° to +150°C range
 Suitable for remote applications
 Low cost due to wafer-level trimming
 Operates from 4 to 30 volts
 Less than 60 µA current drain
 Low self-heating, 0.08°C in still air
 Non-linearity only ±¼°C typical
 Low impedance output, 0.1 Ohm for 1 mA load

Why to Use LM35s to Measure Temperature?

You can measure temperature more accurately than a using a thermistor. The sensor
circuitry is sealed and not subject to oxidation, etc.

The LM35 generates a higher output voltage than thermocouples and may not require
that the output voltage be amplified.

What Does An LM35 Look Like?

39
What Does an LM35 Do? How does it work?

• It has an output voltage that is proportional to the Celsius temperature.


• The scale factor is .01V/oC
• The LM35 does not require any external calibration or trimming and
maintains an accuracy of +/-0.4 oC at room temperature and +/- 0.8 oC over a range of 0
o
C to +100 oC.
• Another important characteristic of the LM35DZ is that it draws only 60
micro amps from its supply and possesses a low self-heating capability. The sensor self-
heating causes less than 0.1 oC temperature rise in still air.

The LM35 comes in many different packages, including the following.

 TO-92 plastic transistor-like package,


 T0-46 metal can transistor-like package
 8-lead surface mount SO-8 small outline package

What Can You Expect When You Use An LM35?

You will need to use a voltmeter to sense Vout.

 The output voltage is converted to temperature by a simple


conversion factor.
 The sensor has a sensitivity of 10mV / oC.
 Use a conversion factor that is the reciprocal that is 100V / oC.

The general equation used to convert output voltage to temperature is:

 Temperature ( oC) = Vout * (100 oC/V)


 So if Vout is 1V , then, Temperature = 100 oC
 The output voltage varies linearly with temperature.

40
How Do You Use An LM35? (Electrical Connections)

Here is a commonly used circuit. For connections refer to the picture above.

In this circuit, parameter values commonly used are:

• Vc = 4 to 30v
• 5v or 12 v are typical values used.
• Ra = Vc /10-6

 Actually, it can range from 80 KW to 600 KW , but most just use


8 KW

Fig.5.1 LM35

5.2 HUMIDITY SENSOR:

Resistive humidity sensors designed for measuring relative humidity.


Characterized by great sensitivity and linearity, miniature and light housing and
narrow hysteresis and wide operating range.
The SYH-2T4W sensors are temperature compensated - fitted with built-in

41
thermistor Rt. Suitable for air humidifiers and dryers, ventilation and air conditioning
systems, air cleaners, incubators,humidity meters, greenhouses, vehicles, etc.

SPECIFICATIONS:

• Items: syh-2,syh-2s
• Rated voltage: AC 1Vrms
• Rated power: AC 0.22mW
• Operating temp.: 0-60 c
• Operating humidity: 20-95%Rh
• Standard characteristics: at 25 c,60%RH
• Storage temperature: -30 to 85 c
• Storage humidity: within 95%Rh
• Humidity accuracy: 5%RH(at 25 c,60%RH)
• Humidity response time: <60 sec(40 to 80%RH)
• Hysterisis: +/-2%RH

42
CHAPTER 6. BLOCK DIAGRAM, CODING AND CONCLUSION

43
6. block diagram of the project:

ADC
MC 0808
PC MAX-232
89C52

CLK

555 TIMER sensors

Fig.5.2 Block Diagram

44
45
FIG.5.3.OVERVIEW OF DATA ACQUISITION SYSTEM USING 89C52

7. CODING

46
#include<reg52.h>
#include<math.h>

sbit ale=P1^4;
sbit oe=P1^5;
sbit sc=P1^6;
sbit eoc=P1^7;

sbit add_a=P1^0;
sbit add_b=P1^1;
sbit add_c=P1^2;

sfr port2=0xa0;
unsigned int c02,c01,c03,c1,c2,c3,c4,t,dispdata,cnl;

int display (float);

void serialintr(void) interrupt 4


{ //SERIAL INTERRUPT

ROUTINE
//TO
TRANSMIT THE
// OUTPUT TO THE
unsigned int x; //HYPER
TERMINAL

if(RI==1){

x=SBUF;
RI=0;
if(x=='0')
{
cnl=0;
}

if(x=='1')
{
cnl=1;

47
}

if(x=='2')
{
cnl=2;
}

if(x=='3')
{
cnl=3;
}
if(x=='4')
{
cnl=4;
}
if(x=='5')
{
cnl=5;
}
if(x=='6')
{
cnl=6;
}
if(x=='7')
{
cnl=7;
}

if(x=='t')
{

IE=0X00;

SBUF='\n';
while(TI==0);
TI=0;

c1=c1+48;
SBUF=c1;
while(TI==0);
TI=0;

c2=c2+48;
SBUF=c2;

48
while(TI==0);
TI=0;

c3=c3+48;
SBUF=c3;
while(TI==0);
TI=0;

SBUF='.';
while(TI==0);
TI=0;

c4=c4+48;
SBUF=c4;
while(TI==0);
TI=0;

SBUF=' ';
while(TI==0);
TI=0;

SBUF='c';
while(TI==0);
TI=0;

SBUF='\n';
while(TI==0);
TI=0;

}
if(x=='x')
{

IE=0X00;

SBUF='\n';
while(TI==0);
TI=0;

SBUF='\n';
while(TI==0);
TI=0;

SBUF=' ';

49
while(TI==0);
TI=0;

t=t+48;
SBUF=t;
while(TI==0);
TI=0;

c1=c1+48;
SBUF=c1;
while(TI==0);
TI=0;

SBUF='.';
while(TI==0);
TI=0;

c2=c2+48;
SBUF=c2;
while(TI==0);
TI=0;

c3=c3+48;
SBUF=c3;
while(TI==0);
TI=0;

c4=c4+48;
SBUF=c4;
while(TI==0);
TI=0;

SBUF=' ';
while(TI==0);
TI=0;

SBUF='V';
while(TI==0);
TI=0;

}
if(x=='h'){

IE=0X00;

SBUF='\n';

50
while(TI==0);
TI=0;

c1=c1+48;
SBUF=c1;
while(TI==0);
TI=0;

c2=c2+48;
SBUF=c2;
while(TI==0);
TI=0;

c3=c3+48;
SBUF=c3;

SBUF='.';
while(TI==0);
TI=0;

c4=c4+48;
SBUF=c4;
while(TI==0);
TI=0;

SBUF=' ';
while(TI==0);
TI=0;

SBUF='H';
while(TI==0);
TI=0;

SBUF='\n';
while(TI==0);
TI=0;

}
}
}

void main(void){

51
unsigned int u,v,z,s,f;
float y,d;
y=19.53;

port2=0xFF;

TMOD=0X20;
TH1=0XFD;
SCON=0X50;
TR1=1;
IE=0X90; //ENABLE SERIAL INTERRUPT

eoc=1;
ale=0;
oe=0;
sc=0;

while(1)
{

if(cnl==0)
{
add_a=0;
add_b=0;
add_c=0;
}
if(cnl==1)
{
add_a=1;
add_b=0;
add_c=0;
}
if(cnl==2)
{
add_a=0;
add_b=1;
add_c=0;
}
if(cnl==3)
{
add_a=1;
add_b=1;
add_c=0;

52
}
if(cnl==4)
{
add_a=0;
add_b=0;
add_c=1;
}
if(cnl==5)
{
add_a=1;
add_b=0;
add_c=1;
}
if(cnl==6)
{
add_a=0;
add_b=1;
add_c=1;
}
if(cnl==7)
{
add_a=1;
add_b=1;
add_c=1;
}

for(f=0;f<3000;f++);

ale=1;

for(f=0;f<3000;f++);
for(f=0;f<3000;f++);
for(f=0;f<3000;f++);

sc=1;

for(f=0;f<3000;f++);
for(f=0;f<3000;f++);
for(f=0;f<3000;f++);
for(f=0;f<3000;f++);
for(f=0;f<3000;f++);
for(f=0;f<3000;f++);

53
ale=0;
sc=0;

for(f=0;f<3000;f++);
for(f=0;f<3000;f++);
for(f=0;f<3000;f++);
for(f=0;f<3000;f++);
for(f=0;f<3000;f++);
for(f=0;f<3000;f++);
for(f=0;f<3000;f++);
for(f=0;f<3000;f++);
for(f=0;f<3000;f++);
for(f=0;f<3000;f++);
oe=1

for(f=0;f<3000;f++);
for(f=0;f<3000;f++);
for(f=0;f<3000;f++);
for(f=0;f<3000;f++);
for(f=0;f<3000;f++);
for(f=0;f<3000;f++);

s=port2;
// ADC DIGITAL O/P 0N PORT1 STORED
IN S
z=0xA; //HEX TO DEC CONVERSION
v=port2/z;
u=port2%z;
v=v*10;
d=u+v;
d=d*y;

display(d);

oe=0;

IE=0X90; //ENABLE SERIAL INTERRUPT

54
}

int display ( float result)


{

unsigned int dispdata;


result=result/1000; //MILLI VOLTS TO
VOLTS
dispdata=result*1000; //ROUTINE TO
SEPARATE EACH
DIGIT OF THE VOLTAGE VALUE

c4=dispdata%10;

c01=dispdata/1000;
c1=c01%10;

c02=dispdata/100;
c2=c02%10;

c03=dispdata/10;
c3=c03%10;

t=dispdata/10000;

return(0);

55
CONCLUSION:

As this world is readily growing up for ‘Era of automation and global


Communication’ this concept of controlling devices remotely regardless of load at which
the devices operate and the functions they perform, will surely fuel the Scope of
technology. This concept can definitely serve as a platform for new Innovations and help
us get better with time.

The existing project can be used for limited purpose, which it can be further
improved to its next generation for a large number of appliances.

As now the kit is interfaced with only few devices with other port pins being left
open for further expansion of the system. This could result in including the other house
hold appliances such as tube light, electric heaters; tape audio deck, etc, thus providing a
complete tool for house hold purpose.

This kit may be modified in the hardware as well as the software in a little manner to
obtain regulation of certain devices.

a) Automatic control of out door lighting system using light dependant resistor as a
sensing element.
b) Door locking system using digital gadget locking.
c) We can measure pressure, humidity and velocity.

Thus all the above parameters are chosen to control with the help of micro
controller, as nowadays the embedded controllers are playing a vital in the industries and
in western countries such as United States and other places lot of demand exist for

56
controllers. There by this project work serves as a guidance to enter into those fields,
which gives much encouragement and helps in growing and climbing the ladder.

BIBILOGRAPHY

TEXT BOOKS:

 The 8051 Micro controller and embedded systems by Mazidi.

 The 8051 Micro controller Architecture, programming &


Applications by Kenneth J.Ayala.

57
APPENDIX

ASCII CODES:

58