Shop OBEX P1 Docs P2 Docs Learn Events
BS2px and the pull-up resistor — Parallax Forums

BS2px and the pull-up resistor

Eagle1Eagle1 Posts: 28
edited 2009-03-26 02:06 in BASIC Stamp
Can anyone tell me why when a pull-up resistor is enabled on a I/O pin the pin goes high? Also I am especially interested in how the pull-up function is utilized in button circuitry. Thanx!

Comments

  • Mike2545Mike2545 Posts: 433
    edited 2009-03-25 23:51
    It keeps the input from "floating". When you use a pull-up resistor you assign a state to that pin that is predictable. When you push a button tied to ground the state then goes negative. If you leave it floating there may be false readings.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike2545

    This message sent to you on 100% recycled electrons.
  • Eagle1Eagle1 Posts: 28
    edited 2009-03-25 23:55
    Mike, Can you give me a schematic of a button circuit using the pull-up feature of the BS2px?
  • Mike2545Mike2545 Posts: 433
    edited 2009-03-26 00:03
    Sure, here you go!
    It's on the page of the BS1 but it will work for the BS2px as well.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike2545

    This message sent to you on 100% recycled electrons.

    Post Edited (Mike2545) : 3/26/2009 12:13:23 AM GMT
    1429 x 1700 - 215K
  • Eagle1Eagle1 Posts: 28
    edited 2009-03-26 00:17
    Mike, I am fairly aware of an active high/low button circuit but just can't get it through my head why the BS2px I/O pin contributes anything to the circuit when we already have a 10K pull-up resistor to VDD ( Active Low Circuit)
  • Mike2545Mike2545 Posts: 433
    edited 2009-03-26 00:27
    Eagle1 said...
    Mike, I am fairly aware of an active high/low button circuit but just can't get it through my head why the BS2px I/O pin contributes anything to the circuit when we already have a 10K pull-up resistor to VDD ( Active Low Circuit)

    The I/O pin is where the input goes.

    I'm not sure I understand what you are asking.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike2545

    This message sent to you on 100% recycled electrons.
  • Eagle1Eagle1 Posts: 28
    edited 2009-03-26 00:37
    Mike, On the schematic you sent for a active low switch there is a resistor of 10K from after the button and prior to the 220 Ohm resistor, that is the pull-up resistor. Putting a 20k resistor after the 220 ohm resistor on the I/O pin is not doing any pulling-up. Am I making any sense at all?

    Eagle1
  • Mike2545Mike2545 Posts: 433
    edited 2009-03-26 00:41
    Where do you see the 20K resistor?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike2545

    This message sent to you on 100% recycled electrons.
  • Eagle1Eagle1 Posts: 28
    edited 2009-03-26 00:43
    Mike, The 20 K resistor is on the I/O pin of the BS2px.
  • Mike2545Mike2545 Posts: 433
    edited 2009-03-26 00:50
    What are you talking about?

    Here is the schematic for the BS2px.

    I don't see the 20k resistors you are talking about.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike2545

    This message sent to you on 100% recycled electrons.

    Post Edited (Mike2545) : 3/26/2009 12:55:51 AM GMT
    1700 x 2338 - 260K
  • Eagle1Eagle1 Posts: 28
    edited 2009-03-26 01:00
    Mike, Don't have a file to send you. Go to Parallax home page Type in BS2px in upper right hand corner, then click on Bs2px above picture , scroll to bottom of larger picture click on Basic Stamp 2px brief, go to bottom of page 5.

    Eagle1
  • Mike2545Mike2545 Posts: 433
    edited 2009-03-26 01:04
    Post the link...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike2545

    This message sent to you on 100% recycled electrons.
  • Mike2545Mike2545 Posts: 433
    edited 2009-03-26 01:10
    You are talking about the Configpin.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike2545

    This message sent to you on 100% recycled electrons.
  • Eagle1Eagle1 Posts: 28
    edited 2009-03-26 01:12
    Yes, specifically the pull-up resistor blurb>
    Eagle1
  • Mike2545Mike2545 Posts: 433
    edited 2009-03-26 01:16
    So, what is it that you want to know?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike2545

    This message sent to you on 100% recycled electrons.
  • Eagle1Eagle1 Posts: 28
    edited 2009-03-26 01:20
    I would like to know how the 20k internal pull-up resistor can possibly do anything (in a pull up sense) in the schematic (active low) that you sent me?

    Eagle1
  • Mike2545Mike2545 Posts: 433
    edited 2009-03-26 01:22
    Just leave out the 10k resistor when the Mode is 3.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike2545

    This message sent to you on 100% recycled electrons.
  • Eagle1Eagle1 Posts: 28
    edited 2009-03-26 01:29
    Sorry, that results in a short to ground when button in downstate.

    Eagle1
  • Mike2545Mike2545 Posts: 433
    edited 2009-03-26 01:35
    That will be an input or a change of signal to that pin.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike2545

    This message sent to you on 100% recycled electrons.
  • Eagle1Eagle1 Posts: 28
    edited 2009-03-26 01:39
    Actually as I first said the I/O pin with pull-up enabled acts as the Vdd because it goes high thus pulling the signal up....are we in agreement?

    Eagle1
  • Mike2545Mike2545 Posts: 433
    edited 2009-03-26 01:44
    It does not act as VDD it holds that pin high so it does not float. When you apply input (through a 220 ohm resistor to ground) that changes the state of that pin, registering a changed state, not a short.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike2545

    This message sent to you on 100% recycled electrons.
  • Eagle1Eagle1 Posts: 28
    edited 2009-03-26 01:55
    Right.............you can remove the part of the schematic from VDD to after the button and only consider the 220 ohm resistor and the 20K resistor when the pull-up feature is enabled. The signal is being pulled to the five volts on the I/O pin in the upstate and changes state to low when in downstate.

    Eagle1
  • Mike2545Mike2545 Posts: 433
    edited 2009-03-26 01:57
    Mode 0-Schmitt trigger
    Accepts noisy input, where the threshold for logic 0 is approximately 15% of VDD and for logic 1 approximately 85% of VDD

    Mode 1- logic threshold
    CMOS level where logic 1 is 1.4 volts and logic 0 is below 1.4 volts

    Mode 2- pullup
    20k ohm pull up resistors logic 1 and 0 are split 50-50 between 5 volts

    Mode 3-Output direction

    Hope this helps

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike2545

    This message sent to you on 100% recycled electrons.
  • Eagle1Eagle1 Posts: 28
    edited 2009-03-26 01:59
    Mike,

    Thanks for the help, i get the picture now.

    Eagle1
  • Mike2545Mike2545 Posts: 433
    edited 2009-03-26 02:05
    Eagle1 said...
    Right.............you can remove the part of the schematic from VDD to after the button and only consider the 220 ohm resistor and the 20K resistor when the pull-up feature is enabled. The signal is being pulled to the five volts on the I/O pin in the upstate and changes state to low when in downstate.

    Eagle1

    "you can remove the part of the schematic from VDD to after the button"
    AKA the 10K resistor

    "The signal is being pulled to the five volts on the I/O pin"
    AKA the I/O pin is being held high or logic 1

    Yes, that is correct. It will not be a dead short in the BS2px

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike2545

    This message sent to you on 100% recycled electrons.
  • Mike2545Mike2545 Posts: 433
    edited 2009-03-26 02:06
    Well, I have to thank you, because I learned about the px series of Stamps today!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike2545

    This message sent to you on 100% recycled electrons.
Sign In or Register to comment.