Leonard/Janis Robert König · @ljrk
268 followers · 10699 posts · Server todon.eu

Finally had time to look at the @HIP22 badge and have some initial code working as well as one of the 16 s driven by the 's.

Something I haven't yet seen (but seems to be quite common) is (ab-)using the to produce the waves for the DIN for the LEDs:

To recap, SPI uses SCLK, PICO/MOSI, POCI/MISO, CS/SS for communication, that is clock, data to and from peripheral and chip-select. The LED stripe only uses one "data in" port however, with a peculiar square-wave protocol that requires precise timing. One popular way to achieve that is to program the SPI to leave SCLK, POCI and CS unconfigured and only hook up PICO<->DIN. Further, since the SPI works at roughly 4x the speed the LED strips operate, to send one bit of value X over to the LED, you need to tell the SPI to send four such X valued bits.

Now I need to figure out whether the Rust crate for this allows "empty" or dangling SPI GPIO Pins as well...
docs.rs/crate/ws2812-spi/lates

Some articles around this technique:
ioprog.com/2016/04/09/stm32f04
github.com/benwilliam/equinox_

There are some people basically doing the same in hardware:
sites.google.com/site/waynehol
elektormagazine.com/news/spi-t
youtube.com/watch?v=aCK0SpZ2ue

#rust #led #ws2812 #neopixel #smartled #spi

Last updated 2 years ago