cancel
Showing results for 
Search instead for 
Did you mean: 

How to disable, as in electrically disconnect, a GPIO to be in neither a ground state nor 3.3v?

Pluto
Associate

Hello,

I have not worked much with the stm32 series, and was brought here by people who claimed that the ADCs on these were rather good, so excuse my lack of knowledge. My question is how would one go about disabling the GPIO pin (specifically on the H743zi2)? In that, I mean for it to neither be high nor low, and as far as the circuit is concerned, be at least megaohms of resistance apart from both ground and 3.3/5v. What I am trying to accomplish is create a simple device that can measure the resistance of a solution (will have rather high resistance and have a rather large range of values - think 4 orders of magnitude) between 2 predetermined contacts, and would like to have a row of analog 3.3v output pins that are each connected to a set resistor value, that all connect to one contact that is submerged. The other contact would simply be grounded at all times. I would then read multiple values, and use this this voltage divider circuit, where a large amount of different resistors are placed to ensure the voltage drop is always about half of the voltage (i.e., ~1.65volts), to get rather accurate data on the resistance and make my regression curves from there. Naturally, having any pins acting as a ground or as a power source would interfere with the readings, so here I am. As a side note, if this is not possible, what is the best way to go about this while relying on such a board rather than commercial electronics?

Thanks,

Pluto

2 REPLIES 2
LCE
Principal

There you found the STM32's not so good spec of the ADC: its input impedance is rather low, at least compared to others.

So, for high resistance measurement you need an external (FET-input) opamp.

Concerning setting an IO to high impedance: set it to input, without pull-up / pull-down.

to switch a pin to high impedance, just set it to "input" (or "analog" ) , and no pullup/pulldown.

+

to measure input voltage at high source resistance, you have to wait with every measurement, because the acd has about 5 pF input capacitance , that needs to be charged to the actual voltage at the adc / cpu pin.

this happens in the adc sampling time, what you have to make very long then...

if you want faster acquisition , you need an input buffer amp, as LCE said.

+ the H743 has 2 on-chip cmos opamps, you could use for this.  (GOhm input + 5pF , about)

If you feel a post has answered your question, please click "Accept as Solution".