TiniLCD

One of the first things I wanted to do with my TINI was to connect a simple LCD module to be able to display some simple text on it. I had some difficulties when connecting the LCD to the TINI and therefore I wrote my own LCD class instead of using the built in LCDPort, mainly because I felt I needed full control of everything to eliminate all problems. The result became TiniLCD. The hardware haven't changed since the first construction but I have tried a couple of different ways of connecting a LCD to the TINI. There is more information on this here. The software have not changed very much either. Instead I have written some applications that utilize the TiniLCD class, e.g. a servlet that makes it possible to write text on the display through a web browser. I have used it as a remote PostIt note. At work I remember something I have to do or not forget to do when I get home. As the display is at home I can put a small reminder on it through a web browser.

IMPORTANT NOTE: The reason why I created the LCD class when the TINI already has a LCDPort Class is that I could not make it work with my first construction. By creating my own class I had controll of each step and could make it work. After I got it working I have made constructions that works with the LCDPort, see this page.

TiniLCD Java Class
TiniLCD is a Java Class for writing text on a HD44870 driven LCD connected to the TINI .

V0.3 - 00-10-07
found out that V0.2 does not work with LCD with 4 lines. He made some changes to the code so it works. Benoit also recommends this LCD FAQ.
LCD.java - The LCD class
lcdTester.java - A small test and demo application using the LCD class.

V0.2 - 00-08-30
This source code has not been tested much, but should now have support for different memory addresses where the LCD is mapped and also different formats.
LCD.java - The LCD class
lcdTester.java - A small test and demo application using the LCD class.

V0.1 - 00-07-01
This is the very first version of the code only update to work with OS1.01. It is reliable and has been tested over some months without any major problems.
LCD.java - The LCD class
lcdTester.java - A small test and demo application using the LCD class.

Some notes on how to make the LCD.java class to work on different constructions.
Depending on the hardware the LCD.java class may not work directly. My initial hardware used a different way to generate the enable signal(using A3, A19, PCE0)then in Chris Fox(actually CE3 changed to PCE0) drawing he sent out on the TINI mailing list a long time ago. TiniLCD uses therefore another address to write data to the LCD.

In Chris Fox drawing _CE3, A19 and _WR are used for E. In my construction, for which my code works, I have changed _CE3 to _PCE0 because I couldn't control the CE3 in the earliest release of the DataPort class. Therefore my code use use another default address. Though the constructor public LCD(int lines, int width, int adress) lets you define where in the address space the LCD is connected. If you use Chris drawing directley as it is you should use the address 0x00380002 and if you use the logic as describe in the TINI schematics, use .

A short note on how to calculate which address to use
There is no difference in use of A3 between any construction, it is used to select if either writing commands or data to the LCD.

On the Rev A boards A3 is used to select if either commands or data is written to the LCD. _ENWR2 is inverted and then used for E(Enable signal). _ENWR2 is generated in the Parallel Port Control hardware, generated by A0, A1, _SEL0 and _WR. _SEL0 is generated by A5,A6,A7, A16, A19 and _CE3 in the Chip Select decoder.

A23 is used to either select Peripheral CE or not, as can be seen in the Java Docs for DataPort:
"CE address space spans from 0 - 4MB. 0x00000000 - 0x003FFFFF PCE address space spans from 8MB - 12MB. 0x00800000 - 0x00BFFFFF"

A5, A6, A7 together with A16 and A19 are used to generate _SEL0 which will go low when A5, A6, A7 and A16 are low and A19 high. See the chip select decoder in the drawings for Rev A.

A0 low and A1 high with _SEL0 low will drop _ENWR2 low and thus through the inverter pull E high on the LCD.

Therefor the following addresses should be used.

A23<------------------------------>A0
0011 1XX0 XXXX XXXX 000X 0X10 = 0x00380002, Write strobes only, LCD Control Write
0011 1XX0 XXXX XXXX 000X 1X10 = 0x0038000A, Write strobes only, LCD Data Write

More on memory addresses can be found in this text that Chris has sent out on the list.

Things to do:

Nothing is planned but please send comments.

Back to TINI at DreamFabric

Last updated 2001-03-20 by Karl-Petter Åkesson