Switch debounce circuit questions
dbritta1
Posts: 36
Project UI has multiple NO spst switches on 18" 22ga 3-conductor twisted cables in noisy environment connected to Propeller USB board.
I presume debounce can be done in code.
Switches have common ground and I am planning to use either 10k or 4.7k pull-up resistors on Prop IO pins.
What is optimal value for pull-up?
Would a bypass cap be appropriate, if so what value?
Would series resistors be appropriate, if so what value?
I presume debounce can be done in code.
Switches have common ground and I am planning to use either 10k or 4.7k pull-up resistors on Prop IO pins.
What is optimal value for pull-up?
Would a bypass cap be appropriate, if so what value?
Would series resistors be appropriate, if so what value?
Comments
A bypass capacitor isn't really in this case. You've got an RC filter which is actually useful here. Look at this article for information and formulas on switch debouncing. There are some formulas starting on page 14 that cover debouncing with RC filters.
Thanks for link and expert advice.
I was refering to RC filter when asking about bypass cap, should have been more specific.
Dennis
Thanks for comments!
Can replace NO with NC switches in design, let me think about it.
NO was "safe" position in logical design, cable disconnect would not allow "unsafe" action.
Thought switch fail open was more likely than switch fail close, and cable short unlikely.
Can have user perform manual diag of switches at startup (or as required).
If you have individual switch lines, then NC are easier to fault find and self test.
NO are better if you scan a matrix, and only expect 1 of N active at a time.
You can cover a cable-disconnect by sensing an all-activated state as illegal, (even have a connected-verify jumper on the cable-end)
Also, if you trigger on the edge(s) of the switch, then a power up with a faulty switch, will not be considered an activation.
http://www.edaboard.com/thread187944.html
Thanks for schematic, have not had chance to properly review Mike's links yet.
Given prior comments, what would be component values if active device in schematic was Prop IO pin?
jmg,
Think I understand basis for NC approach, but fail-safe more important than noise immunity.
Intermittant spurious switch states very bad, but as example, ENABLE_MOTORS system state due to hardware fault would be fatal design flaw.
Excellent comments, switch type should match intended function.
NO for potentially dangerous user commands.
NC for safety loops and hardware fault detection.
I will select switch types as appropriate.