Shop OBEX P1 Docs P2 Docs Learn Events
Push button inconsistency — Parallax Forums

Push button inconsistency

francis_L_Hfrancis_L_H Posts: 10
edited 2010-11-18 14:49 in Accessories
Hello all,

I am working on a project that requires user interface of a simple pushbutton. I have two of the same setups. The only difference is that one is on a breadboard and the other is on the propeller protobard. The code will pull until the user pushes the button. The breadboard set up works perfectly fine. When I try to run the same exact setup, just with the protoboard, the propeller will not recognize the user input. It recognized it a few times during troubleshooting, I was plugging in the wires to the buttons when the protobard still had power to it. I know that is frowned upon and don't usually do it, but thought it might be insightful that it is one of the few times it worked. The very few other times it recognized a button push it gave me some weird results that didn't make any sense.

Just for more information, I have used a multimeter to check continuity and voltages and they are exactly the same as the breadboard set up. I have also run other code on the protobard to make sure everything was working correctly.

Any ideas?

Comments

  • T ChapT Chap Posts: 4,223
    edited 2010-11-15 15:30
    Do you have a way to show the inputs, like an LCD, TV or debug terminal? If the code is identical and the proto board is not working, can you verify that there are no pullups or pulldowns on those pins on the proto board? Write some test code to show what the inputs are with the pins hardwired to 3v3 and then to GND while verifying the inputs voltages on a meter. Post what the hardwired inputs show.

    It would be helpful to see a drawing of your push button schematic plus the code.
  • francis_L_Hfrancis_L_H Posts: 10
    edited 2010-11-18 13:18
    I came in, turned on the board, and it worked perfectly fine. The only thing I did was let it sit for a few days. This has tended to be a recurring theme over the years when working on different projects. It worked fine until I downloaded the code to my EEPROM, then I was right back to where I started.

    I have attached a schematic (very rough) of my circuit and the spin code. I used the LCD screen to check the inputs of the pins and they all indicate 0 just before the point in my code that the pushbutton is used. I used a multimeter to check the voltages across the pin and 3.3V/Vdd. It is 0 when the button is open and 3.3 when the button is pushed.
  • francis_L_Hfrancis_L_H Posts: 10
    edited 2010-11-18 14:49
    My problem was never the pushbutton, it worked completely fine the entire time. In turns out the code was getting hung up in another spot. I took the maxbotix object off obex and I had thought that I eliminated the PWM readings out of the code. Turns out I didn't. The reason the breadboard version worked is because I was using two 3 pin headers to connect the sensor, so the PWM pin was still hooked up. The protoboard just utilized two, 2 pin headers, so the PWM was not hooked up. Sometimes the code would work and sometimes it would not work because I was ultimately using the serial data, so I am assuming that sometimes the code would execute fast enough not to get hung up looking for the PWM call to the other object.
Sign In or Register to comment.