Go Down

Topic: Pull up or down ? (Read 1 time) previous topic - next topic

DaveO

Hi all.

Complete newbee. little electronics experience. programmer. new Arduino Mega on its way to me.

I understand the logic of a pull up or pull down resistor, and what happens if I don't use one.

Have browed the 20 pages of topics under the 'General Electronics' forum, but can't seem to find the answers to 2 simple question :

1. what is the correct value resistor to use ?

2. why ( is there a calculation for determining the correct value ) ?

Also, is it best to use the built-in pull-up, or add an external resistor ?

frank26080115

#1
Apr 05, 2011, 07:40 am Last Edit: Apr 05, 2011, 07:42 am by frank26080115 Reason: 1
http://www.sparkfun.com/tutorials/218

built-in resistors are obviously for convenience, if you don't have a reason not to use them, then use them
Freelance engineer, consultant, contractor. Graduated from UW in 2013.

DaveO

Many Thanks.

I believe I now understand this.

Grumpy_Mike

Quote
1. what is the correct value resistor to use ?

There is no "right answer". It is a compromise between current wasted, noise immunity and drive capacity of the device feeding into the input.

Quote
is there a calculation for determining the correct value

It's just ohms law, the trick is knowing how much current you want at the correct voltage.
If you only pull up to the exact voltage of the logic threshold then any noise will trigger the input. So pull up further gives you immunity against picked up noise.

However the up shot is that you can use between 1K to 10K on an arduino quite happily.

Using LS TTL circuits this is the same for a pull up but TTL inputs require you to sink 2mA for a pull down so then the biggest pull down you could have was a lot lower.

Yankee

So, is there a down-side to using the internal pullups?

retrolefty


So, is there a down-side to using the internal pullups?


Not for interfacing with simple switch contacts. No external components or board space taken up, what's not to like about that.

Lefty


frank26080115


So, is there a down-side to using the internal pullups?


They are only pull-up, they can't be pull-down

You don't choose the resistance

You don't choose the voltage to pull to
Freelance engineer, consultant, contractor. Graduated from UW in 2013.

retrolefty

Quote
You don't choose the voltage to pull to


What choice do you have other then the chip's Vcc voltage with active sink and source output pins?

Lefty

Coding Badly

Quote
What choice do you have other then the chip's Vcc voltage with active sink...


Uh oh.  I've been working on an idea that relies on sinking a lower voltage than VCC.  I was hoping I could...

- Have a connection between two processors.  One processor running at 5 volts the other running at 3 volts.

- Connect a pull-up to the shared line to hold it at 3 volts.

- Signal from the high-voltage processor to the low-voltage processor by sinking the line on the high-voltage processor.  The high-voltage pin would either be an input (high-impedance; line pulled-up to 3 volts) or a low output (sink).

Is that a problem?

retrolefty

Quote
The high-voltage pin would either be an input (high-impedance; line pulled-up to 3 volts) or a low output (sink).
Is that a problem?


That sounds like it should be OK. The potential problem is if the high voltage pin was made an output and made high, then the low voltage pin would see the high voltage.

Lefty

Coding Badly

Got it.  Thanks.  (My apologies for the sidebar)

frank26080115


Quote
You don't choose the voltage to pull to


What choice do you have other then the chip's Vcc voltage with active sink and source output pins?

Lefty



That was my point

But with external resistors, you can pull to whatever voltage you want
Freelance engineer, consultant, contractor. Graduated from UW in 2013.

retrolefty

Quote
That was my point

But with external resistors, you can pull to whatever voltage you want


But you missed my point. When would it be proper to ever pull-up a arduino digital output pin to a voltage higher or lower then the Vcc voltage of the chip? Arduino output pins are not open collector type output pins.


Lefty


frank26080115


Quote
That was my point

But with external resistors, you can pull to whatever voltage you want


But you missed my point. When would it be proper to ever pull-up a arduino digital output pin to a voltage higher or lower then the Vcc voltage of the chip? Arduino output pins are not open collector type output pins.


Lefty




An ATmega running at 5V with an I2C bus interface to a 3.3V device would require external pull-up resistors connected to 3.3V
Freelance engineer, consultant, contractor. Graduated from UW in 2013.

Grumpy_Mike

Quote
would require external pull-up resistors connected to 3.3V

Yes and a hack to the I2C library to not enable the internal pullups.

Go Up
 

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.
Name:
Email:

shortcuts: alt+s submit/post or alt+p preview