Rickta59 589 Posted September 11, 2014 Share Posted September 11, 2014 Those APA-102 leds that are packaged like ws281x pixels but you drive like a ws2801 (clk/data) have hit ebay.com. I ordered a 1 meter length and it arrived today. They look and feel like a ws2811 strip. It has 4 connections. 5V, GND, CLK, DATA. I whipped up a quick test and they seem to be happy: /** * APA-102 - test of 5 leds * * Author: rick@kimballsoftware.com * Date: 09-11-2014 * */ #include <fabooh.h> #include <main.h> #include <spi.h> namespace { typedef spi_attr_t<> SPI_MODE3_A; typedef spi_eusci_b0_t<CS, SCLK, MOSI, NO_PIN, SPI_MODE3_A > spi_t; spi_t spi; } void setup(void) { spi.begin(); spi.set_divisor(8); // 1MHz spi } static const unsigned char buff0[] = { 0x00, 0x00, 0x00, 0x00, // start frame (0b111 << 5 | 31), 0x00, 0x00, 0xFF, // red (0b111 << 5 | 31), 0x00, 0xFF, 0x00, // green (0b111 << 5 | 31), 0xFF, 0x00, 0x00, // blue (0b111 << 5 | 31), 0xFF, 0xFF, 0xFE, // white (0b111 << 5 | 31), 0x00, 0x00, 0x00, // off 0xFF, 0xFF, 0xFF, 0xFF // end frame }; static const unsigned char buff1[] = { 0x00, 0x00, 0x00, 0x00, // start frame (0b111 << 5 | 31), 0x00, 0x00, 0x00, (0b111 << 5 | 31), 0x00, 0x00, 0x00, (0b111 << 5 | 31), 0x00, 0x00, 0x00, (0b111 << 5 | 31), 0x00, 0x00, 0x00, (0b111 << 5 | 31), 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF // end frame }; void loop(void) { while(1) { spi.select(); spi.shiftout(buff0, sizeof(buff0)); spi.deselect(); delay(1000); spi.select(); spi.shiftout(buff1, sizeof(buff1)); spi.deselect(); delay(1000); } } These chips are perfect when you don't want to run your msp430 at high clock speed but still want to be able to use a bunch of rgb leds without resorting to external led drivers or shift registers. However, if you do want to run fast, even faster than the ws281x 800kHz, you can. I tested with both a low speed (500Hz) and a high speed (up to 16MHz) configuration successfully. Using an msp430fr5969 chip at 8MHz I settled on 1MHz in the code above. For a nice review of the chip's internals, you can read more about them on this cpldcpu's blog: http://cpldcpu.wordpress.com/2014/08/27/apa102/ -rick RobG, spirilis and bluehash 3 Quote Link to post Share on other sites
bluehash 1,581 Posted September 11, 2014 Share Posted September 11, 2014 Thanks! Reading Tim's blog..Clk and dat are separated. These will become popular. Couls you share your ebay seller @@Rickta59 Quote Link to post Share on other sites
Rickta59 589 Posted September 11, 2014 Author Share Posted September 11, 2014 Here is the one I ordered from: http://www.ebay.com/itm/141299626574 -rick bluehash 1 Quote Link to post Share on other sites
L.R.A 78 Posted September 12, 2014 Share Posted September 12, 2014 I agree they will be popular. Though i still wouldn't completely discard the WS2812. The APA102 only have a maximum of 400Khz while the WS2812 has a maximum (and minimum) of 800Khz. I think for bigger things the WS2812 is better since it's not that hard for a powerful MCU to control them + the higher refresh speed + when you do something with allot of LEDs you alredy are using a powerful MCU/processor. But now these APA102. They are like a dream when you want to use the MSP430 now that they are integrated into the LED package. It's so simple the control. I want to do something for next month with just a few RGB LEDs. Well it's better to use a DIP packet for this so i need the MSP430 instead of the Tiva so those are perfect. So for hobby projects these will certainly be the most popular. Just give it some time. Quote Link to post Share on other sites
StupidPig 10 Posted November 3, 2014 Share Posted November 3, 2014 Saw this thread awhile ago, and think that would be cool to make some x'mas light with this. So I brought some APA102 strip on ebay and give it a try, but somehow I can't get it work. I get a spare 2231, hook up the clk to P1.5 and data to P1.6, but it only randomly turn on a couple LED on a 72-LED strip. Just to make sure the strip is working, I hook it up with a picaxe 08m (which been collecting dust for many years.... ^.^), write some simple basic code, and the strip seems works fine. Do I need a 3.3v->5v level shifter on the SPI lines? I was thinking 3.3V should be good for logical 1 for the APA102. Quote Link to post Share on other sites
cde 334 Posted November 3, 2014 Share Posted November 3, 2014 Saw this thread awhile ago, and think that would be cool to make some x'mas light with this. So I brought some APA102 strip on ebay and give it a try, but somehow I can't get it work. I get a spare 2231, hook up the clk to P1.5 and data to P1.6, but it only randomly turn on a couple LED on a 72-LED strip. Just to make sure the strip is working, I hook it up with a picaxe 08m (which been collecting dust for many years.... ^.^), write some simple basic code, and the strip seems works fine. Do I need a 3.3v->5v level shifter on the SPI lines? I was thinking 3.3V should be good for logical 1 for the APA102. You might have better luck running the msp430 at 3.6V. That tends to near the typical VIH of a 5V ttl device (VCC * 0.7). StupidPig 1 Quote Link to post Share on other sites
roadrunner84 466 Posted November 4, 2014 Share Posted November 4, 2014 Saw this thread awhile ago, and think that would be cool to make some x'mas light with this. So I brought some APA102 strip on ebay and give it a try, but somehow I can't get it work. I get a spare 2231, hook up the clk to P1.5 and data to P1.6, but it only randomly turn on a couple LED on a 72-LED strip. Just to make sure the strip is working, I hook it up with a picaxe 08m (which been collecting dust for many years.... ^.^), write some simple basic code, and the strip seems works fine. Do I need a 3.3v->5v level shifter on the SPI lines? I was thinking 3.3V should be good for logical 1 for the APA102. I'm not entirely sure, but these packages seem to use I2C, so you should put a pair of pull-up resistors on the Clk/Data lines. Never mind, it's SPI, not I2C. Maybe you can drive the MSP430 at 3.6 volts (like the launchpad), does that do the trick? Quote Link to post Share on other sites
RobG 1,892 Posted November 4, 2014 Share Posted November 4, 2014 You don't need level shifter. How are they connected? Is the GND connected? BTW, check out this thread. Quote Link to post Share on other sites
StupidPig 10 Posted November 6, 2014 Share Posted November 6, 2014 --- Quote Link to post Share on other sites
StupidPig 10 Posted November 6, 2014 Share Posted November 6, 2014 Thanks for everyone tried to help. Somehow it seems the voltage regulator I used is faulty and only giving out around 2.1v. The strip works fine after I replace the regulator, by simply direct connect clock and data line to P1.5 & P1.6. Quote Link to post Share on other sites
PhilXu 0 Posted May 19, 2015 Share Posted May 19, 2015 Thx for your enthusiasm about apa102. recently we have developed apa102 digital white color http://www.rgbledcolor.com Some videos about it http://youtu.be/Hcbhn-ehfhc Quote Link to post Share on other sites
zeke 693 Posted May 19, 2015 Share Posted May 19, 2015 How did I miss this topic?! @@Rickta59, I purchased the APA102, 144 LEDs/meter strip from the same eBay store just yesterday. After I get my code running, I will be cutting up the strip to make my prototype marquee clock. My kids are begging me to hurry up. They are mesmerized by the coloured blinkyness of the LEDs. Thanks for the code as well. Quote Link to post Share on other sites
pololu 0 Posted October 9, 2018 Share Posted October 9, 2018 CAN YOU TEST APA107 LED? Quote Link to post Share on other sites
zeke 693 Posted October 9, 2018 Share Posted October 9, 2018 @pololu The communication scheme, the physical footprint, and the pinout all appear to be exactly like the APA102 so it looks like the APA107 is a drop in replacement. APA107_RGB.pdf Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.