Professional Documents
Culture Documents
Display Controller
Users Guide
Revision 2.02
B y R y a n S h e l d o n
Special Thanks:
I would like to thank Kima Dirks for the many hours she has spent editing and refining all of my written literature.
I would also like to thank Tom Maier for his dedication to this project. Without his help our products would not be
possible.--Ryan Sheldon
This manual will discuss in great detail how the LCD display controller works. It will also discuss how to program
the device to perform many operations. The included software will get you running fast. Since this is a young
product, many software revisions will be made available to you. The software is simple in design, but complicated
in operation. We do not recommend using the NCD-LCD with Basic Stamp microcontrollers because of the
detailed programming involved.
Fatal mistake.
At the very last possible minute, the NCD-LCD display driver was upgraded to use the
new NCD-DISPLAY processor rather than the traditional NCD-110 interface proces-
sor. The upgrade resulted in a 350% speed increase in communicating to an LCD dis-
play, as well as a significant reduction in code required to control the NCD-LCD from
Basic. Functionally, the NCD-DISPLAY is very similar to the NCD-110; however,
some portions of this manual and hardware will unavoidably mention the NCD-110.
Interfacing to the Serial Port of Your Computer
Before we begin, we need to build a cable to transmit data from the serial port of your computer. Since most problems can
be attributed to improper connection to the serial port, extra time should be spent verifying these simple connections. Follow
the diagrams to build a cable for the system you intend to use. Take care not to accidentally short out pins on the connectors.
Though it is theoretically OK to short all the lines together from an RS-232 port, we strongly recommend that you take every
precaution to avoid this. Once the cable is built, connect an LED with a 2.2K resistor to the RS-232 ground and RS-232 data
output lines. The ground should connect to the short lead of the LED. The resistor should connect to the long lead. The
remaining end of the resistor should connect to the RS-232 data line. Enter and run the program for your computer found to
the right of each box. You should see the LED flash so fast that it appears to be on. Do not proceed until your cable is
working. Please note that all illustrations show the solder side of the connector.
PC Specific:
If you are using a PC, identify the type of serial connector you will need. There are only two common choices available. Both connectors
are female; the first diagram is for a DB-25 connection, and the second is for a DB-9 connection. PC users will need to find out if the
serial port is accessed as "COM1:" or "COM2:". The best way to do this is to try both software settings and see which one works.
Software from here on will assume you are using "COM2:".
Macintosh Specific:
If you are using a Macintosh system, make sure the connections are not accidentally touching each other. The lines on the mini 8-pin din
are very close together and very difficult to work with.
In QBasic for PC compatible systems, enter and run the follow-
PC Users ing program to test the serial port of your computer:
RS-232 Data Input
OPEN "com2:9600,N,8,1,CD0,CS0,DS0,OP0" FOR OUTPUT AS #1
RS-232 Data Output DO
RS-232 Ground FOR N = 0 TO 255
PRINT #1, CHR$(N);
Pin 1 Pin 5 NEXT N
LOOP
In Amos for Commodore Amiga systems, enter and run the fol-
PC & Amiga Users lowing program to test the serial port of your computer. Press
the mouse button to exit the program.
R4 - 2.2K
1 7 8 13 J4
Aux Out 2 Q7 A2 Q2 AD3
15 6 7 12 J3
Aux Out 1 Q6 A1 Q1 AD2
R5 - 2.2K
To LCD Pin 6 14 5 6 11 J2
Q5 A0 Q0 AD1
To LCD Pin 4 13 9 10 J1
Q4 Q3 AD0
To LCD Pin 14 12
Q3 [110]
To LCD Pin 13 11
Q2 DATA
3 1
STROBE RN1
To LCD Pin 12 10
Q1 WRDIS
4 18
STROBE
CR1 RN1
To LCD Pin 11 9
Q0 RESET
2 1 15
BAUD 2
2
CR
3 16 RS-232 1 J5
[LATCH]
4099 NCD-110
PIC (PIC16C54A)
16C54A
NCD-DISPLAY +5
V+ LM7805 + 5 V+
D2
C1 C2 R3 - 22K R1 - 5.1K
V+
+5
RS-232 Input
D1
R2 - 75K
Connecting the LCD Controller:
Orient the board as shown in the diagram below. Always make sure connections to the terminals are secure. Initial startup problems are
usually caused by loose connections. All connectors are polarity sensitive inputs. Make sure a proper connection is established before
powering up--incorrect connections may destroy the LCD driver and the LCD display.
Connector CN1 connects to the power supply of the controller. The user should provide +9 to +12 volts for proper operation.
Connector CN2 connects to the RS-232 port of your computer.
Connector CN3 is an auxiliary output. It consists of a ground pin (right-most pin) and two data lines. With minimal external circuitry,
these data lines can be used to drive an LED backlight and a relay. This will be discussed in greater detail later in this manual.
We have included two 7-pin dip sockets that should be soldered to the LCD display at this time. Though they are not required, they will
eliminate the need to de-solder the connector in the event of a malfunction.
Connector CN4 is an in-line 14-pin header for use with LCD displays that make use of an in-line interface. During assembly, you were
given the option to mount the connector on either side of the board. Pin 1 on the connector is located closest to the PIC chip (U1). This
must match pin 1 on the display.
Connector CN5 is a dual in-line 14-pin header and should have been mounted on the SOLDER SIDE of the board. When examining the
board from the solder side, orient the board with the connector on the left. Pin 1 is located on the bottom-right side of the connector
(bottom-left is facing the component side). When connecting an LCD display to the driver, orient the LCD so the screen is up and the
connector is on the left side. The connectors should line up and the driver board should fit neatly behind the display.
the board.
RS-232 Ground
PC, Mac,
or Amiga
Contrast Adjustment: A 5K poten-
tiometer can be connected between
the left-most, center, and right-most
hole of R6. Most displays work
well with the included 1K contrast
resistor; others show up better if the
indicated pads are shorted together.
Aux Output 2
Aux Output 1 1K contrast resistor for some LCD displays.
Connect these 2 lines together for other displays.
Initial Test:
At this point, we will assume you followed our directions for building and testing a serial cable to connect between your computer and LCD
controller. We will also assume you have an LCD display connected to either CN4 or CN5 of the LCD controller. We recommend driving
this board at 9 to 12 volts. A suitable power supply should now be connected. Take care NOT to connect the power supply backwards.
Upon power-up, the first line of your LCD display should be filled with solid squares. If it does not display anything (no change in color),
then verify power and LCD connections before proceeding. This may not indicate a problem at this time--go ahead and run the test program
and see if something happens.
Before using the LCD, remove any address jumpers and verify its operation by running the program "LCDTEST.BAS." Amiga users
running Amos will run the program "LCDTEST.AMOS." Modification may be required to this program depending on the system you are
using. If you performed the LED test when you were building your cable, you may have found that you need to use "COM1:" instead of
"COM2:". In this case, make the appropriate programming change before proceeding.
Depending on the display connected, you should see all or part of the message "National Control Devices." On a 16x1 display, you will see
only "National Control." On a 16x2, the word "Devices" will be centered on the second line of the display. If you are using a 20x2 or 40x2
display, you will see "National Control" on the left of the display on line 1, and "Devices" centered under the words on line 1. This device
has not been tested with 40x4 displays and may not work. Skip the "Debugging" section if the LCD displays the correct test message.
Debugging:
Basic checks: Verify all chips are located and oriented in the proper location. Also check to make sure all pins are in the socket.
Verify all parts are installed according to the directions and that your serial cable is functioning properly by performing the
LED test on the third page. Also, verify there are no shorted solder connections on the LCD board. We will also assume the
LCD board is oriented in the direction shown on the previous page.
Parts List:
Q1-2N2222A Transistor Q2-IRFZ34N Hexfet
D1-1N914 Diode +5 Volts R2-4.7K Resistor
K1-5 Volt Relay LED1 - LED Backlight
From Software to Hardware Interfacing:
We will assume you have set the address on the NCD-DISPLAY to 0 by removing jumpers J1, J2, J3, and J4. When the address is set to
0, the user may transmit ASCII characters from 0 to 15 to speak directly to this device. ASCII characters 16 and up will speak to devices
with an address setting of one or above.
The LCD module has two modes of operation. The mode of operation supported by this controller is called 4-bit mode. This means all
commands are sent into the LCD display in 4-bit chunks. The other mode of operation not supported by this controller is 8-bit mode.
Display speed is much faster in 8-bit mode, but requires additional multiplexing (a second 4099) to provide more data output lines.
Though there are 8 output lines on the 4099, a 9th line is required to tell the display whether it should be in data or instruction mode. Data
mode is used to transfer characters into the display; instruction mode enables advanced features such as scrolling, booting, clearing, and
cursor positioning, to name a few. A 10th data line would also be required to send a pulse after the data lines have changed. This pulse
is often called a strobe or clock. This strobe is used to tell the LCD display that data has changed on the inputs and that it's time to read
the new incoming data.
4-Bit Mode:
The primary reason for choosing the 4-bit mode is that we need to control the display using as few data lines as possible. Because 4-bit
mode requires only six data lines, it is an economical alternative to the traditional 8-bit interface. There is a speed penalty imposed by
operating an LCD display in this mode. The LCD display still requires 8 bits of data. To send 8 bits of data using a 4-bit interface means
breaking each byte into two sections. Each section is copied into the LCD display and reconstructed inside the LCD controller chips.
As you might guess, this process also involves a more complicated driver program. If you are interested in learning more about sending
data to an LCD display, carefully examine the included driver software to see specifically what processes are involved. The following
sections will concentrate on how commands are received and decoded. It will also explain how the versatility of the serial port can be
more efficiently realized by being more conservative with the serial port of your computer.
Immediately after data has been copied to all eight outputs, the strobe line is pulsed. The strobe line is used to indicate to other logic
circuits that new data has arrived. This subsequently tells other chips connected to the NCD-DISPLAY to copy data from the outputs of
the 4099 into other logic chips. This system is a very common method for logical device communications. Pin 1 on the NCD-DISPLAY
is the strobe output line.
In summary, the NCD-DISPLAY when combined with the 4099 multiplexor acts as an addressable serial-to-parallel converter. Two
transmissions are required for data to appear at the outputs of the 4099. Both transmissions must be in a consecutive sequence and both
must address the NCD-DISPLAY chip properly. The first transmission determines the lower four data bits. The second transmission
determines the upper four data bits appearing on the outputs of the 4099. The NCD-DISPLAY chip resets if the incorrect address is
called. This prevents data corruption on the outputs of the 4099.
NCD-DISPLAY Addressing:
Addressing the NCD-DISPLAY is very easy. On all NCD products, we use jumpers to set the address. These jumpers are always located
at pins 10 to 13 on the PIC. We have compiled a table that indicates the possible jumper settings:
Binary Address J1/Pin 10 J2/Pin 11 J3/Pin 12 J4/Pin 13 Range
0000 0 Removed Removed Removed Removed 0-15
0001 1 Installed Removed Removed Removed 16-31
0010 2 Removed Installed Removed Removed 32-47
0011 3 Installed Installed Removed Removed 48-63
0100 4 Removed Removed Installed Removed 64-79
0101 5 Installed Removed Installed Removed 80-95
0110 6 Removed Installed Installed Removed 96-111
0111 7 Installed Installed Installed Removed 112-127
1000 8 Removed Removed Removed Installed 128-143
1001 9 Installed Removed Removed Installed 144-159
1010 10 Removed Installed Removed Installed 160-175
1011 11 Installed Installed Removed Installed 176-191
1100 12 Removed Removed Installed Installed 192-207
1101 13 Installed Removed Installed Installed 208-223
1110 14 Removed Installed Installed Installed 224-239
1111 15 Installed Installed Installed Installed 240-255
Note the Range column--this is a quick way to determine what characters will cause the NCD-DISPLAY to respond. For example, on the
second row the range is 16 to 31. When the jumpers are set as indicated by the second row in the table, the NCD-DISPLAY will respond
to CHR$() commands from 16 to 31.
Applications:
Now that you are familiar with NCD and the LCD controller, we would like to invite you to combine our devices on a single serial line.
Up to 16 NCD products may be combined on a single serial line of your computer. Combine the M1 with the LCD controller to display
motor speed and direction information. Combine with a stepper controller for precise motor movement found in robotics. Bring an entire
robot to life by adding an SV16 servo controller to the network. You can mix and match whatever type of controller you need without
limiting yourself to the restrictions of one controller.
Try combining the AKT ASCII keypad transmitter and the IRTR infrared transceiver to send commands to your computer, then have your
computer send commands to any device you want, controlling any of 16 devices. Combine with the R85 and/or R810 relay driver to
control high current loads such as AC lights. All of our manuals are put together in the same easy-to-read format--just put the routines for
each device into a single program. Call the appropriate routine using the appropriate device name and you will have reliable control of
up to 16 different NCD devices, all from the serial port of a single computer. Watch for the arrival of many more products in the years to
come.
www.controlanything.com
www.controleverything.com
E-mail: ncdryan@aol.com