Forums

Protecting a CMOS gate input

Started by Pimpom May 15, 2020
On Fri, 15 May 2020 16:23:57 +0530, Pimpom <nobody@nowhere.com> wrote:

>I'm going to use a CMOS bistable chip (not a uP) that's to be >manually triggered from time to time by a mechanical switch. It >has a debouncing circuit but since the switch is to be connected >by a removable jack-and-cable set and operated by non-techno >savvy users, I thought I'd include a few extra components as a >precaution. > >The input will have a series resistor followed by a capacitor to >ground and schottky diodes to Vdd and Vss. Do you think any of >this is superfluous since the chip already has similar protection >built-in?
If you expect/experience static discharges, the network might avoid failures. Best to not expose any semiconductor the the outside world. If you expect ESD zaps to change the state of a cross-coupled gate flop, put a cap on one output to ground. -- John Larkin Highland Technology, Inc Science teaches us to doubt. Claude Bernard
On Friday, May 15, 2020 at 9:16:08 AM UTC-4, Pimpom wrote:
> On 5/15/2020 5:54 PM, Ricky C wrote: > > On Friday, May 15, 2020 at 8:02:16 AM UTC-4, Pimpom wrote: > >> On 5/15/2020 5:20 PM, Ricky C wrote: > >>> On Friday, May 15, 2020 at 7:35:54 AM UTC-4, Pimpom wrote: > >>>> On 5/15/2020 4:37 PM, Ricky C wrote: > >>>>> On Friday, May 15, 2020 at 6:54:08 AM UTC-4, Pimpom wrote: > >>>>>> I'm going to use a CMOS bistable chip (not a uP) that's to be > >>>>>> manually triggered from time to time by a mechanical switch. It > >>>>>> has a debouncing circuit but since the switch is to be connected > >>>>>> by a removable jack-and-cable set and operated by non-techno > >>>>>> savvy users, I thought I'd include a few extra components as a > >>>>>> precaution. > >>>>>> > >>>>>> The input will have a series resistor followed by a capacitor to > >>>>>> ground and schottky diodes to Vdd and Vss. Do you think any of > >>>>>> this is superfluous since the chip already has similar protection > >>>>>> built-in? > >>>>> > >>>>> If you are connecting this to the external world nothing is superfluous. You might add a front end bipolar transistor, a zener diode or TVS or maybe even a gas discharge tube depending on the environment. > >>>>> > >>>>> I'm curious about what a "CMOS bistable chip" is exactly. I assume you are not talking about an SR FF? If so, you don't really need debouncing. Why use CMOS rather than something more static resistant like relays or fluidics? > >>>>> > >>>> > >>>> It's a good old 4013. I used one in a similar sub-circuit years > >>>> ago but in a completely different product. I used a BJT front end > >>>> which also served as an inverter. The present design works > >>>> correctly without inversion so I thought I'd do away with the BJT. > >>>> > >>>> I did consider using a relay but it would take up too much PCB > >>>> real estate. I have a very limited choice of relay types I can > >>>> get. Same with the external switch. I can use only an SPST type, > >>>> so an S-R FF is out. > >>> > >>> Huh? Is the FF only to debounce your PB? What puts your CMOS chip in the other state? I'm not following what you are doing at all. I was thinking the PB would connect to one input of the SR and the other input would be the input that resets it. > >>> > >>> I wasn't really serious about the relay. But CMOS is likely your worse choice for connecting to the outside world. There are plenty of TTL FFs out there. > >>> > >> > >> The FF switches two other sub-circuits alternately on and off. > >> The external switch triggers the FF. The debouncing is done in > >> the FF itself (although that may not be needed with the series > >> resistor and cap at the input). Is that clearer? > > > > Not really. Does the switch both set and reset the FF? If so you must be using it on the clk input which means the input does need to be debounced, but the FF can't do that. > > > > What pin of the FF is the switch connected to? What is on the other two or three inputs? > > > > BTW, if you are using an RC to drive the clock input, you can get multiple triggers from any noise in the circuit as the RC will be rising very slowly. > > > > If you are using the clock input with the switch, I suggest you debounce it with the RC and a Schmitt trigger buffer. There are some inexpensive reset devices that will do the debouncing for you without an RC. They will accept an input and apply a delay after release. They are designed as reset devices for MCUs. Essentially they act as retriggerable one shots. Or you could use a 555 timer if you like lots of passives. I think they use five minimum. > > > > Debouncing is not an issue. And the 4013 FF *can* debounce itself > with a single R-C combination. The technique is well known and > I've used it a number of times.
Care to share how the circuit works? I'm not familiar with any non-Schmitt trigger clock input being able to "debounce" itself. That's why I asked what your circuit is. I think it is pretty obvious at this point I'm not on the same page as you. -- Rick C. -+ Get 1,000 miles of free Supercharging -+ Tesla referral code - https://ts.la/richard11209
On Fri, 15 May 2020 14:26:02 +0100, Piglet <erichpwagner@hotmail.com>
wrote:

>On 15/05/2020 11:53, Pimpom wrote: >> I'm going to use a CMOS bistable chip (not a uP) that's to be manually >> triggered from time to time by a mechanical switch. It has a debouncing >> circuit but since the switch is to be connected by a removable >> jack-and-cable set and operated by non-techno savvy users, I thought I'd >> include a few extra components as a precaution. >> >> The input will have a series resistor followed by a capacitor to ground >> and schottky diodes to Vdd and Vss. Do you think any of this is >> superfluous since the chip already has similar protection built-in? > >The schottky diodes may well be superfluous depending on the value of >series resistance. If R is high enough to keep highest expected surge >voltage well below input ESD diode latch-up trigger current. The >parallel C has to be large enough to limit rise time to least many ns >for the diodes to begin forward conduction. Since the input is from a >push button and the input is not edge rate critical you can afford to >massively overdo the series R and shunt C. You haven't mentioned having >a pullup or pull down resistor, generally pushbutton contacts need at >least 100uA "wetting" current to ensure reliable operation. > >piglet
Little resistors can arc over, given a good ESD zap. Some connectors are a lot better than others, in that they connect ground first. -- John Larkin Highland Technology, Inc Science teaches us to doubt. Claude Bernard
On 2020-05-15 09:26, Piglet wrote:
> On 15/05/2020 11:53, Pimpom wrote: >> I'm going to use a CMOS bistable chip (not a uP) that's to be manually >> triggered from time to time by a mechanical switch. It has a debouncing >> circuit but since the switch is to be connected by a removable >> jack-and-cable set and operated by non-techno savvy users, I thought I'd >> include a few extra components as a precaution. >> >> The input will have a series resistor followed by a capacitor to ground >> and schottky diodes to Vdd and Vss. Do you think any of this is >> superfluous since the chip already has similar protection built-in? > > The schottky diodes may well be superfluous depending on the value of > series resistance. If R is high enough to keep highest expected surge > voltage well below input ESD diode latch-up trigger current. The > parallel C has to be large enough to limit rise time to least many ns > for the diodes to begin forward conduction. Since the input is from a > push button and the input is not edge rate critical you can afford to > massively overdo the series R and shunt C. You haven't mentioned having > a pullup or pull down resistor, generally pushbutton contacts need at > least 100uA "wetting" current to ensure reliable operation.
Yup. 1 uF will turn a 20 kV HBM spark into 2 volts. I use that approach with diode lasers quite a lot. Cheers Phil Hobbs -- Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC / Hobbs ElectroOptics Optics, Electro-optics, Photonics, Analog Electronics Briarcliff Manor NY 10510 http://electrooptical.net http://hobbs-eo.com
On 5/15/2020 9:21 PM, Ricky C wrote:
> On Friday, May 15, 2020 at 9:16:08 AM UTC-4, Pimpom wrote: >> On 5/15/2020 5:54 PM, Ricky C wrote: >>> On Friday, May 15, 2020 at 8:02:16 AM UTC-4, Pimpom wrote: >>>> On 5/15/2020 5:20 PM, Ricky C wrote: >>>>> On Friday, May 15, 2020 at 7:35:54 AM UTC-4, Pimpom wrote: >>>>>> On 5/15/2020 4:37 PM, Ricky C wrote: >>>>>>> On Friday, May 15, 2020 at 6:54:08 AM UTC-4, Pimpom wrote: >>>>>>>> I'm going to use a CMOS bistable chip (not a uP) that's to be >>>>>>>> manually triggered from time to time by a mechanical switch. It >>>>>>>> has a debouncing circuit but since the switch is to be connected >>>>>>>> by a removable jack-and-cable set and operated by non-techno >>>>>>>> savvy users, I thought I'd include a few extra components as a >>>>>>>> precaution. >>>>>>>> >>>>>>>> The input will have a series resistor followed by a capacitor to >>>>>>>> ground and schottky diodes to Vdd and Vss. Do you think any of >>>>>>>> this is superfluous since the chip already has similar protection >>>>>>>> built-in? >>>>>>> >>>>>>> If you are connecting this to the external world nothing is superfluous. You might add a front end bipolar transistor, a zener diode or TVS or maybe even a gas discharge tube depending on the environment. >>>>>>> >>>>>>> I'm curious about what a "CMOS bistable chip" is exactly. I assume you are not talking about an SR FF? If so, you don't really need debouncing. Why use CMOS rather than something more static resistant like relays or fluidics? >>>>>>> >>>>>> >>>>>> It's a good old 4013. I used one in a similar sub-circuit years >>>>>> ago but in a completely different product. I used a BJT front end >>>>>> which also served as an inverter. The present design works >>>>>> correctly without inversion so I thought I'd do away with the BJT. >>>>>> >>>>>> I did consider using a relay but it would take up too much PCB >>>>>> real estate. I have a very limited choice of relay types I can >>>>>> get. Same with the external switch. I can use only an SPST type, >>>>>> so an S-R FF is out. >>>>> >>>>> Huh? Is the FF only to debounce your PB? What puts your CMOS chip in the other state? I'm not following what you are doing at all. I was thinking the PB would connect to one input of the SR and the other input would be the input that resets it. >>>>> >>>>> I wasn't really serious about the relay. But CMOS is likely your worse choice for connecting to the outside world. There are plenty of TTL FFs out there. >>>>> >>>> >>>> The FF switches two other sub-circuits alternately on and off. >>>> The external switch triggers the FF. The debouncing is done in >>>> the FF itself (although that may not be needed with the series >>>> resistor and cap at the input). Is that clearer? >>> >>> Not really. Does the switch both set and reset the FF? If so you must be using it on the clk input which means the input does need to be debounced, but the FF can't do that. >>> >>> What pin of the FF is the switch connected to? What is on the other two or three inputs? >>> >>> BTW, if you are using an RC to drive the clock input, you can get multiple triggers from any noise in the circuit as the RC will be rising very slowly. >>> >>> If you are using the clock input with the switch, I suggest you debounce it with the RC and a Schmitt trigger buffer. There are some inexpensive reset devices that will do the debouncing for you without an RC. They will accept an input and apply a delay after release. They are designed as reset devices for MCUs. Essentially they act as retriggerable one shots. Or you could use a 555 timer if you like lots of passives. I think they use five minimum. >>> >> >> Debouncing is not an issue. And the 4013 FF *can* debounce itself >> with a single R-C combination. The technique is well known and >> I've used it a number of times. > > Care to share how the circuit works? I'm not familiar with any non-Schmitt trigger clock input being able to "debounce" itself. That's why I asked what your circuit is. I think it is pretty obvious at this point I'm not on the same page as you. >
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.
On Friday, May 15, 2020 at 12:14:44 PM UTC-4, Phil Hobbs wrote:
> On 2020-05-15 09:26, Piglet wrote: > > On 15/05/2020 11:53, Pimpom wrote: > >> I'm going to use a CMOS bistable chip (not a uP) that's to be manually > >> triggered from time to time by a mechanical switch. It has a debouncing > >> circuit but since the switch is to be connected by a removable > >> jack-and-cable set and operated by non-techno savvy users, I thought I'd > >> include a few extra components as a precaution. > >> > >> The input will have a series resistor followed by a capacitor to ground > >> and schottky diodes to Vdd and Vss. Do you think any of this is > >> superfluous since the chip already has similar protection built-in? > > > > The schottky diodes may well be superfluous depending on the value of > > series resistance. If R is high enough to keep highest expected surge > > voltage well below input ESD diode latch-up trigger current. The > > parallel C has to be large enough to limit rise time to least many ns > > for the diodes to begin forward conduction. Since the input is from a > > push button and the input is not edge rate critical you can afford to > > massively overdo the series R and shunt C. You haven't mentioned having > > a pullup or pull down resistor, generally pushbutton contacts need at > > least 100uA "wetting" current to ensure reliable operation. > > Yup. 1 uF will turn a 20 kV HBM spark into 2 volts. I use that > approach with diode lasers quite a lot.
Yes, but he is talking about plugging in a cable with who knows what potential on it. It can be a lot more capacitance than the HBM. The HBM and other models are intended to be approximations to some set of conditions that may or may not represent actual conditions of any given use case. If I am not mistaken, the HBM spark is just that, a spark where much of the energy is dissipated into the spark rather than the equipment... or do I have it wrong? The surge from the actual contact with a conductor may well deliver a lot more energy than the HBM. It has been a while since I worked with this stuff but I seem to recall the peak voltage, peak current and peak power were not all related directly since the load responds in a non-linear way. The bottom line is an ounce of prevention is worth a pound of "oh, crap!" I'd rather overdesign than under design protection. I think I would use a series resistor, a Zener diode and a capacitor, possibly on a separate board or at least an isolated ground region, to prevent ground current surges from disrupting the operation of the circuit. I also would not use a CMOS device as the first active device. Even with their built in protection they are too easily damaged. Running from one board to another in the same cabinet is one thing. From something on the other end of an external cable is another. -- Rick C. ++ Get 1,000 miles of free Supercharging ++ Tesla referral code - https://ts.la/richard11209
On 5/15/2020 6:56 PM, Piglet wrote:
> On 15/05/2020 11:53, Pimpom wrote: >> I'm going to use a CMOS bistable chip (not a uP) that's to be manually >> triggered from time to time by a mechanical switch. It has a debouncing >> circuit but since the switch is to be connected by a removable >> jack-and-cable set and operated by non-techno savvy users, I thought I'd >> include a few extra components as a precaution. >> >> The input will have a series resistor followed by a capacitor to ground >> and schottky diodes to Vdd and Vss. Do you think any of this is >> superfluous since the chip already has similar protection built-in? > > The schottky diodes may well be superfluous depending on the value of > series resistance. If R is high enough to keep highest expected surge > voltage well below input ESD diode latch-up trigger current. The > parallel C has to be large enough to limit rise time to least many ns > for the diodes to begin forward conduction. Since the input is from a > push button and the input is not edge rate critical you can afford to > massively overdo the series R and shunt C. You haven't mentioned having > a pullup or pull down resistor, generally pushbutton contacts need at > least 100uA "wetting" current to ensure reliable operation. > > piglet >
Here's some data: Vdd is 12V. Series R is tentatively 10k with a parallel R of 100k which is also the pull-down resistor. Parallel C to be decided.
On Friday, May 15, 2020 at 1:02:52 PM UTC-4, Pimpom 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.
I haven't seen that circuit before. It's a good one. I would suggest a couple of things if you are interested. I don't know the environment this is going in and I don't know anything about the cable, but in general such an external cable can be a source of noise. So I would not reference the switch to Vcc. I would use ground. Since you are using a mechanical switch there *will* be bounces, so the polarity of the clock won't matter. If you are concerned it may be connected to something that doesn't bounce you can find negative edge D FFs although I only know of one, a 74xx72. Using ground as your connection point will provide less noise and better protection. While Vcc is good for higher frequency decoupling, that is only because of the decoupling added to the board. I don't know if this will be significant in your design or not. I would definitely use a Zener diode and cap with a high value series resistor. The world is an ugly place when you are a semiconductor. -- Rick C. --- Get 1,000 miles of free Supercharging --- Tesla referral code - https://ts.la/richard11209
On 5/15/2020 11:18 PM, Ricky C wrote:
> On Friday, May 15, 2020 at 1:02:52 PM UTC-4, Pimpom 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. > > I haven't seen that circuit before. It's a good one. I would suggest a couple of things if you are interested. I don't know the environment this is going in and I don't know anything about the cable, but in general such an external cable can be a source of noise. So I would not reference the switch to Vcc. I would use ground. Since you are using a mechanical switch there *will* be bounces, so the polarity of the clock won't matter. If you are concerned it may be connected to something that doesn't bounce you can find negative edge D FFs although I only know of one, a 74xx72. > > Using ground as your connection point will provide less noise and better protection. While Vcc is good for higher frequency decoupling, that is only because of the decoupling added to the board. I don't know if this will be significant in your design or not. > > I would definitely use a Zener diode and cap with a high value series resistor. > > The world is an ugly place when you are a semiconductor. >
Perhaps I altered the circuit a bit too much in the drawing in an attempt for clarity. As mentioned earlier, my previous uses of the technique usually had a BJT front end which served as both a protective buffer and an inverter. The switch acted between the BJT base and ground. This one is different in that Vdd is ground and Vss is -12V so that the pull-up is actually to ground. This makes it convenient to connect the switch between the FF input and ground. The cable will be a shielded one. Your suggestion for input protection is noted and appreciated.
On Friday, May 15, 2020 at 2:15:04 PM UTC-4, Pimpom wrote:
> On 5/15/2020 11:18 PM, Ricky C wrote: > > On Friday, May 15, 2020 at 1:02:52 PM UTC-4, Pimpom 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. > > > > I haven't seen that circuit before. It's a good one. I would suggest a couple of things if you are interested. I don't know the environment this is going in and I don't know anything about the cable, but in general such an external cable can be a source of noise. So I would not reference the switch to Vcc. I would use ground. Since you are using a mechanical switch there *will* be bounces, so the polarity of the clock won't matter. If you are concerned it may be connected to something that doesn't bounce you can find negative edge D FFs although I only know of one, a 74xx72. > > > > Using ground as your connection point will provide less noise and better protection. While Vcc is good for higher frequency decoupling, that is only because of the decoupling added to the board. I don't know if this will be significant in your design or not. > > > > I would definitely use a Zener diode and cap with a high value series resistor. > > > > The world is an ugly place when you are a semiconductor. > > > > Perhaps I altered the circuit a bit too much in the drawing in an > attempt for clarity. As mentioned earlier, my previous uses of > the technique usually had a BJT front end which served as both a > protective buffer and an inverter. The switch acted between the > BJT base and ground. > > This one is different in that Vdd is ground and Vss is -12V so > that the pull-up is actually to ground. This makes it convenient > to connect the switch between the FF input and ground. The cable > will be a shielded one. > > Your suggestion for input protection is noted and appreciated.
OK, if the input is ground referenced that's great. The BJT front end will also be very good or at least better than directly connecting to CMOS. I know I've had bad experiences with inputs from arbitrary sources. A board I'm building now receives a similar input from a push to talk mic button. It goes into an RS-422 receiver through a 4.7K resistor and has all manner of self protection built into the chip. It is specifically designed for connection to cables. This board goes in a rack of equipment and I literally have no idea where the signal comes from. Never had a board returned for a bad part. I did have a handful of bad connectors once though. Connectors... ptooey! -- Rick C. --+ Get 1,000 miles of free Supercharging --+ Tesla referral code - https://ts.la/richard11209