Why do internal pullup resistor's have a range ? - Page 1
Forum section: electronics / general

author: MathWizard
author_rank: Super Contributor
timestamp: October 28, 2024, 08:33:41 am
content: 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 ?

author: Siwastaja
author_rank: Super Contributor
timestamp: October 28, 2024, 08:37:56 am
content: Quote from: MathWizard on October 28, 2024, 08:33:41 amAccurate 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.

author: MathWizard
author_rank: Super Contributor
timestamp: October 28, 2024, 08:41:17 am
content: 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.

author: ArdWar
author_rank: Frequent Contributor
timestamp: October 28, 2024, 08:52:36 am
content: Quote from: MathWizard on October 28, 2024, 08:33:41 amAre 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.

author: Chalcogenide
author_rank: Regular Contributor
timestamp: October 28, 2024, 09:03:25 am
content: 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.

author: Berni
author_rank: Super Contributor
timestamp: October 28, 2024, 09:17:04 am
content: 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.

author: David Hess
author_rank: Super Contributor
timestamp: October 28, 2024, 03:02:18 pm
content: Quote from: MathWizard on October 28, 2024, 08:33:41 amThere 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.

author: asmi
author_rank: Super Contributor
timestamp: October 28, 2024, 03:44:35 pm
content: Quote from: MathWizard on October 28, 2024, 08:41:17 amThat's correct - you shouldn't trust them, their only purpose for such PU is to prevent line from floating.

author: brumbarchris
author_rank: Regular Contributor
timestamp: October 28, 2024, 04:04:40 pm
content: QuoteI 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

author: coppice
author_rank: Super Contributor
timestamp: October 28, 2024, 04:09:29 pm
content: Quote from: MathWizard on October 28, 2024, 08:41:17 amFor 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.

author: Siwastaja
author_rank: Super Contributor
timestamp: October 28, 2024, 05:34:04 pm
content: Quote from: asmi on October 28, 2024, 03:44:35 pmThat'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 arenotgood 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.

author: SiliconWizard
author_rank: Super Contributor
timestamp: October 28, 2024, 09:02:45 pm
content: 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.

author: MikeK
author_rank: Super Contributor
timestamp: October 29, 2024, 01:10:31 am
content: What Silicon said. The internal pullups are transistors, not resistors.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: October 30, 2024, 01:39:19 am
content: Quote from: MathWizard on October 28, 2024, 08:33:41 amJust 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).

author: asmi
author_rank: Super Contributor
timestamp: October 30, 2024, 01:22:25 pm
content: Quote from: Doctorandus_P on October 30, 2024, 01:39:19 amMOSFET channel's current is also mostly linear relative to the voltage between source and drain.

author: AndyC_772
author_rank: Super Contributor
timestamp: October 30, 2024, 02:21:35 pm
content: 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.

author: David Hess
author_rank: Super Contributor
timestamp: October 30, 2024, 02:26:43 pm
content: Quote from: asmi on October 30, 2024, 01:22:25 pmAt low voltage current is linear. At high voltage current becomes constant.

author: Kleinstein
author_rank: Super Contributor
timestamp: October 30, 2024, 04:55:39 pm
content: 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.

author: Siwastaja
author_rank: Super Contributor
timestamp: October 30, 2024, 04:57:34 pm
content: 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.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: October 30, 2024, 06:11:19 pm
content: Quote from: Kleinstein on October 30, 2024, 04:55:39 pmI 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.

author: Kleinstein
author_rank: Super Contributor
timestamp: October 30, 2024, 06:41:37 pm
content: 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.

author: Atlan
author_rank: Frequent Contributor
timestamp: October 30, 2024, 07:53:10 pm
content: 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.

author: Siwastaja
author_rank: Super Contributor
timestamp: October 31, 2024, 06:21:32 am
content: Quote from: Atlan on October 30, 2024, 07:53:10 pmThis 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-upbeforeyour code runs, then you (usually) need external resistors.

author: Atlan
author_rank: Frequent Contributor
timestamp: October 31, 2024, 05:10:10 pm
content: They have a high value, just switch on something with a large power or inductance nearby, and such a sensitive input will react.

author: asmi
author_rank: Super Contributor
timestamp: October 31, 2024, 06:13:56 pm
content: Quote from: Atlan on October 31, 2024, 05:10:10 pmNo pullup resistor will help fix sloppy layout.

author: Siwastaja
author_rank: Super Contributor
timestamp: October 31, 2024, 06:54:53 pm
content: Quote from: Atlan on October 31, 2024, 05:10:10 pmEven larger external pull-up values are regularly used, e.g. in cases where low power consumption is important. I have used values close to 1Mohm. Sensitivity to external fields or conducted emissions depends on the whole design, including length of traces and layout plus other filtering components. The resistance values is just the tip of the iceberg.If 50k-ish was a very poor value, manufacturers would not do it. Usual pull-up values seen in circuits vary between about 2k to 100kOhm, though.

author: bson
author_rank: Unknown
timestamp: November 03, 2024, 11:24:28 pm
content: They're not resistors, but pairs of FETs biased into the ohmic region. The channel resistance is highly dependent on the process used and processes for digital circuits are mainly focused on high switching speeds: minimal ohmic regions, and low capacitance. So you kinda get what you get.

author: MathWizard
author_rank: Super Contributor
timestamp: November 12, 2024, 06:05:05 am
content: Quote from: Doctorandus_P on October 30, 2024, 01:39:19 amNo but reading some answers here, yeah I figured by now, 2024, that making 5% resistors in a chip, would be easy, and worth the effort. Of all the things in a MCU to worry about, I didn't think some 5% PU resistors, on a few pins, would factor into the cost.

author: Kleinstein
author_rank: Super Contributor
timestamp: November 12, 2024, 08:24:11 am
content: Aiming for 5% accuracy resistors could add quite some costs (may even need a different process or extra trim steps). One can usually get accurate resistor ratios, but not accurate absolute values. There are not that much improvements in this ascpect. The pull-up resistor is essentially the R_on of a tiny FET. With FETs it is normal to have quite some variations there.There is essentially no need for more accurate pull-up resistors. So the +-50% range rating is OK for essentially all users. So it is not good, but good enough. The very few cases were a more accurate value is needed one has to use an external resistor.

author: SiliconWizard
author_rank: Super Contributor
timestamp: November 12, 2024, 09:26:56 am
content: - Resistors take die area.- They would still require a transistor to switch them on/off - and one with a low enough RDSon in the whole operating range that it would not add significantly to the above resistors, otherwise it wouldn't add any benefit. So, "much" larger transistors.So there you go, instead of one small transistor, you'd end up with die area taken by one resistor + one much larger transistor. All this for a questionable benefit in 90% of the use cases.And likely a greater probability of messing up the design of the IO pads, you'd en up in the circle of the contractor that the RPi used for the RP2350.

author: Siwastaja
author_rank: Super Contributor
timestamp: November 12, 2024, 11:28:41 am
content: Quote from: SiliconWizard on November 12, 2024, 09:26:56 amOr 99.99%. Because if you really need 5% tolerance, then you also need a specific value, not just some 10k or 20k or 5k or whatever designer thinks is a good value.So make that, say, 4 resistors with resistance 2^n for 16 software-configurable values, and 4 transistors to switch them. And then the same for pulldowns, of course. Probably still less than 5 cents per chip to do, but it's a slippery slope of features. There will always be limitations what microcontrollers can do so it makes no sense to try to do everything when it's easily achievable with small and cheap external component.Better use that same budget to implement, say, CAN peripheral, because external SPI-to-CAN bridge is much more pain in the ass than external resistor. And 1-2% of customers might actually need CAN.

author: hans
author_rank: Super Contributor
timestamp: November 12, 2024, 05:15:52 pm
content: In my master courses on CMOS design, we typically used +/-20% as the absolute accuracy of transconductance at room temperature.So if they designed for a 40k pull-up (or a weak CMOS transistor to Vdd with Id set at e.g. 82.5uA @ 3.3V), then take +/-20% => 66-99uA range=> 33-50k range. Take voltage and temperature tolerance as well, and I'm certain a 20k-80k range is not unthinkable.The point is that matching on-chip is quite good. If you take 2 separately fabricated FETs, both set them to the exact same drain current (as FETs are transconductors), then you'll likely have quite a big tolerance in gate voltage needed.However, if you fabricate these 2 FETs on the same chip, very closely together, and with the proper structure/layout to balance any gradients in the doping across x/y directions, then it is possible to make an extremely well matched transistor pair. Their absolute specs can still be all over the place. But if you want to make a long tail circuit, that's usually not that important at all.The PhD's I spoke to that were fully into analog (RF) CMOS design often said that schematic/simulation was about 10% of their work investment, and 90% was getting to a good layout that will work well across PVT.The "old fashioned" way to accomplish this is to characterize each FET individually and then pair well matched parts together. It still needs to be done for exotic use cases, but fortunately you can still buy matched (J)FETs and the like which are inside a single package for a very good reason.

author: bson
author_rank: Unknown
timestamp: November 12, 2024, 09:41:51 pm
content: CMOS of course is a complementary pair. I think in any CMOS process the minimum cell is going to be at least a complementary pair - but I could be wrong.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: November 15, 2024, 03:42:20 pm
content: Quote from: bson on November 12, 2024, 09:41:51 pmYes, wrong. See:Gates get weird in the ALUAnd on top of that, "CMOS" does not have to be strictly digital. Input can have current sources made from one FET. It's also getting more common to have analog circuits such as (de) multiplexers, comparators and even opamps integrated in microcontrollers, for example the STSPIN. ADC's and DAC's (also common in uC's) are also not strictly "digital". Overall, it's simply "whatever construction which gets the job done" and that is possible to make within the limits of the applied semiconductor technology, that will be implemented.

author: Siwastaja
author_rank: Super Contributor
timestamp: November 15, 2024, 04:20:17 pm
content: "CMOS process" means a process optimized for producing P and N channel MOSFETs suitable to build complementary pairs. Of course process allows separately creating P and N channel transistors for things like open drain outputs. And analog stuff like opamps.