DMX512, RDM send/recv library - DMX512 送受信ライブラリ

DMX512, RDM send/recv library

DMX512 is protocol for lighting.

RDM (Remote Device Management) にも少し対応しました。(2017/10)

http://www.sugakoubou.com/doku/_media/dmx/dmx512.png
RS-485

Serial port: p9, p10 or p13, p14 or p28, p27

Schematic

blockdiagram

	+--------+       +5V
	|        |        |
	|        |        |    LTC490    +[120]+  *option
	|        |        |   +--__--+   |     |
	|        |        +---|1    8|---+-----|---(3 Rx) DMX in XLR 5P male (rx)
	|  mbed  |RXD---------|2    7|---------+---(2 Rx)
	|        |TXD---------|3    6|-------------(2 Tx) DMX out XLR 5P female (tx)
	|        |        +---|4    5|-------------(3 Tx)
	|        |        |   +------+
	|        |        |             +----------(1 Rx)
	|        |GND-----+-------------+----------(1 Tx)
	+--------+ 

blockdiagram(RDM)

	+--------+                      +5V
	|        |                       |
	|        |             LTC485    |
	|        |            +--__--+   |   +[120]+  *option
	|        |RXD---------|1    8|---+   |     |
	|  mbed  |XMIT----+---|2    7|-------+-----|---(2) DMX in/out XLR 5P
	|        |        +---|3    6|-------------+---(3) DMX in/out XLR 5P
	|        |TXD---------|4    5|---+
	|        |            +------+   |
	|        |                       |
	|        |GND--------------------+----------(1 Tx)
	+--------+ 

Download

Import libraryDMX

DMX512, RDM send/recv library http://mbed.org/users/okini3939/notebook/dmx512

Sample

Import programdmx_test

DMX512 library test http://mbed.org/users/okini3939/notebook/dmx512

Example

#include "mbed.h"
#include "DMX.h"

DMX dmx(p9, p10);

int main() {
    dmx.start();
      :
    dmx.put(0, 255);
      :
    i = dmx.get(0);
      :
}

RDM デバイス・ホストのサンプル

Import programDMX_RDM_test

DMX512, RDM test see: https://os.mbed.com/users/okini3939/notebook/dmx512/

Movie

VR -> (analog in) mbed (serial tx) -> Dimmer

DMX Controller -> (serial rx) mbed (pwm out) -> LED

This baseboard is "mbeduino"

Base board

mbed DMX Platform - DMX512プラットフォーム

Note

  • send break: LPC_UARTn->LCR |= (1 << 6)
  • recv break: LPC_UART3->LSR & ((1 << 7)|(1 << 3)|(1 << 4))
  • DMX出力をレジスタ直アクセス(高速)にする場合は #define DMX_DIRECT する。

Acknowledge

  • 送信時、最後のチャンネルのデータが途中で途切れる不具合修正(2011-06-13、感謝 Koichi Shibata様)
  • 512チャンネルに満たないDMX信号の受信不具合修正(感謝 Koichi Shibata様)


8 comments on DMX512, RDM send/recv library - DMX512 送受信ライブラリ:

27 Feb 2012

Hi, I´m very interested in the Base Board, but i´m not able to get it from the shop of the link, and i can not find it anywhere else... someone who knows where to get it?

17 Feb 2014

Hello,

Thank you for this library, I've been able to get this up and running without too much delay. My question is, if I want to control a single DMX light using a 2 channel mode, can I use this library to do that?

How would I specify data for each channel?

Thank you, Julie

I had a special moment there... Of course the channels are specified using the address. In case anyone else's brain melts slightly when doing DMX, here's how it's done...

If your light is set to a 2 channel mode at address 1, then address 1 (0 in this code) is channel one and address 2 (1 in this code) is channel two for the light.

17 Feb 2014

Hi, What is the 2 channel mode? For example, some moving lights have Pan/Tilt and Pan/Tilt Fine. Address 1: Pan (or Tilt), Address 2: Pan Fine (or Tilt Fine)

int n = 12345; /* 0-65535(256*256-1) */
dmx.put(0, n >> 8);
dmx.put(1, n & 0xff);

Are you sure about this?

06 Dec 2014

Sumimasenkedo FRDM-KL25Z wotsukaukara _uart ga naindesu

Error: Identifier "_uart" is undefined in "DMX/DMX.cpp", Line: 82, Col: 9

"RX" to "TX" wo tsukau hoo ga ii to omou kedo, bokiniwa, muzukashii desu.

Is there an easier way to do this, using just the UART, or do I need to scour the documentation for my board?

21 Aug 2016

Hi I'm struggling a bit to get a working receiving example to work. Would anyone be able to show me a simple single channel receiver code. For example controlling an led via PWM 0-255? Also as an extension to that if anyone has a good idea on how to do 16bit values over two dmx channels with this library.

Thanks very much, Alex

15 May 2017

<<quote jldpaula>> Hi, I´m very interested in the Base Board, but i´m not able to get it from the shop of the link, and i can not find it anywhere else... someone who knows where to get it? <</quote>>hello, what do you mean about base board? it is dmx512 led strip?

22 May 2017

<<quote alvin666>> <<quote jldpaula>> Hi, I´m very interested in the Base Board, but i´m not able to get it from the shop of the link, and i can not find it anywhere else... someone who knows where to get it? <</quote>>hello, what do you mean about base board? it is dmx512 led strip? <</quote>>yeah, and how can write the code? it is difficult for me. Every ic have it is address,right? If write the addess,1-50,then,start from 52 is ok? appreciated your help.

14 Jul 2018

Hi, I'm trying to use your library in a bridge between ethernet ArtNet and DMX over 485. I noticed some problem when using standard mbed "EthernetInterface.h". Watching with an oscilloscope the 485 signal is different when using ethernet functions and my parled light has a DMX connection led flashing (it flashes when there is no DMX connection). In my case, parled works correctly, but due to connection led flashing I think there are some issues. Might be some interrupt conflicts? I'm using LPC1768.

Thanks.

Please log in to post comments.