How To Debounce A Switch

How To Debounce A Switch - interpreted as the switch being...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
How To Debounce A Switch. .. A switch is a mechanical device that "opens" and "closes" a circuit. The switches on the eZ430X board are normally open, letting the inputs be pulled high (a logic one) by the internal MSP430 port pull-up resistors. A closed or depressed switch grounds an input pin resulting in a logic zero. However, these mechanical devices do not instantly nor cleanly change the input to your MSP430. The value on the pin of an input port may make multiple transitions, partial transitions with pauses, or just change slowly when compared to the speed of the microcontroller. If software does not handle this transition properly, multiple transitions could be registered, which would be
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: interpreted as the switch being pressed or released multiple times - very annoying at best! The transition time of a switch (before it becomes stable) could vary wildly from 1 to 50 ms, depending on the type and action of the switch. Although the type of switch used on the MSP430 is very clean and almost instantaneous during the press, the release is another matter. To debounce a switch, make sure that the frequency of the sampling of a switch is sufficiently long enough to allow for the input to the microcontroller to settle. See Switch Debounce: MMB pgs. 225-238....
View Full Document

This document was uploaded on 02/08/2012.

Ask a homework question - tutors are online