Shop OBEX P1 Docs P2 Docs Learn Events
One Pin Less Sensitive Than Others? — Parallax Forums

One Pin Less Sensitive Than Others?

Martin_HMartin_H Posts: 4,051
edited 2011-12-14 15:12 in BASIC Stamp
I have push button wired like the Basic Stamp manual. The pin has 220 ohm connected to one side of the switch, that side also has a 10K pull up, and the other side of the switch is grounded. This set up works fine with my Arduino, my Propeller Platform, and almost all my BS2e pins.

I say almost because it will return 1 when open and zero when closed on all pins except pin 0. On that pin it always returns 1. Now at first I thought the pin was dead, but connecting it to ground results in pin 0 reading 0, and I can also blink an LED no problem.

So is it possible to have one sensitive pin detect any voltage as logic 1?

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-12-13 19:43
    No, that doesn't make sense. I'm guessing that the pin got set as an output somewhere in your program (or else something else driving the pin is connected to it) and is outputting a "high" through the 220R resistor against the grounded switch. Have you measured the voltage on the pin when the switch is closed?

    -Phil
  • Martin_HMartin_H Posts: 4,051
    edited 2011-12-13 20:04
    Thanks for the suggestions. I tested the voltage the switch puts out when closed, but not when it is connected to pin 0. I will try that.

    I will check the code ago looking to see if made that pin an output.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-12-13 20:37
    Be sure to measure the voltage at the pin, not at the switch contacts.

    -Phil
  • ercoerco Posts: 20,256
    edited 2011-12-14 10:38
    Be sure to measure the voltage at the pin, not at the switch contacts.

    -Phil

    Yes, that could be explained by a pin/socket connection problem.
  • Martin_HMartin_H Posts: 4,051
    edited 2011-12-14 15:12
    Well this is embarrassing and thanks for the help.

    First, measuring the voltage at the pin was a really good idea, because as soon as I started doing it I found the root cause. The CBA control board has a line following module which plugs into a header on the side of the robot. The cable goes under the board to the LFM and I usually leave it unplugged. But I forgot and it is easy to miss with all the other wires, but that caused the problem.

    Basically if you don't send control signals to the LFM it mostly does nothing, except it was messing up the voltage to pin 0 which is the input pin from the LFM. Doh!
Sign In or Register to comment.