PDA

View Full Version : parallel12 for PCI



Ray
12-21-2010, 09:41 PM
I'm interested in developing a Vixen parallel12 plugin that works with PCI parallel cards.

Background: could get no signals on parallel cables with parallel12 plugin when I used a PCI parallel card. The parallel12 plugin had the ability to change addresses from legacy ones like 378h so I put in PCI addresses like D000 but of course that made no difference (D000 is not an ISA address) and I got no output on the parallel cables.

Why was this happening?

So I: looked into the parallel12 plugin source, the actual input/output is just wrapper functions around the
functions in inpout32.dll from logix4U.net. In fact the code is just the standard

[DllImport("inpout32", EntryPoint = "Inp32")]
private static extern short In(ushort port);

[DllImport("inpout32", EntryPoint = "Out32")]
private static extern void Out(ushort port, short data);

But logix4U developed inp32 and out32 for ISA or legacy parallel ports. It was to get around the higher security requirements of winXP & later that block parallel port access In win98,Me etc one can directly access the ports but not so in winXp. Try it and you get "privlegeded instructions" errors.
But that is all it does. It was never constructed to enable working with PCI parallel ports.

I asked the people at logix4u,
"Anyway to convince you to include support for PCI parallel cards in iopout32.dll?"

Their response was,
"Unfortunately no. It is very difficult if not impossible. Sorry that I'm unable to help you."

Yet. In modern computers about the only way to get parallel ports is with a PCI card. So if anyone in the
future wants to use the parallel12 plugin they will face problems. So this is a need for the future.


That's the background. Someone told me the simple595 plugin works with PCI parallel in winXP. So how is
it done? Any help would be appreciated.

Is there perhaps another dll around somewhere for PCI parallel I/O functions? Or is it just a question of knocking down
the winXP,vista privlege levels temporarily.

Wouldn't it reduce response time if one had to bounce back and forth between ring0 and ring3 everytime one had to output
Vixen light on/off sequences? Is there something I'm missing?

Ray
12-23-2010, 04:09 AM
Found out that in modern programs one is no longer supposed to do the portin, port out stuff as in the parallel12 plugin. Which is why winXP did away with it, allowing it only for kernel mode drivers (ring0 to windoz gurus). So maybe the wrapping of the parallel12 plugin around this port work is the problem. Supposedly one is to use createFile(LPT1 ...) and writeFile to do port output. Or the visa functions from National Instrument. So maybe that is what they did in the 595 plugin that everybody swears works with PCI parallel on winXp and above)

However, with further research I think part of the problem is my PCI card only supports EPP. There is no SPP. From what I've found out about EPP it looks like you have to initialize the port before use, by sending 00000100 to the control register (base+2) which the old parallel12 plugin doesn't do.

Also it looks like EPP will timeout if it doesn't get a signal back on the Acknowledge line (pin 10) after 10 usec. And with no device to send anything back to the port that will quickly happen and the port will freeze. So one is supposed to clear the timeout by reading the Status register (base+1) periodically.

So a parallel12 or even parallel8 plugin will have to accomodate these quirks of different PCI card types if it is to work on everyone's PCI cards.

dirknerkle
12-23-2010, 09:37 AM
Personally I think time would be better spent on something other than older technology.

Entropy
12-23-2010, 10:58 AM
Yeah, parallel is basically dead. For a while developing new USB devices was difficult, but with the advent of USB microcontrollers and USB modules like the FT245, USB is the way to go for smaller installations in the future.

(People are starting to move to Ethernet for larger installations.)