circuitcellar.com
Magazine Support   Digital Library   Products & Services   Suppliers Directory 
 
 





 

Issue 158 September 2003
The XY-Plotter
Drive High-Resolution LCDs For Less
Mad Dash for Flash Cash Contest Winner


MICRO OF CHOICE

I chose the PIC18F252 microcontroller on the basis of certain project-specific criteria. First, I needed speed. The more instructions in these bloody 780-ns nibbles the better. I also wanted a significant amount of RAM. I didn’t store the full bitmap but chose instead to store minimum, maximum, and sample values for each column already requiring 768 bytes. In addition, I needed a precision A/D converter and a large program memory for amassing the huge tables used in the design (including character bitmaps). Lastly, flash memory was necessary for configuring the display for each application.

One or two years ago, these requirements probably would have been impossible to fulfill, but, thanks to suppliers like Microchip, they are now easily satisfied, with the PIC18Fxx2 product line in particular. The PIC18F252, for instance, has 1.5 KB of RAM and plenty of flash memory (32 KB).

 

GRASPING THE SCHEMATICS

Figures 4 and 5 are schematics of the XY-Plotter. Each analog input (X, Y, AUX1, and AUX2) is conditioned thanks to half of an MCP6022 dual rail-to-rail op-amp. Two 20-turn trimmers per input give you the ability to easily adjust the full-scale deviation as well as the DC offset for each channel. One of the channels, AUX2, even includes two inputs summed by the analog amplifier.

(Click here to enlarge)

Figure 4—The XY-Plotter’s power supply isn’t included in this schematic. An MCP6022 analog amplifier, with scale and offset controls, scales each analog input. Some of the microcontroller’s I/O lines are multiplexed to limit the I/O count requirement.

The values of the resistors used for each amplifier stage can be adjusted for each specific application to accommodate different input ranges and adjustment precision. It is not obvious how to design an amplifier stage with positive and negative offset adjustment without a negative power supply. Here’s my trick: A fixed positive voltage, which is derived from a 0.6-V reference, is first subtracted from the input signal, and then a variable positive voltage is added to it, providing an offset that’s either positive or negative. I used Excel to calculate the resistors.

The PIC is clocked by a 10-MHz crystal up-converted to 40 MHz thanks to the on-board PLL. The LCD is directly connected to the PIC I/O lines, whereas the auxiliary digital inputs, which are used to dynamically select the text for the screen, are either direct inputs of the PIC or multiplexed with LCD data lines (thanks to a firmware reconfiguration on the fly).

Lastly, the ubiquitous MAX232 does what it’s intended to do. It should be noted that I included an in-circuit programming header just in case; however, I haven’t had to use it thanks to Microchip’s boot loader firmware. All of the programming was accomplished though the serial port.

 

POWER SUPPLIES

The power supply is a significant part of the design (see Figure 5). First, I needed a clean 5 V. I was already using all of the PIC’s analog inputs, so I couldn’t configure its ADC in external-reference mode. I still needed a stable reference for the analog-to-digital conversions. After experiencing a few headaches, I decided to use the PIC in its 0- to 5-V reference mode and to provide a well-stabilized 5 V. I implemented a high-precision MCP1541 voltage reference and built a discrete power supply around a low-drift LMC6462 op-amp. The second part of the op-amp is used to get the 0.6-V reference drawn on by the offset circuitry.

(Click here to enlarge)

Figure 5—The power supply includes four independent subsystems, one of which is the main 5-V regulator, which I built using a high-precision Microchip MCP1541 reference. I used a 5- to –24-V converter for the LCD. A homemade converter supplies the backlight voltage (100-V AC). Lastly, note that a 0.6-V reference is provided for offset control.

The LCD was hard to deal with because it needed both a –24-VDC input (for the display itself) and a 100-VAC power for the EL backlight. To limit the number of power inputs, I went with a small 5- to ±12-VDC converter to generate the –24 V switched by two transistors under PIC control. I couldn’t find a ready-made DC/AC converter for the backlight in time, but it wasn’t an issue. I built a pretty one with a small 220/12-V transformer driven by a NE555 timer. Done.