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 not Working

Other Parts Discussed in Thread: MSP430G2553, LM324

I have a launchpad for the MSP430G2553

Launchpad is MSP430G2..........

The output is working properly but when I am giving the input to it from pin 1.3 which is connected to to switch S2 it is not accepting the input.

It is not responding to the input it is recieving from switch(when i press it)...........

Once in an workshop which I attained 3 months ago, it worked but now it is not working.

This is my program can any one please check it......

#include<msp430g2553.h>
unsigned int i,left;
void main(void)
{
        WDTCTL = WDTPW + WDTHOLD;
        P1DIR |= 0x41;
        while(1)
       {
              if(P1IN==0x08)
              P1OUT=0x40;
              else
              P1OUT=0x01;
       }
}

Pkease theck my program...... for the input Port 1.3 pin number 5.

  • How does the section allocation map look in your .map file?  Do you see the port interrupt lable?  Here's a forum thread that wil add more insight.

    MSP-EXP430FR5739 User Experience Demo

  • You don't have a pullup resistor on P1.3. The V1.5 launchpad revision (which I think you have since you're using an msp430g2553) doesn't have a discrete pullup resistor on the board, so S2 switches P1.3 between floating and ground. Try enabling the pullup resistor inside the msp430.

    EDIT: Also, I suggest you step through your code in the debugger and see whether that "if" condition is doing what you think it's doing...

  • But  Mr. Robert I have used the same launchpad during the workshop different kit but there was no pullup resistor for port 1.3.....

    Is there any problem with code which I have sent..........???????

    Please go through once.......

    just go through the MSP430G2 LaunchPad circuit board and the circuit in the link.....

    This may help you to help me :

    LINK : http://www.ti.com/tool/msp-exp430g2

    And  then click [Get Hardwarte Design Files] which is in red..

    you will recieve the ciurcuit of the board and the full circuit.......

    Please check it out.....

  • Hi Shekhar,

    Was the code you used during the workshop exactly the same as you posted above? If the code and hardware are both identical then I'm not sure what the problem is.

    Regarding the design files, those are for revision 1.4 of the launchpad. The schematic on Page 3 shows R34, a 47k resistor from P1.3 to VCC. There's also C24, a 100nF capacitor connecting P1.3 to ground - that is marked on the schematic as "do not populate". If you look on your launchpad PCB at the row of SMD components immediately above the VCC trace (to the right of the silkscreen "J1" label) you'll find the locations for C24 and R34.

    I have a revision 1.5 launchpad and neither C24 or R34 are present - just the silkscreen labels and empty solder pads. This means that if I want to read the state of switch S2 I must first configure P1REN and P1OUT to enable the msp430's internal pullup resistor on pin P1.3. If my code doesn't do this then I get no input state changes from the button.

  • But Mr. Robert  I had worked on the same launchpad in the workshop

    that time it worked... now it is not working.......

    Can I connect other input to the launchpad like sensors..... using LM324 IC

    If so..then how????????

  • But Mr. Robert  I had worked on the same launchpad in the workshop

    that time it worked... now it is not working.......

    Can I connect other input to the launchpad like sensors..... using LM324 IC

    If so..then how????????

  • Hi Shekhar,

    I measured the voltage at P1.3 (Pin 5) and it floats at about 0.12v so Robert is on the right track with his advice re the pull ups.

    However I connect an external 10k resistor to Vcc and Pin 5, it makes no difference to the way the program runs. So I think the problem is with your code, check the tests in your "if " test and verify that it is doing what you expect.

    Peter B.

  • So you are asking me to use the P1REN function.......Then how to use it in the program which i have mentioned above???????/

  • Shekar;

    Yes, I suggest you use the following lines of code before your if test...

    P1REN |= 0x08;                            // Enable the Pullup/ Pulldown R.
    P1OUT |= 0x08;                            // Set the P1.3 resistor as Pullup

    This assumes you have the Rev 1.5 of the MSP430G2 with the missing device at R34.

    I have just used this in a sample test from the MSP sample code and it works fine.

    Peter B

  • Thank you Mr. Peter B....your suggestion has worked.......

    Thank you very much.....

  • I have a v1.4 (dated 1043) and C24 labeled as DNP in she schematic is populated and C14 which should be populated is not. Are R27 and C14 populated on the v1.5 boards? I think that intent of the capacitor and resistor was to de-bounce the switches. If that is so, then I might get multiple reset, but that shouldn't ma tter.

**Attention** This is a public forum