Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 7 of 7

Thread: Using OctoWS2811 with a single strand of LEDs

  1. #1
    Junior Member
    Join Date
    Mar 2014
    Posts
    6

    Using OctoWS2811 with a single strand of LEDs

    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

  2. #2
    Senior Member mortonkopf's Avatar
    Join Date
    Apr 2013
    Location
    London, uk
    Posts
    941
    You could use the FastLed (formerly fastspi_led) library as an alternative and so not tie up the other pins.
    http://fastled.io/

  3. #3
    Junior Member
    Join Date
    Mar 2014
    Posts
    6
    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.

  4. #4
    Senior Member mortonkopf's Avatar
    Join Date
    Apr 2013
    Location
    London, uk
    Posts
    941
    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.

  5. #5
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,092
    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.

  6. #6
    Junior Member
    Join Date
    Mar 2014
    Posts
    6
    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.

  7. #7
    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •