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

Thread: Using DMXSimple and OctoWS2811 libraries together, possible hardware timer conflict?

  1. #1
    Junior Member
    Join Date
    Jun 2019
    Posts
    5

    Using DMXSimple and OctoWS2811 libraries together, possible hardware timer conflict?

    Dear all,

    I recently switched most from the Arduino Atmega platform to the Teensy platform as I was running into processing power limitations. And what a difference did that made! Wow! I had a teensy 3.0 from a kickstarter laying around but never used I was used to working with the Atmega....how stupid could I have been.. @Paul, if you read this and before prompting my question, I would like to thank you for all your hard work. Amazing hardware and integration in the Arduino platform!

    Without further ado. I am working on a 4D experience with Unreal doing the display part and a Teensy 3.5 (over serial) doing all the physical effects around that, and I am planning to use many LED strips and a smoke machine. The smoke machine requires DMX and for the Leds I opted for a circuit that would use the OctoWS2811 library (I used the exact adapter schematics (except for the sync part) because I wanted to have everything on one board and connect most of the external things with RJ45 connectors). But now I run into the potential issue that both the DMXSimple and OctoWS2811 library seem to use Hardware Timer 2. Before building the circuit I was wondering if this will give issues and if there is a hardware or software solution to tell one of the libraries to use a different timer? I believe I ran into a similar issue with the Atmega when I used DMX and a RF module together on similar hardware timers, and that did not work (but it might have been something different).

    I attached the proto schematics, but I guess this question is not so much a hardware issue per se. (Some connections are doubled, leading to external connectors, these are just for prototyping and won't actually be connected, and can be ignored)

    Thank you in advance for your input

    Edit: Added component names to schematic

    Click image for larger version. 

Name:	U4DX206MK.jpg 
Views:	21 
Size:	144.6 KB 
ID:	16742
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	U4DX206MK.jpg 
Views:	9 
Size:	144.3 KB 
ID:	16741  
    Last edited by Maru; 06-09-2019 at 10:39 AM.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,551
    Don't use DmxSimple. It's terribly inefficient (really designed for Arduino Uno). On this page, look for the 4 links to code using Serial to send DMX. All of those work much better, and without timer conflicts.

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

  3. #3
    Junior Member
    Join Date
    Jun 2019
    Posts
    5
    Dear Paul,

    Thank you so much for you quick response and feedback, absolutely amazing ! Currently looking into TeensyDMX.
    As I am not insanely versed when it comes to programming, but I understand that the following should work:

    1. I can use the schematics that I currently have: Using the MAX487 pin 4 connected to pin 10/TX2 on the Teensy ( I attached schematics of this)
    2. Use the following code to turn channel 4 to 255 to (I do not have the DMX at home, but it would be great to see if it could work before I start debugging on site):

    Code:
    #include <TeensyDMX.h>
    
    namespace teensydmx = ::qindesign::teensydmx;
    
    // Create the DMX sender on Serial2 - Pin 10.
    teensydmx::Sender dmxTx{Serial2};
    
    void setup() {
      dmxTx.begin();
      // Setting channel 4 to 255
      dmxTx.set(4, 255);
    }
    Because that would be even simpler than using SimpleDMX.
    The example code also includes the following about an enabling pin, but I cannot really figure out if this is necessary in my case (e.g. can I use this or should I reserve it if I use TeensyDMX):

    Code:
    // Pin for enabling or disabling the transmitter.
    constexpr uint8_t kTXPin = 17;
    
    void setup() {
      // Set the pin that enables the transmitter
       pinMode(kTXPin, OUTPUT);
       digitalWriteFast(kTXPin, HIGH);
    }
    Apologies for what is perhaps a stupid question, but feedback is much appreciated (have to built some confidence in this, hehe ) .

    Click image for larger version. 

Name:	Screen Shot 2019-06-09 at 19.32.35.png 
Views:	12 
Size:	25.4 KB 
ID:	16746

  4. #4
    Junior Member
    Join Date
    Jun 2019
    Posts
    5
    One small question, does the OctoWS2811 support ws2813 Led strips? or only ws2811 and ws2812B? Thx

  5. #5
    Member
    Join Date
    Mar 2017
    Location
    Oakland, CA, USA
    Posts
    90
    Hi, Maru. I just noticed your post. You only need to use a TX-enable pin if your transceiver requires it. From your schematic, it looks like you don't need one. Your TX-enable pin is already driven high (pin 3).

    How is the library working for you? Are you able to successfully drive the LEDs and operate DMX?
    Last edited by shawn; 08-13-2019 at 06:46 AM.

  6. #6
    Senior Member crees's Avatar
    Join Date
    Dec 2016
    Location
    Utah
    Posts
    167
    Quote Originally Posted by Maru View Post
    One small question, does the OctoWS2811 support ws2813 Led strips? or only ws2811 and ws2812B? Thx
    I have driven ws2813 LEDs without issue on the octows2811.

  7. #7
    Junior Member
    Join Date
    Jun 2019
    Posts
    5
    Quote Originally Posted by shawn View Post
    Hi, Maru. I just noticed your post. You only need to use a TX-enable pin if your transceiver requires it. From your schematic, it looks like you don't need one. Your TX-enable pin is already driven high (pin 3).

    How is the library working for you? Are you able to successfully drive the LEDs and operate DMX?
    Hi shawn, thanks for your reply! The library is absolutely fantastic and has been working flawlessly together with the FastLED library on the above schematics. I kept the TX-enable pin free, but I did indeed not need it.
    I did have some issues with the SimpleDMX library from time to time (on a Mega), but with the TeensyDMX library, I have yet to accounter any. Thanks for your great work! !
    I'm convinced and moved all my prototyping to the Teensy platform (will try to populate a board by myself soon, seems doable), so Paul, also thanks for all the work you have been doing and congrats on the 600MHz monster!

    Click image for larger version. 

Name:	IMG_3357.jpg 
Views:	4 
Size:	102.0 KB 
ID:	17221

  8. #8
    Junior Member
    Join Date
    Jun 2019
    Posts
    5
    Quote Originally Posted by crees View Post
    I have driven ws2813 LEDs without issue on the octows2811.
    That's great to hear, thank. Would you happen to know the advantages of using the OctoWS2811 library instead of the FastLED library?

Posting Permissions

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