Shop OBEX P1 Docs P2 Docs Learn Events
Using the IN and PULSIN commands — Parallax Forums

Using the IN and PULSIN commands

Joe FishbackJoe Fishback Posts: 99
edited 2006-04-23 19:50 in BASIC Stamp
Help me out to better understand how the IN and PULSIN work with the Basic Stamp. These comands are used to detect the state of· a pin, 1, or 0. Is there any current flow thru the pin when it detects a signal? Can a signal be sent and detected by·the pin from another circuit that is powered by separate 3V source other than the 5V to the BS2? I am assuming you would have to have a common ground between the BS2 and the other circuit. If this is true, how high·can the voltage be that is to the BS2?



▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
······ Joe Fishback

-Robots are my friends-

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2006-04-23 19:50
    1. There is very slight current flow into the pin when it is being used as an input -- I believe the input impedance is around 10 Megohms, so a 3-volt drop would be (3/10e6 == 300e-9, or 300 nano-amps).

    2. I believe the decision point is like 1.4 volts, so a 3-volt signal SHOULD read as a '1'.

    3. Yes, you MUST have a common ground.

    4. If you put a 22 Kohm resistor in series with the signal, the BS2 has 'protection diodes' on its I/O pins which will 'clip' a +- 12 volts signal to 0 and +5. As long as the current is low enough, which the 22 Kohm resistor takes care of.
Sign In or Register to comment.