WS2812 RGB LED with integrated driver.

tony_g

Senior Member
http://www.picaxeforum.co.uk/showthread.php?22713-Getting-Started-with-the-WS2801-3-Channel-RGB-LED-Driver-with-PWM-output

heres a thread by westaus55 he posted a while ago for a different chip from the same manufacturer.

it looks like the principle of operation is similar for both of these, they need 24 bits of data, 8 per color and can be controlled to produce many different colors.

they can work with the picaxe and the link above to the other post will provide you with some code examples for a few different picaxe chips to get you started.
 

PaulRB

Senior Member
I think the answer is no, not without additional driver chips of some kind. The page on your link says they had to do some assembly coding on an avr microcontroller to achieve the speed of communication required, so bit-banging in picaxe basic will be out. Maybe if RevEd build a new command into a future firmware release (unlikely).

Paul
 

westaust55

Moderator
The driver is the WS2811 and it is a (form of) 1-Wire signal protocol for data transfer where:
Reset is low for >= 50us duration
A logic 0 is high for 0.5 us and low for 2 us –
A logic 1 is high for 1.2 us and low for 1.3 us
The above with a tolerance of 150 ns (0.15 us) total duration for logic 0 or 1 is 2.5 uS.

The data signal is uni-directional and simpler than the Dallas 1-Wire scheme but the timing. In approx figures, a PICAXE at 64 MHz can perform 1 BASIC program command in 15 usec. This suggests that a PICAXE cannot switch an IO fast enough to control the WS2811 LED driver chip.
 
Last edited:

PaulRB

Senior Member
Perhaps an attiny84 programmed with that code mentioned on the adafruit link and acting as an i2c slave could be controlled by a picaxe.
 

westaust55

Moderator
Here a thread for the Ws2812 parts
It all links to a thread I started for the lesser WS2801

http://www.picaxeforum.co.uk/showthread.php?24301-WS2812-RGB-LED-with-integrated-driver&highlight=Ws2812

If your application is looking to drive all 100 with the same output colour you might be able to consider some series/parallel and in parallel drive 10 strings of 10 LEDs.

But while the ws2801 and WS2803 were drivable a post I spotted by hippy suggest not the WS2812.
There are a number of threads mentioning the WS2812 so try a search of the forum.
 

hippy

Technical Support
Staff member
There are a number of threads mentioning the WS2812 so try a search of the forum.
APA102 - Easily controlled directly from any PICAXE.

WS2801 / WS2803 - Directly controllable by a fast enough PICAXE with appropriate code.

WS2811 / WS2812 / WS2812B / APA104 - Not controllable by PICAXE.

HL1606 / LPD8803 / LPD8806 - Uncertain

SK6812 / TM1804 / D7001 - Unknown

I am planning on creating a summary so it's all in one place which can be linked to and updated for future controller devices.
 

Volhout

New Member
Rev-Ed to do this

About WS2812

A 08M2 at 32 MHz can easily bit-bang a thread of WS2812B's. The timing is not very critical, except for the short <400nSec high time on the logical "1".
It is true that strings of (neo-) pixels start eating up a lot of memory, 3 bytes per pixel, and memory is not very abundant in pixaxes (the smaller ones especially).

It is strange however that Rev-Ed did not recognize this need. Especially in education, it is very simple and eye catching to offer RGB color LED support.
And you can do great things with a small 8pin package.....
I would not be surprised that in the next firmware version they add support.
It is simply not very difficult to add it. Only you need the speed of assembler, in combination with 32MHz clock while driving the WS281B2's.
Once done you can revert back to the energy efficient 4MHz clock.

Volhout

APA102 - Easily controlled directly from any PICAXE.

WS2801 / WS2803 - Directly controllable by a fast enough PICAXE with appropriate code.

WS2811 / WS2812 / WS2812B / APA104 - Not controllable by PICAXE.

HL1606 / LPD8803 / LPD8806 - Uncertain

SK6812 / TM1804 / D7001 - Unknown

I am planning on creating a summary so it's all in one place which can be linked to and updated for future controller devices.
 

hippy

Technical Support
Staff member
I would not be surprised that in the next firmware version they add support.
It might happen but with the APA102 devices being easy to control from any PICAXE there is less need to support WS2811 or WS2812.

As with anything we could add to the PICAXE it is a matter of making a business case for it, having a return on investment which justifies the effort of altering the firmware, updating the compilers and documentation, and testing.
 

premelec

Senior Member
@Volhout - If you have code that will drive the WS2812 please post it - perhaps the WS2812B is a different drive need? i was not able to get WS2812s to work and APA102s were my final success... thanks...
 

hippy

Technical Support
Staff member
@Volhout - If you have code that will drive the WS2812 please post it
I think Volhout was suggesting it would be easy to do for the PICAXE firmware; PICAXE programs could then do it if firmware supported it and there were Basic commands provided to do it.

If not; and it can be done today with an 08M2, I think we would all be delighted to see that code.
 

premelec

Senior Member
I suppose it might be possible in firmware... I had some discussion with a commercial builder of drivers who pointed out the timing was very picky - also the flicker rate is much lower than with the APA102 [unless you use the global dim function]. As you say we'd be happy to have some working code... maybe there is a 'B' model which has reduced some of the timing problems.

https://acrobotic.com/datasheets/WS2812B_VS_WS2812.pdf compares the B chip with original...
 
Last edited:

BESQUEUT

Senior Member
I have currently a project with more than 900 WS2813 LEDS.
I use a Teensy 3.6 + Octo as serial to LED Driver. (using quasi standard demo code ; I have to measure refresh time, but it is better than 30 times/s. I only use 4 channels so 4 are actually unused...)

Picaxe is used for user interfacing ; commands are send to Teensy via RS232.
 
Last edited:
Top