Driving LCD''s
At 08:55 PM 2/25/02 +1300, Ben Lennard wrote:
>Anyway, does anyone know how to drive an LCD without killing it?
>
>I've come up with a circuit using 4 4094's to drive 4 digits of an LCD and
>fed with 6 lines from the BS2. It works, in that the LCD segments light up.
>BUT, I think I may be driving the LCD too hard and may eventually kill it.
You are close but not quite right. As you say, you have to drive the LCD
segments and backplane with an AC signal. Unfortunately, driving the OE
pin of the 4094 chips does not give you the correct AC signal.
What you want to do is alternate the backplane and segment
levels. Consider this: drive the backplane with a 30 Hz signal. Also
drive all the segments with the same 30 Hz signal. The display is OFF - no
segments show. Now drive all the segments with the inverse of the
backplane signal. Now all the segments are ON - the display shows up as
all 8s with the decimal points lit.
You probably see where I am going - you need to drive the backplane with a
constant AC signal of 30 to 60 Hz. Because none of the readily available
shift registers has an INVERT control pin, you need to shift out new data
to the segments each time the backplane changes polarity. The segment data
is the same level as the backplane if the segment is OFF, inverted with
respect to the backplane if the segment is ON.
Since you need to refresh the segment data each time the backplane changes
polarity, you might as well refresh all the segments at the same time. Do
this by connecting the Qs' output of the 1st shift register to the Din pin
of the next, and so on. Also connect all the Clk lines together, as well
as all the LE pins. This allows you to send data to all 4 shift registers
using 1 data line.
You need 4 pins from the Stamp to drive the display: Data, Clock, Latch
Enable, Backplane. Once you have the basic stuff working, you can start
combining functions on fewer pins by adding some extra components and extra
software. But lets keep it simple right now and use all 4 pins.
You need a bit variable (flag) to keep track of the backplane signal. Lets
start with it LO. Figure out what segments you want lit for the 1st
digit. XOR that data with the backplane flag. Shift the data out to the
1st SR. Now figure out what segments you want lit for the 2nd digit. XOR
that data with the backplane flag and shift it out. Repeat for the 3rd &
4th digits. Now pulse LE HI, then LO. Finally, set the backplane pin to
the same state as the backplane flag bit.
Now you can go off and do something useful for 20 or 30 ms. When about
that much time has elapsed, its time to refresh the LCD. Doing this is
easy! Invert the state of the backplane flag bit. Now repeat the whole
XOR and shift sequence in the paragraph above.
The DC offset is directly proportional to the duty cycle of the backplane
signal. If the backplane signal is HI exactly the same amount of as it is
LO, the net DC offset is zero. The key to controlling that is to try and
update the shift registers exactly the same amount of time as the previous.
Notice how easily the shift register routine can be set up as a
subroutine. Since you use a single bit as a flag, you can include the
toggle of that flag at the beginning of the subroutine. Now all you have
to do is call the subroutine on a periodic basis.
Hope this helps!
dwayne
PS: I routinely drive 4 and 8 digit 7 segment LCD displays as well as 4
character 16 segment LCD displays exactly as I have described above. Only
problem: its in PIC assembler and not in basic. Sorry about that!
dwayne
Dwayne Reid <dwayner@p...>
Trinity Electronics Systems Ltd Edmonton, AB, CANADA
(780) 489-3199 voice (780) 487-6397 fax
Celebrating 18 years of Engineering Innovation (1984 - 2002)
.-. .-. .-. .-. .-. .-. .-. .-. .-. .-
`-' `-' `-' `-' `-' `-' `-' `-' `-'
Do NOT send unsolicited commercial email to this email address.
This message neither grants consent to receive unsolicited
commercial email nor is intended to solicit commercial email.
>Anyway, does anyone know how to drive an LCD without killing it?
>
>I've come up with a circuit using 4 4094's to drive 4 digits of an LCD and
>fed with 6 lines from the BS2. It works, in that the LCD segments light up.
>BUT, I think I may be driving the LCD too hard and may eventually kill it.
You are close but not quite right. As you say, you have to drive the LCD
segments and backplane with an AC signal. Unfortunately, driving the OE
pin of the 4094 chips does not give you the correct AC signal.
What you want to do is alternate the backplane and segment
levels. Consider this: drive the backplane with a 30 Hz signal. Also
drive all the segments with the same 30 Hz signal. The display is OFF - no
segments show. Now drive all the segments with the inverse of the
backplane signal. Now all the segments are ON - the display shows up as
all 8s with the decimal points lit.
You probably see where I am going - you need to drive the backplane with a
constant AC signal of 30 to 60 Hz. Because none of the readily available
shift registers has an INVERT control pin, you need to shift out new data
to the segments each time the backplane changes polarity. The segment data
is the same level as the backplane if the segment is OFF, inverted with
respect to the backplane if the segment is ON.
Since you need to refresh the segment data each time the backplane changes
polarity, you might as well refresh all the segments at the same time. Do
this by connecting the Qs' output of the 1st shift register to the Din pin
of the next, and so on. Also connect all the Clk lines together, as well
as all the LE pins. This allows you to send data to all 4 shift registers
using 1 data line.
You need 4 pins from the Stamp to drive the display: Data, Clock, Latch
Enable, Backplane. Once you have the basic stuff working, you can start
combining functions on fewer pins by adding some extra components and extra
software. But lets keep it simple right now and use all 4 pins.
You need a bit variable (flag) to keep track of the backplane signal. Lets
start with it LO. Figure out what segments you want lit for the 1st
digit. XOR that data with the backplane flag. Shift the data out to the
1st SR. Now figure out what segments you want lit for the 2nd digit. XOR
that data with the backplane flag and shift it out. Repeat for the 3rd &
4th digits. Now pulse LE HI, then LO. Finally, set the backplane pin to
the same state as the backplane flag bit.
Now you can go off and do something useful for 20 or 30 ms. When about
that much time has elapsed, its time to refresh the LCD. Doing this is
easy! Invert the state of the backplane flag bit. Now repeat the whole
XOR and shift sequence in the paragraph above.
The DC offset is directly proportional to the duty cycle of the backplane
signal. If the backplane signal is HI exactly the same amount of as it is
LO, the net DC offset is zero. The key to controlling that is to try and
update the shift registers exactly the same amount of time as the previous.
Notice how easily the shift register routine can be set up as a
subroutine. Since you use a single bit as a flag, you can include the
toggle of that flag at the beginning of the subroutine. Now all you have
to do is call the subroutine on a periodic basis.
Hope this helps!
dwayne
PS: I routinely drive 4 and 8 digit 7 segment LCD displays as well as 4
character 16 segment LCD displays exactly as I have described above. Only
problem: its in PIC assembler and not in basic. Sorry about that!
dwayne
Dwayne Reid <dwayner@p...>
Trinity Electronics Systems Ltd Edmonton, AB, CANADA
(780) 489-3199 voice (780) 487-6397 fax
Celebrating 18 years of Engineering Innovation (1984 - 2002)
.-. .-. .-. .-. .-. .-. .-. .-. .-. .-
`-' `-' `-' `-' `-' `-' `-' `-' `-'
Do NOT send unsolicited commercial email to this email address.
This message neither grants consent to receive unsolicited
commercial email nor is intended to solicit commercial email.