Introduction: LED Patterns Using Msp430 Launchpad

Picture of LED Patterns Using Msp430 Launchpad

This is a simple micro-controller program in which we make led's glow in various attractive patterns using msp430 launchpad. I found that there are many instructables on arduino but very few are existing for msp430, although msp430 can be used without launchpad directly on breadboard or on PCB. So I thought of encouraging people to use Texas Instruments msp430 launchpad. This is my first instructable, hope you find it helpful and interesting.

This is the you tube link of the final product's video.
http://www.youtube.com/watch?feature=player_detailpage&v=g9NRDXL0vOk

Step 1: Components Required

RGB LED 2 pin (8)
1k resistors       (8)
Berg wires F-F  (9)
male headers   (9)
preset 4.7k        (1)[optional if you are not trying to power the chip without launchpad]
copper clad            - if you want to make you own PCB
     

Step 2: The C Code

Picture of The C Code

I am using TI code composer studio v5.4 for buring the code onto the chip. I've written the code in C language and not assembly language.
Steps to make project in CCS:
1)Run code composer studio.
2)Select new->project
3)Select css project in the dialogue box that appears
4) Since I am using msp430g2231 I have selected that ic from the list you can choose whichever ic you intend to use. Give the project a suitable name. You have to select an empty project with main.c else you'll have to manually add c file which is not that difficult but I won't be covering that in this list.
5)Make your project as active project by clicking on it in the project explorer.
6) Expand your current project by clicking on the small plus on the folder. Then double click on the main.c to open the file.
7) Copy paste the code given in the next step into the main.c and save it.
8)Further steps are shown in the images.

Step 3: Code

#include <msp430g2231.h>
main(void) {
    WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer
    P1DIR |= 0XFF;
    int x = 0X01;
    long i=0;
    int j=1;
    int k=0;
    int l=0;
    for(;;)
    {

    for(k=1;k<=5;k++){
     x=0x01;
     for(j=1;j<=8;j++){

     P1OUT = x;
     x*=2;
     for(i=0;i<=10000;i++)
     {
     }
     }
    }
        for(k=1;k<=5;k++){
         x=0x80;
         for(j=1;j<=8;j++){

         P1OUT = x;
         x/=2;
         for(i=0;i<=10000;i++)
         {
         }
         }
     }

        for(k=1;k<=5;k++){

         P1OUT=0xAA;
        for(l=0;l<=1;l++){
         for(i=0;i<=64000;i++)
         {}}
         P1OUT=0x55;
         for(l=0;l<=1;l++){
         for(i=0;i<=64000;i++)
         {}}
        }



        for(k=1;k<=5;k++){

                 P1OUT=0x18;

                 for(i=0;i<=20000;i++)
                 {}
                 P1OUT=0x24;

                 for(i=0;i<=20000;i++)
                 {}
                 P1OUT=0x42;

                 for(i=0;i<=20000;i++)
                  {}
                 P1OUT=0x81;

                 for(i=0;i<=20000;i++)
                 {}

        }
        for(k=1;k<=5;k++){

                 P1OUT=0x81;

                 for(i=0;i<=20000;i++)
                 {}
                 P1OUT=0x42;

                 for(i=0;i<=20000;i++)
                 {}
                 P1OUT=0x24;

                 for(i=0;i<=20000;i++)
                  {}
                 P1OUT=0x18;

                 for(i=0;i<=20000;i++)
                 {}

        }


    }
}

Step 4: Circuit Diagram

Picture of Circuit Diagram

The circuit diagram shown below is what you need to do. You can do it on a breadboard if you want.

Step 5: PCB Layout

Picture of PCB Layout

If anyone of you is interested in making a PCB, I've made the layout for you. But in this instructable I won't be teaching how to make a PCB.
That would be all. If you have any doubts feel free to ask me. I'll try my best to clear it. Thank you for reading this instructable.

P.S: If you are interested in msp430 launchpad, I've started a blog http://learningmsp430.wordpress.com/   where I'll posting whatever I learn regarding the controller. So please do visit and see it.

Comments

Eagle199393 made it! (author)2014-02-09

I made this with led matrix.

Eagle199393 (author)Eagle1993932014-02-09

http://youtu.be/xTDvg_oocYk you can watch result there

alangea (author)2013-10-06

Making you own PCB is quite easy, and theap. For pricing try having a look her: http://imall.iteadstudio.com/open-pcb/pcb-prototyping.html?pcb_size=124 you can get 10 PCBs for $9.90 including silk screen and 100% testing. I have used them a couple of time, and quality seems to be OK.

About This Instructable

7,734views

10favorites

License:

Bio: http://about.me/msminhas93
More by msminhas93:Wireless Notice Board using SIM 300 and EK-TM4C1294XLLine follower using msp430g2 launchpadInterfacing 16x2 LCD with msp430 launchpad in 4 bit mode
Add instructable to: