Shop Learn
DMX protocol levels — Parallax Forums

DMX protocol levels

The logical level of DMX communication is built upon serial sending with 250.000 baud according the RS-485 definition using no parity bits and 2 stop bits.

Can someone give me a quick example of what this might actually look like sending?
im using "C" simpleIDE.


thanks for any help.


  • JonnyMacJonnyMac Posts: 7,742
    edited 2021-09-30 23:13

    If you have your output assigned to a standard serial driver you won't be able to issue the required break (92us minimum per spec) -- the serial driver will hold the pin high in the idle state. It's best to use a dedicated driver, especially since DMX out is one direction and doesn't require bouncing between TX and RX. You're welcome to lift the PASM code from the attached object which I've deployed at Disneyland, Legoland, and in many other places (i.e., it's well tested). Sorry, I don't know how to convert a Spin object to a C library, but others do and can help you.

    This project uses that driver. The P1 is a DMX master controlling the output from several DMX "bricks" from a lighting company. The DMX output array is updated by five animation cogs that handle the various elements (four trees, bear, girl).

  • JonnyMacJonnyMac Posts: 7,742
    edited 2021-09-30 18:39

    Another thought: You can use the FlexProp compiler to write your program in C and include Spin objects. This code compiles with FlexProp, but I didn't try to run it.

    #include <stdio.h>
    #include <propeller.h>
    #define TX  20
    #define TXE 21
    unsigned char dmxbuf[513];
    struct __using("jm_dmx_tx") dmx;
    void main()
        dmx.start(TX, TXE, dmxbuf);
        while(true) {
          // light 'em up, Danno!
Sign In or Register to comment.