Author Topic: Why do internal pullup resistor's have a range ?  (Read 4085 times)

0 Members and 1 Guest are viewing this topic.

Offline MathWizardTopic starter

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: ca
Why do internal pullup resistor's have a range ?
« on: October 28, 2024, 08:33:41 am »
For example in the ATtiny13A datasheet, the internal pullup resistor is listed as from 20 to 80k, and no typical value.

So why such a wide range, I'm sure there's fixed resistor's with under 5% tolerance in this MCU. So why not use one for the PU ??, with a known value ??

Or is it just the V/I, taking into account the different voltage losses on the MOSFET the sits on top the Rpu to Vcc ?
« Last Edit: October 28, 2024, 08:40:00 am by MathWizard »
 

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 9370
  • Country: fi
Re: Why do internal pullup resistor's have a range ?
« Reply #1 on: October 28, 2024, 08:37:56 am »
I'm sure there's fixed resistor's with under 5% tolerance in this MCU

Accurate resistors are possible to manufacture on an IC, but they are more expensive. For pull-up purposes exact value does not matter at all so they use a cheaper process.
 
The following users thanked this post: MathWizard, tellurium

Offline MathWizardTopic starter

  • Super Contributor
  • ***
  • Posts: 1786
  • Country: ca
Re: Why do internal pullup resistor's have a range ?
« Reply #2 on: October 28, 2024, 08:41:17 am »
So it really is just a high tolerance resistor ?

Ok so don't trust them in voltage divider's then too. I'm just finishing baremetal coding my own I2C program, and yeah I shouldn't trust the PU state, with the series resistors I have going to the EEPROM I'm testing with. I have 4.7k PU's on the BUS lines too.
« Last Edit: October 28, 2024, 08:46:20 am by MathWizard »
 

Offline ArdWar

  • Frequent Contributor
  • **
  • Posts: 721
  • Country: sc
Re: Why do internal pullup resistor's have a range ?
« Reply #3 on: October 28, 2024, 08:52:36 am »
I'm sure there's fixed resistor's with under 5% tolerance in this MCU.
Are you sure?

Making accurate resistor in silicon is not trivial at all. At least not in large volume low cost friendly process. That's why ICs are overwhelmingly designed in such a way where their functions and performances are tied to value ratio instead of absolute value.

In this particular case, even if the absolute accuracy between units is rather lax you're more likely to find all 100 pull up resistor inside a single MCU to be within say 2% of each other.
« Last Edit: October 28, 2024, 08:54:54 am by ArdWar »
 
The following users thanked this post: Geoff-AU

Offline Chalcogenide

  • Regular Contributor
  • *
  • Posts: 178
  • Country: it
Re: Why do internal pullup resistor's have a range ?
« Reply #4 on: October 28, 2024, 09:03:25 am »
For such a large tolerance I would assume that they are not using real resistors, but transistors. Some MCUs that actually use resistors (i.e. most STM32) write it into the datasheet and have a narrower range (i.e. 25k to 55k, typ 40k). In fact, having a tight tolerance resistor (5% is already a problem) on a silicon die almost always require trimming that is not justified for a simple pull-up functionality where the exact value is just not needed.
 
The following users thanked this post: newbrain, Kim Christensen

Offline Berni

  • Super Contributor
  • ***
  • Posts: 5050
  • Country: si
Re: Why do internal pullup resistor's have a range ?
« Reply #5 on: October 28, 2024, 09:17:04 am »
Manufacturing accurate resistors on silicon chips has always been a difficult task.

Yes it is possible but is more expensive and might even involve laser trimming afterwards when very high accuracy is required. Accurate ratios between resistors on the same die is easier because they all went trough the exact same manufacturing conditions, but even that up to a point. High value resistors are especially tricky as tiny amounts of change in doping has a large effect.

For things like IO pullups they often need a lot of them due to the large number of pins, hence those resistors have to be optimized to use as little die area as possible. Also pullups are often switchable on/off so they also need a transistor to switch it. This transistor itself might be designed in a way to have a really high RdsON to also act as the pullup resistor, saving even more precious die space, this brings in other issues like the resistance changing with changes in Vcc voltage or temperature. When more accurate pullup is needed they are usually implemented as current sources as those are easier to make accurate on a silicon die.

So in general do NOT expect pullups in any digital chip to have any sort of accuracy. They are just designed to gently nudge a floating IO line into a well defined state, so their actual value is unimportant as long as it is something in the kOhms.
 
The following users thanked this post: nctnico, newbrain

Online David Hess

  • Super Contributor
  • ***
  • Posts: 17440
  • Country: us
  • DavidH
Re: Why do internal pullup resistor's have a range ?
« Reply #6 on: October 28, 2024, 03:02:18 pm »
For example in the ATtiny13A datasheet, the internal pullup resistor is listed as from 20 to 80k, and no typical value.

So why such a wide range, I'm sure there's fixed resistor's with under 5% tolerance in this MCU. So why not use one for the PU ??, with a known value ??

There are a couple of ways to make resistors on an IC process, and usually they would be more accurate than that, but large value resistors take more area which makes the IC cost more.

I suspect they are using the channel diffusion step to make a "pinch resistor" which has a high value, small size, but wide tolerance.  Essentially this would be a MOSFET which is always slightly on.
 

Offline asmi

  • Super Contributor
  • ***
  • Posts: 2861
  • Country: ca
Re: Why do internal pullup resistor's have a range ?
« Reply #7 on: October 28, 2024, 03:44:35 pm »
Ok so don't trust them in voltage divider's then too. I'm just finishing baremetal coding my own I2C program, and yeah I shouldn't trust the PU state, with the series resistors I have going to the EEPROM I'm testing with. I have 4.7k PU's on the BUS lines too.
That's correct - you shouldn't trust them, their only purpose for such PU is to prevent line from floating.
 
The following users thanked this post: tooki

Offline brumbarchris

  • Regular Contributor
  • *
  • Posts: 223
  • Country: ro
Re: Why do internal pullup resistor's have a range ?
« Reply #8 on: October 28, 2024, 04:04:40 pm »
Quote
That's correct - you shouldn't trust them

I take it "trust" is a relative term in this context. I would consider you can "trust" them as long as you take into account the wide variation range they indicate in the datasheet (plus additional margin - consider that these PU values are mostly indicated at room temperature and nominal supply voltage only! So you might have to "widen" the range even further), and design the rest of the circuit accordingly.

Regards,
Cristian
 

Online coppice

  • Super Contributor
  • ***
  • Posts: 10067
  • Country: gb
Re: Why do internal pullup resistor's have a range ?
« Reply #9 on: October 28, 2024, 04:09:29 pm »
So it really is just a high tolerance resistor ?
For many of these "we need a vaguely valued resistor here" components in ICs it not just about tolerance. Its also about temperature variation. So, as much as you can't trust the value, you can't even trust it will be reasonably constant.
 

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 9370
  • Country: fi
Re: Why do internal pullup resistor's have a range ?
« Reply #10 on: October 28, 2024, 05:34:04 pm »
That's correct - you shouldn't trust them, their only purpose for such PU is to prevent line from floating.

That's incorrect - of course you can trust them. Their purpose is exactly the same as any external pull-up resistor. As usual, you do the math to see if the value at either extreme is acceptable for your design, and very often it is.

There is one thing to watch out for - basically exactly opposite to what you say, the integrated pull-ups resistors are not good to reliably prevent the line from floating - the resistors would usually* be disabled in boot so there is delay before your software can enable them, not to talk about risk of bugs turning them accidentally off.

*) there are exceptions, see datasheet.
« Last Edit: October 28, 2024, 05:43:08 pm by Siwastaja »
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15835
  • Country: fr
Re: Why do internal pullup resistor's have a range ?
« Reply #11 on: October 28, 2024, 09:02:45 pm »
Weak pull-ups are just transistors. Explaining the wide distribution of actual values (and sensitivity to temperature as well). Benefit is that they are easily digitally controllable and the cost is very low.
The resistance values are also usually relatively large. If you want a controlled (and lower) value, use external resistors.
 
The following users thanked this post: hans, MikeK, xrunner, newbrain, Doctorandus_P

Offline MikeK

  • Super Contributor
  • ***
  • Posts: 1316
  • Country: us
Re: Why do internal pullup resistor's have a range ?
« Reply #12 on: October 29, 2024, 01:10:31 am »
What Silicon said.  The internal pullups are transistors, not resistors.
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 4004
  • Country: nl
Re: Why do internal pullup resistor's have a range ?
« Reply #13 on: October 30, 2024, 01:39:19 am »
I'm sure there's fixed resistor's with under 5% tolerance in this MCU.

Just curious: Do you have any basis for that assumption?

I tend to agree with SiconWizard, It's quite possible / likely it is not a "real" resistor at all. If you want to be sure, then put a potentiometer on it, and draw a few different currents out of the pin. For a true resistor, the relation between voltage (drop) and current is lineair. If the current stays sort of constant when the voltage drop reaches a few volts, then you can be pretty sure it's a transistor (or combination of transistors).
 

Offline asmi

  • Super Contributor
  • ***
  • Posts: 2861
  • Country: ca
Re: Why do internal pullup resistor's have a range ?
« Reply #14 on: October 30, 2024, 01:22:25 pm »
For a true resistor, the relation between voltage (drop) and current is lineair. If the current stays sort of constant when the voltage drop reaches a few volts, then you can be pretty sure it's a transistor (or combination of transistors).
MOSFET channel's current is also mostly linear relative to the voltage between source and drain.

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 4319
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: Why do internal pullup resistor's have a range ?
« Reply #15 on: October 30, 2024, 02:21:35 pm »
Just to add what others have correctly said - a pull-up "resistor" inside an MCU isn't a resistor at all, it's a very small FET with the gate connected to the drain. The V-I characteristic is highly non-linear, so its effective "resistance" (defined as V/I at whatever value of V you happen to be interested in) could vary over a wide range. Hence the very wide tolerance in the data sheet.

It's done this way because fabricating a 'real' resistor takes up a lot of die area, and die area is the main driver of cost since it directly governs the number of chips per wafer. A FET, on the other hand, is a fraction of the size, therefore much cheaper.


Online David Hess

  • Super Contributor
  • ***
  • Posts: 17440
  • Country: us
  • DavidH
Re: Why do internal pullup resistor's have a range ?
« Reply #16 on: October 30, 2024, 02:26:43 pm »
For a true resistor, the relation between voltage (drop) and current is lineair. If the current stays sort of constant when the voltage drop reaches a few volts, then you can be pretty sure it's a transistor (or combination of transistors).

MOSFET channel's current is also mostly linear relative to the voltage between source and drain.

At low voltage current is linear.  At high voltage current becomes constant.
 

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 15173
  • Country: de
Re: Why do internal pullup resistor's have a range ?
« Reply #17 on: October 30, 2024, 04:55:39 pm »
Some of the Atmel data-sheets (e.g. mega48PA) show actual measured current vs voltage curves. They are pretty linear, though not perfect.
There is also some depence on the supply voltage, as expected for the MOSFET turned on not as hard when the voltage is low.
So the pullup resistance is expected to be higher with low supply voltage.
 

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 9370
  • Country: fi
Re: Why do internal pullup resistor's have a range ?
« Reply #18 on: October 30, 2024, 04:57:34 pm »
Yeah, the issue is probably more the dependence on temperature and supply voltage, than non-linearity. If you expect your circuit to run at fairly constant temperature and regulated supply voltage, you can characterize one unit and expect much less variance than the full rated range.
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 4004
  • Country: nl
Re: Why do internal pullup resistor's have a range ?
« Reply #19 on: October 30, 2024, 06:11:19 pm »
Some of the Atmel data-sheets (e.g. mega48PA) show actual measured current vs voltage curves. They are pretty linear, though not perfect.

I forgot about those.
I made a screenshot from an at90s2313. I would not call that linear.
With an output voltage of 5V, there is no current, pulling the output down towards 3V (2V drop over the "resistor") it's still reasonably linear, but once you pull the output below 1.5V, it has pretty much turned into a (temperature dependent) constant current source.
 

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 15173
  • Country: de
Re: Why do internal pullup resistor's have a range ?
« Reply #20 on: October 30, 2024, 06:41:37 pm »
The curves for the newer parts are much more linear. Attached is the curve from the Tiny13A DS. The 1.8 V curve is a little less linear though.
 

Offline Atlan

  • Frequent Contributor
  • **
  • Posts: 519
  • Country: sk
Re: Why do internal pullup resistor's have a range ?
« Reply #21 on: October 30, 2024, 07:53:10 pm »
Relying on internal pullup resistors is fine as long as the device is on the table.  As soon as the device is moved from the table to operation, there is a big chance that something will go wrong.
FNIRSI 1013D Always provide a picture or video with the problem where the parameters of the oscilloscope are visible, and a picture of the diagnostic screen with the values.
 

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 9370
  • Country: fi
Re: Why do internal pullup resistor's have a range ?
« Reply #22 on: October 31, 2024, 06:21:32 am »
Relying on internal pullup resistors is fine as long as the device is on the table.  As soon as the device is moved from the table to operation, there is a big chance that something will go wrong.

This makes zero sense. There is nothing unreliable about internal pullup resistors. Quite the opposite, they are not susceptible to soldering process errors etc.

Just understand they might not be enabled in boot. If you need pull-up before your code runs, then you (usually) need external resistors.
 

Offline Atlan

  • Frequent Contributor
  • **
  • Posts: 519
  • Country: sk
Re: Why do internal pullup resistor's have a range ?
« Reply #23 on: October 31, 2024, 05:10:10 pm »
They have a high value, just switch on something with a large power or inductance nearby, and such a sensitive input will react.
FNIRSI 1013D Always provide a picture or video with the problem where the parameters of the oscilloscope are visible, and a picture of the diagnostic screen with the values.
 

Offline asmi

  • Super Contributor
  • ***
  • Posts: 2861
  • Country: ca
Re: Why do internal pullup resistor's have a range ?
« Reply #24 on: October 31, 2024, 06:13:56 pm »
They have a high value, just switch on something with a large power or inductance nearby, and such a sensitive input will react.
No pullup resistor will help fix sloppy layout.
 
The following users thanked this post: ajb


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf