2

I'm working on a low power design using SAM D21 microcontroller (Adafruit Feather M0). I would like to take advantage of configurable I/O and have it normally in high impedance state, but reconfigure it temporarily to an input with built-in pull-down resistance in order to take a measurement once in a while, when the microcontroller is awakened from sleep state. Looking at the data sheet Pull-up - Pull-down resistance is listed as 20kΩ to 60kΩ. I don't mind the wide range, I can calibrate, but is the value as stable as a typical external resistor would be? BTW, I don't need very high accuracy.

EDIT

By stability, I mean low drift. For this project, change of 5% per year due to aging is acceptable. Thermal change of 5% in consumer electronic temperature range is acceptable too.

EDIT'

SAM D21 data sheet indicates that the pull-up and pull-down are disabled in analog mode. Thanks to @BruceAbbott for pointing it out.

Paul Jurczak
  • 378
  • 2
  • 12
  • 1
    *but is the value as stable as a typical external resistor would be?* Explain what you mean by "stable". Do you mean **low drift** as in that you measure it today and it measures 30.3 komh and you use the chip one year and measure again, now it's 30.4 kohm (low drift) or it is 36.3 k ohm (higher drift)? On-chip resistors are generally less stable than an external resistor, it depends on what accuracy you need if that is OK. If the drift is 1% per year but you need 0.1% drift then you have an issue. If you just re-calibrate then it might be no issue. – Bimpelrekkie Jun 05 '21 at 20:15
  • 1
    No, it is not stable. It varies with temperature and voltage and probably with time, also. Normally, you would disable all pullups and pulldowns if you are reading an ADC input. So I am not sure what measurement you would be taking. – user57037 Jun 05 '21 at 21:13
  • @mkeith In this case I would be measuring resistance of a photocell. I was thinking about skipping an external resistor for this purpose. – Paul Jurczak Jun 05 '21 at 21:21
  • 2
    I agree that for measuring purposes, if you want a decent level of accuracy (better than 10%, which is quite poor) then you would not want to use the internal pull up resistor. They're not designed to be accurate. – Bimpelrekkie Jun 05 '21 at 21:25
  • 3
    Have you verified that the pull up/down resistor can be enabled in analog mode? – Bruce Abbott Jun 05 '21 at 22:16
  • 1
    @BruceAbbott Excellent point. I checked the data sheet and indeed the pull-up or pull-down is disabled in analog mode. Thank you. – Paul Jurczak Jun 06 '21 at 04:34
  • Floating (e.g., unused) I/O pins [usually result](https://electronics.stackexchange.com/questions/146506/minimising-current-consumption-in-a-pic/146523#146523) [in higher](https://electronics.stackexchange.com/questions/265499/can-unconnected-inputs-make-an-ic-get-warm/265508#265508) [power consumption](https://electronics.stackexchange.com/questions/274433/should-i-connect-unused-stm32-pins-to-ground/274435#274435) than if they are tied to one of the rails. Was this already considered? – Peter Mortensen Jun 06 '21 at 11:56
  • 1
    @PeterMortensen Good question. I don't need I/O when in sleep state, so I think that disabling I/O ports will put them in the lowest possible power consumption state. I will test it when I have a chance. – Paul Jurczak Jun 06 '21 at 17:48

1 Answers1

6

No, you should not expect an internal pull-up or pull-down "resistor" to behave like an external resistor. The internal device may actually be a very weak MOSFET or an implanted silicon resistor. The effective resistance is likely to vary with applied voltage. I would also expect a large temperature coefficient, and of course a very large variation in manufacturing.

Elliot Alderson
  • 31,192
  • 5
  • 29
  • 67
  • `The effective resistance is likely to vary with applied voltage` - you mean voltage applied to the I/O pin, right? Is there a way to find out how it is actually implemented in SAM D21? – Paul Jurczak Jun 05 '21 at 21:19
  • Yes, with the voltage applied to the pin. But if a MOSFET is used then the effective resistance could also vary due to changes in the supply voltage. If you want to know how the "resistor" is actually made then you should ask the manufacturer. – Elliot Alderson Jun 05 '21 at 22:02