Shop OBEX P1 Docs P2 Docs Learn Events
Help with DMX receiving on PROP 1 project. — Parallax Forums

Help with DMX receiving on PROP 1 project.

Hi,

I need urgent help with getting DMX Data into my project.

Ive been using the dmx drivers..

a) jm_dmx_rx.spin
b) jm_dmxin.spin
c) DMX_Rx_Driver_Ver014.spin

1) I'm Designing and building an 8CH DMX control box with 8 x 240v outputs ( using SSR's)
(see attached images)

2) I have a simple 6 channel DMX controller box ( see attached image), that starts at channel 1 ( it has no option for adjusting the starting channel), It has 6 faders and a master fader, and i've used this on DMX lighting and it seems to work fine for simple testing, I also put the output of this device on the scope and it seems to output DMX data ok ( see attached image) I'm using this device for inputting dmx into my project for testing.

So far everything is working except my DMX input.

3) I'm using SPIN TOOLS on MAC, i have tried all the DMX drivers i can see in the OBEX, but i just can't get any results! I'm not an expert in DMX.

4) I'm also using CHATGPT to help with the code ( bad idea! ) sorry, but no matter what it or myself try, i'm not getting any "values" from the channels appearing on the serial terminal.

5) ChatGPT did create some code that uses only the Full_Duplex_Serial UART driver ( not a DMX driver) , and i did get the first 6 channels appearing very smoothly, but when we tried with any of the DMX drivers on the OBEX, i just get no results. or i just get 224 as a value returned.

6) I have check all my circuitry, yes i had some problems, but now i have made my modifications to my prototype PCB.

7) Attached is my schematic and layout images for the DMX section.

8) I have not done much PCB/ SPIN work for along time, so i am a bit rusty. I also don't know much about PASM.

9) I'm using the PROP FLIP module directly soldered to my PCB.

10) i do have a 120R terminating XLR plug on my DMX output.

11) i have also attached some files of my PCB, i did have the RS-485 RO line going to P26 of the FLIP, but i soon realised that's used in a LED on the flip module, so i cut that track and changed it over to P8 ( yellow mod wire you see in image), even after these changes i didnt see any improvement.

12) I'm using the SN65HVD485E driver chip for the RS485. attached is the data sheet.

So Can anyone advise to how i can simply test if the DMX data is being sent to my device and i can simply show the channel data on the terminal ( for now?) . I did get my scope to see the dmx on the screen, as i changed sliders i can see the data change, i'm not an expert, but i believe the output data from the DMX controller unit is ok. (see photo of scope)

The only help/advise i need is to test the DMX input to my board and display it in the serial terminal for now, the rest of my main code for the rest of the system is in another file and that was working fine, so when and if i get the DMX working i can add it to the main code later

Thanks

Dave M

Comments

  • JonnyMacJonnyMac Posts: 9,489
    edited 2025-10-20 23:33

    I'm probably going to regret chiming in... but since you're trying to use my driver, let me assure you that I have deployed it at Disneyland, Legoland, and it other odd applications (Halloween and escape rooms). Instead of a 'scope, connect a logic analyzer (to RO pin) and do a multi-second capture to see what's going on with your little dimmer board. I say this because I was using one of those to test an LED PAR light and had lots of problems. What I found was that the dimmer board only refreshed the DMX stream every second instead of every ~40ms as we normally expect. The LED PAR I had would timeout at 250ms which meant it never seemed to be working. Once I used my own DMX transmitter and was sending a properly-timed stream, the LED PAR worked just fine.

    My early first "professional" DMX programming was for Disneyland and they specifically asked for signal loss detection which is built into the start() method using and LED and a timeout period.

    pub start(rx, led, losms) : result
    
    '' Standard initialization of DMX receiver cog
    '' -- rx...... receive pin#
    '' -- led..... pin# to indicate dmx activity (-1 if no led used)
    '' -- losms... loss-of-signal timing in milliseconds
    
      return startx(rx, led, losms, 0, 0)
    
    

    Maybe your losms setting is too small for the DMX stream you're testing with.

  • Hi,

    Thanks so much for replying, I do belive that your dirver is good, and i did suspect my dmx controller is a bit flaky, although i have used it on other lights and no issues, so i will check for what you advised, regarding timing and loss off signal.

    Thanks for your advice.

    I was thinking of using another DMX controller a better one.. so i will try that too. i don't have a logic analyzer..

    Dave M

  • JonnyMacJonnyMac Posts: 9,489

    If a nice Saleae is not in the budget (they're expensive, but worth it), you can in fact get by with a $13 model from Amazon for simple signals like DMX.
    -- https://www.amazon.com/dp/B077LSG5P2

    I keep one of these in my computer bag because I don't like to take my Saleae when I travel. Don't scoff at the low price; while on Thanksgiving vacation a few years ago I was able to write a custom pixel driver for a forum member using this device and a P1 I had with me.

    Here's the output from my DMX TX object captured by the $13 LA using a nice piece of freeware called PulseView.

  • hey, oh that's cool, that chart is so easy to understand!

    so i guess you "sample" data for a while, then after you view it in the software, rather than analyzing in realtime?

    i can get this one.

    https://www.amazon.com.au/DIGISHUO-Analyzer-Device-Ferrite-Channel/dp/B0CQBZQN11/

    and i think pulseview is available for mac? although i have never used such device or software, it might be worth looking into this as i will have a few DMX projects

    https://sigrok.org/wiki/Supported_hardware#Logic_analyzers

  • JonnyMacJonnyMac Posts: 9,489
    edited 2025-10-21 18:35

    so i guess you "sample" data for a while, then after you view it in the software, rather than analyzing in realtime?

    Yes. In PulseView and other LA software you can connect protocol analyzers that will got through the signal and give you details as shown in the screencap above.

    and i think pulseview is available for mac?

    -- https://sigrok.org/wiki/Mac_OS_X

    Do a search on YouTube -- you'll find tutorials on how to use logic analyzers; even those cheap units. This one is old, but clear.
    --

  • JonnyMacJonnyMac Posts: 9,489
    edited 2025-10-21 19:22

    It turns out that the Logic 2 software from Saleae will detect my cheap LA and use it within the device's constraints. This is good to know for road trips when I leave my nice Saleae LA at home.

    Same DMX as shown with PulseView yesterday:

    There are versions for all three major OSes.
    -- https://www.saleae.com/pages/downloads

  • Hi,

    well i ordered a LA form amazon, i should get it today!

    so will be interesting to check my signal from my cheap dmx controller

    and yes, i have been looking at some videos of analyzing DMX signals, i shal check out the link you sent

    i liked this one..

  • JonnyMacJonnyMac Posts: 9,489
    edited 2025-10-22 21:34

    DMX is really very easy; it's 250kBaud (N82) serial with a break condition (low pulse of 88+ microseconds) at the beginning of the packet/frame to resync all the receivers. This is followed by the Mark-After-Break (MAB) that should be at least 8us. My DMX TX code uses 92us BREAK timing and 12us MAB timing as recommended in the DMX specification. My DMX RX code is able to detect breaks at any time which allows for short frames (that is, less than 512 slot bytes).

    Note that the video demonstrates that using a logic analyzer to look at the DMX packets is easier than using a 'scope.

    For all the garbage on Wikipedia, this is a pretty good resource: https://en.wikipedia.org/wiki/DMX512, especially the protocol and timing sections.

Sign In or Register to comment.