Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

RS485 to DMX512 conversion. Help needed.

Solved!
Go to solution

Hello everyone,

 

I'm trying to simulate the DMX512 protocol using the hardware above, to try and control a RGB light, with no success. I'm hoping you guys can help me.

 

 

Hardware:

cRIO-9075 CompactRIO Controller

NI-9871 4-Port, RS485/RS422 C Series Serial Interface Module

RJ50 to DB9 converter from NI

Compact Par 7-3 RGB light (Dutch manual, sorry) (For testing only, the main application will contain more DMX hardware)

 

 

DMX512 protocol:

https://en.wikipedia.org/wiki/DMX512

 

Protocol.jpg

Baudrate = 250kbaud

 

 

The content of a frame comprises a set of serial bytes (slots) sent with eight bits of data, one start bit, two stop bits. The frame starts with slot 0 and ending with the last implemented slot, with a maximum total of 512 slots.

 

The frame composition of a n-byte DMX Frame may be summarised as:

  1. Break
  2. Mark After Break (MAB)
  3. Start Code
    1. Start bit
    2. Start Code (8-bit Value)
    3. Stop Bit
    4. Stop bit
  4. Mark time before 1st data slot
  5. For count := 1 to n ( Max. n of 512)
    1. Start bit
    2. 8-bit Slot Value
    3. Stop Bit
    4. Stop bit
    5. Mark time between slots

 

 

FPGA Implementation:

 

ModuleProperties.png

 

BlockDiagram.png 

FrontPanel.png

 

 

 

Measurement:


PinLayout.png


Scope.png

 

 

 

 

I'm measuring pin 8 and pin 9 each with a probe, on the DB9 connector. I'm fairly confident that I have the shape of the DMX protocol correct from previous testing. What you are seeing here are the 2 stop bits of each frame with 00h as data. From my understanding of RS485, one of the signals on the scope should be inverted. I think this is the reason that my RGB light does not react on the signal that I'm sending to it. 

 

Am I'm doing anything wrong here? Smiley Sad Please help. Kudos will be given. Thank you. 

 

0 Kudos
Message 1 of 2
(6,055 Views)
Solution
Accepted by topic author Freel

I solved the problem. It is important to note that the RJ50 to DB9 converter from NI is used in combination with TEDS and is NOT a one to one convertor. This was the reason that my signals on my scope were not what I expected.

 

To create the DMX protocol on an FPGA using the NI-9871 module, you can use this code:DMX.png

 

9871_Prop.png

 

0 Kudos
Message 2 of 2
(5,973 Views)