Resistance of a pin in high impedance mode (INPUT) on DIOs

What is it? I’ve scoured the datasheet and I can’t seem to find it anywhere! Note, this is for GPIO/DIOs not ADC pins.

The arduino site says typical micros have a 100M ohm resistance in high impedance mode but I can’t find anything NEAR that for the STM anywhere on the datsheet. The best I see is 50k ohm for ADCs.

Suggestions?/Answer?

Hi @harrisonhjones

The datasheet gives a leakage current of +/- 1uA on 3.3V inputs and +3uA on 5V tolerant inputs. I am sure this changes if you switch on the pull-up or pull-down on an input.

The tested spec on any chip (except maybe an RF chip) is going to be input current, not impedance, so the Arduino value is calculated.

3 Likes

Awesome. I was cautiously optimistic that that was the way to go. Thanks for the info @bko.

Another question for you (or anybody else): I want to measure the voltage of the VIN line in the most power conseratively way possible. I was thinking of this setup: Vin is connected to A0 through a 1-10k resistor. A0 is connected to D0 through a 1-10k resistor. D0 can either be: GROUND (thus making the voltage divider work) or can be left floating. In floating mode there will be a leakage of 1-3uA. In GROUND mode it will only be sinking a few hundred uA. Is this a valid approach? Will it work and are there any issues I’m not thinking of?

Thanks everyone

[Edit] Ok, Nevermind. That method seems unnecessarily complex. How about I use a BJT transistor (see attached). What do y’all think of that?

@harrisonhjones, the current with D0 HIGH seems a tad low IMO (6v accross 20K ohms = 300ua with negligible e-b voltage drop). The base current is really part of the Core current and is small so can be ignored. The circuit will work until Vbat drops below the Core regulator’s minimum voltage and then all heck will break lose. The most frustrating part of the STM32 family is that there is no onboard Vref for the ADC so the measurements are totally dependent on the quality of the *3.3V voltage. :smile: