octows2811 to decaws2811

Status
Not open for further replies.

cdorety

Member
Helo all,

I am new to the forum. I found the Teensy 3.0 recently and have been using it to control ws2811 LEDs.

The Octo library is awesome. Thanks Paul!!! I've modified it to read .raw image files of a uSD card and display the colors on LEds. This allows me to capture video into .raw (using some custom processing and/or open frameworks code) or draw images in Photoshop. I do this rather than video over serial because my projects are stand-alone. I don't want my objects tethered to a computer. It's all fully embedded.

Here's some video of my 1st Teensy project: http://youtu.be/tF-SozS6g0Y

It's a 5.5' spider from the 29th century.

Anyhow. The spider has 8 legs, but it also has two strips of LEDs in the body. Rather than run a data wire from the end of two legs, back through the legs and into the body (to extend two of the strips), I'd like to add two additional outputs to the Octo library. Outputs 3, 22 and 23 are available, but I can't figure out how to modify the code such to achieve this goal.

Any ideas?

thanks so much, and power to the teensy!

--Craig
 
OctoWS2811 is designed for exactly 8 outputs. It uses the DMA engine to automatically move 8-bit bytes from a buffer in memory to the I/O port register.

If you want to do a LOT of fiddling, there is one of the native ports with 12 bits available as I/O pins. Refer to the schematic and/or core_pins.h. So you might be able, with a lot of fiddling, to change the DMA channels to move 16 or 32 bit words instead of 8 bit bytes. That will double of quadruple the memory required for the same strip lengths. Then you'd need to change the code which writes to the buffer to know about the 16 or 32 bit word size, and which of those bits actually correspond to I/O pins and which aren't implemented.

This type of work should be done with a digital scope viewing the output waveforms, relative to the PWM signals, with infinite or long display persistence. In theory, just altering the bus width shouldn't change any timing, since the internal bus is 32 bits. Still, any tweaking to the DMA settings should be done with careful verification of the waveform jitter over a long period of usage. OctoWS2811 is most definitely NOT like most Arduino libraries that can be casually edited and tweaked.

EDIT: also, the display buffer (the one with "DMAMEM" attribute) should be allocated entirely within the first 8K of RAM. Check the linker's output to confirm (this is where the 1000 max LEDs recommendation comes from). The RAM has 2 separate buses, allowing CPU and DMA to simultaneously access memory, as long as they're not trying to access the same half during the same clock cycle. If any part of that display buffer is in the upper half of the RAM, there will be more bus arbitration as the CPU makes heavy use of the stack during interrupts, function call/return and accessing local variables that the compiler spills from the registers.
 
Last edited:
Status
Not open for further replies.
Back
Top