Control Lines of the Printer Port
-
I can use the 8 data lines of this port OK, but when it comes to using the other 4 output lines on the control section of the port I have no luck. I keep getting 0x0C back when I read these lines (no matter what I set it to):- Note Using PortTalk for Windows 2000:
Code: int ReadPortLPT1C(void) { int value = inportb(0x37a); return value; } void WritePortLPT1C(int newData) { outp(0x37a, newData); }
As I said it works fine for the data lines (8) at address 0x0378. -
I can use the 8 data lines of this port OK, but when it comes to using the other 4 output lines on the control section of the port I have no luck. I keep getting 0x0C back when I read these lines (no matter what I set it to):- Note Using PortTalk for Windows 2000:
Code: int ReadPortLPT1C(void) { int value = inportb(0x37a); return value; } void WritePortLPT1C(int newData) { outp(0x37a, newData); }
As I said it works fine for the data lines (8) at address 0x0378.The control port on your PC may be a write only port and reading back the data from it would not be valid. You should check the lines with a scope and verify if they are toggling. If you ultimately require more read lines for your project you can add a latch circuit and use one of the control lines to swap your other signals to read from the 8 data lines.
-
The control port on your PC may be a write only port and reading back the data from it would not be valid. You should check the lines with a scope and verify if they are toggling. If you ultimately require more read lines for your project you can add a latch circuit and use one of the control lines to swap your other signals to read from the 8 data lines.
or.......... purchase a digital IO card and leave the built-in parallel port alone :rolleyes: http://www.accesio.com/go.cgi?p=../digital/digital.html&s=o[^]