Pages: [1] 2   Go Down
Author Topic: Pull up or down ?  (Read 1487 times)
0 Members and 1 Guest are viewing this topic.
South Africa
Offline Offline
Sr. Member
****
Karma: 2
Posts: 416
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 ?
Logged

0
Offline Offline
God Member
*****
Karma: 0
Posts: 593
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: April 05, 2011, 12:42:06 am by frank26080115 » Logged

Freelance engineer, consultant, contractor. Graduated from UW in 2013.

South Africa
Offline Offline
Sr. Member
****
Karma: 2
Posts: 416
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Many Thanks.

I believe I now understand this.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 626
Posts: 34165
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

St. Louis, Missouri
Offline Offline
Sr. Member
****
Karma: 1
Posts: 279
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

0
Offline Offline
God Member
*****
Karma: 0
Posts: 593
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Freelance engineer, consultant, contractor. Graduated from UW in 2013.

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 207
Posts: 12917
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 207
Posts: 12917
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
God Member
*****
Karma: 0
Posts: 593
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Freelance engineer, consultant, contractor. Graduated from UW in 2013.

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

0
Offline Offline
God Member
*****
Karma: 0
Posts: 593
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Freelance engineer, consultant, contractor. Graduated from UW in 2013.

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 626
Posts: 34165
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1] 2   Go Up
Jump to: