Shop OBEX P1 Docs P2 Docs Learn Events
One switch to two BS2s? — Parallax Forums

One switch to two BS2s?

doug.taylordoug.taylor Posts: 31
edited 2006-09-08 12:04 in BASIC Stamp
Can one switch supply a signal to a separate I/O pins on two different networked BS2s?

Please see the attached for a picture.

Comments

  • doug.taylordoug.taylor Posts: 31
    edited 2006-09-05 23:13
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-09-06 00:15
    Yes, as long as you insure that both I/O pins are left as INPUT. Note on RESET all I/O pins default to input. IF both pins were set to OUTPUT, and one pin drove HIGH, while the other pin OUTPUT LOW, then one of the pins would probably burn out. Now, that's quite a few IF's, of course. To make sure, you can put a 220 ohm resistor in series with the signal -- that will lower the current enough that even IF both pins were set to output, etc. they wouldn't hurt each other.
  • doug.taylordoug.taylor Posts: 31
    edited 2006-09-06 23:36
    Thanks allanlane5.· This is the resulting picture.· By the way in my other thread you suggested putting a 120 Ohm resistor in series with the I/O pin, but here you suggest a 220 Ohm.· Just out of curiosity, is there any reason for the difference?
    285 x 236 - 6K
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-09-07 01:33
    The issue is: When you tie an output to a 'hard ground' (ie a low-resistance path to ground), and then set that output high accidentally, the amount of current the BS2 will try to put out into what is essentiall a 'dead short' to ground will burn out the pin.

    Similarly, if you tie an output to a 'hard +5' (ie a low-resistance path to +5 volts) and then set that output low accidentally, again, the amount of current can burn out the pin. Actually, the transistor drivers behind the pin, but you get the idea.

    Now, to prevent damage you need a "current limiting" resistor. 220 ohms is the recommended "current limiting" resistor Parallax uses, and puts in their Homework board. I just figured about half that assigned to each BS2 would work if the BS2's are talking to each other. But, if the BS2's are reading a switch signal, then each one needs the full resistance.
  • doug.taylordoug.taylor Posts: 31
    edited 2006-09-07 12:00
    Thanks Allanlane5, great explanation!· I'll make sure to protect my I/O pins from now on.
  • Alan BradfordAlan Bradford Posts: 172
    edited 2006-09-07 23:46
    Hi,
    If the 2 Stamps are running on different +5 supplies or ontheir own internal regulators:
    ·The safest way would be to use a Doubel Pole Switch. This will supply the switch position· information and isolate the 2 Stamps completely. You could also use Opto-Isolators if a DP switch is not possible.

    If both Stamps are running from the same 5volt supply:
    ·You could wire the switch to ground the input (Using a pullup resistor from the pin to +5). The draw back is if either Stamps pins get assigned as an Output you could get blown pins with the switch closed.

    Good Luck,
    Alan Bradford
    Plasma Technologies
    www.plasmatechnologies.com
  • doug.taylordoug.taylor Posts: 31
    edited 2006-09-08 12:04
    Thanks Alan,

    The double pole or Opto-Isolators idea is great. I didn't even think in those terms. As it happens, both Stamps share Vss and Vdd and are networked together using another pair of I/O pins anyway. I don't plan on allowing the pins in question to be anything but inputs but in a previous post allanlane5 supplied a tip using a protective resistor on each pin just in case of "accidents".

    I will file away your idea though, in case I ever am dealing with isolated Stamps.
Sign In or Register to comment.