Raspberry Pi meets TI LaunchPad MSP430

A few weeks ago I got a TI LaunchPad. With the help of a few tutorials I managed to get the basic input, output and UART working. As most of the examples that I could find are for CCS, I decided to go that route instead of IAR.

My next step was to get my LaunchPad working with my Raspberry Pi via the USB port. After a bit of playing around and installing a few programs, I managed to get it to work. Below is how I got a program  written, compiled and programmed onto the LaunchPad from the Raspberry Pi.

First you have to install a few programs with apt-get.

$sudo apt-get install binutils-msp430
$sudo apt-get install gcc-msp430

$sudo apt-get install msp430mcu

$sudo apt-get install mspdebug

$sudo apt-get install msp430-libc

You might have to run

$sudo apt-get update

before installing the modules.

Next run mspdebug to make sure that there are no errors. If there are no errors type exit to close the debugger.

$sudo mspdebug rf2500

Now that you have everything installed, we need to create the program. I use nano text editor to write my program.

$sudo nano button_ISR.c

This program uses the two LED’s and one push button on the LaunchPad. When the button is pressed, an interrupt is generated and then the LED’s are toggled.

Close nano saving the changes.

The program then needs to be compiled.

$sudo msp430-gcc -mmcu=msp430g2553 -g -o BUTTON_ISR button_ISR.c

The program should compile without any errors and now you are able to run the debugger.

$sudo mspdebug rf2500

Now program the device

prog BUTTON_ISR

and run the program

run

CTRL+c will stop the program running and exit will close the debugger.

In the next post I will show you how to communicate between the TI LaunchPad and Raspberry Pi via hardware UART and the USB connection.

Greg