Shop OBEX P1 Docs P2 Docs Learn Events
Input/Output Pin resistors — Parallax Forums

Input/Output Pin resistors

AnthonyAnthony Posts: 4
edited 2004-11-09 17:28 in BASIC Stamp
Hello,
I noticed that many of the connections between the B2 and other ICs have a 10k pullup/pulldown resistor.· Can someone educate me about exactally what the purpose of this would be.

Thanks
Anthony

Comments

  • NewzedNewzed Posts: 2,503
    edited 2004-10-26 12:39
    You will find pullup/pulldown resistors·on inputs pins.· The purpose of the resistors is to ensure that the input pin is in a steady state before receiving a signal.· If you are expecting a LOW on the input pin, you would use a pullup.· If you are expecting a HIGH you would use a pull down.




    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Try the Stamp Tester

    http://hometown.aol.com/newzed/index.html
    ·
  • allanlane5allanlane5 Posts: 3,815
    edited 2004-10-26 17:18
    Also, you should know that when you place a BS2 pin in the 'INPUT' state, the pin goes to 'high-impedance'. What this means is that the pin will 'look' like a very high resistance to any input signal -- thereby not requireing much input current from the input signal, which is a *good thing*.

    If the INPUT pin is in fact not connected to *anything*, it looks like an *antenna*, and will pick up any stray RF energy nearby. In the US, there is almost always a 60Hz RF signal flying around from the AC house wiring.

    Thus, it is good design practice to 'terminate all inputs'. For the PIC, this means first deciding do you want to tie the pin high or low? If high, you connect the pin through a 10 Kohm resistor to +5. If low, you connect the pin through a 10Kohm resistor to GND. Then the pin no longer operates as an antenna.
  • AnthonyAnthony Posts: 4
    edited 2004-10-27 11:16
    Understood. Thanks for the quick response guys.

    Anthony
  • mikeslaneymikeslaney Posts: 17
    edited 2004-11-08 21:01
    So does this mean that a 10k is generally the most applicable resistor to use as a pullup/down resistor when using a pushbutton?
    I'm running into a problem where my pgm appears to be getting a signal (erratically) from one of the buttons but I am using. I'm using a 10k pull down and have tried different switches just as a test.
    The debug screen shows that the program goes to the next subroutine as if the button has been pressed.
    I am using a 2N2907A as the switching transistor and the motor is rated for about 50% of the max current. Would an overloaded switching transistor cause a spike or something that would set a pin high or low? The program seems to work fine with an LED in place of the motor.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-11-08 21:07
    Where is your motor getting its current? If you're pulling from the same supply that the BASIC Stamp is using, you may get getting noise into the supply.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • mikeslaneymikeslaney Posts: 17
    edited 2004-11-08 21:25
    I just tried using a separate PS for the motor and it seems to work OK. Thanks for the idea. How can I cut the noise that may be causing the problem? This setup is all on one breadboard and I'd like to use one PS for the whole thing. Would it help to use a separate 7805 for the motor?
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-11-08 21:42
    Yes, it would help to use a separate supply for the motor, and make sure you filter it appropriately. Motors create a lot of electrical noise that can be problematic for microcontrollers.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • mikeslaneymikeslaney Posts: 17
    edited 2004-11-09 14:31
    Earlier in this topic you mention the use of MOSFets. Digi-Key, Mouser etc have multiple pages of MOSFets etc. What am I looking for in a general purpose motor driver MOSFet or other motor driver IC?
    As for the power supply, do I have to use a separate wallwart alltogether or could I use two separate regulators off of the same wallwart? Where would I look for resources on building a basic filter that would clean up the current project?
  • allanlane5allanlane5 Posts: 3,815
    edited 2004-11-09 15:34
    http://www.kronosrobotics.com/an142/GAN142.shtml

    This is an article titled "Reduce Motor Noise". It sounds like exactly what you need.

    And yes, if you use one wall-wart with two regulators (with their associated capacitors) you should get enough noise isolation for your BS2.
  • mikeslaneymikeslaney Posts: 17
    edited 2004-11-09 17:28
    I checked out the page and it seems like a quick and dirty yet probably effective method. I noticed he didn't have a clamping diode for the motor though.
    Are the capacitor specs somewhere in the Parallax docs? I need only 3vdc for the motor so I decided to use a 317 and a 7805 for the system. I don't expect a problem, do you?

    Do ya'all think I should start a new topic "Motor Drivers"? we've kind of moved on from Anthony's original question.
Sign In or Register to comment.