problems reading from the parallel port's control register

Hi, I'm trying to build a simple 8-bit input/output interface via the PC parallel port. I've seen lots of sample code and schematics from books
and on the web, but I'm having trouble getting it to work for myself.
8-bit output and the 5-bits of input via the status register work fine, but I've been totally unable to read anything via the control register.
This is essentially what I'm doing:
#define BASE 0x378 // printer port base address #define STATUS BASE+1 // status port #define CONTROL BASE+2 // control port
//output 8 bits to data lines 0-7 outb(value,BASE);
//prepare control port for input outb(inb(CONTROL) || 0x0f, CONTROL); input1 = inb(STATUS); //input 5 bits input2 = inb(CONTROL); //input 4 bits
I can see the bits changing on the status line as I switch pins (10-13,15) from high to low, but I don't ever see changes from the control pins (1,14,16,17) no matter what I do.
I've double checked my connections and they seem fine, and I've tried this on two different machines with the exact same results. Both machines are running Linux 2.4.20. I suppose the next step would be testing with a windows box, but I don't really want to risk damaging my wife's machine.
Does anyone know if I need a particular parallel port kernel module or need to set some setting in linux somewhere? Or am I missing something else somewhere?
Thanks, William
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
snipped-for-privacy@qwest.net (William Schumacher) wrote in message

You're not gonna be able to read anything from the control register. It is a write register, with four _outputs_. If you need more inputs, and your port is bidirectional, you can configure the data port as input instead of output. But the control port is always output, and the status port is always input.
John Kasunich
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
John Kasunich wrote:

--------------- Not true, the SPP control register outputs are open-collector outputs with read-back input paths attached. The exception would be parallel ports that are being unfaithfully emulated by defectively designed multi-I/O chips. First write 40H to the control port, then attach grounding switches to short the control pins 1, 14, 16, 17 to ground, which is pins 18-25, and you will be able to pull them LO from their pre-set HI state and read it on parallel port address base+2.
-Steve
--
-Steve Walz snipped-for-privacy@armory.com ftp://ftp.armory.com/pub/user/rstevew
Electronics Site!! 1000's of Files and Dirs!! With Schematics Galore!!
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
snipped-for-privacy@yahoo.com (John Kasunich) wrote in message

That's what I seem to be seeing anyway... I have a book here called 'Controlling the World with your PC' by Paul Bergsman that says you can use the 4 control pins on the parallel port for input if you force them high first. Here is a site that says the same thing: http://www.gmonline.demon.co.uk/cscene/CS4/CS4-02.html
"What I did not mention about the Control Port (other than having four outputs) is that they are bi-directional. They can be outputs and inputs! Dont you just love how confusing they can get?"
I can't seem to do anything of the sort though.
Thanks, William
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
William Schumacher wrote:

------------ Also, you will have to set the system I/O permissions in Linux to permit this!!! Whereas Windows 9x etc allows it, Linux does not do so automagically.
-Steve
--
-Steve Walz snipped-for-privacy@armory.com ftp://ftp.armory.com/pub/user/rstevew
Electronics Site!! 1000's of Files and Dirs!! With Schematics Galore!!
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.