SPDT debounce doesn't

Dec 01, 2009 42 Replies

One ISR function block, just test a global flag to see how the event was programmed and alter the state of the flag and registers required. If a timer call this block, I disabled the timer and enabled the external event triggers and visa versa.

The idea is to disable the external trigger events via config registers, so that the CPU does not get into a flooded state. When you receive an external event, process it, disable it and then enable the timer to avoid debouncing. The timer is only used to restore the external trigger events after a few ms (msec) Doing this way, you don't have a flooded condition.

For me, it's simpler to do this all in one code block how ever, some uC's are a little harder to do this with and there for, 2 ISR's may make it easier to handle. But, You still need to disable the external events in both cases each time an input is active, then, re-enable it via the timer ISR. The timer ISR must be asynchronous with the external event ISR.

I think you get the picture.

I agree, you can process it after you've done with sex, but bad idea not to debounce!

Yeah before you were born dumbass, if you have 40 key to debounce, I bet you won't have time for your little 3rd leg at all...heehee...... and I can debounce all 40 key with a single RC. Why should I give away my precious brain to a dumbass like you Punk?

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required