Ethernet to DMX512

by 보현방 in Circuits > Microcontrollers

4214 Views, 11 Favorites, 0 Comments

Ethernet to DMX512

dmx-controller-105465-5011941.jpg

Let me tell you how to implement the Ethernet to DMX512 using W5500 and FreeRTOS effectively.

Stuffs That Have to Prepare.

IMG_4834.JPG
ethernet2dmx512.png

1. Any board containing the MCU and W5500.

My custom board that I prepared has the STM32f103VC(cortex m3) and Wiznet W5500 TCP/IP IC.

If you want, e-mail to me. I will send everything to you(pads schematic, artwork file and gerber file)

My e-mail address: bangbh@gmail.com

2. IDE.

Whatever you want but have to fit into your platform(board). I used CoIDE.

3. Source code

https://github.com/bangbh81/EthernetDMX512

Compile and Download to Flash.

freeRTOSlogo.jpg
freeRTOSdirectory.PNG
critical.PNG
DMXtask.PNG

1. Maybe my source code is not compatible with your platform(board). So you have to change the source code. My source code is for reference only.

Source code has 3 tasks. DMX512 task, TCP task and time task.(time task is meaningless.)

2. Compile and download.

Test

IMG_4907.JPG
75176.jpg
DMX_Frames.jpg

1. In actually, DMX512 protocol is just 250kbps, 2 stop bits oneway uart communication. And hardware interface is RS-485. Therefore you have to check waveform of uart tx pin.

2. It's impossible to check full waveform of dmx512, because a packet of dmx512 is 513bytes. Just check only the beginning of packet.

3. Ethernet protocol is very simple. TCP task run as a TCP Server and TCP Data is just 5bytes.

STX(1) - DMX512 address(2) - DMX512 data(1) - ETX(1)

EX) Address: 5, data: 0xff => 0x02|0x00|0x05|0xff|0x03

You can test it any TCP Tool like a hercules.

4. If you want implement dmx512 perfectly, add RS485 transmitter IC to the circuit.