2014-06-27 01:11 AM
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!2014-06-27 02:12 AM
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).2014-06-27 03:29 AM
Thanks for your answer!
It is an amplifier with varible gain. (The values are not fixed jet)2014-06-27 04:14 AM
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.2014-06-27 04:26 AM
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.2014-06-30 03:39 AM
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.2014-07-24 12:37 AM
I just want to tell you, that I've build the PCB now and it is working very well.
best regards Steffen