Using OctoWS2811 with a single strand of LEDs

Status
Not open for further replies.

bill.pugh

Member
I'm using OctoWS2811 with a teensy 3.1 for a Burning Man project, controlling a strip of 230 LEDs (both OctoWS2811 and teensy are great, by the way, thanks).

For various wiring reasons, it doesn't make sense to split this up into 8 separate strips. Instead, we're just using the LED Strip #1 pinout and leaving the others unconnected.

This works fine, although it does consume 7 extra pins. I was took a look at the code, to see if there might be a way to tell/change OctoWS2811 library to just use one output pin for DMA, and free up the other pins for other purposes. I saw the reference:

// configure the 8 output pins
GPIOD_PCOR = 0xFF;

and I was wondering if changing GPIOD_PCOR, perhaps to 0x1, might just enable one pin for DMA output, leaving the other pins available for other purposes. Totally a shot in the dark, and not really needed, but if that was all it took, it might be nice to do (I realize this wouldn't change the size of the required memory buffers). Sorry, but I couldn't find a reference explaining GPIOD_PCOR.

Thanks,
Bill
 
Thanks. Looking into FastLed. One of the key issues for us is that we can't disable interrupts for the time required to send out the signals for the strip (about 7ms). Looking to verify this bit of information, but if anyone could provide me with that key bit of information, it would be helpful.
 
You could email Daniel Garcia directly about it if you can't find answers in the documentation, he has been very helpful at responding in the past. danielgarcia at Gmail dot com, I think. But doing a quick read, interrupts are disabled, so sorry, a no go.
 
You can find documentation for GPIOD_PCOR on page 1336 of the reference manual.

http://www.pjrc.com/teensy/K20P64M72SF1RM.pdf

The main thing you can't change is DMA channel #2 writes to 8 bits of GPIOD_PDOR.

You might be able to use those 7 pins as their alternate non-GPIO functions, or maybe even as inputs. But if the pin configure mux (documented in chapters 10 & 11) configures the pin to be controlled by GPIO and it's in output mode, it's going have the GPIO output register overwritten by the DMA.
 
Yeah, just verified, interrupts are disabled. Not really a surprise, you need something special like DMA to get a signal that precisely timed without disabling interrupts.
 
I too have this problem, because I want to use DMA to write to an LED string, while at the same time using the totally awesome prop shield AND possibly an sdcard as well. (The Wiz8xx+sdcard shield.)

I have the OctoWS part paired down to only write to one string with no problem. I just inverted the bits in setColor and made DMA#2 write to GPIOD_PCOR instead. :)

However, I still have a problem; The OctoWS library uses pin 3, 4, 15 and 16. While somewhat wasteful, only pin 4 currently poses a problem for me, because it conflicts with the sdcard chip select on the Wiz8xx+sdcard shield.) It looks like it might be possible to use another pin, like say pin 17 instead, since it can trigger the same timer operation, but I'm missing something, because it doesn't work. I can post the code if you don't mind taking a look.

Alternatively, would it be possible to use the KINETISL code on a teensy 3.2? Using timers seems better than using pins to me, but if that was true, why are there two versions of the code?
 
Status
Not open for further replies.
Back
Top