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 mailto:jamesnewton@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----- From: Paul B. Webster VK2BZC [mailto:paulb@midcoast.com.au] Sent: Wednesday, October 27, 1999 10:44 AM To: eplus1@san.rr.com; PICLIST@MITVMA.MIT.EDU Subject: Re: Unused Ports 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 5A? 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.