Sunteți pe pagina 1din 109

Moving Message Display

INTRODUCTION

Moving Message Display

1. INTRODUCTION
Todays publicity trends are involving with novel methods. The presentation part plays
vital role for publicity. So there are different methods to display the presentations are developing
like direct printing of images on hoardings using cloth, neon display systems, rolling screens
electronic display systems etc. out of all, electronic display systems are dominating in
presentation of advertisements.
For small message presentations this rolling display sign boards are very effective than
any other display systems. These are compact and economical for general applications. Rolling
Displays are ideal for all type of commercial establishments like Hotels, Restaurants, Banks,
Airports, and other such places to get maximum attention of people where vast amounts of
information need to be conveyed to large audiences both quickly and efficiently, also in the
world of indoor and outdoor displays.
These displays attract customers to watch the display with curiosity and your scrolling
Message also is conveyed simultaneously. Very good advertising results are obtained from these
Unique displays with latest technology.
This Project PC Based Rolling Display Sign Board using Micro Controller basically
depends upon the micro controller and its software. There should be standard PC Keyboard to
input to the message to be displayed. You can change the message as often as you want your self
with ordinary computer keyboard without any prior experience of any kind.
The display unit should be able to display at least 4 characters at a time. The total
message may be taken as maximum 40 characters. There should be provision for shifting of data
from Right to Left. Each character requires 8 x 8 matrix display. So 64 LEDs are required for the
displaying one character. Therefore total 256 LEDs are required for displaying 4 characters at a
time.

Moving Message Display

INTRODUCTION TO
EMBEDDED SYSTEMS

Moving Message Display

2. INTRODUCTION TO EMBEDDED SYSTEMS


2.1 Definition
A combination of hardware and software, which together form a component of a larger
machine. An example of an embedded system is a microprocessor that controls an moving
message display. An embedded system is designed to run its own without human intervention,
and may be required to respond to events in real time.
A specialized computer system that is part of a large system or machines typically, an
embedded system is housed on a single microprocessor board with the program stored in ROM.
Virtually all appliances that have a digital interface watches, microwaves and VCRs utilize
embedded systems. Some embedded systems include an operating system, but many are so
specialized that the entire logic can be implemented as a single program.
Each day, our lives become more dependent on EMBEDDED SYSTEMS, digital
information technology that is embedded in our environment.
2.2 Important Features of Embedded Systems
Embedded systems perform a very specific task and they cant be programmed to
different things.
Embedded systems have very limited resources, particularly the memory.
Generally they do not have secondary devices such as CD-ROM, Floppy Disk.
Embedded systems have to operate in extreme environmental conditions such as very
high temperatures and humidity.
2.3 Application Areas of Embedded Systems
Consumer Appliances
Office Automation
Medical Electronics
Advertisement

Moving Message Display

WORKING PRINCIPLE
OF MOVING MESSAGE
DISPLAY

Moving Message Display

3. WORKING PRINCIPLE OF MOVING MESSAGE


DISPLAY

The Principle of Operation of the PC BASED ROLLING DISPLAY SIGN BOARD USING
MICRO CONTROLLER is mainly depends upon the following two functions.
(i)

Serial interface between the PC and Display Board using RS-232 communication
protocol

(ii)

Row and Column selection of the LED Dot Matrix Board by using Micro controller
along with the help of 4-16 decoders.

(i)

What ever the message is to be displayed is given to the PC through standard PC


keyboard. The message to displayed is only of English capital letters and numerical
from 0 to 9. This message is transferred to the micro controller from the PC by using
RS-232 serial communication in the form of ASCII code for the corresponding letter
typed in pc. The message typed in the pc with the keyboard is converted to ASCII
with the help of C program. The Baud Rate used for the serial communication here is
9,600 bps.

(ii)

The corresponding ASCII code for the character typed is transferred to microcontroller through the level converter (MAX-232). The micro-controller reads the
corresponding letter typed with the help of RXD pin. The program for selecting the
rows and columns is written in the assembly language is stored in micro-controller
itself.

Moving Message Display

DESIGN PROCEDURE

Moving Message Display

4. DESIGN PROCEDURE
The design of any project is a step by step method. The design involves some basic steps
They are
Circuit design
PCB design
Checking the components
Installing the components into PCB
Testing

4.1 Circuit Design


The circuit design is the main step in design of the any project. In designing of the circuit
we should have to know the characteristic of the each and every component. The circuit design
can be done in the chart or in any circuit editor. In this project first DB9 female is connected to
the Transmitter through MAX232. Here MAX232 is the voltage level converter from TTL to
CMOS levels. Here totally the components require at the transmitter side are DB9 female,
MAX232 and the transmitter.
The receiver is connected to the microcontroller. The microcontroller is connected to the
decoders and latches for driving the columns and rows of the display to represent the character.

4.2 PCB Design


PCB design is done in ZUKEN CADSTAR. ZUKEN CADSTAR is the software used for
designing of the PCB. In this software first we design the circuit diagram. After words
corresponding PCB layout is designed. The PCB layout is compiled in that software if any
errors are came that errors are display in the dialog box that errors shows any short circuits in
the PCB. After designing the PCB layout the layout is printed on the circuit board. The
8

Moving Message Display


dimensions of board and printing level decide the cost of PCB. After designing the PCB we
should have to check out all connections in the PCB.

The PCB layouts of the transmitter and receiver are given as bellow
Transmitter

Fig 4.1 PCB layout for transmitter section

Moving Message Display

Receiver

10

Moving Message Display

Fig 4.2 PCB layout of receiver section

4.3 Checking the Components


Different components are checked in different ways. Transistors are checked by
checking the hfe of transistor. The hfe value should be above of 250. The capacitors are

11

Moving Message Display


checked by the multimeter. Resistors and connections in the PCB are also checked by
multimeter. ICS are checked out by the IC tester.

4.4 Installing the Components Into PCB


In installing the components we should have to take care about the soldering. Temperature is
the main thing in soldering. ICS, capacitors, regulators and resistors are very sensitive to the
temperature. So IC bases are used for the ICs. In soldering of adjacent pins of IC or connectors
are not to be shorted.

4.5 Testing
Testing of the designed PCB is the crucial thing. The testing can be done in different
ways. The testing of power supply can be done in first step. Testing of the transmitter and
receiver is done in second step by connecting the function generators output to transmitter and
checking the out put of the receiver in CRO. After that the whole circuit is tested by giving the
input to MC and checking the output at the display. For checking the display, multimeter is kept
in supply mode. By placing positive terminal at row (anode) pins and negative terminal at
columns (cathode) corresponding LEDs are tested.

12

Moving Message Display

BLOCK DIAGRAM

5. BLOCK DIAGRAM
5.1 Transmitter Block Diagram

13

Moving Message Display

Fig 5.1

5.2 Receiver Block Diagram

Fig 5.2

14

Moving Message Display

CIRCUIT DIAGRAM
AND
OPERATION

6. CIRCUIT DIAGRAM AND OPERATION

15

Moving Message Display

6.1 Transmitter Diagram and its Operation

Fig 6.1
To display message in the display board we need to compile the above c program in
standard compilers. After the compilation the program asks to input the data that is to be
displayed. The input data to be started with star (*) and ends with the same. The PC transmits the
data through the RS232 to transmitter. As we have to convert the RS232 logic levels to CMOS
logics we use MAX232 in middle of them. The data to be transmitted is modulated by OOK
modulation at 433 MHZ frequency and transmitted as analog signal by the transmitter.

6.2 Receiver Diagram and its Operation

16

Moving Message Display

The 433 MHZ frequency analog signal is received by the receiver. The receiver demodulates and
converts it to obtain the original data. The output from the receiver is connected to the pin10
(RXD) of microcontroller (AT89C51).A reset circuit is connected to pin9 (RST) of MC. The

17

Moving Message Display


11.0592MHZ crystal is connected to pin18 (XTAL2) and pin19 (XTAL1) of MC as shown in the
above figure.
The port0 (P0.0 to P0.7) is connected to latch (74LS573) input pins 2 to 9. The pin10 of
latch is connected to ground and pin 11 to pin 27 (EA) of MC to enable the latch. The pin21 to
24 (P2.0 to P2.3) of MC is connected to decoder input pins (23 to 20) respectively to 2 decoders
(74HC154). Pin 25 of MC is connected to decoder (1) and Pin 26 of MC is connected to decoder
(2) to pin 18 to enable the decoder. The pin19 (E1) and pin12 (GND) of decoder are grounded,
for the operation of decoder pin 19 should be always low.
The latch outputs are connected to the rows of the display. The decoder outputs are
connected to columns of display. The bits corresponding to the given character is transmitted to
the latch and it transfers to the corresponding rows. The columns are refreshed by the decoders at
15s so that the data appears to be moving from right to left.

18

Moving Message Display

POWER SUPPLY

7. POWER SUPPLY

19

Moving Message Display

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. To make a 5 volt power supply, we use a LM7805
voltage regulator IC. The IC is shown below.
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.
Sometimes the input supply line may be noisy. To help smooth out this noise and get a
better 5 volt output, a capacitor is usually added to the circuit, going between the 5 volt output
and ground (GND). We use a 220 uF capacitor.

7.1 VOLTAGE REGULATORS:


A Voltage Regulator has only three legs and appears to be a comparatively simple device
but it is actually a very complex integrated circuit. A regulator converts varying input voltage and
produces a constant "regulated" output voltage. Voltage regulators are available in a variety of
outputs, typically - 5 volts, 9 volts and 12 volts. The last two digits in the name indicate the
output voltage.
The "LM78XX" series of voltage regulators are designed for positive input. For
applications requiring negative input the "LM79XX" series is used.

20

Moving Message Display


Fig 7.1
The circuit diagram below represents a typical use of a voltage regulator.

Fig 7.2
The transformer drops 240 volt 'mains' voltage to 9 volts. The diode 'bridge' changes the
8.5 volts AC into DC. The 1000uF capacitor helps to maintain a constant input into the regulator.
As a general guide this capacitor should be rated at a minimum of 1000uF for each amp of
current drawn and at least TWICE the input voltage. The 0.1uF capacitor eliminates any high
frequency pulses that could otherwise interfere with the operation of the regulator.
Voltage regulators are very robust. They can withstand over-current draw due to short
circuits and also over-heating. In both cases the regulator will shut down before damage occurs.
The only way to destroy a regulator is to apply reverse voltage to its input. Reverse polarity
destroys the regulator almost instantly. To avoid this possibility you should always use diode
protection of the power supply. This is especially important when using nine volt battery supplies
as it is common for people to 'test' the battery by connecting it one way and then the other. Even
this short 'test' would destroy the regulator if a protection diode were not used.

21

Moving Message Display


All of the interfaces described on this site have protection diodes for this reason. Usually
a 1N4007, 1 amp power diode is connected in series with the power supply.

7.2 Input voltage:


As a general rule the input voltage should be limited to 2 to 3 volts above the output
voltage. The LM78XX series can handle up to 30 volts input, but the power difference between
the input voltage/current ratio and output voltage/current ratio appears as heat. If the input
voltage is unnecessarily high the regulator will get very hot. Unless sufficient heat-sinking is
provided the regulator will shut down.

22

Moving Message Display

SERIAL
COMMUNICATION

8. SERIAL COMMUNICATION
8.1 Personal Computer:
Personal computer is a general purpose computer. This is having the DB9 male port to
connect to the external devices. In this project C compiler is necessary for transmitting the data
through the DB9 port. A key board is required to input the data in to PC. The Keyboard must

23

Moving Message Display


accommodate all 26 English Alphabets along with numerical keys and a space bar. For editing
purpose two cursor control keys namely left ( ) and right ( ) are required along with a
control key. Finally and* key would be required to initiate the rolling the mechanism of the
display. For all above functions we have used the standard keyboard of 108 keys, i.e. normally
used for the computer.

8.2 RS232 Port:


The most common serial interface used today by computer manufacturers is the RS-232.
This serial interface found on practically every PC and external modem (and many other
devices). RS-232 is simple, universal, well understood and supported everywhere. The original
RS-232 standard only specified the data speeds up to 19200 bps. The output signal level usually
swings between +12v and -12v. In this anything higher than +3V is considered to be logic 0 and
anything lower than -3V is considered to be logic 1. The "dead area" between +3v and -3v is
designed to absorb line noise.

1
9
8
7
6

2
1
3
4
5

Fig 8.1
The above shown connector known as 9-pin, D-type male connector is used for RS232
connections. The pin description is given in the following table.
Pin number
1
2

Common

RS232 name
Description

Signal direction

Name
/CD
RXD

CF
BB

IN
IN

Received line signal detector


Received data

24

Moving Message Display


3
4
5
6
7
8
9

TXD
/DTR
GND
/DSR
/RTS
/CTS
--

BA
Transmitted data
CD
Data terminal ready
AB
Signal ground
CC
Data set ready
CA
Request to send
CB
Clear to send
CE
Ring indicator
Table 8.1.

OUT
OUT
-IN
OUT
IN
IN

1
9
8
7
6

1
2
3
4
5

Fig 8.2
We cannot simply connect our system to this terminal with out providing proper hand
shaking signal. For communicating with RS-232 type equipment, the /RTS of the connector is
simply looped into the /CTS, so /CTS will automatically be asserted when /RTS is asserted
internally. Similarly the /DTR is looped into /DSR and /CD, so when PC asserts its /DTR output
the /DSR and /CD inputs are automatically be asserted. These connections do not provide for any
hardware hand shaking. They are necessary to get the PC and our system talk each other.
8.3 MAX 232:
The AT89C51 microcontroller is based on CMOS logic. CMOS logic levels are logic 0
for 0.1 to 1V and logic 1 for 3.5 to 5V. But as mentioned above in RS232 the logic levels are quit
reverse to CMOS levels. So to convert the RS232 logic levels to CMOS levels we have use
MAX232.

25

Moving Message Display


The original MAX232 is a 16 pin IC with dual in line package and it includes two drivers
that convert TTL inputs to RS-232 outputs, and two receivers that accept RS-232 inputs and
translate them to CMOS-compatible outputs.
The difference between TTL and CMOS logic levels as fallows
Parameter
Logic-low

TTL logic (volts)

CMOS logic(volts) 74HCT (volts)

output
0.4

0.1

0.1

Logic-high

output
2.4

3.5

3.5

(minimum)
Logic-low

0.8
input

0.8

(maximum)
Logic-high

2.0
input

3.5

2.0

(maximum)

(minimum)
Table 5.2

The pin description and internal blocks of the MAX232is given below as diagram

26

Moving Message Display

Fig 8.3

Fig 8.4

Four external capacitors store energy for the supplies. The recommended value for the
capacitors is 1F or larger.
The capacitors in MAX232 are connected as fallows
The 4 external 1uF capacitors are used by the internal charge pump to create +10V and -10V
For the first capacitor, the negative leg goes to pin 3 and the positive leg goes to pin 1.
For the second capacitor, the negative leg goes to pin 5 and the positive leg goes to pin 4.
For the third capacitor, the negative leg goes to 5 volts and the positive leg goes to pin 2.
For the fourth capacitor, the negative leg goes to pin 6 and the positive leg goes to ground.

27

Moving Message Display

RF LINK

28

Moving Message Display

9. RF LINK
For different application we are using different frequency for transmitting the data. But in this
project we are using 433 MHz frequency because it is the license free zone.
The RF link consists of
RF Transmitter (STT 433)
RF Receiver (STR 433)

9.1 RF TRANSMITTER:
The transmitter used is STT-433 (Sunrom Technologies Transmitter). The STT433 is ideal for remote control applications where low cost and longer range is required.
The transmitter operates from a 1.5-12V supply, making it ideal for battery-powered
applications. The transmitter employs a SAW-stabilized oscillator, ensuring accurate
frequency control for best range performance. Output power and harmonic emissions are
easy to control, making FCC and ETSI compliance easy. The manufacturing-friendly SIP
style package and low-cost make the STT-433 suitable for high volume applications.

9.1.1 Features
433.92 MHz Frequency
Low Cost
1.5-12V operation
11mA current consumption at 3V
Small size
4 dBm output power at 3V

29

Moving Message Display

9.1.2 Applications

Fig 9.1

Remote Keyless Entry (RKE)


Remote Lighting Controls
On-Site Paging
Asset Tracking
Wireless Alarm and Security Systems
Long Range RFID
Automated Resource Management

9.1.3 Pin Description


Pin Name

ANT

Description
50 ohm antenna output. The antenna port impedance affects output power
and harmonic emissions. An L-C low-pass filter may be needed to
sufficiently filter harmonic emissions. Antenna can be single core wire of
approximately 17cm length or PCB trace antenna
Operating voltage for the transmitter. VCC should be bypassed with a .

VCC

01uF ceramic capacitor and filtered with a 4.7uF tantalum capacitor. Noise
on the power supply will degrade transmitter noise performance.
Digital data input. This input is CMOS compatible and should be driven

DATA

with CMOS level inputs.

GND

Transmitter ground. Connect to ground plane.


Table 9.1
Pin Name Description

9.1.4 OPERATION
OOK (On Off Keying) modulation is a binary form of amplitude modulation.
When a logical 0 (data line low) is being sent, the transmitter is off, fully suppressing the
carrier. In this state, the transmitter current is very low, less than 1mA. When a logical 1
is being sent, the carrier is fully on. In this state, the module current consumption is at its
highest, about 11mA with a 3V power supply.

30

Moving Message Display


OOK is the modulation method of choice for remote control applications where
power consumption and cost are the primary factors. Because OOK transmitters draw no
power when they transmit a 0, they exhibit significantly better power consumption than
FSK transmitters. OOK data rate is limited by the start-up time of the oscillator. High-Q
oscillators which have very stable center frequencies take longer to start-up than low-Q
oscillators. The start-up time of the oscillator determines the maximum data rate that the
transmitter can send.

9.1.5 Data Rate


The oscillator start-up time is on the order of 40uSec, which limits the maximum
data rate to 4.8 Kbit/sec.

9.1.6 Saw Stabilized Oscillator


The transmitter is basically a negative resistance LC oscillator whose center
frequency is tightly controlled by a SAW resonator. SAW (Surface Acoustic Wave)
resonators are fundamental frequency devices that resonate at frequencies much higher
than crystals.

9.2 RF RECEIVER
The STR-433(Sunrom Technologies Receiver) is ideal for short-range remote
control applications where cost is a primary concern. The receiver module requires no
external RF components except for the antenna. It generates virtually no emissions,
making FCC and ETSI approvals easy. The
Super-regenerative design exhibits exceptional sensitivity at a very low cost. The
manufacturing-friendly SIP style package and low-cost make the STR-433 suitable for
high volume applications.

9.2.1 Features
Low Cost

31

Moving Message Display


5V operation
3.5mA current drain
No External Parts are required
Receiver Frequency: 433.92 MHZ
Typical sensitivity: -105dBm
IF Frequency: 1MHz

9.2.2 Applications

Car security system

Sensor reporting

Automation system

Remote Keyless Entry (RKE)

Remote Lighting Controls

On-Site Paging

Asset Tracking

Wireless Alarm and Security Systems

Long Range RFID

Automated Resource Management

Fig 6.2

9.3.3 Pin Description:


Pin Name

Description

ANT
GND

Antenna input.
GND Receiver Ground. Connect to ground plane
VCC pins are electrically connected and provide operating voltage for

VCC(5V)

the receiver. VCC can be applied to either or both. VCC should be


bypassed with a .1F ceramic capacitor. Noise on the power supply will
degrade receiver sensitivity.
Digital data output. This output is capable of driving one TTL or

DATA

CMOS load. It is a CMOS compatible output.

32

Moving Message Display


Table 6.2

9.2.4 Operation of the Receiver


9.2.4.1 Super-Regenerative AM Detection
The STR-433 uses a super-regenerative AM detector to demodulate the incoming
AM carrier. A super regenerative detector is a gain stage with positive feedback greater
than unity so that it oscillates. An RC-time constant is included in the gain stage so that
when the gain stage oscillates, the gain will be lowered over time proportional to the RC
time constant until the oscillation eventually dies. When the oscillation dies, the current
draw of the gain stage decreases, charging the RC circuit, increasing the gain, and
ultimately the oscillation starts again.
In this way, the oscillation of the gain stage is turned on and off at a rate set by
the RC time constant. This rate is chosen to be super-audible but much lower than the
main oscillation rate. Detection is accomplished by measuring the emitter current of the
gain stage. Any RF input signal at the frequency of the main oscillation will aid the main
oscillation in restarting. If the amplitude of the RF input increases, the main oscillation
will stay on for a longer period of time, and the emitter current will be higher. Therefore,
we can detect the original base-band signal by simply low-pass filtering the emitter
current. The average emitter current is not very linear as a function of the RF input level.
It exhibits a 1/ln response because of the exponentially rising nature of oscillator start-up.
The steep slope of a logarithm near zero results in high sensitivity to small input signals.
9.2.4.2 Data Slicer
The data slicer converts the base-band analog signal from the super-regenerative
detector to a CMOS/TTL compatible output. Because the data slicer is AC coupled to the
audio output, there is a minimum data rate. AC coupling also limits the minimum and
maximum pulse width. Typically, data is encoded on the transmit side using pulse-width

33

Moving Message Display


modulation (PWM) or non-return-to-zero (NRZ). The most common source for NRZ data
is from a UART embedded in a micro-controller. Applications that use NRZ data
encoding typically involve microcontrollers.
The most common source for PWM data is from a remote control IC such as the
HC-12E from Holtek or ST14 CODEC from Sunrom Technologies. Data is sent as a
constant rate square-wave. The duty cycle of that square wave will generally be either
33% (a zero) or 66% (a one). The data slicer on the STR-433 is optimized for use with
PWM encoded data, though it will work with NRZ data if certain encoding rules are
followed.
9.2.4.3 Power Supply
The STR-433 is designed to operate from a 5V power supply. It is crucial that this
power supply be very quiet. The power supply should be bypassed using a 0.1uF lowESR ceramic capacitor and a 4.7uF tantalum capacitor. These capacitors should be placed
as close to the power pins as possible. The STR- 433 is designed for continuous duty
operation. From the time power is applied, it can take up to 750mSec for the data output
to become valid.
9.2.4.4 Antenna Input
It will support most antenna types, including printed antennas integrated directly
onto the PCB and simple single core wire of about 17cm. The performance of the
different antennas varies. Any time a trace is longer than 1/8th the wavelength of the
frequency it is carrying, it should be a 50 ohm microstrip.

34

Moving Message Display

MICROCONTROLLER

35

Moving Message Display

10. MICROCONTROLLER
10.1 INTRODUCTION
Looking back into the history of microcomputers, one would at first come across the
development of microprocessor, but the stand alone microprocessor is not self-sufficient.
It requires other components like memory and I/O devices to form a workable system
configuration. The device which contains a microprocessor and the above mentioned
components is a microcontroller. The introduction of microcontrollers drastically changed the
microprocessor based system design. The earlier versions of Intels microcontrollers 8031 and
8051 do not have on-chip EPROM and lock bit protection modes. So we are using AT89C51
microcontroller in our project.
The AT89C51 is a low-power, high-performance CMOS 8-bit microcomputer with 4K
bytes of Flash programmable and erasable read only memory (PEROM). The device is
manufactured using Atmels high-density nonvolatile memory technology and is compatible with
the industry-standard MCS-51 instruction set and pin out. The on-chip Flash allows the program
memory to be reprogrammed to the IC. By combining a versatile 8-bit CPU with Flash on a
monolithic chip, the Atmel AT89C51 is a powerful microcomputer which provides a highlyflexible and cost-effective solution to many embedded control applications.
The AT89C51 provides for 4k EPROM/ROM, 128 byte RAM and 32 I/O lines. It also
includes a universal asynchronous receive-transmit (UART) device, two 16-bit timer/counters
and elaborate interrupt logic. Lack of multiply and divide instructions which had been always
felt in 8-bit microprocessors/micro controllers, has also been taken care of in the 89C51- Thus
the 89C51 may be called nearly equivalent of the following devices on a single chip: 8085 +
8255 + 8251 + 8253 + 2764 + 6116.

36

Moving Message Display

10.2 FEATURES
In short, the AT89C51 has the following on-chip facilities:
4k ROM (EPROM on 8751)
128 byte RAM
UART
32 input-output port lines
Two, 16-bit timer/counters
Six interrupt sources and
On-chip clock oscillator and power on reset circuitry

10.3 PIN DIAGRAM

37

Moving Message Display

Fig 10.1
10.4 ARCHITECTURE

38

Moving Message Display

Fig 10.2

10.5 SILENT FEATURES


The 89C51 can be configured to bypass, the internal 4k ROM and run solely with
external program memory. For this its external access (EA) pin has to be grounded. The program
store enable (PSEN) signal acts as read pulse for program memory. The data memory is external
only and a separate RD* signal is available for reading its contents.
39

Moving Message Display

Use of external memory requires that three of its 8-bit ports (out of four) are configured
to provide data/address multiplexed bus. Hi address bus and control signals related to external
memory use. The RXD and TXD ports of UART also appear on pins 10 and 11 of 8051 and
8031, respectively. One 8 bit port, which is bit addressable and, extremely useful for control
applications.
The UART utilises one of the internal timers for generation of baud rate. The crystal used
for generation of CPU clock has therefore to be chosen carefully. The 11.0596 MHz crystals;
available abundantly, can provide a baud rate of 9600.

10.6 CENTRAL PROCESSING UNIT


Let add 3 more memory locations to a specific block that will have a built in capability to
multiply, divide, subtract, and move its contents from one memory location onto another. The
part we just added in is called central processing unit (CPU). Its memory locations are called
registers.
Registers are therefore memory locations whose role is to help with performing various
mathematical operations or any other operations with data wherever data can be found. Look at
the current situation. We have two independent entities (memory and CPU), which are
interconnected, and thus any exchange of data is hindered, as well as its functionality. If, for
example, we wish to add the contents of two memory locations and return the result again back
to memory, we would need a connection between memory and CPU. Simply stated, we must
have some way through data goes from one block to another.
The term used in micro controller is:

10.7 MEMORY UNIT


Memory is part of the micro controller whose function is to store data. The easiest way
to explain it is to describe it as one big closet with lots of drawers. If we suppose that we marked
the drawers in such a way that they can not be confused, any of their contents will then be easily

40

Moving Message Display


accessible. It is enough to know the designation of the drawer and so its contents will be known
to us for sure.
Memory components are exactly like that. For a certain input we get the contents of a
certain addressed memory location and thats all. Two new concepts are brought to us:
addressing and memory location. Memory consists of all memory locations, and addressing is
nothing but selecting one of them. This means that we need to select the desired memory location
on one hand, and on the other hand we need to wait for the contents of that location. Besides
reading from a memory location, memory must also provide for writing onto it. This is done by
supplying an additional line, called control line. We will designate this line as R/W (read/write).
Control line is used in the following way: if r/w=1, reading is done, and if opposite is true then
writing is done on the memory location. Memory is the first element, and we need a
few operation of our micro controller.
The 256 byte address space is utilized by the internal RAM and special function registers
(SFRs) array which is separate from external data RAM space of 64k. The 00-7F space is
occupied by the RAM and the 80 - FF space by the SFRs. The 128 byte internal RAM has been
utilized in the following fashion:
128 bytes
RAM

32 Bytes
Register Selector
Bank

RB0

16 Bytes
Addressing
Area

RB1

RB2

80 Bytes
General Purpose

RB3

00-IF: Used for four banks of eight registers of 8-bit each. The four banks may be selected by
software any time during the program.
20-2F: The 16 bytes may be used as 128 bits of individually addressable locations. These are
extremely useful for bit oriented programs.

41

Moving Message Display


30- 7F: This area is used for temporary storage, pointers and stack. On reset, the stack starts at 08

and gets incremented during use.

10.7.1 Basic Registers:


Accumulator:

42

Moving Message Display


The accumulator, as its name suggests, is used as a general register to accumulate the
results of a large no of instructions. It can hold an 8-bit (1-byte) value and is the most versatile
register.
R register:
The R registers are a set of 8 registers that are R0, R1.R7. These registers are used as
auxiliary registers in many operations.
B registers:
The B register is very similar to the accumulator in the sense that it may hold an 8-bit
value. The B register is only used by two 89C51 instructions: MUL AB and DIV AB. Thus, if u
want to quickly and easily multiply or divide A by another number, u may store the number in B
register and make use of these two instructions.
Program Counter (PC):
The program counter is a 2-byte address; it tells the 89C51 where the next instruction
executes is found in memory. When the 89C51 is initialized PC always starts at 0000H and is
incremented each time an instruction is executed.
Data Pointer (DPTR):
The data pointer is the 89C51s only user accessible 16-bit register. The accumulator, R
register and B register are all 1byte registers. DPTR, as the name suggests, is used to point to
data. It is used by a no of commands, which allows the 89C51 to access external memory. When
the 89C51 access external memory it will access external memory at the address indicated by
DPTR.
Stack Pointer (SP):
The stack pointer, like all registers except DPTR and PC, may hold an 8-bit value. The SP
is used to indicate where the next value to be removed from the stack. When you push a value
on to the stack, the 89C51 first increments the value of stack pointer and then stores the value at
the resulting memory location. When you pop a value of the stack, the 89C51 returns the value
from the memory location indicated by SP, and then decrements the value of SP. The SP is
modified directly by the 89C51 by 6 instructions: PUSH, POP, ACALL, LCALL, RESET and
RETI.

10.7.2 Special Function Registers:

43

Moving Message Display


The 89C51 is a flexible microcontroller with a relative large no of modes of operations.
SFRs are accessed as if they were normal internal RAM. Each SFR has an address (80H through
FFH) and a name. The following table provides 89C51s SFRs, their names and their address.
Addr.
80
81
82
83
88
89
8A
8B
8C
8D
90
98
99
A0
A8
B0
B8
D0
E0
F0

Port/Register
P0 (Port 0)
SP (stack pointer)
DPH (data pointer High)
DPL (data pointer Low)
TCON (timer control)
TMOD (timer mode)
TLO (timer 0 low byte)
TL1 (timer 1 low byte)
TH0 (timer 0 high byte)
TH1 (timer 1 high byte)
P1 (port 1)
SCON (serial control)
SBUF (serial buffer)
P2 (port 2)
Interrupt enable (IE)
P3 (port 3)
Interrupt priority (IP)
Processor status word (PSW)
Accumulator (ACC)
B register
Table 10.1

Description:
P0 (Port 0, Address 80h, Bit-Addressable):
This is input/output port 0. Each bit of this SFR corresponds to one of the pins on the
microcontroller. For example, 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 a low level.
SP (Stack Pointer, Address 81H):
This is the stack pointer of the microcontroller. This SFR indicates where the next value
to be taken from the stack will read from in internal RAM. If you push a value on to stack, the
value will be written to the address of SP+1. That is to say, if SP holds the value 07H, a push
instruction will push the value on to the stack at the address 08H. This SFR is modified by all

44

Moving Message Display


instructions, which modify the stack, such a PUSH, POP, LCALL, RET, RETI and whenever
interrupts are provoked by the microcontroller.
DPL/ DPH (Data Pointer Low/High, Addresses 82h/83h):
The SFRs DPL and DPH work together to represent a16-bit value called the Data Pointer.
The DPTR is used in operations regarding external RAM and some instructions involving code
memory. Since it is an unsigned 2 byte integer value, it can represent values from 0000h to
FFFFh (0 through 65,535 Decimal).
PCON (Power Control, Address 87h):
The PCON SFR is used to control the 89C51s power control modes. Certain operation
modes of 89C51 allow the 89C51 to go in to a type of sleep mode, which requires much less
power.
SMOD --

--

--

GF1

GF0

PD

IDL

SMOD :

Double baud rate bit. If Timer 1 is used to generate baud rate and SMOD
= 1, the baud rate is doubled when the Serial Port is used in modes 1, 2,
or 3

Not implemented, reserved for future use.

Not implemented, reserved for future use.

Not implemented, reserved for future use.

GF1

General Purpose flag bit.

GF0

General Purpose flag bit.

PD

Power Down bit. Setting this bit activates Power Down operation.

IDL

Idle Mode bit. Setting this bit activates Idle Mode operation.

TCON (Timer Control, Address 88h, Bit-Addressable):


The TCON SFR is used to configure an modify the way in which the 89C51s two timers
operate. This SFR controls whether each of the two timers are running or stopped and contains a
flag to indicate that each timer has overflowed.
TF1

TR1

TF0

TR0

IE1

IT1

IE0

IT0
0

45

Moving Message Display


TF1:

Timer 1 overflow flag. Set by hardware when the Timer/Counter 1 overflows.


Cleared by hardware as the processor vectors to the interrupt service routine.

TR1: Timer 1 run control bit. Set/cleared by software to turn Timer/Counter 1 ON/OFF.
TF0:

Timer 0 overflow flag. Set by hardware when the Timer/Counter 0 overflows.


Cleared by hardware as the processor vectors to the service routine.

TR0: Timer 0 run control bit. Set/cleared by software to turn Timer/Counter 0 ON/OFF.
IE1:

External Interrupt 1 edge flag. Set by hardware when the External Interrupt edge
is detected. Cleared by hardware when the interrupt is processed.

IT1:

Interrupt 1 type control bit. Set/cleared by software to specify falling edge/low


level triggered external Interrupt.

IE0:

External Interrupt 0 edge flag. Set by hardware when External Interrupt edge
detected. Cleared by hardware when interrupt is processed.

IT0:

Interrupt 0 type control bit. Set/cleared by software to specify falling edge/low


level triggered external Interrupt.

TMOD (Timer Mode, Address 89h):


The timer mode SFR is used to configure the mode of operation of each of the two
timers. Using this SFR your program may configure each timer to be a 16-bit timer, an 8-bit auto
reload timer, a13-bit timer, are two separate timers.
GATE

C/T

M1 M0

GATE

C/T

M1

M0

GATE: When TRx (in TCON) is set and GATE = 1, TIMER/COUNTERx runs only
while the INTx pin is high (hardware control). When GATE = 0,
TIMER/COUNTERx will run only while TRx = 1 (software control).
C/T:

Timer or Counter selector. Cleared for Timer operation (input from internal
system clock). Set for Counter operation (input from Tx input pin).

M1

Mode selector bit.

M0

Mode selector bit.


M1
0
0
1
1

M2
0
1
0
1

MODE
0
1
2
3

46

DESCRIPTION
13 Bit counter
16 Bit counter
8 Bit counter with auto reload
Split timer 0 into 8bit counters or

Moving Message Display


timer
TL0/TH0 (Timer 0 Low/High, Addresses 8Ah/8Bh):
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.
TL1/TH1 (Timer 1 Low/High, Addresses 8Ch/8Dh):
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.
P1 (Port 1, Address 90h, Bit-Addressable):
This is input/output port 1. Each bit of this SFR corresponds to one of the pins on the
microcontroller. 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 a low level.
SCON (Serial Control, Address 98h, Bit-Addressable):
The serial control SFR is used to configure the behavior of the 89c51s on-board serial
port. This SFR controls the baud rate of the serial port, whether the serial port is activated to
receive data, and also contains flags that are set when a byte is successfully sent are received.
SM0

SM1

SM2

REN

TB8

RB8

T1

R1
0

SM2: Multiprocessor communication bit set/cleared by program to enable


Multiprocessor communications in modes 2 and 3.
REN: Receives enables bit. set to 1 enables reception; cleared to 0 to disable reception.
TB8: Transmitted bit 8.set/ cleared by program in modes 2 and 3.
RB8: Received bit 8 .Bit 8 of received data in modes 2 and 3; stop bit in Mode1.
T1: Transmit interrupts flag. Set to one at the end bit 7 times in mode 0 and at the
beginning of the stop bit for the other modes.
R1: receives interrupts flag. Set to one at the end off bit 7 time in mode 0 and halfway
through the stop bit for other modes.
SM1
0
0
1
1

SM0
0
1
0
1

MODE
0
1
2
3

OPERATION
Shift registers, baud=f/12
8-bit UART; baud=variable
9-bit UART; baud=f/32 or f/64
9-bit UART; baud=variable

SBUF (Serial Buffer, Address 99h):


47

Moving Message Display


The SBUF is used to send and receive data via on-board serial port. SBUF serves as the
output port when written to and as an input port when read from.
P2 (Port 2, Address A0h, Bit-Addressable):
This is input/output port 2. Each bit of this SFR corresponds to one of the pins on the
microcontroller. 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 a low level.
IE (Interrupt Enable, Address A8h):
The IE is used to enable and disable specific interrupts. The low 7 bits of the SFR are
used to enable/disable the specific interrupts, where as the highest bit is used enable or disable all
interrupts.
EA

ET2

ES

ET1

EX1

ET0

EA

IE.7

EX0
0

Disables all interrupts. If EA = 0, no interrupt is acknowledged. If EA = 1,


each interrupt source is individually enabled or disabled by setting or
clearing its enable bit.

IE.6

Not implemented, reserved for future use.(1)

ET2

IE.5

Enables or disables the Timer 2 overflow or capture

ES

IE.4

Enables or disables the serial ports interrupt.

ET1

IE.3

Enables or disables the Timer 1 overflow interrupt.

EX1

IE.2

Enables or disables External Interrupt 1.

ET0

IE.1

Enables or disables the Timer 0 overflow interrupt.

EX0 IE.0 Enables or disables External Interrupt 0.

P3 (Port 3, Address B0h, Bit-Addressable):


This is input/output port 3. Each bit of this SFR corresponds to one of the pins on the
microcontroller. 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 a low level.
IP (Interrupt Priority, Address B8h, Bit addressable):
The IP is used to specify the relative priority of each interrupt. On the 89C51, an interrupt
may either of low (0) priority or high (1) priority. If a serial interrupt is executing no other
48

Moving Message Display


interrupt will be able to interrupt the serial interrupt routine since serial interrupt routine has the
high priority.
----

-----

PT2

PS

PT1

PX1

PT0

PX0

IP.7

Not implemented, reserved for future use.

IP.6

Not implemented, reserved for future use.

PT2

IP.5

Defines the Timer 2 interrupt priority level (AT89C52 only).

PS

IP.4

Defines the Serial Port interrupt priority level.

PT1

IP.3

Defines the Timer 1 interrupt priority level.

PX1

IP.2

Defines External Interrupt 1 priority level.

PT0

IP.1

Defines the Timer 0 interrupt priority level.

PX0

IP.0

Defines the External Interrupt 0 priority level.

PSW (Program Status Word, Address D0h, Bit-Addressable):


The PSW is used to store a no. of important bits that are set and cleared by 89C51
instructions. The PSW contains the carry flag, the auxiliary carry flag, the overflow flag and the
parity flag.
CY

AC

FO

RS1

RS0

OV

P
0

CY

PSW.7

Carry flag.

AC

PSW.6 Auxiliary carry flag.

F0

PSW.5 Flag 0 available to the user for general purpose.

RS1

PSW.4 Register Bank selector bit 1.

RS0

PSW.3 Register Bank selector bit 0.

OV

PSW.2 Overflow flag.

PSW.1 User definable flag.

PSW.0 Parity flag.

10.8 Hardware details:


The on chip oscillator of 89C51 can be used to generate system clock. Depending upon
version of the device, crystals from 3.5 to 12 MHz may be used for this purpose. The system
clock is internally divided by 6 and the resultant time period becomes one processor cycle. The

49

Moving Message Display


instructions take mostly one or two processor cycles to execute, and very occasionally three
processor cycles. The ALE (address latch enable) pulse rate is 16th of the system clock, except
during access of internal program memory, and thus can be used for timing purposes.
10.8.1 AT89C51 Serial port pins
PIN
P3.ORXD
P3.ITXD
P3.2INTO
P3.3INT1
P3.4TO
P3.5T1
P3.6WR
P3.7RD

ALTERNATE USE
Serial data input
Serial data output
External interrupt 0
External interrupt 1
External timer 0 input
External timer 1 input
External memory write pulse
External memory read pulse
Table 7.2

SFR
SBUF
SBUF
TCON-1
TCON- 2
TMOD
TMOD
------------

The two internal timers are wired to the system clock and prescaling factor is decided by the
software, apart from the count stored in the two bytes of the timer control registers. One of the
counters, as mentioned earlier, is used for generation of baud rate clock for the UART. It would
be of interest to know that the 8052 has a third timer which is usually used for generation of baud
rate.
The reset input is normally low and taking it high resets the micro controller, In the
present hardware, a separate CMOS circuit has been used for generation of reset signal so that it
could be used to drive external devices as well.

10.9 Writing the software:


The 89C51 has been specifically developed for control applications. As mentioned
earlier, out of the 128 bytes of internal RAM, 16 bytes have been organized in such a way that all
the 128 bits associated with this group may be accessed bit wise to facilitate their use for bit
set/reset/test applications. These are therefore extremely useful for programs involving individual
logical operations.. The 89C51 has short branch instructions for 'within page' and conditional
jumps, short jumps and calls within 2k memory space which are very convenient, and as such the
controller seems to favor programs which are less than 2k byte long. Some versions of 8751

50

Moving Message Display


EPROM device have a security bit which can be programmed to lock the device and then the
contents of internal program EPROM cannot be read.
The device has to be erased in full for further alteration, and thus it can only be reused
but not copied. EEPROM and FLASH memory versions of the device are also available now.
10.9.1 Input-output unit:
Those locations weve just added are called ports. There are several types of ports:
input, output or bi-directional ports. When working with ports, first of all it is necessary to
choose which port we need to work with, and then to send data to, or take it from the port. When
working with it the port acts like a memory location. Something is simply being written into or
read from it, and it could be noticed on the pins of the micro-controller.

51

Moving Message Display

DISPLAY DRIVERS

11. DISPLAY DRIVERS


The devices that are used to drive the rows and columns in the display are latches and
decoders. Latch is used as row selector and decoder is used as column selector.

11.1 LATCH (74LS573):


The 74ALS573B is an octal transparent latch coupled to eight 3-State output devices. The
two sections of the device are controlled independently by enable (E) and output enable (OE)
control gates. The 74ALS573B has a broadside pin out configuration to facilitate PC board
layout and allow easy interface with microprocessors. The data on the D inputs is transferred to
the latch outputs when the enable (E) input is high. The latch remains transparent to the data

52

Moving Message Display


input while E is high, and stores the data that is present one setup time before the High-to-Low
enable transition.

11.1.1 Pin Diagram & Truth Table:

Fig 11.1

Table 11.1

11.1.2 Logic Diagram:

Fig 11.2
When the LATCH ENABLE (LE) input is HIGH, the Q outputs will follow the D inputs.
When the LATCH ENABLE goes LOW, data at the D inputs will be retained at the outputs until
LATCH ENABLE returns HIGH again. When a HIGH logic level is applied to the OUTPUT

53

Moving Message Display


CONTROL OC input, all outputs go to a HIGH impedance state, regardless the 74HC logic
family is speed, function and pin out compatible with the standard 74LS logic family. All inputs
are protected from damage due to static discharge by internal diode clamps to VCC and ground.
11.1.3 Features:

Typical propagation delay: 18 ns

Wide operating voltage range: 2 to 6 volts

Low input current: 1 A maximum

Low quiescent current: 80 A maximum (74HC Series)

Compatible with bus-oriented systems

Output drive capability: 15 LS-TTL loads

11.2 DECODERS (74HC154):


The decoder used is 74HC154. It is a 24-pin dual in line package. The 74HC/HCT154 are
high-speed Si-gate CMOS devices and are pin compatible with low power Schottky TTL
(LSTTL).
The 74HC/HCT154 decoders accept four active HIGH binary address inputs and provide
16 mutually exclusive active LOW outputs. The 2-input enable gate can be used to strobe the
decoder to eliminate the normal decoding glitches on the outputs, or it can be used for the
expansion of the decoder. The enable gate has two ANDed inputs which must be LOW to enable
the outputs. The 154 can be used as a 1-to-16 demultiplexer by using one of the enable inputs
as the multiplexed data input. When the other enable is LOW, the addressed output will follow
the state of the applied data.
11.2.1 Pin Diagram & Truth Table:

54

Moving Message Display

F
Fig 11.3

Table 11.2

11.2.2 Features:

Typical propagation delay: 21 ns

Power supply quiescent current: 80 A

Wide power supply voltage range: 26V

Low input current: 1 A maximum

8.2.3 Logic Diagram:

55

Moving Message Display

Fig 8.4

56

Moving Message Display

DISPLAYS

12. DISPLAYS
12.1 Introduction
There are so many types of displays which are generally classified into 2 ways.

57

Moving Message Display


1)

Gaseous Type Display

2)

Semi Conductor Display

12.1.1 GASEOUS TYPE DISPLAY CONSISTS OF:


1)

Neon gas displays.

2)

Discrete number gaseous displays.


The Gaseous type of displays are not used because of higher voltage involved in it and

moreover they are not versatile i.e. they cannot be used to display any other character other than
number.
12.1.2 SEMI CONDUCTOR DISPLAYS ARE:
1.

Seven Segment Display

2.

LCD Display

3.

LED Dot Matrix Display


Seven Segment Display cannot be used as they cannot display the character other than

numbers.
LCD displays are not used for big display applications, because it is small in size and it
will not give illumination as much as compared to that of LED.
LED Dot Matrix displays are used for this purpose

12.2 Light Emitting Diode


The most common and simplest display device used with IC logic is the light emitting
diode (LED). LEDS are solid state devices, P-N junctions which emit light energy when
stimulated by a low voltage direct current. The most efficient LED is in the visible spectrum and
emits red light, it is most commonly used for LED displays. Amber and Green LEDs are also
available.
LEDS are popular for many reasons. Because they can be operated from low voltages,
they are compatible with systems that use integrated circuits. They are small Lightweight, and
mechanically rugged. As solid state device, they are highly reliable and have typical operation
life of more than 1, 00,000 Hours.

58

Moving Message Display


The LED emits light when forward biased, and the intensity of light is a function of the
forward current through the LED. The voltage drop of a forward biased LED is essentially fixed,
1.6 or 2.4 V. For DC operation, the nominal operation current is typically 20ma for red LEDs.
A Junction Diode can emit light or exhibit electro luminescence (the emission light from
a solid with the excitation provided by an electrostatic field). The emitted light in this case
comes from hole electron recombination. This becomes clear that when a free electron
recombines, it may fall the way from an unbound as higher energy level to its ground state
releasing a photon of a wavelength corresponding to the energy level difference associated with
this transition.
In solid state light-emitting diodes (LEDs) the supply of higher energy electron is
provided by forward biasing the diode, thus injecting electrons into n-region (and holes into the
p-region). The injected electrons and holes then recombine with the majority carrier near the
junction. The recombination radiation is emitted in all directions, with most of light observed at
the top surface, since the amount of material between the junction and the surface is the least.
Radiative and non-radiative transitions are experienced in any semi-conductor under forward
bias, but in many cases the non radiative transition predominate or the photon losses are to
excessive for observation of any external radiation.
12.2.1 Advantages of LEDs:(1)

Low working voltages and currents

(2)

Less power consumption

(3)

No warm up time

(4)

Emission of monochromatic light

(5)

Very fast action

(6)

Small size and weight

(7)

No effect of mechanical vibrations

(8)

Less fragile than glass

(9)

Extremely long life.

12.2.2 Applications:(1)

In 7-Segment, 16-Segment and dot matrix displays.

59

Moving Message Display


(2)

For indicating power ON/OFF conditions, power level indicators or stereo


amplifiers.

(3)

In optical switching applications.

(4)

In the field of optical communication.

(5)

For image sensing circuits in Picture phones.

12.3 LED DOT MATRIX DISPLAY


An LED Matrix is an array of LED's with the anode or positive terminal of each row connected
together, and the cathode or negative terminal of each column connected together. Or the anode
can be connected to a column, and cathode connected to a row. They come in various sizes,
colors and formats. The most common sizes are 5x7, 5x8 and 8x8 displays. This means that, for
example, a 5x8 display would have 5 columns with 8 rows of LED's.
In our project we used 8x8 LED matrix to represent one character. Each character
requires 8 x 8 matrix display. So 64 LEDs are required for the displaying of one character.
Therefore total 256 LEDs i.e. four 8x8 LED matrices are required for displaying 4 characters at a
time. To calculate the critical size at this display, that it would be able to accommodate any letter
with in 8 x 8 matrix. Assuming that there would be a gap of three units between any two letters,
the allowable dimension of each letter may be taken as 7 (height) x 5 (width).

Thus to

accommodate four letters at the same instant, it need 8 x 4 = 32 LEDs in the Horizontal direction.
In the vertical direction, it may keep a provision of 8 LEDs leaving the bottom most row for the
cursor.

12.3.1 Pin Diagram of 8x8 LED Matrix Display:

60

Moving Message Display

Fig 12.1

12.4 Dot Matrix Characterization


The display of the characters and numbers in the dot matrix display is based on the
following pattern:

00

3E

51

49

45

3E

00

00

DB

: pattern for 0

00

00

42

7F

40

00

00

00

DB

: pattern for 1

00

46

61

51

49

46

00

00

DB

: pattern for 2

00

22

41

49

49

36

00

00

DB

: pattern for 3

00

30

28

24

22

7F

00

00

DB

: pattern for 4

00

2F

49

49

49

31

00

00

DB

: pattern for 5

00

3E

51

49

49

32

00

00

DB

: pattern for 6

00

41

21

11

09

07

00

00

DB

: pattern for 7

00

36

49

49

49

36

00

00

DB

: pattern for 8

00

26

49

49

49

3E

00

00

DB

: pattern for 9

00

7C

12

11

12

7C

00

00

DB : pattern for A

00

7F

49

49

49

36

00

00

DB : pattern for B

00

3E

41

41

41

22

00

00

DB : pattern for C

61

Moving Message Display


00

7F

41

41

41

36

00

00

DB : pattern for D

00

7F

49

49

41

41

00

00

DB : pattern for E

00

7F

09

09

01

01

00

00

DB

00

3E

41

49

49

3A

00

00

DB : pattern for G

00

7F

08

08

08

7F

00

00

DB : pattern for H

00

00

41

7F

41

00

00

00

DB

: pattern for I

00

30

40

40

40

3F

00

00

DB

: pattern for J

00

7F

08

14

22

41

00

00

DB : pattern for K

00

7F

40

40

40

40

00

00

DB : pattern for L

00

7F

02

04

02

7F

00

00

DB : pattern for M

00

7F

02

04

08

7F

00

00

DB

: pattern for N

00

3E

41

41

41

3E

00

00

DB

: pattern for O

00

7F

09

09

09

06

00

00

DB

: pattern for P

00

3E

41

51

61

7E

00

00

DB

: pattern for Q

00

7F

09

19

29

46

00

00

DB

: pattern for R

00

26

49

49

49

32

00

00

DB

: pattern for S

00

01

01

7F

01

01

00

00

DB

: pattern for T

00

3F

40

40

40

3F

00

00

DB

: pattern for U

00

IF

20

40

20

IF

00

00

DB

: pattern for V

00

3F

40

3F

40

3F

00

00

DB

: pattern for W

00

63

14

08

14

63

00

00

DB

: pattern for X

00

01

02

7C

02

01

00

00

DB

: pattern for Y

00

61

51

49

45

43

00

00

DB

: pattern for Z

62

: pattern for F

Moving Message Display

C PROGRAM

13. C PROGRAM
63

Moving Message Display


The C program is used to enter the message that is to be displayed on the LED display.
#include<bios.h>
#include<conio.h>
#include<stdio.h>
#include<ctype.h>
#define COM1

#define DATA_READY

0x100

#define TRUE 1
#define FALSE

#define SETTINGS (_COM_2400 | _COM_NOPARITY | _COM_STOP1 | _COM_CHR8)


#define XVAL 10
#define YVAL 10
int main(void)
{
unsigned in,out,status;
int xcnt=XVAL, ycnt=YVAL;
textmode(C40);
_bios_serialcom(_COM_INIT,COM1,SETTINGS);
clrscr();
gotoxy(5,2);
textcolor(LIGHTRED);
textbackground(BLUE);
cprintf("PC BASED MOVING MESSAGE DISPLEAY \n");
gotoxy(4,4);
textcolor(LIGHTGREEN);
textbackground(BLACK);
cprintf("=================================== \n");
gotoxy(XVAL,YVAL);
textcolor(CYAN);
textbackground(BLACK);
for(;;)

64

Moving Message Display


{
status=_bios_serialcom(_COM_STATUS,COM1,0);
if(status & DATA_READY)
if((out=_bios_serialcom(_COM_RECEIVE,COM1,0)&0x7F)!=0)
putch(out);
if(kbhit())
{
if((in=getch())=='\x1B')
break;
putch(in);
_bios_serialcom(_COM_SEND,COM1,0xCA);
delay(1);
_bios_serialcom(_COM_SEND,COM1,in);
xcnt++;
if(xcnt>=XVAL+20)
{
xcnt=XVAL;
ycnt++;
if(ycnt>=YVAL+6)
ycnt=XVAL;
gotoxy(xcnt,ycnt);
}
}
_bios_serialcom(_COM_SEND,COM1,0xCA);
delay(1);
}
return 0;
}

65

Moving Message Display

SOURCE CODE

14. SOURCE CODE


66

Moving Message Display


14.1 Assembly language program:
;> TITLE

: MOVING MESSAGE DISPLAY CONTROLLER

;> TARGET

: AT89C51

;> VERSION

: VER-01

;> STARTED

: 07-04-2004

;>

INCLUDES

$MOD51
;>

FLAGS

;>

VARIABLES

;>

:
:

CNT1

DATA 20H

CNT2

DATA 21H

INIT_ADDR

DATA 22H

MEM_PTR

DATA 30H

VECTOR ADDRESESS:
ORG
ljmp
ORG

0000H
INITIALISATION
000BH

push ACC
push

PSW

lcall DISPLAY
pop

PSW

pop

ACC

reti
ORG

001BH

reti

67

Moving Message Display


ORG

0023H

push ACC
push
jbc
ajmp

PSW
RI, RECEIVE_DATA
SKIP_CHKS

RECEIVE_DATA:
mov

A, SBUF

cjne A, #0CAH, STORE_DATA


mov

R5, #01H

ljmp

SKIP_CHKS

STORE_DATA:
cjne R5, #01H, SKIP_CHKS
cjne A, #5BH, STORE_DATA1
STORE_DATA1:
jnc

SKIP_CHKS

mov

R5, #00H

mov

@R1, A

inc

R1

cjne A, #'*', SKIP_CHKS


dec
mov
inc
mov
inc
mov

R1
@R1, #' '
R1
@R1, #' '
R1
@R1, #' '

68

Moving Message Display


inc

R1

mov

@R1, #'*'

call

LOOP_RST

mov

R1, #MEM_PTR

SKIP_CHKS:
pop

PSW

pop

ACC

reti

;>INITIALISATION:
mov

P0, #0FFH

mov

P1, #0FFH

mov

P2, #0FFH

mov

P3, #0FFH

mov

SP, #65H

mov

DPTR, #0400H

mov

TMOD, #21H
anl

mov

pcon, #7fh

mov

th1,

#0f4h

mov

scon, #052h

; set smod
; set TH1 for 2400 rate.
; set MODE 1, REN.

IE, #92H

setb TR0
setb TR1
mov

R5, #00H

mov

R2, #00H

69

Moving Message Display


mov

R3, #00H

mov

R4, #00H

mov

R1, #MEM_PTR

call

LOOP_RST

mov

R0, #MEM_PTR

mov

R1, #MEM_PTR

mov

INIT_ADDR, R0

setb
mov
inc
mov
inc
mov
inc
mov
inc
mov
inc
mov
inc
mov
inc
mov
inc

REN
@R1, #'A'
R1
@R1, #'B'
R1
@R1, #'C'
R1
@R1, #'D'
R1
@R1, #'E'
R1
@R1, #'F'
R1
@R1, #'G'
R1
@R1, #'H'
R1

;>MAIN:

70

Moving Message Display


lmp

MAIN

;>DISPLAY:
cjne @R0,#'*', GO_FOR_DISP
mov

R0, #MEM_PTR

mov

INIT_ADDR, R0

GO_FOR_DISP:
call

LOAD_CHAR

mov

A, R3

movc A, @A + DPTR
mov

P0, A

clr

P2.7

clr

P2.6

nop
setb

P2.7

setb

P2.6

nop
mov

P2, R2

mov

A, R2

jb

ACC.4, SELECT1

clr

P2.4

setb

P2.5

SELECT1:
jnb

ACC.4, SELECT2

clr

P2.5

setb

P2.4

71

Moving Message Display


SELECT2:
inc

R3

cjne R3, #08H, SKIP_CHARC


mov
inc

R3, #00H
R0

cjne R0, #63H, STOP_OVF


dec

R0

STOP_OVF:
inc
mov

CNT1
A, CNT1

cjne A, #80H, SKIP_CHARC


mov
inc

CNT1, #00h
INIT_ADDR

SKIP_CHARC:

inc

R2

cjne R2, #20H, SKIP_RELOAD


mov

R2, #00H

mov

R0, INIT_ADDR

SKIP_RELOAD:
mov

TH0, #0FDH

mov

TL0, #00H

; FFFF - FD00 = 4.095mS

RET
LOOP_RST:

72

Moving Message Display


mov
inc

@R1, #'*'
R1

cjne R1, #62H, LOOP_RST


RET
LOAD_CHAR:
cjne @R0,#'A', NOT_FOR_A
mov

DPTR, #LET_A

ret
NOT_FOR_A:
cjne @R0,#'B', NOT_FOR_B
mov

DPTR, #LET_B

ret
NOT_FOR_B:
cjne @R0,#'C', NOT_FOR_C
mov

DPTR, #LET_C

ret
NOT_FOR_C:
cjne @R0,#'D', NOT_FOR_D
mov

DPTR, #LET_D

ret
NOT_FOR_D:
cjne @R0,#'E', NOT_FOR_E
mov

DPTR, #LET_E

ret
NOT_FOR_E:

73

Moving Message Display


cjne @R0,#'F', NOT_FOR_F
mov

DPTR, #LET_F

ret
NOT_FOR_F:
cjne @R0,#'G', NOT_FOR_G
mov

DPTR, #LET_G

ret
NOT_FOR_G:
cjne @R0,#'H', NOT_FOR_H
mov

DPTR, #LET_H

ret
NOT_FOR_H:
cjne @R0,#'I', NOT_FOR_I
mov

DPTR, #LET_I

ret
NOT_FOR_I:
cjne @R0,#'J', NOT_FOR_J
mov

DPTR, #LET_J

ret
NOT_FOR_J:
cjne @R0,#'K', NOT_FOR_K
mov

DPTR, #LET_K

ret
NOT_FOR_K:
cjne @R0,#'L', NOT_FOR_L

74

Moving Message Display


mov

DPTR, #LET_L

ret
NOT_FOR_L:
cjne @R0,#'M', NOT_FOR_M
mov

DPTR, #LET_M

ret
NOT_FOR_M:
cjne @R0,#'N', NOT_FOR_N
mov

DPTR, #LET_N

ret
NOT_FOR_N:
cjne @R0,#'O', NOT_FOR_O
mov

DPTR, #LET_O

ret
NOT_FOR_O:
cjne @R0,#'P', NOT_FOR_P
mov

DPTR, #LET_P

ret
NOT_FOR_P:
cjne @R0,#'Q', NOT_FOR_Q
mov

DPTR, #LET_Q

ret
NOT_FOR_Q:
cjne @R0,#'R', NOT_FOR_R
mov

DPTR, #LET_R

75

Moving Message Display


ret
NOT_FOR_R:
cjne @R0,#'S', NOT_FOR_S
mov

DPTR, #LET_S

ret
NOT_FOR_S:
cjne @R0,#'T', NOT_FOR_T
mov

DPTR, #LET_T

ret
NOT_FOR_T:
cjne @R0,#'U', NOT_FOR_U
mov

DPTR, #LET_U

ret
NOT_FOR_U:
cjne @R0,#'V', NOT_FOR_V
mov

DPTR, #LET_V

ret
NOT_FOR_V:
cjne @R0,#'W', NOT_FOR_W
mov

DPTR, #LET_W

ret
NOT_FOR_W:
cjne @R0,#'X', NOT_FOR_X
mov

DPTR, #LET_X

ret

76

Moving Message Display


NOT_FOR_X:
cjne @R0,#'Y', NOT_FOR_Y
mov

DPTR, #LET_Y

ret
NOT_FOR_Y:
cjne @R0,#'Z', NOT_FOR_Z
mov

DPTR, #LET_Z

ret
NOT_FOR_Z:
cjne @R0,#'0', NOT_FOR_0
mov

DPTR, #LET_0

ret
NOT_FOR_0:
cjne @R0,#'1', NOT_FOR_1
mov

DPTR, #LET_1

ret
NOT_FOR_1:
cjne @R0,#'2', NOT_FOR_2
mov

DPTR, #LET_2

ret
NOT_FOR_2:
cjne @R0,#'3', NOT_FOR_3
mov

DPTR, #LET_3

ret
NOT_FOR_3:

77

Moving Message Display


cjne @R0,#'4', NOT_FOR_4
mov

DPTR, #LET_4

ret
NOT_FOR_4:
cjne @R0,#'5', NOT_FOR_5
mov

DPTR, #LET_5

ret
NOT_FOR_5:
cjne @R0,#'6', NOT_FOR_6
mov

DPTR, #LET_6

ret
NOT_FOR_6:
cjne @R0,#'7', NOT_FOR_7
mov

DPTR, #LET_7

ret
NOT_FOR_7:
cjne @R0,#'8', NOT_FOR_8
mov

DPTR, #LET_8

ret
NOT_FOR_8:
cjne @R0,#'9', NOT_FOR_9
mov

DPTR, #LET_9

ret
NOT_FOR_9:
cjne @R0,#'.', NOT_FOR_DOT

78

Moving Message Display


mov

DPTR, #LET_DOT

ret
NOT_FOR_DOT:
cjne @R0,#'#', NOT_FOR_AA
mov

DPTR, #LET_AA

ret
NOT_FOR_SPACE:
mov

DPTR, #LET_STAR

ret
ORG

0400H

LET_A:
db

00H

db

7CH

db

12H

db

11H

db

12H

db

7CH

db

00H

db

00H

; 'A'

LET_B:
db

00H

db

7FH

db

49H

db

49H

db

49H

; 'B'

79

Moving Message Display


db

36H

db

00H

db

00H

LET_C:
db

00H

db

3EH

db

41H

db

41H

db

41H

db

22H

db

00H

db

00H

; 'C'

LET_D:
db

00H

db

7FH

db

41H

db

41H

db

41H

db

3EH

db

00H

db

00H

; 'D'

LET_E:
db

00H

db

7FH

db

49H

; 'E'

80

Moving Message Display


db

49H

db

41H

db

41H

db

00H

db

00H

LET_F:
db

00H

db

7FH

db

09H

db

09H

db

01H

db

01H

db

00H

db

00H

; 'F'

LET_G:
db

00H

db

3EH

db

41H

db

49H

db

49H

db

3AH

db

00H

db

00H

; 'G'

LET_H:
db

00H

; 'H'

81

Moving Message Display


db

7FH

db

08H

db

08H

db

08H

db

7FH

db

00H

db

00H

LET_I:
db

00H

db

00H

db

41H

db

7FH

db

41H

db

00H

db

00H

db

00H

; 'I'

LET_J:
db

00H

db

30H

db

40H

db

40H

db

40H

db

3FH

db

00H

db

00H

; 'J'

82

Moving Message Display


LET_K:
db

00H

db

7FH

db

08H

db

14H

db

22H

db

41H

db

00H

db

00H

; 'K'

LET_L:
db

00H

db

7FH

db

40H

db

40H

db

40H

db

40H

db

00H

db

00H

; 'L'

LET_M:
db

00H

db

7FH

db

02H

db

04H

db

02H

db

7FH

; 'M'

83

Moving Message Display


db

00H

db

00H

LET_N:
db

00H

db

7FH

db

02H

db

04H

db

08H

db

7FH

db

00H

db

00H

; 'N'

LET_O:
db

00H

db

3EH

db

41H

db

41H

db

41H

db

3EH

db

00H

db

00H

; 'O'

LET_P:
db

00H

db

7FH

db

09H

db

09H

; 'P'

84

Moving Message Display


db

09H

db

06H

db

00H

db

00H

LET_Q:
db

00H

db

3EH

db

41H

db

51H

db

61H

db

7EH

db

00H

db

00H

; 'Q'

LET_R:
db

00H

db

7FH

db

09H

db

19H

db

29H

db

46H

db

00H

db

00H

; 'R'

LET_S:
db

00H

db

26H

; 'S'

85

Moving Message Display


db

49H

db

49H

db

49H

db

32H

db

00H

db

00H

LET_T:
db

00H

db

01H

db

01H

db

7FH

db

01H

db

01H

db

00H

db

00H

; 'T'

LET_U:
db

00H

db

3FH

db

40H

db

40H

db

40H

db

3FH

db

00H

db

00H

; 'U'

LET_V:

86

Moving Message Display


db

00H

db

1FH

db

20H

db

40H

db

20H

db

1FH

db

00H

db

00H

; 'V'

LET_W:
db

00H

db

3FH

db

40H

db

3FH

db

40H

db

3FH

db

00H

db

00H

; 'W'

LET_X:
db

00H

db

63H

db

14H

db

08H

db

14H

db

63H

db

00H

; 'X'

87

Moving Message Display


db

00H

LET_Y:
db

00H

db

01H

db

02H

db

7CH

db

02H

db

01H

db

00H

db

00H

; 'Y'

LET_Z:
db

00H

db

61H

db

51H

db

49H

db

45H

db

43H

db

00H

db

00H

; 'Z'

LET_0:
db

00H

db

3EH

db

51H

db

49H

db

45H

; '0'

88

Moving Message Display


db

3EH

db

00H

db

00H

LET_1:
db

00H

db

00H

db

42H

db

7FH

db

40H

db

00H

db

00H

db

00H

; '1'

LET_2:
db

00H

db

46H

db

61H

db

51H

db

49H

db

46H

db

00H

db

00H

; '2'

LET_3:
db

00H

db

22H

db

41H

; '3'

89

Moving Message Display


db

49H

db

49H

db

36H

db

00H

db

00H

LET_4:
db

00H

db

30H

db

28H

db

24H

db

22H

db

7FH

db

00H

db

00H

; '4'

LET_5:
db

00H

db

2FH

db

49H

db

49H

db

49H

db

31H

db

00H

db

00H

; '5'

LET_6:
db

00H

; '6'

90

Moving Message Display


db

3EH

db

51H

db

49H

db

49H

db

32H

db

00H

db

00H

LET_7:
db

00H

db

41H

db

21H

db

11H

db

09H

db

07H

db

00H

db

00H

; '7'

LET_8:
db

00H

db

36H

db

49H

db

49H

db

49H

db

36H

db

00H

db

00H

; '8'

91

Moving Message Display


LET_9:
db

00H

db

26H

db

49H

db

49H

db

49H

db

3EH

db

00H

db

00H

; '9'

LET_STAR:
db

00H

db

6BH

db

1CH

db

7FH

db

1CH

db

6BH

db

00H

db

00H

; '*'

LET_SPACE:
db

00H

db

00H

db

00H

db

00H

db

00H

db

00H

;''

92

Moving Message Display


db

00H

db

00H

LET_DOT:
db

00H

db

60H

db

60H

db

00H

db

00H

db

00H

db

00H

db

00H

db

'.'

db

','

db

'Z'

; '.'

END

93

Moving Message Display

LIST OF COMPONENTS

15. LIST OF COMPONENTS

94

Moving Message Display


TYPE

NAME

QUANTITY

IC

AT89C51

IC

74HC154

IC

74LS573

IC

MAX 232

IC

LM7805

Port

RS232

Transistor

BC548

Transistor

BC 547

16

Transistor

BC 557

64

Diodes

1N4007

LED

RED

8x8LED Matrix Display Segments

Capacitors

10 uf/25v

Capacitors

1000 uf/25v

Capacitors

33 pf

Capacitors

1 uf

Transformer

0-230/9-0-9V (1A)

Crystal

11.0596 MHZ

Transmitter

STT433

Receiver

STR433

Sip Register (10 pin) 10 k

Resistor

100 k

Resistor

10 k

Resistor

22 k

Resistor

100 ohms

32

95

Moving Message Display

RESULTS

16. Results

96

Moving Message Display


When we entered the message in PC it displayed in display board, scrolling from right to
left. Below figure shows how the characters are displayed and scrolled in the display
board.

Fig 16.1

Fig 16.2

Fig 16.3

By default if there is no input to the microcontroller, it displays ABCDEFGH. If we need


to display any message we have to enter it in PC starting and ending with star. The
distance between the transmitter and receiver should be maximum of 50m in noise free
area.

97

Moving Message Display

APPLICATIONS,
ADVANTAGES AND
DISADVANTAGES

98

Moving Message Display

17. APPLICATIONS, ADVANTAGES AND


DISADVANTAGES
Applications
Moving Message Displays are ideal for all type of commercial establishments
like Hotels, Restaurants, Retail Shops, Banks, Airports, Clinics, Hospitals and other such
places to get maximum attention of people.
In Hotels to display welcome notes and costs of all items
In Banks to display special offers, new plans and various services of them
In Airports to display arrival and departure timings of planes, and special
attention messages
In Railway stations to display platform numbers, arrival and departure
timings of trains, and special attention messages and
In crowd areas or road sides to display messages and ads of Govt.
services, Retail shops and industries.

Advantages
The message to be displayed can be changed as often we need, by using PC.
The cable is not necessary in between transmitter and receiver. So the receiver can
be placed anywhere in the particular range from the transmitter.
Multiple receivers can be used for a single transmitter.
Capital alphabets (A-Z), numbers (0-9), dot (.) and space can be displayed

Disadvantages:
There should be a power supply board at the location of receiver.
The receiver may be affected by the noise in noisy areas. If noise exists in
received signal the display displays star (*) symbol instead of that character.
This can not be used for longer distances.

99

Moving Message Display


Small (a-z) and some special characters like &, @, %,etc. are not displayed
due to the lack of memory.

FUTURE SCOPE

100

Moving Message Display

18. FUTURE SCOPE


As there is a rapid growth in electronics, moving message displays replaces the present
days advertising methods like banners, wall postersetc.
By using batteries of 5v dc or solar energy systems we can overcome lack of
power supply at the location of receiver.
By increasing the transmitter power we can increase the coverage for the receivers
so that we can place receivers at very far distances also.
By using external memory we can display more characters by writing code for
more no. of characters.
By using noise filters we can eliminate the noise completely.
no. of characters that are displayed can be increased by using more no. of LED
matrix and decoders

101

Moving Message Display

DESIGNING COST

102

Moving Message Display

19. DESIGNING COST


TYPE

NAME

QUANTITY

COST

IC

AT89C51

45.00

IC

74HC154

24.00

IC

74LS573

10.00

IC

MAX 232

6.00

IC

LM7805

5.00

Port

RS232

7.00

Transistor

BC548

1.00

Transistor

BC 547

16

16.00

Transistor

BC 557

64

64.00

Diodes

1N4007

7.50

LED

RED

4.00

8x8LED Matrix Display Segments

600.00

Capacitors

10 uf/25v

2.00

Capacitors

1000 uf/25v

2.00

Capacitors

33 pf

2.00

Capacitors

1 uf

1.00

Transformer

0-230/9-0-9V (1A)

120.00

Crystal

11.0596 MHZ

15.00

Transmitter

STT433

250.00

Receiver

STR433

300.00

Sip Register (10 pin) 10 k

3.00

Resistor

100 k

1.00

Resistor

10 k

4.00

Resistor

22 k

1.00

Resistor

100 ohms

32

32.00

103

Moving Message Display


-------------------Total =

1,458.50

Total Cost of the Project kit:


For PCB design

--

750.00

Components

--

1,458.50

Miscellaneous
-200.00
---------------------------------------------Total

--

2,408.50

If we need a bulk quantity then we can reduce the total cost to Rs1700/- because it costs
Rs500/- for the design of layout for PCB. Once the layout is designed then we can make
as many PCBs we need and further there will be no design cost. So we can reduce
Rs500/- in PCB design and Rs200/- approx. in components and others. So totally we can
reduce Rs700/- from total cost of the project kit.

104

Moving Message Display

20. IMAGES OF KIT

Fig 20.1 Transmitter section top view

105

Moving Message Display

Fig 20.2 Receiver section top view

Fig 20.3 display front view

106

Moving Message Display

Fig 20.4 display with displaying characters

107

Moving Message Display

BIBLIOGRAPHY

21. BIBLIOGRAPHY

Referenced Books

Advanced Microprocessors and Peripherals


- A K Ray & K M Bhurchandi

Electronic Circuit Analysis


- K. Lal Kishore

Switching Theory and Logic Design

108

Moving Message Display


- Marrius Mano

Microprocessor and its Interfacing


- Godsey

Referenced websites

http://www.atmel.com
http://www.datasheetcatalog.com
http://datasheets.maxim-ic.com
http://en.wikipedia.org
http://www.electro-tech-online.com
http://www.best-microcontroller-projects.com
http://www.nuxie1.com
http://www.cadstarworld.com
http://www.digchip.com

109

S-ar putea să vă placă și