Update 4.2: Added link to GitHub-repository.
A long time ago I bought Stellaris LaunchPad just for fun, and because it was so cheap and even included free international shipping. The thing is, that there is no joy with microcontroller if there isn’t anything sensor or device to control. That’s why I also bought 1m addressable led strip from adafruit for ambient lighting purposes.
After wiring these two together, I could start programming with a Launchpad. The led strip uses a somewhat unknown chip named LPD8806, and there is not datasheet available whatsoever. However, adafruit offers led strip driving library for this chip. Usually these strips uses SPI-like protocol, and luckily, so does this one too. But anyway, I had to port arduino-based library to use StellarisWare-libraries. After a while of bitbanging, I finally got the library working just fine.
You can find my implementation of LPD8806-library and other source code at my GitHub repository.
Connecting led strip to LaunchPad is very easy. Just match DI (Data In) and CI (Clock In) pins to LaunchPad’s hardware-SPI pins and you are good to go. I decided to use SSI0-interface, so I connected PA2 to CI and PA5 to DI.
I’m using LaunchPad’s Device USB-port as data-interface for the pc-software. That way, I can use Debug USB-port for debugging and have full-control over the device-usb port. Also using this setup, I can create program that acts just like native LightPack-device (by using same USB Product ID and Vendor ID).
I use external adapter just for distributing power to led strip, because USB-ports usually limits current to 500mA and leds takes about 2A when full brightness. It worked perfectly without any external power when using powered USB hub, but after connecting directly to the PC, then it just won’t work.
I also bought a nice plastic case for this project. Sadly, It was just few millimeters too low to fit. LaunchPad has female and male headers, so it’s surprisingly tall. I just pushed all used pins slightly outwards and then the case fits just perfectly.
Programming, software, and more…
I spent a lot of time researching other ambient lighting projects. Most of the time projects are using atmoligt, boblight, Server IR or custom software in PC to control lighting and screen capturing. I couldn’t get atmolight-software to connect LaunchPad’s virtual COM-port, or anywhere at all. Always same error “Error while connecting to COM-port”, or something like that. Anyway, I got more luck with Server IR, which is very polished software, compared to atmolight or boblight.
If you look closely, you can see that the Device is set to “Adalight”, which means that the connected device is using Adalight-protocol. That protocol specifies data structure when sent to LaunchPad. Protocol itself is very simple. Start looking for start bytes “Ada”, and then three bytes for checksum and led count, and after that, just bunch of bytes in RGB-order specifying each “section” or led. Depeding on configuration, but I’m currently using 32 sections for 32 leds and all leds are controlled directly from PC.
It worth mentioning that many other protocols supports only 3-4 sections for left/top/right/bottom. However, I discovered even better software…
Lightpack is open source project for arduino-based lightpack-boards and leds. It also features support for adalight protocol. It has very simple and elegant UI, support for profiles and more. See the project page at google code.
Here just few reason for using it, comparing to Server IR:
- It has better support for screen capturing. (No need for PlayClaw)
- All configurations in easily modifiable INI-formated text file.
- Open source
This was really first time for me to work with embedded devices. Using StellarisWare with very good eclipse-based Code Composer Studio, it just couldn’t be easier. Of course there were awful a lot of FaultISR-interrupts and other very strange errors, caused by my own mistakes…
And sorry, I speak broken English!! :(
Here few links that were very helpful:
- Stellaris LaunchPad’s documentation (TI has very good documentation, including examples etc.)