August 26, 2007

PC Parallel Port Interfacing Techniques – Part 1



Introduction

In this tutorial I will introduce the PC Parallel Port and how to identify its address for use in home electronic projects. Remember, the whole process and learning takes time but is fairly easy later on.

The LPT or Printer Port [courtesy: LadyAda,
http://www.ladyada.net/make/digg/programinterface.html]

The Parallel Port is (updated 2010) was the most commonly used port for interfacing usual devices like printers and scanners. It’s found commonly on the back of your PC as a D-Type 25 Pin female connector. Did you know it can even be used to make home projects?


LPT port Pin Out

The Line Print Terminal (LPT) port will allow input of up to 9 channels and the output of 12 channels at any given time, thus requiring minimal external circuitry to implement many simpler tasks. These outputs can act like switches in some cases or simply to light up LED’s. The inputs on other hand can act like pushbutton inputs to your PC to control software or hardware.

On the left you can see what individual pins stand for.

For your LPT to work with a printer, it uses internal software protocol for smooth communication. We won’t go into the details of this since it has about 5 different modes of communication. All we need to know is how to connect your little lights and switches to your printer port using the most basic mode!

Hardware Properties
Scroll down for the table of Pin Outs Here for clear explanation.

The output of the Parallel Port is normally TTL (Transistor-Transistor Logic). The voltage levels varies from port to port, either 5V or 12V. The current you can sink and source also varies from port to port. Most Parallel Ports can sink and source around 12mA. However these are just some of the figures taken from Data sheets. They vary quite a bit. So be careful not to overload your Printer Port.

Port Addresses

When the computer is first turned on, BIOS (Basic Input/Output System) will determine the number of ports you have and assign device labels LPT1, LPT2 & LPT3 to them. Usually the address for LPT1 is 378h.

To know your Parallel Port address, do the following on Windows XP or lower versions of windows:
Go to Start > Control Panel > System > ‘Hardware’ Tab > Click on Device Manager > Look for ‘Ports’ in the device list > Double click on LPT1 > Click on the ‘Resources’ Tab. In that you can see the starting address of I/O Range. That’s your number.

In Vista and above:
Click "Start" > Search for "Device Manager" > Look for ‘Ports’ in the device list > Double click on LPT1 > Click on the ‘Resources’ Tab. In that you can see the starting address of I/O Range.

This address called the Base Address is where you send commands to your Port to control their output or input behavior.

Please note that many new PC's do not come with an LPT port at all. They are now mostly obsolete and being replaced by the faster, newer USB ports. Interfacing a USB port is a completely different thing altogether. 


See the next tutorial to know how to program your LPT to control an LED light.

Sources:
http://www.beyondlogic.org/index.html
http://www.lvr.com/parport.htm

*The above picture has been taken from: http://www.lammertbies.nl/ Thanks a lot.

No comments: