Hello,
I am trying to set up a simple digital data acquisition via the parallel port. The idea is to sample the inputs at regular intervals. The problem here is the word “regular”. The application calls for hardware timed data acquisition.
At first glance this sounds like a case for inpout32.dll and using the inp32 function. However, this would be a software timed data acquisition: I have only very little control over exactly when the data are read from the port.
My idea is to make use of ECP and the DMA capabilities of the port.
See for example here:
http://www.beyondlogic.org/ecp/ecp.htm
The handshake is easy to fake. And the PeriphCLK pin would simply be conntected to a constant clock at 10kHz. This would make the port read the data at 10kHz and the DMA would take care to copy the data into memory. I could be certain that the data are sampled with no jitter.
This is the idea. The problem is how to get it to work.
At first I thought of using CreateFile to open the port and then ReadFile to read from it. The problem however is that ReadFile does not work with the parallel port. Apparently, parport.sys has not implemented this functionality.
Then I searched the Internet high and low and the best I could find was the use of inpout32.dll and similar libraries which do not help or the recommendation to use ReadFile which does not work. Alternatively, there are a few rather expensive realtime solutions which seem to be way overpriced for the simple thing I want to do.
Isn’t there a standard solution for reading data from the parallel port? How do scanner drivers do it? They also have to transmit large amounts of data via the parallel interface, surely there is a solution for that?
The system runs WindowsXP and this would be for c/c++.
Thanks in advance for any help you can provide.
Marcus