Shop OBEX P1 Docs P2 Docs Learn Events
Protecting Stamp I/O pins — Parallax Forums

Protecting Stamp I/O pins

MorrolanMorrolan Posts: 98
edited 2007-09-14 16:36 in BASIC Stamp
Hi, just a quick question - I read in a Nuts & Volts article (#101 I think) about using a 220Ohm resistor to protect an I/O pin when it is being used as an output.

Does anyone else do this, or is this just being cautious?



Regards,
Morrolan

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Flying is simple. You just throw yourself at the ground and miss.

Comments

  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2007-09-13 14:34
    Morrolan,
    ·
    It depends on the situation, and how the pin is used.· In practice it is a good idea to plan for the unexpected, which means that precautions need to be made in case of an accidental short.
    The value of 220 Ohms is good, because it limits the current on the I/O pin to a maximum of 23mA.· I = V / R ... I = 5V / 220Ohm = 22.7mA.·· Suppose that you made the I/O pin an OUTPUT and you also made the Pin HIGH.· In this case it would be producing 5V in the Output.· If you were to accidentally connect that pin directly to Ground (0V) then you would soon have a problem, and either destroy the Stamp or loose the ability to use that I/O pin in the future.
    ·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • MorrolanMorrolan Posts: 98
    edited 2007-09-13 15:33
    freaked.gif

    Thanks for that, that's very handy to know - like I said, very rusty and didn't even think what would happen setting a pin HIGH/OUT and connecting it to ground. Might be a good practice to get into. I also need to read the manual properly, as so far i've simply been experimenting with other people's code, or doing really simply stuff.

    Think I need to do some practice calcs with Ohm's Law again, get me back into it!

    Only thing I do remember is how resistors in series and resistors in parallel work.

    I don't want my Stamp to go Poof! and release all those imprisoned little smoke particles! sad.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Flying is simple. You just throw yourself at the ground and miss.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-09-14 16:36
    On the flip side of the coin while it is nice to have some protection, forethought on the code to prevent such issue is sometimes necessary as having 220 ohm resistors in line with the I/O pin can, in some cases cause a particular accessory to no longer work. This is often true of serial devices with pull-up resistors on the internal I/O line. Typically the only place I use them myself is on a bi-directional pin and only if the device doesn’t already have one. The PING))) for example already has a series resistor. When using a DS1302 or DS1620 I add one. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
Sign In or Register to comment.