Maker Pro
Maker Pro

Are pull up / pull down mandatory ?

johnny_cash

Aug 13, 2013
39
Joined
Aug 13, 2013
Messages
39
Hello,

Let's state about my schema:

3 Poles switch (SP3T) that could select:
logical 1 VCC
logical 0 GND
external input

as my input.

My input then go to a buffer. The buffer ouput is wired on resistor + led to GND.

I'm wondering if i need pullup (for logical entry 0), pulldown (for logical entry 1). The switch commutation is manual, so user will need to either choose a level or external input, then work with. What is the design rule in such a case ?

Is 10k suitable ?
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
It would help if you showed a circuit diagram.

It is always a good idea not to connect a buffer's input directly to VCC or GND but to use a Pull-Up or Pull-down resistor. This will protect the input of the buffer in case of spurious events on the power supply.

Another point is the third position of your switch: You should ensure that an open input will still lead to a defined signal at the buffer. Therefore you should place either a Pull-Up or Pull-Down on that line, too.

10k is o.k. for the VCC and GND connections.
What value is suitable for the third position depends on th eimpedance of your external source. As a rule of thumb use at least 10*Rsource or 10k, whichever is higher.
 

johnny_cash

Aug 13, 2013
39
Joined
Aug 13, 2013
Messages
39
You are right. Here is my diagram, what do you think about it ?
INPUT LINE A is something that i must not change, and the signal is normally pull'ed before it comes on my connector.

/!\ EN and D are inversed on my drawing, sorry for the mistake - it is not on final circuit
/!\ this is a 74HC125, not HCT - which as far as i see is only 5v VCC sorry
 

Attachments

  • pu_pd.jpg
    pu_pd.jpg
    86.8 KB · Views: 245
Last edited:

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
and the signal is normally pull'ed before it comes on my connector.
That's fine, but what happens if the switch is in the senter position and nothing is connected? If you use a 100k Pull-Up (for example), any decent driver connected to input_A will easily be able to pull that line low - or vice versa.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
As far as I can see, the two 10K resistors that you call pullup and pulldown are doing absolutely nothing (except wasting 330uA of current.) They are simply 10 K resistors from power to ground. If you wanted a pullup or pulldown it should be on the other side of the switch, i.e. connected directly to the input.

Bob
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
Yup, an oversight on my side. Remove the connections from the switch to Vcc and GND, use only the pull-up and pull-down resistors.
 

johnny_cash

Aug 13, 2013
39
Joined
Aug 13, 2013
Messages
39
Thank you. I totally see the point. Using now a 100k pull down to the right side on the switch and it avoids to have an entry not connected.

For my knowledge, if i connect an input without pullup/down to a tri-state buffer output in high Z, is it really considered as an open input ?
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Thank you. I totally see the point. Using now a 100k pull down to the right side on the switch and it avoids to have an entry not connected.

For my knowledge, if i connect an input without pullup/down to a tri-state buffer output in high Z, is it really considered as an open input ?
Yes, when using tri-state you must have a pullup or pulldown. When using open collector you must have a pullup, or you will never see a high state.

Bob
 

johnny_cash

Aug 13, 2013
39
Joined
Aug 13, 2013
Messages
39
BobK, if i have, let's say eight IO pins from microcontroller, and i want each of them to light a 20mA LEDs if logic level 1.

I was first thinking driving an NPN transistor with R+LED on C/E , but could i replace this by octo-buffer in opendrain, thus avoiding the transistor stuff ?

I think it could be better.

Thank you, JC
 
Last edited:

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Some microcontrollers can put out 20ma on a pin without a buffer. Which one are you using?

Bob
 
Top