NeoPixel Strip serial drive details

Play with it! Please tell us which board you're using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Rick314
 
Posts: 10
Joined: Wed Sep 22, 2021 6:00 pm

NeoPixel Strip serial drive details

Post by Rick314 »

I have a Circuit Playground Express, an adafruit 3811 30-NeoPixel Strip, and wanted to understand how one wire set the color of all those pixels. Multiple sources led to this summary that I hope readers find useful.

8 bits per color * 3 colors (Red Green Blue) per pixel * 30 pixels = 720 bits. Each bit is 1.25 micro-seconds (us) long, consisting of a high voltage then a low voltage. If the high is longer than the low it is a 1. If the low is longer than the high it is a 0. Bits are sent to the strip in order: 8 green, 8 red, 8 blue for pixel 0; 8 green, 8 red, 8 blue for pixel 1; ... pixel 29. Each pixel has serial in and serial out wires. Each pixel consumes (serial in, latch, parallel out) the first 24 bits it sees and during that time transmits nothing to higher number pixels. Once it has its 24 bits it passes all further bits is receives on up the strip immediately. The first 24 bits any pixel receives are the bits it keeps. Pixel 29 only sees its 24 bits and nothing before that. Each pixel resets when its input has been low for more than 80 us and is ready for an another update.

1/(1.25 us) = 800 kHz = the bit frequency, right in the middle of the AM broadcast radio band. You can hear the strip update by putting an AM radio near the Circuit Playground Express and tuning it to 800 kHz. 1.25 us per bit * 720 bits = 900 us. Add 100 us for a reset period, and 1/(900 + 100 us) = 1 kHz = the maximum update rate of the whole strip.

This photo shows the Circuit Playground Express serial drive to the strip, setting all pixels to dim green (green = 21 = binary 00010101, red = 0 = binary 00000000, blue = 0 = binary 00000000). You can see the initial 00010101 green value for pixel 0, followed by 3 (of 16 total) zero bits. That pattern repeats 29 more times. The picture shows a measured value of 8.6 us for 8 bits, or 1.08 us per bit instead of the expected 1.25 us per bit. The LogicDart was last calibrated in 1997, but it still shows the right idea.
20220301_083934.jpg
20220301_083934.jpg (398.75 KiB) Viewed 113 times

Locked
Please be positive and constructive with your questions and comments.

Return to “Circuit Playground Classic, Circuit Playground Express, Circuit Playground Bluefruit”