View Full Version : Receive and re-tranmit DMX with Arduino?
cadomanis
12-19-2010, 04:24 PM
I am working on a project where I need to sample an incoming DMX stream, and then send it out onto a new stream having altered the data. The application is to run some LED strings where each LED requires three channels. For this application I don't need such fine control and would like to be able to use three channels as opposed to 96 for each 32 LED string.
There seems to be excellent code examples for both transmit and receive, but I can't tell if they will run well together. I have seen a commercial unit that does this using 2 PIC chips that appear to pass the DMX data via IO - have 8 lines run between the two chips with one wired to receive circuit and one wired to transmit circuit.
Any thoughts if one Arduino is up to the task. Anyone done something like this?
Thanks for any feedback?
Chuck
dmcole
12-19-2010, 04:49 PM
Any thoughts if one Arduino is up to the task. Anyone done something like this?
Chuck:
Welcome to DIYC. You'll find a lot of really great people here.
I may have insight into your application, as I have proto-boarded DMX reception on a Arduino Duemilanove. I didn't get very far in this project, so I'm not going to be able to give you definitive answers.
I have used three different DMX reception code bases and found the version detailed in this link to be the most efficient:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1223117506/16
I have been able to successfully drive (and dimmed) six individual LEDs from this code and, after using the Alex Leone TLC5940 library, have driven as many as 16 LEDs with this code.
My sense is that there is not a lot of headroom left in the 328 after this code is operational. I could be wrong and there's a possibility that with some efficient coding, you might be able to strip out what you want and pass along the remainder of the string, but you would need to use some pins other than the UART, as those will be already taken by the receiver.
The fact that a similar device requires two PICs doesn't hearten me toward the notion that there's enough room here to do the whole thing in a single AVR chip, but maybe those designers weren't as clever as you (or as clever as the Arduino community combined).
As I always like to point out, the Arduino is three different types of technology -- the IDE, the bootloader and the hardware platform. There's nothing preventing you from leveraging the first two technologies and designing your own hardware, meaning that you could build this with two chips but one power supply (I have two projects in mind for 2011 that will do something similar).
HTH.
\dmc
P. Short
12-19-2010, 09:57 PM
I don't think that you can make any useful capacity assessments based on a design using two PICs. I think that the interprocessor-communications overhead would make it very difficult in almost any situation to get better performance out of two PICs than out of one.
Entropy
12-20-2010, 11:27 AM
Depending on exactly what sort of conversion he wants to do (just mirror three channels out to all 96 so all LEDs light up the same? Why not just get the far cheaper "analog" LED strips?), it should be easily within the realm of an ATMega328, with ONE exception:
The 328 has only one UART. You need two for this (one in, one out).
Even though technically you only need the Rx side of one and the Tx side of another, trying to "split" a UART like this is likely not possible.
n1ist
12-20-2010, 05:10 PM
The big challenge with spltting a UART is that they share the data register UDR0. You are probably better off to going with the ATMega324, which has two UARTs.
/mike
cadomanis
12-20-2010, 08:01 PM
Thanks for the feedback.
I already have the LED strings so not an option to change. they are some commercial units made by Traxon. We also have all the power supplies and distributors they make to go with them. Drag is that every power supply can run 5 strings and so takes an entire DMX universe. The application I am looking out I need control of about 50 strings - so 10 DMX universes. With my re-patched version, each string needs only 3 channels so 150 channels total. Thanks for the idea.
I sort of figured that splitting the USART would be a problem. I ma thinking for the cost, I can just go to and arduino MEGA 2560 and so would have 4 USART available.
That being said, anyone see any other reasons this shouldn't work? Anyone have AVR DMX transmit code that they feel is reliable?
Thanks,
Chuck
Entropy
12-20-2010, 08:10 PM
DMX Receive - Look for Henne's examples. I'm "on the go" so can't link at the moment.
DMX Transmit - Look at the firmware source code for RPM's DMX dongle. His is in ASM I think though. mrpackethead was working on alternate C firmware but I haven't actually seen it materialize yet.
Powered by vBulletin® Version 4.1.10 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.