Controlling the PC Parallel Port


Posted on Jun 2, 2012

This source code module provides the low-level control of the port, implementing code to control 12 outputs and read 5 inputs. This code was written for Borland C/C++ v3.1, but you should be able to adapt it for other compilers. You can view the source code online, or download an archive (prn_io.zip) that contains PRN_IO.C and PRN_IO.H. To use the module in your program, simply #include PRN_IO.H from wherever you need to call the functions, and compile and link PRN_IO.C into your program.



The code is written to use LPT1 at 0x0378; change it if you need to The code doesn't attempt to use interrupts The parallel port is also capable of enhanced modes (see the links below), but this code doesn't attempt to use them This code assumes that the port is configured as a "standard" or "normal" port; configuring the port for EPP or ECP modes may or may not work




Leave Comment

characters left:

New Circuits

.

 


Popular Circuits

Digital capacitance meter
Window Comparator Circuit
How Discrete Voltage Regulator with Current Limiter Works
Guitar Effects & JFET Splitter
When using the lamp base circuit delay circuit 2



Top