C.3.1
Design
Switch bounce is intermittent contact and release of the switch contacts. Two
parameters characterize switch bounce: bounce period and bounce duration.
Bounce period is the random length of time the contacts remain open, or closed, while
the bounce is occurring. Bounce periods can vary anywhere from a few nanoseconds
to a few milliseconds.
Bounce duration is the time from the leading edge of the first bounce period to the
trailing edge of the last bounce period. The difficulty is bounce duration is
indeterminate.
Bounce abatement design starts by making assumptions based on empirical data.
The first assumption is bounce period will be absolutely less than 10 milliseconds.
Experience dictates this is a good assumption, however, bench and field-testing are still
essential to ensure the switch selected for the application does not have a longer
bounce period. The second assumption is the total bounce duration is indeterminate.
A good design should work regardless of how long the switch bounces provided that it
eventually does stop bouncing.
C.3.1.1
BRUTE FORCE DEBOUNCE
Consider a simple push button application. In this case, some event should occur when
a button is pushed. Ideally the invoked event will occur immediately, and only once for
each button push. The system should also be ready to respond to a repeat button push
as soon as possible after the button is released. This presents an apparent dilemma.
How is the difference between switch bounce and repeated button pushes determined?
Recall the assumption that the bounce period is less than 10 milliseconds. If the switch
input level is stable for longer than 10 milliseconds, then bouncing has stopped and the
input level represents the pushed or released switch state. The Brute Force method
only cares about a button-push event because this is what invokes the action. It
recognizes the switch release state as the stable state and everything else is
considered unstable. When the switch becomes unstable, the action is invoked
permitting nothing to happen until the switch returns to the released stable state.
The flowchart in Figure C-3 outlines the software actions necessary to implement the
Brute Force debounce method. Notice that the debounce loop is looking for a stable
released state for 10 milliseconds before returning to the top of the main loop. Any
instability, including a stable button pushed state, resets the debounce 10 millisecond
timer.
? 2004 Microchip Technology Inc.
DS40051D-page 41
相关PDF资料
DV164120 KIT STARTER PICKIT 2
DV164121 KIT PICKIT 2 DEBUG EXPRESS
DV164122 ANALYZER SRL PICKIT W/DEMO BOARD
DV164131 KIT STARTER PICKIT 3
DV164132 KIT EVAL F1 FOR PIC12F1/PIC16F1
DV243003 KIT STARTER FOR SRL MEM PRODUCTS
DVA1001 ADAPTER FOR PIC16F716 18DIP
DVA1004 DEVICE ADAPTER 8/14/20DIP
相关代理商/技术参数
DV164101 制造商:Microchip Technology Inc 功能描述:TOOLS: FLASH MICROCONTROLLER (
DV164102 功能描述:开发板和工具包 - 无线 rfPICkit RoHS:否 制造商:Arduino 产品:Evaluation Boards 工具用于评估:AT32UC3L 核心:AVR32 频率: 接口类型:USB 工作电源电压:5 V
DV164120 功能描述:电路内置调试器 PICkit 2 8/14/20P Flash RoHS:否 制造商:Microchip Technology 产品:In-Circuit Debugger Kits 工具用于评估:PIC MCUs, dsPIC DSCs 用于:07-00024, AC164113 核心:dsPIC, PIC 接口类型:USB 工作电源电压:3 V to 5 V
DV164121 功能描述:电路内置调试器 PICkit 2 Debug Express RoHS:否 制造商:Microchip Technology 产品:In-Circuit Debugger Kits 工具用于评估:PIC MCUs, dsPIC DSCs 用于:07-00024, AC164113 核心:dsPIC, PIC 接口类型:USB 工作电源电压:3 V to 5 V
DV164121 制造商:Microchip Technology Inc 功能描述:ICPICKIT2 PROGRAMMER/DEBUGGER ((NW))
DV164121+TEFLCST3 制造商:Microchip Technology Inc 功能描述:KIT PICKIT2+FLOWCODE-HOME BUNDLE 制造商:Microchip Technology Inc 功能描述:ICD, PICKIT 2, FLOW CODE, PIC, DSPIC 制造商:Microchip Technology Inc 功能描述:ICD, PICKIT 2, DEBUG EXP, FLOW CODE, PIC, DSPIC; Silicon Family Name:PIC12F6xx, PIC16F5xx; Core Architecture:PIC; Core Sub-Architecture:PIC12, PIC18, PIC24; IC Product Type:Debugger / Programmer; Series:PICkit 2 ;RoHS Compliant: Yes
DV164122 功能描述:界面开发工具 PICkit Ser Analyzer RoHS:否 制造商:Bourns 产品:Evaluation Boards 类型:RS-485 工具用于评估:ADM3485E 接口类型:RS-485 工作电源电压:3.3 V
DV164126 功能描述:开发板和工具包 - PIC / DSPIC USB Kit w/ PICkit LowPinCount RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压: