Searching \ for 'Unused Ports' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/ios.htm?key=port
Search entire site for: 'Unused Ports'.

Truncated match.
PICList Thread
'Unused Ports'
1999\10\26@091409 by HJ Simpson

flavicon
face
Does anyone have an pinion on what to do with unused ports?
Make them outputs and leave floating, and set or clear?
Make them inputs and pull up or pull down?
And.... speaking of inputs, what do think is best, pull up and input as
a clear, or pull down and input as a set?
Opinions gratefully received.
Regards Howard.

1999\10\26@092449 by jamesp

picon face
Howard,

Personally, I make them outputs and leave them in the high
state.  I think this is a carry over from TTL days and just
didn't get changed in my mindset.  I really believe that it
as a matter of personal opinion on which way to treat them.
The thing in CMOS is don't let them go unterminated.  You
must do something with them.  If left floating and not
terminated in some way, they can toggle with adjacent pins
and cause power consumption to go up, they can cause programs
to go astray if they are read and not dealt with, and a whole
list of other reasons that are too numerous to list here.
Suffice it to say as long as you terminate unused ports in
some way that makes sense to you and the application, and as
long as they are dealt with in the program if need be, then
it's just a matter of personal taste, and application
functionality and possible future expansion, etc. that will
determine which way to terminate them is best (better) for
that particular application.  I know I've been a little long
winded here, but I hope you understand what it is I'm trying
to say. If there is anything here you have questions on, let
me know and I'll try to calrify.

                                       Regards,

                                        Jim




>Does anyone have an pinion on what to do with unused ports?
>Make them outputs and leave floating, and set or clear?
>Make them inputs and pull up or pull down?
>And.... speaking of inputs, what do think is best, pull up and input as
>a clear, or pull down and input as a set?
>Opinions gratefully received.
>Regards Howard.
>

1999\10\26@102319 by paulb

flavicon
face
HJ Simpson wrote:

> Does anyone have an pinion on what to do with unused ports?

 It's a FAQ.  Make them outputs.  Set them low.  On the PCB, track them
to a little pad and hole to attach things to later if desired.

> And.... speaking of inputs, what do think is best, pull up and input
> as a clear, or pull down and input as a set?

 It is generally most convenient for switches to return to ground and
use pull-ups.  Port B has internal pull-ups available for this purpose.
--
 Cheers,
       Paul B.

1999\10\26@140322 by Dave VanHorn

flavicon
face
> Make them outputs and leave floating, and set or clear?

As long as they are not tied to circuitry, this is my most preferred option.

> Make them inputs and pull up or pull down?

This works, as long as activation of the inputs won't cause the SW any
grief.
The chip will draw more current if inputs are just left floating.

> And.... speaking of inputs, what do think is best, pull up and input as
> a clear, or pull down and input as a set?

For unused, I don't see that it matters.

1999\10\26@205555 by Roberto Fernandes T Neto

flavicon
face
part 0 722 bytes content-type:text/x-vcard; charset=us-ascii; (decoded 7bit)

HJ Simpson wrote:

> Does anyone have an pinion on what to do with unused ports?
> Make them outputs and leave floating, and set or clear?
> Make them inputs and pull up or pull down?
> And.... speaking of inputs, what do think is best, pull up and input as
> a clear, or pull down and input as a set?
> Opinions gratefully received.
> Regards Howard.

Content-Type: text/x-vcard; charset=us-ascii;
name="tavaresneto.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Roberto Fernandes T Neto
Content-Disposition: attachment;
filename="tavaresneto.vcf"

Attachment converted: wonderland:tavaresneto.vcf 3 (TEXT/CSOm) (0000E809)

1999\10\27@093014 by eplus1

flavicon
face
The safest thing to do is to tie all unused pins to either ground or the
positive supply voltage using resistors, and leave them tri-stated (if they
are programmable i/o). Anything from about 1K to about 10K will work fine.
This way, if the pins get set to an unintended state (due to software bugs
or electrical noise or whatever), the chip will not be damaged because the
current will be limited by the resistor.

You could get rid of the resistors by just leaving the pins unconnected and
set as outputs, (high or low) but this leaves the possibility of the pins
floating while the chip is initializing, or in a fault situation in which
the pins are tristated unintentionally. It also introduces the (low but
real) possibility of the pin being shorted to the other supply rail and
causing functional failure or damage to the chip or supply.

The important thing is to avoid having a tri-stated (input) pin floating,
and to avoid having an output pin driven against an external connection so
that it exceeds its rated source/sink capability (or the combined
source/sink capability of the chip). Pull up or pull down resistors
eliminate both possibilities in all conditions. The worst than can happen is
accidentally driving an output against a pull up/down and thus wasting
power.

James Newton spam_OUTjamesnewtonTakeThisOuTspamgeocities.com phone:1-619-652-0593
http://techref.homepage.com NOW OPEN (R/O) TO NON-MEMBERS!
Members can add private/public comments/pages ($0 TANSTAAFL web hosting)
PICLIST guide: http://204.210.50.240/techref/default.asp?url=piclist.htm


{Original Message removed}

1999\10\27@134440 by paulb

flavicon
face
Again the FAQ!

James Newton wrote:

> The safest thing to do is to tie all unused pins to either ground or
> the positive supply voltage using resistors, and leave them tri-stated
> (if they are programmable i/o).
> This way, if the pins get set to an unintended state (due to software
> bugs or electrical noise or whatever), the chip will not be damaged
> because the current will be limited by the resistor.

 *But*...  If you leave them unconnected, you certainly guarantee no
damage from unintended states.

> You could get rid of the resistors by just leaving the pins
> unconnected and set as outputs, (high or low)

 Best idea.  Allocate them pads for possible later use.  This satisfies
the design sensibilities of most of us who abhor waste!  And saves
resistors!

> but this leaves the possibility of the pins floating while the chip is
> initializing, or in a fault situation in which the pins are tristated
> unintentionally.

 Oh no!  You mean to say if the pin floats for a millisecond, the chip
will go up in smoke?  Shock!  Horror!

> It also introduces the (low but real) possibility of the pin being
> shorted to the other supply rail and causing functional failure or
> damage to the chip or supply.

 Why, but why, would this happen only to unused pins?  *Surely* it is
far more likely to happen to *used* pins?

> The important thing is to avoid having a tri-stated (input) pin
> floating,

 This is ludicrous!  So it might add a few dozen microamps to the
current draw.  Not half as much as if your suggested pull-up resistor
is accidentally pulled down by the same circumstance.

 Or do you propose this will "damage" the chip?  If so, why is it such
a popular concept, frequently advised, to use I/O pins to measure
analogue resistances or voltages?

> and to avoid having an output pin driven against an external
> connection so that it exceeds its rated source/sink capability (or the
> combined source/sink capability of the chip).

 Surely far more likely to happen to pins wired to other components?

> Pull up or pull down resistors eliminate both possibilities in all
> conditions.

 Rubbish!  If you can seriously conjecture a shorted pin, it's just as
likely to happen to a SMD resistor or SIL pack.

>  The worst than can happen is accidentally driving an output against a
> pull up/down and thus wasting power.

 33 k ohm resistors?  140 µA?  I suspect that's rather more than the
switching current of an input held at ¸ Vcc.

 Anyone got data on that though?
--
 Cheers,
       Paul B.

1999\10\27@171449 by eplus1

flavicon
face
Paul, I respect your opinions (and you are more than welcome to sign up on
my TechRef and post them along side mine) and I won't refer to them as
"rubbish" or "ludicrous" but,

1. Accidental grounding or energizing of an output pin (via a dropped pen or
paperclip, ill-formed trace, bent component lead, etc...) to the opposite
rail CAN smoke the chip and is far more likely (especially in the hands of a
newbie) than any other serious error. Yes, since most projects have more
used than unused pins, a short is more likely to happen to an in-use output
pin but, given equality in other areas, why increase the chance?

2. The cost of the resister is minimal to the projects that beginning PICers
will be turning out. Experienced production personnel, like yourself, can
weight the pros and cons and most likely already have decided to do FOR
THEMSELVES. A large value resistor, even left in place, will not prevent the
pin from being used if the production boards need a feature added by hand
later. I am trying to give the SAFEST advice possible for beginners here.
More than enough people will pressure them not to "waste" resistors.

3. Many low power PIC applications involve the chips power cycling,
sometimes rapidly. The power loss due to rapid switching of a tri-stated
input pin may be significant. I would like hard data also. No, rapid
switching will not fry the chip, and I didn't say it would.

4. By using very large value resistors (as I recommended), the current draw,
even if the pin is incorrectly set, will be negligible. A 100M resistor at 5
volts is 50nA IF set incorrectly. I have seen power consumption increase by
50mA when the pull-ups were removed from an unused port on an old Z80/PIO
project. Now, that was an old TTL (I think) PIO and there was a lot of RF
noise on that board so I doubt anything that extreme would happen on a
little PIC thing today. Data on PICs would be nice.

I also have another hidden reason for recommending the resistor that you
have, almost, hit upon. I have found that the last minute design change or
feature addition is the rule rather than the exception. I ALWAYS allocate
space to bring out every pin used or not. Getting inexperienced people in
the habit of placing that resistor makes them better prepared for the
reality of EE life. I know that on many occasions, people that I have
mentored have related that a last minute change was eased because they were
able to replace the resistor with another component or wire in a jumper to
satisfy the unforeseen need.

If non of that is compelling (and I doubt it is from your point of view),
may we agree to disagree and let each decide for themselves without getting
personal?

James Newton .....jamesnewtonKILLspamspam@spam@geocities.com phone:1-619-652-0593
http://techref.homepage.com NOW OPEN (R/O) TO NON-MEMBERS!
Members can add private/public comments/pages ($0 TANSTAAFL web hosting)
PICLIST guide: http://204.210.50.240/techref/default.asp?url=piclist.htm


{Original Message removed}

1999\10\27@182313 by Dave VanHorn

flavicon
face
> 4. By using very large value resistors (as I recommended), the current
draw,
> even if the pin is incorrectly set, will be negligible. A 100M resistor at
5
> volts is 50nA IF set incorrectly. I have seen power consumption increase
by
> 50mA when the pull-ups were removed from an unused port on an old Z80/PIO

This is a useless value for a pullup.
Electric field effects will dominate, and your "pulled up" input will be
bouncing all over the place.  Try something sane like 1-10k, which will
survive even near field E and H field events and usually remain in whatever
state you pulled it to.

Pullups on cmos inputs don't draw appreciable current.
NMOS Z80s are not CMOS, and they do draw current.

The safest, least cost method to secure unused pins is as outputs, low or
high.
Making them inputs adds ways for the code to have problems.
Shorting an output pin to the rails is not going to kill a chip. They will
simply output their max current into the load, and get slightly warm.

That being said, I would still put a resistor to ground on the schematic,
and not populate it, so that later, you can add things to those pins, using
the resistor pads.

1999\10\27@193333 by Robert A. LaBudde

flavicon
face
<x-flowed>At 05:22 PM 10/27/99 -0500, Dave wrote:
>That being said, I would still put a resistor to ground on the schematic,
>and not populate it, so that later, you can add things to those pins, using
>the resistor pads.

After watching all of this discussion, I have come to a personal conclusion
(as a neophyte, I admit) that the best solution appears to be to set all
unused pins to output HIGH with 10k pull-up resistors. This apparently has
the following benefits:

1. Defined state & non-floating.
2. No current flow (since at HIGH with pull-up).
3. Ready for future use on board.
4. Pull-up resistors are weak enough to overcome when used for a purpose.


================================================================
Robert A. LaBudde, PhD, PAS, Dpl. ACAFS  e-mail: ralspamKILLspamlcfltd.com
Least Cost Formulations, Ltd.                   URL: http://lcfltd.com/
824 Timberlake Drive                            Tel: 757-467-0954
Virginia Beach, VA 23464-3239                   Fax: 757-467-2947

"Vere scire est per causae scire"
================================================================

</x-flowed>

1999\10\27@215018 by Tony Nixon

flavicon
picon face
> > The important thing is to avoid having a tri-stated (input) pin
> > floating,
>
>   This is ludicrous!  So it might add a few dozen microamps to the
> current draw.  Not half as much as if your suggested pull-up resistor
> is accidentally pulled down by the same circumstance.

I don't think the current flow is the main problem here. A floating
input WILL cause erratic chip operation. Maybe not while you force it
to, but at some stage it will. I've had chips do all sorts of wierd
things, until I eliminated a floating pin (or pins). Some of these chips
froze just by placing a finger near them, some won't start, some start
but run 'funny'. The worst problem is spending mutitudes of time finding
out 'why', when you haven't realised the floating pin is the culprit. As
far as I know, the excess currents are caused by input FETS not knowing
what to do and the 'hi' and 'lo' ones turning on at the same time
causing minute rail to rail shorts, which could be at any frequency.
Surely this causes wonderful things to happen inside the die, false
triggering the brown out detect etc. - who knows?.

My opinion, is that there is some credibillity in using a moderate value
resistor to 'babysit' unused pins. Besides, there is your pin pad for
other uses if need be :-)


--
Best regards

Tony

http://www.picnpoke.com
Email .....salesKILLspamspam.....picnpoke.com

1999\10\28@004140 by paulb

flavicon
face
James Newton wrote:

> 1. Accidental grounding or energizing of an output pin (via a dropped
> pen or paperclip, ill-formed trace, bent component lead, etc...) to
> the opposite rail CAN smoke the chip and is far more likely
> (especially in the hands of a newbie) than any other serious error.

 And statistically would be somewhat more likely to short to ground in
most designs.

> Yes, since most projects have more used than unused pins, a short is
> more likely to happen to an in-use output pin but, given equality in
> other areas, why increase the chance?

 I was not going on that basis (most pins already used) but rather on
the concept that the more trace and pads you have connected to any given
pin, the more likely to make a short.

> 2. The cost of the resister is minimal to the projects that beginning
> PICers will be turning out.

 Every piece counts.

> Experienced production personnel, like yourself,

 Oooh!  That *was* tongue-in-cheek!

> 3. Many low power PIC applications involve the chips power cycling,
> sometimes rapidly.  The power loss due to rapid switching of a
> tri-stated input pin may be significant.

 Indeed it could.

> I would like hard data also.

 Hopefully someone will actually *do* the experiment?

> A 100M resistor at 5 volts is 50nA IF set incorrectly.

 Dave's already taken you to task on that.  I don't think you really
meant it, did you?  I know for starters that you cannot get anywhere
near that value in SMD or SIL packs.  100k more likely.

> I have seen power consumption increase by 50mA when the pull-ups were
> removed from an unused port on an old Z80/PIO project.  Now, that was
> an old TTL (I think) PIO and there was a lot of RF noise on that board
> so I doubt anything that extreme would happen on a little PIC thing
> today.  Data on PICs would be nice.

 You have me at a loss for a mechanism on that one.  Dave too, it
seems, he has interpreted it the other way round I think.

> I also have another hidden reason for recommending the resistor that
> you have, almost, hit upon.

 Ah!  *NOW* you come clean!

>  I have found that the last minute design change or feature addition
> is the rule rather than the exception.  I ALWAYS allocate space to
> bring out every pin used or not.  Getting inexperienced people in the
> habit of placing that resistor makes them better prepared for the
> reality of EE life.  I know that on many occasions, people that I have
> mentored have related that a last minute change was eased because they
> were able to replace the resistor with another component or wire in a
> jumper to satisfy the unforeseen need.

 Good thinking 99.

Robert A. LaBudde wrote:

> After watching all of this discussion, I have come to a personal
> conclusion ... that the best solution appears to be to set all unused
> pins to output HIGH with 10k pull-up resistors.

 I'd give you two reasons to pull *down* as James suggests.
1} a short is more likely to occur to ground.
2} If you have to use the points to connect to an external device, you
are more likely to want to reference it to ground.

 Tony Nixon reminds us of bizarre problems with unterminated inputs (a
good argument for making them outputs! ;-).

 This still worries me, as it conflicts with the use of them for
analogue assessments.  I'd still be suspicious of interrupt problems
with interrupt-on-change or RB0 if one was looking for an explanation
rather than undocumented chip problems!

 My limited ATMEL experience says: "Don't forget to terminate RESET!"
--
 Cheers,
       Paul B.

1999\10\28@110201 by eplus1

flavicon
face
Yeah, I brain farted on the resistor values. I have a big box of 4.7k that I
use when I need such a thing. Truth is, Paul is right FOR THE PIC in that I
program unused pins for output and set them low. I DO always leave space for
a pad or a resistor for unexpected additions (especially post-production)
and if I were working with chips that I wasn't absolutely sure were going to
survive a short, I would use the resistors.

I also worry about my designs freaking on power-up before I can set the
unused pins for output. I haven't had the problems that Tony mentions with
erratic operation but if a production part started exhibiting that effect, I
would have a space on the board for the resistors to be added as a fix.

So, when answering a newbie question, I always advise the resistors. I still
think its the safest single answer.

I was asked off list if its ok to tie the pins together and use just one
resistor. My response was:
The safest thing to do is to use a separate resistor to a rail for each pin.
The next safest thing to do is to not use the resistors at all and program
the pins as outputs.
The least safest thing would be to tie the pins together and use one
resistor to a rail as it would be very easy to get two pins programmed as
outputs and one set high while the other was set low.

James Newton EraseMEjamesnewtonspam_OUTspamTakeThisOuTgeocities.com phone:1-619-652-0593
http://techref.homepage.com NOW OPEN (R/O) TO NON-MEMBERS!
Members can add private/public comments/pages ($0 TANSTAAFL web hosting)
PICLIST guide: http://204.210.50.240/techref/default.asp?url=piclist.htm


{Original Message removed}

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...