equals 6), thus Y6 will be low and all other Y outputs will
be high. Also note that it is literally impossible to activate
more than one zone at a time because the 4515 will only
ever precisely do one of two possible things: it will assert
no zones if the inhibit input is asserted, or it will assert
whichever Y output corresponds to the four-bit pattern in
its internal latch.
What’s the purpose of the four-bit latch? Notice that I
have used four of the PA bits from the RCM5450W
module’s Port A. I will also use those same bits to convey
data to and from the LCD module. The 4515 lets me write
the four bits into its internal latch; once the PA bits have
been written into that latch, I can reuse PA bits for other
things, such as changing the display on the LCD module so
that the clock remains accurate.
I’m using PD5 as the latch enable. The protocol here is
simple: To enable relay X, write the RCM5450W Port A bits
3:0 with the value of X. Then, write Port D bit 5 (which is
normally a 0) to a 1, and then back to a 0. That causes the
latch to open which passes X through to the 4: 16 decoder,
and then causes the latch to close which causes the latch
to remember that value of X until next time.
Meanwhile, PD7 has been held inactive all this time, so
no Y outputs of the 4515 are asserted, and no relays are
yet activated. Once the four-bit value is sent on Port A bits
3:0 and latched by pulsing PD5, we can de-assert the
4515’s “INHIBIT” input by writing PD7 to zero, and keep it
low for the duration of the sprinkling desired.
■ FIGURE 4.
module mounted on
Interfacing to the LCD Module
The only semi-tricky part of interfacing to the LCD
module is to find a way to accomplish that interface
without interfering with the relay interface. Previously, I
showed how the relay interface was
done, using Port A bits 3:0 and Port D
bits 5 and 7. If Port D bit 7 is high,
then you can do anything you want to
the Port A bits. The relays won’t see it
because the 4515 chip’s outputs will
not be enabled.
So, to interface to the LCD
module, I used all eight Port A bits,
plus some Port D bits for the three
LCD control signals RS, E, and R/W.
Note that the Port D control bits I
chose were not the same ones I used
for relay interfacing. The LCD module
listens to Port D bits 2:0, plus bit 6 to
control the LCD module backlight; the
relay interface uses Port D bits 5 and
7. There are 16 pins on the LCD
module. Pins 1 and 16 are grounded,
and pin 2 supplies +5V. Pin 3 is a
voltage between 0 and +5V - this
voltage sets the display's contrast.
I assigned three Port D signals to
control the LCD module: Port D bits 0, 1, and 2. PD0 is the
module's RS bit, PD1 is R/W, and PD2 is the Enable bit.
January 2011 47