Fun With Graphics LCDs


 
Graphics LCDs
Graphics LCDs are a bit of a pain. OK, they're really a pain, due mostly to the fact that there are few standards, and those standards are de-facto only, and at the convenience of the LCD maker, not the system designer. Each LCD is unique in its electrical, optical and mechanical characteristics.

But I love 'em. Cheap surplus panels are readily available. You can display anything, limited only by your imagination and the amount of code you're willing to write.

The painful part is that each LCD is different in many ways from the next. Electrically, the logic signal timing, types of signals, frequencies, number of data and timing signals, how the data maps to the display coordinates, the power supply, sequencing of the supplies, the backlighting circuitry, the logic levels (3V or 5V), can all be specific to one panel or group of panels. Each needs specialized circuitry.

Optically, the viewing angle, contrast ratio, backlighting, response time, contrast as a function of supply voltage and temperature,  and backlighting brightness, all are panel dependent. Mechanically, the size, mounting, and perhaps the most frustrating, the connector mechanics, position and pinouts all vary significantly from panel to panel. But if you are willing to compromise contrast ratio, then surplus panels can be an option. Indoors, nearly any panel is readable. When you need sunlight readability, the choice of panels is far narrower. 

Another variable is the controller. Many smaller panels have built-in controllers and memory. Their interface is typically an 8 bit data bus plus control signals intended to tie to a microprocessor's bus. Some use a serial interface.  Few if any larger displays have built in controllers and so need external controllers. 

Also controllers topically have a range of panels they support. Switch to color, greyscale, or more pixels, and plan to change controllers, board layout and software. Then plan to change controllers at random times because the controller you designed in just went obsolete. Epson is the big cheese in the embedded LCD controller market, and is pretty infamous for obsoleting controllers shortly after you get into production. I know.

Some newer CPUs have on-chip LCD controllers and memory. Same problem here, but worse. Changing resolution could cause you to change CPU architectures. I'm sure your software group won't mind.

If you are fortunate to have the budget, purchase (or borrow) an evaluation kit with the exact panel you plan to design in. This will allow you to evaluate the optical characteristics without having to design your entire system just to see the display say "Hello World".

LCD Controllers: LC10X
I attempted to get some form of control over, and market solutions for this unwieldy situation in the shape of a small company, named Celestial Design Co., a few years back.  I designed LCD controllers chips using FPAGs. A case of a hobby run amok. Each controller design addressed one class of monochrome panels, and mapped the panels into X-Y coordinates, so the software would be consistent across displays. My next step was to make one connector pinout that would address all these panels.  I based it on the Epson 14 pin de-facto pinout since it had the most funny control signals. Many of my earlier projects used Epson, and so could use a straight 14 pin ribbon cable. VGA panels need 4 more data bits, so I stretched the Epson pinout to 20 pins and added one additional ground and one spare. You can make a 14 pin cable in a 20 pin connector by not using the upper 6 pins.

The first,  LC101, was based on an Actel OTP FPGA device and only supported the bizarre Hitachi LM215XB panel (480 X 128). This original design was the foundation for the other designs. My 1993 Circuit Cellar Article is based on this part. The first BoatBus system used this device.

For the next project, a house-wide stereo system, I adapted LC101 to an Epson 240 X 64 panel and called the controller LC102. The only one in the world continues to operate in my living room.

Then I had the idea to commercialize the chips and start a small, part-time internet based company. Actel FPGAs were appealing, but the need for an expensive programmer and the onetime programming nature of the devices was frustrating. I developed and programmed the original two devices courtesy of my employer, Datacube. But to spin this off into a commercial venture required independence. I settled on the Altera FLEX8000 parts. The controllers fit in the smallest part, EPF8282. Unfortunately it is also the largest physical part: 84PLCC. They were low cost, but need a configuration PROM. The Atmel 17C65 would do the job nicely. Altera Max+ (now Quartus) software is available for free and supports lots of parts. I would sell the programmed Config PROMs and re-sell the FPGAs, but customers could buy the FPGAs from any distributor. I would also sell the design to people who wanted to design it into their own FPGA.

The first device supported all the Epson panels. It was LC103. The next supported all 4 bit, single scan panels. That's the bulk of the LCD market: LC104.
The next design would support all VGA 640 X 480 single and dual scan panels: LC106. All these parts used a consistent RAM and CPU interface, and pinout. Simply by changing the 8 pin DIP config PROM you could re-configure the device. Within each device, four pins, set by jumpers or DIP switch, would select one of up to 16 different resolutions.

Technically it was a good success. Other than a few mutant one bit and two bit panels, just about every modern panel was supported. I bought up many new and surplus panels to test them out. Market-wise, there was no way to protect the product without a bank of lawyers. Anyone with a PROM programmer could buy one PROM and then make all they wanted. At least with Actel copying was virtually impossible. When chip sales dropped to 1 chip per month, I closed the web site.

Since then a few things have changed. LCD's have gotten smaller, lower power, and cheaper, thanks to the handheld market. Modern ones are either 3V or can handle both 5V and 3V power.

LCD Panels
The big problem in the first version of BoatBus was the LCD. I liked the fact that the panels did 80% of the job and were cheap ($20), but I realized that ability to work both in sunlight and in dark were very important in a boat cockpit. After seeing some nice commercial products with LCD's, I figured that decent black and white (monochrome) LCDs were widely available. There are three types of monochrome LCDs: Reflective, Transmissive, and Trans-reflective.

Reflective units generally have no backlighting for night viewing and so need an external front light. Transmissive units always require a back light and in sunlight, the backlight is fighting against the sun and losing. So the display washes out. Laptop TFT color displays are transmissive and very hard to read in direct sunlight.

Transflective are visible in direct light, and then at night a backlight can be turned on. My Garmin GPS uses this type and works quite well. The compromises for transflective LCDs are that the contrast ratio isn't as good, and there is a bit of double view at oblique viewing angles. However, the fact that they work in all light conditions is a big plus. This is what I settled on for a display that needs to be outside.

Then there is the backlight. Backlights are available in Cold Cathode Fluorescent (CCFL) Electro-luminescent (EL) and LED. CCFL is nice, bright and white. EL is generally blue, yellow, etc. Older LED backlights are generally yellow, but new ones use white LEDs. I prefer a nice white backlight, myself. They have the best contrast and most pleasing displays to my eye. The three types use radically different power supplies, but fortunately inverters for EL and CCFL are widely available. EL uses 100V AC at about 400 Hz. CCFLs use about 500VAC at 5ma and 25 kHz  which is typically 2-5W from a 12V or 5V supply. LED's use straight DC: about 100 ma at 5V or 0.5W. The last time I used an EL it was in an audio preamp, and I found it nearly impossible to keep all the 400Hz from the EL inverter out of the audio signal. It would have required a separate supply shielding, etc. DC and  25 kHz are a bit easier to deal with. Watch the CCFL and EL high voltage though. It definitely hurts when it comes in contact with you!!

My preferred resolution is quarter VGA (QGVA) or 320 X 240. It has square pixels, so bit maps and fonts don't need to be scaled. They are available from 3.5" or smaller, up to 5.7" diagonal. I like the 4.7" and 3.8" sizes. My preferred backlight is white LED with CCFL as a second choice. I have one 4.7" which I like and it has CCFL backlight. So I looked for white LED versions and found a sweet little 3.8" panel at Apollo. The price was right at about $65 new. But when I proceeded to buy two , I found that Apollo has a hard and fast $250 minimum order. This is specifically to deter hobbyists. Unfortunately displays with white LED backlight are new, and none have reached the surplus market yet. So I settled on a CCFL backlight. Unfortunately almost all surplus QVGA panels are transmissive. And there are few at that. Three strikes (transmissive, CCFL, and hard to find) so they're out. There are QVGA panels available at about $110, but I intend to litter my home and boat with these, so that's a bit too much money

The other problem with surplus is that if you design the packaging, backlight, voltage supply, software,  LCD controller, etc. for some panel, and then go to buy more a year or two later, you will likely find them no longer available. There are however a bunch of VGA (640x480) panels available surplus. They are very cheap, have good contrast, and are available in quantities from 1 to 1000's. I like the EG9013 from EarthLCD. It is a decent size (6") and I have one lying around. Earth has 20,000 in stock for $29 each, Qty 1. They are transmissive CCFL backlit units. For this project I want a smaller display and so will use a QVGA (320 X 240) panel. 

So I need to make the good vs cheap decision. For my hobby,  I generally lean towards cheap surplus panels when making a good vs. cheap tradeoff. Here I decided that most of the displays I'll use are indoors always, with only 1-2 outdoors. So I could use the cheap surplus QVGA panels inside and the good,  pricier, Transflective ones for outside applications. Seems reasonable. The other advantage of a full VGA is that you can display much more stuff on a single display. More numeric displays, larger plots and graphs, etc. The downside of all these pixels is that the CPU can run out of steam trying to update them at 1-2 updates per second. An Atmel 32 or larger at 8MHz or above can keep up with 1 or 2 updates per second though. A lesser processor will be slower. 

In case you're still not convinced that I'm a true LCD geek, check out my current inventory of spares, not including Alphanumeric and just numeric LCDs. I've fired up about 3/4 of them.

I used to own a company, Celestial Design, that offered LCD controller chips based on FPGAs. It never really took off, partly due to my unwillingness to really invest much money into it. I did it partly to answer the question of whether a part-time, technical,  internet only company could succeed. Not without some significant commitment of cash and time. However I have some decent LCD controller technology left over. I'm offering the source code for these controllers on this web site. Contact me if you would like a copy. 

Gee Dave, How About Color LCDs?

Certainly color LCDs are prettier. They are also much more expensive. They require more display memory,  more display memory bandwidth, more power, and more CPU cycles to update all that extra display memory. This would probably push an application into the realm of 32 bit processors, with all their attendant cost, power and board real estate. I prefer to stick with my little 8 bit wonders, getting as much out of them as possible.

Monochrome LCDs only need one memory byte for 8 pixels. This is really efficient. Color and greyscale panels use 8 or more bits per pixel, thus 8X the memory and the bandwidth. And on character and bitmap operations, 8X the CPU cycles too. On  a QVGA panel this isn't much, but on a full VGA or higher panel, the memory size and bandwidth numbers start getting big.

Monochrome LCDs can be driven with time dithered signals to achieve greyscale. Passive color panels also use this trick. They are by nature only 8 color devices: one bit each for Red, Green and Blue. To get more colors, you time-dither the color signals. All these pay the same price in terms of memory size and bandwidth. When my applications start requiring greyscale and color, I may turn to the dark side: Embedded PC!! Run away Dave!!! Let's see some embedded PC do a meaningful graphics application for under $100 including the display. I think not!

LCD Controllers: LC10X
I attempted to get control of hunks of this unwieldy situation in the shape of a small company, Celestial Design Co. a few years back.  I designed LCD controllers chips using FPAGs. A case of a hobby run amok. Each controller design addressed one class of monochrome panels, and mapped the panels into X-Y coordinates, so the software would be consistent across displays. My next step was to make one connector pinout that would address all these panels.  I based it on the Epson 14 pin de-facto pinout since it had the most funny control signals. Many of my earlier projects used Epson, and so could use a straight 14 pin ribbon cable. VGA panels need 4 more data bits so extending the Epson 14 bit 'standard' to 20 pins was necessary. That way either a 14 pin or a 20 pin cable could be used.
Here's a photo of the prototype of a AVR Mega128 processor with an LC106 type LCD controller. The empty sockets on the top left are from the old 68hc11, SRAM and EPROM that I removed. The Mega128 is on a prototype adapter from www.devrs.com/store.  This cool adapter takes any .8mm QFP up to 80 pins, or any 0.5mm QFP up to 100. $10 plus shipping. In the upper right are the LCD controller FPGA,  8 pin config EEPROM, and display RAM . The IC and caps on the right are the V- power supply for the LCD. JTAG ICECube is lower right.


Here's an LCD du-jour: Epson EG9013 6.3" VGA  640 X 480 with CCFL backlight. The software is set up for a QVGA panel (320 X 240) and so only 1/4 of the screen is currently used. Now I need to figure out what to display on all those empty pixels. It's currently displaying the total AC current drawn by my house, and the temperature in the basement. The rest is place holders. The plot is the house current over a 3 minute interval. Those big  60A pulses are the clothes dryer cycling its heater.



BoatBus Home
BoatBus Story
WeatherNode
 LCDs are a pain. but fun!
AVR Processors
Communications via RS485
How I prototype, and the Lab

Last Updated: May 20, 2005