cancel
Showing results for 
Search instead for 
Did you mean: 

How should I treat unused GPIO pins?

qing2
Associate II
Posted on July 01, 2009 at 10:33

How should I treat unused GPIO pins?

7 REPLIES 7
qing2
Associate II
Posted on May 17, 2011 at 13:13

How should I treat unused GPIO pins?

mikael1
Associate
Posted on May 17, 2011 at 13:13

A good idea is to set them to output, unused inputs can pick up noise.

st3
Associate II
Posted on May 17, 2011 at 13:13

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...?

sjo
Associate II
Posted on May 17, 2011 at 13:13

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

Spen

pswenson
Associate II
Posted on May 17, 2011 at 13:13

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 */

st3
Associate II
Posted on May 17, 2011 at 13:13

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! :|

dmatheis
Associate II
Posted on May 17, 2011 at 13:13

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:

http://www.st.com/mcu/forums-cat-6110-23.html