Tuesday, December 11, 2012

MSP430

On MSP430 and why it's better than Arduino

MSP430 is a family of 16 bit micro controllers from Texas Instruments. As I'm not a hardware engineer or a really embedded software engineer by trade. I'm mostly interested in the low-cost, educational development boards. Here, the MSP430-based TI LaunchPad  (why did they use that name!) MSP-EXP430G2 board fits the bill perfectly. At the astonishing cost of $4.30 (with free worldwide shipping) it's really the best way, that I know of, to learn about pretty advanced, embedded, low power software. Unlike the ubiquitous Arduino, the family of LaunchPad boards requires some serious learning and has quite decent range of low-level, on-die hardware to work with. You may disagree with me here (Arduino is better in that it does not really require you to learn anything) but the point is that I do want to learn about all that the low-level stuff.


The beautiful hardware

I got my first MSP430-based board over a year ago. During that time, in my limited spare time, I learned about its extremely simple and elegant assembly language, about the way designers exposed all the hardware as memory-mapped registers, about the DMA engine and the several low-power sleep states and many other interesting things. And I found much joy in all of that, as it was the opposite side of the spectrum, filled with my daily duties as a python developer. Here I could cherish each of the 512 bytes of memory (that the particular variant, M430G2553, comes with), each of the 16 registers and all of the carefully crafted 27 instructions. While I got exactly nowhere with actual programming or hardware applications (applying the hardware to solve a particular problem) I did have more fun than I ever did with Arduino.


My learning process

A few months ago I created a small repository called hello-msp430 with a few really basic programs (so far only two, more are on the way) and detailed instructions on how to set everything up. My goal is to document my learning process by writing lots of small programs that use and explain a given piece of hardware (interrupts, timers, watchdog, GPIO pin, etc). If I can explain something then hopefully, I understand it myself. Most importantly all of my examples are designed to work well on free software desktops using free software toolchains  (mspgcc and mspdebug). I found the learning experience somewhat frustrating, finding mostly code and examples that only work with the proprietary IAR and Code Composer Studio IDE/compilers. I did try them out in a virtual windows box but it was annoying and complicated, filled with the kind of software interactions that I don't like.


There's a lot to read

MSP430 is a pretty well-documented piece of hardware, starting with the excellent user's guide from TI that in itself documents virtually everything there is about the hardware, to books and various online community resources. Lately I also came across a large collection of mspgcc tutorials that are a really great read if you don't have any books about the device yet. I really wish the same was true for the new ARM Cortex M4 based micro controllers, that in comparison, are a licensing minefield with no free software ecosystem in sight.

Thursday, December 6, 2012

plainbox 0.2 released

What is plainbox?

Plainbox is a re-implementation of checkbox that is easier to maintain, understand and embed into additional programs. Checkbox is a tool (launchpad project entrywiki) for testing hardware that Canonical uses to work with vendors for hardware certification.

Why the rewrite?

We chose to rewrite our code because it grew very hard to maintain. The original implementation scaled for many years with additional features but was very hard to understand and difficult to test. We've came up with a much more plain approach that will get the same job done in a more maintainable, testable and practical manner. Plainbox is highly testable, tested and documented (sadly we don't have a public web-clickable docs but do read the source code please!) and we're just getting started!

How do I get it?

Plainbox started out as a separate repository but it has now been integrated into the lp:checkbox repository as a sub-directory. You can get the code directly and look at the associated README.md file. You can also use our checkbox-dev PPA and install the plainbox package directly. Lastly if you're into python you can also grab plainbox from pypi.

What can plainbox do?

Currently plainbox is mostly interesting to people that are into testing and have been using checkbox in the past. Plainbox is already much better at some things (notably error diagnostics, understanding checkbox jobs, detecting dependencies) and entirely lacking at others (no support for saving data back, no GUI, no support for sudo-elevated jobs, a few quirks in the checkbox requirement evaluation system). We support most of the jobs that are in checkbox and by the next version we should really support all of them (maybe except sudo-elevated jobs, those may need some more work to get done properly). 

Plainbox can run automatic and manual tests. It supports advanced dependencies where a test (something we also call a job for technical reasons) can depend on successful execution of other tests. Plainbox can also limit a test to a machine where certain hardware or software is installed via an extensible and powerful resource system (where only the machine with the appropriate resources will execute certain tests). Plainbox (via checkbox) comes with a large library of real-world hardware testing components that can be used to create both generic and very specific solutions).

What's coming next?

In the next few quick releases we want to get all the existing jobs supported properly with simple but powerful command line tool that could allow us to replace checkbox with plainbox in certain scenarios. We have an ongoing project to redesign the UI without the limitations that the original implementation carried but it will take us a while to get to a working prototype.

You can help!

if you are interested in testing, have been using checkbox in the past, want to review our code and point out issues, want to build some custom tools and are looking for software components come and talk to us in #ubuntu-quality on IRC (just ask for plainbox or checkbox and we'll get back to you!). We're a great, friendly team to work with and we would love to see you interested in this topic.