Shop OBEX P1 Docs P2 Docs Learn Events
newbie needs input / output definition — Parallax Forums

newbie needs input / output definition

bertbert Posts: 3
edited 2004-09-11 21:33 in BASIC Stamp
· Hi, I am a newbie and hope to learn to program the basic stamps but need some help on a basic issue.·I· am learning about electronics in school but microcontrollers are new to me.··My question is basically what is the difference electronically in setting pins as inputs or outputs.· I understand that an ouput can have a logical high or low state but what happens with a pin set as an input?··I don't think I quite understand about sinking and sourcing or what is going on inside the chip.·My dad is taking me to the library today to look for books on microcontrollers·but I hope you might give me a few pointers.· Thank you very muchconfused.gif

Comments

  • NewzedNewzed Posts: 2,503
    edited 2004-09-11 20:50
    I get confused also, but I think it goes like this.· If you set a pin as an input, the you have to know what kind of signal you are expecting on that pin.· If you are expecting a high, then you would pull the pin low with a resistor.· If you are expecting a low signal then you would pull the pin high.

    Does that help?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Visit the Piggyback Page

    http://hometown.aol.com/newzed/index.html
    ·
  • K de JongK de Jong Posts: 154
    edited 2004-09-11 21:02
    Hi Bert,

    To put it more simple:

    An INPUT is a pin where a signal comes IN. So you can measure or detect something on that pin.

    An OUTPUT is a pin where a signal goes OUT. So you can switch or control something from that pin.

    The pins on a Stamp can be gonfigured either as input or as output. You will have to tell the Stamp at some time what you want a pin to be, input or output.

    I hope this helps a bit,

    Klaus
  • bertbert Posts: 3
    edited 2004-09-11 21:20
    · smilewinkgrin.gif hanks guys for the quick response!!· I think you cleared it up and I will get those library books.· I guess I was confused in thinking that a 5v high was sort of an input from ground to the chips source and a 0v low was an output to the source of the external circuit.· I was thinking in terms of· actual electron current flow and not logical states.·
  • KenMKenM Posts: 657
    edited 2004-09-11 21:21
    Regarding SINK and SOURCE.......

    When you sink something, a ground is provided for current to flow through the compoent.

    When you·source something, power is provided for current to flow through the component.

    The "component" could be a light bulb, motor, resistor, LED etc.

    See attached.
    1476 x 944 - 10K
  • bertbert Posts: 3
    edited 2004-09-11 21:33
    you guys are great!!
Sign In or Register to comment.