ELM409 Versatile Debounce Circuit

Similar documents
ELM334 Garage Doorman

ELM313 Stepper Motor Controller

Adaptive Power MOSFET Driver 1

Supply Voltage Supervisor TL77xx Series. Author: Eilhard Haseloff

Adaptive Power MOSFET Driver 1

EE283 Electrical Measurement Laboratory Laboratory Exercise #7: Digital Counter

OBSOLETE TTL/CMOS INPUTS* TTL/CMOS OUTPUTS TTL/CMOS TTL/CMOS OUTPUTS DO NOT MAKE CONNECTIONS TO THESE PINS INTERNAL 10V POWER SUPPLY

High Speed, +5 V, 0.1 F CMOS RS-232 Driver/Receivers ADM202/ADM203

DM96S02 Dual Retriggerable Resettable Monostable Multivibrator

A5821. BiMOS II 8-Bit Serial Input Latched Driver. Discontinued Product

CD54/74HC221, CD74HCT221

MIC4451/4452. General Description. Features. Applications. Functional Diagram V S. 12A-Peak Low-Side MOSFET Driver. Bipolar/CMOS/DMOS Process

UC284x, UC384x, UC384xY CURRENT-MODE PWM CONTROLLERS

CD74HC221, CD74HCT221

SPG Monolithic Event Detector Interface SP42400P

Implications of Slow or Floating CMOS Inputs

LSI/CSI LS7560N LS7561N BRUSHLESS DC MOTOR CONTROLLER

Isolated High Side FET Driver

CD74HC123, CD74HCT123, CD74HC423, CD74HCT423

Pulse Width Modulation Amplifiers BLOCK DIAGRAM AND TYPICAL APPLICATION CONNECTIONS HIGH FIDELITY AUDIO

Features V DD 4 STROBE MOS. Bipolar. Sub 8 GND V EE OUT 8

T 3 OUT T 1 OUT T 2 OUT R 1 IN R 1 OUT T 2 IN T 1 IN GND V CC C 1 + C 1

Resonant-Mode Power Supply Controllers

A5832. BiMOS II 32-Bit Serial Input Latched Driver. Discontinued Product

ABSOLUTE MAXIMUM RATINGS These are stress ratings only and functional operation of the device at these ratings or any other above those indicated in t

CD54/74HC123, CD54/74HCT123, CD74HC423, CD74HCT423

Voltage-to-Frequency and Frequency-to-Voltage Converter ADVFC32

Low Power μp Supervisor Circuits

ML4818 Phase Modulation/Soft Switching Controller

ASTABLE MULTIVIBRATOR

Volterra. VT1115MF Pulse Width Modulation (PWM) Controller. Partial Circuit Analysis

1X6610 Signal/Power Management IC for Integrated Driver Module

Description. Applications

MAINTENANCE MANUAL AUDIO MATRIX BOARD P29/

Monostable multivibrators

MIC4421/4422. Bipolar/CMOS/DMOS Process. General Description. Features. Applications. Functional Diagram. 9A-Peak Low-Side MOSFET Driver

HIGH FREQUENCY 7660 DC-TO-DC VOLTAGE CONVERTER TC7660H GENERAL DESCRIPTION FEATURES ORDERING INFORMATION

CD54/74AC245, CD54/74ACT245

M-991 Call Progress Tone Generator

DACPORT Low Cost, Complete P-Compatible 8-Bit DAC AD557*

Model 305 Synchronous Countdown System

STM706T/S/R, STM706P, STM708T/S/R

CD54HC4538, CD74HC4538, CD74HCT4538

8-Bit, high-speed, µp-compatible A/D converter with track/hold function ADC0820

MARKING DIAGRAMS PIN CONNECTIONS ORDERING INFORMATION

AD557 SPECIFICATIONS. T A = 25 C, V CC = 5 V unless otherwise noted) REV. B

+5V, Low-Power µp Supervisory Circuits with Adjustable Reset/Watchdog

SP385A. +3V to +5V RS-232 Line Driver/Receiver. Operates from 3.3V or 5V Power Supply Meets All EIA-232D and V.28 Specifications

Extremely Accurate Power Surveillance, Software Monitoring and Sleep Mode Detection. Pin Assignment. Fig. 1

Low Power, 3.3 V, RS-232 Line Drivers/Receivers ADM3202/ADM3222/ADM1385

Automotive Wash Wiper Timer

A3982. DMOS Stepper Motor Driver with Translator

DS1869 3V Dallastat TM Electronic Digital Rheostat

Stepper Motor Drive Circuit

CD4538 Dual Precision Monostable

HT7610A/HT7610B/HT7611A/HT7611B General Purpose PIR Controller

Low Cost P Supervisory Circuits ADM705 ADM708

TC4584BP,TC4584BF,TC4584BFN

HIGH LOW Astable multivibrators HIGH LOW 1:1

NJ88C Frequency Synthesiser with non-resettable counters

SN54221, SN54LS221, SN74221, SN74LS221 DUAL MONOSTABLE MULTIVIBRATORS WITH SCHMITT-TRIGGER INPUTS

PSM Buck Converter with Dynamic Adjustable Output and Bypass Capability

11 Counters and Oscillators

SGM706 Low-Cost, Microprocessor Supervisory Circuit

SGM706 Low-Cost, Microprocessor Supervisory Circuit

NAU82011WG 2.9 W Mono Filter-Free Class-D Audio Amplifier. 1 Description VIN. Output Driver VIP. Class D Modulator VDD VSS

Experiment (1) Principles of Switching

MARKING DIAGRAMS MAXIMUM RATINGS (Voltages Referenced to V SS ) (Note 1.) ORDERING INFORMATION PDIP 14 P SUFFIX CASE 646

LABORATORY EXPERIMENT. Infrared Transmitter/Receiver

Programmable, Off-Line, PWM Controller

CONSONANCE Ultra Low Power Microprocessor Reset IC CN803/809/CN810 General Description Features Pin Assignment Applications

Charge Pump Voltage Converters TJ7660

Application Note AN-3006 Optically Isolated Phase Controlling Circuit Solution

css Custom Silicon Solutions, Inc.

AC/DC to Logic Interface Optocouplers Technical Data

FEATURES. Timers Low Supply Detector. Power up Timer. Post Alarm Dead Time. Counter. Pulse Width Discriminator. Discriminator control function

TL598 PULSE-WIDTH-MODULATION CONTROL CIRCUITS

Constant-Current LED Drivers

SGM706 Low-Cost, Microprocessor Supervisory Circuit

Debouncing Switches. The non-ideal behavior of the contacts that creates multiple electrical transitions for a single user input.

CD V Low Power Subscriber DTMF Receiver. Description. Features. Ordering Information. Pinouts CD22204 (PDIP) TOP VIEW. Functional Diagram

CD74HC73, CD74HCT73. Dual J-K Flip-Flop with Reset Negative-Edge Trigger. Features. Description. Ordering Information. Pinout

High Speed, +5 V, 0.1 µf CMOS RS-232 Drivers/Receivers ADM222/ADM232A/ADM242*

Advanced Regulating Pulse Width Modulators

+15 V 10k. !15 V Op amp as a simple comparator.

CD4541BC Programmable Timer

Last Time Buy. Deadline for receipt of LAST TIME BUY orders: April 30, 2011

ICS PLL BUILDING BLOCK

CPC5712 INTEGRATED CIRCUITS DIVISION

Discontinued Product

UNISONIC TECHNOLOGIES CO., LTD UU6032B Advance LINEAR INTEGRATED CIRCUIT

FAN1851A Ground Fault Interrupter

DS V EconoReset PIN ASSIGNMENT FEATURES PIN DESCRIPTION PIN 1 GROUND PIN 2 RESET PIN 3 V CC PIN 4 GROUND (SOT 223 ONLY)

LD /01/2013. Boost Controller for LED Backlight. General Description. Features. Applications. Typical Application REV: 00

Features. RAMP Feed Forward Ramp/ Volt Sec Clamp Reference & Isolation. Voltage-Mode Half-Bridge Converter CIrcuit

The Basics Digital Input

General Description. Pin Names. Time-out programming input. Inrush current control output. Battery voltage input. Voltage loop comp input

+5 V Powered RS-232/RS-422 Transceiver AD7306

Microprocessor-Compatible 12-Bit D/A Converter AD667*

Dual precision monostable multivibrator

Transcription:

ersatile Debounce Circuit Description The ELM is digital filter circuit that is used to interface mechanical contacts to electronic circuits. All mechanical contacts, whether from switches, relays, etc. will have inherent bounce when they make or break a connection. When that contact is used for the electrical input to a digital circuit, the bounces can easily be incorrectly interpreted as multiple inputs. The ELM contains all of the logic that is typically required to remove the bounce from such signals, and provide a signal that has only one transition. In addition to providing the standard debounce function, the ELM may also be configured for other useful functions such as generating pulses or alternating output levels on signal transitions. No external components are needed for the operation of the ELM, as all timing and logic functions are performed internally. Features Standard and extra long debounce times Schmitt input provides hysteresis Complementary circuit outputs Needs no external timing components Low power CMOS design - typically 1 ma at Wide supply range - 3.0 to. volt operation High current drive outputs Connection Diagram PDIP and SOIC (top view) DD 1 8 SS Applications Pushbutton interface for logic circuits Limit switch monitoring A B C 2 3 4 Out Out In Time delay generation Power on sequencing Block Diagram A B C 2 3 4 Control Logic 00 msec debounce edge detectors pulse generator In Out debounce edge detectors toggle circuit Out 1 of 8

Pin Descriptions DD (pin 1) This pin is the positive supply pin, and should always be the most positive point in the circuit. Internal circuitry connected to this pin is used to provide power-on reset of the microprocessor, so an external reset signal is not required. Refer to the Electrical Characteristics section for further information. A, B, and C (pins 2, 3, and 4) These three pins modify the behaviour of the ELM, providing eight different configurations. They determine whether the output should follow the input, be a momentary pulse, or toggle the output on each input transition. As well, they can select either a standard debounce period, or a longer 00 msec one. The longer period may be useful for some very noisy interfaces, or for situations that need a slight delay. See the ELM Operation section for more details on these options. hysteresis means that very slow moving or noisy signals can be accommodated by the ELM without needing the signal to be preconditioned by any external circuitry. (A standard CMOS input should never have a slowly varying signal applied, as it may cause excessive currents to flow internally, but a Schmitt input circuit does not have this limitation.) Out and Out (pin ) The debounced and processed signal is output on pin, while the complement of this signal is output on pin. These are high current CMOS drivers, so will interface to virtually all of the common digital logic families. SS (pin 8) Circuit common is connected to this pin. This should be the most negative point in the circuit. In (pin ) The signal that is to be processed is applied to this pin. Before the signal is debounced, it is passed through a Schmitt trigger - a special buffer circuit that has hysteresis in its gain function. The use of Ordering Information These integrated circuits are available in either the 300 mil plastic DIP format, or in the 208 mil SOIC surface mount type of package. To order, add the appropriate suffix to the part number: 300 mil Plastic DIP... ELMP 208 mil SOIC... ELMSM All rights reserved. Copyright 2009 by Elm Electronics Inc. Every effort is made to verify the accuracy of information provided in this document, but no representation or warranty can be given and no liability assumed by Elm Electronics with respect to the accuracy and/or use of any products or information described in this document. Elm Electronics will not be responsible for any patent infringements arising from the use of these products or information, and does not authorize or warrant the use of any Elm Electronics product in life support devices and/or systems. Elm Electronics reserves the right to make changes to the device(s) described in this document in order to improve reliability, function, or design. 2 of 8

Absolute Maximum Ratings Storage Temperature... - C to +10 C Ambient Temperature with Power Applied...-40 C to +8 C oltage on DD with respect to SS... 0 to +. oltage on any other pin with respect to SS... -0. to (DD + 0.) Note: Stresses beyond those listed here will likely damage the device. These values are given as a design guideline only. The ability to operate to these levels is neither inferred nor recommended. Electrical Characteristics All values are for operation at 2 C and a supply, unless otherwise noted. For further information, refer to note 1 below. Characteristic Minimum Typical Maximum Units Conditions Supply oltage, DD 3.0.0. DD rate of rise 0.0 /ms see note 2 Average Supply Current, IDD 1.0 2.4 ma see note 3 Input (pin ) Schmitt trigger thresholds rising falling 1.0 2.9 1. 4.0 DD =.0 Input (pin ) Schmitt trigger thresholds rising falling 0. 1. 1.0 2.4 DD = 3.0 low voltage 0.3 Current (sink) = 10 ma high voltage 4.2 Current (source) = 10 ma Standard debounce time 2 Long debounce time 00 msec msec see note 4 see note 4 pulse width 0 msec see note 4 Notes: 1. This integrated circuit is produced using one of the Microchip Technology Inc. s PIC12CXX products as the core embedded microcontroller. For further device specifications, and possibly clarification of those given, please refer to the appropriate Microchip documentation. 2. This spec must be met in order to ensure that a correct power on reset occurs. It is quite easily achieved using most common types of supplies, but may be violated if one uses a slowly varying supply voltage, as may be obtained through direct connection to solar cells, or some charge pump circuits. 3. Device only. Does not include any current supplied to external circuits. 4. The ELM uses an internal RC oscillator for the timing. This oscillator typically maintains an accuracy of 2% over the allowed temperature and voltage range. 3 of 8

About Contact Bounce The circuit of Figure 1 below shows one possible connection that might be made between a mechanical switch and a digital circuit. The pushbutton could be used to summon an elevator, or to turn a circuit on, or it could be a switch that is operated by foot pressure to count the number of people entering a room. It does not matter what the function is actually - in every case we simply need a clean signal to present to the logic. Normally, the pushbutton will not be pressed, so its contacts will be open, and the digital circuit will see taken from our pushbutton tests (and shows the output from the ELM in the lower trace). Note that the signal alternates between high and low several times, bouncing between the levels. This bounce occurs when the moving contacts of the switch meet the stationary contacts, and is simply due to the physics of the two parts meeting one another. The bounces do not seem to have a defining characteristic that would allow the behaviour to be predicted and filtered - it is basically digital noise. If this signal were to be input to the digital circuit as it is, it would be seen as at least two switch presses (and maybe more). Note that when the contacts open, there is a similar problem, as shown in Figure 3: Digital Circuit Figure 1. Pushbutton input to digital logic only a resistor to circuit common (a low input). When the pushbutton is pressed, the contacts close and the digital circuit will be connected to the positive power supply, or a logic high. It should be a simple matter of processing this signal, but it is often not. The oscilloscope trace of Figure 2 shows the voltage that the digital circuit of Figure 1 might see when the pushbutton is pressed. It is an actual trace Figure 3. Bounce on switch opening Seeing multiple inputs for a single switch press is certainly not what is intended by any circuit, and it needs to be addressed. The technique of cleaning up such a signal is commonly known as debouncing, and that is what the ELM does. It simply waits until the bounces stop, then waits an additional time (the debounce time) to be sure that there are no more bounces likely to occur. Choosing an appropriate debounce time is a design choice, but seems to be a good value. There are several analog methods of performing the debouncing of a signal, many that work extremely well, but we do not think that any work better than the ELM. Figure 2. Bounce on switch closing 4 of 8

ELM Operation The circuit of Figure 4 shows how the ELM would typically be connected to debounce the signal of Figure 1. Other than powering the ELM, all that is needed is to connect the options pins (A, B and C) to SS (providing low levels on all three), connect the noisy switch signal to the input pin, and then connect the ELM output pin to the digital circuit. The output of the ELM in Figure 4 would appear as shown in the scope traces of Figures 2 and 3 (the lower traces). There is a slight delay () due to the debounce period, but otherwise, the signal appears as you would expect from an ideal switch. The ELM is capable of performing several other functions on the input signal - it can do more that just debounce the signal. For example, it can provide a change in output on the signal edges (transitions from a low to a high level, or from a high to a low level), and it can alternate (toggle) the output on each occurrence of an edge. Each of these possibilities are selected by changing the logic levels at the A, B and C pins. The eight combinations are described in Table 1 below, and also appear pictorially on the next page. 4 3 2 Digital Circuit Figure 4. Debouncing the pushbutton 1 8 Function A B C Debounce Period Notes Follows Input 0 0 0 0 0 1 00 msec Standard contact debounce For very noisy circuits Pulse on Rising Edge 0 1 0 0 1 1 00 msec pulse is 0 msec wide pulse is 0 msec wide Pulse on Falling Edge 1 0 0 1 0 1 00 msec pulse is 0 msec wide pulse is 0 msec wide Toggle on Edge 1 1 0 1 1 1 Changes on input H -> L Changes on input L -> H Table 1. ELM options of 8

ELM Operation (continued) The following diagrams provide a pictorial view of each of the eight ELM options: Input (pin ) ABC = 000 or 001 or 00 msec ABC = 010 or 011 0 msec or 00 msec ABC = 100 or 101 0 msec or 00 msec ABC = 110 or 00 msec ABC = 111 or 00 msec Figure. ELM Timing Diagrams of 8

Example Applications This section shows several different ways to use the ELM. The first example (Figure ) is actually a variation of the circuit shown in Figure 4. Figure adds two components that should always be considered in every ELM design. The first is a supply bypass capacitor. Digital circuits will often have transients ( spikes ) in their current flow due to the internal switching process. By adding a capacitor very close to the IC, much of the current for these spikes can be supplied by the capacitor rather than through the (inductive) leads from the supply. The net result is that there will be less noise generated at the supply by the ELM. A value of 0.01µF works well. The other component that was added in Figure is a series resistor at the input (pin ). This resistor is recommended when the electrical contact or switch is any more than a few feet away from the ELM IC. Placing the resistor in series with the input serves to limit induced currents that might otherwise damage the ELM. A minimum value of a few hundred ohms is recommended, and a larger value (such as the 4.KΩ shown), is preferred. The next example (shown in Figure ) has the pushbutton connected between circuit common and the input, rather than from the positive supply. An arrow is shown at the output, symbolizing the output signal, which is then connected as appropriate. The one difference with this circuit is that the input voltage will go from a high level to a low level when the switch is pressed. To accommodate this, the options pins have been set to 110, providing a toggle function that changes state on each high to low transition. The circuit will provide alternating high and low outputs which change state each time the switch is pressed. If the options pins had been set to 000 (ie all tied low), the circuit would provide an output that follows the switch presses, but might seem inverted. That is, pin would normally be at a high level, and would go to a low level when the switch is pressed. If an output that is normally low and goes high when the switch is pressed is required, simply use pin for the output rather than pin. This section concludes on page 8, with three more example circuits and a short description of each. 4.KΩ Figure. Debouncing the pushbutton revisited 4.KΩ 4 4 3 2 3 1 8 0.01µF Digital Circuit 0.01µF Figure. Toggle circuit with the pushbutton to common 2 1 8 of 8

Example Applications (continued) The following are a a few circuits that use the ELM, but may not be what comes to mind when you think of debouncing. They take advantage of the internal timers in the ELM as well as the ability to change options while the circuit is operational, to provide some interesting functions. The first (Figure 8) is a circuit that simply connects the debounce input to the positive supply. With the debounce period set for 00 msec, the output will initially be low, then go high 00 msec after the power is turned on. This delay may be useful if trying to sequence the power to different circuits, or enable the outputs (audio power amplifiers often need this delay to allow the supplies to settle before connecting the amplifier outputs to the speakers). Figure 9 shows a circuit that provides a single 0 msec wide pulse at the output, after power has been applied. It relies on the fact that the ELM s pin output is always at a low level on power up (and pin is always high), so the initial options setting will then be 010, for a 0 msec pulse after a debounce period. Once the output pulse begins, however, the connection from pin to pin 4 causes the options to change to 011, giving a debounce period of 00 msec (which can never be met by a 0 msec pulse). The output remains low from that time on. This circuit works because the option pins are always read just before a debounce period is about to expire (allowing for changes on the fly ). In this case, the pulse output is at its midpoint when the pins are read, so the new latched setting becomes 011, and the debounce period changes to 00 msec. As the pulse never lasts that long, it is ignored by the 00 msec debounce circuit, and the output never changes again. The final circuit also uses the output to modify the input, and the debounce period. The result is a series of pulses with 00 msec gaps in between, that continually repeat. Low frequency oscillators such as this may be useful on the test bench, or it may simply be used to drive an LED in order to attract attention. These are just a few of the many applications possible with the ELM Enjoy! 4 3 2 1 8 Figure 8. Power on delay 4 3 2 1 8 Figure 9. Power on pulse 4 3 2 1 8 Figure 10. Low frequency oscillator 8 of 8