leaving pin floating

Hi!

Is it so bad to leave an input pin floating (from a PIC)?

Is the increased current consumption from input noise at threshold point the only drawback?

Thanks! Al

Reply to
A. Lemon
Loading thread data ...

Not familiar with PICs but, generally, it is bad. Can't you at least pull up?

On most uC it's the usual CMOS dilemma: Around the VCC/2 level the first stage will draw cross current. Not a lot but possibly enough to toast your whole power budget. This cross current is usually not specified so while it might seem ok on a prototype in production you could be in for a rude awakening. If the input doesn't have a Schmitt function the next stage will also cross conduct and that can be a lot more current.

IOW I suggest not to do that.

--
Regards, Joerg

http://www.analogconsultants.com
Reply to
Joerg

Some uCs have internal pull-ups. If so, then it's OK to leave the input unterminated. If not, then pull it high or low. If you terminate it with a resistor, you can use this pin as a spare input or output. Handy for debug or an oopsie. You can also program the pin as an output if it's dual function.

--
Mark
Reply to
qrk

Yes, you can do it internally if the uC has that capability. What I wanted to point out is that Al must actually turn that feature on by writing to a port register. If it's just configured as a plain input it'll be floating and that's not a good thing.

--
Regards, Joerg

http://www.analogconsultants.com
Reply to
Joerg

The TI 28xx DSP chip has weak pullups coming out of reset. It's very nice.

I just took out the pepper shaker and sprinkled a bunch of pulldowns all over a design, not because the chip doesn't have pullups (or downs), but because I wanted to make sure that each processor pin had a lead that I could attach green-wire mods to.

It's just that phase of the project...

--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

Posting from Google?  See http://cfaj.freeshell.org/google/

"Applied Control Theory for Embedded Systems" came out in April.
See details at http://www.wescottdesign.com/actfes/actfes.html
Reply to
Tim Wescott

Sometimes I use extra vias large enough to hook a wire into, either for soldering or for a scope probe. With sacrificial wire, of course. I hate it when folks stick the bare Tektronix probe tip in there and then it's all bent.

On my last project I am really glad we built it on Veroboard and not onto a prototype layout. It's that dreaded PID thingie that'll stare me in the face again tomorrow. Looks like I'll have to wire in a few more opamp stages and some poor-man's logic. Drat! But I should be happy, with a layout I'd be sitting there with the Dremel.

--
Regards, Joerg

http://www.analogconsultants.com
Reply to
Joerg

What is you reason for floating the pin???

Floating pins can cause a lot of noise spikes and you just never know which one will cause a problem some time.

Luhan

Reply to
Luhan

On second thought, I leave pins 'floating' all the time while prototyping PIC designs! I just program them all as outputs if they are not otherwise used.

Luhan

Reply to
Luhan

the

As it had been pointed out, there is a finite time that the pin is in its' default condition (and in PICs it is usually a high impedance input) before you make it an output and drive it to some state. Never a good idea. Resistors are cheap.

Jim

Reply to
James Beck

the

If you insist on doing that, you should also put resistors on all output pins that have a high impedance load.

Reply to
Arlet

the

Resistors are far too much trouble for prototyping. Of questionable value for one-off devices. And appropriate for most commercial designs.

"Theoretically" there is the time after reset when the floating inputs 'could' cause some extra current drain - in practice, I have never seen a problem.

Luhan

Reply to
Luhan

Why?

Thanks, Rich

Reply to
Rich Grise

point the

Ok, I powered up a PIC16F819 with one input adjusted to the point at which maximum noise comes out another pin (the software reads one pin and outputs to the other).

The worst case increase in VCC current is about 2ma. Less than I had expected.

I suspect that unlike standard CMOS circuits, there is no need to make the inputs 'really, really fast' when the processing speed is the limitation. Also, I believe it is the output circuit on most CMOS chips where the midline voltage causes the current to spike.

Luhan

Reply to
Luhan

For the same reason. If a device starts up with pins defined as inputs, there will be a brief delay before the firmware can reprogram them as outputs, during which they can float as inputs. Of course, this is only important if the load connected to that pin has high impedance. For output pins connected to, say, a LED, this is not a concern, as the LED Vf is typically below the CMOS threshold.

Sometimes this default input state can be maintained for a long time, for instance, if the reset pin is kept asserted.

Reply to
Arlet

point the

Well there is that way and then there is the "right" way and that is to tie all unused inputs to power or ground through a resistor. The worse possible time to break that rule is when you are doing a one off design. Would you rather work on the design or chase intermittent strangeness because of floating inputs? What happens when the one off design gets hit with a little static and there are floating inputs?

That you know of. See above.

Jim

Reply to
James Beck

Yeah, why? If the pin was an input to start with and then gets set to an output I can see making sure there is something there other than the cap on the gate of a FET, but if the output is a dedicated out then there are probably low impedance drivers holding a state. Maybe I'm missing something. Wouldn't be the first time.

Jim

Reply to
James Beck

point the

Take a look at Microchip's website for reference designs. I see no resistors used on output lines. Nor have I noticed any on the many PIC sites I've seen.

Luhan

Reply to
Luhan

point the

Outputs? I thought we were talking about inputs..........

Jim

Reply to
James Beck

threshold point the

know

a

Follow the thread back up, its about whether programming unused PIC pins as outputs is a problem because of the time between power up and when the pins actually get set to output.

I would never recommend leaving inputs floating.

Luhan

Reply to
Luhan

Take for instance pins used as an address/data bus for an external Flash/RAM memory. If the microcontroller starts with all pins defined as generic inputs, and relies on firmware to define these pins as outputs, there will be a finite time in which these pins can float.

For dedicated output-only pins, there is always a well defined level, of course, but many microcontrollers have multiple functions per pin, configurable by software, and they may default to input.

Reply to
Arlet

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.