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.

msp 430 code for blinking led

Other Parts Discussed in Thread: MSP430G2553

hi i am new in using msp430 launchpad anybody give the ccs code

  • Hi,
    You can find a lot of free code examples if you go to ti.com and enter you msp430 part name in the search field. On this product page you will find a software tab, there you can download the software examples, including also several examples for blinking LEDs.

    Best regards,
    Tobias
  • If you download and install MSPWare (available from your LaunchPad's product page),
    you can import the blinky example from the CCS Resource Explorer:

    Just check that you select *your* LaunchPad when navigating through the MSPWare tree in the Resource Explorer.

    A CCS project will be created for you. You just have to plug in the LaunchPad and press the debug button.

    Good Luck

  • Hi Arul!

    You did not say anything about the MSP you are using, but in case it is the MSP430G2553 on the MSP-EXP430G2 LaunchPad, this is the blinking LED example:

    //******************************************************************************
    //  MSP430G2xx3 Demo - Software Toggle P1.0
    //
    //  Description; Toggle P1.0 by xor'ing P1.0 inside of a software loop.
    //  ACLK = n/a, MCLK = SMCLK = default DCO
    //
    //                MSP430G2xx3
    //             -----------------
    //         /|\|              XIN|-
    //          | |                 |
    //          --|RST          XOUT|-
    //            |                 |
    //            |             P1.0|-->LED
    //
    //  D. Dang
    //  Texas Instruments, Inc
    //  December 2010
    //   Built with CCS Version 4.2.0 and IAR Embedded Workbench Version: 5.10
    //******************************************************************************
    
    #include <msp430.h>
    
    int main(void)
    {
      WDTCTL = WDTPW + WDTHOLD;                 // Stop watchdog timer
      P1DIR |= 0x01;                            // Set P1.0 to output direction
    
      for (;;)
      {
        volatile unsigned int i;
    
        P1OUT ^= 0x01;                          // Toggle P1.0 using exclusive-OR
    
        i = 50000;                              // Delay
        do (i--);
        while (i != 0);
      }
    }

    Dennis

**Attention** This is a public forum