Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/19/04 16:24
Read: times


 
#74462 - RE: Push Button Bouncing Time Method
Responding to: ???'s previous message
"while (pushb != 0); // wait until button is
// pressed "

So if push button port is never operated, will your MCU wait just there endlessley ?

The proper approach would be :

1. Read Push button port.
2. Is it low ? If NO quit this routine.
3. If it is low, then start a timer for debounce_delay.
4. After debounce_delay is over, read push button port.
5. If it is still low, then you have a real signal. Process it as required.
6. If it is not low, then it is a false signal or is still debouncing.

For the debounce_delay, you can start with about 20 ms delay. Should suffice mostly but can stretch upto 40ms or more at times depending on the condition of relay contacts / pusbutton contacts.

PS: The above is one of several such methods and goes by the name of polling.

Raghu

List of 20 messages in thread
TopicAuthorDate
Push Button Bouncing Time Method            01/01/70 00:00      
   RE: Push Button Bouncing Time Method            01/01/70 00:00      
      RE: Push Button Bouncing Time Method            01/01/70 00:00      
      RE: Push Button Bouncing Time Method            01/01/70 00:00      
   RE: Push Button Bouncing Time Method            01/01/70 00:00      
      RE: Push Button Bouncing Time Method            01/01/70 00:00      
   RE: Push Button Bouncing Time Method            01/01/70 00:00      
   RE: Push Button Bouncing Time Method            01/01/70 00:00      
      RE: Push Button Bouncing Time Method            01/01/70 00:00      
         RE: Push Button Bouncing Time Method            01/01/70 00:00      
            RE: Push Button Bouncing Time Method            01/01/70 00:00      
   Hardware debouncing is also possible            01/01/70 00:00      
      RE: Hardware debouncing is also possible            01/01/70 00:00      
         RE: Hardware debouncing is also possible            01/01/70 00:00      
   RE: 4 points            01/01/70 00:00      
      Maddening Release - not always!            01/01/70 00:00      
         RE: Maddening Release - not always!            01/01/70 00:00      
            RE: Maddening Release - not always!            01/01/70 00:00      
            Release issue - Erik & Bartosz            01/01/70 00:00      
               As clear as a bell            01/01/70 00:00      

Back to Subject List