How To Drive An LCD Glass With Your Own Processor
How To Drive An LCD Glass With Your Own Processor
Table of Contents
File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
http://www.instructables.com/id/How-to-Drive-an-LCD-glass-with-your-own-processor/
Intro: How to Drive an LCD glass with your own processor
Practically speaking it is much easier to use a preassembled module consisting of a controller and glass. But if you ever wondered how the controller actually controls the
segments, read on.
If you don't have the luxury of a working circuit to start with, experiment with the AC, applying it to various combinations till you see a pattern. Stay away from using
elaborate glasses at first, it gets way too complicated.
http://www.instructables.com/id/How-to-Drive-an-LCD-glass-with-your-own-processor/
Step 2: Exploring the matrix
This particular glass has 2 back plane pins and 8 segment pins, 4 per digit. Glasses with more digits or figures require more back planes but I will be exploring this 2 back
plane glass only. And only the left digit. The right digit is just more of the same. Glass pins 3-6 are for the right digit.
Each pair of segments is controlled by one SEG pin and the two COM pins. Segments c and e of the left digit are controlled by pin 10 plus COM pins 1 and 2. Segments f
and g are controlled by pin 9 plus COM pins 1 and 2 and so on. All the segments are multiplexed between the individual segment pins and the COM pins. Segment d
alone is controlled by pin 7 and the COMs.
This is quite different than a standard LED display plus while LEDs use DC, LCDs require AC. In fact if you apply DC to an LCD for very long it will damage the glass.
The 2 COMs of a two back plane glass require 3 different voltage levels to operate: Vcc, Vcc/2 and Gnd. Since the glass draws extremely little current (think RC with high
R and low C), Vcc/2 is easily achieved with a resistor divider with both ends controlled by the uP. The center points of the dividers are connected to the COMs. With one
end of the divider high and one low the (1,0 or 0,1) the divider output is Vcc/2. Both high (1.1) the output is Vcc, both low (0,0) the output is Gnd.
http://www.instructables.com/id/How-to-Drive-an-LCD-glass-with-your-own-processor/
Step 3: It's all about the timing
In t1 COM0 is Vcc, t2 and t3 are Vcc/2 and in t4 COM0 is Gnd. COM1 is identical to COM0 but 180 degrees out of phase with COM0; t1 is Vcc/2, t2 Gnd, t3 Vcc and t4
Gnd. With more than 2 back planes you will have more divisions in every frame (period). This frame is 40 mS wide or 25Hz. The documentation I have found says that is
too slow but it works OK. Any problems just shorten all the times to increase the frequency, it’s looks issue; with the frequency too low you will notice the flicker, too high
causes ghosting.
For coding:
PORTD.6=1;
PORTD.7=0;
PORTD.2=1;
PORTD.6=0;
PORTD.7=0;
PORTD.2=1;
PORTD.3=0; For the next 10mS and so on to produce the above waveforms.
Once you have the above waveforms functioning forget about them. From now on you just have to manipulate the segments.
That is how the AC is realized. You don’t need to think about that any more; we will be only working with DC levels at the proper time.
http://www.instructables.com/id/How-to-Drive-an-LCD-glass-with-your-own-processor/
Step 5: Controlling a segment pair
Timing of the voltages is the key to controlling the segments. Each segment pair requires its own uP pin and follows this timing pattern:
t1 t2 t3 t4
For the segments ab, ce, fg and d the 1st segments are a, c, g and d. 2nd are b, e and g.
For coding:
All the SEGs and COMs are controlled in the same t1-t4 time frame based on a 10 mS interrupt.
http://www.instructables.com/id/How-to-Drive-an-LCD-glass-with-your-own-processor/
Step 6: Putting it all together
Controlling all the segments gets a little confusing. Each segment pair (d is considered a pair here) requires its own group of 4 bits, one each for t1-t4. Since there are 4
sets of segment pairs, 16 bits of refreshed data are needed for every frame. And that's just for the one digit.
So to display "4", send 0xC35A to the segment terminals. The code uses switch statements. One function for the COMs has a single switch statement and runs whenever
the program is running. Then another function with 4 switch statements (one for each pair of segments) which gets the refreshed data. All switch statements key off the
same 10mS interrupt to keep all the uP pins timed correctly.
Take a look at the code and hopefully it will all make sense. It's written in C using Code Vision. There is a lot of extraneous stuff, SPI (Serial Port Interface) etc. Initially I
thought I was going to have to produce four voltages for each pin to get the "result" pattern. So I connected to a DAC to get the various voltages only to find they weren't
needed. Too lazy (project fatigue!) to take it out. Really it's all about producing the proper levels at the proper time.
http://www.instructables.com/id/How-to-Drive-an-LCD-glass-with-your-own-processor/
File Downloads
Related Instructables
How electricity
and electronics
works by
rickharris test Grab Bag Paul's
Effect of Static with misc. Electronics Pit
Electricity on Electronics for Electricity? by electronics (Photos) by
Electronics by Absolute grenadier provided by pfred2
Ins Trucktibles Beginners, Jameco by wxh
Study Guide,
Chapter 1 by
elektrobot
http://www.instructables.com/id/How-to-Drive-an-LCD-glass-with-your-own-processor/
Advertisements
Comments
1 comments Add Comment
http://www.instructables.com/id/How-to-Drive-an-LCD-glass-with-your-own-processor/