What is a Microcontroller p79
taiwest
Posts: 2
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
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
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·
TW