Ian Leonard wrote:
> Could you not just wait for a few ms (maybe quite a few) and then test
> the input to make sure it's valid?
Yes, what I did was created a device driver that "times" the closure of
the relay. It is based on a software downcounter. I preset the counter
to 80, test the relay every millisecond, if the relay is active, I drop
the counter by one, if the relay is inactive, I preset the counter back
to 80.. When I ultimately drop the counter to zero, then I set a flag
that says "relay active". It depends on the relay as to how long the
contacts will bounce before you get a stable state on them, but 80
milliseconds is a generous amount of time.
I have a different hardware platform than the uCsimm and can use the GP
Timer for my own purposes (other than jiffies), you could tap into the
SAM timer output / interrupt and use that to drive your timebase. There
is a 512HZ tap...
-- Tom Walsh - WN3L - Embedded Systems Consultant 'www.openhardware.net', 'www.cyberiansoftware.com' "Windows? No thanks, I have work to do..." This message resent by the email@example.com list server http://www.uClinux.com/
This archive was generated by hypermail 2b30 : Sun Apr 07 2002 - 00:01:41 EST