Shop OBEX P1 Docs P2 Docs Learn Events
Protecting BS2 Inputs — Parallax Forums

Protecting BS2 Inputs

ArchiverArchiver Posts: 46,084
edited 2004-04-04 08:03 in General Discussion
I saw another BS2 byte the dust today. I believe this occurred because the
individual
connected five volts directly to the I/O pin.

I would like to permanently connect 1k resistors to each I/O as a means to
protect
them from accidental shorts to Vdd. Is there a reason not to do this? Are
there
circuits or sensors that will not operate if a 1k resistor is atached to the
pin?

Thanks,
Paul

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-04-03 22:43
    Paul,

    To protect the stamp, the recommended value resistor to connect in series
    with each I/O pin is 220 ohms.

    ken

    =======================================


    I saw another BS2 byte the dust today. I believe this occurred because the
    individual
    connected five volts directly to the I/O pin.

    I would like to permanently connect 1k resistors to each I/O as a means to
    protect
    them from accidental shorts to Vdd. Is there a reason not to do this? Are
    there
    circuits or sensors that will not operate if a 1k resistor is atached to the
    pin?

    Thanks,
    Paul


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-03 23:00
    The only time applying 5v to a pin will kill it is when that pin is an
    output low.

    The reason not to add a 1K resistor in series with every pin is that you
    may affect what the pin is doing for other functions. For our
    student-oriented HomeWork board we put 220 ohm resistors in series with
    each pin for protection. By doing this, we can eliminate the 220
    normally used in RCTIME, and we can use 220 for LEDs (or bump back up to
    470 if we're lighting a bunch of LEDs). 220 is enough to protect a pin
    for an errant programming error (which is in fact the real killer of
    microcontrollers ... and we've all done it).

    We haven't found anything adversely affected by the 220 ohm resistor --
    but that's not to say that there isn't some device or sensor out there
    that won't like it.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office



    Original Message
    From: verhap@o... [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=kLLoPgWZkG2k2RTaI_qitEYJkkQT5_5lRUXlwcyq3UF9dwZSXP6QZNWGwgdIpuUMXOPsFaUhb5DHJMwiDL47iq4a]verhap@o...[/url
    Sent: Saturday, April 03, 2004 2:27 PM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] Protecting BS2 Inputs


    I saw another BS2 byte the dust today. I believe this occurred because
    the individual
    connected five volts directly to the I/O pin.

    I would like to permanently connect 1k resistors to each I/O as a means
    to protect
    them from accidental shorts to Vdd. Is there a reason not to do this?
    Are there
    circuits or sensors that will not operate if a 1k resistor is atached to
    the pin?

    Thanks,
    Paul
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-04 03:25
    >I saw another BS2 byte the dust today. I believe this occurred
    >because the individual
    >connected five volts directly to the I/O pin.
    >
    >I would like to permanently connect 1k resistors to each I/O as a
    >means to protect
    >them from accidental shorts to Vdd. Is there a reason not to do
    >this? Are there
    >circuits or sensors that will not operate if a 1k resistor is
    >atached to the pin?
    >
    >Thanks,
    >Paul


    I use 330 ohms in my data loggers. When powered with 12 volts,
    someone sometime is going to hook 12 volts directly to an input pin.
    With the pin low and 330 ohms, the current is limited to less than 35
    milliamps, which is within the ratings of the SX48 chip. With 220
    ohms, the current could be 55 ma, which is pushing it. The inputs
    are remarkably resilient, but it better to avoid the insults. The
    question is, what insults are likely to occur in your particular
    system? If it is a 28 volt system, then maybe the 1kohm resistors
    would be a good call. If there is severe ESD threat, a network of
    resistors and transorbs would be justified. But if everything is 9
    volts or less, the 220 ohms are perfect.

    Some solid state relays will not turn on reliably from 5 volts with a
    1k series resistor. Better to go with 220 to 470.

    There might be a situation where you need to provide a microsecond
    pulse of high current, so you have to leave out the resistor. Say
    you need to charge up the input capacitor of a big MOSFET, fast, so
    that the MOSFET will turn on fast. Even though the MOSFET input
    capacitor will draw a pulse of current, it will be so short that it
    won't matter for the Stamp.

    Reference data for single pin source and sink current...
    ***BS2/PIC16C57 at 5 volts Vdd, 25 degrees C...
    short circuit source current: 40 milliamps
    rated maximum source current: 20 milliamps
    small signal source resistance: 75 ohms

    short circuit sink current: 60 milliamps
    rated maximum sink current: 25 milliamps
    small signal sink resistance: 33 ohms

    ***BS2sx, e, p, pe using SX.. at 5 volts Vdd, 25 degrees C...
    short circuit source current: 80 milliamps
    rated maximum source current: 45 milliamps
    small signal source resistance: 25 ohms

    short circuit sink current: 130 milliamps
    rated maximum sink current: 45 milliamps
    small signal sink resistance: 12 ohms

    Note that the short circuit currents are way more than they can
    handle continuously. The above figures are directly from the PIC and
    SX data sheets, and I have verified that they are pretty close to
    reality for the SX chip.

    If you connect a Stamp pin directly to a capacitor, and then, HIGH
    it, the rate of charge will be at first the short circuit current,
    and then, as the capacitor approaches full charge, the rate is
    determined by the small signal source or sink resistance.

    Note also that all the chips have limits on the total current to/from
    any one 8 bit port.

    -- Tracy
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-04 08:03
    Paul,

    No problem as long as the electrical specs
    (basing on parts datasheets) for both
    the BS2 I/O and your sensors are met.
    Just keep note that the resistors limits current.
    And in ohms law, when your current change the voltage
    also changes, and might be out of the component's electrical
    requirement.

    Bing

    --- In basicstamps@yahoogroups.com, <verhap@o...> wrote:
    > I saw another BS2 byte the dust today. I believe this occurred
    because the individual
    > connected five volts directly to the I/O pin.
    >
    > I would like to permanently connect 1k resistors to each I/O as a
    means to protect
    > them from accidental shorts to Vdd. Is there a reason not to do
    this? Are there
    > circuits or sensors that will not operate if a 1k resistor is
    atached to the pin?
    >
    > Thanks,
    > Paul
Sign In or Register to comment.