Table of Contents

T6963

This driver supports display modules based on the Toshiba T6963 chip. These displays are made by different manufactures, and come in various sizes (mine is a Toshiba TLC1091, which is really large: 240×128 pixels, which make 40 rows and 16 columns). You're right: I said pixels. The T6963 is a graphical display controller. Although there's no support for any graphic elements in lcd4linux at the moment, the driver does all operations in graphics mode (similar to the X11 or raster driver). All the font rendering, bar drawing and so on is only pixel based, the T6963 character mode is never used.

The displays are connected to the parallel board (see Wiring below), and are quite timing-critical. There's no way to delay a usermode program under Linux for e.g. 40 usec, so we have to do busy-waiting. This has been done in a delay loop, which had to be calibrated. Since 0.9.8 there are two new delay loops, one based on the processor's TSC (Time Stamp Counter), one based on gettimeofday(). LCD4Linux decides automatically which one to use (it prefers the TSC method, but falls back to gettimeofday() if neither the TSC flag nor the MHz value is set in /proc/cpuinfo). Calibration is no longer necessary!

The T6963 uses a bidirectional protocol, it is necessary to read data from the controller to perform the so called status check. This check returns if the T6963 is busy or idle (and ready for the next command). Therefore your parallel port has to be bidirectional!

The driver knows of two ways of controlling the parallel port: The (old, ugly and unportable) raw programming of ports, and the new, cool, great ppdev() style. You decide which one to use by specifying either a hexadecimal value or a device file with the 'Port' entry in the config file.

Note that the old port programming only works with standard ports (0x3f8, 2f8,…), but not with PCI parallel port cards. Also, some secured linux systems (LEAF kernels with the grsecurity patches being one) do not allow a userspace program to do raw I/O (not even if running as root), so you have to use ppdev there anyway.

ppdev requires kernel 2.4 or newer, and the ppdev kernel module loaded. The configure script detects if you have the required include files, and deactivates ppdev if they are not there. You should use ppdev whenever possible! Raw port access may be dropped someday.

Note that you have to use parport devices (usually /dev/parports/* or /dev/parport* with major number 99), the printer devices (/dev/printers/* with major number 6) do NOT work! If you are using devfs or udev, these devices may become visible as soon as you load the ppdev kernel module.


Display Section

Display <name> {
    Driver     'T6963'
    Model      'generic'
    Port       <string>
    Size       <string>
    DualScan   <0|1>
    Cell       <5|6|7|8>
    Font       <string>
    Foreground <color>
    Background <color>
    Basecolor  <color>
    Wire {
	CE <string>
	CD <string>
	RD <string>
	WR <string>
    }
    Timing {
        fuzz      <percentage>
        ACC       <number of nanoseconds>
        OH        <number of nanoseconds>
        PW        <number of nanoseconds>
        DH        <number of nanoseconds>
        CDS       <number of nanoseconds>
    }
}

Parameters:

Driver'T6963'
Model'generic'
Porteither the hexadecimal address of the parallel port (“0x378”) or a ppdev device (“/dev/parports/0”)
Sizesize of the display in pixels, specified as <width>x<height> (e.g. “240×64”)
!DualScanset to 1 if your display is controlled by dual-scan mode. If your display has 128 or more rows, and the lower half stays dark, try this parameter. Default: 0 (deactivated)
Cellhorizontal pixel size of a character in text mode. This is hardwired on the T6963, but LCD4Linux must know about this value. If your display shows garbage, try playing with this parameter. Default: 6 (6×8 font). Note that this setting has nothing to do with the Font parameter!
Fontfont size, specified as <width>x<height> (only '5×8' and '6×8' supported at the moment)
Foregroundcolor of active pixels (RRGGBBAA or RRGGBB), default is opaque black '000000ff' (see colors for details)
Backgroundcolor of inactive pixels (RRGGBBAA or RRGGBB), default is transparent 'ffffff00' (see colors for details)
Basecolorcolor of virtual backlight (RRGGBB), default is white 'ffffff' (see colors for details)
Wire.*see below
Timing.*see below

Examples:

T6963 default wiring

This wiring is used by some windows programs, too, and the graphlcd plugin for VDR knows this as the “windows wiring”.

Display T6963-240x64 {
    Driver  'T6963'
    Port    '/dev/parport0'
    Size    '240x64'
    Font    '6x8'
    Wire.CE 'STROBE'
    Wire.CD 'SLCTIN'
    Wire.RD 'AUTOFD'
    Wire.WR 'INIT'
}

graphlcd wiring

This is the default wiring used by the graphlcd plugin.

Display T6963-240x128 {
    Driver  'T6963'
    Port    '/dev/parport0'
    Size    '240x128'
    Font    '6x8'
    Wire.CE 'AUTOFD'
    Wire.CD 'INIT'
    Wire.RD 'SLCTIN'
    Wire.WR 'STROBE'
}

Wiring:

My TLC1091 display has 20 pins, the last two (pin 19 and pin 20) are not connected. Power (+5V) must be supplied via pin 2(GND) and pin 3(+5V), be careful not to change polarity, you will destroy your display! Pin 4 is used to control the contrast, it needs a negative voltage of about -7V. To create this negative voltage, I used a DC/DC converter (NMA1212) and a potentiometer (10k) between GND and -12V, and connect pin 4 to the slider.

The wiring configuration uses abstract signal names (e.g. STROBE) instead of pin numbers on the parallel port. So here's a translation table:

PinNameI/O
1STROBEOut
2DB0I/O
3DB1I/O
4DB2I/O
5DB3I/O
6DB4I/O
7DB5I/O
8DB6I/O
9DB7I/O
10ACKIn
11BUSYIn
12PAPEROUTIn
13SELECTIn
14AUTOFDOut
15ERRORIn
16INITOut
17SLCTINOut
18-25GNDn/a

My TLC1091 display has 20 pins, the last two (pin 19 and pin 20) are not connected:

PinNameComment
1FGNDFrame Ground
2GNDGround
3VCC+5V
4VEEnegative contrast voltage (about -7V)
5WRData Write
6RDData Read
7CEChip Enable
8CDCommand/Data
9N/Cnot connected
10RESETreset the display
11DB0Data Bit 0
12DB1Data Bit 1
13DB2Data Bit 2
14DB3Data Bit 3
15DB4Data Bit 4
16DB5Data Bit 5
17DB6Data Bit 6
18DB7Data Bit 7
19N/Cnot connected
20N/Cnot connected

Now for the wiring details:


GPO's:

As the T6963 needs all four control signals of the parallel port, it is not possible (at least not in a simple way) to connect an additional circuit for GPO's.


Timing:

As I said above, the T6963 is quite timing-critial, especially the low-level timing on the parallel port. In the past, we tried to use worst-case values, as the timings differ from datasheet to datasheet. But this did not always work, some displays really need smaller values…

So I decided to make the timings configurable. That's what the Timing section in the lcd4linux.conf is for. Note that under normal circumstances you won't need such a section, lcd4linux uses default values which should work with most displays.

You should consult the datasheet of your display before messing around with these values!

To make it easier to play with the timing values, I invented a fuzz factor, which modifies all other timing values. This factor is interpreted as a percentage, with a default of 100% (meaning no modification). If you specify a fuzz factor of 150, this leads to all timings being multiplied by 1.5.

NameDescriptionDefaultUnit
ACCAccess Time150ns
OHOutput Hold Time50ns
PWCE, RD, WR Pulse Width80ns
DHData Hold Time40ns
CDSC/D Setup Time100ns

Sample Timing Section:

 Timing {
    fuzz   120
    ACC    150  
    OH      50 
    PW      80  
    DH      40  
    CDS    100  
 }

Schematic:

I built a little interface board to my TLC1091 display. It consists of a stabilized voltage regulator to create the +5V, a DC/DC converter to get the negative contrast voltage, a potentiometer to control the contrast (supplied with -12V) and a connector to the parallel port. The whole board needs +12V supply voltage. Here's the schematic and board (designed with eagle):