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

Thread: Teensy 4.0 with OctoWS2811

  1. #1

    Teensy 4.0 with OctoWS2811

    I'm using Arduino 1.8.11 / Teensyduino 1.50 with the Teensy 4.0 / OctoWS2811 Adapter Board. When I run the BasicTest I get the following error:

    Code:
    /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/OctoWS2811/OctoWS2811.cpp: In member function 'void OctoWS2811::begin()':
    /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/OctoWS2811/OctoWS2811.cpp:94:2: error: 'GPIOD_PCOR' was not declared in this scope
      GPIOD_PCOR = 0xFF;
      ^
    /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/OctoWS2811/OctoWS2811.cpp:177:19: error: 'GPIOD_PSOR' was not declared in this scope
      dma1.destination(GPIOD_PSOR);
                       ^
    /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/OctoWS2811/OctoWS2811.cpp:184:19: error: 'GPIOD_PDOR' was not declared in this scope
      dma2.destination(GPIOD_PDOR);
                       ^
    Error compiling for board Teensy 4.0.
    It looks like the OctoWS2811 library isn't currently supported by Teensy 4.0, is there a known workaround or plan to support OctoWS2811 in the future?

  2. #2
    Junior Member
    Join Date
    Oct 2013
    Posts
    6
    Have the same issue myself. Did you figure anything out?

  3. #3
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    6,331
    I was curious, so I thought I would take a quick look,

    Looks like this one would be a bit of a challenge and it is not something I have or use... Actually I think I did buy one in my last PJRC purchase, but...

    Some of the challenges associated with this include:
    The board is setup to use pins: 2, 14, 7, 8, 6, 20, 21, 5 on the T3.x (and LC) which maps to Port pins D0-D7 on T3.6/3.5 (did not look at others, but assume on same Port pins 0-7)

    Problem(s) with T4: These pins are not on the same port nor are there any 8 pins that are consecutive bits on the same port, nor does the T4 have 8 bit access to IO ports (access is 32 bits).
    These 8 pins are spread out like4.4, 1.18, 2.17, 2.16, 2.10, 1.17, 1.16, 4.8)

    So I don't see any obvious way to translate the DMA operations used in this library over to something that would work on T4.
    My guess is it would take a sort of rethink... For example if one has 8 pins on the same IO buss, could this could be setup to do DMA not to the Data register but only use the SET/CLEAR registers... Or if 8 pins were all on the same FLEX IO controller, could we setup to do this.. Note: would probably need to be FLexIO 1 or 2 as 3 does not have DMA...

    So sorry, I don't think I am much help here, probably needs someone like Paul who set this up originally.

  4. #4
    Junior Member
    Join Date
    Jan 2020
    Posts
    10
    It might not help you specifically since it isn't compatible with OctoWS2811, but Ward demonstrated a way to drive WS2811 strips using the FlexIO and some external shift registers:
    https://forum.pjrc.com/threads/59023...FlexIO-and-DMA

  5. #5
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,473
    I've committed code on github for OctoWS2811 on Teensy 4.0.

    https://github.com/PaulStoffregen/Oc...bf0a2d4c607f13

    This will be in Teensyduino 1.52, which will begin beta testing next week.

  6. #6
    Junior Member
    Join Date
    Jan 2020
    Posts
    10
    Awesome! Can you share a little about your method to provide output on an arbitrary set of 8 pins?

    It looks like you set up DMA to transfer 32 bits to each of GPIO1, GPIO2, GPIO3, and GPIO4 in sequence (as opposed to the T3 code which transfered 8 bits to a single GPIO) - is that correct?

  7. #7
    Junior Member
    Join Date
    Sep 2015
    Posts
    18
    Thanks! I was waiting for this! Directly upgraded two of the LED walls you can see in the video which were using OctoWS2811 on a T3.6 to a T4.0 and the increase in performance makes the animation run way smoother! It went from varying around 40 fps to maxing out at 140 fps (the limit for the amount of leds/strip I'm using). Thank you so much!
    https://youtu.be/cdfFI6miXMU

Posting Permissions

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