November 29, 2012

MSP430 LaunchPi - expansion board for the Raspberry Pi


So I got my Raspberry Pi a few days ago. (Time from order to delivery was one business day from http://lawicel-shop.se/ .) As I have been playing a bit with the MSP430 Launchpad lately, I thought it would be nice to interface MSP430 microcontrollers with the Raspi. Why not make an expansion board? Inspired by the MSP430 Launchpad, this is what I ended up with:


The expansion board, which I would like to call the MSP430 LaunchPi, is fully pin-compatible with the normal Launchpad (except for the touchbutton, wich I never used anyway). The TX/RX pins are easy to connect with the Raspi UART (GPIO pins 8 and 10) and all GPIO pins from the Raspi are accessable.

Just as on the original Launchpad, the leds and uart connections are configurable using jumpers or double female connectors.

I plan to create a hardware driver for mspdebug to be able to program the board using the GPIO pins 11 and 13 on the Raspi.


Building process

The time from idea to finished board was approximately four hours, the priority was to make something that worked. The design was done using pen and paper.
 In hindsight, it would have been easier to use wirewrap female headers (Arduino stackable) but I used normal female headers with bent legs and soldered these on the solder side of the board.
 I accidentally cut one copper strip, the one leading 3.3 V from the header. Fixed it with some wire.
 I wanted more space on the top of the board to be able to easily change the microcontrollers, so I chose to mount a 47k SMD resistor on the soldering side to pull-up the reset pin.
 After soldering headers, leds, jumpers and resistors, I connected it to the Launchpad. It worked! =)

Plugged in the Raspi. The Test and Reset pins of the MSP430 does not like the default state of the Raspi GPIO pins 11 and 13, so these are disconnected for now.

I had problems connecting to the serial port at first, this was because a getty was connected to the serial port. I disabled this in the file /etc/inittab and rebooted the Raspi.

pi@raspberrypi ~ $ tail -3 /etc/inittab
#Spawn a getty on Raspberry Pi serial line
#Commented out for use with the MSP430 LaunchPi
#T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
pi@raspberrypi ~ $


I had previously loaded the MSP430 with a UART test program (source code available at https://github.com/LarsH/msp430-uart).

pi@raspberrypi ~ $ screen /dev/ttyAMA0 9600

...

Unknown command.
>>>?
Uart test program
Commands:
r: blink red led
g: blink green led
t: read temperature sensor
?: print this help
>>>r
Blinking red led...
>>>g
Blinking green led...
>>>t
Temperature: d6b4
>>>


Success!

Finally I noticed that I forgot to make the green led optional, I resoldered the board a bit to make it possible to disconnect. I also moved the resistor so that I can use the led with another pin and a double female connector. Here are pictures of the final board. Wire colors are red/black for 3V/Gnd, green/yellow for UART Rx/Tx and blue/white for reset pull-up/green led.