This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Launchpad's P1.3 Push Button not working

Hello,

I just bought the Launchpad and I was doing some simple tests with it. I decided to test the on-board push button in P1.3 and I think it is not working properly. I wrote a simple code to turn on the on board LED when the push button was pressed. The push button doesn't work when pressed. Only if I touch the P1.3 pin connector or the push button's solder under the board that the LED is lighted.

Is this something wrong with my code or with my board? If the latter, there is a way to correct this?

Thanks, 

Daniel K. Franch

  • My guess is that you have the latest revision of the PCB. I suspect R34 47kohm has been removed. (SLAU318A–July 2010–Revised December 2011|)

    To test the switch you will have to enable the internal pin pull up resistor on  P1.3

    Peter

  • Yes, this is the last revision of the PCB. I have enabled the pull up the resistor, but the button still doesn't work. But touching either the connector or the solder doesn't work anymore, at least. 

  • Sounds like something wrong with the board. Do you have a meter you can use to see if the push button works? Your code needs to be running so that the pull up is enabled.

  • Daniel,

    Can you share details of your code and the device part number ?

    Peter

  • Hi,

    I just took a wild guess and tried re-soldering the button on to the board and now it is working. Well, at least with the example code. The code I have written seems to be wrong. But, then, I should just work a little more with it.

    Thank you very much.

  • Hello man, Did you check the jumper which disconect the button is in it place?

    J5 (1 &2)

  • Hi, Have you done all the settings to enable the Button interrupt? Because, I also had the same problem.

    I forgot to enable internal pull up resistor for Button.

    Please check it too.

      P1DIR &= ~BIT3;
      P1OUT |= BIT3;
      P1REN |= BIT3;    //Enable internal pull up register
      P1IES |= BIT3;
      P1IFG &= ~BIT3;
      P1IE |= BIT3;

    Hope it helps.

  • Hi, I had same problem and this fixed it.

    Man, I spent so much time on it !  TI should explain this better than they have done.

    There are many examples on web that no longer work without your fix.

    But anyway thanks a lot for your help !

    JJ

  • You're welcome!

    It is good to know that the answer helps even after one year :)

  • Hi,

    Even i enabled the P1REN |= BIT3; When i pressed the pushbutton, even its not working. USB powered lanchpad, did pushbuttons will work..? because R34 resistor is connected to the J6(+Vcc) supply. When we give the usd powered, did this push buttons will work..? even though we program them correctly. 

  • Hi,  what worked for me was 

    P1REN |= BIT3;

    P1OUT |= BIT3;

    The P1OUT line makes it pull up rather than pull down. You need this so that the switch pulls a normally high voltage pin low.

    I found I needed this but still had to tackle 'debouncing" which triggers the ISR multiple times unpredictably. But that's a separate issue to the pull up resistor thing which is needed first to make the switch work at all.

    JJ

  • FWIW two years later you've also solved the exact opposite problem which has been stressing me out for several hours: on an original Launchpad, trying to use the internal pull-up resistor with S2 (P1.3) exhibits bizarre behavior - evil R34 and C24 seemingly to blame. Even though these components are still in the schematics for Rev 1.5, they have simply not been soldered on, and everything works as expected. I'd still be banging my head on heavy objects had I not found this reply. So thank you.

  • Veg said:
    Even though these components are still in the schematics for Rev 1.5, they have simply not been soldered on, and everything works as expected.

    Yes, they are there and you can populate them if you want, but they are no longer populated by default. The reason is that with R34 and C24 soldered, you can't use this pin as analog input anymore.

    BTW: C23 helps debouncing. An additional serial resistor would further increase its use as low-pass debounce filter.

  • Jens-Michael Gross said:

    The reason is that with R34 and C24 soldered, you can't use this pin as analog input anymore.

    Ah that makes sense - thanks for the clarification.

  • The internal pull up/down resistor is just not working on P1.3!

    This code should be turning the LED on when pushing on the button and it doesn't work.

    If you connect a wire from P1.3 to P1.2 and use this code:

    It works very well.

    Hope this help you not being frustrated for over an hour (like I have been) trying to make this switch work with the internal pull up from P1.3 that doesn't exist.

**Attention** This is a public forum