mr_spider
Posts: 8
Joined: Sun May 13, 2012 1:17 am

Raspberry Pi and the MSP430

Sun May 13, 2012 1:20 am

Hi,
I have bought both a RPi and a TI MSP430 Lauchpad. I've managed to get the launchpad working with a small 16x2 LCD panel. My question is, how to I interface to the MSP430 from the RPi? I want to use the MSP430 as a display 'driver' (yes, I know you can probably connect the LCD straight to the RPi, but I want to try it this way).

Cheers

xkxx
Posts: 39
Joined: Sat Dec 10, 2011 5:26 am

Re: Raspberry Pi and the MSP430

Sun May 13, 2012 2:34 am

connect them together with the usb wire (or through uart pins, either way works), and then communicate to the launchpad through the uart interface. I assume you know how to program the msp430 under linux or you won't have bought it, unlike me who spent one whole day to get msp430-music to compile :)

mr_spider
Posts: 8
Joined: Sun May 13, 2012 1:17 am

Re: Raspberry Pi and the MSP430

Sun May 13, 2012 7:05 am

Haha, not quite. I'm still waiting for my RPi to arrive (it's meant to be dispatched shortly).
Until now, I've been using Windoze to write code for it. While I'm very familiar with Linux, I'm not quite so familiar with the MSP430s

xkxx
Posts: 39
Joined: Sat Dec 10, 2011 5:26 am

Re: Raspberry Pi and the MSP430

Sun May 13, 2012 12:54 pm

hum, then I highly recommend installing a linux environment on your computer through a virtual machine just to get familiar with msp430 programming in gcc. On the other hand, I doubt if the raspi debian/fedora images have compiled msp430-gcc packages in their repos (as far as I know, ubuntu and fedora didn't have it till the the 2nd latest release). Interesting project, keep me posted.

GrahamC
Posts: 27
Joined: Wed Dec 28, 2011 1:03 am

Re: Raspberry Pi and the MSP430

Tue May 15, 2012 11:45 am

I believe the MSP430 launchpad can only support relatively low baud rates for serial input (using the timer interrupt to sample the data input one bit at a time), anywhere from 2,400 up to 9,600 depending on the MSP430 clock speed used. It might be a little faster to use a pair of GPIO pins on the PI connected to port inputs on the MSP430, one for data and one for clock and have an interrupt to collect a data bit each time the clock line rises (or falls). A bit more code involved through and I don't know how quickly the PI can bit twiddle it's GPIO lines as presumably there is context switching and device driver code involved. A more sophisticated answer would be an I2C type bus. Connecting GPIO pins assumes of course that both devices are going to be powered from the same power supply to avoid any risk of damage.

error404
Posts: 351
Joined: Wed Dec 21, 2011 11:49 pm

Re: Raspberry Pi and the MSP430

Tue May 15, 2012 7:47 pm

The MSP430 toolchain is in Debian testing, and is built for ARM. GrahamC is right though, the included chip doesn't actually have a UART attached to the USB interface, it's just a (rather slow) software UART. You might be able to write one yourself that performs better (probably), but it can be challenging with async serial. Certainly you can experiment though.

It does have SPI hardware though, so you should be able to get quite a fast interface that way.

GrahamC
Posts: 27
Joined: Wed Dec 28, 2011 1:03 am

Re: Raspberry Pi and the MSP430

Tue May 22, 2012 11:21 pm

A correction to what I wrote on 15-May. One of the chips (MSP430G2553) supplied with the latest TI launchpad kit does have a built in hardware UART so it can go up to 115,200 baud without a problem. The other chip supplied (MSP430G2452) doesn't have the hardware UART so you have to emulate serial I/O with timed interrupts.
Earlier versions of the launchpad kit might have been provided with different chips.
So for anyone interfacing the launchpad to the Raspberry Pi async serial does seem a reasonable method but you have to be careful which MSP430 chip is used if you want quick data communication between the two devices.

error404
Posts: 351
Joined: Wed Dec 21, 2011 11:49 pm

Re: Raspberry Pi and the MSP430

Tue May 22, 2012 11:41 pm

As far as I can tell, the included devices are still MSP430G2211 and MSP430G2231, neither of which has a UART. The captouch addon includes the G2452. Where'd you find those other devices listed?

GrahamC
Posts: 27
Joined: Wed Dec 28, 2011 1:03 am

Re: Raspberry Pi and the MSP430

Tue May 22, 2012 11:44 pm

Those are the two chips my kit came with a couple of months ago.

error404
Posts: 351
Joined: Wed Dec 21, 2011 11:49 pm

Re: Raspberry Pi and the MSP430

Wed May 23, 2012 1:18 am

Interesting. If I'd known that I would've bought another Launchpad instead of the captouch board!

Return to “Off topic discussion”