The LaunchPad is an easy-to-use, affordable, and scalable introduction to the world of microcontrollers and the MSP430 family.
The LaunchPad development kit is a part of TI's MSP430 Value Line series. It has an integrated DIP target socket that supports up to 20 pins, allowing MSP430 Value Line devices to be dropped into the LaunchPad board. Also, an on-board flash emulation tool allows direct interface to a PC for easy programming, debugging, and evaluation.
Unfortunately, the TI supported tools for this kit are Windows only.
It is, however, quite possible to use Linux based tools with Launchpad. The procedure below outlines the steps to build a Linux based tool chain and debugger, as well as create and test a short C program.
The procedure below should work on either your x86 Linux machine or on an OMAP system using the GNOME image from this site.
If you are using the GNOME image from this site all necessary packages to build the msp430 tools are included. If you are using an x86 machine you may need to install a few required packages (the below assumes you are using Ubuntu, modify as needed for your distro): $ sudo aptitude install git-core gcc-4.4 texinfo patch libncurses5-dev $ sudo aptitude install zlibc zlib1g-dev libx11-dev libusb-dev libreadline6-dev
Next we will download and build the mspgcc compiler: git clone git://mspgcc4.git.sourceforge.net/gitroot/mspgcc4/mspgcc4 cd mspgcc4 sudo sh buildgcc.sh
The build script will ask a number of questions. Accept the default by pressing Enter for each question except "Do you want to start build right now?" The proper response here is of course "yes"!
Next we download and build mspdebug: cd .. git clone git://mspdebug.git.sourceforge.net/gitroot/mspdebug/mspdebug cd mspdebug make sudo make install
At this point we're ready to test our first MSP430 program: blinking the red LED connected to the P1 pin.
Create a blink.c file using your favorite editor: /* Demo app to blink the red LED on the TI Launchpad */
#include <msp430g2231.h>
int main(void) { volatile int i;
// stop watchdog timer WDTCTL = WDTPW | WDTHOLD; // set up bit 0 of P1 as output P1DIR = 0x01; // intialize bit 0 of P1 to 0 P1OUT = 0x00;
// loop forever for (;;) { // toggle bit 0 of P1 P1OUT ^= 0x01; // delay for a while for (i = 0; i < 0x6000; i++); } }
Next compile your program: $ /opt/msp430-gcc-4.4.5/bin/msp430-gcc -oS -o blink.elf blink.c
Connect the Launchpad to your development machine using the supplied USB cable. Use MSPDebug to download and launch your program. $ sudo mspdebug rf2500 (mspdebug) prog blink.elf Erasing... Programming... Writing 104 bytes to fc00... Writing 32 bytes to ffe0... (mspdebug) run Running. Press Ctrl+C to interrupt...
You should now see the red LED blinking! |