MSP430 Mood Light Update

Correction: It’s 18 bit, not 21 bit.

I just wanted to post an update on the RGB mood light I have been working on. I have optimized the code a whole lot, and it now runs smooth with a total of 6 bits per channel with a total of 18 bits color. That is 64 levels of intensity for each of the color channels.

Video recorded with my cellphone, hence the quality.

You can check the sourcecode out from the subversion repository at svn.noccy.com/mspdev where you can find the sourcecode in the projects/moodlight folder. It depends on libarduino to build for now, so make sure you run the start.sh script in the root or accommodate the dependencies accordingly. For Linux users, this would be:

$ svn checkout http://svn.noccy.com/mspdev/ mspdev
$ cd mspdev
$ ./start.sh
...Answer the questions...
$ cd projects/moodlight
$ make
..your device will be programmed..
The circuit is pretty self explanatory. The P1.1, P1.2 and P1.3 lines are hooked up to the collectors of three PNP or NPN diodes. The LEDs are then hooked up to +V via an resistor or directly depending on your LEDs. The remaining legs are then connected to the transistors base,  and the emitters to GND.
In a future version, P1.4 and upwards is going to be used for inputs, to control the light. I am also considering moving the LED pins away from the UART and SPI pins to allow it to be used with an RF-shield like the Air Booster Pack or be controlled from the pc.
  • main.c (Highlighted source)

lib430 updates

lib430 has been updated together with all the skeleton files. Actually, the skeleton files updated first, causing the chef to fail at building the libraries altogether. But everything has been sorted. If you have other projects that depend on the skeleton makefiles (primarily common.mk) you should use SOURCEC in your include file to define the source files to compile, rather than SOURCES. As an added bonus, you can now use SOURCECPP and SOURCEASM to point to C++ and assembly files to compile.

libArduino is in the process of being improved with basic “uptime” functionality. This makes the micros() and millis() usable in your code. They will however count with a reduced granularity, which means that subsequent calls to the functions are likely to return the same value. This is done to preserve memory and make sure that the counters can run long enough. The main file has also been updated to remove external dependencies on libCore for wdt_halt().

libAir is moving as well. It is however not working yet. The drivers for the RFM70 and CC1101 radios are still very much in the works.

libLcd should be working with HD44780 displays, but I have been unable to test this code fully as I suspect my 16×2 LCD is broken. However, the HD44780 is not the only display out there, so more drivers are needed. Have you got some code to contribute perhaps? :) Make sure to put yourself as @author in the header files.

libComm currently implements a mostly working FIFO buffer, while the Software UART (suart) support is still untested. The Hardware UART (huart) implementation is not yet complete, and the same goes for SPI and I²C.

Please download it and have a go at it, and if possible feel free to pitch in. If you have code to contribute for any of the libraries, or would like to propose a new library for the collection just let me know.