Forums

Protecting a CMOS gate input

Started by Pimpom May 15, 2020
On Sunday, May 17, 2020 at 5:51:17 PM UTC-4, Tom Del Rosso wrote:
> Ricky C wrote: > > On Sunday, May 17, 2020 at 12:12:18 AM UTC-4, Tom Del Rosso wrote: > >> Ricky C wrote: > >>> On Saturday, May 16, 2020 at 8:02:45 AM UTC-4, Jasen Betts wrote: > >>>> On 2020-05-15, Pimpom <nobody@nowhere.com> wrote: > >>>> > >>>>> Okay, here it is - somewhat simplified and slightly different > >>>>> from my actual circuit, but not in any way that changes the > >>>>> operating principles: > >>>>> https://www.dropbox.com/s/juomu98oyz1vxec/Debounced%20flip-flop.png?dl=0 > >>>>> > >>>>> C2 & R3 do the debouncing, C1 & R2 set the initial state of the > >>>>> flip-flop. > >>>> > >>>> Ah, it's similar to the feeback debounce used with dual-inverter > >>>> bistables. eg: https://i.stack.imgur.com/yDeFm.png > >>>> > >>>> But your circuit allows the switch be be connected to a > >>>> power node at one end, which is a nice feature, also not > >>>> free-running if the switch is held. > >>> > >>> Not free running, but if the switch is held long enough the opening > >>> of the switch can also bounce and toggle the circuit back to the > >>> original state. Make the time constant very long to deal with this > >>> issue and that sets a limit to the time before the FF state can be > >>> changed again. > >>> > >>> The inherent limitation of this circuit is that the RC timer and FF > >>> are being used to debounce the control, the FF is also being used to > >>> remember a state controlled by the debounced button. The circuit > >>> really needs two FFs, one to debounce and one to remember the state. > >>> Then the timeout can be as short as the max bounce period and no > >>> need to worry about how long a user holds the button. > >>> > >>> Rather than two FFs, a simple approach might be to use the RC on the > >>> switch input and a FF with a Schmitt trigger clock input. The RC > >>> will provide a slowly changing input which the Schmitt trigger input > >>> will accept without bouncing. Tie the Qn to the D and you get > >>> transitions on every button press. The only issue is the RC delay > >>> is added to detection of the input change. For real world push > >>> buttons that's not normally an issue. For machine controlled > >>> switches it may be a problem. > >> > >> You mean like this, to prevent toggling again on release? > >> > >> > >> ^ > >> | > >> | > >> R 1M > >> | | > >> | _|_ |-----| > >> +---X X---+---------|> Q|------- > >> | | | _| > >> | | |---|D Q|---| > >> | | | |-----| | > >> | | | | > >> === 1uF R 1K +------R------| > >> | | | 100K > >> | | === 1uF > >> | | | > >> |---------+-----+ > >> | > >> ----- > >> --- > >> - > > > > I don't think that is quite right. This way there is no debouncing > > of the voltage from the cap. The cap has to be on the clock input > > and then the resistors need to be swapped. 1 second RC might be a > > bit long. 1K from the switch to ground with the switch feeding the > > clock input with 100K and 1.0uF to power. This requires a negative > > edge clock. Or run the switch to power and let the cap and discharge > > resistor go to ground. > > > > The switch can be the only thing on the end of the cable and the > > switch resistor can be in the unit as the series limiting resistor. > > > > > > ^ > > | > > X | > > |=== > > X | > > | |-----| > > +--R1K--+----x---------|> Q|----- > > | | | _| > > | | |---|D Q|---| > > | | | |-----| | > > | |1uF | | > > R100K === +-------------| > > | | > > | | > > | | > > +----+ > > | > > ----- > > --- > > - > > > > The time constant on the Qn feedback to the D is not needed at all > > then. The RC does the debouncing (as long as the clock input is a > > Schmitt trigger) and the FF just needs to toggle. > > > > Am I missing something? > > That has a slow rise and a slower fall. The circuit I posted (which was > one of a compendium of past SED toggle circuits that Win posted) has the > problem of a slow fall-time if the button is held. I haven't seen any > debounced toggle circuit that can drive the clock input within its spec, > and also has adequate protection for an outside connection. They are > mutually exclusive.
Not sure what the issue is with protection, but the debounce I suggested requires a schmitt trigger clock input which I stated. If it has that, the circuit will work. Input protection depends on the input spec. We don't have one, so of course there will be input conditions that will not be met. State an input spec and perhaps I can suggest input conditioning circuits to protect the circuit.
> If it was me, I'd use a bipolar in addition to a resistor, cap, and > zener diode for protection. A pair of biploars can provide the > non-inverting logic that Pimpom needs, and a pair of bipolars can also > have a little positive feedback to make it a Schmitt, and provide a very > fast rise and fall to the FF. (values are just from mental calculation, > so needs review) > > ^ ^ > | | > | | > 1k 1k > | | > ^ | | > | |----------------x > | | | | > | o | | x--------FF clock > -| | | | > | o | | | > | 4.7k | c > | | x-------b > 1k | | e > | | | | > | | c | > x----x----x---x----b | > | | | e | > | | | | | > | | | | | > 1k =10 ZD 1k | > | |uf | | | > | | | | | > | | | | | > V V V V V > > > But then I remembered the toggle made with only a Schmitt (I just added > the 10k at the button, and split the lower 200k and added a cap for > reset), > > > ^ > | > | > 200k > | > | Schmitt > | o----10k----x---x-----|>o---x------- > --| | | > | o----x---------------1M-----| > | | > | | ^ > | 180k | > | .01 | | > === x-------||-------| > | | .01 > | 20k > | | > +----------| > | > | > v > > and that means a discreet Schmitt can be a toggle by itself with no > 4013.
What makes you think this circuit will work reliably? While it may have a schmitt trigger input that is not enough to assure the idle level will be close enough to the threshold voltage to sit in the state given rather than revert to a default state. The threshold value is specified as a wide range that can vary with process and temperature.
> I was about to modify the discreet circuit for that, but remembered > there were already a few discreet toggles in Win's post. > > It's probably best of all for ruggedness at the input and it can drive a > load if the FET is big. > > > 2002, Win Hill, 20A zero-power transistor + MOSFET switch > (Zero power when off, low when on.) > improvements by Jonathan Kirwan, SPICE by Terry Pinnell > > > ,------+--------------+----------+-----(o)---+---- power > > | C1 | R3 6.8k | | | 7 - 18V > > +| 1uF '--/\/\--, | | __|__ > > === 25V | |/V Q1 __|__ | | > > | R2 +---| 2n4403 / \ D1 | | > > | _|_ 330 | |\ /___\ | LOAD > > +---o o---/\/\--+ | | | | > > | toggle | | R4 22k | |_____| > > | '---- | --/\/\---+ | > > | R1 470k | +-----(o) --' to 15A > > '-----/\/\------------+ | > > | |---' > > | ||<--, Q2 > > +-----||---+ IRF540 etc > > | | > > | R5 6.8k | > > '---\/\/---+-----(o)------ return > > > > Certainly the part values are not optimum. For example, currents > > could be scaled down 10x, increasing all R's by 10 and C1 = 0.1uF > > ceramic. Q2 can be almost any n-channel MOSFET, small to large.
Definitely the R values need to be tweaked to achieve anything like "low" power when on. But I guess in comparison to 15 amps even many mA is "low". -- Rick C. ++- Get 1,000 miles of free Supercharging ++- Tesla referral code - https://ts.la/richard11209