??? 09/21/04 02:41 Read: times |
#77761 - Validity of state Responding to: ???'s previous message |
Hi Lisa,
Would you please elaborate about "the validity of the state change"- I'm not sure what you mean. When polling the input bit which is HIGH, you suddenly read a LOW. This may or may not be due to real push button actuation and instaed it could be due to a Vcc glitch or something similiar. So to decide which, you wait for about 20ms in a loop. If it was due to a false trigger like a spike or glitch then when you read the input bit AFTER the 20ms, you will naturally read a HIGH. But if it was due to real actuation of push button, then you would read the input as still being LOW, after the 20ms gap. Now you say that input is validated. - Read input state as LOW - Wait for Debounce time - Read input state again - If input state is still LOW , then it is validated. Trust its clear now... Raghu |