Knowing the chef, a lib430 update.

If you have checked out the sourcecode for lib430 yet, you have probably already used the chef to build a library for your mcu of taste. However, if you use several different mcus, and would like to have it built for all of them we can use the buildall.sh script.

Also, you should not remember to call svn update frequently as there is a lot of work going on on the code all the time.

noccy@noccy-desktop:~/Development/mspdev/lib430$ ./buildall.sh
You must first create a file named MCUS and populate it with one microcontroller per line

So let’s create a MCUS file. Just use “cat > MCUS” if you are on *nix. Put in the mcus one per line and hit Ctrl-D when you are done.

noccy@noccy-desktop:~/Development/mspdev/lib430$ cat > MCUS
msp430g2553
msp430f2013
msp430g2452
^D

Calling on buildall will now call the chef to build for each of the controllers:

noccy@noccy-desktop:~/Development/mspdev/lib430$ ./buildall.sh
== Cooking for: msp430g2553 ==
      libair              : Failed          : See msp430g2553/libair.log
   ·· libarduino          : Successful      : (1 libraries, 1 headers)
   ·· libcomm             : Successful      : (1 libraries, 3 headers)
   ·· libcore             : Successful      : (0 libraries, 4 headers)
      libfat              : Failed          : See msp430g2553/libfat.log
      libhal              : Failed          : See msp430g2553/libhal.log
   ·· liblcd              : Successful      : (1 libraries, 1 headers)
      libmidi             : Failed          : See msp430g2553/libmidi.log
   ·· libsound            : Successful      : (0 libraries, 0 headers)
   :: 3 libraries and 9 headers have been installed.
== Cooking for: msp430f2013 ==
      libair              : Failed          : See msp430f2013/libair.log
      libarduino          : Failed          : See msp430f2013/libarduino.log
      libcomm             : Failed          : See msp430f2013/libcomm.log
   ·· libcore             : Successful      : (0 libraries, 4 headers)
      libfat              : Failed          : See msp430f2013/libfat.log
      libhal              : Failed          : See msp430f2013/libhal.log
   ·· liblcd              : Successful      : (1 libraries, 1 headers)
      libmidi             : Failed          : See msp430f2013/libmidi.log
   ·· libsound            : Successful      : (0 libraries, 0 headers)
   :: 1 libraries and 5 headers have been installed.
== Cooking for: msp430g2452 ==
      libair              : Failed          : See msp430g2452/libair.log
   ·· libarduino          : Successful      : (1 libraries, 1 headers)
      libcomm             : Failed          : See msp430g2452/libcomm.log
   ·· libcore             : Successful      : (0 libraries, 4 headers)
      libfat              : Failed          : See msp430g2452/libfat.log
      libhal              : Failed          : See msp430g2452/libhal.log
   ·· liblcd              : Successful      : (1 libraries, 1 headers)
      libmidi             : Failed          : See msp430g2452/libmidi.log
   ·· libsound            : Successful      : (0 libraries, 0 headers)
   :: 2 libraries and 6 headers have been installed.
noccy@noccy-desktop:~/Development/mspdev/lib430$

One thing you might notice is that some of the libraries doesn’t build for some of the microcontrollers. This can be sorted with custom #defines in the various libraries to adapt to the controller. This is where you come in. If you can get something working that wasn’t, your patches are more than welcome. I am a single developer, and this is a work in progress. So I hope you enjoy lib430!

PICkit2 vs. MSP430 Launchpad Revisited

In my previous review I commented on the fact that the Launchpad came with a MSP430G2211 and MSP430G2231 microcontroller, both in DIP14 packaging, which made the stock setup a bit short on I/O pins. I am happy to inform you that the this is no longer true, as the new boards now come with the more powerful MSP430G2553 and MSP430G2452 microcontrollers in DIP20 packaging!

This means you will be getting a full 20 pins mcu at your disposal out of the box, as well as more easily available USI and USCI pins through some design changes on the board. It also comes with the male headers already soldered in place, which might be handy for some, but it makes it harder if you intend to jumper the Launchpad on to a breadboard using the female headers.

When it comes to actually writing code for the Launchpad, I personally must say that it keeps growing on me. The fact that msp430-gcc gives you the whole nine yards including the support to build libraries with the familiar gcc suite arguments makes it take the winning leap against the PICkit2. There are also a couple of additional things to note about the architecture of the MSP430, such as the fact that all I/O pins have built in pull-up/pull-down resistors, which makes the design and engineering of systems based on the MSP430 series controllers much easier.

Read more: http://www.43oh.com/2011/12/confirmed-ti-shipping-launchpads-with-msp430g2553-and-msp430g2452/

PICkit2 vs. MSP430 Launchpad on Linux

I have been fiddling around a bit with microcontrollers lately. As the Arduino revolution still hasn’t hit Sweden, the first microcontroller I got my hands on was the PIC 16F690 that came with the PICkit2. Later, I discovered the MSP430 Launchpad that is available for the symbolic amount of $4.30. Being an avid Linux user, the solutions that came with these two kits didn’t quite work out of the box. Surely, there is always Wine, but this article will compare these two kits from a “native” standpoint in relation with Linux.

1. Hardware

When it comes to hardware compatibility both kits are winners. Plug and Play all the way. Some minor tweaks were needed with the udev configuration in order to make the programmers available without requiring superuser permissions, but besides that no special drivers or other madness was needed.

The included microcontrollers are fairly decent. The PICkit2 comes with a PIC16F690 mcu in a DIP-20 IC. The Launchpad instead comes with a MSP430G2210 in a DIP-14 IC, and a spare mcu included in the package. The downside of the Launchpad is the limited number of I/O on the included mcus, and therefore the winner when it comes to hardware is the PICkit2.

The PICkit2 programmer can also be used to program a variety of the PIC16 series mcus (although not all of them on the demo board as it only supports the 20-pin form factor – you can however wire it up on a solderless breadboard or buy additional demo boards with support for other PIC16 series microcontrollers), while the Launchpad with the mspdebug utility currently only supports a subset of the available MSP430 microcontrollers, namely the following: (this list seem to differ from the list of compatible microcontrollers provided by TI)

CC430F5133    MSP430F149    MSP430F2234   MSP430F2618   MSP430F5438A  
CC430F5137    MSP430F1611   MSP430F2274   MSP430F413    MSP430F5529   
CC430F6137    MSP430F1612   MSP430F2370   MSP430F4270   MSP430FG4618  
MSP430F1121   MSP430F169    MSP430F247    MSP430F47197  MSP430G2231   
MSP430F1232   MSP430F2013   MSP430F249    MSP430F5437   
MSP430F147    MSP430F2131   MSP430F2616   MSP430F5437A  
MSP430F148    MSP430F2132   MSP430F2617   MSP430F5438

The functionality provided on the boards is pretty similar. The PICkit comes with four leds, one button and one potentiometer that can not be disabled. The Launchpad instead comes with two leds that can be disabled with two jumpers, and two pushbuttons of which one acts as a reset button.

2. Programmer

Microchip does offer an open source programmer, pk2cmd, that provides the same functionality as the PICkit2 programmer software does in Windows. As an added bonus, this programmer also compiles on Mac.

In the case of the Launchpad, there is no official effort to support Linux or any other platforms besides Windows for that matter. Programming the device is done using the open source community effort mspdebug which also offer step-by-step debugging as well as disassembly and memory dumping.

Microchip gets a gold star for providing an open source programmer, but from a usability standpoint the programming and debugging features provided by mspdebug makes this the winner.

3. The Code

The Microchip assembly language is very well supported by the gpasm software suite, all the examples that you can find in documentation as well as on the interwebs can be instantly compiled and tested. For the Launchpad, I still haven’t had a go at writing assembly language code.

Both kits do however support C; in the case of the PIC microcontrollers the Small Devices C Compiler (SDCC) does a fairly good job at creating binary blobs from standards compliant C code, while the Launchpad instead prefer a patched version of the Gnu C Compiler (GCC) aptly named msp430-gcc.

The PICkit2 with SDCC however does require a bit of digging in order to get full access to header files and similar to support I²C, UART etc.

Microchip also provides a C-compiler named HiTech C that works in Linux, but this is really crippleware with a limitation on the resulting code size based on the target device.

For Windows, the support comes with the MPLAB IDE that integrates the programmer with a C-based environment based around HiTech C. There is also a MPLABX IDE available as a beta that is built around the OpenSource IDE NetBeans, that works with SDCC as well as the other by Microchip supported programmers. For some reason, MPLABX feels much more heavy compared to the standalone NetBeans IDE, but this will hopefully change when it gets out of beta.

The winner here is yet again the Launchpad, but if Microchip decided to help bring SDCC up to speed as well continue their work on MPLABX the verdict is very likely to change.

Summary

Both platforms work flawlessly in Linux, but they leave a bit to wish for when it comes to support from the manufacturers. As for getting started, both the PICkit and the LaunchPad work pretty much out of the box, and both have got potent open source solutions to deliver the full potential even in Linux. The Launchpad however feels more mature when it comes to writing code in C, and also comes with powerful debugging functionality. The only thing the Launchpad falls behind with is the number of I/O the included microcontrollers come with, but on the other hand, with a pricetag of $4.30 it just can’t go wrong.

TI’s new $4.30 LaunchPad is a complete development kit for harnessing the ultra-low power and 16-bit performance of MSP430™ Value Line MCUs

TI LaunchPadThe press release reads:

Dallas, TX (June 22, 2010) – Furthering its commitment to merge 16-bit MCU performance, ultra-low power and ultra-low cost to overcome shortcomings of 8-bit MCUs, Texas Instruments Incorporated (TI) (NYSE: TXN) today announced its new MSP430™ MCU Value Line LaunchPad development kit. For $4.30, the open source kit includes all of the hardware and software needed to easily launch designs based on TI’s MSP430 Value Line MCUs, which start at 25 cents and offer up to 10X performance and 10X battery life over 8-bit MCUs. LaunchPad supports rapid prototyping and development by allowing developers to quickly drop-in MSP430 Value Line MCUs to evaluate, program or debug devices. This flexibility allows developers to remove programmed devices to be placed on a custom board, or remain plugged into LaunchPad to leverage on-board buttons, LEDs and breakout pins for external components. For more information, including multiple production-ready open source projects, please visit www.ti.com/launchpadwiki-pr.

LaunchPad is compatible across the MSP430 MCU Value Line allowing developers to adapt to evolving design requirements in fast moving markets. MSP430 LaunchPad and Value Line MCUs provide a complete development environment to enable applications including 3D glasses, gaming controls, touch sensing, smoke/fire detectors, wireless networking and more. Additionally, since all MSP430 MCUs are code compatible, solutions developed using LaunchPad can be seamlessly migrated to any other MSP430 MCU for added scalability

This looks like quite the nifty little embedded project. And the price is just right to get things rolling.

Sources: newscenter.ti.com, TI Wiki, HackADay