??? 07/21/06 22:17 Read: times |
#120828 - Schmidt triggers Responding to: ???'s previous message |
Hi Ashwin,
I haven't read your code. Frankly, if Erik has looked at it, my doing so would be pointless. Nonetheless, given the circuit behavior you're describing, I wouldn't look at firmware at all until I looked at the hardware. Specifically, what you're describing sounds exactly like I would expect a circuit to behave if you tied galvenic contacts directly to the logic inputs. When you press a mechanical switch/contact, it does not make a clean connection immediately. During the time that the two contacts are lightly touching the continuity will fluctuate wildly, causing mechanical "bounce". In other words, the switch will make and break contact repeatedly before it settles into one state or the other. And if you maintain pressure for a long time (like five seconds or so), normal fluctuations in pressure can cause more bouncing. It's been a long time, but I believe the kind of logic gate you need is called a Schmidt trigger. It's an invertor, but it responds to a state change and then will not respond to any more for a short time. Thus, by connecting your mechanical switch to the Schmidt trigger, and then connecting the output of the Schmidt trigger to your logic circuit input (ยต-controller pin for example), you can get reliable stable behavior. Do a search for switch debouncing too. I believe this has been discussed before, and there may be some ways to deal with switch bounce in software. Of course, I recommend the Schmidt trigger, leaving the software to do what needs doing. But it doesn't hurt to have options. Good luck, Joe P.S. If I left any misspellings in this post, they are there just so Erik won't feel so alone. |
Topic | Author | Date |
Problem with switches. | 01/01/70 00:00 | |
well, what is FLAG | 01/01/70 00:00 | |
simple logic | 01/01/70 00:00 | |
what is the difference | 01/01/70 00:00 | |
It is application specific | 01/01/70 00:00 | |
Good at checking if key IS pressed/ | 01/01/70 00:00 | |
Schmidt triggers | 01/01/70 00:00 | |
you are very kind![]() | 01/01/70 00:00 | |
change detect needed | 01/01/70 00:00 |