DMX physical layer questions (building a DMX receiver using an FPGA)

Hello folks!

It's my first post in here and this board seems to have a lot of very good material!
I have a few specific questions at the end, but in order to get there i feel i need to first tell the whole story of what i've been trying to do in the past weeks and what i've learned in the process. I'm thankful for any hints and please do correct me if i've come to the wrong conclusions!

I'm a computer engineer active in an amateur theatre group (have experience from running the lights and building scenery/props from the past four years).
This year we've built a cool "machine" which has a number of LEDs on it and a few DC motors (everything runs from a 12 V battery). I thought it would have been even cooler to be able to control it from the lighting console via DMX! :grin: So i looked up some stuff on the net and found this page: DMX decoder - Altera CPLD on how to decode DMX coming in via RS-232 with the help of programmable hardware. I fell for it, as I wanted to refresh my VHDL programming skills i hadn't used in a couple of years since school, and that meant i had an excuse to buy the Altera FPGA board we used for VHDL labs at uni, which happened to have an RS-232 port that could run at 250kbs.

I took the VHDL code provided, cleaned it up a bit and adapted it to my board (mostly because mine had a higher clock frequency). I started writing a testbench to test that the code worked correctly after my modifications (in Modelsim) and the DMX timing got me quite confused. That's how I found this site http://www.controlbooth.com/forums/...ing-rs-232-485-converter-box-dmx-program.html , which in turn sent me to DMX512 PAGE FROM Ujjal...details of DMX512 !! . With the latter's help I could figure out the DMX timing details and fix my testbench. I was happy the code seemed to work as it should in simulation, but i started to get more worried about the physical layer...

I had connected the 'Signal+' and 'ground' of the DMX cable to the 'Rx' and 'GND' of the RS-232 port respectively, assuming that was how the guy from "mad inventions" had done the same. But reading more about DMX physical layer (RS-485) I now realised the ground on RS-485 had little to do with the actual signal. I tried this connection with the lighting console at the theatre anyway, and as expected it didn't work. I also tried adding the needed 120ohm termination, and more unorthodox stuff like connecting the 'Signal-' of the DMX cable to the 'GND' of the RS-232 to no avail. After going back to http://www.controlbooth.com/forums/...ing-rs-232-485-converter-box-dmx-program.html (thread with good info, though a bit confusing at times), i gave up on any more "quick and dirty" fixes and decided to go for a propper signal level converter next time. That meant we ran the thing manually from backstage for that series of shows.

The next show is in a couple of weeks and I've been looking at commercially available RS-485 to RS-232 signal converters. The problem is I can't seem to find any capable of handling 250kbps, most go only up to 115200. The one or two that i found that went up to 230400 were quite expensive, which made me start to look more and more into DMX-to-USB converters, which in turn have the advantage of being designed to work with DMX from the beginning and I felt I could maybe also use for controlling lights from my laptop when we play in smaller venues.


There's where I stand now. The questions I need help answering are:

* First, do you know of any commercially available RS-485 to RS-232 converters that can handle 250000 BPS at a reasonable price?

* Second, does the "Enttec OpenDMX USB" do just the signal level convertion of the RS-485 signal and keep the original timing of the incoming DMX signal exactly as it is (effectively using the USB at 250kbps)? or does the timing change in any way?
If the answer is yes (as in it does keep the original timing), then, in an ideal world, i should be able to use the USB port of my FPGA board as input instead of the RS-232 and the VHDL code would work just the same, i hope...

* Third, I'm a bit in a dilemma here. The very reasons that make "Enttec OpenDMX USB" the right choice for the FPGA, make it less desirable for running shows from a laptop. I read the "DMX USB Pro" and the like have several advantages when running from a laptop (buffered output, isolation), but i would need to basically write a driver for it myself on the FPGA if I were to use it... Anybody knows if this is doable? Are there any good examples out there on how to do something similar? (I gave a fast look at http://www.enttec.com/docs/dmx_usb_pro_api_spec.pdf but i couldn't make much of it.)

Thank you for your help! It is very appreciated!
Joni
 
* First, do you know of any commercially available RS-485 to RS-232 converters that can handle 250000 BPS at a reasonable price?

The conversion isn't the problem. The most common UART chips don't support anything above 115 kbps. Nor do the OS drivers.
 
Use a 75176 or MAX485 to convert from RS485 to logic-level async serial to feed your FPGA. It's better than hacking RS485 to RS232 to logic-level.

The Enttec Open DMX is just a USB to serial converter chip from FTDI (which can run at 250kbaud) followed by a 75176. I wouldn't bother going that route since adding a USB host interface to the FPGA is going to be a lot of work.


/mike
 
Thank you for your answers!

Use a 75176 or MAX485 to convert from RS485 to logic-level async serial to feed your FPGA. It's better than hacking RS485 to RS232 to logic-level.

/mike

Oh, you mean just convert RS-485 to TTL and feed it directly to one of the FPGAs general purpose I/O pins, instead of going the long way via RS-232! That's genius :grin:, i like that!

Having a look at MAX3485 (since my FPGA inputs are 3.3V), looks pretty straightforward to use and they have it in my local electronics store. I'll definitely give that a go.

Thanks mike!
 

Users who are viewing this thread

Back