So I broke down and bought a 5M roll of the individually addressable RGB LED strips based on the WS2811 current driver. I've been playing around with it on my Arduino using the Fast_SPI library (SPI_TM1809 chipset) and is relatively easy to write programs for. However, I can't really dedicate my arduino to driving this, so I'd like to build a controller for it using one of the PICAXE chips I have (20M2, 20X2, 14M2 and 08M2), or buy another if need be. Since it only requires a 1-Wire 800kHz signal, all of them 'should' work; however, I'd like to attach it to a joystick switch (x/y axis w/ push button...and prob a few other buttons for added features), so the 08M2 is out since it wouldn't have enough pins. Unfortunately I don't know where to begin!
Background / WS2811 Info:
I've been doing a lot of research on the WS2811's protocol and have a pretty solid understanding of how the timing/data is formatted. It works on a 1-wire protocol providing both data and timing. Essentially each WS2811 byte is 10uS long, divided into 8-1.25uS bits. Each bit is then sub-divided into 5-250nS segments. Each bit must start with a logic 1 and end with a logic 0. The middle 3 segments determine the value of the bit. After each byte, a minimum of 50uS is required for a reset condition.
Timing:
To sent a 0 - 250ns high / 1000ns low.
To sent a 1 - 1000us High / 250ns low.
The timing on this doesn't have to be exact since the read is at the midpoint of 625nS (+/- 150nS), so there's a lot of room for noise. Essentially then, each WS2811 incoming byte requires 5 bytes sent from the controller.
The 0s and 1s are required, and the Xs make up the bits that change. Most of the data I found comes from these three sources: One, Two, Three, and the datasheet.
Like I said, I've been able to drive my 5M strip very well using my arduino and the Fast_SPI library, though the TM1809 uses a slightly different timing. Each bit is only divided into 3 segments, but is the same length. It requires a little less bandwidth, but not as much noise immunity. But it seems to be working fine. The project I have in mind only uses about 3M too.
The datasheet also says there's a low-speed timing mode too using a 400kHz data rate. But that requires PIN 7 of the chip to be set to Vdd. I sampled the arduino's output pin though and it's using 1250uS timing, so it seems it's setup in fast mode.
Where I need help
There's essentially two areas I need help with:
It looks like the hspiout would be what I want, but I'm honestly completely confused when it comes to all this timing! Fastspi mode can achieve 1MHz, which seems to over satisfy the 800kHz data rate, but beyond that the whole timing thing starts going way over my head
2. So even if I'm able to produce the proper output data timing, I'm still not sure how to actually format the data. The datasheet does show a 24-bit data format, but I'm not exactly sure how to interpret it, nor does it say anything about address data.
From datasheet: 24bit composition R7 R6 R5 R4 R3 R2 R1 R0 G7 G6 G5 G4 G3 G2 G1 G0 B7 B6 B5 B4 B3 B2 B1 B0
I'm assuming since the TM1809 chipset uses the same data composition that this is a relatively common format, so I'm just hoping someone here might have some added insight on this.
Thanks for any help or info anyone can provide, and please don't be afraid to say I'm in way over my head Though likely it won't do much to detour me! hehe
Background / WS2811 Info:
I've been doing a lot of research on the WS2811's protocol and have a pretty solid understanding of how the timing/data is formatted. It works on a 1-wire protocol providing both data and timing. Essentially each WS2811 byte is 10uS long, divided into 8-1.25uS bits. Each bit is then sub-divided into 5-250nS segments. Each bit must start with a logic 1 and end with a logic 0. The middle 3 segments determine the value of the bit. After each byte, a minimum of 50uS is required for a reset condition.
Timing:
To sent a 0 - 250ns high / 1000ns low.
To sent a 1 - 1000us High / 250ns low.
The timing on this doesn't have to be exact since the read is at the midpoint of 625nS (+/- 150nS), so there's a lot of room for noise. Essentially then, each WS2811 incoming byte requires 5 bytes sent from the controller.
Code:
|8th 7th 6th 5th 4th 3rd 2nd 1st | [WS2811 bits]
|1XXX01XX|X01XXX01|XXX01XXX|01XXX01X|XX01XXX0| [data]
| First | Second | Third | Forth | Fifth | [Controller bytes]
Like I said, I've been able to drive my 5M strip very well using my arduino and the Fast_SPI library, though the TM1809 uses a slightly different timing. Each bit is only divided into 3 segments, but is the same length. It requires a little less bandwidth, but not as much noise immunity. But it seems to be working fine. The project I have in mind only uses about 3M too.
The datasheet also says there's a low-speed timing mode too using a 400kHz data rate. But that requires PIN 7 of the chip to be set to Vdd. I sampled the arduino's output pin though and it's using 1250uS timing, so it seems it's setup in fast mode.
Where I need help
There's essentially two areas I need help with:
- How to produce the required timing
- The actual data format to control them
It looks like the hspiout would be what I want, but I'm honestly completely confused when it comes to all this timing! Fastspi mode can achieve 1MHz, which seems to over satisfy the 800kHz data rate, but beyond that the whole timing thing starts going way over my head
2. So even if I'm able to produce the proper output data timing, I'm still not sure how to actually format the data. The datasheet does show a 24-bit data format, but I'm not exactly sure how to interpret it, nor does it say anything about address data.
From datasheet: 24bit composition R7 R6 R5 R4 R3 R2 R1 R0 G7 G6 G5 G4 G3 G2 G1 G0 B7 B6 B5 B4 B3 B2 B1 B0
I'm assuming since the TM1809 chipset uses the same data composition that this is a relatively common format, so I'm just hoping someone here might have some added insight on this.
Thanks for any help or info anyone can provide, and please don't be afraid to say I'm in way over my head Though likely it won't do much to detour me! hehe
Last edited: