I am polling some slow/dumb input lines on the Cobra board & getting noise glitches
so I thought I’d turn on the glitch filter & set a long time span:
static InputPort rdButtUp = new InputPort((Cpu.Pin)FEZ_Pin.Digital.ButtonDown, true, Port.ResistorMode.PullUp);
TimeSpan ts = new TimeSpan(0, 0, 0, 0, 800);//800ms
Microsoft.SPOT.Hardware.Cpu.GlitchFilterTime = ts;
However, now i expect to see a delayed reaction when i press the button, but do not…it polls & responds just as quickly with the glitch filter turned on (& set to 800ms)!!!
using long timespans for glitch filters won’t give you the results you’re looking for. I can’t explain how it works, but it doesn’t give you a trigger if you only get 800ms of solid signal; what durations were you actually seeing in your glitches/bounces?
I’m not sure, it was just reported that there was noise at some times causing an input to respond (as though a switch were pressed). What is the max time of the input glitch filter? I need to be able to see that is is having an effect, so I set it to 800ms so I can see the delay when I push the switch. I will normally set it to 50ms, but that won’t show me it is working (I don’t have an actual system, just the cpu board–so no noise at my end).
How else could you easily verify that the glitch filter is on & working, if all you have is a board? Why wouldn’t it workfor 800ms? This makes me suspicious that it doesn’t work at all…what is the limit?
Why don’t you measure it? You get the interrupt time and then you can calculate how many bounces you get until the signal becomes stable.
I just use a sampling technique within my interrupt handler to only record the current value if it’s different to the current recorded state; so if they’re not the same then it’s in a bounce state.
Thanks Brett, I might try something along that line, altough righ now I’m not using any intterupts at all. …Is it needed to usw the glitch filtering?..I was just trying to see if the filter really did anything. I suppose i could try putting in some glitches with a signal generator…I was trying to make them using my finerg & setting the filter to 800ms.
By the way, does anyone know what the glitch time limit really is?
glitch filter is defined http://msdn.microsoft.com/en-us/library/ee433940.aspx. Default is 7.68ms according to this. You’d have to delve into the porting kit to see how that is actually implemented and how it interacts with the hardware, if at all. Perhaps that’s a processor specific thing, if it doesn’t have debounce capability setting this might not have any relevant change in behaviour.
I’ll try setting it to 50ms & see what happens…I’m not familiar enough with the porting to be able to diagnose the inner workings.
I’m not sure why the limit or how it specifically filters glitches isn’t simply stated (just says its a “glitch filter”).