Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!ncar!husc6!cs.utexas.edu!ut-emx!nather From: nather@ut-emx.UUCP (Ed Nather) Newsgroups: comp.sys.ibm.pc Subject: Re: Using the printer port for input Message-ID: <9439@ut-emx.UUCP> Date: 14 Jan 89 16:48:27 GMT References: <704@krafla.rhi.hi.is> <816@ttrde.UUCP> Organization: The University of Texas at Austin, Austin, Texas Lines: 26 In article <816@ttrde.UUCP>, pfales@ttrde.UUCP (Peter Fales) writes: > In article <704@krafla.rhi.hi.is>, frisk@rhi.hi.is (Fridrik Skulason) writes: > > I need to connect a set of eight switches to my PC. The most simple way > > to do it seems to be connecting them to the parallel port, and using it > > as input port instead of output. > > > > Sorry, the standard PC parallel port hardware is not capable of being > used as an input port no matter how clever your code is. > I'm glad I didn't know this when I wrote my "portfinder" routine, which finds the port name of the printer port -- you have to put a dummy plug in, which the program looks for. It does this by sending out 4-bit codes, then reading the various possible ports to see if it can find the code -- by using lines in the output port as input bits. As I recall (it's been several years) I could only input 4 bit codes, not 8 bit -- there weren't enough input lines for 8 of them. I did the input in two-nibble bytes. "`Impossible' is a challenge, not a truth." -- Ed Nather Astronomy Dept, U of Texas @ Austin