cancel
Showing results for 
Search instead for 
Did you mean: 

Set GPIOs to high impedance

entwicklung
Associate II
Posted on June 27, 2014 at 10:11

Hopefully this is an easy question:

To set up a GPIO to high impedance mode, I have to configure it as input?

If I want something connected to ground at this pin, I can set it to an output with low level?

What I actually want to do, is enable and disable resistors, witch are conntected to the GPIOs. So that some are connected to ground and the others are floating.

Thanks for any help!
6 REPLIES 6
chen
Associate II
Posted on June 27, 2014 at 11:12

Hi

''To set up a GPIO to high impedance mode, I have to configure it as input?

If I want something connected to ground at this pin, I can set it to an output with low level?''

Sounds OK.

''What I actually want to do, is enable and disable resistors, witch are conntected to the GPIOs. So that some are connected to ground and the others are floating.''

What are the resistors doing?

Are they part of another circuit?

If so - it is not a good idea - you will be subjecting the STM32 IO pins to voltages from the other circuit. If the voltage goes above the processor supply voltage - this may destroy the STM32 (regardless of whether it is in high impedance input mode).

entwicklung
Associate II
Posted on June 27, 2014 at 12:29

Thanks for your answer!

It is an amplifier with varible gain. (The values are not fixed jet)

0690X0000060560QAA.png

chen
Associate II
Posted on June 27, 2014 at 13:14

Hi

I think you will be OK, the STM32 IO will only be subjected to 3.3V which should be in tolerance (Assuming you are also running the STM32 at 3.3V).

However, I am not sure your variable gain is going to work.

chen
Associate II
Posted on June 27, 2014 at 13:26

Hi

I just asked one of my colleagues (an electronics engineer) and he says the variable gain will work.

Due to the cap, DC gain is unity

AC gain is selected by the resistor shorted to ground.

However, you may see clipping due to the protection diodes in the STM32 IO pins.

They stop the AC seen by the STM32 IO pins going negative.

His advice - do not do it this way. Spend the money and use analogue switches, controlled by the STM32.

entwicklung
Associate II
Posted on June 30, 2014 at 12:39

Thank you for your advice.

I will try the circuit as shown in the picture. The STM32 has FET outputs and the negative current should flow to ground.

entwicklung
Associate II
Posted on July 24, 2014 at 09:37

I just want to tell you, that I've build the PCB now and it is working very well.

best regards

Steffen