b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
-
Upload
sreedharvk -
Category
Documents
-
view
219 -
download
0
Transcript of b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 1/75
WIRELESS ELECTRONIC NOTICE BOARD
CHAPTER.1.
1.INTRODUCTION
1.1 DESCRIPTION OF THE PROJECT:
In Today’s Electronic communication take important role. Using Today’s
Communication technology the data transmission and reception from one Place to
another is easy and fast.
In our project we have two sections, one is transmitter another one Receiver, in
transmitting section we have PC and zigBee module. In receiver section we have
ZigBee, AT89S52Microcontroller and LCD.
At the time when data will transfer from the transmitter a predefined code will
be Added with every eight bit data and when this data receive by the receiver this code
Will be decode by the receiver and generate the exact data that will be displayed On
LCD.
Whatever the commands sent on the transmitter side in the hyper terminal it will
be passed to receiver section through zigBee which will act like wireless transmitter and
the respective command will received by the another zigBee module which will act
like a wireless receiver in this case and the commands will read by the microcontroller
and act according to the commands the respective functionality is seen on the LCD
display which will be connected to the microcontroller.
DEPT OF ECE 1 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 2/75
WIRELESS ELECTRONIC NOTICE BOARD
1.2 BLOCK DIAGRAM:
TRANSMITTER
RECEIVER
DEPT OF ECE 2 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 3/75
WIRELESS ELECTRONIC NOTICE BOARD
1.3 EMBEDDED SYSTEMS:
Embedded systems are designed to do some specific task, rather than be a
general-purpose computer for multiple tasks. Some also have real time performance
constraints that must be met, for reason such as safety and usability; others may have
low or no performance requirements, allowing the system hardware to be simplified to
reduce costs.
An embedded system is not always a separate block - very often it is physically
built-in to the device it is controlling. The software written for embedded systems is
often called firmware, and is stored in read-only memory or flash convector chips rather
than a disk drive. It often runs with limited computer hardware resources: small or nokeyboard, screen, and little memory.
Wireless communication has become an important feature for commercial
products and a popular research topic within the last ten years. There are now more
mobile phone subscriptions than wired-line subscriptions. Lately, one area of
commercial interest has been low-cost, low-power, and short-distance wireless
communication used for personal wireless networks." Technology advancements are
providing smaller and more cost effective devices for integrating computational
processing, wireless communication, and a host of other functionalities. These
embedded communications devices will be integrated into applications ranging from
homeland security to industry automation and monitoring. They will also enable custom
tailored engineering solutions, creating a revolutionary way of disseminating and
processing information. With new technologies and devices come new business
activities, and the need for employees in these technological areas. Engineers who have
knowledge of embedded systems and wireless communications will be in high demand.
Unfortunately, there are few adorable environments available for development and
classroom use, so students often do not learn about these technologies during hands-on
lab exercises. The communication mediums were twisted pair, optical fiber, infrared,
and generally wireless radio.
DEPT OF ECE 3 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 4/75
WIRELESS ELECTRONIC NOTICE BOARD
CHAPTER.2.
2.HARDWARE FEATURES
2.1. Power Supply.
2.2 AT89S52 Microcontroller.
2.3 ZigBee.
2.4 LCD.
2.5.Max 232.
2.1 POWER SUPPLY:
The input to the circuit is applied from the regulated power supply. The AC
input i.e., 230V from the mains supply is step down by the transformer to 12V and is
fed to a rectifier. The output obtained from the rectifier is a pulsating DC voltage. So in
order to get a pure DC voltage, the output voltage from the rectifier is fed to a filter to
remove any AC components present even after rectification. Now, this voltage is given
to a voltage regulator to obtain a pure constant DC voltage.
50HZ
Fig2.1.: Circuit Diagram
a)Transformer:
Usually, DC voltages are required to operate various electronic equipment and
these voltages are 5V, 9V or 12V. But these voltages cannot be obtained directly. Thus
DEPT OF ECE 4 SSCET
230V AC
50HZ
Bridge
Rectifier
step down
transformer
Filter Regulator
D.C
Output
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 5/75
WIRELESS ELECTRONIC NOTICE BOARD
the A.C input available at the mains supply i.e., 230V is to be brought down to the
required voltage level. This is done by a transformer. Thus, a step down transformer is
employed to decrease the voltage to a required level.
b)Rectifier:
The output from the transformer is fed to the rectifier. It converts A.C. into
pulsating D.C. The rectifier may be a half wave or a full wave rectifier. In this project, a
bridge rectifier is used because of its merits like good stability and full wave
rectification.
c)Filter:
Capacitive filter is used in this project. It removes the ripples from the output of
rectifier and smoothens the D.C. Output received from this filter is constant until the
mains voltage and load is maintained constant. However, if either of the two is varied,
D.C. voltage received at this point changes. Therefore a regulator is applied at the
output stage.
d)Voltage Regulator:
As the name itself implies, it regulates the input applied to it. A voltage
regulator is an electrical regulator designed to automatically maintain a constant voltage
level. In this project, power supply of 5V and 12V are required. In order to obtain these
voltage levels, 7805 and 7812 voltage regulators are to be used. The first number 78
represents positive supply and the numbers 05, 12 represent the required output voltage
levels. A variable regulated power supply, also called a variable bench power supply, is
one where you can continuously adjust the output voltage to your requirements.
Varying the output of the power supply is the recommended way to test a project after
having double checked parts placement against circuit drawings and the parts placement
guide.
Most digital logic circuits and processors need a 5-volt power supply. To use
these parts we need to build a regulated 5-volt source. Usually you start with an
unregulated power supply ranging from 9 volts to 24 volts DC (A 12 volt power supply
DEPT OF ECE 5 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 6/75
WIRELESS ELECTRONIC NOTICE BOARD
is included with the Beginner Kit and the Microcontroller Beginner Kit.). To make a 5
volt power supply, we use a LM7805 voltage regulator IC (Integrated Circuit). The IC
is shown below.
Fig.2.1.(a): LM7805 IC
The LM7805 is simple to use. You simply connect the positive lead of your
unregulated DC power supply (anything from 9VDC to 24VDC) to the Input pin,
connect the negative lead to the Common pin and then when you turn on the power, you
get a 5 volt supply from the Output pin.
DEPT OF ECE 6 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 7/75
WIRELESS ELECTRONIC NOTICE BOARD
BLOCK DIAGRAM:
Fig2.1.(b): Components of a typical linear power supply
This 5V DC acts as Vcc to the microcontroller. The excess voltage is dissipated
as heat via an Aluminum heat sink attached to the voltage regulator. For both positive
and negative swings of the transformer, there is a Forward path through the diode
bridge. Both conduction paths cause Current to flow in the same direction through the
load resistor, accomplishing full-wave rectification. While one set of diodes is forward
biased, the other set is reverse biased and effectively eliminated from the circuit.
DEPT OF ECE 7 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 8/75
WIRELESS ELECTRONIC NOTICE BOARD
e)Bridge Rectifier:
Fig2.1(c): Power Supply Circuit Diagram
A diode bridge is an arrangement of four diodes connected in a bridge circuit as
shown below, that provides the same polarity of output voltage for any polarity of the
input voltage. When used in its most common application, for conversion of alternating
current (AC) input into direct current (DC) output, it is known as a bridge rectifier. The
diagram describes a diode-bridge design known as a full-wave rectifier. This design can
be used to rectify single phase AC when no transformer center tap is available. A
bridge rectifier makes use of four diodes in a bridge arrangement to achieve full-wave
rectification. This is a widely used configuration, both with individual diodes wired as
shown and with single component bridges where the diode bridge is wired internally.
2.1.1.CIRCUIT FEATURES:
a)Brief description of operation:
Gives out well regulated +5V output, output current capability of 100 mA.
b)Circuit protection:
Built-in overheating protection shuts down output when regulator IC gets too hot.
c)Circuit complexity:
DEPT OF ECE 8 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 9/75
WIRELESS ELECTRONIC NOTICE BOARD
Very simple and easy to build
d)Circuit performance:
Very stable +5V output voltage, reliable operation.
e)Availability of components:
Easy to get, uses only very common basic components.
f)Design testing:
Based on datasheet example circuit, I have used this circuit successfully as part of many
electronics projects
2.1.2Applications:
Part of electronics devices, small laboratory power supply
a)Power supply voltage: Unregulated DC 8-18V power supply
b)Power supply current: Needed output current + 5 mA
2.2.AT89C51
a) A Brief History of 8051:
In 1981, Intel Corporation introduced an 8 bit microcontroller called 8051. This
microcontroller had 128 bytes of RAM, 4K bytes of chip ROM, two timers, one serial
port, and four ports all on a single chip. At the time it was also referred as “A SYSTEM
ON A CHIP”
b)AT89S52:
DEPT OF ECE 9 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 10/75
WIRELESS ELECTRONIC NOTICE BOARD
The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller
with 8K bytes of in-system programmable Flash memory. The device is manufactured
using Atmel’s high-density nonvolatile memory technology and is compatible with the
industry-standard 80C51 instruction set and pinout. The on-chip Flash allows the
program memory to be reprogrammed in-system or by a conventional nonvolatile
memory pro-grammer. By combining a versatile 8-bit CPU with in-system
programmable Flash on a monolithic chip, the Atmel AT89S52 is a powerful
microcontroller, which provides a highly flexible and cost-effective solution to many,
embedded control applications. The AT89S52 provides the following standard features:
8K bytes of Flash, 256 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers,
three 16-bit timer/counters, a six-vector two-level interrupt architecture, a full duplex
serial port, on-chip oscillator, and clock circuitry. In addition, the AT89S52 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 con-tents but freezes the oscillator, disabling all other chip
functions until the next interrupt.
DEPT OF ECE 10 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 11/75
WIRELESS ELECTRONIC NOTICE BOARD
Fig. 2.2:AT89C51 Microcontroller
8031128 bytes of RAM, two timers and 6 interrupts.
8051 4K ROM, 128 bytes of RAM, two timers and 6 interrupts.
8052 has 8K ROM, 256 bytes of RAM, three timers and 8 interrupts.Of the three microcontrollers, 8051 is the most preferable. Microcontroller
supports both serial and parallel communication.
In the concerned project 8052 microcontroller is used. Here microcontroller
used is AT89S52, which is manufactured by ATMEL laboratories.
The 8051 is the name of a big family of microcontrollers. The device which we are
going to use along this tutorial is the 'AT89S52' which is a typical 8051 microcontroller
manufactured by Atmel™. Note that this part doesn't aim to explain the functioning of
the different components of a 89S52 microcontroller, but rather to give you a general
DEPT OF ECE 11 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 12/75
WIRELESS ELECTRONIC NOTICE BOARD
idea of the organization of the chip and the available features.
The block diagram provided by Atmel™ in their datasheet howing the architecture the
89S52 device can seem very complicated, and since we are going to use the C high
level language to program it, a simpler architecture can be represented as the figure
This figures shows the main features and components that the designer can
interact with. You can notice that the 89S52 has 4 different ports, each one having 8
Input/output lines providing a total of 32 I/O lines. Those ports can be used to output
DATA and orders do other devices, or to read the state of a sensor, or a switch. Most of
the ports of the 89S52 have 'dual function' meaning that they can be used for two
different functions: the fist one is to perform input/output operations and the second one
is used to implement special features of the microcontroller like counting external
pulses, interrupting the execution of the program according to external events,
performing serial data transfer or connecting the chip to a computer to update the
software.
c)Necessity of Microcontrollers:
Microprocessors brought the concept of programmable devices and made many
applications of intelligent equipment. Most applications, which do not need large
amount of data and program memory, tended to be costly.
The microprocessor system had to satisfy the data and program requirements so,
sufficient RAM and ROM are used to satisfy most applications .The peripheral control
equipment also had to be satisfied. Therefore, almost all-peripheral chips were used in
the design. Because of these additional peripherals cost will be comparatively high.
d)8085 chip needs:
An Address latch for separating address from multiplex address and data.32-
KB RAM and 32-KB ROM to be able to satisfy most applications. As also Timer /
Counter, Parallel programmable port, Serial port, and Interrupt controller are needed for
its efficient applications.
In comparison a typical Micro controller 8051 chip has all that the 8051 board
has except a reduced memory as follows.
4K bytes of ROM as compared to 32-KB, 128 Bytes of RAM as compared to 32-KB.
DEPT OF ECE 12 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 13/75
WIRELESS ELECTRONIC NOTICE BOARD
e)Bulky:
On comparing a board full of chips (Microprocessors) with one chip with all
components in it (Microcontroller).
f)Debugging:
Lots of Microprocessor circuitry and program to debug. In Micro controller
there is no Microprocessor circuitry to debug.
Slower Development time: As we have observed Microprocessors need a lot of
debugging at board level and at program level, where as, Micro controller do not have
the excessive circuitry and the built-in peripheral chips are easier to program for
operation.
So peripheral devices like Timer/Counter, Parallel programmable port, Serial
Communication Port, Interrupt controller and so on, which were most often used were
integrated with the Microprocessor to present the Micro controller .RAM and ROM
also were integrated in the same chip. The ROM size was anything from 256 bytes to
32Kb or more. RAM was optimized to minimum of 64 bytes to 256 bytes or more.
Microprocessor has following instructions to perform:
1. Reading instructions or data from program memory ROM.
2. Interpreting the instruction and executing it.
3. Microprocessor Program is a collection of instructions stored in a Nonvolatile
memory.
4. Read Data from I/O device
5. Process the input read, as per the instructions read in program memory.
6. Read or write data to Data memory.
7. Write data to I/O device and output the result of processing to O/P device.
2.2.1.Introduction to AT89S52:
DEPT OF ECE 13 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 14/75
WIRELESS ELECTRONIC NOTICE BOARD
The system requirements and control specifications clearly rule out the use of
16, 32 or 64 bit micro controllers or microprocessors. Systems using these may be
earlier to implement due to large number of internal features. They are also faster and
more reliable but, the above application is satisfactorily served by 8-bit micro
controller. Using an inexpensive 8-bit Microcontroller will doom the 32-bit product
failure in any competitive market place. Coming to the question of why to use 89S52 of
all the 8-bit Microcontroller available in the market the main answer would be because
it has 8kB Flash and 256 bytes of data RAM32 I/O lines, three 16-bit timer/counters, a
Eight-vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator,
and clock circuitry.
In addition, the AT89S52 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 Flash program memory supports both parallel programming and in Serial In-
System Programming (ISP). The 89S52 is also In-Application Programmable (IAP),
allowing the Flash program memory to be reconfigured even while the application is
running.
By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel
AT89S52 is a powerful microcomputer which provides a highly flexible and cost
effective solution to many embedded control applications.
2.2.2.Features:
Compatible with MCS-51 Products
8K Bytes of In-System Reprogrammable Flash Memory
Fully Static Operation: 0 Hz to 33 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
DEPT OF ECE 14 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 15/75
WIRELESS ELECTRONIC NOTICE BOARD
Programmable Serial Channel
Low-power Idle and Power-down Modes
4.0V to 5.5V Operating Range
Full Duplex UART Serial Channel
Interrupt Recovery from Power-down Mode
Watchdog Timer
Dual Data Pointer
Power-off Flag
Fast Programming Time
Flexible ISP Programming (Byte and Page Mode)
2.2.3.PIN DIAGRAM:
FIG-2.2.3. PIN DIAGRAM OF 89S52 IC
2.2.3.1Pin Description:
DEPT OF ECE 15 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 16/75
WIRELESS ELECTRONIC NOTICE BOARD
a)VCC: Supply voltage.
b)GND: Ground.
c)Port 0:
Port 0 is an 8-bit open drain bidirectional 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
highimpedance inputs.Port 0 can also be configured to be the multiplexed loworder
address/data bus during accesses to external program and data memory. In this mode,
P0 has internal pullups. 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.
d)Port 1:
Port 1 is an 8-bit bidirectional I/O port with internal pullups. 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 pullups 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 pullups.
In addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external count
input (P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX), respectively, as
shown in the following table. Port 1 also receives the low-order address bytes during
Flash programming and verification.
Table2.2.3.: Port1 Configuration
e)Port 2:
DEPT OF ECE 16 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 17/75
WIRELESS ELECTRONIC NOTICE BOARD
Port 2 is an 8-bit bidirectional I/O port with internal pullups.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
pullups. Port 2 emits the high-order 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, Port 2 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.
f)Port 3:
Port 3 is an 8-bit bidirectional I/O port with internal pullups.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 pullups and can be used as inputs. As inputs, Port 3 pins that
are externally being pulled low will source current (IIL) because of the pullups. Port 3
also serves the functions of various special features of the AT89S52, as shown in the
following table. Port 3 also receives some control signals for Flash programming and
verification.
Table.2.2.3.(a): Port3 Configuration
g)RST:
DEPT OF ECE 17 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 18/75
WIRELESS ELECTRONIC NOTICE BOARD
Reset input. A high on this pin for two machine cycles while the oscillator is
running resets the device. This pin drives High for 96 oscillator periods after the
Watchdog times out. The DISRTO bit in SFR AUXR (address 8EH) can be used to
disable this feature. In the default state of bit DISRTO, the RESET HIGH out feature is
enabled. ALE/PROG Address Latch Enable (ALE) is an 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
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.
h)PSEN:
Program Store Enable (PSEN) is the read strobe to external program memory.
When the AT89S52 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.
i)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.
j)XTAL1:
DEPT OF ECE 18 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 19/75
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 20/75
WIRELESS ELECTRONIC NOTICE BOARD
the microcontroller. The manufacturers make 8051 designs that run at specific
minimum and maximum frequencies typically 1 to 16 MHz.
Fig2.2.4: Oscillator and timing circuit
2.2.5.MEMORIES:
2.2.5.1.Types of memory:
The 8052 have three general types of memory. They are on-chip memory,
external Code memory and external Ram. On-Chip memory refers to physically
existing memory on the micro controller itself. External code memory is the code
memory that resides off chip. This is often in the form of an external EPROM. External
RAM is the Ram that resides off chip. This often is in the form of standard static RAM
or flash RAM.
DEPT OF ECE 20 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 21/75
WIRELESS ELECTRONIC NOTICE BOARD
a) Code memory:
Code memory is the memory that holds the actual 8052 programs that is to be
run. This memory is limited to 64K. Code memory may be found on-chip or off-chip. It
is possible to have 8K of code memory on-chip and 60K off chip memory
simultaneously. If only off-chip memory is available then there can be 64K of off chip
ROM. This is controlled by pin provided as EA.
b) Internal RAM:
The 8052 have a bank of 256 bytes of internal RAM. The internal RAM is
found on-chip. So it is the fastest Ram available. And also it is most flexible in terms of
reading and writing. Internal Ram is volatile, so when 8051 is reset, this memory is
cleared. 256 bytes of internal memory are subdivided. The first 32 bytes are divided
into 4 register banks. Each bank contains 8 registers. Internal RAM also contains 256
bits, which are addressed from 20h to 2Fh. These bits are bit addressed i.e. each
individual bit of a byte can be addressed by the user. They are numbered 00h to FFh.
The user may make use of these variables with commands such as SETB and CLR.
2.2.5.2.Special Function registered memory:
Special function registers are the areas of memory that control specific
functionality of the 8052 micro controller.
a) Accumulator (0E0h):
As its name suggests, it is used to accumulate the results of large no of
instructions. It can hold 8 bit values.
b) B registers (0F0h):
DEPT OF ECE 21 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 22/75
WIRELESS ELECTRONIC NOTICE BOARD
The B register is very similar to accumulator. It may hold 8-bit value. The b
register is only used by MUL AB and DIV AB instructions. In MUL AB the higher
byte of the product gets stored in B register. In div AB the quotient gets stored in B
with the remainder in A.
C)Sack pointer (81h):
The stack pointer holds 8-bit value. This is used to indicate where the
next value to be removed from the stack should be taken from. When a value is to be
pushed onto the stack, the 8052 first store the value of SP and then store the value at
the resulting memory location. When a value is to be popped from the stack, the 8052
returns the value from the memory location indicated by SP and then decrements the
value of SP.
d) Data pointer:
The SFRs DPL and DPH work together work together to represent a 16-bit
value called the data pointer. The data pointer is used in operations regarding external
RAM and some instructions code memory. It is a 16-bit SFR and also an addressable
SFR.
e) Program counter:
The program counter is a 16 bit register, which contains the 2 byte address,
which tells the 8052 where the next instruction to execute to be found in memory.
When the 8052 is initialized PC starts at 0000h. And is incremented each time an
instruction is executes. It is not addressable SFR.
f) PCON (power control, 87h):
DEPT OF ECE 22 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 23/75
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 24/75
WIRELESS ELECTRONIC NOTICE BOARD
i) TO (Timer 0 low/high, address 8A/8C h):
These two SFRs taken together represent timer 0. Their exact behavior depends
on how the timer is configured in the TMOD SFR; however, these timers always count
up. What is configurable is how and when they increment in value.
j) T1 (Timer 1 Low/High, address 8B/ 8D h):
These two SFRs, taken together, represent timer 1. Their exact behavior
depends on how the timer is configured in the TMOD SFR; however, these timers
always count up.
k) P0 (Port 0, address 90h, bit addressable):
This is port 0 latch. Each bit of this SFR corresponds to one of the pins on a
micro controller. Any data to be outputted to port 0 is first written on P0 register. For
e.g., bit 0 of port 0 is pin P0.0, bit 7 is pin p0.7. Writing a value of 1 to a bit of this SFR
will send a high level on the corresponding I/O pin whereas a value of 0 will bring it to
low level.
l) P1 (port 1, address 90h, bit addressable):
This is port latch1. Each bit of this SFR corresponds to one of the pins on a
micro controller. Any data to be outputted to port 0 is first written on P0 register. For
e.g., bit 0 of port 0 is pin P1.0, bit 7 is pin P1.7. Writing a value of 1 to a bit of this SFR
will send a high level on the corresponding I/O pin whereas a value of 0 will bring it to
low level.
m) P2 (port 2, address 0A0h, bit addressable):
This is a port latch2. Each bit of this SFR corresponds to one of the pins on a
micro controller. Any data to be outputted to port 0 is first written on P0 register. For
e.g., bit 0 of port 0 is pin P2.0, bit 7 is pin P2.7. Writing a value of 1 to a bit of this SFR
DEPT OF ECE 24 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 25/75
WIRELESS ELECTRONIC NOTICE BOARD
will send a high level on the corresponding I/O pin whereas a value of 0 will bring it to
low level.
n) P3 (port 3, address B0h, bit addressable):
This is a port latch3. Each bit of this SFR corresponds to one of the pins on a
micro controller. Any data to be outputted to port 0 is first written on P0 register. For
e.g., bit 0 of port 0 is pin P3.0, bit 7 is pin P3 .7. Writing a value of 1 to a bit of this
SFR will send a high level on the corresponding I/O pin whereas a value of 0 will bring
it to low level.
o) IE (interrupt enable, 0A8h):
The Interrupt Enable SFR is used to enable and disable specific interrupts. The
low 7 bits of the SFR are used to enable/disable the specific interrupts, where the MSB
bit is used to enable or disable all the interrupts. Thus, if the high bit of IE is 0 all
interrupts are disabled regardless of whether an individual interrupt is enabled by
setting a lower bit.
Table.2.2.5.2.(c):IE Register.
p) IP (Interrupt Priority, 0B8h):
The interrupt priority SFR is used to specify the relative priority of eachinterrupt. On 8051, an interrupt maybe either low or high priority. An interrupt may
interrupt interrupts. For e.g., if we configure all interrupts as low priority other than
serial interrupt. The serial interrupt always interrupts the system, even if another
interrupt is currently executing. However, if a serial interrupt is executing no other
interrupt will be able to interrupt the serial interrupt routine since the serial interrupt
routine has the highest priority.
DEPT OF ECE 25 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 26/75
WIRELESS ELECTRONIC NOTICE BOARD
Table.2.2.5.2.(d):IP Register.
q) PSW (Program Status Word, 0D0h):
The program Status Word is used to store a number of important bits that are
set and cleared by 8052 instructions. The PSW SFR contains the carry flag, the
auxiliary carry flag, the parity flag and the overflow flag. Additionally, it also contains
the register bank select flags, which are used to select, which of the “R” register banks
currently in use.
Table.2.2.5.2(e):PSW Register.
r) SBUF (Serial Buffer, 99h) :
SBUF is used to hold data in serial communication. It is physically two
registers. One is writing only and is used to hold data to be transmitted out of 8052 via
TXD. The other is read only and holds received data from external sources via RXD.
Both mutually exclusive registers use address 99h.
2.3 ZIGBEE
2.3.1.Introduction:
When we hold the TV remote and wish to use it we have to necessarily point
our control at the device. This one-way, line-of-sight, short-range communication uses
infrared (IR) sensors to enable communication and control and it is possible to operate
the TV remotely only with its control unit.
Add other home theatre modules, an air- conditioner and remotely enabled fans
and lights to your room, and you become a juggler who has to handle not only these
DEPT OF ECE 26 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 27/75
WIRELESS ELECTRONIC NOTICE BOARD
remotes, but also more numbers that will accompany other home appliances you are
likely to use.
Some remotes do serve to control more than one device after ‘memorizing'
access codes, but this interoperability is restricted to LOS, that too only for a set of
related equipment, like the different units of a home entertainment system
Now picture a home with entertainment units, security systems including fire alarm,
smoke detector and burglar alarm, air-conditioners and kitchen appliances all within
whispering distance from each other and imagine a single unit that talks with all the
devices, no longer depending on line-of-sight, and traffic no longer being one-way.
This means that the devices and the control unit would all need a common standard to
enable intelligible communication. ZigBee is such a standard for embedded application
software and has been ratified in late 2004 under IEEE 802.15.4 Wireless Networking
Standards.
ZigBee is an established set of specifications for wireless personal area
networking (WPAN), i.e., digital radio connections between computers and related
devices. This kind of network eliminates use of physical data buses like USB and
Ethernet cables. The devices could include telephones, hand-held digital assistants,
sensors and controls located within a few meters of each other.
ZigBee is one of the global standards of communication protocol formulated by
the relevant task force under the IEEE 802.15 working group. The fourth in the series,
WPAN Low Rate/ZigBee is the newest and provides specifications for devices that
have low data rates, consume very low power and are thus characterized by long battery
life. Other standards like Bluetooth and IrDA address high data rate applications such
as voice, video and LAN communications.
The ZigBee Alliance has been set up as “an association of companies working
together to enable reliable, cost-effective, low-power, wirelessly networked, monitoring
and control products based on an open global standard”.
Once a manufacturer enrolls in this Alliance for a fee, he can have access to the
standard and implement it in his products in the form of ZigBee chipsets that would be
built into the end devices. Philips, Motorola, Intel, HP are all members of the Alliance .
The goal is “to provide the consumer with ultimate flexibility, mobility, and ease of use
by building wireless intelligence and capabilities into every day devices. ZigBee
technology will be embedded in a wide range of products and applications across
consumer, commercial, industrial and government markets worldwide. For the first
DEPT OF ECE 27 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 28/75
WIRELESS ELECTRONIC NOTICE BOARD
time, companies will have a standards-based wireless platform optimized for the unique
needs of remote monitoring and control applications, including simplicity, reliability,
low-cost and low-power”.
The target networks encompass a wide range of devices with low data rates in
the Industrial, Scientific and Medical (ISM) radio bands, with building-automation
controls like intruder/fire alarms, thermostats and remote (wireless) switches,
video/audio remote controls likely to be the most popular applications. So far sensor
and control devices have been marketed as proprietary items for want of a standard.
With acceptance and implementation of ZigBee, interoperability will be enabled in
multi-purpose, self-organizing mesh networks
DEPT OF ECE 28 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 29/75
WIRELESS ELECTRONIC NOTICE BOARD
Fig. 2.3.1: ZigBee Module.
2.3.2.ZigBee Characteristics:
The focus of network applications under the IEEE 802.15.4 / ZigBee standard
include the features of low power consumption, needed for only two major modes
(Tx/Rx or Sleep), high density of nodes per network, low costs and simple
implementation.
DEPT OF ECE 29 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 30/75
WIRELESS ELECTRONIC NOTICE BOARD
These features are enabled by the following characteristics (technical data from
ZigBee: 'Wireless Control That Simply Works') 2.4GHz and 868/915 MHz dual PHY
modes. This represents three license-free bands: 2.4-2.4835 GHz, 868-870 MHz and
902-928 MHz. The number of channels allotted to each frequency band is fixed at
sixteen (numbered 11-26), one (numbered 0) and ten (numbered 1-10) respectively. The
higher frequency band is applicable worldwide, and the lower band in the areas of
North America, Europe, Australia and New Zealand .
Low power consumption, with battery life ranging from months to years.
Considering the number of devices with remotes in use at present, it is easy to see that
more numbers of batteries need to be provisioned every so often, entailing regular (as
well as timely), recurring expenditure. In the ZigBee standard, longer battery life is
achievable by either of two means: continuous network connection and slow but sure
battery drain, or intermittent connection and even slower battery drain.
• Maximum data rates allowed for each of these frequency bands are fixed as 250
kbps @2.4 GHz, 40 kbps @ 915 MHz, and 20 kbps @868 MHz.
• High throughput and low latency for low duty-cycle applications (<0.1%)
• Channel access using Carrier Sense Multiple Access with Collision Avoidance
(CSMA - CA)
• Addressing space of up to 64 bit IEEE address devices, 65,535 networks
• 50m typical range
• Fully reliable “hand-shake” data transfer protocol.
• Different topologies as illustrated below: star, peer-to-peer, mesh
Fig2.3.2: ZigBee Topologies.
DEPT OF ECE 30 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 31/75
WIRELESS ELECTRONIC NOTICE BOARD
2.3.3.Technology Comparisons:
The Why “ZigBee” question has always had an implied, but never quite worded
follower phrase “…when there is Bluetooth”. A comparative study of the two can befound in ZigBee: 'Wireless Control That Simply Works' .
The bandwidth of Bluetooth is 1 Mbps, ZigBee's is one-fourth of this value. The
strength of Bluetooth lies in its ability to allow interoperability and replacement of
cables, ZigBee's, of course, is low costs and long battery life.
In terms of protocol stack size, ZigBee's 32 KB is about one-third of the stack
size necessary in other wireless technologies (for limited capability end devices, the
stack size is as low as 4 KB).
Most important in any meaningful comparison are the diverse application areas
of all the different wireless technologies. Bluetooth is meant for such target areas as
wireless USB's, handsets and headsets, whereas ZigBee is meant to cater to the sensors
and remote controls market and other battery operated products.
In a gist, it may be said that they are neither complementary standards nor
competitors, but just essential standards for different targeted applications. The earlier
Bluetooth targets interfaces between PDA and other device (mobile phone / printer etc)
and cordless audio applications.
The IEEE 802.15.4–based ZigBee is designed for remote controls and sensors,
which are very many in number, but need only small data packets and, mainly,
extremely low power consumption for (long) life. Therefore they are naturally different
in their approach to their respective application arenas.
2.3.4.RF Trans-receiver:
This is an FSK Transceiver module, which is designed using the
ChipconIC(CC2500). It is a true single-chip transceiver, It is based on 3 wire digital
serial interface and an entire Phase-Locked Loop (PLL) for precise local oscillator
generation .so the frequency could be setting. It can use in UART / NRZ / Manchester
encoding / decoding. It is a high performance and low cost module. It gives 30 meters
range with onboard antenna. In a typical system, this trans-receiver will be used
together with a microcontroller. It provides extensive hardware support for packet
DEPT OF ECE 31 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 32/75
WIRELESS ELECTRONIC NOTICE BOARD
handling, data buffering, burst transmissions ,clear channel assessment, link quality
indication and wake on radio . It can be used in 2400-2483.5 MHz ISM/SRD band
systems. (eg. RKE-two way Remote Keyless Entry, wireless alarm and security
systems, AMR-automatic Meter Reading, Consumer Electronics, Industrial monitoring
and control, Wireless Game Controllers, Wireless Audio/Keyboard/Mouse). It could
easily to design product requiring wireless connectivity. It can be used on wireless
security system or specific remote-control function and others wireless
system.Operating Range is 30 meters without requiring any external antenna.
2.3.5.Features:
• Low power consumption.
• Integrated bit synchronizer.
• Integrated IF and data filters.
• High sensitivity (type -104dBm)
• Programmable output power -20dBm~1dBm
• Operation temperature range : -40~+85 deg C
• Operation voltage: 1.8~3.6 Volts.
• Available frequency at : 2.4~2.483 GHz
• Digital RSSI
• Automation system.
DEPT OF ECE 32 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 33/75
WIRELESS ELECTRONIC NOTICE BOARD
2.3.6.Pin Diagram:
Fig. 2.3.6.: ZigBee Pin Diagram
2.3.6.1.Pin Description:
1) VCC Power 1.8~3.6V power supply
2) SI - Digital Input - Serial configuration interface, data input
3) SCLK - Digital Input - Serial configuration interface, clock input
4) SO - Digital Output - Serial configuration interface, clock input
· Optional general output pin when CSN is high
5) GDO2 - Digital I/O - Digital output pin for general use
· Test signals· FIFO status signals
DEPT OF ECE 33 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 34/75
WIRELESS ELECTRONIC NOTICE BOARD
· Clear Channel indicator
· Clock output, down-divided from Xosc
· Serial output RX data
6) GND - Ground
7) GDO0 - Digital I/O Digital output pin for general use:
· Test signals
· FIFO status signals
· Clear Channel indicator
· Clock output RX data
· Serial output RX data
· Serial input TX data
Also used as analog test I/O for prototype/production testing
8) Digital Input Serial configuration interface ,chip select
2.3.7.APPLICATIONS:
· Car & Home security system
· Remote keyless entry / Garage door controller
· Wireless game controllers/mouse/keyboard/audio
2.4 LCD MODULE
An HD44780 Character LCD is an industry standard liquid crystal display
(LCD) display device designed for interfacing with embedded systems. These screens
come in common configurations of 8x1 characters, 16x2, and 20x4 among others. The
largest such configuration is 40x4 characters, but these are rare and are actually two
separate 20x4 screens seamlessly joined together. The low power supply (2.7 to 5.5v)
of hd44780.
These screens are often found in copiers, fax machines, laser printers, industrial
test equipment, networking equipment such as routers and storage devices, etc. These
are not the kind of screens one would find in a cell phone, portable television, etc. They
are limited to text only, with 8 customizable characters.
DEPT OF ECE 34 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 35/75
WIRELESS ELECTRONIC NOTICE BOARD
Character LCD s can come with or without back lights. Back lights can be LED,
fluorescent, or electro luminescent. Here we are used LM20400.The ability to display
numbers, characters,and a few characters. Incorporation of a refreshing controller into
the Lcd, thereby relieving the cpu of the task of refreshing the LCD.Ease of
programming for characters and graphics.
Character LCD s use a standard 16-pin interface. If the screen has a back light,
it will have 16 pins. The pin outs are as follows:
Fig2.4: 16*2 LCD Display
2.4.1.Pin Assignment:
The pin assignment standard for character LCD-modules with a maximum of 80
characters and for character LCD-modules with more than 80 characters. Table, pin
assignment for <=80 character displays.
Pin number Symbol Level I/O Function
1 vs s - - Power supply (GND)
2 V cc - - Power supply (+5V)
3 V ee - - Contrast adjust
4 RS 0/1 I 0 = Instruction input1 = Data input
5 R/W 0/1 I 0 = Write to LCD module1 = Read from LCDmodule
6 E 1, 1->0 I Enable signal
7 DB0 0/1 I/O Data bus line 0 (LSB)
DEPT OF ECE 35 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 36/75
WIRELESS ELECTRONIC NOTICE BOARD
8 DB1 0/1 I/O Data bus line 1
9 DB2 0/1 I/O Data bus line 2
10 DB3 0/1 I/O Data bus line 3
11 DB4 0/1 I/O Data bus line 4
12 DB5 0/1 I/O Data bus line 5
13 DB6 0/1 I/O Data bus line 6
14 DB7 0/1 I/O Data bus line 7 (MSB)
15 LED BL A I/O Battery +
16 LED BL K I/O Battery -
Table.2.4.1: LCD Pin Configuration
Character LCD s can operate in 4-bit or 8-bit mode. In 4 bit mode, pins 7
through 10 are unused and the entire byte is sent to the screen using pins 11 through 14
by sending a at a time.
2.4.2.LCD Command Codes:
1) Clear display screen
2) Return home,
4) Decrement cursor (shift cursor to left).
5) Increment cursor (shift cursor to right).
6)Shift display Here we are used LM20400y right.
7) shift display left.
8) Display off, cursor off.
A Display off, cursor on.
C Display on, cursor off.
E Display on, cursor blinking.
F Display on, cursor blinking.
10 Shift cursor position to left.
14 Shift cursor position to right.
18 Shift the entire display to the left.
1C Shift the entire display to the right.
80 Force cursor to beginning of 1st line.
DEPT OF ECE 36 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 37/75
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 38/75
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 39/75
WIRELESS ELECTRONIC NOTICE BOARD
(Least Significant Bit) is sent first. A Stop Bit (Logic 1) is then appended to the signal
to make up the transmission.
The data sent using this method, is said to be framed. That is the data is framed
between a Start and Stop Bit.
2.5.2.RS-232 Voltage Levels:
• +3 to +25 volts to signify a "Space" (Logic 0)
• -3 to -25 volts for a "Mark" (logic 1).
• Any voltage in between these regions (i.e. between +3 and -3 Volts) is
undefined.The data byte is always transmitted least-significant-bit first. The bits are
transmitted at specific time intervals determined by the baud rate of the serial signal.
This is the signal present on the RS-232 Port of your computer, shown below.
Fig2.5.2.: RS-232 Logic Waveform
2.5.3.RS-232 LEVEL CONVERTER:
Standard serial interfacing of microcontroller (TTL) with PC or any RS232C
Standard device , requires TTL to RS232 Level converter . A MAX232 is used for this
purpose. It provides 2-channel RS232C port and requires external 10uF capacitors.
The driver requires a single supply of +5V.
DEPT OF ECE 39 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 40/75
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 41/75
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 42/75
WIRELESS ELECTRONIC NOTICE BOARD
Fig2.5.4(a): RS232
IBM PC/ compatible computers based on x86(8086, 80286, 386, 486 and
Pentium) microprocessors normally have two COM ports. Both COM ports have
RS232 type connectors. Many PCs use one each of the DB-25 and DB-9 RS232
connectors. The COM ports are designated as COM1 and COM2. We can connect the
serial port to the COM 2 port of a PC for serial communication experiments. We use a
DB9 connector in our arrangement.
CHAPTER.3.
3.SOFTWARE FEATURES
3.1.Introduction:
In this chapter the software used and the language in which the program code is
defined is mentioned and the program code dumping tools are explained. The chapter
also documents the development of the program for the application. This program has
been termed as “Source code”. Before we look at the source code we define the two
header files that we have used in the code.
DEPT OF ECE 42 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 43/75
WIRELESS ELECTRONIC NOTICE BOARD
3.2.Tools Used:
Fig3.2.: Keil Software- internal stages
Keil development tools for the 8051 Microcontroller Architecture support every
level of software developer from the professional applications
a)C51 Compiler & A51 Macro Assembler:
Source files are created by the µVision IDE and are passed to the C51 Compiler
or A51 Macro Assembler. The compiler and assembler process source files and create
replaceable object files.
The Keil C51 Compiler is a full ANSI implementation of the C programming
language that supports all standard features of the C language. In addition, numerous
features for direct support of the 8051 architecture have been added.
DEPT OF ECE 43 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 44/75
WIRELESS ELECTRONIC NOTICE BOARD
b)Start µVision:
µVision is a standard Windows application and started by clicking on the
program icon.
c)Create a Project File:
To create a new project file select from the µVision menu Project – New
Project. This opens a standard Windows dialog that asks you for the new project file
name. We suggest that you use a separate folder for each project. You can simply use
the icon Create New Folder in this dialog to get a new empty folder. Then select this
folder and enter the file name for the new project, i.e. Project1. µVision creates a new
project file with the name PROJECT1.UV2 which contains a default target and file
group name. You can see these names in the Project Workspace – Files.
d)Select a Device:
1. Click on the Keil uVision Icon on Desktop
2. The following fig will appear
DEPT OF ECE 44 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 45/75
WIRELESS ELECTRONIC NOTICE BOARD
3. Click on the Project menu from the title bar
4. Then Click on New Project
5. Save the Project by typing suitable project name with no extension in u r own
folder sited in either C:\ or D:\
6. Then Click on Save button above.
7. Select the component for u r project. i.e. Atmel……8. Click on the + Symbol beside of Atmel
DEPT OF ECE 45 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 46/75
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 47/75
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 48/75
WIRELESS ELECTRONIC NOTICE BOARD
16. The next screen will be as shown in next page, and just maximize it by double
clicking on its blue boarder.
17. Now start writing program in either in “C” or “ASM”
18. For a program written in Assembly, then save it with extension “. asm” and for
“C” based program save it with extension “ .C”
DEPT OF ECE 48 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 49/75
WIRELESS ELECTRONIC NOTICE BOARD
19. Now right click on Source group 1 and click on “Add files to Group Source”
20. Now you will get another window, on which by default “C” files will appear.
DEPT OF ECE 49 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 50/75
WIRELESS ELECTRONIC NOTICE BOARD
21. Now select as per your file extension given while saving the file
22. Click only one time on option “ADD”
23. Now Press function key F7 to compile. Any error will appear if so happen.
24. If the file contains no error, then press Control+F5 simultaneously.
25. The new window is as follows
DEPT OF ECE 50 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 51/75
WIRELESS ELECTRONIC NOTICE BOARD
26. Then Click “OK”
27. Now Click on the Peripherals from menu bar, and check your required port as
shown in fig below
28. Drag the port a side and click in the program file.
DEPT OF ECE 51 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 52/75
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 53/75
WIRELESS ELECTRONIC NOTICE BOARD
//USERDEFINE DATA TYPES
typedef unsigned char LCDubyte;
//DEFINE PROTOTYPES
static void LCDEnable(void);
void LCDWriteCommand(LCDubyte command);
void LCDWriteData(LCDubyte ascii);
void LCDWriteString(LCDubyte *lcd_string);
static void LCDWriteByte(LCDubyte LCDData);
void LCDInitialize(void);
void LCDDisplayInitializing(void);
void LCDDisplayByte(LCDubyte LCDAdress, LCDubyte Value);
static void LCDReset(void);
#endif
static void LCDEnable(void)
{
LCDEnablePin = HIGH;
Delay(2);
LCDEnablePin = LOW;
}
void LCDWriteCommand(LCDubyte LCDData)
{
LCDRegisterSelectPin = LOW;
LCDWriteByte(LCDData);
}
void LCDWriteData(LCDubyte LCDData)
{
LCDRegisterSelectPin = HIGH;
LCDWriteByte(LCDData);
}
void LCDWriteString(LCDubyte *lcd_string)
{
DEPT OF ECE 53 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 54/75
WIRELESS ELECTRONIC NOTICE BOARD
while (*lcd_string)
{
LCDWriteData(*lcd_string++);
}
}
void LCDInitialize(void)
{
LCDEnablePin = OUTPUTPIN;
LCDRegisterSelectPin = OUTPUTPIN;
LCDDataPort &= 0x0f;
LCDReset();
LCDWriteCommand(0x28);
LCDWriteCommand(0x0C);
LCDWriteCommand(0x06);
LCDWriteCommand(0x01);
}
static void LCDReset(void)
{
LCDWriteCommand(0x33);
LCDWriteCommand(0x33);
LCDWriteCommand(0x32);
}
void LCDDisplayInitializing(void)
{
//LCDubyte i;
LCDWriteString("INITIALIZING....");
//LCDRow2();
//for(i = 0 ; i < 16; i++)
//{
// LCDWriteData(46); // ascii value of '.' in decimanl
Delay(100);
//}
DEPT OF ECE 54 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 55/75
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 56/75
WIRELESS ELECTRONIC NOTICE BOARD
#define DELAY_H
//FUNCTION PROTOTYPE
void Delay(unsigned int time);
//DEFINE USER DEFINED DATATYPE
typedef unsigned char ubyte;
#endif
//--------------------------------------------------------
// LCD port input output pins installation
//---------------------------------------------------------
#ifndef LCD_H
#define LCD_H
#define LCD_DATA P1
#define LOW 0
#define HIGH 1
#define MAX_COLUMNS
16
#define UNDER_LINE_CURSOR_ON
74
#define UNDER_LINE_CURSOR_OFF
75
#define CLEAR_DISPLAY
88
#define BLINKING_CURSOR_ON
83
#define BLINKING_CURSOR_OFF
84
#define SET_CURSOR_HOME
72
DEPT OF ECE 56 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 57/75
WIRELESS ELECTRONIC NOTICE BOARD
#define SET_CURSOR_POSITION
71
#define SET_CONTRAST
80
#define SET_BACKLIGHT_BRIGHTNESS 153
#define GENERALPURPOSE_OUTPUT_ON
87
#define GENERALPURPOSE_OUTPUT_OFF
86
#define BACKLIGHT_ON
66
#define BACKLIGHT_OFF
70
#define CURSOR_LEFT
76
#define CURSOR_RIGHT
77
//lcd commands
//lcd commands
#define LCD_CLEAR_DISPLAY
0X01
#define LCD_CURSOR_ON
0x0E
#define LCD_CURSOR_OFF
0x0C
#define LCD_BLINKING_ON
0x0F
#define LCD_BLINKING_OFF
0x0C
#define LCD_CURSOR_HOME
0x02
#define LCD_CURSOR_LEFT
0x10
DEPT OF ECE 57 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 58/75
WIRELESS ELECTRONIC NOTICE BOARD
#define LCD_CURSOR_RIGHT
0x14
sbit RS = P3^2;
sbit E = P3^3;
void SignOnMessage();
void delay(unsigned int);
void LcdInit();
void LCDInstWrite(unsigned char instruction);
void LCDDataWrite(unsigned char character);
void LCDGotoXY(unsigned char X, unsigned char Y);
//void LCDPutText(char *datastr);
LCDPutChar(char datachar);
void LCDWriteLine(unsigned char LineNo, char *datastr, unsigned char Alignment);
void LCDClearLine(unsigned char LineNo);
void LCDCursorON();
void LCDCursorOFF();
void LCDClearLine(unsigned char LineNo);
void SendByteSerial(unsigned char lcdstr);
unsigned char LCD_CurrentX=1;
unsigned char LCD_CurrentY=1;
unsigned char *ptr,i;
unsigned char *lines[]={
"\r*******************************************\
n\r",
"** Welcome to E-Notice Board **\n\r",
"*******************************************\n\
r",
"** Operation Instructions.... **\n\n\r",
DEPT OF ECE 58 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 59/75
WIRELESS ELECTRONIC NOTICE BOARD
"** Press 1 to Clear Display **\n\r",
"** Press 2 to Display String on 1st Line**\n\r",
"** Press 3 to Display String on 2nd Line**\n\r",
"** Press 4 to Enter String to Display **\n\r",
"*******************************************\n\
r",
"\n\n\rPress Now:\n\n\r"};
unsigned char *inst[]={
"Lcd On & Initialised...\n\r",
"Cleared LCD Display...\n\r",
"String will Display in 1st Line...\n\r",
"String will Display in 2nd Line...\n\r",
"Please enter the String and Press Return...\n\r",
"LCD Turned OFF...\n\r"};
#endif
//---------------------------------------------------
// Main function starts here
//---------------------------------------------------
/*-----------------------------------------------------------------------------
serial coomunication.c : Demonstration of serial communication - A ECHO program
Designed for 8051 running at 11.0592Mhz
communication between PC and microcontroller.
RS232 serial specification
9600 baud rate
8-bit
1- start bit
1-stop bit
parity none
compile the program in Keil uVision Compiler.
Note: Hyper Terminal / Terminal v1.9b software for communication
operation: receives data from PC (or any serial device) and transmitt
DEPT OF ECE 59 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 60/75
WIRELESS ELECTRONIC NOTICE BOARD
same data back to PC- A ECHO program
feedback appreciated: [email protected]
------------------------------------------------------------------------------*/
//INCLUDES
#include<reg51.h> //Includes definition of 89c51
#include <intrins.h>
#include <string.h>
#include <stdio.h>
#include "lcd.h"
#include "delay.h"
//DEFINE CONSTANT
#define Baud_rate 0xFD // BAUD RATE 9600
//#define LCDDataPort P2
//DEFINE PROTOTYPES
void main(void);
void SerialInitialize(void);
void SendByteSerially(unsigned char ascii);
unsigned char ReceiveByteSerially(void);
void send_string(unsigned char *ptr);
//FUNCTIONS
void main(void)
{
unsigned char lcdstr[50],lk,serialdata,lcdcommand; // DECLARE
serialdata VARIABLE AS UNSIGNED CHAR
//unsigned char *lok[21];
SerialInitialize(); // CALL ROUTINE TO INITIALIZE
SERIAL PORT
LcdInit();
SignOnMessage();
DEPT OF ECE 60 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 61/75
WIRELESS ELECTRONIC NOTICE BOARD
delay(0xffff);
for(i=0;i<=9;i++)
{
send_string(lines[i]);
//LCDPutChar(serialdata);
}
for(;;) // INFINITE LOOP
{
//serialdata = ReceiveByteSerially(); // RECEIVE DATA FROM
SERIAL PORT (PC)
//SendByteSerially(serialdata); // SEND DATA BACK TO PC
lcdcommand= ReceiveByteSerially();
switch(lcdcommand)
{
case '1':
LCDInstWrite(LCD_CLEAR_DISPLAY);
send_string("Cleared LCD Display...\n\r");
break;
case '2':
LCDInstWrite(LCD_CLEAR_DISPLAY);
LCDWriteLine(1,"ESSENCE SOCIETY",2);
send_string("String will Display in 1st
Line...\n\r");
LCDInstWrite(0x80);
break;
case '3':
LCDInstWrite(LCD_CLEAR_DISPLAY);
LCDWriteLine(2,"ANANTAPUR",2);
send_string("String will Display in 2nd
Line...\n\r");
LCDInstWrite(0xC0);
DEPT OF ECE 61 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 62/75
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 63/75
WIRELESS ELECTRONIC NOTICE BOARD
} // END OF MAIN FUNCTION
void SerialInitialize(void) // INITIALIZE SERIAL PORT
{
TMOD = (( TMOD & 0x0F) | 0x20); // Timer 1 IN MODE 2 -AUTO
RELOAD TO GENERATE BAUD RATE
SCON = 0x50; // SERIAL MODE 1, 8-DATA BIT 1-START
BIT, 1-STOP BIT, REN ENABLED
TH1 = Baud_rate; // LOAD BAUDRATE TO TIMER
REGISTER
TR1 = 1; // START TIMER
}
void SendByteSerially(unsigned char serialdata)
{
SBUF = serialdata; // LOAD DATA TO SERIAL BUFFER
REGISTER
while(TI == 0); // WAIT UNTIL
TRANSMISSION TO COMPLETE
TI = 0; // CLEAR TRANSMISSION
INTERRUPT FLAG
}
void SendByteSerial(unsigned char serial)
{
SBUF = serial; // LOAD DATA TO SERIAL BUFFER
REGISTER
while(TI == 0); // WAIT UNTIL
TRANSMISSION TO COMPLETE
TI = 0; // CLEAR TRANSMISSION
INTERRUPT FLAG
}
unsigned char ReceiveByteSerially(void)
{
while(RI == 0); // WAIT UNTIL DATA IS
RECEIVED
DEPT OF ECE 63 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 64/75
WIRELESS ELECTRONIC NOTICE BOARD
RI = 0; // CLEAR FLAG
return SBUF; // RETURN SERIAL DATA
}
void send_string(unsigned char *str)
{
while(*str)
{
SendByteSerially(*str++);
}
}
/
**********************************************************************
******
LCD INTIALISATIONS
**********************************************************************
*******/
void LcdInit()
{
// LCDInstWrite(0X30);
// delay(0xff);
// LCDInstWrite(0x30);
// delay(0xff);
// LCDInstWrite(0x30);
// delay(0xff);
LCDInstWrite(0x38);
LCDInstWrite(0x0C);
LCDInstWrite(0x01);
LCDInstWrite(0x06); // Auto increment cursor position
}
void LCDInstWrite(unsigned char instruction)
{
DEPT OF ECE 64 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 65/75
WIRELESS ELECTRONIC NOTICE BOARD
RS = 0;
E = 0;
LCD_DATA = instruction;
E = 1;
// _nop_();
// _nop_();
// _nop_();
delay(0xf);
E = 0;
delay(0xff);
}
void LCDDataWrite(unsigned char character)
{
RS = 0;
E = 0;
LCD_DATA = character;
E = 1;
RS = 1;
// _nop_();
// _nop_();
// _nop_();
delay(0xf);
E = 0;
delay(0x1ff);
}
void LCDGotoXY(unsigned char X, unsigned char Y)
{
if(X < 1 || X > MAX_COLUMNS)
return;
switch(Y)
{
DEPT OF ECE 65 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 66/75
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 67/75
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 68/75
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 69/75
WIRELESS ELECTRONIC NOTICE BOARD
The above ciricuit diagram shows “Wireless Electronic Notice Board”.
The above diagram consists of
1.Microcontroller.(AT89S52).
2. LCD.
3. MAX232.
4. DB9 connector.
The connections of the project are explained here. LCD they have 16 pins in
that 1st ,3rd ,and 5th pins are connected to Ground. Reset and Enable pins are connected
to Microcontroller P3.2 and P3.3. LCD seven data pins are connected to
Microcontroller P1.0-P1.7.
The Microcontroller 31st and 40th pins are connected to the VCC and the 18th
and 19th pins are connected to crystal oscillator through capacitors to ground, 20 th pin
also connected to the ground. Whereas the pins 10th and 11th of the microcontroller are
connected to the pins 12th and 11th of MAX232.
The MAX232 pins 6th and 15th are connected to the ground, 1st and 3rd pins are
connected to the capacitor C3, 4th and 5th pins are connected to the C4, 2nd and 16th pins
are connected to VCC through to capacitor C1 and 13th and 14th pins are connected to
DB9 Serial Port pins of 2nd(Rxd) and 3rd(Txd).Serial Port 5th pin is connected to the
Ground.
CHAPTER.6.
DEPT OF ECE 69 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 70/75
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 71/75
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 72/75
WIRELESS ELECTRONIC NOTICE BOARD
6. Above fig shows the whenever we press the 3 button in the keyboard the
respective command will seen on hyper terminal as well as respective function
seen on the LCD.
7. Whenever we press the 4 button in the keyboard the respective command will
follows by the LCD that is “please enter the string and press return”.
8. For example we can enter the string “Welcome” and then press the “Shift+4”
the String will be displayed on the LCD Board.
DEPT OF ECE 72 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 73/75
WIRELESS ELECTRONIC NOTICE BOARD
CHAPTER.7.
7.CONCLUSION
• This project can be successfully implemented we can transferring the data
between the two devices through Wireless Communication.
• This project can be used in Bus and Railway stations, Offices and Colleges.
DEPT OF ECE 73 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 74/75
WIRELESS ELECTRONIC NOTICE BOARD
CHAPTER.8.
8.FUTURE SCOPE
The project will be extended by means of controlling the several devices
connected to the target board. In future we can control the device from remote end such
as pc using by developing webpage.
DEPT OF ECE 74 SSCET
8/2/2019 b.naresh-9494406519 Sri Sai College of Eng & Technology (2)
http://slidepdf.com/reader/full/bnaresh-9494406519-sri-sai-college-of-eng-technology-2 75/75
WIRELESS ELECTRONIC NOTICE BOARD
CHAPTER.9.
9.REFERENCES
Text Books:
Microcontroller and Embeeded systems By Mazidi.
Working with Radio Frequency By Cruis Leanardo.
Radio Frequency Applications By Morris Hamington.
Website:
www.howstuffworks.com
www.answers.com
www.radiotronix.com
Magazines:
Electronics for you
Electrikindia
Let us Go Wireless