Interfacing To A Graphics Module With A Toshiba T6963C Controller
Interfacing To A Graphics Module With A Toshiba T6963C Controller
Interfacing To A Graphics Module With A Toshiba T6963C Controller
Introduction:
The Toshiba T6963C LCD controller is one of the most popular controllers for use in small graphics
displays. For this reason it is used in a number of Hantronix LCD modules from 128x128 to
240x128 pixels. This class of module is most commonly used to display a mixture of text and
graphics in small devices and instruments. It is usually interfaced directly with an embedded 8-bit
microprocessor. This application note describes the use of this controller with a number of
Hantronix graphics modules. The example used here is based on an 8-bit Intel I8051 micro-
controller but applies to almost any micro-controller.
Functional Description:
The T6963C uses a simple 8-bit data bus to transfer all instructions and data to and from the
display. After power is applied a hardware reset is issued. The controller must then be initialized
with a series of commands to set up the various modes and options available to the user. Once
initialized the display is ready to accept the data to be displayed. This data can be in the form of
bit-mapped graphical data or text data in pseudo ASCII format. The internal character generator is
biased at -20h. which means the user must subtract 20h from the ASCII code before sending it to
the display.
In the bit-mapped mode each byte of data represents 8 pixels on the display. See Figure #1. Text
data can be written in pseudo ASCII format and will be displayed as a 5x7 dot character. The
graphical and text data are written to separate, user assigned, areas, or pages, in the display RAM
within the display module. The user can then choose one of three ways to mix the text and
graphics pages on the display or the text or graphics page can be displayed alone.
17TH BYTE
Schematic:
The 80C51 microprocessor is connected to the LCD controller chip via parallel I/O ports in this
example. It could also be connected to the processor's data bus and be mapped into the
processor's data memory area. See figure 2.
80C51
33pF 240x64LCDDISPLAY +5v
16.00mHz P1.0
X1
VD D -15V
P1.1 D0
D1
FS
X2 P1.2 D2
33pF D3
P1.3 D4 VL 20K
D5
D6 VSS
P1.4
D7
+5v FG
P1.5
1N4148 + WR
1uF RD
P1.6
RST CE
CD
10k P1.7 RESET
P3.0
P3.1
P3.2
P3.3
Figure 2 Schematic diagram
Software:
The sample program here is written in 8051 assembly language and is designed to work with the
hardware shown in Figure 2. It is based on a 240x64 display but is applicable to any Hantronix
graphics display with the T6963C controller.
The program first resets the display. This reset must last a minimum of 2µS. It then sends a series of
command bytes and parameters to the LCD controller to initialize it. The T6963C requires that the
parameters, if any, are sent in the data mode and must precede the command byte, which is sent in
the command mode.
The controller is initialized with the graphics page at 0000-077fh. This is 1920 bytes which will
accommodate a full screen of data. No text is displayed in this example but the controller is
initialized for text operation to illustrate the process. The text page starts immediately following the
graphics page at location 0780h. All Hantronix graphics displays that have a built in T6963C
controller also have 8k of built-in display RAM.
The FS (Font Select) line is set to a zero in this example which will place the 5x7 pixel character in a
8x8 pixel field. This will produce 30 characters per line with 8 lines per display (240
8 =30 ). The total
number of characters possible in this mode is 240. A one on the FS line will produce an 6x8 pixel
field for each character.
After initialization the controller is set in the auto write mode and the display is filled with a bit-
mapped graphic.
The code example is not written to be efficient but to be as simple as possible to follow.
INITIALIZE
T6963C SET COUNTER
TO 2
NO
WRITE A WRITE A STATUS CHECK CALL
COMMAND BYTE DATA BYTE
WRITED
STATUS:
WRITEC: WRITED:
INC. TABLE
POINTER
SET C/D TO 1
STATUS STATUS
OK? NO OK? NO
YES YES DECREMENT
RD LOW COUNTER
STATUS CALL
OK? NO WRITEC
WRHIGH
YES
RETURN
RETURN
Initialization:
Before the LCD controller can accept or display data or text it must be initialized. This is usually
done immediately after the system is powered up. The following chart lists the initialization
commands and the parameters that accompany them along with a brief explanation of the function
of each. Where a parameter is different for a display that differs in resolution from the 240x64
example, the alternate values are also listed.
Initialization bytes:
COMMAND CODE PARAMETERS* FUNCTION
START OF THE TEXT STORAGE AREA IN DISPLAY RAM
TEXT HOME ADDRESS 40h 80h, 07h 0780h
1eh, 00h LINE LENGTH IN CHARACTERS 240 = 30 = 1eh FOR AN
8
(240x128, 240x64) 8 BIT CHARACTER CELL (FS=0). (28h FOR FS=1)
TEXT AREA 41h 14h, 00h LINE LENGTH IN CHARACTERS 160 = 20 = 14h FOR AN
8
(160x128) 8 BIT CHARACTER CELL (FS=0). (1ah FOR FS=1)
10h, 00h LINE LENGTH IN CHARACTERS 1288
= 16 = 10h FOR AN
(128x128) 8 BIT CHARACTER CELL (FS=0). (15h FOR FS=1)
GRAPHIC HOME ADDRESS 42h 00h, 00h START OF THE GRAPHICS STORAGE AREA IN DISPLAY
RAM 0000h
1eh, 00h LINE LENGTH IN PIXELS 240 = 30 = 1eh
8
(240x128, 240x64)
GRAPHIC AREA 43h 14h, 00h LINE LENGTH IN PIXELS 160 = 20 = 14h
(160x128) 8
Displayed image:
writec:
; Initialize the T6963C lcall status ;display ready?
setb p3.2 ;c/d = 1
clr p3.3 ;hardware reset writec1:
nop mov p1,r1 ;get data
nop clr p3.0 ;strobe it
setb p3.3 setb p3.0
mov dptr,#msgi1 ;initialization bytes ret
lcall msgc
; WRITED sends the byte in R1 to the
; Start of regular program ; graphics module as data.
;************************************************
; TABLES AND DATA
msgi2:
db 00,00,0b0h ;auto mode
db 0a1h
msg1:
db 00h,00h,00h,00h,00h,00h,00h,00h
db 0a1h
end