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