Shop OBEX P1 Docs P2 Docs Learn Events
What is a Microcontroller p79 — Parallax Forums

What is a Microcontroller p79

taiwesttaiwest Posts: 2
edited 2006-12-19 18:42 in Learn with BlocklyProp
I am a bit unclear on the workings of this circuit. It appears to me that Vdd supplies 5V. Via Ohm's law:

10k resistor: 4.89V @ .49mA
220 resistor: .11V @ .49mA

so what is the requirement for P3 to set binary 1? I'm confused because I would think that P3(IN3) is seeing .11V @ .49mA when the switch is open. So I do not understand how it is set high. When the button is pressed, Vdd is shorting straight to ground so P3(IN3) is at 0 correct?


Vdd
|
10k
|
220R----P3
|
switch
|
Vss (ground)

Thanks in advance,
TW

Comments

  • Martin HebelMartin Hebel Posts: 1,239
    edited 2006-12-19 02:22
    This is a very common circuit for inputs, but you are over analyzing it. When the switch is open, the voltage on P3 is simply Vdd (5V). As an input, P3 is very high resistance (impedance), and therefore very little current flows into the pin, so 5V is simply felt there.

    The 10K resistor is there so that when the switch is closed, there is a relatively high resistance between Vdd and Vss limitiing current flow and preventing a short. The voltage on P3 is now Vss.

    The 220 ohm is only there to prevent bad things from happening if a wiring or programming good occurs, such as making P3 HIGH when the switch is closed and causing excessive current flow from the pin.

    Any voltage above 1.7V (or there abouts without looking it up) the BASIC Stamp sees as a HIGH. Less is low.

    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Martin Hebel
    StampPlot - Graphical Data Acquisition and Control
    AppBee -·2.4GHz Wireless Adapters & transceivers·for the BASIC Stamp & Other controllers·
  • taiwesttaiwest Posts: 2
    edited 2006-12-19 18:42
    Thank you Martin.

    TW
Sign In or Register to comment.