PSoC NeoPixel Tree Lights | Cypress Semiconductor
PSoC NeoPixel Tree Lights
When you have the option between decorating your house or tree the normal way or the nerdy way, a true engineer will always pick the nerdy path, right? Standard strings of holiday lights are usually only one color and at most just blink. During the last couple years you can get some LED lights that change color and make interesting patterns. That is cool and all, but your decorations will be the same as everyone else, that buy those lights.
If you are interested in adding a little flash to your decorations this year, there are some fun modules available that will help you do just that. The WS2811 and WS2812 contain three LEDs, red, green, and blue, and a serial interface to control the current in each LED. These RGB LED modules are also known as NeoPixel. Strings up to five meters long or rings of them can be found at Adafruit.com. You can chain a thousand or more of these devices in series, controlled by a single IO pin. The bad news is that the interface is non-standard. Most single chip microcontrollers require you to use firmware to bit-bang the interface. Since the WS2811/12 parts operate at 800K bits per second interface, the firmware must bit-bang at an accuracy of about +/- 150 ns. This can easily take up 100% of the CPU time just to send the data to the LEDs! With PSoC (3,4,5) you can create your own custom interface and easily interface to parts such as the WS3811/12. The UDBs in PSoC allow you to load a FIFO every 30uS instead of constantly toggling a GPIO pin at speeds at less than a 1 micro second interval.
Since this component has already been created, you can spend your time coming up with cool patterns to dazzle your friends and relatives. I have included a PSoC Creator Workspace that includes the StripLights library (for the WS2811/12) and a couple of example projects to give you an idea of how to use the component. Both projects are built for the PSoC 4200 family, but you can change the project to use either PSoC 3 or PSoC 5LP. Project P4_OneRing controls a single ring of these LED modules. The second project P4_MultiRings , allows you to string multiple rings together to make your own very cool string of circular lighted ornaments. You can find the download here at http://www.cypress.com/?docID=51512 You are not limited to rings of lights with this library or the examples, you can use any combination of the LEDs to do whatever you want. So get out there and be creative with PSoC and some LEDs!
The images below show one of the 12 LED rings from Adafruit.com, twelve of these rings wired in series, our amazing Christmas tree in my office using several of these rings, and what the project schematic looks like.