Shop OBEX P1 Docs P2 Docs Learn Events
Connecting 5V logic output to P2 - is a resistor sufficient... — Parallax Forums

Connecting 5V logic output to P2 - is a resistor sufficient...

... or more complex solutions have to be used?

TTL level signals have to be connected with several microseconds timings (TTL serial port, TTL proximity sensor)

If the resistor is sufficient, what should be its resistance to be safe?

Comments

  • we've followed the P1's ~500uA suggestion and been ok thus far. (5v-3v3)/500uA ~ 3k4.
    But, much healthier if you can use two resistors to form a divider

  • RaymanRayman Posts: 14,640

    Think I’d try a 10k resistor first

  • pik33pik33 Posts: 2,366

    I will try 10k/20k divider and check if it works.

  • AribaAriba Posts: 2,690

    You can also use a 1k series resistor and activate the internal 1.5k pulldown resistor. So the protection diodes are not stressed and the input is still very fast.

    For slower signals, you can use 10k series and a 15k internal pulldown.

    Andy

  • Consider that the internal pulldown is active not before the propeller has booted. A single 1k resistor won't hurt as injecting 1.5mA won't cause any damage. But I've seen some strange effects of neighbouring pins reading false inputs on the P1 if multiple pins are driven with 5V through series resistors. Now, I always try to use dividers. 1k8 / 3k3 works well.

  • jmgjmg Posts: 15,173

    @ManAtWork said:
    ... But I've seen some strange effects of neighbouring pins reading false inputs on the P1 if multiple pins are driven with 5V through series resistors. Now, I always try to use dividers. 1k8 / 3k3 works well.

    Yes, that is a lateral current effect, caused because the clamp diode is not actually a simple diode, but is a sideways PNP transistor.
    It is common across all CMOS parts. Current injected into the emitter, can travel laterally and appear on other collectors (nearby pins).
    The 'gain' is quite low, but it can be enough to disturb higher impedance or analog-use pins.

  • Hmm you raise interesting points jmg, we could put the neighbouring pins into ADC mode and see what they see above the rail, and how many pins away they can see it.

    Another interesting P2 feature...

Sign In or Register to comment.