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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/21/04 12:37
Read: times


 
#77811 - Debounce, and define current problem
Responding to: ???'s previous message
Hi Craig, I think the error you speak of is the missing debounce but the assignment had two parts, write one program with debounce and one without.


Actually the correction I remember had something to do with an address being wrong. Someone pointed out that the 8255 address was usually something else and you indicated that he was right.

Either way my code doesn't seem to work.


What is the current problem you are experiencing with the code you just posted (the one with debounce)? Does it constantly flash the LED, too? Is the flashing at a constant speed or is it sporadic?

The professor recommended a 250ms delay for debounce, perhaps this is overkill but can it hurt?


250ms should be more than sufficient but looking at your code it doesn't really look like you're implementing debounce.

Debounce means that you constantly read the value of the key and only consider it to be a valid keypress if the value doesn't change for a specific amount of time (250ms in your case). Normally what you do is read the value of the key. If the key was not pressed the last time you checked the key and now it is pressed you reset a counter. Then every time you read the key and determine that it is still pressed you increment the counter. You only consider the key as having been pressed if your counter reaches the debounce time. Pressing a key doesn't always result in an "instant on" but rather may result in a brief on, brief off, brief on, brief off, and then finally a constant "on" signal. The debounce logic makes sure the initial on/off noise is not counted as keypresses.

Your code does not currently do that. It just has a delay so it only checks the key once every 250ms. That's not debounce. It just means your code will execute slower.

Regards,
Craig Steiner


List of 55 messages in thread
TopicAuthorDate
Problem with my code            01/01/70 00:00      
   RE: Problem with my code            01/01/70 00:00      
      RE: Problem with my code            01/01/70 00:00      
   RE: Problem with my code            01/01/70 00:00      
      RE: Problem with my code            01/01/70 00:00      
   RE: Problem with my code            01/01/70 00:00      
      RE: Problem with my code            01/01/70 00:00      
         RE: Problem with my code            01/01/70 00:00      
            RE: Problem with my code            01/01/70 00:00      
               RE: Problem with my code            01/01/70 00:00      
               RE: Problem with my code            01/01/70 00:00      
                  RE: Antiques            01/01/70 00:00      
                  RE: Problem with my code            01/01/70 00:00      
                     can't count            01/01/70 00:00      
                        RE: can't count            01/01/70 00:00      
                  RE: Problem with my code            01/01/70 00:00      
                     Validity of state            01/01/70 00:00      
                        RE: Validity of state            01/01/70 00:00      
                           RE: Validity of state            01/01/70 00:00      
                        RE: Validity of state            01/01/70 00:00      
            RE: Problem with my code            01/01/70 00:00      
               Another for the teacher            01/01/70 00:00      
               Fighting academia            01/01/70 00:00      
                  RE: Fighting academia            01/01/70 00:00      
                     RE: Fighting academia            01/01/70 00:00      
                  RE: Fighting academia more            01/01/70 00:00      
                  RE: Fighting academia            01/01/70 00:00      
               RE: Problem with my code            01/01/70 00:00      
                  RE: Problem with my code            01/01/70 00:00      
   RE: Problem with my code            01/01/70 00:00      
      RE: Problem with my code            01/01/70 00:00      
   RE: Replacing school hardware            01/01/70 00:00      
      RE: Replacing school hardware            01/01/70 00:00      
         RE: Replacing school hardware            01/01/70 00:00      
      RE: Replacing school hardware            01/01/70 00:00      
         RE: Replacing school hardware            01/01/70 00:00      
            RE: Replacing school hardware            01/01/70 00:00      
               RE: Replacing school hardware            01/01/70 00:00      
                  RE: Lisas problem            01/01/70 00:00      
                  Debounce, and define current problem            01/01/70 00:00      
                     RE: Debounce, and define current problem            01/01/70 00:00      
                        Defining debouncing            01/01/70 00:00      
                           RE: Defining debouncing            01/01/70 00:00      
                              You got it            01/01/70 00:00      
            RE: good old 6809            01/01/70 00:00      
      RE: Replacing school hardware            01/01/70 00:00      
         RE: Replacing school hardware            01/01/70 00:00      
            STUPID marketing policy            01/01/70 00:00      
               Possibly not entirely stupid...?            01/01/70 00:00      
                  RE: Possibly not entirely stupid...?            01/01/70 00:00      
            RE: Replacing school hardware            01/01/70 00:00      
               RE: Replacing school hardware            01/01/70 00:00      
   C.Steiner, Atari and dev. systems..            01/01/70 00:00      
   RE: Problem with my code            01/01/70 00:00      
      RE: Problem with my code            01/01/70 00:00      

Back to Subject List