Set GPIOs to high impedance
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-06-27 1:11 AM
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-06-27 2:12 AM
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).Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-06-27 3:29 AM
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)Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-06-27 4:14 AM
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.Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-06-27 4:26 AM
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.Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-06-30 3:39 AM
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.Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-07-24 12:37 AM
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