??? 06/13/11 13:29 Modified: 06/13/11 13:46 Read: times |
#182630 - Button Connect to Interrupt :-( Responding to: ???'s previous message |
I would not recommend directly connecting a switch or push button to an interrupt pin input. Switches bounce like crazy and cause many many transitions at each closure or opening. The switch will need to be debounced first. One way to do this is to connect the switch through an R/C circuit. Another way is to use a Form C switch and connect the switch up through a set.reset type latching circuit.
If you want to avoid the additional hardware then leave the pin that the switch is connected to as a simple input pin (without interrupts being used) and then setup a timer interrupt to periodically poll the switch input pin. The timer could peer at the pin say every 10 msec and if the input stays at the same state for three samples in a row then you could know that you have a stable input level. Michael Karas |
Topic | Author | Date |
Timers/LCD and Interrupts problem | 01/01/70 00:00 | |
show sourcecode and BTW... | 01/01/70 00:00 | |
thanks | 01/01/70 00:00 | |
Using Google Documents....arrrgh. | 01/01/70 00:00 | |
I hope that's better | 01/01/70 00:00 | |
Button Connect to Interrupt :-( | 01/01/70 00:00 | |
but it can be good exercise | 01/01/70 00:00 | |
hmmm | 01/01/70 00:00 | |
irq pin | 01/01/70 00:00 | |
simulator | 01/01/70 00:00 | |
push pop | 01/01/70 00:00 | |
:( | 01/01/70 00:00 |