Shop OBEX P1 Docs P2 Docs Learn Events
Feeding an external pulse, or pulses, to one of the pins on a BS2, what is maxi — Parallax Forums

Feeding an external pulse, or pulses, to one of the pins on a BS2, what is maxi

po2lepo2le Posts: 76
edited 2008-01-25 21:09 in BASIC Stamp
Using a 2 transistor MV (flip-flop) that·outputs 9.0v pulses, I figure that a voltage divider should be used to reduce pulse volts by half.··Would that·be OK?·· Should voltage-divider resistances be large? 110K,·for instance? I don't know what the input impedence of the BS2 pins are·

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-01-23 05:41
    In input mode, the input impedance of the BS2 I/O pins is high. The BS2 and BS2e are built with a PIC processor and you can get the datasheets for the 16C57 from Microchip which characterize the input currents involved (roughly 1uA) and the thresholds for logic low and high. The other Stamps use an SX processor and those datasheets are available on Parallax's website.

    Half of 9V is 4.5V which is a perfectly good logic high voltage (2V is minimum logic high).

    A 1uA leakage current is roughly 5 Megs, so the voltage divider resistances can certainly be on the order of 100K.
  • allanlane5allanlane5 Posts: 3,815
    edited 2008-01-23 19:33
    Another approach is to put a 22Kohm resistor in series with the signal. The BS2 has "internal protection diodes", which will 'clip' the signal at the I/O pin to zero (if the input goes negative) to +5 (if the signal goes over 5 volts).

    The 22 Kohm resistor is needed to limit the amount of current that the protection diodes have to deal with. They can't deal with much -- look at the Microchip documentation for the 16C57 I/O pins to see how much exactly -- but 22 Kohm should deal with a -12 to +12 volt signal. Your zero to 9 volt signal is in that range.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-01-23 22:34
    As a note, all BASIC Stamps past the BS2 use an SX Microcontroller, including the BS2e.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • allanlane5allanlane5 Posts: 3,815
    edited 2008-01-24 15:45
    Okay. And does the BS2sx ALSO have (as I assume it does) the previously mentioned "protection diodes"? So the "put a 22 Kohm resistor in series" solution will work for voltages between +- 12 volts?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-01-25 21:09
    That is correct…Like most microcontrollers, the SX28 (used as the interpreter for the BS2sx) has internal clamping diodes on the I/O pins.

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