Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.

WS2812 Refresh
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

WS2812 Refresh

by thelearnlaxi on Fri Jun 19, 2020 2:46 am

Hi, I'm posting on both the microcontrollers and general project help page because this seems to fit both categories.

I am using a micro controller that does not have a built in library for the WS2812 LEDs so I am writing my own. I've been using SPI to send 300ns pulses to the Din on the WS2812b strip. Therefore 1 bits are sent as (1110) and 0 bits are sent as (1000).

The MOSI line is pulled low for ~75 microseconds at the end of each pattern to have the LEDs latch/reset. However, the WS2812 light pattern only shows the updated, correctly programmed pattern after power cycling the WS2812's Vin (5V).

Further observations:
1) When Din is disconnected, the LEDs appears to have latched onto the pattern and remain illuminated (only after power cycling).

2) However, when I set a delay after sending the pattern on the MOSI line in an infinite loop, the LED never illuminates even with power cycling. This makes it seem that Din need to be constantly refreshed but this contradicts 1).

Code: Select all | TOGGLE FULL SIZE
   // send LED pattern
        // Delay 1 second (MOSI line is empty)


Q1) How do I refresh the LED pattern without having to power cycle?

Q2) If I'd like to illuminate a pattern for a long duration, does Din still need to be constantly repeating the same byte patterns? How can the LEDs remain illuminated without having to do so?

dịch vụ giúp việc theo giờ uy tín giúp việc nhà ở chung cư giá rẻ giúp việc theo giờ quận 1 chuyên nghiệp

Posts: 3
Joined: Sat Nov 16, 2019 3:29 am

Please be positive and constructive with your questions and comments.