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

Op Amp Power Driver
Simple Sine-Wave Generator Circuit
DOD Phasor 595
Audio Tube Preamplifier Circuit 6DJ8 / ECC88 SRPP
Solar Cell Voltage Regulator
Monitoring Voltages with Scaling Circuits
Pushbutton Relay Selector
Motorola TPN1154 and TPN1136 Desktop Power Supplies
Universal adder 741 1458 schematic
A simple bedside lamp delay circuit



Top