Everything for Electronics

Tech Forum





February 2018

Legacy Printer Port (LPT1)

I’m doing some work with legacy computer equipment and have written Basic software to control time and temperature in a high temperature kiln. I’ve used an old Compaq laptop (LTE Elite 4/40CX). I use the COM 1 port to control temperature and the LPT1 port to cycle the kiln on/off via an SCR.

Everything works great. I’m able to toggle the printer port pins via OUT commands. When trying other legacy computers, everything works except the printer ports don't respond to the OUT commands and remain in a high state. However, they DO operate the dot matrix printer indicating they are functional. My question is how do I gain control of some of the data pins and be able to toggle them high and low?

#2181
Jerry Sobel, R.Ph.
Las Vegas, NV



Answers

Very old Legacy computers used different physical addresses for the LPT port. Try some of the other addresses. The most common ones:

  • Logical parallel port 1: I/O port 0x3BC, IRQ 7 (usually in monochrome graphics adapters)
  • Logical parallel port 2: I/O port 0x378, IRQ 7 (Addon I/O cards or using a controller built into the mainboard)
  • Logical parallel port 3: I/O port 0x278, IRQ 5 (Addon I/O cards or using a controller built into the mainboard)

Note: More modern computers can require interrogating the OS or an interrupt call. Also a device driver may be required.

Steve
East Hartford, CT

This is great! The humble printer port lives! Here’s my guess as to what is happening in your situation.

You are using the OUT command and the syntax is OUT Port#, Data where Port# is the address of the parallel port, typically &H3BC, &H378 or &H278. You need to find the address for your particular configuration. In the older machines, the Parallel Port was on a separate plug-in card and there should be jumpers on the card for setting the address.

The reason why the dot matrix printer works is because the print routine in use calls for the data to be sent to LPT1: instead of the port address. The computer’s BIOS translates the LPT1: to your port’s address. You are bypassing this function by going directly to the port via the OUT command. You should be able to go into the PC’s BIOS setup and find the port address assigned to LPT1:, then use that address in your OUT command.

Or open up the PC, find the parallel port setup jumpers and set them so the port address matches the address on your Compaq. Note that if you do change the card’s address, you’ll probably have to go into the BIOS and make the change there too.

May I suggest getting hold of the book Parallel Port Complete by Jan Axelson? A veritable boatload of information, including an example program for identifying what ports are installed in Chapter 4.

Jerry McCarty
Jackson, MI

Do a Google search for partester by Kellyware (freeware). The information displayed and ability to toggle the outputs will give you the troubleshooting information you need. The program was created in support of the CNC program Kcam that uses the parallel port to control these machines.

Steve Benson
New Castle, IN

Depending on your computer, LPT1 may have one of two addresses. LPT1= 03BC hex, DATABYTE 956, STATUSBYTE 957, CONTROLBYTE 958 or LPT1= 0378 hex, DATABYTE 888, STATUSBYTE 889, CONTROLBYTE 890. Whichever one you are using, try the other one.

Dave Hogan
N Palm Beach FL

I would check the printer port settings in the BIOS. The LPT port should be set up for bi-directional communication. “Standard parallel” will not work. ECP should work. Different BIOSs have different options for the port settings. P. S. My dad and my brother were both pharmacists.

Bob Kottas
Omaha, NE

There are 3 types of printer ports for PCs, Standard, EPP and EC. Check out the Wikipedia article at https://en.wikipedia.org/wiki/Parallel_port There may be an issue with LPT1 not being at the address expected, see the Interfaces and Access sections. It may also be possible to use one of the DSR or DTR lines from the serial port to control the SCR.

Philip Martel
Salem, NH

Although the early BASIC language gave instructions for direct access to hardware such as LPT and COM ports, operating system and BIOS variations can interfere and limit direct control.

For an excellent source of parallel-port information, get a copy of the 2006 edition of Jan Axelson’s book, Parallel Port Complete. You’ll find much helpful information therein. Also find guidance here: [url=http://retired.beyondlogic.org/spp/parallel.htm]http://retired.beyondlogic.org/spp/parallel.htm[/url].

Jon Titus
Herriman, UT

Many eons ago I did something similar, using 80286 vintage computers to control a weather station via LPT1. The BASIC routine needed to know the address of the LPT port, which on my machines was always 888 (decimal). I do remember that Compaq machines used a different address, but unfortunately I can’t recall what it was.

I suggest you consider migrating your control system to an Arduino or Raspberry Pi platform. I have done this myself, and never looked back. The new boards are so much smaller, cheaper, less power hungry, more user friendly from the standpoint of hardware control, and there is exhaustive online support.

There is no need to buy a chip programmer or use assembly language. I have not been so excited about electronics since discovering solderless prototpying and integrated circuits 30 years ago.

Steve Turner
Labadie, MO