ELM415 Up/Down Interface Description Features The ELM415 is an 8 pin device that simplifies the connections between a pushbutton type human interface and many counter-based circuits. Counter circuits are often employed for such things as temperature control, audio volume control, level settings etc., but some require a direction and a step input, which are not intuitive for human operators. With the ELM415, all you need do is provide two pushbuttons - one to increase the count, and one to decrease it. The IC will provide the pushbutton debouncing, direction translation, and the count (step) output generation, all with little more than having power provided to it. Additionally, special functions such as multiple switch press detection, autorepeat, providing a minimum setup time, and output level inversion are all provided too. • • • • • • • • Low power CMOS design Wide supply range – 3.0 to 5.5 volts Fully debounced switch inputs Internal pullup resistors provided Protection from simultaneous key presses High current drive outputs User selectable automatic repeat function Selectable Count output polarity Connection Diagram PDIP and SOIC (top view) Applications • • • • • Digital audio potentiometer controls Variable voltage or temperature circuits Motor positioning controls Single-stepping control circuits Reset circuits VDD 1 8 VSS Up/Down 2 7 DownSw Count 3 6 UpSw Invert 4 5 Repeat Block Diagram VDD Debounce Circuit 7 DownSw reset Latch VDD 6 Up/Down 2 set Debounce Circuit UpSw Pulse Generator Logic Repeat ELM415DSB 5 Elm Electronics – Circuits for the Hobbyist www.elmelectronics.com Output Control 3 4 Count Invert 1 of 5 ELM415 Pin Descriptions VDD (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. Invert (pin 4) This input controls the quiescent output level at pin 3 (the Count output). If low, the level at pin 3 will also normally be low, pulsing momentarily to a high level when a button is pressed. Setting this pin high causes pin 3 to rest at a high level, with the output pulses momentarily going low. Up/Down (pin 2) This is the count direction output, which changes state depending on which pushbutton input is active. An UpSw input will cause this output to go to a high level (after the debounce period), while a DownSw input will cause it to go to a low level. The output remains at that level until the alternate pushbutton is pressed. When the Up/Down output level does change, internal circuitry ensures that the change occurs about 1 msec prior to an active pulse appearing on Count. Repeat (pin 5) This input controls the circuit response should one of the pushbuttons be continuously pressed. If this pin is at a low level, there will only be a single Count output generated, no matter how long the button stays pressed. If this pin is at a high level, a single pulse is output, then after a short delay, a continuous stream of pulses are generated for as long as the button is held. Count (pin 3) This pin outputs a short pulse in response to one of the two pushbuttons being pressed. Simultaneous pressing of both switches results in no Count output. The width of the output pulse is fixed, but the polarity can be changed depending on the level at the Invert input. This output is used to ‘clock’ the controlled counter circuit. Multiple outputs (similar to a keyboard autorepeat) can be generated if the Repeat input is at a high level. UpSw (pin 6) and DownSw (pin 7) The pushbuttons are connected between these pins and circuit common (VSS). Internal pullup resistors are provided to bias the input when no button is pressed, simplifying the circuitry required. These are standard CMOS inputs, so the use of external delay components (capacitors, etc.) is not recommended. VSS (pin 8) Circuit common is connected to this pin. This is the most negative point in the circuit. 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............................... ELM415P 208 mil SOIC..................................... ELM415SM All rights reserved. Copyright 2002, 2010 Elm Electronics. 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. ELM415DSB Elm Electronics – Circuits for the Hobbyist www.elmelectronics.com 2 of 5 ELM415 Absolute Maximum Ratings Storage Temperature....................... -65°C to +150°C Ambient Temperature with Power Applied....................................-40°C to +85°C Voltage on VDD with respect to VSS............ 0 to +7.0V 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. Voltage on any other pin with respect to VSS........................... -0.6V to (VDD + 0.6V) Electrical Characteristics All values are for operation at 25°C and a 5V supply, unless otherwise noted. For further information, refer to note 1 below. Characteristic Minimum Typical Supply voltage, VDD 3.0 5.0 VDD rate of rise 0.05 Maximum Units 5.5 1.4 Conditions V V/ms see note 2 mA see note 3 Average supply current, IDD 0.8 Output low voltage 0.3 V Current (sink) = 10 mA Output high voltage 4.2 V Current (source) = 10 mA Internal pullup resistance 20 30 50 KΩ Debounce period 25 30 35 msec see note 5 see note 6 Up/Down to Count setup time 1 msec Count output pulse width 1 msec Delay before Count autorepeat 800 msec Count repeat rate 6.7 Hz Pins 6 & 7, see note 4 Notes: 1. This integrated circuit is based on a Microchip Technology Inc. PIC12C5XX device. For more detailed specifications, please refer to the Microchip documentation (www.microchip.com). 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. Pullup resistor currents (pins 6 and 7) are not included in this figure. 4. The value of the internal pullup resistance is both supply and temperature dependent. 5. The time for which the input must remain stable before it is considered valid by internal logic. 6. The Up/Down output will be stable for this time period before a Count (pin 3) pulse is output. ELM415DSB Elm Electronics – Circuits for the Hobbyist www.elmelectronics.com 3 of 5 ELM415 Example Applications Figure 1 shows the ELM415 used to interface two pushbutton switches to an ELM310 stepper motor controller, so that the motor position can be manually controlled. For simplicity, the stepper motor and its drive transistors are not shown in the diagram. Notice that the ELM415’s pin 5 has been tied to VDD in order to enable the automatic repeat function, allowing the motor to move ‘continuously’ if a button is held down. Since there are internal pullup resistors, the two pushbuttons have been connected directly to the inputs without the need for further support circuitry. One of the biggest advantages to using an ELM415 for this circuit is the debounce feature provided on the pushbutton inputs. Integrated circuits such as the ELM310 respond very quickly to inputs and are capable of following switch bounce (even if the stepper motor is not). If you do not provide this extra filtering of the switch levels, you would almost certainly be guaranteed very erratic motor behaviour. A +5V +5V 1 8 2 7 B 5 4 3 6 C 6 3 4 5 D 7 2 8 1 To winding drive circuits Clockwise +5V Counter clockwise Figure 1. Controlling a stepper motor The circuit of Figure 2 is very similar to the one above, but it uses an Analog Devices AD5220 Digital Potentiometer as the controlled device. The up and down pushbuttons are used to ‘move’ the wiper between the two ends (pins 3 and 6). As shown, when stepped in the Up direction, the AD5220 moves the wiper towards the pin 3 end of the pot, while Down moves it towards pin 6. The AD5220 expects a Count input signal that is normally low, but pulses to a high level for a change in resistance (so there is no need to invert the Count signal, and pin 4 can be connected to VSS). Some devices, such as the Maxim MAX5160, require an inverted Count signal, which can be provided by simply tying pin 4 to VDD instead of VSS. VDD 5 4 6 3 7 2 Up VDD 1 2 8 AD5220 7 VDD 8 Down 1 3 6 4 5 Figure 2. Controlling a digital potentiometer ELM415DSB Elm Electronics – Circuits for the Hobbyist www.elmelectronics.com 4 of 5 ELM415 Example Applications (cont’d) A variation of Figure 2 is shown in Figure 3. It uses series resistors on the pushbutton inputs, and has also had its autorepeat function modified slightly. This circuit assumes that the pushbuttons are to be mounted at a distance from the ELM415, which is why the series resistors have been added. This is a good practice to follow whenever working with CMOS circuits that might be exposed to electrostatically induced charges, as could be the case due to the extra wiring for the switches. The resistors help to limit induced currents which will flow through the IC’s internal protection diodes during a discharge, and in doing so will reduce the chance of latchup problems. Generally, we recommend that protection resistors be installed close to the IC whenever wiring is to extend 1KΩ 5 4 6 3 7 2 from the circuit by more than about twelve inches. The other difference between the circuits of Figures 2 and 3 is the connection between pins 5 and 6. This can best be explained by considering that in Figure 3, due to the internal pullup resistor on pin 6, pin 5 will normally be at VDD (enabling the repeat function). When the Down button is pressed, the autorepeat function will remain enabled, and multiple pulses will be output. When the Up button is pressed, however, it will pull both pins 5 and 6 low, disabling the autorepeat and allowing only a single pulse to be generated. This is useful if one wants the user to explicitly press a button for each advance in one direction, but will allow a rapid transition to a ‘safe’ position when the other button is pressed. This may be a desireable feature if controlling the temperature in a heater circuit, for example. VDD 1 8 1KΩ Up 2 AD5220 7 VDD 8 1 Down 3 6 4 5 Figure 3. Controlling a digital potentiometer (with rapid down) Our final example shows how easily one can use the ELM415 as a ‘one-shot’ or monostable multivibrator in a reset circuit. Often one has the need to reset a circuit using a pushbutton, but multiple resets due to bouncing switches would be an Reset 5 4 6 3 7 2 8 1 Reset Output VDD annoyance. Using the circuit of Figure 4, one can generate a single clean reset pulse whenever the pushbutton is pressed. If the circuit needs a negativegoing pulse, simply connect pin 4 to VDD rather than VSS. Hopefully this has provided you with several ideas for using the ELM415 in your next project. Perhaps you might consider using it to reset a timer whenever a contact closes, or to count switch closures, or to determine an object’s direction based on the order in which the two switches operated… Figure 4. Manual reset circuit ELM415DSB Elm Electronics – Circuits for the Hobbyist www.elmelectronics.com 5 of 5