Shop OBEX P1 Docs P2 Docs Learn Events
See HIGH on one BS2 from another — Parallax Forums

See HIGH on one BS2 from another

kenwtnkenwtn Posts: 250
edited 2008-05-29 15:35 in BASIC Stamp
HI,

···· This should be easy but I can't seem to get it. I want to put a HIGH on say PIN 7 on one BS2 and check for that HIGH on another BS2. I have the pins connected with two 470ohm resistors. What I am I doing wrong.

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-05-29 15:11
    Ken,

    If you have two pins connected together on two BASIC Stamps, then why are there two resistors? Typically the pin on BS2-A would go through a resistor to the pin on BS2-B. Is this not how you have it connected?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • ercoerco Posts: 20,261
    edited 2008-05-29 15:14
    Make sure the two chips share at least a common ground (Vss) connection, even better to have common Vss and Vdd (+5V) connections. One 470 or even a 220-ohm resistor wired directly between the two Stamp pins (one out, one in) is sufficient. Use the INPUT n command on the Stamp receiving the signal.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • kenwtnkenwtn Posts: 250
    edited 2008-05-29 15:14
    The circuit I saw showed a 1K resistor but said if you don't have a 1K you could use 2 470ohms
  • kenwtnkenwtn Posts: 250
    edited 2008-05-29 15:17
    Maybe the command I used to check the line is wrong. I was doing this:
    MASTER
    HIGH PIN7

    SLAVE
    DO UNTIL PIN7:LOOP
  • ercoerco Posts: 20,261
    edited 2008-05-29 15:21
    The receiving stamp doesn't care what pin the other stamp is outputting from (pin 7), so I trust that is just a coincidence in your numbering convention. The receiving stamp has to look at its own pin that is hardwired to the other stamp, let's say pin 4 to avoid confusion.

    Master:
    HIGH 7


    Slave:
    INPUT 4
    wait:IF IN4=0 THEN wait

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • kenwtnkenwtn Posts: 250
    edited 2008-05-29 15:25
    I just used the same pin on both stamps to keep it simpe. I will try your code. THANKS for the HELP
  • Mike GreenMike Green Posts: 23,101
    edited 2008-05-29 15:28
    As erco said, make sure the two Stamps have a common ground connection.
  • kenwtnkenwtn Posts: 250
    edited 2008-05-29 15:31
    I should have said in my post that both stamps share a common source of power.
  • Bobb FwedBobb Fwed Posts: 1,119
    edited 2008-05-29 15:34
    And to prevent floating, it wouldn't hurt to have a 10K resistor to ground (Vss) to perform a pull down in case the pin is not high or is set to input or the like.
  • kenwtnkenwtn Posts: 250
    edited 2008-05-29 15:35
    I got it working with all your help. THANKS SO MUCH! Just bad coding on my part.
Sign In or Register to comment.