Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Parallel Port

1 view
Skip to first unread message

Flannan Lo

unread,
May 21, 1997, 3:00:00 AM5/21/97
to

I have a custom external hardware device which has in the past been
controlled by software in a DOS environment. I must now do so by
software run in an NT environment. The hardware device on the parallel
port is controlled via asynchronous handshaking in a custom manner,
therefore, I need to access the control, status, and data registers of
the parallel port. Also, I need to do the equivalent handshaking so that
I do not have to change any hardware or firmware on our custom device. I
want to know if Windows NT has the equivalent of, or access to the
equivalent of, the old data, control, and status registers of a parallel
port.

I am currently studying the MSDN NT DDK and the software samples that go
with it. Of specific interest are the PARPORT.C and the PARSIMP.C files.
As I look through the code I do not see any evidence of a handshaking
capability with the parallel port. Is it possible? If so, how can this
be done? Is there any sample code out there? Anything that uses the *.c
drivers mentioned above?

Thanks in advance.

John

unread,
May 21, 1997, 3:00:00 AM5/21/97
to

I needed to do something like what you describe and used the intpar
example as my starting point. It's an interrupt-driven non-layered
driver that you substitute for parport. It has a lot of printer stuff
in it that you probably end up throwing away, but under it all is all
the stuff you need to take interrupts and talk to the i/o registers.

Paul Sanders

unread,
May 22, 1997, 3:00:00 AM5/22/97
to

Is your 'external hardware device' a dongle? If so, are you going to run
your old DOS code or write new Win32 code. If you are using the old DOS
code, then under NT 4.0 with service pack 2 or greater Microsoft added
dongle support in the form of parvdm.sys. In other words, just run your
DOS code. If you are writing Win32 code then go to the next paragraph.

Will you be sharing the parallel port with a printer and your device?? If
not, disable all of the parallel port drivers (parport.sys, parclass.sys)
and take exclusive ownership of the port. At this point, use
\ddk\src\general\portio as your boilerplate.

If you must share with a printer, then you must write a parallel class
driver in order to do this. I don't know about the handshaking so you
might have to tweak the driver in order to enable this. I don't know if
anything more than a simple tweak is required.

-Paul

Flannan Lo <flann...@dreo.dnd.ca> wrote in article
<338353...@dreo.dnd.ca>...

Scott Chicoine

unread,
May 28, 1997, 3:00:00 AM5/28/97
to

Sounds to me like you need your own parallel "class" driver. My
recommendation would be to study the PARCLASS source from the DDK. It's
the code for the standard parallel class driver used for common
Centronics-style output to printers and is the driver used by the system
whenever you CreateFile() on LPTx.

PARPORT itself is only a contention handler, and is not intended to be
replaced, nor should there be a need to replace it. Parallel class drivers
cooperate for ownership of the port hardware through PARPORT. PARCLASS and
PARSIMP show how this negotiation for port ownership is performed. Once a
class driver owns the port, it can perform whatever operations on the
hardware it needs to.

The code for PARCLASS is somewhat convoluted, but don't get discouraged. A
lot of code in there is specific to printer handshaking and timing issues
and can pulled out if you use it as a basis for your own driver.

Hope this helps.

0 new messages