Shop OBEX P1 Docs P2 Docs Learn Events
Floating Pins and DeCoupling — Parallax Forums

Floating Pins and DeCoupling

Chicago MikeChicago Mike Posts: 88
edited 2006-10-07 16:27 in BASIC Stamp
SO I have a really great project I've finished and I think I've run into a minor issue involving floating pins, which I would like to know how to address on the next thing I build. So here's the scoop. I've got a BS2 on·what I call the mainboard. This has the power supply and other gak. 3 of the pins from the BS2 are run through a 220 resistor network to a .100K connector. This connector also has 2 pins for the 5V rail as well. This connector then has a cable that goes about 18" to a daughter board with a motion sensor and other stuff. Well, everything works GREAT if the daughter board is actually plugged in, but if I unplug the .100k cable from the mainboard. I notice that it seems pin 3 (of these pins I'm remoting) floats around. (Debug commands are showing me this). Its low most of the time, but high sometimes, and if I put my flinger across the connector I can ground it out to zero. (Which is my ideal condition when nothing is plugged in.. OF course minus having to use my finger to ground it out). This isn't a big deal. I can work around it as I've made my own circuit board already, but I was wondering what someone would recommend to add to·pins to ground them out when no 'load' is on them. I guess my queston here is that i want it to default to ground, unless I have a device plugged in? Make sense?

Also, on another note can someone explain what decoupling really is on Ground lines? I notice quite a few devices use small caps .01u on unused pins to ground. Why? Why not just ground them?

Thanks again
Mike
·

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-07 15:11
    If pins are truly inputs only, then grounding them is quite possible. If, as on the Stamp, pins can be inputs or outputs, then connecting spare pins to ground could damage the chip if, due to a program bug, the pins were made outputs and set to HIGH. The best thing is to connect unused pins to ground or the Vdd supply through a 100K resistor (or something from 4.7K to 100K). This would provide a LOW input signal if nothing else were connected, yet allow the pin to be used if it were connected to something later. This is commonly done when pins are brought "off board", but not usually done when pins are just not connected. Strictly speaking, when CMOS inputs are floating, they'll sit near the transition point from LOW to HIGH and, since they're very high impedance, wander around based on local charges (like whether your hand or some signal cable is nearby). If they're right at the transition voltage, they may oscillate. Again, this is rarely a problem most of the time.
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-10-07 16:27
    I tend to use 22 Kohm resistors to provide a 'default' state to an input pin.
Sign In or Register to comment.