please dont rip this site

What should I do with pins that I am not using?

Leaving unused pins just sitting there "floating" in any design is a serious and common error. A floating pin can pick up surrounding RF or electrostatic signals and oscillate, which can draw a surprising amount of current, leading to unnecessary heating, power supply drain, and additional cross talk.

Summary

The safest thing to do is to tie all unused pins, using resistors, to either ground ("pulldown") or the positive supply voltage ("pullup"). Anything from about 1K to about 10K will work fine.

If they are programmable I/O pins, also leave them tri-stated.

Why use pullup resistors? (or pulldown resistors)

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.

When using pullup (or pulldown) resistors, the worst that can happen is accidentally driving an output against a pull up/down and thus wasting power. (See "power considerations" section below).

Paul B. Webster says:

You should pull down to ground [rather than to Vcc] as:

Why not do something else?

Well, what else could you possibly do? Let's exhaustively list all the options: You could have an input-only pin, an output-only-pin, or a programmable I/O ("tristate") pin. And you could either connect that pin to a resistor (covered above), connect that pin directly to Vcc or ground, or leave it unconnected.

I hope this page covers all 9 possibilities ...

Bad options:

Potentially useful options:

historical notes, and specialized chips.

TTL chips: Letting inputs float is not too bad with TTL inputs because they sortof have pullup resistors built in.

Some chips have "internal pull ups".

stops gate voltages rising faster than any internal supply rails for any devices that can latch-up and so prevent an occasional failure due to bond wires melting. Latch-up is a danger in chips that have parasitic thyristors as an artifact of the manufacturing process. Most modern chips do not have this problem but its best to be safe

more thoughts, especially about low-power effects

Pull down to GND (versus pull up to VCC) consumes %15 less power on the PIC.

Pulling up to Vcc (versus pull down to GND) consumes less power on TTL chips.

David VanHorn http://dvanhorn.org/ says:

There are some things you should not do, and there are several options of what you can do.
Which technique is best is subject to some debate. Most microcontrollers, on reset, default their I/O pins to inputs, so that you can control what happens before your code starts running, by using resistors to ground or VCC as appropriate. However, leaving unused pins in the input state can cause problems, unless the pins are tied to some definite logic level. CMOS inputs are very high impedance, and left unconnected, usually float to about 1/2 VCC, where the input stage draws much more current than normal. This also results in the input pin, as seen by the micro, changing state rapidly between '1' and '0'. This may cause other problems, depending on the micro, and on which pin we're looking at.

Mark Willis says:

Usually, on Reset, all I/O pins are set as inputs (Gotcha here - use a pullup or pulldown so your devices don't act in "unpleasant ways" when your chip resets, you want a pull-down if using a logic-level Power FET or an NPN power Darlington or SCR that fires on a logic high input, or a pull-up if using a PNP transistor to do something safety-critical, of course - floating pins are a BAD idea if safety's at stake. This isn't a problem for an indicator LED; if it flashes on power-up, you probably won't notice the 10 microsecond flash <G> On the other hand if you have your ejector seat fire just because of a power glitch in the ejector seat controller you're making, you'll NOT be well liked by the pilot.)

"Inputs circuits (including schmidt trigger) draw considerably more power from the supply when the voltage strays from VDD or GND. Using schmidt inverters with an RC to make an oscillator draws a surprising amount of current, because the input connected to a capacitor is always in the linear range.

I once inherited a design where current consumption was intended to be extremely low (~=60uA), and draw varied by the amount of ambient light falling of the PCB! Ends up, an LED was tied to an open-drain output. When the LED was off (normal), light level hitting the LED would change the voltage across it to the OD output (which was also an input, not unusual in a uP), and take the pin through different areas of the linear region. The solution was to pull-up the pin, so it was at VDD when the LED was off (the LED didn't care)."

-- Bruce Walter

What can happen. Especially in low power sleep modes:

Q: Recently, I had some odd problems with our [PICs] not going into sleep mode--or so it appears. Instead of the usual 30-70 uA of current draw from the battery, I am seeing 1-2 mA. Or what is even more baffling, a drop to sleep followed by a single slow rise to about 600 uA followed by a fall back to normal sleep current.

A: Dwayne Reid (dwayner at planet.eon.net) of Trinity Electronics Systems Ltd, Edmonton, AB, CANADA (780) 489-3199 voice (780) 487-6397 fax says:

I've had similar problems.

One of them turned out to be the oscillator pins floating. I added a 10M resistor from ocs1 to gnd - problem gone.

The other was an input pin floating - solution was to make it an output during sleep.

Use a high impedance probe and look around while the PIC is asleep - keep an eye on the quiescent current each time you touch something. Even a 10M scope probe will bring an input LO - you might not even see that it was floating if the pin / trace capacitance is really lo. But your quiescent current will plummet if you hit the problem pin.

It might be a good idea to put some code like the following at the beginning of all your projects. This VERY BRIEFLY drives the pin and tests the result of that by reading the pin back.

    movlw   TRISB,FSR    ; Point at TRIS register
    bcf    PORTB,x             ; Get ready to drive a low
    bcf    INDF,x                  ; Start the short in this instruction
    movf PORTB,W           ; Get the value
    bsf    INDF,x                 ; Clear the short in this instruction

Simon Nield [simon.nield at QUANTEL.COM] says:

Reading Outputs and Inputs:
might be a good opportunity to make use of the usually irritating lack of a shadow register for the
port states:

; pin0 of port D is either connected to ground, vcc, or open circuit
; if o/c or vcc pin0 is driven high, if connected to ground pin0 is driven low
bsf   PORTD, 0    ; try and pull the pin high
clrw              ; (and wait a bit to let the voltage rise)
xorwf PORTD, F    ; read state of port D and drive it that way
                  ; if pin0 was pulled low it will now be driven low
                  ; if pin0 was floating or high it will now be driven high

...detecting the open circuit state...:

; if pin n port x is pulled high  => result = 0xfe, pin is driven high
; if pin n port x is pulled low   => result = 0x00, pin is driven low
; if pin n port x is open circuit => result = 0xff, pin is driven high
; i.e. bit0 set => open circuit, bits7..1 = pin state
bsf    PORTx, n
clrf   result     ; h:00 o:00 l:00
btfsc  PORTx, n
decf   result, f  ; h:ff o:ff l:00

bcf    PORTx, n
decf   result, f  ; h:fe o:fe l:ff
btfss  PORTx, n
incfsz result, f  ; h:fe o:ff l:00
bsf    PORTx, n   ; set pin high to match state


See also:

Q2: Well, which is it ? Do I tie them to Hi ? Or do I tie them to Lo ?

A2a: ``Sometimes it does matter, such as a completely unused flip-flop, where you would not want to tie both the reset and set inputs to their active level ... which could cause ... upset the performance of the other FFs in the same package.'' -- Jon Elson

A2b: CMOS inputs: ``whatever may make the PCB layout easiest (annotate to SCH), or makes using the input later (with a wire?) easier.'' -- Bruce Walter

``For example, if I am routing traces for a 74HC14 hex inverter, and I don't use 5 of the inverters, I tie the inputs of the unused gates on the pin 1 side of the chip to GND, and the inputs of unused gates on the pin 14 side of the chip to VCC. The way I route my power buses, the GND track is under the pin 1 side of the chip, and the VCC is under the pin 14 side of the chip. Electrically, there is no reason I know of to choose VCC over GND for CMOS inputs. ... This is what I do for double-sided boards. Of course, this advice is moot for boards with VCC and GND planes, since VCC and GND are equally accessible.'' -- Ivan Baggett http://www.bagotronix.com

``Actually, I have sometimes daisy chained unused sections of a HC14 or HC04 since the pins in question are adjacent and the lengths of the nets are minimized. The first in the chain connects to the nearest of Vcc and GND. If I recall correctly, TTL gates required a series resistor (I don't know why), LSTTL did not but both had to be pulled high because when pulled low they sourced appreciable current. Since CMOS the input behaviour has been independent of the input logic state. If you want to be able to use a spare gate or inverter in modifying a board, you could perhaps just make sure that the track to the input can be cut readily. If you daisy chain sections you can readily pull off a non-inverting buffer from 2 spare sections by just cutting the track to the second last inverter in the chain.'' -- Robert Mitchell

A2c: TTL inputs: Tie high. Use a 1 KOhm pull-up resistor. ``so that if the +5 V power supply goes to an abnormally high voltage, the chip may survive up to 7 Volts or so. Without the resistor, the input protection network would pop at about 5.5 V.'' -- Jon Elson

Inside the chip, TTL inputs ``are biased high, so connecting to VCC will give slightly less current draw.'' (but still much more current than CMOS) -- Ivan Baggett

``A grounded TTL input will sink 1.6 mA out of each input! That can add up quick on battery powered or other low power equipment. Of course, they DON'T use that stuff in battery powered gear anymore.'' -- Jon Elson


From: David Cary ...
"Mike Reagan"  on 2001-03-29 06:07:13 AM mentioned
>Look at the low level schematic provided by the Mfg for their integrated
>circuit.

This is always good advice.

Now that the top IC suppliers have put their databooks online, it's very easy to get this information.

Logic ICs


Questions:

General IO Information +

Comments:

Archive:


file: /Techref/logic/xtrapins.htm, 25KB, , updated: 2016/8/23 11:28, local time: 2024/11/5 02:58, owner: DAV-MP-E62a,
TOP NEW HELP FIND: 
3.149.237.89:LOG IN
©2024 PLEASE DON'T RIP! THIS SITE CLOSES OCT 28, 2024 SO LONG AND THANKS FOR ALL THE FISH!

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://linistepper.com/Techref/logic/xtrapins.htm"> Extra, unused pins</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?