Stadi's software page

A magyar változat megtekintéséhez kattints ide

lcdconsole: demo console application for the parport unit

This application shows you how to use the parport unit through an example of driving an LCD display connected to the LPT port.

Hardware

Connect the LCD display to the computer according to this table:

LCD displayLPT port
E1
D02
D13
D24
D35
D46
D57
D68
D79
R/S16
R/WGND

Check the pinout of the display in its datasheet. The demo application only works with HD44780-compatible displays, in 8-bit mode.

Compiling the demo

To compile the demo application you need the console unit (see the Downloads section). The demo can be compiled to use either the old-school port access method or the parport unit. So you can see how little modification is needed for an existing code to take advantage of the Windows API for parallel port access. The two ways of compiling the demo are shown below.

Compiling with the parport unit

The downloadable source is set up to use the parport unit. To compile the demo, put parport.pas into its directory or add the folder of that unit to the Search Path.

Compiling with old-school port access

If you don't want to use the parport unit, remove {$DEFINE API_CALLS} from the source before compiling.

Running the demo

If the demo was compiled with the parport unit you do not need any other application, driver or DLL to run it. On the contrary, you need a kernel mode I/O driver (for Windows 2000 and XP) and the io.dll (for Windows 9x, 2000 and XP) if the demo was compiled with old-school port access. (See the Downloads section for details.)

Starting the demo:

lcdconsole <port>

If you compiled the demo with the parport unit and want to use LPTx, replace port parameter with x. See the Device Manager to check which parallel ports are installed in the computer.

If you compiled the demo with the old-school port access, the port parameter should be the decimal value of the base address of LPTx. The standard values are 888 (=378h) for LPT1, 632 for LPT2 (=278h) and 956 (=3BCh) for LPT3.

Right after the startup the demo shows a test message on the LCD, then waits for keys and displays the typed characters. If you press ENTER, the following characters will be displayed in the second row of the LCD, starting at the first column. Hit ESC any time to quit.

Conditions of usage

I take no responsibility for any damage that is caused by using the lcdconsole demo. You can only use this application on your own responsibility, providing that you fully understood the previous sentence. The usage and modification of this demo is allowed free of charge for everyone.

Downloads

console unit - put it into the folder of the demo application
io.dll* - put it into the folder of the demo or into C:\WINDOWS\SYSTEM32 on Windows 2000 and XP esetén or into C:\WINDOWS\SYSTEM on Windows 9x
kernel mode I/O driver* - you just have to run this one
parport.pas - the parport unit
lcdconsole.dpr - the demo application

*: you do not need these if the demo is compiled with the parport unit

Contact info

Bug reports, advices and "thank you"s :) can be sent to this e-mail address:

stadi at stadi dot hu