[sdiy] Coloured LEDs

Ben Stuyts ben at stuyts.nl
Mon Feb 20 21:49:06 CET 2017


> On 20 Feb 2017, at 20:54, Ingo Debus <igg.debus at gmail.com> wrote:
> 
> 
>> Am 19.02.2017 um 20:57 schrieb Vladimir Pantelic <vladoman at gmail.com>:
>> 
>> they can be driven just fine with no CPU overhead at all if you have a free SPI and a bit of memory
> 
> So this NRZ signal can be generated with a SPI port? How is this done?

I’m currently playing with those 1 m LED strips with 60 of these LEDs. It’s actually rather easy with an SPI port. You just have to fit one bit of info for those LEDs into an 8-bit byte. And you do that at a frequency of 8 times the required freq. So by setting 0 to 8 bits high you can have a duty cycle of 0..100% in 12.5% steps, and two of those fit nicely in the timing requirements for a ‘0’ or ‘1’ for the LED. You can even use DMA to send this out, but obviously to send out 24 bits of LED data (RGB each 8 bits) you need 24 bytes of ram in the DMA buffer.

And I also recommend the FastLED library that Amos mentioned. It has tons of functionality for driving these LEDs.

Ben





More information about the Synth-diy mailing list