Manual Moving-Message Display
Manual Moving-Message Display
Microcontroller-Based
Moving-Message Display
L
ED-based moving-message Circuit description Ports P0 and P2 of the microcon-
displays are becoming popular troller have been configured to act
Fig. 1 shows the circuit of the micro-
for transmitting information to as a common data bus for all the 16
controller-based moving-message
large groups of people quickly. These alphanumeric displays whose cor-
display. It comprises microcontrol-
can be used indoors or outdoors. We responding data pins have been tied
ler AT89C51, three-to-eight decoder
can find such displays in areas like rail- together to make a common 16-bit
74LS138, common anode alphanumeric
way platforms, banks, public offices, data bus. Port-2 provides the higher
displays, regulator 7805 and a few dis-
hotels, training institutes, nightclubs byte of data, while port-0 provides
crete components.
and shops. the lower one to light up a character
At the heart of the moving-mes-
Compared to LEDs, liquid-crystal on the display. Port pins P1.2-P1.4
sage display is Atmel AT89C51 mi-
displays (LCDs) are easy to interface and P1.5-P1.7 of the microcontroller
crocontroller (IC1). It is a low-power,
with a microcontroller for display- have been used as address inputs
high-performance, 8-bit microcontrol-
ing information as these have many for decoder IC3 and IC4 (74LS138) to
ler with 4 kB of flash programmable
built-in functions. But these can’t be enable one of the fourteen alphanu-
and erasable read-only memory
observed from a distance and large- meric displays (DIS3 through DIS16)
(PEROM) used as on-chip program
size LCDs are very costly. at a time, respectively. However,
memory, 128 bytes of RAM used as
LED-based displays can be of two displays DIS1 and DIS2 are enabled
internal data memory, 32 individually
types: dot-matrix and segmental. If you or disabled directly by port pins P1.0
programmable input/output (I/O)
implement a moving-message display and P1.1. Pins 4 and 5 are grounded
lines divided into four 8-bit ports, two
with multiplexed dot-matrix LEDs, it and pin 6 is made high to enable de-
16-bit programmable timers/counters,
will be very costly for displaying 16 coder 74LS138.
a five-vector two-level interrupt archi-
characters or more at a time. Moreover, Fig. 2 shows the pin configuration
tecture, on-chip oscillator and clock
programming will require a lot of data of the common-anode alphanumeric
circuitry.
memory or program memory space. display.
An external RAM may be needed to Parts List All the corresponding data pins
complement a microcontroller like Dis1 through DIS16 of alphanumeric
Semiconductors:
AT89C51. IC1 - AT89C51 microcontroller displays have been tied together,
However, if you use alphanumeric IC2, IC3 - 74LS138 3-to-8 decoder
(16-segment LED) displays for the IC4 - 7805 5V regulator
List of Messages
above purpose, programming burden T1-T16 - BC558 pnp transistor
is reduced and also it becomes highly D1-D4 - 1N4007 rectifier diode Which can be Selected
DIS1-DIS16 - KLA51 common-anode S3S2S1S0 Message selected
cost-effective. You can make your alphanumeric display
own display panel consisting of 16 LED1 - 5mm LED 0 0 0 0 Happy Birthday
alphanumeric characters at a much Resistors (all ¼-watt, ±5% carbon): 0 0 0 1 Happy New Year
lower cost. R1-R16 - 2.2-kilo-ohm 0 0 1 0 *Happy Diwali*
The circuit presented here uses 16 R17-R32 - 120-ohm 0 0 1 1 Merry Christmas
common-anode, single-digit, alphanu- R33-R37 - 10-kilo-ohm
0 1 0 0 *Happy Holi*
R38 - 220-ohm
meric displays to show 16 characters 0 1 0 1 *Eid Mubarak*
Capacitors:
at a time. Moreover, programming has 0 1 1 0 Happy Dashehra
C1, C2 - 33pF ceramic disk
been done to make the characters move C3 - 2200µF, 25V electrolytic 0 1 1 1 Happy Wedding
in a beautiful manner. A message ap- C4 - 1µF, 16V electrolytic
1 0 0 0 Happy Janmashtmi
pears on the panel from the right side, C5 - 10µF, 16V electrolytic
C6 - 0.1µF ceramic disk 1 0 0 1 *Happy Rakhi*
stays for a few seconds when the first
1 0 1 0 *Happy Pongal*
character reaches the leftmost place Miscellaneous:
and then goes out from the left side. X1 - 220V AC primary to 9V, 1 0 1 1 Happy Mothers Day
500mA secondary 1 1 0 0 *Happy Ramjan*
It displays 16 different messages to transformer
depict different occasions, which can 1 1 0 1 *Happy Lohri*
XTAL - 11.0592MHz crystal
be selected by the user through a DIP S0-S3 - 4-pin DIP switch 1 1 1 0 *Happy Easter*
switch. S4 - Push-to-‘on’ switch 1 1 1 1 Welcome to All
EFY april 2009
KS Project Manual
responding connector are provided to each message stored in the look-up starting address of DIS16 (right-most
make a proper connection. Connectors table at the end of the program. display). As soon as the first character
CON2, CON4 and CON6 of Fig. 3 are Each time, to display a character at reaches DIS16, the message stays for a
connected to CON2, CON4 and CON6 a given display, first two bytes (16 bits) longer time so that the entire message
of Fig. 5, respectively, through external of data are sent to Port-2 and Port-0, (message length not longer than 16
wires to interface DIS1 through DIS9. then the desired display is enabled by characters) can be easily read. There-
Connectors CON3, CON5 and CON7 sending its address to Port-1. Thereaf- after, characters again start scrolling
of Fig. 3 are connected to CON2, CON4 ter, a delay of 1 ms (slightly more than rightwards, so the entire message goes
and CON6 of Fig. 5, respectively, that) is generated by timer 1. Upon out and disappears after a while to
through external cable to interface DIS9 timer overflow, the entire display panel reappear from left side.
through DIS16. is refreshed by passing ‘FFFFH’ to the All the messages are stored in the
data bus. Then the next character at the form of a look-up table in the program
Software and its working next display is passed in the similar memory (ROM) itself. When the circuit
The source code ‘movmsg.asm’ is writ- manner. The cycle frequency is vari- is switched ‘on’ (or reset), the monitor-
ten in Assembly language and assem- able (depending upon the length of the ing program first checks for the binary
bled using cross-compiler. It is well- message) but always high enough so number present at the selection bus
commented and easy to understand. that the message appears continuous and according to that, the ROM ad-
Timer 1 has been used to generate a to the human eye. dress of the starting character of the
delay of around 1 ms for the switching Timer 0, with its interrupt enabled, selected message is loaded into the
gap between two consecutive displays. is used to change the starting address data-pointer. Thereafter, on-chip ROM
Thus, each display is enabled for 1 ms of the message in cyclic manner so reading is used to read the entire mes-
while displaying a message. The length that the characters scroll from left sage over there.
of this cycle depends upon the length to right with a proper gap between Note that each character is rep-
of the message string. The cycle repeats each shift. Meanwhile, the interrupt resented in the look-up table of the
after a ‘0’ is encountered at the end of service sub-routine also checks for the source code by two bytes. For exam-
KS Project Manual
EFY april 2009
ple, ‘S’ is represented by ‘Sh’ and ‘Sl’ msg0: db Hh, Hl, Oh, Ol, Uh, Ul, Sh, kept free, so that these can be used
separated by a comma. In addition to Sl, Eh, El, bsh, bsl, Nh, Nl, Oh, for interfacing with the serial port
the alphabets, Arabic numerals and Ol, bsh, bsl, fourh, fourl, zeroh, of the PC. Also, interrupt pins can
a few special characters have been zerol, oneh, onel, msh, msl, Hh, Hl, 0 be used to display some message
defined in the program. For instance, (Please note that the assembler is and sound an alarm in the case of
a blank space is represented by ‘bsh, case-insensitive. Still, upper and lower an emergency. For example, a fire
bsl.’ Thus, it is very easy to modify cases have been used for clarity.) sensor can be connected to ‘INT0’ and
the program. a vibration detector to ‘INT1.’ These
Suppose you want to display
Future enhancements pins can also be used to send signals
“HOUSE NO 401-H” in place of mes- Many more messages would be to synchronise a similar system that
sage ‘0.’ First, open the source code in possible if complete Port-3 is used displays another related message at
the editor. Delete the old string and for message selection. Pins RxD, the same time, so a 16-character, two-
write the new string as below: TxD, INT0 and INT1 have been line display is made possible.
movmsg.asm
$mod51 Fl equ 0e8h Zl equ 7ch
DBH equ p2 ; Higher byte of Data
Bus GH equ 1bh ;** codes for few special characters:
DBL equ p0 ; Lower byte of Data Bus Gl equ 0e8h
ADB equ p1 ; Address Bus strh equ 0e8h ;for star sign (as-
input equ p3 ; message select input Hh equ 0c3h terisk)
Hl equ 0ebh strl equ 17h
;** codes for decimal digits are given
below: Ih equ 0ffh plsh equ 0ebh ;for ‘+’ sign
; (‘h’ refers to higher byte, ‘l’ to Il equ 9fh plsl equ 9fh
lower one)
zeroh equ 17h Jh equ 17h mnsh equ 0ebh ;minus sign
zerol equ 0e8h Jl equ 0ffh mnsl equ 0ffh
twoh equ 23h Lh equ 3fh bsh equ 0ffh ;blank space
twol equ 0ech Ll equ 0ebh bsl equ 0ffh
threeh equ 2bh Mh equ 0d5h pieh equ 0eah ;for pie
threel equ 0fch Ml equ 0e3h piel equ 7fh
fourh equ 0c3h Nh equ 0d6h mueh equ 0e3h ;for micro (mu)
fourl equ 0fbh Nl equ 0e3h muel equ 0ebh