Discussion:
Digital Filter for Digital IO
(too old to reply)
bmann2000
2008-03-27 15:10:07 UTC
Permalink
This may sound strange, digital filters are traditionally used to filter analog signals, but I need a filter for a digital signal.

I'm using a cRIO-9401 module to sample digital inputs, but due to system noise, sometimes I register a logic low when the input if actually at 5V, a look on the scope has revealed that occasional noise spikes below the TTL threshold are causing logic-0 levels to be briefly registered on the cRIO.  The sampling rate of the digital input is 30Mhz, therefore, even though the noise spike only lasts for a tiny amount of time, the cRIO picks this up as logic-0. 

 

I figure I need to implement a digital filter, preferably in a way that can be tuned to strike a balance between missing logic-0's and not recording noise spikes as logic-0.  A real event would last for at least 10mS.  Has anyone encountered this problem before, and has code?  I can think of a few ways to implement the filter, but wondered if anyone had tried and tested code.

 

Thanks in advance for your suggestions.
bmann2000
2008-03-27 17:40:14 UTC
Permalink
thanks JB & Phil, link to debounce code looks best, tunable, small amount of code, cRIO specific, thanks very much.
here it is again:
 


digital_debounce.jpg:
Loading Image...
Continue reading on narkive:
Loading...