2009-07-01 01:33 AM
How should I treat unused GPIO pins?
2011-05-17 04:13 AM
How should I treat unused GPIO pins?
2011-05-17 04:13 AM
A good idea is to set them to output, unused inputs can pick up noise.
2011-05-17 04:13 AM
Quote:
A good idea is to set them to output
What kind of output? And, if it's an output, what state should you write to it?Quote:
unused inputs can pick up noise.
But, when a GPIO is not used, is it an input? Doesn't the design ensure that unused pins are inherently in a sensible state...?2011-05-17 04:13 AM
This is a very much age old discussion, and depends on the actual design and silicon used.
For most designs i set unused io as output low (no external resistor). But even with this there is a tiny window where the floating io could oscillate - chances are very rare however. You will find quite a few threads on this topic around the web. Cheers Spen2011-05-17 04:13 AM
If you look in ''\FWLib\examples\GPIO\IOToggle\main.c'' (v2), there's this:
/* Configure all unused GPIO port pins in Analog Input mode (floating input trigger OFF), this will reduce the power consumption and increase the device immunity against EMI/EMC */2011-05-17 04:13 AM
Quote:
On 04-06-2009 at 22:24, Anonymous wrote: If you look in ''\FWLib\examples\GPIO\IOToggle\main.c'' (v2), there's this..Bad ST: this is the kind of thing that should be properly & clearly documented - not hidden as some aside in some example code! :|2011-05-17 04:13 AM
hmm-> ''In Run mode you can just leave all your unused I/O pins on your PCB not connected and thru software configure them as Push-pull with Data 0.
This maintains a static level with zero consumption and finally is the best reliable mode for EMI and EMS.'' Qouted from STOne-32's post in the thread: