APA102 aka “Superled”


cpldcpu writes:

I contrast to the very timing-sensitive one-wire protocol of the WS2812, the APA102 uses a standard two wire SPI protocol – one clock line and one data line. Each LED has two inputs and two outputs which can be daisy chained. At the first sight this may seem wasteful, but it has the advantage of being supported by standard microcontroller periphery and it is insensitive to timing variations. Due to the critical timing requirement it is not possible to control the WS2812 from SOCs with multitasking operating systems, such as the Raspberry Pi. This should not be an issue with the APA102. Furthermore, the data can be transferred at an almost arbitrary clock rate. I was able to control the LEDs with 4 MHz SPI clock without any hitch. It appears that the maximum speed is mainly limited by the parasitics of the wiring.

Join the Conversation


  1. It would have been so much easier to lay out on a one layer flexi if they had put power and ground on opposite corners!

  2. Kermit: just turn the chip 90 degrees.. power on top, ground on bottom and you can stripe do/co to di/ci of next chip.

  3. It’s possible to control WS2812 from multitasking OS with SPI, assuming that SPI speed can be set so that bit timing is within WS2812’s specs (400ns+-150ns short pulse / 850ns+-150ns long pulse).

    For example using 3MHz SPI clock (333ns/bit) and 4-bits of memory for each WS2812 bit: 0111 = 3*333ns = 999ns (long pulse), 0001 = 1*333ns = 333ns (short pulse). These are barely in spec, but seem to work, better timings can be achieved by using more bits and faster clock or better fitting SPI clock if available.

    Data can be generated beforehand for whole string of LEDs (3x8x4 bits for each LED @3MHz) and buffer can be sent by using DMA transfer or by filling FIFO in IRQ.

  4. It’ll be fine. You want a ground plane underneath the chip anyway for thermal, so run the ground line along the top and flood under the chip down to the ground pin.

Leave a comment

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.