I am not the person who sent that code to you, but a while back (maybe 6 months ago) someone posted a URL on the list where you could find info on how to access the parallel port in EPP and ECP modes. This is not the straight bidirectional mode you are trying, but it might work better. Maybe if you use the archive you can find this post. If not, email me and I will send you the files directly. Good luck, Sean mailto:shb7@cornell.edu On Fri, 26 Jun 1998, Brian Clewer wrote: > Hey sorry I didn't catch your name, but you wrote:) > > >There is a bit in the control register that controls the direction of the > data lines in ECP > >and PS2 modes. If bit 5 of the control register (base address +2) is set > to 1, the data > >lines are set to inputs....... > > Thankyou for your code to set the port to inputs. However I still can't > get the port to work! I do have a program that monitors the data line on > the port and this seems to work properly. I have designed a program to > read the base address of the port plus the next two addresses for the > port > on a re-boot of my PC and then again while the 'port program' was running > and again when the port program had ended (it turns the port to an output > again at the end). > > Here are the results:) > On boot up: > Base address ( 0x378) = 7F04 > Base +1 (0x379) = CC7F > Base +2 (0x37A) = CCCC > > While the LPT program was running:) > Base address ( 0x378) = 7FFF > Base +1 (0x379) = E37F > Base +2 (0x37A) = E3E3 > > After the LPT program:) > Base address ( 0x378) = 7F04 > Base +1 (0x379) = DC7F > Base +2 (0x37A) = DCDC > > Now, If I run the LPT program and it exits properly (it has now set all > bits on the port to outputs) I can run my 'C' program and read the port > correctly but, if I just reboot my PC and try to read the port, it does > not > work. I have set the three registers to 7FFF for the base address, and > E37F for Base + 1 and E3E3 for base + 3. My only guess now is that the > LPT program does more than setting up these three registers. Can anybody > tell me exactly what is needed (step by step) to initialize the parallel > port? > > Thanks, > Brian. >