Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Digital chip input handling

carbonzit

Well-Known Member
Couple questions regarding handling the inputs to digital ICs (the chips I'm using are all in the CD4xxx series).

1. I have a project where I'm using a 4013 as a latch, and I want it to come up in the unset state when I power it on. I'm using this arrangement, which seems to work OK:

Power-on reset.gif


Question is, what values of R and C would be best here? (I don't mean super-optimized, just what will accomplish what I want, which is a reliable reset.) The trade-off here seems to be between A) a small C giving a shorter pulse vs a larger C, and B) a small R giving a faster pulse but loading the input more.

Basically, are these values in the ballpark?

Yes, yes, I know there are probably better ways to do this, like a one-shot, a 555 or something, but I'd rather keep this as simple as possible and not have to add another chip. It's not a precision application.

2. In the same project I'm setting the flip-flop by using a pushbutton switch connected to the set input. Since there's nothing else connected (no other gate), do I need to add a resistor to ground so that this input doesn't float when the switch is open? Would the same (4.7K) value be good here?

(Anticipating replies: no, debouncing isn't needed here. Multiple pulses don't matter.)
 
Couple questions regarding handling the inputs to digital ICs (the chips I'm using are all in the CD4xxx series).

1. I have a project where I'm using a 4013 as a latch, and I want it to come up in the unset state when I power it on. I'm using this arrangement, which seems to work OK:

View attachment 146801

Question is, what values of R and C would be best here? (I don't mean super-optimized, just what will accomplish what I want, which is a reliable reset.) The trade-off here seems to be between A) a small C giving a shorter pulse vs a larger C, and B) a small R giving a faster pulse but loading the input more.

Basically, are these values in the ballpark?

Yes, yes, I know there are probably better ways to do this, like a one-shot, a 555 or something, but I'd rather keep this as simple as possible and not have to add another chip. It's not a precision application.

2. In the same project I'm setting the flip-flop by using a pushbutton switch connected to the set input. Since there's nothing else connected (no other gate), do I need to add a resistor to ground so that this input doesn't float when the switch is open? Would the same (4.7K) value be good here?

(Anticipating replies: no, debouncing isn't needed here. Multiple pulses don't matter.)

Q1 answer:
The reset pulse should be longer than the minimum pulse width at the operating supply voltage.
So V+ in your circuit should be applied to R for at least 180ns@5v.
Below was clipped from the CD4013B datasheet.

1724192784588.png


Q2 answer:

Yes, use a pullup or pulldown resistor as needed. CMOS Inputs should never be left floating.
 
OK, good answer, although I must admit I don't know off the top of my head how to calculate the width of the power-on pulse I'm getting from that cap and resistor; will have to look that up. I thought maybe someone would do that for me (heh).

But regarding the R value and how much current it draws, since there is another gate attached to that input (the output of a 555), at 5 volts that resistor should have ~1mA through it. Does that sound about right? (I'm by no means an experienced digital designer!)
 
I don't get it. Your simulation doesn't look anything like what I showed.

I really don't think I need a Schmitt trigger here.
 
Forget the sim, read the ap notes on slow Tr and Tf in CMOS.

Setup and hold times are affected by that input.....

Almost forgot direct coupling of power supply noise and transients
into reset pin great idea.
 
Last edited:
Why using RC slow Trise, Tfall :

View attachment 146804

As you can see there is a lot of jitter in gate output. That can cause metastable states in
the downstream clocked logic.

Easy to use is single gate logic Schmidt trigger gate that cleans up this using hysteresis internal.





Regards, Dana.

Connect some capacitance across the supply pins.
 
The 4013 S and R inputs are not conditioned with Schmitt triggers. Thus, the input transition level is approx. 50% of Vdd. Thus, assuming Vdd snaps on very rapidly, the pulse width seen by the gate input will be approx. 0.7 x R x C. With 10K and 0.1 uF, that is 693 us. This is plenty long enough for most applications.

And, as with your question about a switch on the other input, if you go with a wider reset pulse that has a slower trailing edge, that slow edge will not affect the stability of the flipflop output.

ak
 
And, as with your question about a switch on the other input, if you go with a wider reset pulse that has a slower trailing edge, that slow edge will not affect the stability of the flipflop output.
Ackshooly, my question there was whether I needed a resistor from that pin to ground to prevent the input from floating when the switch was open, since there's nothing else connected to it.
 
Last edited:
You might check a single shot capture of your reset pulse differentiator
time constants. This sim used a 10 mS ramp for power on, as you can see
no real reset pulse was generated. If supply has small bulk caps, and is
much faster then a decent pulse is generated.

1724239251911.png


Note sims are behavioral, not transistor level, so bench chk is really mandatory.
Just a single shot level trigger should capture and confirm what you have.

When sim was rerun at 10 uS ramp on Vcc a decent pulse occurred.

Attached handbook good section on terminating CMOS inputs and other considerations.


Regards, Dana.
 
Ackshooly, my question there was whether I needed a resistor from that pin to ground to prevent the input from floating when the switch was open, since there's nothing else connected to it.

You mentioned debouncing not being needed. I see now that it was not a specific part of the question.

ak
 
But regarding the R value and how much current it draws, since there is another gate attached to that input (the output of a 555), at 5 volts that resistor should have ~1mA through it. Does that sound about right? (I'm by no means an experienced digital designer!)

If your connecting "R" to the output of a 555, then a resistor might not be needed because the 555 has a push pull output, and so is never floating. However, at low supply voltages, it would be a good idea to use a resistor at "R" input because the 555 BJT version isn't rail-rail output. The BJT 555 should work fine, the CMOS 555, however, is rail-rail output so the logic levels are more compatible with CMOS logic (the output drive is much lower, however, ~50mA@15v).
 
read the ap notes on slow Tr and Tf in CMOS.
That applies to the clocked inputs, not logic functions such as Set or Reset.

Just use an R and C for the reset that has a time-constant significantly longer than the rise-time of the power-on (which can vary with the type of power source and how it is energized).
With CMOS logic, the resistor can be large (e.g. 100kΩ or more).
 
That applies to the clocked inputs, not logic functions such as Set or Reset.

Just use an R and C for the reset that has a time-constant significantly longer than the rise-time of the power-on (which can vary with the type of power source and how it is energized).
With CMOS logic, the resistor can be large (e.g. 100kΩ or more).
This TI & Toshiba apnote discusses it applies to all inputs, attached, as posted prior.

1724274350359.png


Typical recommended max transition rates by families at inputs.

There is another ap note/report on a meta stability study funded heavily by TI back in 70's/80's
in attempt at creating a flop with no issues. $ Millions spent with no luck.

Short answer, do not feed analog like signals into logic.....
 

Attachments

  • slla364a (1).pdf
    680.5 KB · Views: 71
  • application_note_en_20210131_AKX00111.pdf
    1.5 MB · Views: 76
Last edited:
Short answer, do not feed analog like signals into logic....
Well, guess what? I'm violating your rule--happily, I must add--and it's working just fine. I have a pushbutton connected directly to the set input of a flip-flop (as well as the master resets of a couple of counter chips), with absolutely no debouncing, no Schmitt triggers, and for my application it works like a charm.

Just to be clear: I am not advocating this practice for anyone designing production devices. But for my little project it works well, so thanks but no thanks for all the dire warnings.

Maybe you should learn to tailor your responses to the level required of those asking the questions.
 
Well, there are "proper and safe practices" for milspec circuits, and then there are proper and safe practices for hobbyist projects, which I would think are a bit different. One size does not fit all.
 
I have a pushbutton connected directly to the set input of a flip-flop (as well as the master resets of a couple of counter chips), with absolutely no debouncing, no Schmitt triggers, and for my application it works like a charm.

Just to be clear: I am not advocating this practice for anyone designing production devices. But for my little project it works well, so thanks but no thanks for all the dire warnings.

Maybe you should learn to tailor your responses to the level required of those asking the questions.

1. Calm down there, sparky.

2. A pushbutton (switch) is a digital input.

ak
 
2. A pushbutton (switch) is a digital input.
Well, not to quibble too much, but have you seen the waveform for an un-debounced pushbutton? Pretty horrible. So yes, nominally digital: push=on, release=off, but in the real world:
Pushbutton switch bounce.gif

(I guess you could say it's a digital input, but a very, very noisy one!)

Normally you'd take steps to eliminate all that garbage. In my project, it really doesn't matter, since those after-pulses don't do any harm.
 
Your OK to use RC timing components at logic inputs with CD4000 series devices. These devices are much slower than the high speed device series listed in post #14. But RC circuits CAN cause oscillation problems if used at clock inputs, or inputs of buffer/inverter/gates, and the RC rise time is close to 1ms. This is where schmitt trigger inputs should be considered to square off the RC pulse.
 

Latest threads

New Articles From Microcontroller Tips

Back
Top