Member • Oct 16, 2006
PC Tutorial: Parallel Port Interfacing Techniques - Part 2
PC Parallel Port Interfacing Techniques - Part 2
Introduction
In this tutorial we will flash a LED (Light Emitting Diode) connected to your printer port socket. Reading the #-Link-Snipped-# is recommended to get a general idea what you are upto.
Connections
To connect a LED to your port first you have to know what it looks like. Here are the two most common connectors that you can have.
Pin Layout:
The LED
Shown below is a very common LED found anywhere from toys to computers. To connect, insert the positive pin into Pin number 2 of your port. And the negative to any ground of your connector. Pin 19 is an easy reach.
In the above image the longer pin is positive and the shorter one is negative (ground). If you have a LED looking like the left one then you have to find out yourself which one is +/- by connecting it to a battery. I would recommend a 220ohm or 470ohm resistor in series with the LED. Mine worked without the resistor but I cannot promise anyone!
Ok after you finish this setup, it is now time to test the light! See if you have really found out the correct address by following the #-Link-Snipped-# then download #-Link-Snipped-#( #-Link-Snipped-#)** to have real-time control over your Port to test the light.
Open the executable; you should see a blue screen with port addresses, pins and their description. Choose the address where you have connected the port wire, and click on PIN 2 (Data 0) (there should be a cross on it now). Look at the LED, it must glow. If it does not glow then try different Port addresses, LPT1, LPT2 etc.
Programming the Parallel Port in C, C++, VB or Java with âWindows the great XPâ is not easy since it does not allow you to access the Ports directly. All hardware is virtualised. I somehow have a feeling programming in VB is easier. Very basic LED flashing is also easy through Assembly Language. Iâll look into this problem and post a tutorial soon.
Dont hesitate, ask me if you have trouble with anything!!! Writing a tutorial from scratch is not easy so please donât mind random grammar mistakes 😀
Some Useful links:
Parallel port output : A very detailed look into the Port basics and programming.
#-Link-Snipped-# : Excellent for explanation on Win NT/XP programming.
#-Link-Snipped-# : The Debug program to test your parallel port with LED