??? 09/05/04 13:55 Read: times |
#76913 - RE: debouncing for matrix keypad ? Responding to: ???'s previous message |
Clearly the microcontroller may be setup to read the switch at some interval in the 15 to 30 milliseconds range. But you need to consider what happens if the microcontroller performs its internal read operation of the port pin at the time shown in the modified scope trace below:
![]() The port read pulse is some narrow pulse a microsecond or less wide. What state will the microcontroller see in the above picture? A "1" or a "0"? Your guess is probably as good as mine!! Now if that particular microswitch press was supposed to be the exact time a life saving defibrillation pulse was supposed to be delivered to a patient on the hospital operating table we may conclude that we cannot determine if the pulse got delivered or not. Now I know that you may respond that "oh, do not forget that I will be scanning the microswitch again in another 30 milliseconds". Sure then you would see the switch input high at the subsequent sample...but then you need to sample multiple times to be able to detect the approximate switch transition times....from "0" -> "1" or from "1" -> "0". Such a sampled process is a kind of a filter and does itself provide an inherent debounce process!! Michael Karas |