Anybody hooked up an AVR to WS2812 RGB LEDs?

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I just started looking at these guys and wrote some preliminary code yesterday (on paper, haven't gotten around to testing it). Anybody else playing with them?

Here's the datasheet for the WS2812B, which is the latest revision of the chip. FWIW, the 2812 is an RGB LED with the WS2811 LED driver chip onboard the LED itself.

http://www.mikrocontroller.net/a...

Assuming an 8MHz internal oscillator AVR, it appears that I can come up with timing well within specs, so I expect it would work just fine. I'll post my code when I've actually compiled/assembled it, but in the meantime I was wondering if anybody else was working with these things.

So far it looks like (using an asm function) I can hit 6/4 (for a 1) or 4/6 (for a 0) clocks for the first 7 bits, while on the 8th I can hit 6/4 and 4/7.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have a few on my desk, but I haven't got round to doing anything with them yet.
Sometimes work gets in the way.

John

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yeah, I bought one of the 30/meter strips. You can just cut off as few or as many as you want to play with. I'll see if I can get some lit up in the next day or two.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

http://bleaklow.com/2012/12/02/d...

http://www.instructables.com/id/...

And there is another one where the person is cycle counting and state watching to do a simpler/sensible RGB order one at 8mhz.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Adafruit has written an Arduino library for them. I have 100 or so coming from Ray Wu.

Cheers,

Ross

Attachment(s): 

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Success! After I figured out how to call an ASM function from C, I've got the bit-banging working at 800kHz on an 8MHz AVR, with 3/7 7/3 timing. Seems to work fine with the LEDs I have. It's fun to revisit ASM every once in a while.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Some of the Teensy2 and Teensy3 users are fiddling with those WS2812B LEDs.
http://forum.pjrc.com/forum.php

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The arm based Teensy uses a neat trick with timers and 3 DMA channels to drive LED strings with very low processor overhead. Handy if you want to drive lots of LEDs and do some animation. Might not be very ram efficient for just one string.

https://www.pjrc.com/teensy/td_libs_OctoWS2811.html

I wonder if any of the xmegas with DMA could do the same.

-carl