Issue
158 September 2003
The
XY-Plotter
Drive
High-Resolution LCDs For Less
Mad
Dash for Flash Cash Contest Winner
by
Robert Lacoste
Robert spent nearly 100 hours
building his high-performance, LCD-based XY-Plotter.
Now that he has written about the process, it should
take you much less time to construct your own. Follow
along as he shows you how to maximize your time
and money when driving graphic LCD panels.
Start
Micro
of Choice
Prototype
Assembly
Text
Display
Optimization
Tips
Problems
Solved
Sources
and PDF
Implementing
a graphical LCD is an excellent way to drastically change
the look and feel of a project. You can transition from
a classic technician-oriented, two-lined text LCD to
a user-friendlier device. Unfortunately, graphic LCDs
are resource-hungry devices, both in terms of memory
and CPU power. So, you’re forced to either create lovely
minimalist designs with an intelligent LCD (with on-board
LCD controller, processor, and memory, as described
by Jeff Bachiochi in Circuit Cellar 150) or swap the
usual microcontroller for a classic microprocessor,
memory, display controller set.
Both
options are expensive, and there doesn’t seem to be
another solution. For instance, the 240 × 320 pixel
display used in this project eats one 4-bit nibble every
780 ns, and it needs a minimum of 10 KB of RAM just
to store the displayed bitmap. Thus, it’s impossible
to drive it directly with a high-end PIC controller
providing a 100-ns cycle when clocked at 40 MHz and
1536 bytes of RAM, right? Nothing useful can be done
in less than seven assembly instructions per nibble,
correct?
As
you probably expect, this project proves that the impossible
is possible with an optimized firmware design. You’ll
even learn that it’s possible to use this minimalist
concept for something useful!
PLOTTER
BASICS
I
got the idea for the XY-Plotter from an old spectrum
analyzer sleeping in my garage. Despite the fact that
the heavy analyzer’s CRT display was dead, the radio
parts worked well. So, from time to time, I used it
with an oscilloscope as an output device. The arrangement
was cumbersome and uncomfortable to implement. Consequently,
I decided to repackage the analyzer in a smaller, prettier
enclosure and design an LCD alternative to the CRT display.
Because I wanted the ability to reuse the design, I
chose to develop a generic display subsystem, the XY-Plotter
(see Photo 1).
|

(Click
here to enlarge)
|
Photo
1—The large 240 × 320 LCD is affixed to the PCB.
The three control push buttons and the screen dump
RS-232 connector are along the bottom edge. |
The
XY-Plotter is an autonomous analog-like display with
two main x and y inputs. Continuously scanning the two
inputs, the plotter displays them on a real-time x-y
graph by way of configurable modes (i.e., Sample, Maximum,
Peaks, or Average) with Accumulate and Hold controls.
Moreover, a set of analog and digital auxiliary inputs
allow you to display configurable information on the
screen such as center frequency, reference level, scan
time, and so on (see Figure 1). Lastly, an RS-232 port
dumps hard copies of the screen to a host computer.
|

(Click
here to enlarge)
|
Figure
1—The XY-Plotter screen displays a real-time x-y
graph as well as three lines of configurable textual
status information and real-time measurements. |
As
you can see in Figure 2, the XY-Plotter’s overall architecture
is simplistic: it contains nothing more than a PIC18F252,
a few MCP6022 analog amplifiers, a low-cost LCD, and
several other low-cost components. I built an integrated
power supply using a MCP1541 precision voltage reference.
|

(Click
here to enlarge)
|
Figure
2—The XY-Plotter’s hardware design is simple. The
PIC18F252 manages everything including LCD pixel
generation in real time. A couple of Microchip MCP6022
rail-to-rail op-amps were used to scale the analog
inputs. |
LCD
TIMING REQUIREMENTS
I
used an FTN reflective Epson ECM-A0635-2 LCD with a
240 × 320 pixel black and white screen (see Figure 3).
The display is extremely dumb, and it should be supplied
in real time with the required pixels. The host controller
must send a new frame every 15 ms. Each frame includes
240 lines, and each line includes 320 pixels grouped
into 4-bit nibbles.
In
addition to the 4-bit data input port, the controller
must also supply three clocks: frame, line, and nibble.
One new nibble must be delivered every 780 ns, which
I arrived at via the following equation: 15 ms/240/(320/4).
Note that for this project I used the display turned
by 90° in Portrait mode (320 pixels high, 240 wide),
so the scan lines are vertical.