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:29
Read: times


 
#74463 - RE: Push Button Bouncing Time Method
Responding to: ???'s previous message
If you can afford a timed interrupt, just wait for the button to be in the pressed state for N interrupt where :
N*(delay beetween interrupt)>= 40ms

Just :
- increment a variable each time the button seems to be pressed
- put it at zero else

-When the variable is at N you can consider that the button is pressed,
if the button is still pressed store the info somewhere use most significant bit of the counter for example if you dont use it for counting, but i don't think it will be very interesting speaking in term of performances

(beware, dont forget that 8 bit variables loop FAST )

the longer you wait, the better is the debouncer (as long as you don't mind having a laggy button

Never designed this on 8152 but worked perfectly for a whole raw matrix keyboard on a ยต68010/PIT system

if you still have problems use a less bouncing button (i ve seen some .4 sec bouces on very old and very much used buttons)


your program will look like

//do some stuff

//wait for the button
while(!ButtonState)
;

//do some other stuff

Regards,
Benjamin
(I wanted to conclude on the regards like everyone else ;-))

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