Shop OBEX P1 Docs P2 Docs Learn Events
Input question — Parallax Forums

Input question

UghaUgha Posts: 543
edited 2009-01-15 16:29 in BASIC Stamp
There's something I don't quite understand about the Basic Stamp.

If a pin is set to input... I understand that it "floats" and the value can quickly flicker from 0 to 1.

An LED connected to an input pin will glow very dimly.
It also drains voltage from a cap much slower than if the pin was set to logic 0.

What exactly happens when a pin is set to input? It seems to allow power to flow both ways freely.
Is the voltage that comes from a pin in input state stable enough to be reliable? Or is there a fixed
range that it'll drift through?

I'm so confused [noparse]:([/noparse]
·

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-01-14 01:23
    When set as an Input pin, an I/O pin is in a high impedance (resistance)·state.· [noparse][[/noparse]As opposed to a low impedance or an infinite impedance.]
    ·
  • UghaUgha Posts: 543
    edited 2009-01-15 13:23
    I understand that... but why does it still "leak" voltage? And is this power consistant enough to be used to sense if a pin is in an input state?
  • Mike GreenMike Green Posts: 23,101
    edited 2009-01-15 16:15
    Here's a document from Phillips (NXP) explaining the typical CMOS gate structure including protection diodes. An I/O pin essentially consists of a gate input and another gate's output connected together. This is shown in the datasheet for the Microchip PIC 16C57 which is used for some of the Stamps.

    Normally an I/O pin gate structure in input mode will "leak" only about 1uA (see the datasheet) unless you connect it to something it's not intended to like a voltage above the supply voltage. It does not "allow power to flow both ways freely" unless it's broken or the device is not powered. There's no such thing as "input mode" if the device isn't connected to a proper power supply.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-01-15 16:29
    PIC I/O pin circuit attached.
    412 x 541 - 28K
Sign In or Register to comment.