At 05:11 1998-10-29 +1000, Paul Webster wrote: >Dave Johnson wrote: > >> I need to make a push button "toggle": push goes high, next push goes >> low, and so on. > > Well, we will all tell you how to do it in software, so I might just >mention the hardware solutions - use a single gate from a 74HC14 or >two gates which do not then *need* to be Schmidt. > > 2M2 ohm 2M2 ohm > *------/\/\/------* *---/\/\/------* > | | | | > | ___ PB |\ | | ___ PB |\ | |\ > +--o o-----+-| o--+----O out +--o o---+-| o-+-| o-+-O out > | | |/ | | |/ |/ | > | | 1/6 74HC14 | | 74HC14 | > --- 0.47µF | --- 0.47µF| | > --- | --- | | > | 220k ohm | 220k ohm | | 100k ohm | > +--/\/\/---+---/\/\/---Vcc | *--/\/\/----* > | gnd > gnd -snip- Two soles sharing the same thought :) I described the right one in my previous posting but was too lazy to make ASCII art -this is nice drawn :) For the left one: Yes i have had it working too, but it is sensible to glitches as V/2 is close to V/3 and 2V/3. Especially as the scmidt trigger input is the wire that goes to pusbutton, and might catch much EMI. Another problem is that the schmidt-trigger levels are not guaranteed very preceisely at all by the manufacturers, and i wouild not be surprised if some schmidt-trigger inverters in real life would have one level at around V/2... The design is neat, but I would not ship that design to customer. Also, often the extra inverter in the right solution is cheaper than the saved resistor, compared to the left solution. Substitute the inverter in the left solution with a 555 timer ckt and the trig levels will be guaranteed. (Still it is more EMI sensitive than right solution though) in= 2&6; out = 3; 1=GND; Vdd=8; use pin 7 and resistor to drive a LED. Pin 4 to system reset (low) or tie to Vdd. The right one is the right one (what a language...) to use ;) /Morgan Morgan Olsson ph +46(0)414 70741 MORGANS REGLERTEKNIK fax +46(0)414 70331 H€LLEKS (in A-Z letters: "HALLEKAS") SE-277 35 KIVIK, SWEDEN mrt@iname.com ___________________________________________________________