Low cost LCD over LPT
Using of low-cost LCD (liquid crystal displays) in embedded world is a popular topic. Many years ago I was faced with problem of constructing device with simple output to seven segments numerical display. In final solution was used eight digit LCD panel controlled by special LCD controller namely HT1621B. I was not very happy because of cost of solution was near $10 and was competitive.
Recently during visit on electronic component shop I find $3 LCD (model TIC8148) and bought it. Little search in Internet provide information that this device is LCD with chip on glass (COG) or in other words: displays with build on controller. Detailed investigation of short datasheet was finished without clear understanding how to use TIC8148. There was only hint at used type of COG namely ML1001 (referenced as LCD Driver, see Picture 1.).

Pic. 1.– TIC8148: LCD with COG.
Specification for this LCD controller was more informative and complement to specification document for TIC8148. The ML1001 is shifter register with 40 outputs lines to drive 40 LCD segments and can be cascaded to drive 80 and 120 segments. Accordingly TIC8148 consists of two LCD drivers and have internal structure similar to shown in the Picture 2.
Inputs and outputs of COG are mapped to TIC8148. There is short description of them:
-
1.VDD – positive power supply in range 2..6V;
2.GND – ground;
3.LOAD – register latch pulse (state of 80 LCD segments);
4.DIN – serial input to load data;
5.DCLK – serial data clock;
6.CHK – check output (usually not used).
Input data are clocked on rising edge of DCLK and after 80 clock pulses should be applied rising edge on LOAD line to latch and to output received data chunk.

Pic. 3. – TIC8148 segments numbering.
TIC8148 have only 72 segments for output. So outputs of ML1001 from #73 to #80 are not connected. The naming scheme for LCD segments is shown on Picture 1. The digits places are numbered from the left to the right from #1 to #8. Each digits requires 9 bits. There are usual 7-segment digit (A, B, C, D, E, F, G segments) followed with dot (P segment) and additional “V”-symbol (H-segment).
To COG shift register data are clocked most significant bit (MSB) first. This means segment 80 should be first in data chunk and segment #1 should be the last. During transferring the first part of data is dummy byte (segments from #73 to #80 not connected) followed by other 72 real data bits. You can refer to table below to see the mapping scheme of data bits to segments of TIC8148.

Table 1. – TIC8148 segments mapping.
Simple C# example of application of TIC8148. To build simple application of TIC8148 was chosen parallel port of personal computer. I managed to use 4 lines of LPT port to power and control LCD with COG. Picture 4 provides circuit diagram.
Description of circuit diagram.
Often output buffer of PC parallel port can drive TIC8148 directly. I recommend to use buffer when distance between parallel port and LCD is longer than 20 centimeters. In many cases output buffers of PC LPT port capable to provide power supply to external load like LCD with COG. Both TIC8148 and 74HC244 can work in range 2..6V. So there is no need to adjust signal levels. Line D2 of parallel port provides DC supply to 3.3V stabilizer. Scheme can be powered from external source. Diode VD1 protects LPT port from damage in case of external power supply. 74HC244 buffer repeats input levels and drives LCD. Lines D0, D4, D5 are mapped to LOAD, DCLK and DIN.
Picture 5 shows screenshot of simple C# Windows application while picture 6 provides a photo of working prototype. It outputs PC time to TIC8148.

Pic. 5. – Screenshot of Windows TIC8148 application.

Pic. 6 – Working prototype
Code description
Windows provides no libraries to work directly with parallel port. To control LPT output lines was selected third party inpout32.dll. It provides one methods to write data to port and other one to read it. In Appendix you can find example of access to library methods.
Appendix B lists source code of main routine. When Windows Application catches event from Timer1 it read current PC Time and convert it to decimal data.
Mapping of received data to LCD is not very tricky. The data of for representation on 8 digit LCD display are mapped to 8 byte vector. To simplify handling of this vector was used conversion table named “hex2digits” with 16 entries. Each entry links hexadecimal number in range 0x0…0xF to LCD mask for one digit place. As was mentioned above the digit place should be represented by 9 bits (7 segments for digit , 1 segment for “V” segment and 1 segment for dot). To eliminate some difficult conversions the whole 80 bit chunk supposed to have the following structure:
1)1 Dummy byte (Segments #80..#73)
2)8 Digit mask (LCD data byte + dot)
I such case simple table conversation allows to get desired output.
Appendix A
(import of library function for PC port access)
using System;
using System.Runtime.InteropServices;
using System.Threading;
public class PortAccess
{
[DllImport("inpout32.dll", EntryPoint="Out32")]
public static extern void Output(int adress, int value);
[DllImport("inpout32.dll", EntryPoint="Inp32")]
public static extern int Input( int adress);
}
Appendix B
(main module to output data over PC parallel port to LCD)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace TIC8148
{
public partial class Form1 : Form
{
The entire code on Download - TIC8148_LPT.pdf.
- andri_ym's blog
- 2174 reads







Very interesting
Thanks andri_ym for this article: it is very clear and useful, and shows how a complete project can be completed both with hardware and software solutions. I didn't find any note regarding the backlight, however. In any case, even if the LCD device is not provided with that feature, it can be added (as happens in several industrial applications) by adding one or more leds of the desidered color on the back of the display.
Post new comment