In message <[EMAIL PROTECTED]> David Miller 
writes:
: Anyone know of a way to get a low cost port of some kind to to simple
: state change detection?  The specific purpose is to time external events
: which are triggered by breaking an LED light beam.  Millisecond resolution
: would be fine.
: 
: I was thinking of sampling the parallel port repeatedly and looking for
: data lines to be high or low.  Feasible?

If you have only 1 source, then you can use the ack line of the
parallel port and the ppi driver to get timestamped events.  If you
have more than one, then you might be able to wire a simple latch to
the ACK line and sample of to 8 sources.  That's trickier as their's
some hair in converting the signals to pulses, worrying about races,
etc.  1 source gives you nanosecond resolution (but only ms accuracy
due to interrupt latencies, us if you hack it to be a fast interrupt).
N sources gets dicier, and I don't even want to think about it.

You likely could also create a driver similar to the ppi driver that
polled the parallel port every tick.  This would give you approx 10ms
accuracy and resolution, assuming that HZ is 100.  Not sure how far
you could push this technique.

Warner


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to