Shop OBEX P1 Docs P2 Docs Learn Events
Is it safe to wire +5v directly to an I/O pin? — Parallax Forums

Is it safe to wire +5v directly to an I/O pin?

edited 2010-12-14 08:35 in General Discussion
Is it safe to wire +5 directly to an I/O pin, or must a resistor be in series. I see a description of: Eight, normally-open pushbuttons (I/O lines protected, and pulled-up to Vdd via 10K), which makes me believe that in general conditions, this would cause a fatal short (damaging the board), but that Parallax builds a safety into their I/O? I am a software developer and hardware is all new to me (but loving it).

I ask b/c I actually see a diagram showing no resistor in Figure 9.2 (diagram 2) at:
Page 160 • Javelin Stamp Manual v1.0 • www.parallaxinc.com

Thank you for any tips,
Brian

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-12-07 10:23
    The series resistor is to protect against programming mistakes. If you connect a Stamp I/O pin to +5V and the I/O pin is configured as an input (default), there's no problem. If the I/O pin gets configured as a low output, the I/O pin circuitry on the chip will instantly be damaged or destroyed because you have a short circuit between the +5V and ground. If you never make programming errors, you don't need the resistor.

    Note that there are completely different issues if the +5V is really not +5V, but occasionally something higher. Similarly, there are different issues if you're using a Propeller (which is a 3.3V device) with inputs at +5V.

    Also, sometime when you're wiring up a board and you've left the power on because you're "just fixing one wire" and accidentally brush that wire against another wire that's carrying the "wrong voltage", just for an instant, and you've accidentally connected a high output to ground for an instant and you've now burned out another I/O pin, you might wish you had a current limiting resistor in that I/O lead.
  • bee_manbee_man Posts: 109
    edited 2010-12-08 15:17
    Safe? maybe.

    Smart? No.
  • localrogerlocalroger Posts: 3,452
    edited 2010-12-08 16:46
    The reason you shouldn't connect +5 directly to the Prop's 3v3 I/O is that even in input mode, the Prop has overvoltage clamping zener diodes that really, really don't want the voltage on those pins to go above 3v5 or so. If your 5V output really, really wants to drive the prop pin to 5V, current will flow and if enough of that happens the input protecting zeners will blow, closely followed by the output transistors they are protecting.

    While you can theoretically get away with no series resistor if all the I/O are the same voltage, it's still a bad idea because of the possibility of a programming error induced Crowbar Effect, where the two connected I/O's are both told to be outputs but of opposite polarity, and they try to short out the power supply. If you like brewing nitroglycerine on a hot stove while sniffing gasoline fumes go ahead and try it, but hey resistors are cheaper than Propeller chips.
  • edited 2010-12-14 08:29
    Thank you all for your responses. Very helpful. Can I assume that "negative output" is simply the same as a) writing false to an I/O pin, b) ground?
  • Mike GreenMike Green Posts: 23,101
    edited 2010-12-14 08:35
    Neither. Negative output is a voltage that's negative in relationship to ground. (a) gives you a voltage just slightly above ground (like 0.3V or less). (b) is 0V in relationship to ground.
Sign In or Register to comment.