I'm experimenting with some simple programs in C++ and am trying to figure out how to access the parallel port. Apparently Win XP doesn't allow direct access to the port. Anyone have any pointers on which drivers to use? Thanks.
I'm experimenting with some simple programs in C++ and am trying to figure out how to access the parallel port. Apparently Win XP doesn't allow direct access to the port. Anyone have any pointers on which drivers to use? Thanks.
Hi Zumba,
I think it's possibly a bit worse than just not allowing direct access, I believe WinXP polls any Parallel ports it can find, if you are connecting something to it that can move real hardware you need to be carefull that you turn this feature off in XP. There's a fix for the polling on this page 'http://www.melabs.com/support/patches.htm#filefix'.
Once you stop Windows accessing the port, you should be able to get directly to the hardware ie: the 8255 pio chip, to understand how to do this you will need to identify the particular type of io chip being used and its base io address, with these you should be able to get something working in C++.
Try inpout32.dll
http://www.logix4u.net/inpout32.htm
I've also attached a c# project I wrote that uses it for reading and flipping pport bits from a form (the port address is hard coded in Form.cs).
My front doorbell uses this library to poll the pport and play a wav file when the button is pressed.
But yes, you won't want to rely on it for driving machinery at any speed.
Good luck, have fun!
Thanks for the help guys. My programming skills are rusty but hopefully I'll be able to do it.
BTW, does anyone know what Mach uses?
I am looking for the source code for inpout32.dll if anyone can help me.
Cheers DeWayne
DeWayne
Hi there, have done extensive work with the parallel port in both WinXP and Vista, a kernel mode driver is required, the one that I have found the best is TvicPort http://www.entechtaiwan.com/dev/port/index.shtm free for non commercial use works perfectly and easy to use under any programming langauge, I'm using .net and are able to trigger events from any of the port pins, the only bad thing I have found is that as Windows is not a real time operating system, high speed events sometimes fail, as at the end of the day if the Windows kernel decides to do something else (like defrag the hard drive) your event can be delayed or missed. On the bright side I have bit bashed many 8 bit controllers like the SJA1000 CAN controller directly from the parallel port so at slower speeds talking to an 82C55 wouldn't be a problem. The TvicPort comes with kernel mode driver (no point in recreating the wheel) and an extensive help file for all programming langauge, wish you all the best!
Best regard Dave
FYI. We were also looking an Parallel control of stepper motors, and learned that if you're using a USB->Parallel port, most of the existing solutions for Bit level control will not work without finding a way to writhe your own drivers.