Building the "new" MSPGCC from TI and RedHat

Ok, after a system update (opensuse 12.3 to opensuse 13.1) I was without my MSP430 compiler and launchpad connection. Also since the last time a new compiler version appeared (from 4.6.3 to 4.8.0) so I thought I could build (install) a new one.
TI also got together with RedHat to build a new opensource msp-gcc compiler. It took them quite some time but we've got them.
For those that like to try linux installers (beware: sometimes things go up in flames and you don't know why.) you can download the installer from here and run it as

If that doesn't work for you... you can always build from source, these instructions (in spanish) appear to unlock the code .

On the other hand I also tried the install from source! After a couple of attempts I manged to do it, here's how:
- download the sources from here and untar it. (in the following commands remove the "" in the comand line;
- create a new directory like "mkdir build";
- "cd build";
- "../sources/tools/configure -target=msp430-elf -prefix=/opt/cross/msp430"
- "make"
- go and take a looooooooooong coffee (might as well go to work and come back later).
- "sudo make install".

A few caveats I found out the hard way:
- the target must be specified as msp430-elf otherwise gdb won't compile;
- the prefix can be other, it is the directory where all the files will be placed.

I haven't checked actually using the cross compiler for anything but I'll try soon. Also there are some heather files that must be placed in some directory (according to TI) but they don't tell you how and where... I will also have to check that...
Furthermore it appears that mspdebug is not built... also need to check that...
But the compiler runs and gdb also.

Using TI Launchpad in linux

Texas Instruments made a good effort in having free and community tool chain for their family of MSP430 low power microcontrollers. Before the tool chain had to be build by the user and that had the usual problems (dependencies, headers, etc).

You will need to register with TI in order to download the installer (apparently you can download the source without registering, current version (for this post) is You need to change the permissions on that file (chmod 777), then run it.
The launchpad is TI low cost entry point development tool, for 10USD you get two processors, a PCB with embedded programmer and debugger and you can also get plenty of add on modules. The new launchpad has a different interface to the first ones (one row of connectors to two rows on each side), in order to support processors with more IO.

Once the tool is installed you can go to the examples directory and search one for your launchpad. There are still some issues, but they can be alternatives.
I didn't manage to connect the gdb_agent_console to gdb and without this connection debugging and programming are impossible. The previous tool chain needed another agent to interface to gdb (mspdebug), this one still works reasonably well.
You still need to program the processor with mspdebug, then enter gdb mode. In another terminal start gdb, connect to target remote on the correct port and then continue.


Current increase for MAX6957

This will be a mostly Analog Electronics post...

In a project I made with friends we had a Raspberry Pi driving a MAX6957 for driving some LEDs. The MAX6957 was connected to the SPI bus of the RPI and the driving functions were developed in python (if you're interested in this you can post a question in the comments but if google it it's faster).

We were driving a few piranha RGB LED but then we bought a bigger LED (something like this one). In order to keep the software simple and unchanged I wanted to use the MAX to drive the bigger LED. If the MAX drives the LEDs with a current source that can be stepped (in 16 equal current steps), so I would have measure the current of the MAX and amplify it for the new LED.
This is what I've done:

First I have a current mirror, as the MAX sinks current I used PNP transistors, on the other side I have a small resistor to convert current into voltage.
This voltage drives a voltage to current converter with a protection for over current (in case the MAX is removed, goes crazy or it's output is miss configured). Then repeat for each of the 3 channels.


We're back..

I've been busy (very), but I'm still here...
Starting the first post of the year on the end of March is not the best indication of a success blog (which I don't have)... but I'll try to post some old stuff that I did meanwhile.
I've lost a bit of touch with the Arduino and last time I check things have gone mainstream and big (check this one out, an ARM Arduino). I have an old project done two years ago to post.
Meanwhile I've started with the RaspberryPi and how to connect it to some hardware. Although I don't really like Python (the strict indenting drives me mad), you can also use C to program it.
Well all the people of posted questions I've published them, for those with questions just shoot.