Specifications

CONSTRUCTION
tal ‘D’
latch
74LS373.
The
purpose
of using
74LS373
is to de-
multi-
plex the
address
lines and the data lines. Hence, after
de-multiplexing, AD0-AD7 forms two
sets of lines—address lines A0-A7 and
data lines D0-D7. The higher-order ad-
dress lines A8 to A15 are directly avail-
able from 8051 pins.
During the memory access cycle, port
P0 first outputs lower bytes of 16-bit
memory address and then the same port
acts as bidirectional data bus to read a
byte of memory, whereas port P2 provides
the higher byte of memory address dur-
ing the read cycle. It is further seen that
the lower-order address byte of port P0
gets latched into external register of 74373
(IC2) to save the particular byte. The ALE
(Address latch enable) pulse provides the
precise timing to the 74LS373 for latch-
ing the low-order address.
If the memory access is meant for
the program memory, the PSEN signal
goes low and enables the EPROM to
output the code on the data bus. The
purpose of using PSEN (program store
enable) is that it provides the output
signal for the program memory/code
memory. When this signal goes low, con-
troller can read instruction byte from
the program memory.
Under the program control, 8051
provides the output to port P1, which
is further coupled to the base of driver
transistors T1 through T8 (BC547). A
logic 1 at any of the output pins of port
P1 will drive the corresponding LED as
well as the gate of the triac. The corre-
sponding triac therefore fires to drive
the lamp/lamps connected between its
terminal A2 and the neutral line (N). If
you use, say, 12V lamps, you may con-
nect about 20 lamps in series. If each
lamp is of 25-watt (passes about 2A
current) rating, you may connect two
rows of 20 such bulbs across A2 termi-
nal of each triac and neutral line. The
software program determines the trig-
gering sequence of the triacs to provide
the lighting effects.
Software
As mentioned earlier, lighting of bulbs
is controlled by port P1 output code
format. During the execution of the pro-
gram, the code stored from memory lo-
cation 0023H up 007CH (total locations
are thus 59H or 89 decimal) will get
loaded into the accumulator one by one
and will get transferred to port P1. If
the format of these codes or their se-
quence is changed, the output too will
get altered in same manner. Please note
that outputting logic 1 from any pin
(equivalent to setting a specific bit) will
switch ‘on’ the corresponding triac (and
the series of bulbs connected across its
terminals A2 and N), whereas output-
ting logic 0 from the same pin of port
P1 (equivalent to clearing/resetting the
specific bit) will switch it ‘off’. The out-
put code format from port P1 is shown
in Fig. 4.
Example 1: If there is a requirement
to set only P1.0 bit, the output format
from port P1 will be as shown in Fig. 5.
For converting the above format to
Fig. 4: Output code format from
port P1
Fig. 5: Output code format for
setting only P1.0
Fig. 6: Hex code for Fig. 3
Fig. 7: Hex code for setting P1.0 and P1.7 bit
PARTS LIST
Semiconductors:
IC1 - 8051 microcontroller
IC2 - 74373 octal ‘D’ type latches
IC3 - 2764 EPROM 8-kbytes
IC4 - 7805 regulator +5V
T1-T8 - BC547 npn transistors
TR1-TR8 - BT 136, triac
LED1-LED8 - Red LED
Resistors (all ¼-watt, ±5% carbon, unless
stated otherwise):
R1-R16 - 560-ohm
R17 - 47-ohm
R18 - 10-kilo-ohm
Capacitors:
C1, C2 - 30pF ceramic disk
C3 - 100µF, 16V electrolytic
C4, C5 - 10µF, 25V electrolytic
Miscellaneous:
X
TAL
- 12MHz quartz crystal
L1-L8 - L1 through L8 could each
be a series of bulbs with to-
tal voltage-drop of 230V AC
- Heat-sink
S1 - Push-to-on switch
www.electronicsforu.com
a portal dedicated to electronics enthusiasts
183