Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: Need to detect continuity between 2 terminals

by martell (Friar)
on Jan 06, 2013 at 20:59 UTC ( #1011918=note: print w/replies, xml ) Need Help??

in reply to Need to detect continuity between 2 terminals

Short answer: No

Long answer:

Those are data communication ports and not general input/output pins (gpio) as found on some devices as the raspberry pi. Those gpio can be used to detect a closed or open state. Albeit you need to be careful not to fry the chip.

As Old_Gray_Bear said: you need something bridges your input to the protocol on the serial and parallel port. There is plenty things available, but you need to go to more dedicated 'electronic' hacker forums for a good answer. From there you can probably use something like Device::SerialPort to read from the serial port.

Kind regards


  • Comment on Re: Need to detect continuity between 2 terminals

Replies are listed 'Best First'.
Re^2: Need to detect continuity between 2 terminals
by BrowserUk (Pope) on Jan 06, 2013 at 21:35 UTC
    Those are data communication ports and not general input/output pins

    I beg to differ. From the perspective of the code, a parallel port is just a set of 3 registers -- 1x8-bit (data), 1x5-bit(status), 1x4bit(control) -- that can be read and written using the appropriate (INx/OUTx) instructions.

    On modern OSs these are privileged instructions, so you do need a device driver that exposes them to application code, but given that access, when the data port is read, any of the data pins (2-9 on a db25 plug) held high will be 1; with those held low as 0.

    With an appropriate device driver, this is easily programmed under windows (I've done it). And I read on wikipedia that "On Linux, inb() and outb() can be used when a process is run as root and an ioperm() command is used to allow access to its base address; alternatively, ppdev allows shared access and can be used from userspace if the appropriate permissions are set.".

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

      I stand corrected. ;)



Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1011918]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2018-04-22 22:21 GMT
Find Nodes?
    Voting Booth?